diff --git a/backend/assets/fonts/DejaVuSans-Bold.ttf b/backend/assets/fonts/DejaVuSans-Bold.ttf new file mode 100644 index 00000000..22987c62 Binary files /dev/null and b/backend/assets/fonts/DejaVuSans-Bold.ttf differ diff --git a/backend/assets/fonts/DejaVuSans.ttf b/backend/assets/fonts/DejaVuSans.ttf new file mode 100644 index 00000000..3259bc21 Binary files /dev/null and b/backend/assets/fonts/DejaVuSans.ttf differ diff --git a/backend/go.mod b/backend/go.mod index 553fcd36..557da1df 100644 --- a/backend/go.mod +++ b/backend/go.mod @@ -5,6 +5,7 @@ go 1.23.0 toolchain go1.24.2 require ( + baliance.com/gooxml v1.0.1 github.com/arran4/golang-ical v0.2.7 github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/digitalocean/godo v1.19.0 @@ -15,7 +16,9 @@ require ( github.com/h2non/filetype v1.0.10 github.com/joho/godotenv v1.5.1 github.com/minio/minio-go v0.0.0-20190523192347-c6c2912aa552 + github.com/nguyenthenguyen/docx v0.0.0-20230621112118-9c8e795a11db github.com/patrickmn/go-cache v2.1.0+incompatible + github.com/phpdave11/gofpdf v1.4.3 github.com/spf13/viper v1.4.0 go.mongodb.org/mongo-driver v1.5.1 golang.org/x/oauth2 v0.30.0 diff --git a/backend/go.sum b/backend/go.sum index f6e224e3..10784e8a 100644 --- a/backend/go.sum +++ b/backend/go.sum @@ -1,3 +1,5 @@ +baliance.com/gooxml v1.0.1 h1:fG5lmxmjEVFfbKQ2NuyCuU3hMuuOb5avh5a38SZNO1o= +baliance.com/gooxml v1.0.1/go.mod h1:+gpUgmkAF4zCtwOFPNRLDAvpVRWoKs5EeQTSv/HYFnw= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= @@ -55,6 +57,7 @@ github.com/aws/aws-sdk-go v1.34.28 h1:sscPpn/Ns3i0F4HPEWAVcwdIRaZZCuL7llJ2/60yPI github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= @@ -207,8 +210,6 @@ github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e h1:JKmoR8x90Iww1 github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/handlers v1.4.2 h1:0QniY0USkHQ1RGCLfKxeNHK9bkDHGRYGNDFBCS+YARg= github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= -github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw= -github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= @@ -237,6 +238,7 @@ github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/X github.com/jtolds/gls v4.2.1+incompatible h1:fSuqC+Gmlu6l/ZYAoZzx2pyucC8Xza35fpRVWLVmUEE= github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= @@ -270,6 +272,8 @@ github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyua github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/nguyenthenguyen/docx v0.0.0-20230621112118-9c8e795a11db h1:v0cW/tTMrJQyZr7r6t+t9+NhH2OBAjydHisVYxuyObc= +github.com/nguyenthenguyen/docx v0.0.0-20230621112118-9c8e795a11db/go.mod h1:BZyH8oba3hE/BTt2FfBDGPOHhXiKs9RFmUvvXRdzrhM= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= @@ -277,6 +281,9 @@ github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTK github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.7.0 h1:7utD74fnzVc/cpcyy8sjrlFr5vYpypUixARcHIMIGuI= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= +github.com/phpdave11/gofpdf v1.4.3 h1:M/zHvS8FO3zh9tUd2RCOPEjyuVcs281FCyF22Qlz/IA= +github.com/phpdave11/gofpdf v1.4.3/go.mod h1:MAwzoUIgD3J55u0rxIG2eu37c+XWhBtXSpPAhnQXf/o= +github.com/phpdave11/gofpdi v1.0.15/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -300,6 +307,7 @@ github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= +github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= @@ -406,6 +414,7 @@ golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EH golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= diff --git a/backend/src/models/template.go b/backend/src/models/template.go index 91bdf7c9..69de6c3b 100644 --- a/backend/src/models/template.go +++ b/backend/src/models/template.go @@ -9,8 +9,9 @@ type Template struct { // template's ID (_id of mongodb). ID primitive.ObjectID `json:"id" bson:"_id"` - Name string `json:"name" bson:"name"` - Url string `json:"url" bson:"url"` + Name string `json:"name" bson:"name"` + Url string `json:"url" bson:"url"` + Event int `json:"event,omitempty" bson:"event,omitempty"` Requirements []Requirement `json:"requirements" bson:"requirements"` Kind string `json:"kind" bson:"kind"` } diff --git a/backend/src/mongodb/init.go b/backend/src/mongodb/init.go index 8e7d102e..46d6bfd0 100644 --- a/backend/src/mongodb/init.go +++ b/backend/src/mongodb/init.go @@ -215,7 +215,7 @@ func InitializeDatabase() { _, err = Templates.Collection.Indexes().CreateOne( context.Background(), mongo.IndexModel{ - Keys: bson.D{{Key: "name", Value: 1}}, + Keys: bson.D{{Key: "event", Value: 1}, {Key: "kind", Value: 1}, {Key: "name", Value: 1}}, Options: options.Index().SetUnique(true), }, ) diff --git a/backend/src/mongodb/template.go b/backend/src/mongodb/template.go index c5b6fc2e..5a38afbf 100644 --- a/backend/src/mongodb/template.go +++ b/backend/src/mongodb/template.go @@ -109,10 +109,9 @@ func (t *TemplateType) GetTemplates(tempOptions GetTemplatesOptions) ([]*models. ctx := context.Background() filter := bson.M{} - elemMatch := bson.M{} if tempOptions.EventID != nil { - elemMatch["event"] = tempOptions.EventID + filter["event"] = *tempOptions.EventID } if tempOptions.Name != nil { @@ -147,3 +146,37 @@ func (t *TemplateType) GetTemplates(tempOptions GetTemplatesOptions) ([]*models. return template, nil } + +// CreateTemplate inserts a new template document and returns it. +func (t *TemplateType) CreateTemplate(template models.Template) (*models.Template, error) { + ctx := context.Background() + + // ensure an ID is set + if template.ID.IsZero() { + template.ID = primitive.NewObjectID() + } + + if _, err := t.Collection.InsertOne(ctx, template); err != nil { + return nil, err + } + + return &template, nil +} + +// UpdateTemplate updates name/event/kind fields of a template +func (t *TemplateType) UpdateTemplate(templateID primitive.ObjectID, update bson.M) (*models.Template, error) { + ctx := context.Background() + + var filterQuery = bson.M{"_id": templateID} + + var optionsQuery = options.FindOneAndUpdate() + optionsQuery.SetReturnDocument(options.After) + + var updatedTemplate models.Template + + if err := t.Collection.FindOneAndUpdate(ctx, filterQuery, bson.M{"$set": update}, optionsQuery).Decode(&updatedTemplate); err != nil { + return nil, err + } + + return &updatedTemplate, nil +} diff --git a/backend/src/router/company.go b/backend/src/router/company.go index 946ab988..834ac32e 100644 --- a/backend/src/router/company.go +++ b/backend/src/router/company.go @@ -6,7 +6,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "log" "net/http" "strconv" @@ -905,7 +904,7 @@ func setCompanyPrivateImage(w http.ResponseWriter, r *http.Request) { var buf bytes.Buffer checker := io.TeeReader(file, &buf) - bytes, err := ioutil.ReadAll(checker) + bytes, err := io.ReadAll(checker) if err != nil { http.Error(w, "Unable to read the file: "+err.Error(), http.StatusExpectationFailed) return @@ -985,7 +984,7 @@ func setCompanyPublicImage(w http.ResponseWriter, r *http.Request) { var buf bytes.Buffer checker := io.TeeReader(file, &buf) - bytes, err := ioutil.ReadAll(checker) + bytes, err := io.ReadAll(checker) if err != nil { http.Error(w, "Unable to read the file: "+err.Error(), http.StatusExpectationFailed) return diff --git a/backend/src/router/contract.go b/backend/src/router/contract.go new file mode 100644 index 00000000..3e3c3649 --- /dev/null +++ b/backend/src/router/contract.go @@ -0,0 +1,521 @@ +package router + +import ( + "bytes" + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "os" + "path/filepath" + "regexp" + "strings" + + gooxml "baliance.com/gooxml" + docx "baliance.com/gooxml/document" + "github.com/gorilla/mux" + docxfill "github.com/nguyenthenguyen/docx" + "github.com/phpdave11/gofpdf" + "github.com/sinfo/deck2/src/mongodb" + "go.mongodb.org/mongo-driver/bson/primitive" +) + +type contractRequest struct { + Language string `json:"language"` + EventID int `json:"eventId"` +} + +func writeJSONError(w http.ResponseWriter, status int, msg string) { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(status) + fmt.Fprintf(w, `{"message":%q}`, msg) +} + +// generateCompanyContractDocx downloads a DOCX template, replaces variables and +// returns the filled DOCX as a download. +func generateCompanyContractDocx(w http.ResponseWriter, r *http.Request) { + gooxml.DisableLogging() + // Recover from panics to ensure we log the error and return 500. + defer func() { + if rec := recover(); rec != nil { + http.Error(w, "internal server error", http.StatusInternalServerError) + } + }() + + // Read company ID from path and fetch server-side data. + params := mux.Vars(r) + companyHex, ok := params["id"] + if !ok || companyHex == "" { + writeJSONError(w, http.StatusBadRequest, "company id missing in path") + return + } + + companyID, err := primitive.ObjectIDFromHex(companyHex) + if err != nil { + writeJSONError(w, http.StatusBadRequest, "invalid company id") + return + } + + company, err := mongodb.Companies.GetCompany(companyID) + if err != nil { + writeJSONError(w, http.StatusNotFound, "unable to find company: "+err.Error()) + return + } + + defer r.Body.Close() + + var req contractRequest + _ = json.NewDecoder(r.Body).Decode(&req) + + // Prefer templates stored in DB (which should point to Spaces CDN). + templateURL := "" + + // Require explicit eventId in the request. There must be exactly one + // `companyContract` template for the given event. + if req.EventID == 0 { + writeJSONError(w, http.StatusBadRequest, "eventId is required") + return + } + eventID := req.EventID + + // Require language in the request (e.g. "en" or "pt"). + if strings.TrimSpace(req.Language) == "" { + writeJSONError(w, http.StatusBadRequest, "language is required") + return + } + + // Validate allowed language values (only 'en' and 'pt' supported). + lowerLang := strings.ToLower(strings.TrimSpace(req.Language)) + if lowerLang != "en" && lowerLang != "pt" { + writeJSONError(w, http.StatusUnprocessableEntity, "unsupported language; allowed values are: en, pt") + return + } + + opts := mongodb.GetTemplatesOptions{} + opts.EventID = &eventID + templates, err := mongodb.Templates.GetTemplates(opts) + if err != nil { + writeJSONError(w, http.StatusInternalServerError, "unable to retrieve templates for event") + return + } + + // filter to templates of kind `companyContract` (case-insensitive) + var eventTemplates []struct{ Name, Url, Kind string } + for _, t := range templates { + if strings.ToLower(t.Kind) == "companycontract" { + eventTemplates = append(eventTemplates, struct{ Name, Url, Kind string }{t.Name, t.Url, t.Kind}) + } + } + + if len(eventTemplates) == 0 { + writeJSONError(w, http.StatusUnprocessableEntity, fmt.Sprintf("no companyContract template found for event %d", eventID)) + return + } + + // Among eventTemplates, pick the one that matches the requested language. + // Allow both an EN and a PT template to exist for the same event, but require + // exactly one template for the requested language. + var candidates []struct{ Name, Url, Kind string } + // language regexes + reEn := regexp.MustCompile(`(?i)\b(en|english|ingles)\b`) + rePt := regexp.MustCompile(`(?i)\b(pt|pt_pt|ptbr|pt_br|portuguese|portugues)\b`) + for _, t := range eventTemplates { + name := strings.ToLower(t.Name) + // match name tokens against requested language + if lowerLang == "pt" { + if rePt.MatchString(name) { + candidates = append(candidates, t) + } + } else { // en + if reEn.MatchString(name) { + candidates = append(candidates, t) + } + } + } + + if len(candidates) == 0 { + // no template for requested language + writeJSONError(w, http.StatusUnprocessableEntity, fmt.Sprintf("no companyContract template found for event %d and language %s", eventID, lowerLang)) + return + } + if len(candidates) > 1 { + writeJSONError(w, http.StatusConflict, fmt.Sprintf("multiple companyContract templates found for event %d and language %s; expected exactly one", eventID, lowerLang)) + return + } + + // use the single matching template + if candidates[0].Url == "" { + writeJSONError(w, http.StatusUnprocessableEntity, "template has no URL") + return + } + templateURL = candidates[0].Url + + // No global fallback: templates must be event-scoped and of kind `companyContract`. + + // If no template URL was resolved from DB, return an explicit JSON error. + if templateURL == "" { + writeJSONError(w, http.StatusUnprocessableEntity, "no template found for this event and language") + return + } + + resp, err := http.Get(templateURL) + if err != nil || resp.StatusCode >= 400 { + writeJSONError(w, http.StatusBadGateway, "unable to download template") + return + } + defer resp.Body.Close() + + b, err := ioutil.ReadAll(resp.Body) + if err != nil { + writeJSONError(w, http.StatusInternalServerError, "unable to read template") + return + } + + // Build replacements from company data (prefer billing info) + companyName := company.Name + companyNif := "" + companyAddress := "" + // BillingInfo is a struct (not a pointer). Use its fields if populated. + if company.BillingInfo.Name != "" { + companyName = company.BillingInfo.Name + } + companyNif = company.BillingInfo.TIN + companyAddress = company.BillingInfo.Address + + packageName := "" + packagePrice := "" + for _, p := range company.Participations { + if p.Event == eventID { + if p.Package != nil { + if pkg, err := mongodb.Packages.GetPackage(*p.Package); err == nil { + packageName = pkg.Name + // pkg.Price is in cents (int). Format as euros with cents. + packagePrice = fmt.Sprintf("%d.%02d€", pkg.Price/100, pkg.Price%100) + } + } + break + } + } + + // If no package was found for the requested event, return an explicit error. + if packageName == "" { + writeJSONError(w, http.StatusUnprocessableEntity, fmt.Sprintf("company has no package for event %d", eventID)) + return + } + + replacements := map[string]string{ + "{{companyNif}}": companyNif, + "{{companyAddress}}": companyAddress, + "{{companyName}}": companyName, + "{{packageName}}": packageName, + "{{packagePrice}}": packagePrice, + } + + // also try without braces for some templates + replacementsPlain := map[string]string{ + "companyNif": companyNif, + "companyAddress": companyAddress, + "companyName": companyName, + "packageName": packageName, + "packagePrice": packagePrice, + } + + modifiedDocx, err := replaceDocxPlaceholders(b, replacements, replacementsPlain) + if err != nil { + writeJSONError(w, http.StatusInternalServerError, "error processing template") + return + } + + // Return the filled DOCX directly as a download (simpler than rendering PDF) + filename := fmt.Sprintf("contract-%s.docx", sanitizeFilename(companyName)) + w.Header().Set("Content-Type", "application/vnd.openxmlformats-officedocument.wordprocessingml.document") + w.Header().Set("Content-Disposition", fmt.Sprintf("attachment; filename=\"%s\"", filename)) + if _, err := w.Write(modifiedDocx); err != nil { + } +} + +func sanitizeFilename(name string) string { + if name == "" { + return "contract" + } + // keep letters, numbers, - and _ + re := regexp.MustCompile(`[^a-zA-Z0-9\-_]+`) + s := re.ReplaceAllString(name, "-") + s = strings.Trim(s, "-_") + return s +} + +func replaceDocxPlaceholders(docxBytes []byte, replacements map[string]string, plain map[string]string) ([]byte, error) { + // Use github.com/nguyenthenguyen/docx to perform placeholder replacements + // Write incoming bytes to a temp file because the library operates on files. + tmpSrc, err := ioutil.TempFile("", "template-*.docx") + if err != nil { + return nil, err + } + tmpSrcName := tmpSrc.Name() + defer func() { + tmpSrc.Close() + _ = os.Remove(tmpSrcName) + }() + + if _, err := tmpSrc.Write(docxBytes); err != nil { + return nil, err + } + + // Read and get editable document + r, err := docxfill.ReadDocxFile(tmpSrcName) + if err != nil { + return nil, err + } + ed := r.Editable() + + // Apply replacements: first full-brace placeholders, then plain keys + for k, v := range replacements { + ed.Replace(k, v, -1) + } + for k, v := range plain { + ed.Replace("{{"+k+"}}", v, -1) + ed.Replace(k, v, -1) + } + + // Write to a temp output file and return its bytes + tmpOutName := tmpSrcName + ".out.docx" + if err := ed.WriteToFile(tmpOutName); err != nil { + return nil, err + } + defer func() { _ = os.Remove(tmpOutName) }() + + outBytes, err := ioutil.ReadFile(tmpOutName) + if err != nil { + return nil, err + } + return outBytes, nil +} + +// Basic styled types +type Run struct { + Text string + Bold bool + Italic bool + Underline bool +} + +type Paragraph struct { + Runs []Run +} + +// extractStyledParagraphsFromDocx parses word/document.xml and extracts paragraphs made of runs +// with basic styling flags (bold, italic, underline). This is a lightweight parser and +// intentionally limited compared to full gooxml/unioffice feature set. +func extractStyledParagraphsFromDocx(docxBytes []byte) ([]Paragraph, error) { + // Use gooxml (baliance.com/gooxml/document) to parse the docx and extract paragraphs and runs. + // We write the bytes to a temp file because the gooxml API expects a file path for opening. + tmp, err := ioutil.TempFile("", "docx-*.docx") + if err != nil { + return nil, err + } + tmpName := tmp.Name() + defer func() { + tmp.Close() + _ = os.Remove(tmpName) + }() + + if _, err := tmp.Write(docxBytes); err != nil { + return nil, err + } + + d, err := docx.Open(tmpName) + if err != nil { + return nil, err + } + + var paragraphs []Paragraph + for _, p := range d.Paragraphs() { + para := Paragraph{} + for _, r := range p.Runs() { + // build text including breaks/tabs, since Run.Text() omits breaks + var buf strings.Builder + for _, ic := range r.X().EG_RunInnerContent { + if ic.T != nil { + buf.WriteString(ic.T.Content) + } + if ic.Tab != nil { + buf.WriteByte('\t') + } + if ic.Br != nil { + buf.WriteByte('\n') + } + } + text := buf.String() + + rp := r.Properties() + underline := false + if rp.X() != nil && rp.X().U != nil { + underline = true + } + + run := Run{ + Text: text, + Bold: rp.IsBold(), + Italic: rp.IsItalic(), + Underline: underline, + } + para.Runs = append(para.Runs, run) + } + if len(para.Runs) > 0 { + paragraphs = append(paragraphs, para) + } + } + + // also extract headers and footers + for _, h := range d.Headers() { + for _, p := range h.Paragraphs() { + para := Paragraph{} + for _, r := range p.Runs() { + var buf strings.Builder + for _, ic := range r.X().EG_RunInnerContent { + if ic.T != nil { + buf.WriteString(ic.T.Content) + } + if ic.Tab != nil { + buf.WriteByte('\t') + } + if ic.Br != nil { + buf.WriteByte('\n') + } + } + text := buf.String() + rp := r.Properties() + underline := false + if rp.X() != nil && rp.X().U != nil { + underline = true + } + run := Run{ + Text: text, + Bold: rp.IsBold(), + Italic: rp.IsItalic(), + Underline: underline, + } + para.Runs = append(para.Runs, run) + } + if len(para.Runs) > 0 { + paragraphs = append(paragraphs, para) + } + } + } + + for _, f := range d.Footers() { + for _, p := range f.Paragraphs() { + para := Paragraph{} + for _, r := range p.Runs() { + var buf strings.Builder + for _, ic := range r.X().EG_RunInnerContent { + if ic.T != nil { + buf.WriteString(ic.T.Content) + } + if ic.Tab != nil { + buf.WriteByte('\t') + } + if ic.Br != nil { + buf.WriteByte('\n') + } + } + text := buf.String() + rp := r.Properties() + underline := false + if rp.X() != nil && rp.X().U != nil { + underline = true + } + run := Run{ + Text: text, + Bold: rp.IsBold(), + Italic: rp.IsItalic(), + Underline: underline, + } + para.Runs = append(para.Runs, run) + } + if len(para.Runs) > 0 { + paragraphs = append(paragraphs, para) + } + } + } + + if len(paragraphs) == 0 { + return nil, fmt.Errorf("no paragraphs extracted") + } + return paragraphs, nil +} + +// renderPDFfromStyledParagraphs renders basic styled paragraphs to a PDF bytes buffer. +// Supports bold/italic by switching among Type1 Helvetica variants. Wrapping and spacing +// are approximate (OSS limitation). +func renderPDFfromStyledParagraphs(pars []Paragraph) ([]byte, error) { + // Use gofpdf with embedded DejaVu fonts (TTF) for proper Unicode support. + // Expect fonts at backend/assets/fonts/DejaVuSans.ttf and DejaVuSans-Bold.ttf + fontDir := filepath.Join("assets", "fonts") + normalPath := filepath.Join(fontDir, "DejaVuSans.ttf") + boldPath := filepath.Join(fontDir, "DejaVuSans-Bold.ttf") + + if _, err := os.Stat(normalPath); err != nil { + return nil, fmt.Errorf("font not found: %s (place DejaVuSans.ttf in backend/assets/fonts)", normalPath) + } + // bold variant optional; if missing we'll use normal for bold style + + pdf := gofpdf.New("P", "mm", "A4", "") + // Register fonts (UTF-8 aware). AddUTF8Font does not return an error. + // Register normal and provide fallbacks for italic (I) and bold-italic (BI) + // by reusing the available TTFs so SetFont("DejaVu","I") won't fail. + pdf.AddUTF8Font("DejaVu", "", normalPath) + // register italic style as same as normal if italic file not available + pdf.AddUTF8Font("DejaVu", "I", normalPath) + if _, err := os.Stat(boldPath); err == nil { + pdf.AddUTF8Font("DejaVu", "B", boldPath) + // register bold-italic to bold TTF (best effort) + pdf.AddUTF8Font("DejaVu", "BI", boldPath) + } else { + // if bold not present, map BI to normal as well + pdf.AddUTF8Font("DejaVu", "B", normalPath) + pdf.AddUTF8Font("DejaVu", "BI", normalPath) + } + + pdf.SetAutoPageBreak(true, 20) + pdf.AddPage() + + lineHt := 6.0 + pdf.SetFont("DejaVu", "", 12) + + for _, p := range pars { + for _, r := range p.Runs { + style := "" + if r.Bold { + style += "B" + } + if r.Italic { + style += "I" + } + // gofpdf will fall back to normal if B variant not registered + pdf.SetFont("DejaVu", style, 12) + // handle newlines inside run + parts := strings.Split(r.Text, "\n") + for i, part := range parts { + if part == "" { + pdf.Ln(lineHt) + continue + } + // Write text (UTF-8) + pdf.Write(lineHt, part) + if i < len(parts)-1 { + pdf.Ln(lineHt) + } + } + } + // paragraph gap + pdf.Ln(lineHt) + } + + var out bytes.Buffer + if err := pdf.Output(&out); err != nil { + return nil, err + } + return out.Bytes(), nil +} diff --git a/backend/src/router/init.go b/backend/src/router/init.go index b9f0b465..3b585713 100644 --- a/backend/src/router/init.go +++ b/backend/src/router/init.go @@ -179,6 +179,7 @@ func InitializeRouter() { companyRouter.HandleFunc("/{id}/employers", authMember(updateEmployersOrder)).Methods("PUT") companyRouter.HandleFunc("/{id}/employer", authMember(addEmployer)).Methods("POST") companyRouter.HandleFunc("/{id}/employer/{rep}", authMember(removeEmployer)).Methods("DELETE") + companyRouter.HandleFunc("/{id}/contract/docx", authCoordinator(generateCompanyContractDocx)).Methods("POST") // speaker handlers speakerRouter := r.PathPrefix("/speakers").Subrouter() @@ -358,6 +359,11 @@ func InitializeRouter() { templatesRouter.HandleFunc("/fill/{id}", fillTemplate).Methods("POST") templatesRouter.HandleFunc("/filled/{uuid}", getFilledTemplate).Methods("GET") + // upload/download template files (coordination only) + templatesRouter.HandleFunc("/{id}/upload", authCoordinator(uploadTemplateFile)).Methods("POST") + templatesRouter.HandleFunc("/upload-by-name", authCoordinator(uploadTemplateFileByName)).Methods("POST") + templatesRouter.HandleFunc("/{id}/download", authCoordinator(downloadTemplateFile)).Methods("GET") + // save router instance Router = handlers.CORS(allowedHeaders, allowedOrigins, allowedMethods)(r) } diff --git a/backend/src/router/templates.go b/backend/src/router/templates.go index 5d9063d8..14c3394c 100644 --- a/backend/src/router/templates.go +++ b/backend/src/router/templates.go @@ -10,10 +10,14 @@ import ( "text/template" "time" + "strings" + "github.com/google/uuid" "github.com/gorilla/mux" "github.com/patrickmn/go-cache" + "github.com/sinfo/deck2/src/models" "github.com/sinfo/deck2/src/mongodb" + "github.com/sinfo/deck2/src/spaces" "go.mongodb.org/mongo-driver/bson/primitive" ) @@ -169,3 +173,212 @@ func getTemplates(w http.ResponseWriter, r *http.Request) { json.NewEncoder(w).Encode(templates) } + + +func uploadTemplateFile(w http.ResponseWriter, r *http.Request) { + params := mux.Vars(r) + templateId, err := primitive.ObjectIDFromHex(params["id"]) + if err != nil { + http.Error(w, "invalid template id", http.StatusBadRequest) + return + } + + eventStr := r.URL.Query().Get("event") + if eventStr == "" { + http.Error(w, "missing event query parameter", http.StatusBadRequest) + return + } + + eventID, err := strconv.Atoi(eventStr) + if err != nil { + http.Error(w, "invalid event id", http.StatusBadRequest) + return + } + + // Parse multipart form + if err := r.ParseMultipartForm(10 << 20); err != nil { + http.Error(w, "invalid multipart form", http.StatusBadRequest) + return + } + + file, header, err := r.FormFile("file") + if err != nil { + http.Error(w, "file field is required", http.StatusBadRequest) + return + } + defer file.Close() + + // Read file bytes + b, err := io.ReadAll(file) + if err != nil { + http.Error(w, "unable to read file", http.StatusInternalServerError) + return + } + + // upload to spaces + mime := header.Header.Get("Content-Type") + if mime == "" { + mime = "application/octet-stream" + } + + url, err := spaces.UploadTemplateFile(eventID, templateId.Hex(), bytes.NewReader(b), int64(len(b)), mime) + if err != nil { + http.Error(w, "unable to upload to spaces", http.StatusBadGateway) + return + } + + // update template url in DB + updated, err := mongodb.Templates.UpdateTemplateUrl(templateId, *url) + if err != nil { + http.Error(w, "unable to update template url in db", http.StatusInternalServerError) + return + } + + w.Header().Set("Content-Type", "application/json") + json.NewEncoder(w).Encode(updated) +} + +func uploadTemplateFileByName(w http.ResponseWriter, r *http.Request) { + eventStr := r.URL.Query().Get("event") + if eventStr == "" { + http.Error(w, "missing event query parameter", http.StatusBadRequest) + return + } + + eventID, err := strconv.Atoi(eventStr) + if err != nil { + http.Error(w, "invalid event id", http.StatusBadRequest) + return + } + + // Parse multipart form + if err := r.ParseMultipartForm(10 << 20); err != nil { + http.Error(w, "invalid multipart form", http.StatusBadRequest) + return + } + + // template name can be provided as form value + name := r.FormValue("name") + if name == "" { + // fallback to query param + name = r.URL.Query().Get("name") + } + + if name == "" { + http.Error(w, "template name is required", http.StatusBadRequest) + return + } + + // find template by name and event + opts := mongodb.GetTemplatesOptions{} + opts.Name = &name + opts.EventID = &eventID + + templates, err := mongodb.Templates.GetTemplates(opts) + if err != nil { + http.Error(w, "unable to lookup template", http.StatusInternalServerError) + return + } + + var templateId primitive.ObjectID + + if len(templates) == 0 { + // create a new template when none exists for this name+event + kind := "" + lname := strings.ToLower(name) + if strings.Contains(lname, "company contract") { + kind = "companyContract" + } + + newT := models.Template{ + ID: primitive.NewObjectID(), + Name: name, + Url: "", + Event: eventID, + Requirements: []models.Requirement{}, + Kind: kind, + } + + created, err := mongodb.Templates.CreateTemplate(newT) + if err != nil { + http.Error(w, "unable to create template", http.StatusInternalServerError) + return + } + + templateId = created.ID + } else { + // use the first match + templateId = templates[0].ID + } + + file, header, err := r.FormFile("file") + if err != nil { + http.Error(w, "file field is required", http.StatusBadRequest) + return + } + defer file.Close() + + b, err := io.ReadAll(file) + if err != nil { + http.Error(w, "unable to read file", http.StatusInternalServerError) + return + } + + mime := header.Header.Get("Content-Type") + if mime == "" { + mime = "application/octet-stream" + } + + url, err := spaces.UploadTemplateFile(eventID, templateId.Hex(), bytes.NewReader(b), int64(len(b)), mime) + if err != nil { + http.Error(w, "unable to upload to spaces", http.StatusBadGateway) + return + } + + updated, err := mongodb.Templates.UpdateTemplateUrl(templateId, *url) + if err != nil { + http.Error(w, "unable to update template url in db", http.StatusInternalServerError) + return + } + + w.Header().Set("Content-Type", "application/json") + json.NewEncoder(w).Encode(updated) +} + +func downloadTemplateFile(w http.ResponseWriter, r *http.Request) { + params := mux.Vars(r) + templateId, err := primitive.ObjectIDFromHex(params["id"]) + if err != nil { + http.Error(w, "invalid template id", http.StatusBadRequest) + return + } + + tmpl, err := mongodb.Templates.GetTemplate(templateId) + if err != nil { + http.Error(w, "template not found", http.StatusNotFound) + return + } + + if tmpl.Url == "" { + http.Error(w, "template has no associated file URL", http.StatusNotFound) + return + } + + resp, err := http.Get(tmpl.Url) + if err != nil || resp.StatusCode >= 400 { + http.Error(w, "unable to download template file", http.StatusBadGateway) + return + } + defer resp.Body.Close() + + // Use the template name as filename fallback + filename := tmpl.Name + if filename == "" { + filename = "template.docx" + } + + w.Header().Set("Content-Type", resp.Header.Get("Content-Type")) + w.Header().Set("Content-Disposition", fmt.Sprintf("attachment; filename=\"%s\"", filename)) + + io.Copy(w, resp.Body) +} diff --git a/backend/src/spaces/init.go b/backend/src/spaces/init.go index 69e947eb..3dc131d1 100644 --- a/backend/src/spaces/init.go +++ b/backend/src/spaces/init.go @@ -76,8 +76,18 @@ func InitializeSpaces() { for _, cdn := range cdns { if strings.Contains(cdn.Origin, name) { - cdnBaseURL = cdn.CustomDomain - endpoint = cdn.Origin[len(name)+1:] + // Prefer an explicitly configured custom domain for the CDN + if cdn.CustomDomain != "" { + cdnBaseURL = cdn.CustomDomain + } else { + // Fallback: construct base URL from bucket name + endpoint + endpoint = cdn.Origin[len(name)+1:] + cdnBaseURL = fmt.Sprintf("%s.%s", name, endpoint) + } + // Ensure endpoint is set for MinIO client initialization + if endpoint == "" { + endpoint = cdn.Origin + } } } diff --git a/backend/vendor/baliance.com/gooxml/.gitignore b/backend/vendor/baliance.com/gooxml/.gitignore new file mode 100644 index 00000000..0801b70a --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/.gitignore @@ -0,0 +1,15 @@ +# Binaries for programs and plugins +*.exe +*.dll +*.so +*.dylib +coverage* +**/.DS_Store +**/main + +# Test binary, build with `go test -c` +*.test + +**/.coverprofile +gover.coverprofile +spreadsheet/formula/y.output diff --git a/backend/vendor/baliance.com/gooxml/.travis.yml b/backend/vendor/baliance.com/gooxml/.travis.yml new file mode 100644 index 00000000..a7acf7fa --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/.travis.yml @@ -0,0 +1,19 @@ +language: go +go: + - 1.8.x + - 1.9.x + - 1.10.x + - 1.11 + +install: + - mkdir -p $HOME/gopath/src/baliance.com/ + - ln -s $HOME/gopath/src/github.com/baliance/gooxml $HOME/gopath/src/baliance.com/gooxml + +script: + - cd $HOME/gopath/src/baliance.com/gooxml + - ./build-examples.sh + - go vet ./... + - go test ./... + +after_success: + - ./test-coverage.sh diff --git a/backend/vendor/baliance.com/gooxml/CLA.md b/backend/vendor/baliance.com/gooxml/CLA.md new file mode 100644 index 00000000..014bd2d1 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/CLA.md @@ -0,0 +1,149 @@ +Thank you for your interest in contributing to gooxml ("We" or "Us"). + +The purpose of this contributor agreement ("Agreement") is to clarify and +document the rights granted by contributors to Us. + + +# 1. DEFINITIONS + +"YOU" means the Individual Copyright owner who submits a Contribution to Us. If +You are an employee and submit the Contribution as part of your employment, You +have had Your employer approve this Agreement or sign the Entity version of this +document. + +"CONTRIBUTION" means any original work of authorship (software and/or +documentation) including any modifications or additions to an existing work, +Submitted by You to Us, in which You own the Copyright. If You do not own the +Copyright in the entire work of authorship, please contact Us at +gooxml@baliance.com. + +"COPYRIGHT" means all rights protecting works of authorship owned or controlled +by You, including copyright, moral and neighboring rights, as appropriate, for +the full term of their existence including any extensions by You. + +"MATERIAL" means the software or documentation made available by Us to third +parties. When this Agreement covers more than one software project, the Material +means the software or documentation to which the Contribution was Submitted. +After You Submit the Contribution, it may be included in the Material. + +"SUBMIT" means any form of physical, electronic, or written communication sent +to Us, including but not limited to electronic mailing lists, source code +control systems, and issue tracking systems that are managed by, or on behalf +of, Us, but excluding communication that is conspicuously marked or otherwise +designated in writing by You as "Not a Contribution." + +"SUBMISSION DATE" means the date You Submit a Contribution to Us. + +"DOCUMENTATION" means any non-software portion of a Contribution. + + +# 2. LICENSE GRANT + +## 2.1 Copyright License to Us + +Subject to the terms and conditions of this Agreement, You hereby grant to Us a +worldwide, royalty-free, NON-exclusive, perpetual and irrevocable license, with +the right to transfer an unlimited number of non-exclusive licenses or to grant +sublicenses to third parties, under the Copyright covering the Contribution to +use the Contribution by all means, including, but not limited to: + +* to publish the Contribution, + +* to modify the Contribution, to prepare derivative works based upon or + containing the Contribution and to combine the Contribution with other + software code, + +* to reproduce the Contribution in original or modified form, + +* to distribute, to make the Contribution available to the public, display and + publicly perform the Contribution in original or modified form. + +2.2 Moral Rights remain unaffected to the extent they are recognized and not +waivable by applicable law. Notwithstanding, You may add your name in the header +of the source code files of Your Contribution and We will respect this +attribution when using Your Contribution. + + +# 3. PATENTS + +## 3.1 Patent License + +Subject to the terms and conditions of this Agreement You hereby grant to us a +worldwide, royalty-free, non-exclusive, perpetual and irrevocable (except as +stated in Section 3.2) patent license, with the right to transfer an unlimited +number of non-exclusive licenses or to grant sublicenses to third parties, to +make, have made, use, sell, offer for sale, import and otherwise transfer the +Contribution and the Contribution in combination with the Material (and portions +of such combination). This license applies to all patents owned or controlled by +You, whether already acquired or hereafter acquired, that would be infringed by +making, having made, using, selling, offering for sale, importing or otherwise +transferring of Your Contribution(s) alone or by combination of Your +Contribution(s) with the Material. + +##3.2 Revocation of Patent License + +You reserve the right to revoke the patent license stated in section 3.1 if we +make any infringement claim that is targeted at your Contribution and not +asserted for a Defensive Purpose. An assertion of claims of the Patents shall be +considered for a "Defensive Purpose" if the claims are asserted against an +entity that has filed, maintained, threatened, or voluntarily participated in a +patent infringement lawsuit against Us or any of Our licensees. + + +# 4. DISCLAIMER + +THE CONTRIBUTION IS PROVIDED "AS IS". MORE PARTICULARLY, ALL EXPRESS OR IMPLIED +WARRANTIES INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTY OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE +EXPRESSLY DISCLAIMED BY YOU TO US AND BY US TO YOU. TO THE EXTENT THAT ANY SUCH +WARRANTIES CANNOT BE DISCLAIMED, SUCH WARRANTY IS LIMITED IN DURATION TO THE +MINIMUM PERIOD PERMITTED BY LAW. + + +# 5. CONSEQUENTIAL DAMAGE WAIVER + +TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT WILL YOU OR US BE +LIABLE FOR ANY LOSS OF PROFITS, LOSS OF ANTICIPATED SAVINGS, LOSS OF DATA, +INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL AND EXEMPLARY DAMAGES ARISING OUT +OF THIS AGREEMENT REGARDLESS OF THE LEGAL OR EQUITABLE THEORY (CONTRACT, TORT OR +OTHERWISE) UPON WHICH THE CLAIM IS BASED. + + +# 6. APPROXIMATION OF DISCLAIMER AND DAMAGE WAIVER + +IF THE DISCLAIMER AND DAMAGE WAIVER MENTIONED IN SECTION 4 AND SECTION 5 CANNOT +BE GIVEN LEGAL EFFECT UNDER APPLICABLE LOCAL LAW, REVIEWING COURTS SHALL APPLY +LOCAL LAW THAT MOST CLOSELY APPROXIMATES AN ABSOLUTE WAIVER OF ALL CIVIL +LIABILITY IN CONNECTION WITH THE CONTRIBUTION. + + +# 7. TERM + +7.1 This Agreement shall come into effect upon Your acceptance of the terms and +conditions. + +7.2 In the event of a termination of this Agreement Sections 4, 5, 6, 7 and 8 +shall survive such termination and shall remain in full force thereafter. For +the avoidance of doubt, Contributions that are already licensed under a free and +open source license at the date of the termination shall remain in full force +after the termination of this Agreement. + + +# 8. MISCELLANEOUS + +8.1 This Agreement and all disputes, claims, actions, suits or other proceedings +arising out of this agreement or relating in any way to it shall be governed by +the laws of the United States excluding its private international law provisions. + +8.2 This Agreement sets out the entire agreement between You and Us for Your +Contributions to Us and overrides all other agreements or understandings. + +8.3 If any provision of this Agreement is found void and unenforceable, such +provision will be replaced to the extent possible with a provision that comes +closest to the meaning of the original provision and that is enforceable. The +terms and conditions set forth in this Agreement shall apply notwithstanding any +failure of essential purpose of this Agreement or any limited remedy to the +maximum extent possible under law. + +8.4 You agree to notify Us of any facts or circumstances of which you become +aware that would make this Agreement inaccurate in any respect. diff --git a/backend/vendor/baliance.com/gooxml/LICENSE b/backend/vendor/baliance.com/gooxml/LICENSE new file mode 100644 index 00000000..dd1a5364 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/LICENSE @@ -0,0 +1,617 @@ + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU Affero General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. diff --git a/backend/vendor/baliance.com/gooxml/LICENSE.commercial b/backend/vendor/baliance.com/gooxml/LICENSE.commercial new file mode 100644 index 00000000..18eed14a --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/LICENSE.commercial @@ -0,0 +1,118 @@ + END USER LICENSE AGREEMENT + +This copy of gooxml ("the Software Product") and accompanying documentation is +licensed and not sold. This Software Product is protected by copyright laws and +treaties, as well as laws and treaties related to other forms of intellectual +property. Baliance LLC or its subsidiaries, affiliates, and suppliers +(collectively "Baliance") own intellectual property rights in the Software +Product. The Licensee's ("you" or "your") license to download, use, copy, or +change the Software Product is subject to these rights and to all the terms and +conditions of this End User License Agreement ("Agreement"). + +Acceptance + +YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS COMMERCIAL AGREEMENT BY +PURCHASING THE THE SOFTWARE PRODUCT. YOU MUST AGREE TO ALL OF THE TERMS OF THIS +AGREEMENT BEFORE YOU WILL BE ALLOWED TO DOWNLOAD THE SOFTWARE PRODUCT. IF YOU DO +NOT AGREE TO ALL OF THE TERMS OF THIS AGREEMENT, YOU MUST NOT PURCHASE THE +SOFTWARE AND WILL BE BOUND BY THE TERMS OF THE AGPL LICENSE. + +License Grant + +Development with Licensed Software + +Subject to the terms of this Agreement, Baliance grants to Licensee a personal, +worldwide, non-exclusive, non-transferable license, valid for the Term, to use, +modify and copy the Licensed Software by Designated Users for the sole purposes +of designing, developing, demonstrating and testing Application(s), and to +provide thereto related support and other services to end-user Customers. + +Licensee may install copies of the Licensed Software on an unlimited number of +computers provided that (i) only the Designated Users may use the Licensed +Software, and (ii) all Designated Users must have a valid Development License to +use Licensed Software. + +Licensee may at any time designate another Designated User to replace a +then-current Designated User by notifying Baliance in writing. + +Restrictions on Transfer + +Without first obtaining the express written consent of Baliance, you may not +otherwise assign your rights and obligations under this Agreement, or +redistribute, encumber, sell, rent, lease, sublicense, or otherwise transfer +your rights to the Software Product except + +Updates + +Licensee will be eligible for software updates for the duration of the support +period of the license (12 months). Upon expiry of the support term, the Licensee +will not be authorized to use further updates of the software until a new +license has been purchased. However, licensees shall be allowed to continue the +software as it existed at the expiration of the license term in perpetuity. + +Unless otherwise agreed, Baliance shall not be responsible for providing any +service or support to the Customers. + +Disclaimer of Warranties and Limitation of Liability + +UNLESS OTHERWISE EXPLICITLY AGREED TO IN WRITING BY BALIANCE, BALIANCE MAKES NO +OTHER WARRANTIES, EXPRESS OR IMPLIED, IN FACT OR IN LAW, INCLUDING, BUT NOT +LIMITED TO, ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A +PARTICULAR PURPOSE OTHER THAN AS SET FORTH IN THIS AGREEMENT OR IN THE LIMITED +WARRANTY DOCUMENTS PROVIDED WITH THE SOFTWARE PRODUCT. + +Baliance makes no warranty that the Software Product will meet your requirements +or operate under your specific conditions of use. Baliance makes no warranty +that operation of the Software Product will be secure, error free, or free from +interruption. YOU MUST DETERMINE WHETHER THE SOFTWARE PRODUCT SUFFICIENTLY MEETS +YOUR REQUIREMENTS FOR SECURITY AND UNINTERRUPTABILITY. YOU BEAR SOLE +RESPONSIBILITY AND ALL LIABILITY FOR ANY LOSS INCURRED DUE TO FAILURE OF THE +SOFTWARE PRODUCT TO MEET YOUR REQUIREMENTS. BALIANCE WILL NOT, UNDER ANY +CIRCUMSTANCES, BE RESPONSIBLE OR LIABLE FOR THE LOSS OF DATA ON ANY COMPUTER OR +INFORMATION STORAGE DEVICE. + +UNDER NO CIRCUMSTANCES SHALL BALIANCE, ITS DIRECTORS, OFFICERS, EMPLOYEES OR +AGENTS BE LIABLE TO YOU OR ANY OTHER PARTY FOR INDIRECT, CONSEQUENTIAL, SPECIAL, +INCIDENTAL, PUNITIVE, OR EXEMPLARY DAMAGES OF ANY KIND (INCLUDING LOST REVENUES +OR PROFITS OR LOSS OF BUSINESS) RESULTING FROM THIS AGREEMENT, OR FROM THE +FURNISHING, PERFORMANCE, INSTALLATION, OR USE OF THE SOFTWARE PRODUCT, WHETHER +DUE TO A BREACH OF CONTRACT, BREACH OF WARRANTY, OR THE NEGLIGENCE OF BALIANCE +OR ANY OTHER PARTY, EVEN IF BALIANCE IS ADVISED BEFOREHAND OF THE POSSIBILITY OF +SUCH DAMAGES. TO THE EXTENT THAT THE APPLICABLE JURISDICTION LIMITS BALIANCE'S +ABILITY TO DISCLAIM ANY IMPLIED WARRANTIES, THIS DISCLAIMER SHALL BE EFFECTIVE +TO THE MAXIMUM EXTENT PERMITTED. + +Limitation of Remedies and Damages + +Your remedy for a breach of this Agreement or of any warranty included in this +Agreement is the correction or replacement of the Software Product. Selection of +whether to correct or replace shall be solely at the discretion of Baliance. +Baliance reserves the right to substitute a functionally equivalent copy of the +Software Product as a replacement. If Baliance is unable to provide a +replacement or substitute Software Product or corrections to the Software +Product, your sole alternate remedy shall be a refund of the purchase price for +the Software Product exclusive of any costs for shipping and handling. + +Any claim must be made within the applicable warranty period. All warranties +cover only defects arising under normal use and do not include malfunctions or +failure resulting from misuse, abuse, neglect, alteration, problems with +electrical power, acts of nature, unusual temperatures or humidity, improper +installation, or damage determined by Baliance to have been caused by you. All +limited warranties on the Software Product are granted only to you and are +non-transferable. You agree to indemnify and hold Baliance harmless from all +claims, judgments, liabilities, expenses, or costs arising from your breach of +this Agreement and/or acts or omissions. + +Governing Law, Jurisdiction and Costs + +This Agreement is governed by the laws of Alabama, without regard to Alabama's +conflict or choice of law provisions. + +Severability + +If any provision of this Agreement shall be held to be invalid or unenforceable, +the remainder of this Agreement shall remain in full force and effect. To the +extent any express or implied restrictions are not permitted by applicable laws, +these express or implied restrictions shall remain in force and effect to the +maximum extent permitted by such applicable laws. + diff --git a/backend/vendor/baliance.com/gooxml/README.md b/backend/vendor/baliance.com/gooxml/README.md new file mode 100644 index 00000000..184c45a8 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/README.md @@ -0,0 +1,127 @@ +**gooxml** is a library for creation of Office Open XML documents (.docx, .xlsx +and .pptx). It's goal is to be the most compatible and highest performance Go +library for creation and editing of docx/xlsx/pptx files. + +Requires **go1.8+**, builds are tested with 1.8, 1.9 and tip. + +[](https://travis-ci.org/baliance/gooxml) +[](https://github.com/baliance/gooxml/releases) +[](https://www.gnu.org/licenses/agpl-3.0) +[](https://godoc.org/baliance.com/gooxml) +[](http://golang.org) + + + +## Status ## + +- Documents (docx) [Word] + - Read/Write/Edit + - Formatting + - Images + - Tables +- Spreadsheets (xlsx) [Excel] + - Read/Write/Edit + - Cell formatting including conditional formatting + - Cell validation (drop down combobox, rules, etc.) + - Retrieve cell values as formatted by Excel (e.g. retrieve a date or number as displayed in Excel) + - Formula Evaluation (100+ functions supported currently, more will be added as required) + - Embedded Images + - All chart types +- PowerPoint (pptx) [PowerPoint] + - Creation from templates + - Textboxes/shapes + + +## Performance ## + +There has been a great deal of interest in performance numbers for spreadsheet +creation/reading lately, so here are gooxml numbers for this +[benchmark](https://github.com/baliance/gooxml/tree/master/_examples/spreadsheet/lots-of-rows) +which creates a sheet with 30k rows, each with 100 columns. + + creating 30000 rows * 100 cells took 3.92506863s + saving took 89ns + reading took 9.522383048s + +Creation is fairly fast, saving is very quick due to no reflection usage, and +reading is a bit slower. The downside is that the binary is large (33MB) as it +contains generated structs, serialization and deserialization code for all of +DOCX/XLSX/PPTX. + +## Installation ## + + go get baliance.com/gooxml/ + go build -i baliance.com/gooxml/... + +## Document Examples ## + +- [Simple Text Formatting](https://github.com/baliance/gooxml/tree/master/_examples/document/simple) Text font colors, sizes, highlighting, etc. +- [Auto Generated Table of Contents](https://github.com/baliance/gooxml/tree/master/_examples/document/toc) Creating document headings with an auto generated TOC based off of the headingds +- [Floating Image](https://github.com/baliance/gooxml/tree/master/_examples/document/image) Placing an image somewhere on a page, absolutely positioned with different text wrapping. +- [Header & Footer](https://github.com/baliance/gooxml/tree/master/_examples/document/header-footer) Creating headers and footers including page numbering. +- [Multiple Headers & Footers](https://github.com/baliance/gooxml/tree/master/_examples/document/header-footer-multiple) Using different headers and footers depending on document section. +- [Inline Tables](https://github.com/baliance/gooxml/tree/master/_examples/document/tables) Adding an table with and without borders. +- [Using Existing Word Document as a Template](https://github.com/baliance/gooxml/tree/master/_examples/document/use-template) Opening a document as a template to re-use the styles created in the document. +- [Filling out Form Fields](https://github.com/baliance/gooxml/tree/master/_examples/document/fill-out-form) Opening a document with embedded form fields, filling out the fields and saving the result as a new filled form. +- [Editing an existing document](https://github.com/baliance/gooxml/tree/master/_examples/document/edit-document) Open an existing document and replace/remove text without modifying formatting. + +## Spreadsheet Examples ## +- [Simple](https://github.com/baliance/gooxml/tree/master/_examples/spreadsheet/simple) A simple sheet with a few cells +- [Named Cells](https://github.com/baliance/gooxml/tree/master/_examples/spreadsheet/named-cells) Different ways of referencing rows and cells +- [Cell Number/Date/Time Formats](https://github.com/baliance/gooxml/tree/master/_examples/spreadsheet/number-date-time-formats) Creating cells with various number/date/time formats +- [Line Chart](https://github.com/baliance/gooxml/tree/master/_examples/spreadsheet/line-chart)/[Line Chart 3D](https://github.com/baliance/gooxml/tree/master/_examples/spreadsheet/line-chart-3d) Line Charts +- [Bar Chart](https://github.com/baliance/gooxml/tree/master/_examples/spreadsheet/bar-chart) Bar Charts +- [Mutiple Charts](https://github.com/baliance/gooxml/tree/master/_examples/spreadsheet/multiple-charts) Multiple charts on a single sheet +- [Named Cell Ranges](https://github.com/baliance/gooxml/tree/master/_examples/spreadsheet/named-ranges) Naming cell ranges +- [Merged Cells](https://github.com/baliance/gooxml/tree/master/_examples/spreadsheet/merged) Merge and unmerge cells +- [Conditional Formatting](https://github.com/baliance/gooxml/tree/master/_examples/spreadsheet/conditional-formatting) Conditionally formatting cells, styling, gradients, icons, data bar +- [Complex](https://github.com/baliance/gooxml/tree/master/_examples/spreadsheet/complex) Multiple charts, auto filtering and conditional formatting +- [Borders](https://github.com/baliance/gooxml/tree/master/_examples/spreadsheet/borders) Individual cell borders and rectangular borders around a range of cells. +- [Validation](https://github.com/baliance/gooxml/tree/master/_examples/spreadsheet/validation) Data validation including combo box dropdowns. +- [Frozen Rows/Cols](https://github.com/baliance/gooxml/tree/master/_examples/spreadsheet/freeze-rows-cols) A sheet with a frozen header column and row + +## Presentation Examples ## + +- [Simple Text Boxes](https://github.com/baliance/gooxml/tree/master/_examples/presentation/simple) Simple text boxes and shapes +- [Images](https://github.com/baliance/gooxml/tree/master/_examples/presentation/image) Simple image insertion +- [Template](https://github.com/baliance/gooxml/tree/master/_examples/presentation/use-template/simple) Creating a presentation from a template + +## Raw Types ## + +The OOXML specification is large and creating a friendly API to cover the entire +specification is a very time consuming endeavor. This library attempts to +provide an easy to use API for common use cases in creating OOXML documents +while allowing users to fall back to raw document manipulation should the +library's API not cover a specific use case. + +The raw XML based types reside in the ```schema/``` directory. These types are +accessible from the wrapper types via a ```X()``` method that returns the raw +type. + +For example, the library currently doesn't have an API for setting a document +background color. However it's easy to do manually via editing the +```CT_Background``` element of the document. + + dox := document.New() + doc.X().Background = wordprocessingml.NewCT_Background() + doc.X().Background.ColorAttr = &wordprocessingml.ST_HexColor{} + doc.X().Background.ColorAttr.ST_HexColorRGB = color.RGB(50, 50, 50).AsRGBString() + +### Contribution guidelines ### + +[](https://cla-assistant.io/baliance/gooxml) + +All contributors are must sign a contributor license agreement before their code +will be reviewed and merged. + + +### Licensing ### + +This library is offered under a dual license. It is freely available for use +under the terms of AGPLv3. If you would like to use this library for a closed +source project, please contact sales@baliance.com. + +There are no differences in functionality between the open source and commercial +versions. You are encouraged to use the open source version to evaluate the library +before purchasing a commercial license. + diff --git a/backend/vendor/baliance.com/gooxml/algo/naturalsort.go b/backend/vendor/baliance.com/gooxml/algo/naturalsort.go new file mode 100644 index 00000000..a83e2910 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/algo/naturalsort.go @@ -0,0 +1,63 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package algo + +import ( + "strconv" +) + +func isdigit(c byte) bool { + return c >= '0' && c <= '9' +} + +// NaturalLess compares two strings in a human manner so rId2 sorts less than rId10 +func NaturalLess(lhs, rhs string) bool { + lidx, ridx := 0, 0 + for lidx < len(lhs) && ridx < len(rhs) { + lc := lhs[lidx] + rc := rhs[ridx] + ldigit := isdigit(lc) + rdigit := isdigit(rc) + switch { + // digits sort before characters + case ldigit && !rdigit: + return true + // characters after digits + case !ldigit && rdigit: + return false + // no digits, so compare the characters + case !ldigit && !rdigit: + if lc != rc { + return lc < rc + } + lidx++ + ridx++ + // both digits, so parse and compare + default: + lend := lidx + 1 + rend := ridx + 1 + + for lend < len(lhs) && isdigit(lhs[lend]) { + lend++ + } + for rend < len(rhs) && isdigit(rhs[rend]) { + rend++ + } + lv, _ := strconv.ParseUint(lhs[lidx:lend], 10, 64) + rv, _ := strconv.ParseUint(rhs[lidx:rend], 10, 64) + if lv != rv { + return lv < rv + } + // digits are equal, so keep looking + lidx = lend + ridx = rend + } + } + // fall back to comparing length + return len(lhs) < len(rhs) +} diff --git a/backend/vendor/baliance.com/gooxml/algo/strings.go b/backend/vendor/baliance.com/gooxml/algo/strings.go new file mode 100644 index 00000000..fcba5cf5 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/algo/strings.go @@ -0,0 +1,13 @@ +package algo + +func RepeatString(s string, cnt int) string { + if cnt <= 0 { + return "" + } + buf := make([]byte, len(s)*cnt) + sb := []byte(s) + for i := 0; i < cnt; i++ { + copy(buf[i:], sb) + } + return string(buf) +} diff --git a/backend/vendor/baliance.com/gooxml/build-examples.sh b/backend/vendor/baliance.com/gooxml/build-examples.sh new file mode 100644 index 00000000..e95d7a01 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/build-examples.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +go get -u github.com/go-ole/go-ole/oleutil +find _examples/ -maxdepth 2 -mindepth 2 -exec sh -c "cd {}; echo building {}; go build -i main.go" \; diff --git a/backend/vendor/baliance.com/gooxml/codecov.yml b/backend/vendor/baliance.com/gooxml/codecov.yml new file mode 100644 index 00000000..c93070c2 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/codecov.yml @@ -0,0 +1,2 @@ +ignore: + - ".*/schema/.*" \ No newline at end of file diff --git a/backend/vendor/baliance.com/gooxml/color/color.go b/backend/vendor/baliance.com/gooxml/color/color.go new file mode 100644 index 00000000..d40e8480 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/color/color.go @@ -0,0 +1,42 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package color + +import ( + "baliance.com/gooxml" +) + +// Color is a 24 bit color that can be converted to +// internal ECMA-376 formats as needed. +type Color struct { + r, g, b, a uint8 + isAuto bool +} + +// RGB constructs a new RGB color with a given red, green and blue value. +func RGB(r, g, b uint8) Color { + return Color{r, g, b, 255, false} +} + +// IsAuto returns true if the color is the 'Auto' type. If the +// field doesn't support an Auto color, then black is used. +func (c Color) IsAuto() bool { + return c.isAuto +} + +// AsRGBString is used by the various wrappers to return a pointer +// to a string containing a six digit hex RGB value. +func (c Color) AsRGBString() *string { + return gooxml.Stringf("%02x%02x%02x", c.r, c.g, c.b) +} + +// AsRGBAString is used by the various wrappers to return a pointer +// to a string containing a six digit hex RGB value. +func (c Color) AsRGBAString() *string { + return gooxml.Stringf("%02x%02x%02x%02x", c.a, c.r, c.g, c.b) +} diff --git a/backend/vendor/baliance.com/gooxml/color/doc.go b/backend/vendor/baliance.com/gooxml/color/doc.go new file mode 100644 index 00000000..975b348e --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/color/doc.go @@ -0,0 +1,3 @@ +// Package color provides color handling structures and functions for use across +// all of the document types. +package color diff --git a/backend/vendor/baliance.com/gooxml/color/hex.go b/backend/vendor/baliance.com/gooxml/color/hex.go new file mode 100644 index 00000000..bb200065 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/color/hex.go @@ -0,0 +1,26 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package color + +import "fmt" + +func FromHex(s string) Color { + if len(s) == 0 { + return Auto + } + if s[0] == '#' { + s = s[1:] + } + //func Sscanf(str string, format string, a ...interface{}) (n int, err error) { + var r, g, b uint8 + n, _ := fmt.Sscanf(s, "%02x%02x%02x", &r, &g, &b) + if n == 3 { + return RGB(r, g, b) + } + return Auto +} diff --git a/backend/vendor/baliance.com/gooxml/color/names.go b/backend/vendor/baliance.com/gooxml/color/names.go new file mode 100644 index 00000000..6f373a97 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/color/names.go @@ -0,0 +1,160 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package color + +// Auto translates to an 'auto' tag in places where it's legal. +var Auto = Color{0, 0, 0, 255, true} + +var AliceBlue = Color{0xF0, 0xF8, 0xFF, 255, false} +var AntiqueWhite = Color{0xFA, 0xEB, 0xD7, 255, false} +var Aqua = Color{0x00, 0xFF, 0xFF, 255, false} +var Aquamarine = Color{0x7F, 0xFF, 0xD4, 255, false} +var Azure = Color{0xF0, 0xFF, 0xFF, 255, false} +var Beige = Color{0xF5, 0xF5, 0xDC, 255, false} +var Bisque = Color{0xFF, 0xE4, 0xC4, 255, false} +var Black = Color{0x00, 0x00, 0x00, 255, false} +var BlanchedAlmond = Color{0xFF, 0xEB, 0xCD, 255, false} +var Blue = Color{0x00, 0x00, 0xFF, 255, false} +var BlueViolet = Color{0x8A, 0x2B, 0xE2, 255, false} +var Brown = Color{0xA5, 0x2A, 0x2A, 255, false} +var BurlyWood = Color{0xDE, 0xB8, 0x87, 255, false} +var CadetBlue = Color{0x5F, 0x9E, 0xA0, 255, false} +var Chartreuse = Color{0x7F, 0xFF, 0x00, 255, false} +var Chocolate = Color{0xD2, 0x69, 0x1E, 255, false} +var Coral = Color{0xFF, 0x7F, 0x50, 255, false} +var CornflowerBlue = Color{0x64, 0x95, 0xED, 255, false} +var Cornsilk = Color{0xFF, 0xF8, 0xDC, 255, false} +var Crimson = Color{0xDC, 0x14, 0x3C, 255, false} +var Cyan = Color{0x00, 0xFF, 0xFF, 255, false} +var DarkBlue = Color{0x00, 0x00, 0x8B, 255, false} +var DarkCyan = Color{0x00, 0x8B, 0x8B, 255, false} +var DarkGoldenRod = Color{0xB8, 0x86, 0x0B, 255, false} +var DarkGray = Color{0xA9, 0xA9, 0xA9, 255, false} +var DarkGrey = Color{0xA9, 0xA9, 0xA9, 255, false} +var DarkGreen = Color{0x00, 0x64, 0x00, 255, false} +var DarkKhaki = Color{0xBD, 0xB7, 0x6B, 255, false} +var DarkMagenta = Color{0x8B, 0x00, 0x8B, 255, false} +var DarkOliveGreen = Color{0x55, 0x6B, 0x2F, 255, false} +var DarkOrange = Color{0xFF, 0x8C, 0x00, 255, false} +var DarkOrchid = Color{0x99, 0x32, 0xCC, 255, false} +var DarkRed = Color{0x8B, 0x00, 0x00, 255, false} +var DarkSalmon = Color{0xE9, 0x96, 0x7A, 255, false} +var DarkSeaGreen = Color{0x8F, 0xBC, 0x8F, 255, false} +var DarkSlateBlue = Color{0x48, 0x3D, 0x8B, 255, false} +var DarkSlateGray = Color{0x2F, 0x4F, 0x4F, 255, false} +var DarkSlateGrey = Color{0x2F, 0x4F, 0x4F, 255, false} +var DarkTurquoise = Color{0x00, 0xCE, 0xD1, 255, false} +var DarkViolet = Color{0x94, 0x00, 0xD3, 255, false} +var DeepPink = Color{0xFF, 0x14, 0x93, 255, false} +var DeepSkyBlue = Color{0x00, 0xBF, 0xFF, 255, false} +var DimGray = Color{0x69, 0x69, 0x69, 255, false} +var DimGrey = Color{0x69, 0x69, 0x69, 255, false} +var DodgerBlue = Color{0x1E, 0x90, 0xFF, 255, false} +var FireBrick = Color{0xB2, 0x22, 0x22, 255, false} +var FloralWhite = Color{0xFF, 0xFA, 0xF0, 255, false} +var ForestGreen = Color{0x22, 0x8B, 0x22, 255, false} +var Fuchsia = Color{0xFF, 0x00, 0xFF, 255, false} +var Gainsboro = Color{0xDC, 0xDC, 0xDC, 255, false} +var GhostWhite = Color{0xF8, 0xF8, 0xFF, 255, false} +var Gold = Color{0xFF, 0xD7, 0x00, 255, false} +var GoldenRod = Color{0xDA, 0xA5, 0x20, 255, false} +var Gray = Color{0x80, 0x80, 0x80, 255, false} +var Green = Color{0x00, 0x80, 0x00, 255, false} +var GreenYellow = Color{0xAD, 0xFF, 0x2F, 255, false} +var HoneyDew = Color{0xF0, 0xFF, 0xF0, 255, false} +var HotPink = Color{0xFF, 0x69, 0xB4, 255, false} +var IndianRed = Color{0xCD, 0x5C, 0x5C, 255, false} +var Indigo = Color{0x4B, 0x00, 0x82, 255, false} +var Ivory = Color{0xFF, 0xFF, 0xF0, 255, false} +var Khaki = Color{0xF0, 0xE6, 0x8C, 255, false} +var Lavender = Color{0xE6, 0xE6, 0xFA, 255, false} +var LavenderBlush = Color{0xFF, 0xF0, 0xF5, 255, false} +var LawnGreen = Color{0x7C, 0xFC, 0x00, 255, false} +var LemonChiffon = Color{0xFF, 0xFA, 0xCD, 255, false} +var LightBlue = Color{0xAD, 0xD8, 0xE6, 255, false} +var LightCoral = Color{0xF0, 0x80, 0x80, 255, false} +var LightCyan = Color{0xE0, 0xFF, 0xFF, 255, false} +var LightGoldenRodYellow = Color{0xFA, 0xFA, 0xD2, 255, false} +var LightGray = Color{0xD3, 0xD3, 0xD3, 255, false} +var LightGrey = Color{0xD3, 0xD3, 0xD3, 255, false} +var LightGreen = Color{0x90, 0xEE, 0x90, 255, false} +var LightPink = Color{0xFF, 0xB6, 0xC1, 255, false} +var LightSalmon = Color{0xFF, 0xA0, 0x7A, 255, false} +var LightSeaGreen = Color{0x20, 0xB2, 0xAA, 255, false} +var LightSkyBlue = Color{0x87, 0xCE, 0xFA, 255, false} +var LightSlateGray = Color{0x77, 0x88, 0x99, 255, false} +var LightSlateGrey = Color{0x77, 0x88, 0x99, 255, false} +var LightSteelBlue = Color{0xB0, 0xC4, 0xDE, 255, false} +var LightYellow = Color{0xFF, 0xFF, 0xE0, 255, false} +var Lime = Color{0x00, 0xFF, 0x00, 255, false} +var LimeGreen = Color{0x32, 0xCD, 0x32, 255, false} +var Linen = Color{0xFA, 0xF0, 0xE6, 255, false} +var Magenta = Color{0xFF, 0x00, 0xFF, 255, false} +var Maroon = Color{0x80, 0x00, 0x00, 255, false} +var MediumAquaMarine = Color{0x66, 0xCD, 0xAA, 255, false} +var MediumBlue = Color{0x00, 0x00, 0xCD, 255, false} +var MediumOrchid = Color{0xBA, 0x55, 0xD3, 255, false} +var MediumPurple = Color{0x93, 0x70, 0xDB, 255, false} +var MediumSeaGreen = Color{0x3C, 0xB3, 0x71, 255, false} +var MediumSlateBlue = Color{0x7B, 0x68, 0xEE, 255, false} +var MediumSpringGreen = Color{0x00, 0xFA, 0x9A, 255, false} +var MediumTurquoise = Color{0x48, 0xD1, 0xCC, 255, false} +var MediumVioletRed = Color{0xC7, 0x15, 0x85, 255, false} +var MidnightBlue = Color{0x19, 0x19, 0x70, 255, false} +var MintCream = Color{0xF5, 0xFF, 0xFA, 255, false} +var MistyRose = Color{0xFF, 0xE4, 0xE1, 255, false} +var Moccasin = Color{0xFF, 0xE4, 0xB5, 255, false} +var NavajoWhite = Color{0xFF, 0xDE, 0xAD, 255, false} +var Navy = Color{0x00, 0x00, 0x80, 255, false} +var OldLace = Color{0xFD, 0xF5, 0xE6, 255, false} +var Olive = Color{0x80, 0x80, 0x00, 255, false} +var OliveDrab = Color{0x6B, 0x8E, 0x23, 255, false} +var Orange = Color{0xFF, 0xA5, 0x00, 255, false} +var OrangeRed = Color{0xFF, 0x45, 0x00, 255, false} +var Orchid = Color{0xDA, 0x70, 0xD6, 255, false} +var PaleGoldenRod = Color{0xEE, 0xE8, 0xAA, 255, false} +var PaleGreen = Color{0x98, 0xFB, 0x98, 255, false} +var PaleTurquoise = Color{0xAF, 0xEE, 0xEE, 255, false} +var PaleVioletRed = Color{0xDB, 0x70, 0x93, 255, false} +var PapayaWhip = Color{0xFF, 0xEF, 0xD5, 255, false} +var PeachPuff = Color{0xFF, 0xDA, 0xB9, 255, false} +var Peru = Color{0xCD, 0x85, 0x3F, 255, false} +var Pink = Color{0xFF, 0xC0, 0xCB, 255, false} +var Plum = Color{0xDD, 0xA0, 0xDD, 255, false} +var PowderBlue = Color{0xB0, 0xE0, 0xE6, 255, false} +var Purple = Color{0x80, 0x00, 0x80, 255, false} +var RebeccaPurple = Color{0x66, 0x33, 0x99, 255, false} +var Red = Color{0xFF, 0x00, 0x00, 255, false} +var RosyBrown = Color{0xBC, 0x8F, 0x8F, 255, false} +var RoyalBlue = Color{0x41, 0x69, 0xE1, 255, false} +var SaddleBrown = Color{0x8B, 0x45, 0x13, 255, false} +var Salmon = Color{0xFA, 0x80, 0x72, 255, false} +var SandyBrown = Color{0xF4, 0xA4, 0x60, 255, false} +var SuccessGreen = Color{0x00, 0xCC, 0x00, 255, false} +var SeaGreen = Color{0x2E, 0x8B, 0x57, 255, false} +var SeaShell = Color{0xFF, 0xF5, 0xEE, 255, false} +var Sienna = Color{0xA0, 0x52, 0x2D, 255, false} +var Silver = Color{0xC0, 0xC0, 0xC0, 255, false} +var SkyBlue = Color{0x87, 0xCE, 0xEB, 255, false} +var SlateBlue = Color{0x6A, 0x5A, 0xCD, 255, false} +var SlateGray = Color{0x70, 0x80, 0x90, 255, false} +var SlateGrey = Color{0x70, 0x80, 0x90, 255, false} +var Snow = Color{0xFF, 0xFA, 0xFA, 255, false} +var SpringGreen = Color{0x00, 0xFF, 0x7F, 255, false} +var SteelBlue = Color{0x46, 0x82, 0xB4, 255, false} +var Tan = Color{0xD2, 0xB4, 0x8C, 255, false} +var Teal = Color{0x00, 0x80, 0x80, 255, false} +var Thistle = Color{0xD8, 0xBF, 0xD8, 255, false} +var Tomato = Color{0xFF, 0x63, 0x47, 255, false} +var Turquoise = Color{0x40, 0xE0, 0xD0, 255, false} +var Violet = Color{0xEE, 0x82, 0xEE, 255, false} +var Wheat = Color{0xF5, 0xDE, 0xB3, 255, false} +var White = Color{0xFF, 0xFF, 0xFF, 255, false} +var WhiteSmoke = Color{0xF5, 0xF5, 0xF5, 255, false} +var Yellow = Color{0xFF, 0xFF, 0x00, 255, false} +var YellowGreen = Color{0x9A, 0xCD, 0x32, 255, false} diff --git a/backend/vendor/baliance.com/gooxml/common/appproperties.go b/backend/vendor/baliance.com/gooxml/common/appproperties.go new file mode 100644 index 00000000..0610bf36 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/common/appproperties.go @@ -0,0 +1,95 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package common + +import ( + "fmt" + "strconv" + "strings" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/extended_properties" +) + +// AppProperties contains properties specific to the document and the +// application that created it. +type AppProperties struct { + x *extended_properties.Properties +} + +// NewAppProperties constructs a new AppProperties. +func NewAppProperties() AppProperties { + p := AppProperties{x: extended_properties.NewProperties()} + p.SetCompany("Baliance LLC") + p.SetApplication("baliance.com/gooxml") + p.SetDocSecurity(0) + p.SetLinksUpToDate(false) + // trim the 'v' + ver := strings.Replace(gooxml.ReleaseVersion, "v", "", -1) + f, _ := strconv.ParseFloat(ver, 64) + p.SetApplicationVersion(fmt.Sprintf("%07.4f", f)) + return p +} + +// Application returns the name of the application that created the document. +// For gooxml created documents, it defaults to baliance.com/gooxml +func (a AppProperties) Application() string { + if a.x.Application != nil { + return *a.x.Application + } + return "" +} + +// SetLinksUpToDate sets the links up to date flag. +func (a AppProperties) SetLinksUpToDate(v bool) { + a.x.LinksUpToDate = gooxml.Bool(v) +} + +// SetDocSecurity sets the document security flag. +func (a AppProperties) SetDocSecurity(v int32) { + a.x.DocSecurity = gooxml.Int32(v) +} + +// SetApplication sets the name of the application that created the document. +func (a AppProperties) SetApplication(s string) { + a.x.Application = &s +} + +// ApplicationVersion returns the version of the application that created the +// document. +func (a AppProperties) ApplicationVersion() string { + if a.x.AppVersion != nil { + return *a.x.AppVersion + } + return "" +} + +// 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 +} + +// X returns the inner wrapped XML type. +func (a AppProperties) X() *extended_properties.Properties { + return a.x +} + +// Company returns the name of the company that created the document. +// For gooxml created documents, it defaults to baliance.com/gooxml +func (a AppProperties) Company() string { + if a.x.Company != nil { + return *a.x.Company + } + return "" +} + +// SetCompany sets the name of the company that created the document. +func (a AppProperties) SetCompany(s string) { + a.x.Company = &s +} diff --git a/backend/vendor/baliance.com/gooxml/common/contenttypes.go b/backend/vendor/baliance.com/gooxml/common/contenttypes.go new file mode 100644 index 00000000..93a154f7 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/common/contenttypes.go @@ -0,0 +1,110 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package common + +import ( + "strings" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/pkg/content_types" +) + +// ContentTypes is the top level "[Content_Types].xml" in a zip package. +type ContentTypes struct { + x *content_types.Types +} + +// NewContentTypes returns a wrapper around a newly constructed content-types. +func NewContentTypes() ContentTypes { + ct := ContentTypes{x: content_types.NewTypes()} + // add content type defaults + ct.AddDefault("xml", "application/xml") + ct.AddDefault("rels", "application/vnd.openxmlformats-package.relationships+xml") + ct.AddDefault("png", "image/png") + ct.AddDefault("jpeg", "image/jpeg") + ct.AddDefault("jpg", "image/jpg") + ct.AddDefault("wmf", "image/x-wmf") + + ct.AddOverride("/docProps/core.xml", "application/vnd.openxmlformats-package.core-properties+xml") + ct.AddOverride("/docProps/app.xml", "application/vnd.openxmlformats-officedocument.extended-properties+xml") + + return ct +} + +// X returns the inner raw content types. +func (c ContentTypes) X() *content_types.Types { + return c.x +} + +// AddDefault registers a default content type for a given file extension. +func (c ContentTypes) AddDefault(fileExtension string, contentType string) { + def := content_types.NewDefault() + def.ExtensionAttr = fileExtension + def.ContentTypeAttr = contentType + c.x.Default = append(c.x.Default, def) +} + +// AddOverride adds an override content type for a given path name. +func (c ContentTypes) AddOverride(path, contentType string) { + if !strings.HasPrefix(path, "/") { + path = "/" + path + } + if strings.HasPrefix(contentType, "http") { + gooxml.Log("content type '%s' is incorrect, must not start with http", contentType) + } + or := content_types.NewOverride() + or.PartNameAttr = path + or.ContentTypeAttr = contentType + c.x.Override = append(c.x.Override, or) +} + +// EnsureDefault esnures that an extension and default content type exist, +// adding it if necessary. +func (c ContentTypes) EnsureDefault(ext, contentType string) { + for _, def := range c.x.Default { + if def.ExtensionAttr == ext { + def.ContentTypeAttr = contentType + return + } + } + + def := &content_types.Default{} + def.ContentTypeAttr = contentType + def.ExtensionAttr = ext + c.x.Default = append(c.x.Default, def) +} + +// EnsureOverride ensures that an override for the given path exists, adding it if necessary +func (c ContentTypes) EnsureOverride(path, contentType string) { + for _, ovr := range c.x.Override { + // found one, so just ensure the content type matches and bail + if ovr.PartNameAttr == path { + if strings.HasPrefix(contentType, "http") { + gooxml.Log("content type '%s' is incorrect, must not start with http", contentType) + } + ovr.ContentTypeAttr = contentType + return + } + } + + // Didn't find a matching override for the target path, so add one + c.AddOverride(path, contentType) +} + +// RemoveOverride removes an override given a path. +func (c ContentTypes) RemoveOverride(path string) { + if !strings.HasPrefix(path, "/") { + path = "/" + path + } + for i, ovr := range c.x.Override { + if ovr.PartNameAttr == path { + copy(c.x.Override[i:], c.x.Override[i+1:]) + c.x.Override = c.x.Override[0 : len(c.x.Override)-1] + } + } +} diff --git a/backend/vendor/baliance.com/gooxml/common/coreproperties.go b/backend/vendor/baliance.com/gooxml/common/coreproperties.go new file mode 100644 index 00000000..4978f8c5 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/common/coreproperties.go @@ -0,0 +1,175 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package common + +import ( + "encoding/xml" + "time" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/pkg/metadata/core_properties" +) + +// CoreProperties contains document specific properties. +type CoreProperties struct { + x *core_properties.CoreProperties +} + +// NewCoreProperties constructs a new CoreProperties. +func NewCoreProperties() CoreProperties { + return CoreProperties{x: core_properties.NewCoreProperties()} +} + +// X returns the inner wrapped XML type. +func (c CoreProperties) X() *core_properties.CoreProperties { + return c.x +} + +// Category returns the category of the document +func (c CoreProperties) Category() string { + if c.x.Category != nil { + return *c.x.Category + } + return "" +} + +// SetCategory records the category of the document. +func (c CoreProperties) SetCategory(s string) { + c.x.Category = &s +} + +// ContentStatus returns the content status of the document (e.g. "Final", "Draft") +func (c CoreProperties) ContentStatus() string { + if c.x.ContentStatus != nil { + return *c.x.ContentStatus + } + return "" +} + +// SetContentStatus records the content status of the document. +func (c CoreProperties) SetContentStatus(s string) { + c.x.ContentStatus = &s +} + +// Author returns the author of the document +func (c CoreProperties) Author() string { + if c.x.Creator != nil { + return string(c.x.Creator.Data) + } + return "" +} + +// SetAuthor records the author of the document. +func (c CoreProperties) SetAuthor(s string) { + if c.x.Creator == nil { + c.x.Creator = &gooxml.XSDAny{XMLName: xml.Name{Local: "dc:creator"}} + } + c.x.Creator.Data = []byte(s) +} + +// LastModifiedBy returns the name of the last person to modify the document +func (c CoreProperties) LastModifiedBy() string { + if c.x.LastModifiedBy != nil { + return *c.x.LastModifiedBy + } + return "" +} + +// SetLastModifiedBy records the last person to modify the document. +func (c CoreProperties) SetLastModifiedBy(s string) { + c.x.LastModifiedBy = &s +} + +// SetLanguage records the language of the document. +func (c CoreProperties) SetLanguage(s string) { + c.x.Language = &gooxml.XSDAny{XMLName: xml.Name{Local: "dc:language"}} + c.x.Language.Data = []byte(s) +} + +const cpTimeFormatW3CDTF = "2006-01-02T15:04:05Z" + +func parseTime(x *gooxml.XSDAny) time.Time { + if x == nil { + return time.Time{} + } + + // We should be checking the attributes as it can specify the format, + // however I've only ever seen the W3CDTF format so I wouldn't know what code + // to write to handle any other format anyway. If you see another format + // in the wild, please let me know. + + t, err := time.Parse(cpTimeFormatW3CDTF, string(x.Data)) + if err != nil { + gooxml.Log("error parsing time from %s: %s", string(x.Data), err) + } + return t +} + +// Created returns the time that the document was created. +func (c CoreProperties) Created() time.Time { + return parseTime(c.x.Created) +} + +func cpSetTime(t time.Time, name string) *gooxml.XSDAny { + x := &gooxml.XSDAny{XMLName: xml.Name{Local: name}} + x.Attrs = append(x.Attrs, + xml.Attr{Name: xml.Name{Local: "xsi:type"}, Value: "dcterms:W3CDTF"}) + x.Attrs = append(x.Attrs, + xml.Attr{Name: xml.Name{Local: "xmlns:xsi"}, Value: "http://www.w3.org/2001/XMLSchema-instance"}) + x.Attrs = append(x.Attrs, + xml.Attr{Name: xml.Name{Local: "xmlns:dcterms"}, Value: "http://purl.org/dc/terms/"}) + x.Data = []byte(t.Format(cpTimeFormatW3CDTF)) + return x +} + +// SetCreated sets the time that the document was created. +func (c CoreProperties) SetCreated(t time.Time) { + c.x.Created = cpSetTime(t, "dcterms:created") +} + +// Modified returns the time that the document was modified. +func (c CoreProperties) Modified() time.Time { + return parseTime(c.x.Modified) +} + +// SetModified sets the time that the document was modified. +func (c CoreProperties) SetModified(t time.Time) { + c.x.Modified = cpSetTime(t, "dcterms:modified") +} + +// Title returns the Title of the document +func (c CoreProperties) Title() string { + if c.x.Title != nil { + return string(c.x.Title.Data) + } + return "" +} + +// SetTitle records the title of the document. +func (c CoreProperties) SetTitle(s string) { + if c.x.Title == nil { + c.x.Title = &gooxml.XSDAny{XMLName: xml.Name{Local: "dc:title"}} + } + c.x.Title.Data = []byte(s) +} + +// Description returns the description of the document +func (c CoreProperties) Description() string { + if c.x.Description != nil { + return string(c.x.Description.Data) + } + return "" +} + +// SetDescription records the description of the document. +func (c CoreProperties) SetDescription(s string) { + if c.x.Description == nil { + c.x.Description = &gooxml.XSDAny{XMLName: xml.Name{Local: "dc:description"}} + } + c.x.Description.Data = []byte(s) +} diff --git a/backend/vendor/baliance.com/gooxml/common/doc.go b/backend/vendor/baliance.com/gooxml/common/doc.go new file mode 100644 index 00000000..4f44cf13 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/common/doc.go @@ -0,0 +1,3 @@ +// Package common contains wrapper types and utilities common to all of the +// OOXML document formats. +package common diff --git a/backend/vendor/baliance.com/gooxml/common/docbase.go b/backend/vendor/baliance.com/gooxml/common/docbase.go new file mode 100644 index 00000000..eb4d3d78 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/common/docbase.go @@ -0,0 +1,63 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package common + +import ( + "archive/zip" + "fmt" + "image" + + "baliance.com/gooxml/zippkg" +) + +// DocBase is the type embedded in in the Document/Workbook/Presentation types +// that contains members common to all. +type DocBase struct { + ContentTypes ContentTypes + AppProperties AppProperties + Rels Relationships + CoreProperties CoreProperties + Thumbnail image.Image // thumbnail preview of the document + + Images []ImageRef + ExtraFiles []ExtraFile + TmpPath string // path where temporary files are stored when opening documents + +} + +// AddExtraFileFromZip is used when reading an unsupported file from an OOXML +// file. This ensures that unsupported file content will at least round-trip +// correctly. +func (d *DocBase) AddExtraFileFromZip(f *zip.File) error { + path, err := zippkg.ExtractToDiskTmp(f, d.TmpPath) + if err != nil { + return fmt.Errorf("error extracting unsupported file: %s", err) + } + d.ExtraFiles = append(d.ExtraFiles, ExtraFile{ + ZipPath: f.Name, + DiskPath: path, + }) + return nil +} + +// WriteExtraFiles writes the extra files to the zip package. +func (d *DocBase) WriteExtraFiles(z *zip.Writer) error { + for _, ef := range d.ExtraFiles { + if err := zippkg.AddFileFromDisk(z, ef.ZipPath, ef.DiskPath); err != nil { + return err + } + } + return nil +} + +// ExtraFile is an unsupported file type extracted from, or to be written to a +// zip package +type ExtraFile struct { + ZipPath string + DiskPath string +} diff --git a/backend/vendor/baliance.com/gooxml/common/image.go b/backend/vendor/baliance.com/gooxml/common/image.go new file mode 100644 index 00000000..0abc9bec --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/common/image.go @@ -0,0 +1,104 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package common + +import ( + "fmt" + "image" + "os" + + "baliance.com/gooxml/measurement" + // Add image format support + _ "image/gif" + _ "image/jpeg" + _ "image/png" +) + +// Image is a container for image information. It's used as we need format and +// and size information to use images. +type Image struct { + Size image.Point + Format string + Path string +} + +// ImageRef is a reference to an image within a document. +type ImageRef struct { + d *DocBase + rels Relationships + img Image + relID string +} + +// MakeImageRef constructs an image reference which is a reference to a +// particular image file inside a document. The same image can be used multiple +// times in a document by re-use the ImageRef. +func MakeImageRef(img Image, d *DocBase, rels Relationships) ImageRef { + return ImageRef{img: img, d: d, rels: rels} +} + +func (i *ImageRef) SetRelID(id string) { + i.relID = id +} + +// RelID returns the relationship ID. +func (i ImageRef) RelID() string { + return i.relID +} + +// Format returns the format of the underlying image +func (i ImageRef) Format() string { + return i.img.Format +} + +// Path returns the path to an image file +func (i ImageRef) Path() string { + return i.img.Path +} + +// Size returns the size of an image +func (i ImageRef) Size() image.Point { + return i.img.Size +} + +// RelativeHeight returns the relative height of an image given a fixed width. +// This is used when setting image to a fixed width to calculate the height +// required to keep the same image aspect ratio. +func (i ImageRef) RelativeHeight(w measurement.Distance) measurement.Distance { + hScale := float64(i.Size().Y) / float64(i.Size().X) + return w * measurement.Distance(hScale) +} + +// RelativeWidth returns the relative width of an image given a fixed height. +// This is used when setting image to a fixed height to calculate the width +// required to keep the same image aspect ratio. +func (i ImageRef) RelativeWidth(h measurement.Distance) measurement.Distance { + wScale := float64(i.Size().X) / float64(i.Size().Y) + return h * measurement.Distance(wScale) +} + +// ImageFromFile reads an image from a file on disk. It doesn't keep the image +// in memory and only reads it to determine the format and size. You can also +// construct an Image directly if the file and size are known. +func ImageFromFile(path string) (Image, error) { + f, err := os.Open(path) + r := Image{} + if err != nil { + return r, fmt.Errorf("error reading image: %s", err) + } + defer f.Close() + imgDec, ifmt, err := image.Decode(f) + if err != nil { + return r, fmt.Errorf("unable to parse image: %s", err) + } + + r.Path = path + r.Format = ifmt + r.Size = imgDec.Bounds().Size() + return r, nil +} diff --git a/backend/vendor/baliance.com/gooxml/common/relationship.go b/backend/vendor/baliance.com/gooxml/common/relationship.go new file mode 100644 index 00000000..657d68ef --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/common/relationship.go @@ -0,0 +1,53 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package common + +import ( + "fmt" + + "baliance.com/gooxml/schema/soo/pkg/relationships" +) + +// Relationship is a relationship within a .rels file. +type Relationship struct { + x *relationships.Relationship +} + +// NewRelationship constructs a new relationship. +func NewRelationship() Relationship { + return Relationship{relationships.NewRelationship()} +} + +// X returns the inner wrapped XML type. +func (r Relationship) X() *relationships.Relationship { + return r.x +} + +// ID returns the ID of a relationship. +func (r Relationship) ID() string { + return r.x.IdAttr +} + +// SetTarget set the target (path) of a relationship. +func (r Relationship) SetTarget(s string) { + r.x.TargetAttr = s +} + +// Target returns the target (path) of a relationship. +func (r Relationship) Target() string { + return r.x.TargetAttr +} + +// Type returns the type of a relationship. +func (r Relationship) Type() string { + return r.x.TypeAttr +} + +func (r Relationship) String() string { + return fmt.Sprintf("{ID: %s Target: %s Type: %s}", r.ID(), r.Target(), r.Type()) +} diff --git a/backend/vendor/baliance.com/gooxml/common/relationships.go b/backend/vendor/baliance.com/gooxml/common/relationships.go new file mode 100644 index 00000000..4481559f --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/common/relationships.go @@ -0,0 +1,105 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package common + +import ( + "fmt" + "strings" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/pkg/relationships" +) + +// Relationships represents a .rels file. +type Relationships struct { + x *relationships.Relationships +} + +// NewRelationships creates a new relationship wrapper. +func NewRelationships() Relationships { + return Relationships{x: relationships.NewRelationships()} +} + +// X returns the underlying raw XML data. +func (r Relationships) X() *relationships.Relationships { + return r.x +} + +// IsEmpty returns true if there are no relationships. +func (r Relationships) IsEmpty() bool { + return r.x == nil || len(r.x.Relationship) == 0 +} + +// Clear removes any existing relationships. +func (r Relationships) Clear() { + r.x.Relationship = nil +} + +// FindRIDForN returns the relationship ID for the i'th relationship of type t. +func (r Relationships) FindRIDForN(i int, t string) string { + for _, rel := range r.x.CT_Relationships.Relationship { + if rel.TypeAttr == t { + if i == 0 { + return rel.IdAttr + } + i-- + } + } + return "" +} + +// AddAutoRelationship adds a relationship with an automatically generated +// filename based off of the type. It should be preferred over AddRelationship +// to ensure consistent filenames are maintained. +func (r Relationships) AddAutoRelationship(dt gooxml.DocType, src string, idx int, ctype string) Relationship { + return r.AddRelationship(gooxml.RelativeFilename(dt, src, ctype, idx), ctype) +} + +// AddRelationship adds a relationship. +func (r Relationships) AddRelationship(target, ctype string) Relationship { + if !strings.HasPrefix(ctype, "http://") { + gooxml.Log("relationship type %s should start with 'http://'", ctype) + } + rel := relationships.NewRelationship() + nextID := len(r.x.Relationship) + 1 + used := map[string]struct{}{} + + // identify IDs in use + for _, exRel := range r.x.Relationship { + used[exRel.IdAttr] = struct{}{} + } + // find the next ID that is unused + for _, ok := used[fmt.Sprintf("rId%d", nextID)]; ok; _, ok = used[fmt.Sprintf("rId%d", nextID)] { + nextID++ + + } + rel.IdAttr = fmt.Sprintf("rId%d", nextID) + rel.TargetAttr = target + rel.TypeAttr = ctype + r.x.Relationship = append(r.x.Relationship, rel) + return Relationship{rel} +} + +// Hyperlink is just an appropriately configured relationship. +type Hyperlink Relationship + +// AddHyperlink adds an external hyperlink relationship. +func (r Relationships) AddHyperlink(target string) Hyperlink { + rel := r.AddRelationship(target, gooxml.HyperLinkType) + rel.x.TargetModeAttr = relationships.ST_TargetModeExternal + return Hyperlink(rel) +} + +// Relationships returns a slice of all of the relationships. +func (r Relationships) Relationships() []Relationship { + ret := []Relationship{} + for _, x := range r.x.Relationship { + ret = append(ret, Relationship{x}) + } + return ret +} diff --git a/backend/vendor/baliance.com/gooxml/common/theme.go b/backend/vendor/baliance.com/gooxml/common/theme.go new file mode 100644 index 00000000..fc1b3d86 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/common/theme.go @@ -0,0 +1,25 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package common + +import "baliance.com/gooxml/schema/soo/dml" + +// Theme is a drawingml theme. +type Theme struct { + x *dml.Theme +} + +// NewTheme constructs a new theme. +func NewTheme() Theme { + return Theme{dml.NewTheme()} +} + +// X returns the inner wrapped XML type. +func (t Theme) X() *dml.Theme { + return t.x +} diff --git a/backend/vendor/baliance.com/gooxml/creator.go b/backend/vendor/baliance.com/gooxml/creator.go new file mode 100644 index 00000000..c877fb48 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/creator.go @@ -0,0 +1,50 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package gooxml + +import ( + "encoding/xml" + "errors" + "fmt" + "reflect" +) + +// Any is the interface used for marshaling/unmarshaling xsd:any +type Any interface { + MarshalXML(e *xml.Encoder, start xml.StartElement) error + UnmarshalXML(d *xml.Decoder, start xml.StartElement) error +} + +var creatorFns = map[string]interface{}{} + +// RegisterConstructor registers a constructor function used for unmarshaling +// xsd:any elements. +func RegisterConstructor(ns, name string, fn interface{}) { + creatorFns[ns+"/"+name] = fn +} + +// CreateElement creates an element with the given namespace and name. It is +// used to unmarshal some xsd:any elements to the appropriate concrete type. +func CreateElement(start xml.StartElement) (Any, error) { + fn, ok := creatorFns[start.Name.Space+"/"+start.Name.Local] + if !ok { + r := &XSDAny{} + return r, nil + } + + v := reflect.ValueOf(fn) + res := v.Call(nil) + if len(res) != 1 { + return nil, fmt.Errorf("constructor function should return one value, got %d", len(res)) + } + any, ok := res[0].Interface().(Any) + if !ok { + return nil, errors.New("constructor function should return any 'Any'") + } + return any, nil +} diff --git a/backend/vendor/baliance.com/gooxml/doc.go b/backend/vendor/baliance.com/gooxml/doc.go new file mode 100644 index 00000000..5b10e807 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/doc.go @@ -0,0 +1,29 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +/* + +Package gooxml provides creation, reading, and writing of ECMA 376 Office Open +XML documents, spreadsheets and presentations. It is still early in +development, but is progressing quickly. This library takes a slightly +different approach from others, in that it starts by trying to support all of +the ECMA-376 standard when marshaling/unmarshaling XML documents. From there it +adds wrappers around the ECMA-376 derived types that provide a more convenient +interface. + +The raw XML based types reside in the `schema/`` directory. These types are +always accessible from the wrapper types via a `X() method that returns the +raw type. Except for the base documents (document.Document, +spreadsheet.Workbook and presentation.Presentation), the other wrapper types are +value types with non-pointer methods. They exist solely to modify and return +data from one or more XML types. + +The packages of interest are baliance.com/gooxml/document, +baliance/gooxml/spreadsheet and baliance.com/gooxml/presentation. + +*/ +package gooxml // import "baliance.com/gooxml" diff --git a/backend/vendor/baliance.com/gooxml/document/anchoreddrawing.go b/backend/vendor/baliance.com/gooxml/document/anchoreddrawing.go new file mode 100644 index 00000000..4dbfc683 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/anchoreddrawing.go @@ -0,0 +1,120 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package document + +import ( + "baliance.com/gooxml" + "baliance.com/gooxml/common" + "baliance.com/gooxml/measurement" + pic "baliance.com/gooxml/schema/soo/dml/picture" + "baliance.com/gooxml/schema/soo/wml" +) + +// AnchoredDrawing is an absolutely positioned image within a document page. +type AnchoredDrawing struct { + d *Document + x *wml.WdAnchor +} + +// X returns the inner wrapped XML type. +func (a AnchoredDrawing) X() *wml.WdAnchor { + return a.x +} + +// GetImage returns the ImageRef associated with an AnchoredDrawing. +func (a AnchoredDrawing) GetImage() (common.ImageRef, bool) { + any := a.x.Graphic.GraphicData.Any + if len(any) > 0 { + p, ok := any[0].(*pic.Pic) + if ok { + if p.BlipFill != nil && p.BlipFill.Blip != nil && p.BlipFill.Blip.EmbedAttr != nil { + return a.d.GetImageByRelID(*p.BlipFill.Blip.EmbedAttr) + } + } + } + return common.ImageRef{}, false +} + +// SetName sets the name of the image, visible in the properties of the image +// within Word. +func (a AnchoredDrawing) SetName(name string) { + a.x.DocPr.NameAttr = name + for _, a := range a.x.Graphic.GraphicData.Any { + if p, ok := a.(*pic.Pic); ok { + p.NvPicPr.CNvPr.DescrAttr = gooxml.String(name) + } + } +} + +// SetOrigin sets the origin of the image. It defaults to ST_RelFromHPage and +// ST_RelFromVPage +func (a AnchoredDrawing) SetOrigin(h wml.WdST_RelFromH, v wml.WdST_RelFromV) { + a.x.PositionH.RelativeFromAttr = h + a.x.PositionV.RelativeFromAttr = v +} + +// SetOffset sets the offset of the image relative to the origin, which by +// default this is the top-left corner of the page. Offset is incompatible with +// SetAlignment, whichever is called last is applied. +func (a AnchoredDrawing) SetOffset(x, y measurement.Distance) { + a.SetXOffset(x) + a.SetYOffset(y) +} + +// SetXOffset sets the X offset for an image relative to the origin. +func (a AnchoredDrawing) SetXOffset(x measurement.Distance) { + a.x.PositionH.Choice = &wml.WdCT_PosHChoice{} + a.x.PositionH.Choice.PosOffset = gooxml.Int32(int32(x / measurement.EMU)) +} + +// SetYOffset sets the Y offset for an image relative to the origin. +func (a AnchoredDrawing) SetYOffset(y measurement.Distance) { + a.x.PositionV.Choice = &wml.WdCT_PosVChoice{} + a.x.PositionV.Choice.PosOffset = gooxml.Int32(int32(y / measurement.EMU)) +} + +// SetAlignment positions an anchored image via alignment. Offset is +// incompatible with SetOffset, whichever is called last is applied. +func (a AnchoredDrawing) SetAlignment(h wml.WdST_AlignH, v wml.WdST_AlignV) { + a.SetHAlignment(h) + a.SetVAlignment(v) +} + +// SetHAlignment sets the horizontal alignment for an anchored image. +func (a AnchoredDrawing) SetHAlignment(h wml.WdST_AlignH) { + a.x.PositionH.Choice = &wml.WdCT_PosHChoice{} + a.x.PositionH.Choice.Align = h +} + +// SetVAlignment sets the vertical alignment for an anchored image. +func (a AnchoredDrawing) SetVAlignment(v wml.WdST_AlignV) { + a.x.PositionV.Choice = &wml.WdCT_PosVChoice{} + a.x.PositionV.Choice.Align = v +} + +// SetSize sets the size of the displayed image on the page. +func (a AnchoredDrawing) SetSize(w, h measurement.Distance) { + a.x.Extent.CxAttr = int64(float64(w*measurement.Pixel72) / measurement.EMU) + a.x.Extent.CyAttr = int64(float64(h*measurement.Pixel72) / measurement.EMU) +} + +// SetTextWrapNone unsets text wrapping so the image can float on top of the +// text. When used in conjunction with X/Y Offset relative to the page it can be +// used to place a logo at the top of a page at an absolute position that +// doesn't interfere with text. +func (a AnchoredDrawing) SetTextWrapNone() { + a.x.Choice = &wml.WdEG_WrapTypeChoice{} + a.x.Choice.WrapNone = wml.NewWdCT_WrapNone() +} + +// SetTextWrapSquare sets the text wrap to square with a given wrap type. +func (a AnchoredDrawing) SetTextWrapSquare(t wml.WdST_WrapText) { + a.x.Choice = &wml.WdEG_WrapTypeChoice{} + a.x.Choice.WrapSquare = wml.NewWdCT_WrapSquare() + a.x.Choice.WrapSquare.WrapTextAttr = t +} diff --git a/backend/vendor/baliance.com/gooxml/document/bookmark.go b/backend/vendor/baliance.com/gooxml/document/bookmark.go new file mode 100644 index 00000000..45643ec5 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/bookmark.go @@ -0,0 +1,33 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package document + +import "baliance.com/gooxml/schema/soo/wml" + +// Bookmark is a bookmarked location within a document that can be referenced +// with a hyperlink. +type Bookmark struct { + x *wml.CT_Bookmark +} + +// X returns the inner wrapped XML type. +func (b Bookmark) X() *wml.CT_Bookmark { + return b.x +} + +// SetName sets the name of the bookmark. This is the name that is used to +// reference the bookmark from hyperlinks. +func (b Bookmark) SetName(name string) { + b.x.NameAttr = name +} + +// Name returns the name of the bookmark whcih is the document unique ID that +// identifies the bookmark. +func (b Bookmark) Name() string { + return b.x.NameAttr +} diff --git a/backend/vendor/baliance.com/gooxml/document/cell.go b/backend/vendor/baliance.com/gooxml/document/cell.go new file mode 100644 index 00000000..a4f4cd14 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/cell.go @@ -0,0 +1,54 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package document + +import "baliance.com/gooxml/schema/soo/wml" + +// Cell is a table cell within a document (not a spreadsheet) +type Cell struct { + d *Document + x *wml.CT_Tc +} + +// X returns the inner wrapped XML type. +func (c Cell) X() *wml.CT_Tc { + return c.x +} + +// AddParagraph adds a paragraph to the table cell. +func (c Cell) AddParagraph() Paragraph { + ble := wml.NewEG_BlockLevelElts() + c.x.EG_BlockLevelElts = append(c.x.EG_BlockLevelElts, ble) + bc := wml.NewEG_ContentBlockContent() + ble.EG_ContentBlockContent = append(ble.EG_ContentBlockContent, bc) + p := wml.NewCT_P() + bc.P = append(bc.P, p) + + return Paragraph{c.d, p} +} + +// Properties returns the cell properties. +func (c Cell) Properties() CellProperties { + if c.x.TcPr == nil { + c.x.TcPr = wml.NewCT_TcPr() + } + return CellProperties{c.x.TcPr} +} + +// Paragraphs returns the paragraphs defined in the cell. +func (c Cell) Paragraphs() []Paragraph { + ret := []Paragraph{} + for _, ble := range c.x.EG_BlockLevelElts { + for _, cbc := range ble.EG_ContentBlockContent { + for _, p := range cbc.P { + ret = append(ret, Paragraph{c.d, p}) + } + } + } + return ret +} diff --git a/backend/vendor/baliance.com/gooxml/document/cellborders.go b/backend/vendor/baliance.com/gooxml/document/cellborders.go new file mode 100644 index 00000000..caa818e7 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/cellborders.go @@ -0,0 +1,70 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package document + +import ( + "baliance.com/gooxml/color" + "baliance.com/gooxml/measurement" + "baliance.com/gooxml/schema/soo/wml" +) + +// CellBorders are the borders for an individual +type CellBorders struct { + x *wml.CT_TcBorders +} + +// X returns the inner wrapped type +func (b CellBorders) X() *wml.CT_TcBorders { + return b.x +} + +// SetAll sets all of the borders to a given value. +func (b CellBorders) SetAll(t wml.ST_Border, c color.Color, thickness measurement.Distance) { + b.SetBottom(t, c, thickness) + b.SetLeft(t, c, thickness) + b.SetRight(t, c, thickness) + b.SetTop(t, c, thickness) + b.SetInsideHorizontal(t, c, thickness) + b.SetInsideVertical(t, c, thickness) +} + +// SetBottom sets the bottom border to a specified type, color and thickness. +func (b CellBorders) SetBottom(t wml.ST_Border, c color.Color, thickness measurement.Distance) { + b.x.Bottom = wml.NewCT_Border() + setBorder(b.x.Bottom, t, c, thickness) +} + +// SetTop sets the top border to a specified type, color and thickness. +func (b CellBorders) SetTop(t wml.ST_Border, c color.Color, thickness measurement.Distance) { + b.x.Top = wml.NewCT_Border() + setBorder(b.x.Top, t, c, thickness) +} + +// SetLeft sets the left border to a specified type, color and thickness. +func (b CellBorders) SetLeft(t wml.ST_Border, c color.Color, thickness measurement.Distance) { + b.x.Left = wml.NewCT_Border() + setBorder(b.x.Left, t, c, thickness) +} + +// SetRight sets the right border to a specified type, color and thickness. +func (b CellBorders) SetRight(t wml.ST_Border, c color.Color, thickness measurement.Distance) { + b.x.Right = wml.NewCT_Border() + setBorder(b.x.Right, t, c, thickness) +} + +// SetInsideHorizontal sets the interior horizontal borders to a specified type, color and thickness. +func (b CellBorders) SetInsideHorizontal(t wml.ST_Border, c color.Color, thickness measurement.Distance) { + b.x.InsideH = wml.NewCT_Border() + setBorder(b.x.InsideH, t, c, thickness) +} + +// SetInsideVertical sets the interior vertical borders to a specified type, color and thickness. +func (b CellBorders) SetInsideVertical(t wml.ST_Border, c color.Color, thickness measurement.Distance) { + b.x.InsideV = wml.NewCT_Border() + setBorder(b.x.InsideV, t, c, thickness) +} diff --git a/backend/vendor/baliance.com/gooxml/document/cellmargins.go b/backend/vendor/baliance.com/gooxml/document/cellmargins.go new file mode 100644 index 00000000..3d733b7c --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/cellmargins.go @@ -0,0 +1,92 @@ +// Copyright 2018 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package document + +import ( + "baliance.com/gooxml" + "baliance.com/gooxml/measurement" + "baliance.com/gooxml/schema/soo/wml" +) + +// CellMargins are the margins for an individual cell. +type CellMargins struct { + x *wml.CT_TcMar +} + +func setCellMarginPercent(w *wml.CT_TblWidth, pct float64) { + w.TypeAttr = wml.ST_TblWidthPct + w.WAttr = &wml.ST_MeasurementOrPercent{} + w.WAttr.ST_DecimalNumberOrPercent = &wml.ST_DecimalNumberOrPercent{} + w.WAttr.ST_DecimalNumberOrPercent.ST_UnqualifiedPercentage = gooxml.Int64(int64(pct * 50)) +} +func setCellMargin(w *wml.CT_TblWidth, d measurement.Distance) { + w.TypeAttr = wml.ST_TblWidthDxa + w.WAttr = &wml.ST_MeasurementOrPercent{} + w.WAttr.ST_DecimalNumberOrPercent = &wml.ST_DecimalNumberOrPercent{} + w.WAttr.ST_DecimalNumberOrPercent.ST_UnqualifiedPercentage = gooxml.Int64(int64(d / measurement.Dxa)) +} + +// SetTopPct sets the cell top margin +func (c CellMargins) SetTopPct(pct float64) { + c.x.Top = wml.NewCT_TblWidth() + setCellMarginPercent(c.x.Top, pct) +} + +// SetTop sets the cell top margin +func (c CellMargins) SetTop(d measurement.Distance) { + c.x.Top = wml.NewCT_TblWidth() + setCellMargin(c.x.Top, d) +} + +// SetLeftPct sets the cell left margin +func (c CellMargins) SetLeftPct(pct float64) { + c.x.Left = wml.NewCT_TblWidth() + setCellMarginPercent(c.x.Left, pct) +} + +// SetLeft sets the cell left margin +func (c CellMargins) SetLeft(d measurement.Distance) { + c.x.Left = wml.NewCT_TblWidth() + setCellMargin(c.x.Left, d) +} + +// SetRightPct sets the cell right margin +func (c CellMargins) SetRightPct(pct float64) { + c.x.Right = wml.NewCT_TblWidth() + setCellMarginPercent(c.x.Right, pct) +} + +// SetRight sets the cell right margin +func (c CellMargins) SetRight(d measurement.Distance) { + c.x.Right = wml.NewCT_TblWidth() + setCellMargin(c.x.Right, d) +} + +// SetBottomPct sets the cell bottom margin +func (c CellMargins) SetBottomPct(pct float64) { + c.x.Bottom = wml.NewCT_TblWidth() + setCellMarginPercent(c.x.Bottom, pct) +} + +// SetBottom sets the cell bottom margin +func (c CellMargins) SetBottom(d measurement.Distance) { + c.x.Bottom = wml.NewCT_TblWidth() + setCellMargin(c.x.Bottom, d) +} + +// SetStartPct sets the cell start margin +func (c CellMargins) SetStartPct(pct float64) { + c.x.Start = wml.NewCT_TblWidth() + setCellMarginPercent(c.x.Start, pct) +} + +// SetStart sets the cell start margin +func (c CellMargins) SetStart(d measurement.Distance) { + c.x.Start = wml.NewCT_TblWidth() + setCellMargin(c.x.Start, d) +} diff --git a/backend/vendor/baliance.com/gooxml/document/cellproperties.go b/backend/vendor/baliance.com/gooxml/document/cellproperties.go new file mode 100644 index 00000000..26a703fd --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/cellproperties.go @@ -0,0 +1,119 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package document + +import ( + "baliance.com/gooxml" + "baliance.com/gooxml/color" + "baliance.com/gooxml/measurement" + "baliance.com/gooxml/schema/soo/wml" +) + +// CellProperties are a table cells properties within a document. +type CellProperties struct { + x *wml.CT_TcPr +} + +// X returns the inner wrapped XML type. +func (c CellProperties) X() *wml.CT_TcPr { + return c.x +} + +// SetColumnSpan sets the number of Grid Columns Spanned by the Cell. This is used +// to give the appearance of merged cells. +func (c CellProperties) SetColumnSpan(cols int) { + if cols == 0 { + c.x.GridSpan = nil + } else { + c.x.GridSpan = wml.NewCT_DecimalNumber() + c.x.GridSpan.ValAttr = int64(cols) + } +} + +// SetVerticalMerge controls the vertical merging of cells. +func (c CellProperties) SetVerticalMerge(mergeVal wml.ST_Merge) { + if mergeVal == wml.ST_MergeUnset { + c.x.VMerge = nil + } else { + c.x.VMerge = wml.NewCT_VMerge() + c.x.VMerge.ValAttr = mergeVal + } +} + +// SetWidthAuto sets the the cell width to automatic. +func (c CellProperties) SetWidthAuto() { + c.x.TcW = wml.NewCT_TblWidth() + c.x.TcW.TypeAttr = wml.ST_TblWidthAuto +} + +// SetWidthPercent sets the cell to a width percentage. +func (c CellProperties) SetWidthPercent(pct float64) { + c.x.TcW = wml.NewCT_TblWidth() + c.x.TcW.TypeAttr = wml.ST_TblWidthPct + c.x.TcW.WAttr = &wml.ST_MeasurementOrPercent{} + c.x.TcW.WAttr.ST_DecimalNumberOrPercent = &wml.ST_DecimalNumberOrPercent{} + // percent value is measured in 1/50'th of a percent + c.x.TcW.WAttr.ST_DecimalNumberOrPercent.ST_UnqualifiedPercentage = gooxml.Int64(int64(pct * 50)) +} + +// SetWidth sets the cell width to a specified width. +func (c CellProperties) SetWidth(d measurement.Distance) { + c.x.TcW = wml.NewCT_TblWidth() + c.x.TcW.TypeAttr = wml.ST_TblWidthDxa + c.x.TcW.WAttr = &wml.ST_MeasurementOrPercent{} + c.x.TcW.WAttr.ST_DecimalNumberOrPercent = &wml.ST_DecimalNumberOrPercent{} + c.x.TcW.WAttr.ST_DecimalNumberOrPercent.ST_UnqualifiedPercentage = gooxml.Int64(int64(d / measurement.Twips)) +} + +// SetShading controls the cell shading. +func (c CellProperties) SetShading(shd wml.ST_Shd, foreground, fill color.Color) { + if shd == wml.ST_ShdUnset { + c.x.Shd = nil + } else { + c.x.Shd = wml.NewCT_Shd() + c.x.Shd.ValAttr = shd + c.x.Shd.ColorAttr = &wml.ST_HexColor{} + if foreground.IsAuto() { + c.x.Shd.ColorAttr.ST_HexColorAuto = wml.ST_HexColorAutoAuto + } else { + c.x.Shd.ColorAttr.ST_HexColorRGB = foreground.AsRGBString() + } + c.x.Shd.FillAttr = &wml.ST_HexColor{} + if fill.IsAuto() { + c.x.Shd.FillAttr.ST_HexColorAuto = wml.ST_HexColorAutoAuto + } else { + c.x.Shd.FillAttr.ST_HexColorRGB = fill.AsRGBString() + } + } +} + +// SetVerticalAlignment sets the vertical alignment of content within a table cell. +func (c CellProperties) SetVerticalAlignment(align wml.ST_VerticalJc) { + if align == wml.ST_VerticalJcUnset { + c.x.VAlign = nil + } else { + c.x.VAlign = wml.NewCT_VerticalJc() + c.x.VAlign.ValAttr = align + } +} + +// Borders allows controlling individual cell borders. +func (c CellProperties) Borders() CellBorders { + if c.x.TcBorders == nil { + c.x.TcBorders = wml.NewCT_TcBorders() + } + return CellBorders{c.x.TcBorders} +} + +// Margins allows controlling individual cell margins. +func (c CellProperties) Margins() CellMargins { + if c.x.TcMar == nil { + c.x.TcMar = wml.NewCT_TcMar() + } + return CellMargins{c.x.TcMar} +} diff --git a/backend/vendor/baliance.com/gooxml/document/color.go b/backend/vendor/baliance.com/gooxml/document/color.go new file mode 100644 index 00000000..fcc86741 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/color.go @@ -0,0 +1,47 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package document + +import ( + "fmt" + + "baliance.com/gooxml/color" + "baliance.com/gooxml/schema/soo/wml" +) + +// Color controls the run or styles color. +type Color struct { + x *wml.CT_Color +} + +// X returns the inner wrapped XML type. +func (c Color) X() *wml.CT_Color { + return c.x +} + +// SetColor sets a specific color or auto. +func (c Color) SetColor(v color.Color) { + if v.IsAuto() { + c.x.ValAttr.ST_HexColorAuto = wml.ST_HexColorAutoAuto + c.x.ValAttr.ST_HexColorRGB = nil + } else { + c.x.ValAttr.ST_HexColorAuto = wml.ST_HexColorAutoUnset + c.x.ValAttr.ST_HexColorRGB = v.AsRGBString() + } +} + +// SetThemeColor sets the color from the theme. +func (c Color) SetThemeColor(t wml.ST_ThemeColor) { + c.x.ThemeColorAttr = t +} + +// SetThemeShade sets the shade based off the theme color. +func (c Color) SetThemeShade(s uint8) { + shd := fmt.Sprintf("%02x", s) + c.x.ThemeShadeAttr = &shd +} diff --git a/backend/vendor/baliance.com/gooxml/document/doc.go b/backend/vendor/baliance.com/gooxml/document/doc.go new file mode 100644 index 00000000..1ce12b7a --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/doc.go @@ -0,0 +1,21 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +/* + +Package document provides creation, reading, and writing of ECMA 376 Open +Office XML documents. + +Example: + + doc := document.New() + para := doc.AddParagraph() + run := para.AddRun() + run.SetText("foo") + doc.SaveToFile("foo.docx") +*/ +package document diff --git a/backend/vendor/baliance.com/gooxml/document/document.go b/backend/vendor/baliance.com/gooxml/document/document.go new file mode 100644 index 00000000..7f3a815d --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/document.go @@ -0,0 +1,884 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package document + +import ( + "archive/zip" + "errors" + "fmt" + "image" + "image/jpeg" + "io" + "io/ioutil" + "os" + "path/filepath" + "strings" + + "baliance.com/gooxml" + "baliance.com/gooxml/common" + "baliance.com/gooxml/zippkg" + + "baliance.com/gooxml/schema/soo/dml" + st "baliance.com/gooxml/schema/soo/ofc/sharedTypes" + "baliance.com/gooxml/schema/soo/pkg/relationships" + "baliance.com/gooxml/schema/soo/wml" +) + +// Document is a text document that can be written out in the OOXML .docx +// format. It can be opened from a file on disk and modified, or created from +// scratch. +type Document struct { + common.DocBase + x *wml.Document + + Settings Settings // document settings + Numbering Numbering // numbering styles within the doucment + Styles Styles // styles that are use and can be used within the document + + headers []*wml.Hdr + hdrRels []common.Relationships + + footers []*wml.Ftr + ftrRels []common.Relationships + + docRels common.Relationships + themes []*dml.Theme + webSettings *wml.WebSettings + fontTable *wml.Fonts + endNotes *wml.Endnotes + footNotes *wml.Footnotes +} + +// New constructs an empty document that content can be added to. +func New() *Document { + d := &Document{x: wml.NewDocument()} + d.ContentTypes = common.NewContentTypes() + d.x.Body = wml.NewCT_Body() + d.x.ConformanceAttr = st.ST_ConformanceClassTransitional + d.docRels = common.NewRelationships() + + d.AppProperties = common.NewAppProperties() + d.CoreProperties = common.NewCoreProperties() + + d.ContentTypes.AddOverride("/word/document.xml", "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml") + + d.Settings = NewSettings() + d.docRels.AddRelationship("settings.xml", gooxml.SettingsType) + d.ContentTypes.AddOverride("/word/settings.xml", "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml") + + d.Rels = common.NewRelationships() + d.Rels.AddRelationship(gooxml.RelativeFilename(gooxml.DocTypeDocument, "", gooxml.CorePropertiesType, 0), gooxml.CorePropertiesType) + d.Rels.AddRelationship("docProps/app.xml", gooxml.ExtendedPropertiesType) + d.Rels.AddRelationship("word/document.xml", gooxml.OfficeDocumentType) + + d.Numbering = NewNumbering() + d.Numbering.InitializeDefault() + d.ContentTypes.AddOverride("/word/numbering.xml", "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml") + d.docRels.AddRelationship("numbering.xml", gooxml.NumberingType) + + d.Styles = NewStyles() + d.Styles.InitializeDefault() + d.ContentTypes.AddOverride("/word/styles.xml", "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml") + d.docRels.AddRelationship("styles.xml", gooxml.StylesType) + + d.x.Body = wml.NewCT_Body() + return d +} + +// X returns the inner wrapped XML type. +func (d *Document) X() *wml.Document { + return d.x +} + +// AddHeader creates a header associated with the document, but doesn't add it +// to the document for display. +func (d *Document) AddHeader() Header { + hdr := wml.NewHdr() + d.headers = append(d.headers, hdr) + path := fmt.Sprintf("header%d.xml", len(d.headers)) + d.docRels.AddRelationship(path, gooxml.HeaderType) + + d.ContentTypes.AddOverride("/word/"+path, "application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml") + d.hdrRels = append(d.hdrRels, common.NewRelationships()) + + return Header{d, hdr} +} + +// Headers returns the headers defined in the document. +func (d *Document) Headers() []Header { + ret := []Header{} + for _, h := range d.headers { + ret = append(ret, Header{d, h}) + } + return ret +} + +// Footers returns the footers defined in the document. +func (d *Document) Footers() []Footer { + ret := []Footer{} + for _, f := range d.footers { + ret = append(ret, Footer{d, f}) + } + return ret +} + +// AddFooter creates a Footer associated with the document, but doesn't add it +// to the document for display. +func (d *Document) AddFooter() Footer { + ftr := wml.NewFtr() + d.footers = append(d.footers, ftr) + path := fmt.Sprintf("footer%d.xml", len(d.footers)) + d.docRels.AddRelationship(path, gooxml.FooterType) + + d.ContentTypes.AddOverride("/word/"+path, "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml") + d.ftrRels = append(d.ftrRels, common.NewRelationships()) + + return Footer{d, ftr} +} + +// BodySection returns the default body section used for all preceding +// paragraphs until the previous Section. If there is no previous sections, the +// body section applies to the entire document. +func (d *Document) BodySection() Section { + if d.x.Body.SectPr == nil { + d.x.Body.SectPr = wml.NewCT_SectPr() + } + return Section{d, d.x.Body.SectPr} +} + +// Save writes the document to an io.Writer in the Zip package format. +func (d *Document) Save(w io.Writer) error { + if err := d.x.Validate(); err != nil { + gooxml.Log("validation error in document: %s", err) + } + dt := gooxml.DocTypeDocument + + z := zip.NewWriter(w) + defer z.Close() + if err := zippkg.MarshalXML(z, gooxml.BaseRelsFilename, d.Rels.X()); err != nil { + return err + } + if err := zippkg.MarshalXMLByType(z, dt, gooxml.ExtendedPropertiesType, d.AppProperties.X()); err != nil { + return err + } + if err := zippkg.MarshalXMLByType(z, dt, gooxml.CorePropertiesType, d.CoreProperties.X()); err != nil { + return err + } + if d.Thumbnail != nil { + tn, err := z.Create("docProps/thumbnail.jpeg") + if err != nil { + return err + } + if err := jpeg.Encode(tn, d.Thumbnail, nil); err != nil { + return err + } + } + if err := zippkg.MarshalXMLByType(z, dt, gooxml.SettingsType, d.Settings.X()); err != nil { + return err + } + documentFn := gooxml.AbsoluteFilename(dt, gooxml.OfficeDocumentType, 0) + if err := zippkg.MarshalXML(z, documentFn, d.x); err != nil { + return err + } + if err := zippkg.MarshalXML(z, zippkg.RelationsPathFor(documentFn), d.docRels.X()); err != nil { + return err + } + + if d.Numbering.X() != nil { + if err := zippkg.MarshalXMLByType(z, dt, gooxml.NumberingType, d.Numbering.X()); err != nil { + return err + } + } + if err := zippkg.MarshalXMLByType(z, dt, gooxml.StylesType, d.Styles.X()); err != nil { + return err + } + + if d.webSettings != nil { + if err := zippkg.MarshalXMLByType(z, dt, gooxml.WebSettingsType, d.webSettings); err != nil { + return err + } + } + if d.fontTable != nil { + if err := zippkg.MarshalXMLByType(z, dt, gooxml.FontTableType, d.fontTable); err != nil { + return err + } + } + if d.endNotes != nil { + if err := zippkg.MarshalXMLByType(z, dt, gooxml.EndNotesType, d.endNotes); err != nil { + return err + } + } + if d.footNotes != nil { + if err := zippkg.MarshalXMLByType(z, dt, gooxml.FootNotesType, d.footNotes); err != nil { + return err + } + } + for i, thm := range d.themes { + if err := zippkg.MarshalXMLByTypeIndex(z, dt, gooxml.ThemeType, i+1, thm); err != nil { + return err + } + } + for i, hdr := range d.headers { + fn := gooxml.AbsoluteFilename(dt, gooxml.HeaderType, i+1) + if err := zippkg.MarshalXML(z, fn, hdr); err != nil { + return err + } + if !d.hdrRels[i].IsEmpty() { + zippkg.MarshalXML(z, zippkg.RelationsPathFor(fn), d.hdrRels[i].X()) + } + } + for i, ftr := range d.footers { + fn := gooxml.AbsoluteFilename(dt, gooxml.FooterType, i+1) + if err := zippkg.MarshalXMLByTypeIndex(z, dt, gooxml.FooterType, i+1, ftr); err != nil { + return err + } + if !d.ftrRels[i].IsEmpty() { + zippkg.MarshalXML(z, zippkg.RelationsPathFor(fn), d.ftrRels[i].X()) + } + } + + for i, img := range d.Images { + fn := fmt.Sprintf("word/media/image%d.%s", i+1, strings.ToLower(img.Format())) + if img.Path() != "" { + if err := zippkg.AddFileFromDisk(z, fn, img.Path()); err != nil { + return err + } + } else { + gooxml.Log("unsupported image source: %+v", img) + } + } + + if err := zippkg.MarshalXML(z, gooxml.ContentTypesFilename, d.ContentTypes.X()); err != nil { + return err + } + if err := d.WriteExtraFiles(z); err != nil { + return err + } + return z.Close() +} + +// AddTable adds a new table to the document body. +func (d *Document) AddTable() Table { + elts := wml.NewEG_BlockLevelElts() + d.x.Body.EG_BlockLevelElts = append(d.x.Body.EG_BlockLevelElts, elts) + c := wml.NewEG_ContentBlockContent() + elts.EG_ContentBlockContent = append(elts.EG_ContentBlockContent, c) + tbl := wml.NewCT_Tbl() + c.Tbl = append(c.Tbl, tbl) + return Table{d, tbl} +} + +func (d *Document) InsertTableAfter(relativeTo Paragraph) Table { + return d.insertTable(relativeTo, false) +} + +func (d *Document) InsertTableBefore(relativeTo Paragraph) Table { + return d.insertTable(relativeTo, true) +} + +func (d *Document) insertTable(relativeTo Paragraph, before bool) Table { + if d.x.Body == nil { + return d.AddTable() + } + for i, ble := range d.x.Body.EG_BlockLevelElts { + for _, c := range ble.EG_ContentBlockContent { + for j, p := range c.P { + // found the paragraph + if p == relativeTo.X() { + tbl := wml.NewCT_Tbl() + elts := wml.NewEG_BlockLevelElts() + cbc := wml.NewEG_ContentBlockContent() + elts.EG_ContentBlockContent = append(elts.EG_ContentBlockContent, cbc) + cbc.Tbl = append(cbc.Tbl, tbl) + d.x.Body.EG_BlockLevelElts = append(d.x.Body.EG_BlockLevelElts, nil) + if before { + copy(d.x.Body.EG_BlockLevelElts[i+1:], d.x.Body.EG_BlockLevelElts[i:]) + d.x.Body.EG_BlockLevelElts[i] = elts + if j != 0 { + elts := wml.NewEG_BlockLevelElts() + cbc := wml.NewEG_ContentBlockContent() + elts.EG_ContentBlockContent = append(elts.EG_ContentBlockContent, cbc) + cbc.P = c.P[:j] + d.x.Body.EG_BlockLevelElts = append(d.x.Body.EG_BlockLevelElts, nil) + copy(d.x.Body.EG_BlockLevelElts[i+1:], d.x.Body.EG_BlockLevelElts[i:]) + d.x.Body.EG_BlockLevelElts[i] = elts + } + c.P = c.P[j:] + } else { + copy(d.x.Body.EG_BlockLevelElts[i+2:], d.x.Body.EG_BlockLevelElts[i+1:]) + d.x.Body.EG_BlockLevelElts[i+1] = elts + if j != len(c.P)-1 { + elts := wml.NewEG_BlockLevelElts() + cbc := wml.NewEG_ContentBlockContent() + elts.EG_ContentBlockContent = append(elts.EG_ContentBlockContent, cbc) + cbc.P = c.P[j+1:] + d.x.Body.EG_BlockLevelElts = append(d.x.Body.EG_BlockLevelElts, nil) + copy(d.x.Body.EG_BlockLevelElts[i+3:], d.x.Body.EG_BlockLevelElts[i+2:]) + d.x.Body.EG_BlockLevelElts[i+2] = elts + } + c.P = c.P[:j+1] + } + return Table{d, tbl} + } + } + } + } + return d.AddTable() +} + +// Tables returns the tables defined in the document. +func (d *Document) Tables() []Table { + ret := []Table{} + if d.x.Body == nil { + return nil + } + for _, ble := range d.x.Body.EG_BlockLevelElts { + for _, c := range ble.EG_ContentBlockContent { + for _, t := range c.Tbl { + ret = append(ret, Table{d, t}) + } + } + } + return ret +} + +// AddParagraph adds a new paragraph to the document body. +func (d *Document) AddParagraph() Paragraph { + elts := wml.NewEG_BlockLevelElts() + d.x.Body.EG_BlockLevelElts = append(d.x.Body.EG_BlockLevelElts, elts) + c := wml.NewEG_ContentBlockContent() + elts.EG_ContentBlockContent = append(elts.EG_ContentBlockContent, c) + p := wml.NewCT_P() + c.P = append(c.P, p) + return Paragraph{d, p} +} + +// RemoveParagraph removes a paragraph from a document. +func (d *Document) RemoveParagraph(p Paragraph) { + if d.x.Body == nil { + return + } + + for _, ble := range d.x.Body.EG_BlockLevelElts { + for _, c := range ble.EG_ContentBlockContent { + for i, pa := range c.P { + // do we need to remove this paragraph + if pa == p.x { + copy(c.P[i:], c.P[i+1:]) + c.P = c.P[0 : len(c.P)-1] + return + } + } + + if c.Sdt != nil && c.Sdt.SdtContent != nil && c.Sdt.SdtContent.P != nil { + for i, pa := range c.Sdt.SdtContent.P { + if pa == p.x { + copy(c.P[i:], c.P[i+1:]) + c.P = c.P[0 : len(c.P)-1] + return + } + } + } + } + } +} + +// StructuredDocumentTags returns the structured document tags in the document +// which are commonly used in document templates. +func (d *Document) StructuredDocumentTags() []StructuredDocumentTag { + ret := []StructuredDocumentTag{} + for _, ble := range d.x.Body.EG_BlockLevelElts { + for _, c := range ble.EG_ContentBlockContent { + if c.Sdt != nil { + ret = append(ret, StructuredDocumentTag{d, c.Sdt}) + } + } + } + return ret +} + +// Paragraphs returns all of the paragraphs in the document body. +func (d *Document) Paragraphs() []Paragraph { + ret := []Paragraph{} + if d.x.Body == nil { + return nil + } + for _, ble := range d.x.Body.EG_BlockLevelElts { + for _, c := range ble.EG_ContentBlockContent { + for _, p := range c.P { + ret = append(ret, Paragraph{d, p}) + } + } + } + return ret +} + +// SaveToFile writes the document out to a file. +func (d *Document) SaveToFile(path string) error { + f, err := os.Create(path) + if err != nil { + return err + } + defer f.Close() + return d.Save(f) +} + +// Open opens and reads a document from a file (.docx). +func Open(filename string) (*Document, error) { + f, err := os.Open(filename) + if err != nil { + return nil, fmt.Errorf("error opening %s: %s", filename, err) + } + defer f.Close() + fi, err := os.Stat(filename) + if err != nil { + return nil, fmt.Errorf("error opening %s: %s", filename, err) + } + _ = fi + return Read(f, fi.Size()) +} + +// OpenTemplate opens a document, removing all content so it can be used as a +// template. Since Word removes unused styles from a document upon save, to +// create a template in Word add a paragraph with every style of interest. When +// opened with OpenTemplate the document's styles will be available but the +// content will be gone. +func OpenTemplate(filename string) (*Document, error) { + d, err := Open(filename) + if err != nil { + return nil, err + } + d.x.Body = wml.NewCT_Body() + return d, nil +} + +// Read reads a document from an io.Reader. +func Read(r io.ReaderAt, size int64) (*Document, error) { + doc := New() + // numbering is not required + doc.Numbering.x = nil + + td, err := ioutil.TempDir("", "gooxml-docx") + if err != nil { + return nil, err + } + doc.TmpPath = td + + zr, err := zip.NewReader(r, size) + if err != nil { + return nil, fmt.Errorf("parsing zip: %s", err) + } + + files := []*zip.File{} + files = append(files, zr.File...) + + decMap := zippkg.DecodeMap{} + decMap.SetOnNewRelationshipFunc(doc.onNewRelationship) + // we should discover all contents by starting with these two files + decMap.AddTarget(gooxml.ContentTypesFilename, doc.ContentTypes.X(), "", 0) + decMap.AddTarget(gooxml.BaseRelsFilename, doc.Rels.X(), "", 0) + if err := decMap.Decode(files); err != nil { + return nil, err + } + + for _, f := range files { + if f == nil { + continue + } + if err := doc.AddExtraFileFromZip(f); err != nil { + return nil, err + } + } + return doc, nil +} + +// Validate validates the structure and in cases where it't possible, the ranges +// of elements within a document. A validation error dones't mean that the +// document won't work in MS Word or LibreOffice, but it's worth checking into. +func (d *Document) Validate() error { + if d == nil || d.x == nil { + return errors.New("document not initialized correctly, nil base") + } + + for _, v := range []func() error{d.validateTableCells, d.validateBookmarks} { + if err := v(); err != nil { + return err + } + } + if err := d.x.Validate(); err != nil { + return err + } + return nil +} + +func (d *Document) validateBookmarks() error { + bmnames := make(map[string]struct{}) + for _, bm := range d.Bookmarks() { + if _, ok := bmnames[bm.Name()]; ok { + return fmt.Errorf("duplicate bookmark %s found", bm.Name()) + } + bmnames[bm.Name()] = struct{}{} + } + return nil +} +func (d *Document) validateTableCells() error { + for _, elt := range d.x.Body.EG_BlockLevelElts { + for _, c := range elt.EG_ContentBlockContent { + for _, t := range c.Tbl { + for _, rc := range t.EG_ContentRowContent { + for _, row := range rc.Tr { + hasCell := false + for _, ecc := range row.EG_ContentCellContent { + cellHasPara := false + for _, cell := range ecc.Tc { + hasCell = true + for _, cellElt := range cell.EG_BlockLevelElts { + for _, cellCont := range cellElt.EG_ContentBlockContent { + if len(cellCont.P) > 0 { + cellHasPara = true + break + } + } + } + } + if !cellHasPara { + return errors.New("table cell must contain a paragraph") + } + } + // OSX Word requires this and won't open the file otherwise + if !hasCell { + return errors.New("table row must contain a cell") + } + } + } + } + } + } + return nil +} + +// AddImage adds an image to the document package, returning a reference that +// can be used to add the image to a run and place it in the document contents. +func (d *Document) AddImage(i common.Image) (common.ImageRef, error) { + r := common.MakeImageRef(i, &d.DocBase, d.docRels) + if i.Path == "" { + return r, errors.New("image must have a path") + } + + if i.Format == "" { + return r, errors.New("image must have a valid format") + } + if i.Size.X == 0 || i.Size.Y == 0 { + return r, errors.New("image must have a valid size") + } + + d.Images = append(d.Images, r) + fn := fmt.Sprintf("media/image%d.%s", len(d.Images), i.Format) + rel := d.docRels.AddRelationship(fn, gooxml.ImageType) + d.ContentTypes.EnsureDefault("png", "image/png") + d.ContentTypes.EnsureDefault("jpeg", "image/jpeg") + d.ContentTypes.EnsureDefault("jpg", "image/jpeg") + d.ContentTypes.EnsureDefault("wmf", "image/x-wmf") + d.ContentTypes.EnsureDefault(i.Format, "image/"+i.Format) + r.SetRelID(rel.X().IdAttr) + return r, nil +} + +// GetImageByRelID returns an ImageRef with the associated relation ID in the +// document. +func (d *Document) GetImageByRelID(relID string) (common.ImageRef, bool) { + for _, img := range d.Images { + if img.RelID() == relID { + return img, true + } + } + return common.ImageRef{}, false +} + +// FormFields extracts all of the fields from a document. They can then be +// manipulated via the methods on the field and the document saved. +func (d *Document) FormFields() []FormField { + ret := []FormField{} + for _, p := range d.Paragraphs() { + runs := p.Runs() + for i, r := range runs { + for _, ic := range r.x.EG_RunInnerContent { + // skip non form fields + if ic.FldChar == nil || ic.FldChar.FfData == nil { + continue + } + + // found a begin form field + if ic.FldChar.FldCharTypeAttr == wml.ST_FldCharTypeBegin { + // ensure it has a name + if len(ic.FldChar.FfData.Name) == 0 || ic.FldChar.FfData.Name[0].ValAttr == nil { + continue + } + + field := FormField{x: ic.FldChar.FfData} + // for text input boxes, we need a pointer to where to set + // the text as well + if ic.FldChar.FfData.TextInput != nil { + + // ensure we always have at lest two IC's + for j := i + 1; j < len(runs)-1; j++ { + if len(runs[j].x.EG_RunInnerContent) == 0 { + continue + } + ic := runs[j].x.EG_RunInnerContent[0] + // look for the 'separate' field + if ic.FldChar != nil && ic.FldChar.FldCharTypeAttr == wml.ST_FldCharTypeSeparate { + if len(runs[j+1].x.EG_RunInnerContent) == 0 { + continue + } + // the value should be the text in the next inner content that is not a field char + if runs[j+1].x.EG_RunInnerContent[0].FldChar == nil { + field.textIC = runs[j+1].x.EG_RunInnerContent[0] + } + } + } + } + ret = append(ret, field) + } + } + } + } + return ret +} + +func (d *Document) onNewRelationship(decMap *zippkg.DecodeMap, target, typ string, files []*zip.File, rel *relationships.Relationship, src zippkg.Target) error { + dt := gooxml.DocTypeDocument + + switch typ { + case gooxml.OfficeDocumentType: + d.x = wml.NewDocument() + decMap.AddTarget(target, d.x, typ, 0) + // look for the document relationships file as well + decMap.AddTarget(zippkg.RelationsPathFor(target), d.docRels.X(), typ, 0) + rel.TargetAttr = gooxml.RelativeFilename(dt, src.Typ, typ, 0) + + case gooxml.CorePropertiesType: + decMap.AddTarget(target, d.CoreProperties.X(), typ, 0) + rel.TargetAttr = gooxml.RelativeFilename(dt, src.Typ, typ, 0) + + case gooxml.ExtendedPropertiesType: + decMap.AddTarget(target, d.AppProperties.X(), typ, 0) + rel.TargetAttr = gooxml.RelativeFilename(dt, src.Typ, typ, 0) + + case gooxml.ThumbnailType: + // read our thumbnail + for i, f := range files { + if f == nil { + continue + } + if f.Name == target { + rc, err := f.Open() + if err != nil { + return fmt.Errorf("error reading thumbnail: %s", err) + } + d.Thumbnail, _, err = image.Decode(rc) + rc.Close() + if err != nil { + return fmt.Errorf("error decoding thumbnail: %s", err) + } + files[i] = nil + } + } + + case gooxml.SettingsType: + decMap.AddTarget(target, d.Settings.X(), typ, 0) + rel.TargetAttr = gooxml.RelativeFilename(dt, src.Typ, typ, 0) + + case gooxml.NumberingType: + d.Numbering = NewNumbering() + decMap.AddTarget(target, d.Numbering.X(), typ, 0) + rel.TargetAttr = gooxml.RelativeFilename(dt, src.Typ, typ, 0) + + case gooxml.StylesType: + d.Styles.Clear() + decMap.AddTarget(target, d.Styles.X(), typ, 0) + rel.TargetAttr = gooxml.RelativeFilename(dt, src.Typ, typ, 0) + + case gooxml.HeaderType: + hdr := wml.NewHdr() + decMap.AddTarget(target, hdr, typ, uint32(len(d.headers))) + d.headers = append(d.headers, hdr) + rel.TargetAttr = gooxml.RelativeFilename(dt, src.Typ, typ, len(d.headers)) + + // look for header rels + hdrRel := common.NewRelationships() + decMap.AddTarget(zippkg.RelationsPathFor(target), hdrRel.X(), typ, 0) + d.hdrRels = append(d.hdrRels, hdrRel) + + case gooxml.FooterType: + ftr := wml.NewFtr() + decMap.AddTarget(target, ftr, typ, uint32(len(d.footers))) + d.footers = append(d.footers, ftr) + rel.TargetAttr = gooxml.RelativeFilename(dt, src.Typ, typ, len(d.footers)) + + // look for footer rels + ftrRel := common.NewRelationships() + decMap.AddTarget(zippkg.RelationsPathFor(target), ftrRel.X(), typ, 0) + d.ftrRels = append(d.ftrRels, ftrRel) + + case gooxml.ThemeType: + thm := dml.NewTheme() + decMap.AddTarget(target, thm, typ, uint32(len(d.themes))) + d.themes = append(d.themes, thm) + rel.TargetAttr = gooxml.RelativeFilename(dt, src.Typ, typ, len(d.themes)) + + case gooxml.WebSettingsType: + d.webSettings = wml.NewWebSettings() + decMap.AddTarget(target, d.webSettings, typ, 0) + rel.TargetAttr = gooxml.RelativeFilename(dt, src.Typ, typ, 0) + + case gooxml.FontTableType: + d.fontTable = wml.NewFonts() + decMap.AddTarget(target, d.fontTable, typ, 0) + rel.TargetAttr = gooxml.RelativeFilename(dt, src.Typ, typ, 0) + + case gooxml.EndNotesType: + d.endNotes = wml.NewEndnotes() + decMap.AddTarget(target, d.endNotes, typ, 0) + rel.TargetAttr = gooxml.RelativeFilename(dt, src.Typ, typ, 0) + + case gooxml.FootNotesType: + d.footNotes = wml.NewFootnotes() + decMap.AddTarget(target, d.footNotes, typ, 0) + rel.TargetAttr = gooxml.RelativeFilename(dt, src.Typ, typ, 0) + + case gooxml.ImageType: + var iref common.ImageRef + for i, f := range files { + if f == nil { + continue + } + if f.Name == target { + path, err := zippkg.ExtractToDiskTmp(f, d.TmpPath) + if err != nil { + return err + } + img, err := common.ImageFromFile(path) + if err != nil { + return err + } + iref = common.MakeImageRef(img, &d.DocBase, d.docRels) + d.Images = append(d.Images, iref) + files[i] = nil + } + } + + ext := "." + strings.ToLower(iref.Format()) + rel.TargetAttr = gooxml.RelativeFilename(dt, src.Typ, typ, len(d.Images)) + // ensure we don't change image formats + if newExt := filepath.Ext(rel.TargetAttr); newExt != ext { + rel.TargetAttr = rel.TargetAttr[0:len(rel.TargetAttr)-len(newExt)] + ext + } + + default: + gooxml.Log("unsupported relationship type: %s tgt: %s", typ, target) + } + return nil +} + +// InsertParagraphAfter adds a new empty paragraph after the relativeTo +// paragraph. +func (d *Document) InsertParagraphAfter(relativeTo Paragraph) Paragraph { + return d.insertParagraph(relativeTo, false) +} + +// InsertParagraphBefore adds a new empty paragraph before the relativeTo +// paragraph. +func (d *Document) InsertParagraphBefore(relativeTo Paragraph) Paragraph { + return d.insertParagraph(relativeTo, true) +} + +func (d *Document) insertParagraph(relativeTo Paragraph, before bool) Paragraph { + if d.x.Body == nil { + return d.AddParagraph() + } + + for _, ble := range d.x.Body.EG_BlockLevelElts { + for _, c := range ble.EG_ContentBlockContent { + for i, p := range c.P { + // foudn the paragraph + if p == relativeTo.X() { + p := wml.NewCT_P() + c.P = append(c.P, nil) + if before { + copy(c.P[i+1:], c.P[i:]) + c.P[i] = p + } else { + copy(c.P[i+2:], c.P[i+1:]) + c.P[i+1] = p + } + return Paragraph{d, p} + } + } + + if c.Sdt != nil && c.Sdt.SdtContent != nil && c.Sdt.SdtContent.P != nil { + for i, p := range c.Sdt.SdtContent.P { + if p == relativeTo.X() { + p := wml.NewCT_P() + c.Sdt.SdtContent.P = append(c.Sdt.SdtContent.P, nil) + if before { + copy(c.Sdt.SdtContent.P[i+1:], c.Sdt.SdtContent.P[i:]) + c.Sdt.SdtContent.P[i] = p + } else { + copy(c.Sdt.SdtContent.P[i+2:], c.Sdt.SdtContent.P[i+1:]) + c.Sdt.SdtContent.P[i+1] = p + } + return Paragraph{d, p} + } + } + } + } + } + return d.AddParagraph() +} + +// AddHyperlink adds a hyperlink to a document. Adding the hyperlink to a document +// and setting it on a cell is more efficient than setting hyperlinks directly +// on a cell. +func (d Document) AddHyperlink(url string) common.Hyperlink { + return d.docRels.AddHyperlink(url) +} + +// Bookmarks returns all of the bookmarks defined in the document. +func (d Document) Bookmarks() []Bookmark { + if d.x.Body == nil { + return nil + } + ret := []Bookmark{} + for _, ble := range d.x.Body.EG_BlockLevelElts { + for _, bc := range ble.EG_ContentBlockContent { + // bookmarks within paragraphs + for _, p := range bc.P { + for _, ec := range p.EG_PContent { + for _, ecr := range ec.EG_ContentRunContent { + for _, re := range ecr.EG_RunLevelElts { + for _, rm := range re.EG_RangeMarkupElements { + if rm.BookmarkStart != nil { + ret = append(ret, Bookmark{rm.BookmarkStart}) + } + } + } + } + } + } + for _, re := range bc.EG_RunLevelElts { + for _, rm := range re.EG_RangeMarkupElements { + if rm.BookmarkStart != nil { + ret = append(ret, Bookmark{rm.BookmarkStart}) + } + } + } + } + } + return ret +} diff --git a/backend/vendor/baliance.com/gooxml/document/fonts.go b/backend/vendor/baliance.com/gooxml/document/fonts.go new file mode 100644 index 00000000..ce7b31e3 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/fonts.go @@ -0,0 +1,40 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package document + +import "baliance.com/gooxml/schema/soo/wml" + +// Fonts allows manipulating a style or run's fonts. +type Fonts struct { + x *wml.CT_Fonts +} + +// X returns the inner wrapped XML type. +func (f Fonts) X() *wml.CT_Fonts { + return f.x +} + +// SetASCIITheme sets the font ASCII Theme. +func (f Fonts) SetASCIITheme(t wml.ST_Theme) { + f.x.AsciiThemeAttr = t +} + +// SetEastAsiaTheme sets the font East Asia Theme. +func (f Fonts) SetEastAsiaTheme(t wml.ST_Theme) { + f.x.EastAsiaThemeAttr = t +} + +// SetHANSITheme sets the font H ANSI Theme. +func (f Fonts) SetHANSITheme(t wml.ST_Theme) { + f.x.HAnsiThemeAttr = t +} + +// SetCSTheme sets the font complex script theme. +func (f Fonts) SetCSTheme(t wml.ST_Theme) { + f.x.CsthemeAttr = t +} diff --git a/backend/vendor/baliance.com/gooxml/document/footer.go b/backend/vendor/baliance.com/gooxml/document/footer.go new file mode 100644 index 00000000..16f10025 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/footer.go @@ -0,0 +1,108 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package document + +import ( + "errors" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/common" + "baliance.com/gooxml/schema/soo/wml" +) + +// Footer is a footer for a document section. +type Footer struct { + d *Document + x *wml.Ftr +} + +// X returns the inner wrapped XML type. +func (f Footer) X() *wml.Ftr { + return f.x +} + +// AddParagraph adds a paragraph to the footer. +func (f Footer) AddParagraph() Paragraph { + bc := wml.NewEG_ContentBlockContent() + f.x.EG_ContentBlockContent = append(f.x.EG_ContentBlockContent, bc) + p := wml.NewCT_P() + bc.P = append(bc.P, p) + return Paragraph{f.d, p} +} + +// Index returns the index of the footer within the document. This is used to +// form its zip packaged filename as well as to match it with its relationship +// ID. +func (f Footer) Index() int { + for i, hdr := range f.d.footers { + if hdr == f.x { + return i + } + } + return -1 +} + +// Paragraphs returns the paragraphs defined in a footer. +func (f Footer) Paragraphs() []Paragraph { + ret := []Paragraph{} + for _, ec := range f.x.EG_ContentBlockContent { + for _, p := range ec.P { + ret = append(ret, Paragraph{f.d, p}) + } + } + return ret +} + +// RemoveParagraph removes a paragraph from a footer. +func (f Footer) RemoveParagraph(p Paragraph) { + for _, ec := range f.x.EG_ContentBlockContent { + for i, pa := range ec.P { + // do we need to remove this paragraph + if pa == p.x { + copy(ec.P[i:], ec.P[i+1:]) + ec.P = ec.P[0 : len(ec.P)-1] + return + } + } + } +} + +// Clear clears all content within a footer +func (f Footer) Clear() { + f.x.EG_ContentBlockContent = nil +} + +// AddImage adds an image to the document package, returning a reference that +// can be used to add the image to a run and place it in the document contents. +func (f Footer) AddImage(i common.Image) (common.ImageRef, error) { + var ftrRels common.Relationships + for i, ftr := range f.d.footers { + if ftr == f.x { + ftrRels = f.d.ftrRels[i] + } + } + + r := common.MakeImageRef(i, &f.d.DocBase, ftrRels) + if i.Path == "" { + return r, errors.New("image must have a path") + } + + if i.Format == "" { + return r, errors.New("image must have a valid format") + } + if i.Size.X == 0 || i.Size.Y == 0 { + return r, errors.New("image must have a valid size") + } + + f.d.Images = append(f.d.Images, r) + fn := fmt.Sprintf("media/image%d.%s", len(f.d.Images), i.Format) + rel := ftrRels.AddRelationship(fn, gooxml.ImageType) + r.SetRelID(rel.X().IdAttr) + return r, nil +} diff --git a/backend/vendor/baliance.com/gooxml/document/formfield.go b/backend/vendor/baliance.com/gooxml/document/formfield.go new file mode 100644 index 00000000..cdb99e78 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/formfield.go @@ -0,0 +1,123 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package document + +import ( + "baliance.com/gooxml/schema/soo/wml" +) + +// FormFieldType is the type of the form field. +//go:generate stringer -type=FormFieldType +type FormFieldType byte + +// Form Field Type constants +const ( + FormFieldTypeUnknown FormFieldType = iota + FormFieldTypeText + FormFieldTypeCheckBox + FormFieldTypeDropDown +) + +// FormField is a form within a document. It references the document, so changes +// to the form field wil be reflected in the document if it is saved. +type FormField struct { + x *wml.CT_FFData + textIC *wml.EG_RunInnerContent +} + +// Type returns the type of the field. +func (f FormField) Type() FormFieldType { + if f.x.TextInput != nil { + return FormFieldTypeText + } else if f.x.CheckBox != nil { + return FormFieldTypeCheckBox + } else if f.x.DdList != nil { + return FormFieldTypeDropDown + } + return FormFieldTypeUnknown +} + +// Name returns the name of the field. +func (f FormField) Name() string { + return *f.x.Name[0].ValAttr +} + +// PossibleValues returns the possible values for a FormFieldTypeDropDown. +func (f FormField) PossibleValues() []string { + if f.x.DdList == nil { + return nil + } + ret := []string{} + for _, s := range f.x.DdList.ListEntry { + if s == nil { + continue + } + ret = append(ret, s.ValAttr) + } + return ret +} + +// SetValue sets the value of a FormFieldTypeText or FormFieldTypeDropDown. For +// FormFieldTypeDropDown, the value must be one of the fields possible values. +func (f FormField) SetValue(v string) { + if f.x.DdList != nil { + for i, s := range f.PossibleValues() { + if s == v { + f.x.DdList.Result = wml.NewCT_DecimalNumber() + f.x.DdList.Result.ValAttr = int64(i) + break + } + } + } else if f.x.TextInput != nil { + f.textIC.T = wml.NewCT_Text() + f.textIC.T.Content = v + } +} + +// Value returns the tring value of a FormFieldTypeText or FormFieldTypeDropDown. +func (f FormField) Value() string { + if f.x.TextInput != nil && f.textIC.T != nil { + return f.textIC.T.Content + } else if f.x.DdList != nil && f.x.DdList.Result != nil { + pv := f.PossibleValues() + idx := int(f.x.DdList.Result.ValAttr) + if idx < len(pv) { + return pv[idx] + } + } else if f.x.CheckBox != nil { + if f.IsChecked() { + return "true" + } + return "false" + } + return "" +} + +// IsChecked returns true if a FormFieldTypeCheckBox is checked. +func (f FormField) IsChecked() bool { + if f.x.CheckBox == nil { + return false + } + if f.x.CheckBox.Checked != nil { + return true + } + return false +} + +// SetChecked marks a FormFieldTypeCheckBox as checked or unchecked. +func (f FormField) SetChecked(b bool) { + if f.x.CheckBox == nil { + return + } + if !b { + f.x.CheckBox.Checked = nil + } else { + f.x.CheckBox.Checked = wml.NewCT_OnOff() + } + +} diff --git a/backend/vendor/baliance.com/gooxml/document/formfieldtype_string.go b/backend/vendor/baliance.com/gooxml/document/formfieldtype_string.go new file mode 100644 index 00000000..6f9b3c24 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/formfieldtype_string.go @@ -0,0 +1,16 @@ +// Code generated by "stringer -type=FormFieldType"; DO NOT EDIT. + +package document + +import "fmt" + +const _FormFieldType_name = "FormFieldTypeUnknownFormFieldTypeTextFormFieldTypeCheckBoxFormFieldTypeDropDown" + +var _FormFieldType_index = [...]uint8{0, 20, 37, 58, 79} + +func (i FormFieldType) String() string { + if i >= FormFieldType(len(_FormFieldType_index)-1) { + return fmt.Sprintf("FormFieldType(%d)", i) + } + return _FormFieldType_name[_FormFieldType_index[i]:_FormFieldType_index[i+1]] +} diff --git a/backend/vendor/baliance.com/gooxml/document/header.go b/backend/vendor/baliance.com/gooxml/document/header.go new file mode 100644 index 00000000..8ef5c44f --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/header.go @@ -0,0 +1,108 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package document + +import ( + "errors" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/common" + "baliance.com/gooxml/schema/soo/wml" +) + +// Header is a header for a document section. +type Header struct { + d *Document + x *wml.Hdr +} + +// X returns the inner wrapped XML type. +func (h Header) X() *wml.Hdr { + return h.x +} + +// AddParagraph adds a paragraph to the header. +func (h Header) AddParagraph() Paragraph { + bc := wml.NewEG_ContentBlockContent() + h.x.EG_ContentBlockContent = append(h.x.EG_ContentBlockContent, bc) + p := wml.NewCT_P() + bc.P = append(bc.P, p) + return Paragraph{h.d, p} +} + +// Index returns the index of the header within the document. This is used to +// form its zip packaged filename as well as to match it with its relationship +// ID. +func (h Header) Index() int { + for i, hdr := range h.d.headers { + if hdr == h.x { + return i + } + } + return -1 +} + +// Paragraphs returns the paragraphs defined in a header. +func (h Header) Paragraphs() []Paragraph { + ret := []Paragraph{} + for _, ec := range h.x.EG_ContentBlockContent { + for _, p := range ec.P { + ret = append(ret, Paragraph{h.d, p}) + } + } + return ret +} + +// RemoveParagraph removes a paragraph from a footer. +func (h Header) RemoveParagraph(p Paragraph) { + for _, ec := range h.x.EG_ContentBlockContent { + for i, pa := range ec.P { + // do we need to remove this paragraph + if pa == p.x { + copy(ec.P[i:], ec.P[i+1:]) + ec.P = ec.P[0 : len(ec.P)-1] + return + } + } + } +} + +// Clear clears all content within a header +func (h Header) Clear() { + h.x.EG_ContentBlockContent = nil +} + +// AddImage adds an image to the document package, returning a reference that +// can be used to add the image to a run and place it in the document contents. +func (h Header) AddImage(i common.Image) (common.ImageRef, error) { + var hdrRels common.Relationships + for i, hdr := range h.d.headers { + if hdr == h.x { + hdrRels = h.d.hdrRels[i] + } + } + + r := common.MakeImageRef(i, &h.d.DocBase, hdrRels) + if i.Path == "" { + return r, errors.New("image must have a path") + } + + if i.Format == "" { + return r, errors.New("image must have a valid format") + } + if i.Size.X == 0 || i.Size.Y == 0 { + return r, errors.New("image must have a valid size") + } + + h.d.Images = append(h.d.Images, r) + fn := fmt.Sprintf("media/image%d.%s", len(h.d.Images), i.Format) + rel := hdrRels.AddRelationship(fn, gooxml.ImageType) + r.SetRelID(rel.X().IdAttr) + return r, nil +} diff --git a/backend/vendor/baliance.com/gooxml/document/hyperlink.go b/backend/vendor/baliance.com/gooxml/document/hyperlink.go new file mode 100644 index 00000000..cb884bbd --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/hyperlink.go @@ -0,0 +1,63 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package document + +import ( + "baliance.com/gooxml" + "baliance.com/gooxml/common" + "baliance.com/gooxml/schema/soo/wml" +) + +// HyperLink is a link within a document. +type HyperLink struct { + d *Document + x *wml.CT_Hyperlink +} + +// X returns the inner wrapped XML type. +func (h HyperLink) X() *wml.CT_Hyperlink { + return h.x +} + +// SetTargetByRef sets the URL target of the hyperlink and is more efficient if a link +// destination will be used many times. +func (h HyperLink) SetTargetByRef(link common.Hyperlink) { + h.x.IdAttr = gooxml.String(common.Relationship(link).ID()) + h.x.AnchorAttr = nil +} + +// SetTarget sets the URL target of the hyperlink. +func (h HyperLink) SetTarget(url string) { + rel := h.d.AddHyperlink(url) + h.x.IdAttr = gooxml.String(common.Relationship(rel).ID()) + h.x.AnchorAttr = nil +} + +// SetTargetBookmark sets the bookmark target of the hyperlink. +func (h HyperLink) SetTargetBookmark(bm Bookmark) { + h.x.AnchorAttr = gooxml.String(bm.Name()) + h.x.IdAttr = nil +} + +// SetToolTip sets the tooltip text for a hyperlink. +func (h HyperLink) SetToolTip(text string) { + if text == "" { + h.x.TooltipAttr = nil + } else { + h.x.TooltipAttr = gooxml.String(text) + } +} + +// AddRun adds a run of text to a hyperlink. This is the text that will be linked. +func (h HyperLink) AddRun() Run { + rc := wml.NewEG_ContentRunContent() + h.x.EG_ContentRunContent = append(h.x.EG_ContentRunContent, rc) + r := wml.NewCT_R() + rc.R = r + return Run{h.d, r} +} diff --git a/backend/vendor/baliance.com/gooxml/document/inlinedrawing.go b/backend/vendor/baliance.com/gooxml/document/inlinedrawing.go new file mode 100644 index 00000000..b0d014ab --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/inlinedrawing.go @@ -0,0 +1,46 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package document + +import ( + "baliance.com/gooxml/common" + "baliance.com/gooxml/measurement" + pic "baliance.com/gooxml/schema/soo/dml/picture" + "baliance.com/gooxml/schema/soo/wml" +) + +// InlineDrawing is an inlined image within a run. +type InlineDrawing struct { + d *Document + x *wml.WdInline +} + +// X returns the inner wrapped XML type. +func (i InlineDrawing) X() *wml.WdInline { + return i.x +} + +// GetImage returns the ImageRef associated with an InlineDrawing. +func (i InlineDrawing) GetImage() (common.ImageRef, bool) { + any := i.x.Graphic.GraphicData.Any + if len(any) > 0 { + p, ok := any[0].(*pic.Pic) + if ok { + if p.BlipFill != nil && p.BlipFill.Blip != nil && p.BlipFill.Blip.EmbedAttr != nil { + return i.d.GetImageByRelID(*p.BlipFill.Blip.EmbedAttr) + } + } + } + return common.ImageRef{}, false +} + +// SetSize sets the size of the displayed image on the page. +func (i InlineDrawing) SetSize(w, h measurement.Distance) { + i.x.Extent.CxAttr = int64(float64(w*measurement.Pixel72) / measurement.EMU) + i.x.Extent.CyAttr = int64(float64(h*measurement.Pixel72) / measurement.EMU) +} diff --git a/backend/vendor/baliance.com/gooxml/document/knownfields.go b/backend/vendor/baliance.com/gooxml/document/knownfields.go new file mode 100644 index 00000000..c10df9ab --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/knownfields.go @@ -0,0 +1,21 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package document + +// Field constants +const ( + FieldCurrentPage = "PAGE" + FieldNumberOfPages = "NUMPAGES" + FieldDate = "DATE" + FieldCreateDate = "CREATEDATE" + FieldEditTime = "EDITTIME" + FieldPrintDate = "PRINTDATE" + FieldSaveDate = "SAVEDATE" + FieldTIme = "TIME" + FieldTOC = "TOC" +) diff --git a/backend/vendor/baliance.com/gooxml/document/mailmerge.go b/backend/vendor/baliance.com/gooxml/document/mailmerge.go new file mode 100644 index 00000000..7a6825cb --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/mailmerge.go @@ -0,0 +1,225 @@ +// Copyright 2018 Baliance. All rights reserved. + +package document + +import ( + "bytes" + "strings" + "unicode" + + "baliance.com/gooxml/schema/soo/wml" +) + +type mergeFieldInfo struct { + fieldName string + followText string + beforeText string + upper bool + lower bool + firstCap bool + caps bool + + // normal merge fields + para Paragraph + begIdx, sepIdx, endIdx int + + // simple fields + pc *wml.EG_PContent + isSimple bool +} + +func parseField(mf string) mergeFieldInfo { + //fields := strings.Fields(mf) + fields := []string{} + sb := bytes.Buffer{} + pq := -1 + for i, c := range mf { + switch c { + case ' ': + if sb.Len() != 0 { + fields = append(fields, sb.String()) + } + sb.Reset() + case '"': + if pq != -1 { + // this doesn't handled nested quotes, but it's good enough + // for the field info I've seen + fields = append(fields, mf[pq+1:i]) + pq = -1 + } else { + pq = i + } + default: + sb.WriteRune(c) + } + } + if sb.Len() != 0 { + fields = append(fields, sb.String()) + } + + field := mergeFieldInfo{} + for i := 0; i < len(fields)-1; i++ { + k := fields[i] + switch k { + case "MERGEFIELD": + field.fieldName = fields[i+1] + i++ + case "\\f": + field.followText = fields[i+1] + i++ + case "\\b": + field.beforeText = fields[i+1] + i++ + case "\\*": + switch fields[i+1] { + case "Upper": + field.upper = true + case "Lower": + field.lower = true + case "Caps": + field.caps = true + case "FirstCap": + field.firstCap = true + } + i++ + } + } + return field +} + +// MergeFields returns the list of all mail merge fields found in the document. +func (d Document) mergeFields() []mergeFieldInfo { + mf := []mergeFieldInfo{} + for _, p := range d.Paragraphs() { + runs := p.Runs() + begIdx := -1 + sepIdx := -1 + endIdx := -1 + mergeField := mergeFieldInfo{} + for _, pc := range p.x.EG_PContent { + for _, fs := range pc.FldSimple { + if strings.Contains(fs.InstrAttr, "MERGEFIELD") { + f := parseField(fs.InstrAttr) + f.isSimple = true + f.para = p + f.pc = pc + mf = append(mf, f) + } + } + } + for i := 0; i < len(runs); i++ { + r := runs[i] + for _, ic := range r.X().EG_RunInnerContent { + if ic.FldChar != nil { + switch ic.FldChar.FldCharTypeAttr { + case wml.ST_FldCharTypeBegin: + begIdx = i + case wml.ST_FldCharTypeSeparate: + sepIdx = i + case wml.ST_FldCharTypeEnd: + endIdx = i + if mergeField.fieldName != "" { + mergeField.para = p + mergeField.begIdx = begIdx + mergeField.endIdx = endIdx + mergeField.sepIdx = sepIdx + mf = append(mf, mergeField) + } + begIdx = -1 + sepIdx = -1 + endIdx = -1 + mergeField = mergeFieldInfo{} + } + } else if ic.InstrText != nil && strings.Contains(ic.InstrText.Content, "MERGEFIELD") { + if begIdx != -1 && endIdx == -1 { + mergeField = parseField(ic.InstrText.Content) + } + } + } + } + } + return mf +} + +// MergeFields returns the list of all mail merge fields found in the document. +func (d Document) MergeFields() []string { + flds := map[string]struct{}{} + for _, mf := range d.mergeFields() { + flds[mf.fieldName] = struct{}{} + } + ret := []string{} + for k := range flds { + ret = append(ret, k) + } + return ret +} + +// MailMerge finds mail merge fields and replaces them with the text provided. It also removes +// the mail merge source info from the document settings. +func (d *Document) MailMerge(mergeContent map[string]string) { + fields := d.mergeFields() + remove := map[Paragraph][]Run{} + for _, v := range fields { + repText, ok := mergeContent[v.fieldName] + if ok { + if v.upper { + repText = strings.ToUpper(repText) + } else if v.lower { + repText = strings.ToLower(repText) + } else if v.caps { + repText = strings.Title(repText) + } else if v.firstCap { + sb := bytes.Buffer{} + for i, v := range repText { + if i == 0 { + sb.WriteRune(unicode.ToUpper(v)) + } else { + sb.WriteRune(v) + } + } + repText = sb.String() + } + + if repText != "" && v.beforeText != "" { + repText = v.beforeText + repText + } + if repText != "" && v.followText != "" { + repText = repText + v.followText + } + } + + if v.isSimple { + // simple field replacement, just promote the run + if len(v.pc.FldSimple) == 1 && + len(v.pc.FldSimple[0].EG_PContent) == 1 && + len(v.pc.FldSimple[0].EG_PContent[0].EG_ContentRunContent) == 1 { + rc := &wml.EG_ContentRunContent{} + rc.R = v.pc.FldSimple[0].EG_PContent[0].EG_ContentRunContent[0].R + v.pc.FldSimple = nil + run := Run{d, rc.R} + run.ClearContent() + run.AddText(repText) + v.pc.EG_ContentRunContent = append(v.pc.EG_ContentRunContent, rc) + } + } else { + // non-simple so we'll remove the extra stuff + runs := v.para.Runs() + for i := v.begIdx; i <= v.endIdx; i++ { + if i == v.sepIdx+1 { + runs[i].ClearContent() + runs[i].AddText(repText) + } else { + remove[v.para] = append(remove[v.para], runs[i]) + } + } + } + } + // remove any of the mail merge field runs except for the one immediately after 'separate' + for p, runs := range remove { + for _, r := range runs { + p.RemoveRun(r) + } + } + + d.Settings.RemoveMailMerge() +} diff --git a/backend/vendor/baliance.com/gooxml/document/numbering.go b/backend/vendor/baliance.com/gooxml/document/numbering.go new file mode 100644 index 00000000..45019170 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/numbering.go @@ -0,0 +1,122 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package document + +import ( + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" + "baliance.com/gooxml/schema/soo/wml" +) + +// Numbering is the document wide numbering styles contained in numbering.xml. +type Numbering struct { + x *wml.Numbering +} + +// NewNumbering constructs a new numbering. +func NewNumbering() Numbering { + n := wml.NewNumbering() + return Numbering{n} +} + +// X returns the inner wrapped XML type. +func (n Numbering) X() *wml.Numbering { + return n.x +} + +// Clear resets the numbering. +func (n Numbering) Clear() { + n.x.AbstractNum = nil + n.x.Num = nil + n.x.NumIdMacAtCleanup = nil + n.x.NumPicBullet = nil +} + +// InitializeDefault constructs a default numbering. +func (n Numbering) InitializeDefault() { + abs := wml.NewCT_AbstractNum() + abs.MultiLevelType = wml.NewCT_MultiLevelType() + abs.MultiLevelType.ValAttr = wml.ST_MultiLevelTypeHybridMultilevel + + n.x.AbstractNum = append(n.x.AbstractNum, abs) + abs.AbstractNumIdAttr = 1 + const indentStart = 720 + const indentDelta = 720 + const hangingIndent = 360 + for i := 0; i < 9; i++ { + lvl := wml.NewCT_Lvl() + lvl.IlvlAttr = int64(i) + lvl.Start = wml.NewCT_DecimalNumber() + lvl.Start.ValAttr = 1 + + lvl.NumFmt = wml.NewCT_NumFmt() + lvl.NumFmt.ValAttr = wml.ST_NumberFormatBullet + + lvl.Suff = wml.NewCT_LevelSuffix() + lvl.Suff.ValAttr = wml.ST_LevelSuffixNothing + + lvl.LvlText = wml.NewCT_LevelText() + lvl.LvlText.ValAttr = gooxml.String("") + + lvl.LvlJc = wml.NewCT_Jc() + lvl.LvlJc.ValAttr = wml.ST_JcLeft + + lvl.RPr = wml.NewCT_RPr() + lvl.RPr.RFonts = wml.NewCT_Fonts() + lvl.RPr.RFonts.AsciiAttr = gooxml.String("Symbol") + lvl.RPr.RFonts.HAnsiAttr = gooxml.String("Symbol") + lvl.RPr.RFonts.HintAttr = wml.ST_HintDefault + + lvl.PPr = wml.NewCT_PPrGeneral() + + indent := int64(i*indentDelta + indentStart) + lvl.PPr.Ind = wml.NewCT_Ind() + lvl.PPr.Ind.LeftAttr = &wml.ST_SignedTwipsMeasure{} + lvl.PPr.Ind.LeftAttr.Int64 = gooxml.Int64(indent) + lvl.PPr.Ind.HangingAttr = &sharedTypes.ST_TwipsMeasure{} + lvl.PPr.Ind.HangingAttr.ST_UnsignedDecimalNumber = gooxml.Uint64(uint64(hangingIndent)) + + abs.Lvl = append(abs.Lvl, lvl) + } + num := wml.NewCT_Num() + num.NumIdAttr = 1 + num.AbstractNumId = wml.NewCT_DecimalNumber() + num.AbstractNumId.ValAttr = 1 + n.x.Num = append(n.x.Num, num) +} + +// Definitions returns the defined numbering definitions. +func (n Numbering) Definitions() []NumberingDefinition { + ret := []NumberingDefinition{} + for _, n := range n.x.AbstractNum { + ret = append(ret, NumberingDefinition{n}) + } + return ret +} + +// AddDefinition adds a new numbering definition. +func (n Numbering) AddDefinition() NumberingDefinition { + nx := wml.NewCT_Num() + + nextID := int64(1) + for _, nd := range n.Definitions() { + if nd.AbstractNumberID() >= nextID { + nextID = nd.AbstractNumberID() + 1 + } + } + nx.NumIdAttr = nextID + nx.AbstractNumId = wml.NewCT_DecimalNumber() + nx.AbstractNumId.ValAttr = nextID + + an := wml.NewCT_AbstractNum() + an.AbstractNumIdAttr = nextID + + n.x.AbstractNum = append(n.x.AbstractNum, an) + n.x.Num = append(n.x.Num, nx) + return NumberingDefinition{an} +} diff --git a/backend/vendor/baliance.com/gooxml/document/numberingdefinition.go b/backend/vendor/baliance.com/gooxml/document/numberingdefinition.go new file mode 100644 index 00000000..c31fa819 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/numberingdefinition.go @@ -0,0 +1,43 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package document + +import "baliance.com/gooxml/schema/soo/wml" + +// NumberingDefinition defines a numbering definition for a list of pragraphs. +type NumberingDefinition struct { + x *wml.CT_AbstractNum +} + +// X returns the inner wrapped XML type. +func (n NumberingDefinition) X() *wml.CT_AbstractNum { + return n.x +} + +// AbstractNumberID returns the ID that is unique within all numbering +// definitions that is used to assign the definition to a paragraph. +func (n NumberingDefinition) AbstractNumberID() int64 { + return n.x.AbstractNumIdAttr +} + +// Levels returns all of the numbering levels defined in the definition. +func (n NumberingDefinition) Levels() []NumberingLevel { + ret := []NumberingLevel{} + for _, nl := range n.x.Lvl { + ret = append(ret, NumberingLevel{nl}) + } + return ret +} + +// AddLevel adds a new numbering level to a NumberingDefinition. +func (n NumberingDefinition) AddLevel() NumberingLevel { + nl := wml.NewCT_Lvl() + nl.IlvlAttr = int64(len(n.x.Lvl)) + n.x.Lvl = append(n.x.Lvl, nl) + return NumberingLevel{nl} +} diff --git a/backend/vendor/baliance.com/gooxml/document/numberinglevel.go b/backend/vendor/baliance.com/gooxml/document/numberinglevel.go new file mode 100644 index 00000000..65fcd117 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/numberinglevel.go @@ -0,0 +1,68 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package document + +import ( + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/wml" +) + +// NumberingLevel is the definition for numbering for a particular level within +// a NumberingDefinition. +type NumberingLevel struct { + x *wml.CT_Lvl +} + +// X returns the inner wrapped XML type. +func (n NumberingLevel) X() *wml.CT_Lvl { + return n.x +} + +// SetFormat sets the numbering format. +func (n NumberingLevel) SetFormat(f wml.ST_NumberFormat) { + if n.x.NumFmt == nil { + n.x.NumFmt = wml.NewCT_NumFmt() + } + n.x.NumFmt.ValAttr = f +} + +// SetText sets the text to be used in bullet mode. +func (n NumberingLevel) SetText(t string) { + if t == "" { + n.x.LvlText = nil + } else { + n.x.LvlText = wml.NewCT_LevelText() + n.x.LvlText.ValAttr = gooxml.String(t) + } +} + +// Properties returns the numbering level paragraph properties. +func (n NumberingLevel) Properties() ParagraphStyleProperties { + if n.x.PPr == nil { + n.x.PPr = wml.NewCT_PPrGeneral() + } + return ParagraphStyleProperties{n.x.PPr} +} + +// SetAlignment sets the paragraph alignment +func (n NumberingLevel) SetAlignment(j wml.ST_Jc) { + if j == wml.ST_JcUnset { + n.x.LvlJc = nil + } else { + n.x.LvlJc = wml.NewCT_Jc() + n.x.LvlJc.ValAttr = j + } +} + +// RunProperties returns the RunProperties controlling numbering level font, etc. +func (n NumberingLevel) RunProperties() RunProperties { + if n.x.RPr == nil { + n.x.RPr = wml.NewCT_RPr() + } + return RunProperties{n.x.RPr} +} diff --git a/backend/vendor/baliance.com/gooxml/document/onoffvalue.go b/backend/vendor/baliance.com/gooxml/document/onoffvalue.go new file mode 100644 index 00000000..9dd1c010 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/onoffvalue.go @@ -0,0 +1,32 @@ +// Copyright 2018 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package document + +import "baliance.com/gooxml/schema/soo/wml" + +// OnOffValue represents an on/off value that can also be unset +type OnOffValue byte + +// OnOffValue constants +const ( + OnOffValueUnset OnOffValue = iota + OnOffValueOff + OnOffValueOn +) + +func convertOnOff(v *wml.CT_OnOff) OnOffValue { + if v == nil { + return OnOffValueUnset + } + // set, but the value is set to false + if v.ValAttr != nil && v.ValAttr.Bool != nil && *v.ValAttr.Bool == false { + return OnOffValueOff + } + // element exists, which implies turned on (and boolean value can't be false) + return OnOffValueOn +} diff --git a/backend/vendor/baliance.com/gooxml/document/paragraph.go b/backend/vendor/baliance.com/gooxml/document/paragraph.go new file mode 100644 index 00000000..da434d17 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/paragraph.go @@ -0,0 +1,246 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package document + +import ( + "baliance.com/gooxml/schema/soo/wml" +) + +// Paragraph is a paragraph within a document. +type Paragraph struct { + d *Document + x *wml.CT_P +} + +// X returns the inner wrapped XML type. +func (p Paragraph) X() *wml.CT_P { + return p.x +} + +func (p Paragraph) ensurePPr() { + if p.x.PPr == nil { + p.x.PPr = wml.NewCT_PPr() + } +} + +// RemoveRun removes a child run from a paragraph. +func (p Paragraph) RemoveRun(r Run) { + for _, c := range p.x.EG_PContent { + for i, rc := range c.EG_ContentRunContent { + if rc.R == r.x { + copy(c.EG_ContentRunContent[i:], c.EG_ContentRunContent[i+1:]) + c.EG_ContentRunContent = c.EG_ContentRunContent[0 : len(c.EG_ContentRunContent)-1] + } + if rc.Sdt != nil && rc.Sdt.SdtContent != nil { + for i, rc2 := range rc.Sdt.SdtContent.EG_ContentRunContent { + if rc2.R == r.x { + copy(rc.Sdt.SdtContent.EG_ContentRunContent[i:], rc.Sdt.SdtContent.EG_ContentRunContent[i+1:]) + rc.Sdt.SdtContent.EG_ContentRunContent = rc.Sdt.SdtContent.EG_ContentRunContent[0 : len(rc.Sdt.SdtContent.EG_ContentRunContent)-1] + } + } + } + } + } +} + +// Properties returns the paragraph properties. +func (p Paragraph) Properties() ParagraphProperties { + p.ensurePPr() + return ParagraphProperties{p.d, p.x.PPr} +} + +// Style returns the style for a paragraph, or an empty string if it is unset. +func (p Paragraph) Style() string { + if p.x.PPr != nil && p.x.PPr.PStyle != nil { + return p.x.PPr.PStyle.ValAttr + } + return "" +} + +// SetStyle sets the style of a paragraph and is identical to setting it on the +// paragraph's Properties() +func (p Paragraph) SetStyle(s string) { + p.ensurePPr() + if s == "" { + p.x.PPr.PStyle = nil + } else { + p.x.PPr.PStyle = wml.NewCT_String() + p.x.PPr.PStyle.ValAttr = s + } +} + +// AddRun adds a run to a paragraph. +func (p Paragraph) AddRun() Run { + pc := wml.NewEG_PContent() + p.x.EG_PContent = append(p.x.EG_PContent, pc) + + rc := wml.NewEG_ContentRunContent() + pc.EG_ContentRunContent = append(pc.EG_ContentRunContent, rc) + r := wml.NewCT_R() + rc.R = r + return Run{p.d, r} +} + +// Runs returns all of the runs in a paragraph. +func (p Paragraph) Runs() []Run { + ret := []Run{} + for _, c := range p.x.EG_PContent { + for _, rc := range c.EG_ContentRunContent { + if rc.R != nil { + ret = append(ret, Run{p.d, rc.R}) + } + if rc.Sdt != nil && rc.Sdt.SdtContent != nil { + for _, rc2 := range rc.Sdt.SdtContent.EG_ContentRunContent { + if rc2.R != nil { + ret = append(ret, Run{p.d, rc2.R}) + } + } + } + } + } + return ret +} + +// InsertRunAfter inserts a run in the paragraph after the relative run. +func (p Paragraph) InsertRunAfter(relativeTo Run) Run { + return p.insertRun(relativeTo, false) +} + +// InsertRunBefore inserts a run in the paragraph before the relative run. +func (p Paragraph) InsertRunBefore(relativeTo Run) Run { + return p.insertRun(relativeTo, true) +} + +func (p Paragraph) insertRun(relativeTo Run, before bool) Run { + for _, c := range p.x.EG_PContent { + for i, rc := range c.EG_ContentRunContent { + if rc.R == relativeTo.X() { + r := wml.NewCT_R() + c.EG_ContentRunContent = append(c.EG_ContentRunContent, nil) + if before { + copy(c.EG_ContentRunContent[i+1:], c.EG_ContentRunContent[i:]) + c.EG_ContentRunContent[i] = wml.NewEG_ContentRunContent() + c.EG_ContentRunContent[i].R = r + } else { + copy(c.EG_ContentRunContent[i+2:], c.EG_ContentRunContent[i+1:]) + c.EG_ContentRunContent[i+1] = wml.NewEG_ContentRunContent() + c.EG_ContentRunContent[i+1].R = r + } + return Run{p.d, r} + + } + if rc.Sdt != nil && rc.Sdt.SdtContent != nil { + for _, rc2 := range rc.Sdt.SdtContent.EG_ContentRunContent { + if rc2.R == relativeTo.X() { + r := wml.NewCT_R() + rc.Sdt.SdtContent.EG_ContentRunContent = append(rc.Sdt.SdtContent.EG_ContentRunContent, nil) + if before { + copy(rc.Sdt.SdtContent.EG_ContentRunContent[i+1:], rc.Sdt.SdtContent.EG_ContentRunContent[i:]) + rc.Sdt.SdtContent.EG_ContentRunContent[i] = wml.NewEG_ContentRunContent() + rc.Sdt.SdtContent.EG_ContentRunContent[i].R = r + } else { + copy(rc.Sdt.SdtContent.EG_ContentRunContent[i+2:], rc.Sdt.SdtContent.EG_ContentRunContent[i+1:]) + rc.Sdt.SdtContent.EG_ContentRunContent[i+1] = wml.NewEG_ContentRunContent() + rc.Sdt.SdtContent.EG_ContentRunContent[i+1].R = r + } + return Run{p.d, r} + } + } + } + } + } + return p.AddRun() +} + +// AddHyperLink adds a new hyperlink to a parapgraph. +func (p Paragraph) AddHyperLink() HyperLink { + pc := wml.NewEG_PContent() + p.x.EG_PContent = append(p.x.EG_PContent, pc) + + pc.Hyperlink = wml.NewCT_Hyperlink() + return HyperLink{p.d, pc.Hyperlink} +} + +// AddBookmark adds a bookmark to a document that can then be used from a hyperlink. Name is a document +// unique name that identifies the bookmark so it can be referenced from hyperlinks. +func (p Paragraph) AddBookmark(name string) Bookmark { + pc := wml.NewEG_PContent() + rc := wml.NewEG_ContentRunContent() + pc.EG_ContentRunContent = append(pc.EG_ContentRunContent, rc) + + relt := wml.NewEG_RunLevelElts() + rc.EG_RunLevelElts = append(rc.EG_RunLevelElts, relt) + + markEl := wml.NewEG_RangeMarkupElements() + bmStart := wml.NewCT_Bookmark() + markEl.BookmarkStart = bmStart + relt.EG_RangeMarkupElements = append(relt.EG_RangeMarkupElements, markEl) + + markEl = wml.NewEG_RangeMarkupElements() + markEl.BookmarkEnd = wml.NewCT_MarkupRange() + + relt.EG_RangeMarkupElements = append(relt.EG_RangeMarkupElements, markEl) + + p.x.EG_PContent = append(p.x.EG_PContent, pc) + + bm := Bookmark{bmStart} + bm.SetName(name) + return bm +} + +// SetNumberingLevel sets the numbering level of a paragraph. If used, then the +// NumberingDefinition must also be set via SetNumberingDefinition or +// SetNumberingDefinitionByID. +func (p Paragraph) SetNumberingLevel(listLevel int) { + p.ensurePPr() + if p.x.PPr.NumPr == nil { + p.x.PPr.NumPr = wml.NewCT_NumPr() + } + lvl := wml.NewCT_DecimalNumber() + lvl.ValAttr = int64(listLevel) + p.x.PPr.NumPr.Ilvl = lvl +} + +// SetNumberingDefinition sets the numbering definition ID via a NumberingDefinition +// defined in numbering.xml +func (p Paragraph) SetNumberingDefinition(nd NumberingDefinition) { + p.ensurePPr() + if p.x.PPr.NumPr == nil { + p.x.PPr.NumPr = wml.NewCT_NumPr() + } + lvl := wml.NewCT_DecimalNumber() + + numID := int64(-1) + for _, n := range p.d.Numbering.x.Num { + if n.AbstractNumId != nil && n.AbstractNumId.ValAttr == nd.AbstractNumberID() { + numID = n.NumIdAttr + } + } + if numID == -1 { + num := wml.NewCT_Num() + p.d.Numbering.x.Num = append(p.d.Numbering.x.Num, num) + num.NumIdAttr = int64(len(p.d.Numbering.x.Num)) + num.AbstractNumId = wml.NewCT_DecimalNumber() + num.AbstractNumId.ValAttr = nd.AbstractNumberID() + } + + lvl.ValAttr = numID + p.x.PPr.NumPr.NumId = lvl +} + +// SetNumberingDefinitionByID sets the numbering definition ID directly, which must +// match an ID defined in numbering.xml +func (p Paragraph) SetNumberingDefinitionByID(abstractNumberID int64) { + p.ensurePPr() + if p.x.PPr.NumPr == nil { + p.x.PPr.NumPr = wml.NewCT_NumPr() + } + lvl := wml.NewCT_DecimalNumber() + lvl.ValAttr = int64(abstractNumberID) + p.x.PPr.NumPr.NumId = lvl +} diff --git a/backend/vendor/baliance.com/gooxml/document/paragraphproperties.go b/backend/vendor/baliance.com/gooxml/document/paragraphproperties.go new file mode 100644 index 00000000..e44f0fcd --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/paragraphproperties.go @@ -0,0 +1,201 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package document + +import ( + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/measurement" + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" + "baliance.com/gooxml/schema/soo/wml" +) + +// ParagraphProperties are the properties for a paragraph. +type ParagraphProperties struct { + d *Document + x *wml.CT_PPr +} + +// X returns the inner wrapped XML type. +func (p ParagraphProperties) X() *wml.CT_PPr { + return p.x +} + +// SetSpacing sets the spacing that comes before and after the paragraph. +// Deprecated: See Spacing() instead which allows finer control. +func (p ParagraphProperties) SetSpacing(before, after measurement.Distance) { + if p.x.Spacing == nil { + p.x.Spacing = wml.NewCT_Spacing() + } + p.x.Spacing.BeforeAttr = &sharedTypes.ST_TwipsMeasure{} + p.x.Spacing.BeforeAttr.ST_UnsignedDecimalNumber = gooxml.Uint64(uint64(before / measurement.Twips)) + p.x.Spacing.AfterAttr = &sharedTypes.ST_TwipsMeasure{} + p.x.Spacing.AfterAttr.ST_UnsignedDecimalNumber = gooxml.Uint64(uint64(after / measurement.Twips)) +} + +// Spacing returns the paragraph spacing settings. +func (p ParagraphProperties) Spacing() ParagraphSpacing { + if p.x.Spacing == nil { + p.x.Spacing = wml.NewCT_Spacing() + } + return ParagraphSpacing{p.x.Spacing} +} + +// SetAlignment controls the paragraph alignment +func (p ParagraphProperties) SetAlignment(align wml.ST_Jc) { + if align == wml.ST_JcUnset { + p.x.Jc = nil + } else { + p.x.Jc = wml.NewCT_Jc() + p.x.Jc.ValAttr = align + } +} + +// Style returns the style for a paragraph, or an empty string if it is unset. +func (p ParagraphProperties) Style() string { + if p.x.PStyle != nil { + return p.x.PStyle.ValAttr + } + return "" +} + +// SetStyle sets the style of a paragraph. +func (p ParagraphProperties) SetStyle(s string) { + if s == "" { + p.x.PStyle = nil + } else { + p.x.PStyle = wml.NewCT_String() + p.x.PStyle.ValAttr = s + } +} + +// AddTabStop adds a tab stop to the paragraph. It controls the position of text when using Run.AddTab() +func (p ParagraphProperties) AddTabStop(position measurement.Distance, justificaton wml.ST_TabJc, leader wml.ST_TabTlc) { + if p.x.Tabs == nil { + p.x.Tabs = wml.NewCT_Tabs() + } + tab := wml.NewCT_TabStop() + tab.LeaderAttr = leader + tab.ValAttr = justificaton + tab.PosAttr.Int64 = gooxml.Int64(int64(position / measurement.Twips)) + p.x.Tabs.Tab = append(p.x.Tabs.Tab, tab) +} + +// AddSection adds a new document section with an optional section break. If t +// is ST_SectionMarkUnset, then no break will be inserted. +func (p ParagraphProperties) AddSection(t wml.ST_SectionMark) Section { + p.x.SectPr = wml.NewCT_SectPr() + if t != wml.ST_SectionMarkUnset { + p.x.SectPr.Type = wml.NewCT_SectType() + p.x.SectPr.Type.ValAttr = t + } + return Section{p.d, p.x.SectPr} +} + +// SetHeadingLevel sets a heading level and style based on the level to a +// paragraph. The default styles for a new gooxml document support headings +// from level 1 to 8. +func (p ParagraphProperties) SetHeadingLevel(idx int) { + p.SetStyle(fmt.Sprintf("Heading%d", idx)) + if p.x.NumPr == nil { + p.x.NumPr = wml.NewCT_NumPr() + } + p.x.NumPr.Ilvl = wml.NewCT_DecimalNumber() + p.x.NumPr.Ilvl.ValAttr = int64(idx) +} + +// SetKeepWithNext controls if this paragraph should be kept with the next. +func (p ParagraphProperties) SetKeepWithNext(b bool) { + if !b { + p.x.KeepNext = nil + } else { + p.x.KeepNext = wml.NewCT_OnOff() + } +} + +// SetKeepOnOnePage controls if all lines in a paragraph are kept on the same +// page. +func (p ParagraphProperties) SetKeepOnOnePage(b bool) { + if !b { + p.x.KeepLines = nil + } else { + p.x.KeepLines = wml.NewCT_OnOff() + } +} + +// SetPageBreakBefore controls if there is a page break before this paragraph. +func (p ParagraphProperties) SetPageBreakBefore(b bool) { + if !b { + p.x.PageBreakBefore = nil + } else { + p.x.PageBreakBefore = wml.NewCT_OnOff() + } +} + +// SetWindowControl controls if the first or last line of the paragraph is +// allowed to dispay on a separate page. +func (p ParagraphProperties) SetWindowControl(b bool) { + if !b { + p.x.WidowControl = nil + } else { + p.x.WidowControl = wml.NewCT_OnOff() + } +} + +// SetFirstLineIndent controls the indentation of the first line in a paragraph. +func (p ParagraphProperties) SetFirstLineIndent(m measurement.Distance) { + if p.x.Ind == nil { + p.x.Ind = wml.NewCT_Ind() + } + if m == measurement.Zero { + p.x.Ind.FirstLineAttr = nil + } else { + p.x.Ind.FirstLineAttr = &sharedTypes.ST_TwipsMeasure{} + p.x.Ind.FirstLineAttr.ST_UnsignedDecimalNumber = gooxml.Uint64(uint64(m / measurement.Twips)) + } +} + +// SetStartIndent controls the start indentation. +func (p ParagraphProperties) SetStartIndent(m measurement.Distance) { + if p.x.Ind == nil { + p.x.Ind = wml.NewCT_Ind() + } + if m == measurement.Zero { + p.x.Ind.StartAttr = nil + } else { + p.x.Ind.StartAttr = &wml.ST_SignedTwipsMeasure{} + p.x.Ind.StartAttr.Int64 = gooxml.Int64(int64(m / measurement.Twips)) + } +} + +// SetEndIndent controls the end indentation. +func (p ParagraphProperties) SetEndIndent(m measurement.Distance) { + if p.x.Ind == nil { + p.x.Ind = wml.NewCT_Ind() + } + if m == measurement.Zero { + p.x.Ind.EndAttr = nil + } else { + p.x.Ind.EndAttr = &wml.ST_SignedTwipsMeasure{} + p.x.Ind.EndAttr.Int64 = gooxml.Int64(int64(m / measurement.Twips)) + } +} + +// SetHangingIndent controls the indentation of the non-first lines in a paragraph. +func (p ParagraphProperties) SetHangingIndent(m measurement.Distance) { + if p.x.Ind == nil { + p.x.Ind = wml.NewCT_Ind() + } + if m == measurement.Zero { + p.x.Ind.HangingAttr = nil + } else { + p.x.Ind.HangingAttr = &sharedTypes.ST_TwipsMeasure{} + p.x.Ind.HangingAttr.ST_UnsignedDecimalNumber = gooxml.Uint64(uint64(m / measurement.Twips)) + } +} diff --git a/backend/vendor/baliance.com/gooxml/document/paragraphspacing.go b/backend/vendor/baliance.com/gooxml/document/paragraphspacing.go new file mode 100644 index 00000000..f1878abb --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/paragraphspacing.go @@ -0,0 +1,64 @@ +// Copyright 2018 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package document + +import ( + "baliance.com/gooxml" + "baliance.com/gooxml/measurement" + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" + "baliance.com/gooxml/schema/soo/wml" +) + +// ParagraphSpacing controls the spacing for a paragraph and its lines. +type ParagraphSpacing struct { + x *wml.CT_Spacing +} + +// SetBefore sets the spacing that comes before the paragraph. +func (p ParagraphSpacing) SetBefore(before measurement.Distance) { + p.x.BeforeAttr = &sharedTypes.ST_TwipsMeasure{} + p.x.BeforeAttr.ST_UnsignedDecimalNumber = gooxml.Uint64(uint64(before / measurement.Twips)) +} + +// SetAfter sets the spacing that comes after the paragraph. +func (p ParagraphSpacing) SetAfter(after measurement.Distance) { + p.x.AfterAttr = &sharedTypes.ST_TwipsMeasure{} + p.x.AfterAttr.ST_UnsignedDecimalNumber = gooxml.Uint64(uint64(after / measurement.Twips)) +} + +// SetLineSpacing sets the spacing between lines in a paragraph. +func (p ParagraphSpacing) SetLineSpacing(d measurement.Distance, rule wml.ST_LineSpacingRule) { + if rule == wml.ST_LineSpacingRuleUnset { + p.x.LineRuleAttr = wml.ST_LineSpacingRuleUnset + p.x.LineAttr = nil + } else { + p.x.LineRuleAttr = rule + p.x.LineAttr = &wml.ST_SignedTwipsMeasure{} + p.x.LineAttr.Int64 = gooxml.Int64(int64(d / measurement.Twips)) + } +} + +// SetBeforeAuto controls if spacing before a paragraph is automatically determined. +func (p ParagraphSpacing) SetBeforeAuto(b bool) { + if b { + p.x.BeforeAutospacingAttr = &sharedTypes.ST_OnOff{} + p.x.BeforeAutospacingAttr.Bool = gooxml.Bool(true) + } else { + p.x.BeforeAutospacingAttr = nil + } +} + +// SetAfterAuto controls if spacing after a paragraph is automatically determined. +func (p ParagraphSpacing) SetAfterAuto(b bool) { + if b { + p.x.AfterAutospacingAttr = &sharedTypes.ST_OnOff{} + p.x.AfterAutospacingAttr.Bool = gooxml.Bool(true) + } else { + p.x.AfterAutospacingAttr = nil + } +} diff --git a/backend/vendor/baliance.com/gooxml/document/paragraphstyleproperties.go b/backend/vendor/baliance.com/gooxml/document/paragraphstyleproperties.go new file mode 100644 index 00000000..50ea1449 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/paragraphstyleproperties.go @@ -0,0 +1,106 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package document + +import ( + "baliance.com/gooxml" + "baliance.com/gooxml/measurement" + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" + "baliance.com/gooxml/schema/soo/wml" +) + +// ParagraphStyleProperties is the styling information for a paragraph. +type ParagraphStyleProperties struct { + x *wml.CT_PPrGeneral +} + +// X returns the inner wrapped XML type. +func (p ParagraphStyleProperties) X() *wml.CT_PPrGeneral { + return p.x +} + +// AddTabStop adds a tab stop to the paragraph. +func (p ParagraphStyleProperties) AddTabStop(position measurement.Distance, justificaton wml.ST_TabJc, leader wml.ST_TabTlc) { + if p.x.Tabs == nil { + p.x.Tabs = wml.NewCT_Tabs() + } + tab := wml.NewCT_TabStop() + tab.LeaderAttr = leader + tab.ValAttr = justificaton + tab.PosAttr.Int64 = gooxml.Int64(int64(position / measurement.Twips)) + p.x.Tabs.Tab = append(p.x.Tabs.Tab, tab) +} + +// SetSpacing sets the spacing that comes before and after the paragraph. +func (p ParagraphStyleProperties) SetSpacing(before, after measurement.Distance) { + if p.x.Spacing == nil { + p.x.Spacing = wml.NewCT_Spacing() + } + + if before == measurement.Zero { + p.x.Spacing.BeforeAttr = nil + } else { + p.x.Spacing.BeforeAttr = &sharedTypes.ST_TwipsMeasure{} + p.x.Spacing.BeforeAttr.ST_UnsignedDecimalNumber = gooxml.Uint64(uint64(before / measurement.Twips)) + } + + if after == measurement.Zero { + p.x.Spacing.AfterAttr = nil + } else { + p.x.Spacing.AfterAttr = &sharedTypes.ST_TwipsMeasure{} + p.x.Spacing.AfterAttr.ST_UnsignedDecimalNumber = gooxml.Uint64(uint64(after / measurement.Twips)) + } +} + +// SetKeepNext controls if the paragraph is kept with the next paragraph. +func (p ParagraphStyleProperties) SetKeepNext(b bool) { + if !b { + p.x.KeepNext = nil + } else { + p.x.KeepNext = wml.NewCT_OnOff() + } +} + +// SetKeepOnOnePage controls if all lines in a paragraph are kept on the same +// page. +func (p ParagraphStyleProperties) SetKeepOnOnePage(b bool) { + if !b { + p.x.KeepLines = nil + } else { + p.x.KeepLines = wml.NewCT_OnOff() + } +} + +// SetOutlineLevel sets the outline level of this style. +func (p ParagraphStyleProperties) SetOutlineLevel(lvl int) { + p.x.OutlineLvl = wml.NewCT_DecimalNumber() + p.x.OutlineLvl.ValAttr = int64(lvl) +} + +// SetContextualSpacing controls whether to Ignore Spacing Above and Below When +// Using Identical Styles +func (p ParagraphStyleProperties) SetContextualSpacing(b bool) { + if !b { + p.x.ContextualSpacing = nil + } else { + p.x.ContextualSpacing = wml.NewCT_OnOff() + } +} + +// SetLeftIndent controls the left indent of the paragraph. +func (p ParagraphStyleProperties) SetLeftIndent(m measurement.Distance) { + if p.x.Ind == nil { + p.x.Ind = wml.NewCT_Ind() + } + if m == measurement.Zero { + p.x.Ind.LeftAttr = nil + } else { + p.x.Ind.LeftAttr = &wml.ST_SignedTwipsMeasure{} + p.x.Ind.LeftAttr.Int64 = gooxml.Int64(int64(m / measurement.Twips)) + } +} diff --git a/backend/vendor/baliance.com/gooxml/document/row.go b/backend/vendor/baliance.com/gooxml/document/row.go new file mode 100644 index 00000000..b5a7a4db --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/row.go @@ -0,0 +1,51 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package document + +import ( + "baliance.com/gooxml/schema/soo/wml" +) + +// Row is a row within a table within a document. +type Row struct { + d *Document + x *wml.CT_Row +} + +// X returns the inner wrapped XML type. +func (r Row) X() *wml.CT_Row { + return r.x +} + +// AddCell adds a cell to a row and returns it +func (r Row) AddCell() Cell { + cc := wml.NewEG_ContentCellContent() + r.x.EG_ContentCellContent = append(r.x.EG_ContentCellContent, cc) + tc := wml.NewCT_Tc() + cc.Tc = append(cc.Tc, tc) + return Cell{r.d, tc} +} + +// Properties returns the row properties. +func (r Row) Properties() RowProperties { + if r.x.TrPr == nil { + r.x.TrPr = wml.NewCT_TrPr() + } + return RowProperties{r.x.TrPr} +} + +// Cells returns the cells defined in the table. +func (r Row) Cells() []Cell { + ret := []Cell{} + for _, cc := range r.x.EG_ContentCellContent { + for _, ctCell := range cc.Tc { + ret = append(ret, Cell{r.d, ctCell}) + } + } + return ret +} diff --git a/backend/vendor/baliance.com/gooxml/document/rowproperties.go b/backend/vendor/baliance.com/gooxml/document/rowproperties.go new file mode 100644 index 00000000..92087a0a --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/rowproperties.go @@ -0,0 +1,33 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package document + +import ( + "baliance.com/gooxml" + "baliance.com/gooxml/measurement" + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" + "baliance.com/gooxml/schema/soo/wml" +) + +// RowProperties are the properties for a row within a table +type RowProperties struct { + x *wml.CT_TrPr +} + +// SetHeight allows controlling the height of a row within a table. +func (r RowProperties) SetHeight(ht measurement.Distance, rule wml.ST_HeightRule) { + if rule == wml.ST_HeightRuleUnset { + r.x.TrHeight = nil + } else { + htv := wml.NewCT_Height() + htv.HRuleAttr = rule + htv.ValAttr = &sharedTypes.ST_TwipsMeasure{} + htv.ValAttr.ST_UnsignedDecimalNumber = gooxml.Uint64(uint64(ht / measurement.Twips)) + r.x.TrHeight = []*wml.CT_Height{htv} + } +} diff --git a/backend/vendor/baliance.com/gooxml/document/run.go b/backend/vendor/baliance.com/gooxml/document/run.go new file mode 100644 index 00000000..3b81bf0d --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/run.go @@ -0,0 +1,276 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package document + +import ( + "bytes" + "errors" + "math/rand" + + "baliance.com/gooxml" + "baliance.com/gooxml/common" + "baliance.com/gooxml/measurement" + "baliance.com/gooxml/schema/soo/dml" + pic "baliance.com/gooxml/schema/soo/dml/picture" + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" + "baliance.com/gooxml/schema/soo/wml" +) + +// Run is a run of text within a paragraph that shares the same formatting. +type Run struct { + d *Document + x *wml.CT_R +} + +// X returns the inner wrapped XML type. +func (r Run) X() *wml.CT_R { + return r.x +} + +// Text returns the underlying tet in the run. +func (r Run) Text() string { + if len(r.x.EG_RunInnerContent) == 0 { + return "" + } + buf := bytes.Buffer{} + for _, ic := range r.x.EG_RunInnerContent { + if ic.T != nil { + buf.WriteString(ic.T.Content) + } + if ic.Tab != nil { + buf.WriteByte('\t') + } + } + return buf.String() +} + +// ClearContent clears any content in the run (text, tabs, breaks, etc.) +func (r Run) ClearContent() { + r.x.EG_RunInnerContent = nil +} + +// AddText adds tet to a run. +func (r Run) AddText(s string) { + ic := wml.NewEG_RunInnerContent() + r.x.EG_RunInnerContent = append(r.x.EG_RunInnerContent, ic) + ic.T = wml.NewCT_Text() + if gooxml.NeedsSpacePreserve(s) { + p := "preserve" + ic.T.SpaceAttr = &p + } + ic.T.Content = s +} + +func (r Run) newIC() *wml.EG_RunInnerContent { + ic := wml.NewEG_RunInnerContent() + r.x.EG_RunInnerContent = append(r.x.EG_RunInnerContent, ic) + return ic +} + +// Clear removes all of the content from within a run. +func (r Run) Clear() { + r.x.EG_RunInnerContent = nil +} + +// AddTab adds tab to a run and can be used with the the Paragraph's tab stops. +func (r Run) AddTab() { + ic := r.newIC() + ic.Tab = wml.NewCT_Empty() +} + +// AddFieldWithFormatting adds a field (automatically computed text) to the +// document with field specifc formatting. +func (r Run) AddFieldWithFormatting(code string, fmt string, isDirty bool) { + ic := r.newIC() + ic.FldChar = wml.NewCT_FldChar() + ic.FldChar.FldCharTypeAttr = wml.ST_FldCharTypeBegin + if isDirty { + ic.FldChar.DirtyAttr = &sharedTypes.ST_OnOff{} + ic.FldChar.DirtyAttr.Bool = gooxml.Bool(true) + } + + ic = r.newIC() + ic.InstrText = wml.NewCT_Text() + if fmt != "" { + ic.InstrText.Content = code + " " + fmt + } else { + ic.InstrText.Content = code + } + + ic = r.newIC() + ic.FldChar = wml.NewCT_FldChar() + ic.FldChar.FldCharTypeAttr = wml.ST_FldCharTypeEnd +} + +// AddField adds a field (automatically computed text) to the document. +func (r Run) AddField(code string) { + r.AddFieldWithFormatting(code, "", true) +} + +// Properties returns the run properties. +func (r Run) Properties() RunProperties { + if r.x.RPr == nil { + r.x.RPr = wml.NewCT_RPr() + } + return RunProperties{r.x.RPr} +} + +// AddBreak adds a line break to a run. +func (r Run) AddBreak() { + ic := r.newIC() + ic.Br = wml.NewCT_Br() +} + +// DrawingAnchored returns a slice of AnchoredDrawings. +func (r Run) DrawingAnchored() []AnchoredDrawing { + ret := []AnchoredDrawing{} + for _, ic := range r.x.EG_RunInnerContent { + if ic.Drawing == nil { + continue + } + for _, anc := range ic.Drawing.Anchor { + ret = append(ret, AnchoredDrawing{r.d, anc}) + } + } + return ret +} + +// AddDrawingAnchored adds an anchored (floating) drawing from an ImageRef. +func (r Run) AddDrawingAnchored(img common.ImageRef) (AnchoredDrawing, error) { + ic := r.newIC() + ic.Drawing = wml.NewCT_Drawing() + anchor := wml.NewWdAnchor() + + ad := AnchoredDrawing{r.d, anchor} + + // required by Word on OSX for the file to open + anchor.SimplePosAttr = gooxml.Bool(false) + + anchor.AllowOverlapAttr = true + anchor.CNvGraphicFramePr = dml.NewCT_NonVisualGraphicFrameProperties() + + ic.Drawing.Anchor = append(ic.Drawing.Anchor, anchor) + anchor.Graphic = dml.NewGraphic() + anchor.Graphic.GraphicData = dml.NewCT_GraphicalObjectData() + anchor.Graphic.GraphicData.UriAttr = "http://schemas.openxmlformats.org/drawingml/2006/picture" + anchor.SimplePos.XAttr.ST_CoordinateUnqualified = gooxml.Int64(0) + anchor.SimplePos.YAttr.ST_CoordinateUnqualified = gooxml.Int64(0) + anchor.PositionH.RelativeFromAttr = wml.WdST_RelFromHPage + anchor.PositionH.Choice = &wml.WdCT_PosHChoice{} + anchor.PositionH.Choice.PosOffset = gooxml.Int32(0) + + anchor.PositionV.RelativeFromAttr = wml.WdST_RelFromVPage + anchor.PositionV.Choice = &wml.WdCT_PosVChoice{} + anchor.PositionV.Choice.PosOffset = gooxml.Int32(0) + + anchor.Extent.CxAttr = int64(float64(img.Size().X*measurement.Pixel72) / measurement.EMU) + anchor.Extent.CyAttr = int64(float64(img.Size().Y*measurement.Pixel72) / measurement.EMU) + anchor.Choice = &wml.WdEG_WrapTypeChoice{} + anchor.Choice.WrapSquare = wml.NewWdCT_WrapSquare() + anchor.Choice.WrapSquare.WrapTextAttr = wml.WdST_WrapTextBothSides + + // Mac Word chokes if the ID is greater than an int32, even though the field is a + // uint32 in the XSD + randID := 0x7FFFFFFF & rand.Uint32() + anchor.DocPr.IdAttr = randID + p := pic.NewPic() + p.NvPicPr.CNvPr.IdAttr = randID + + // find the reference to the actual image file in the document relationships + // so we can embed via the relationship ID + imgID := img.RelID() + if imgID == "" { + return ad, errors.New("couldn't find reference to image within document relations") + } + + anchor.Graphic.GraphicData.Any = append(anchor.Graphic.GraphicData.Any, p) + p.BlipFill = dml.NewCT_BlipFillProperties() + p.BlipFill.Blip = dml.NewCT_Blip() + p.BlipFill.Blip.EmbedAttr = &imgID + p.BlipFill.Stretch = dml.NewCT_StretchInfoProperties() + p.BlipFill.Stretch.FillRect = dml.NewCT_RelativeRect() + + p.SpPr = dml.NewCT_ShapeProperties() + // Required to allow resizing + p.SpPr.Xfrm = dml.NewCT_Transform2D() + p.SpPr.Xfrm.Off = dml.NewCT_Point2D() + p.SpPr.Xfrm.Off.XAttr.ST_CoordinateUnqualified = gooxml.Int64(0) + p.SpPr.Xfrm.Off.YAttr.ST_CoordinateUnqualified = gooxml.Int64(0) + p.SpPr.Xfrm.Ext = dml.NewCT_PositiveSize2D() + p.SpPr.Xfrm.Ext.CxAttr = int64(img.Size().X * measurement.Point) + p.SpPr.Xfrm.Ext.CyAttr = int64(img.Size().Y * measurement.Point) + // required by Word on OSX for the image to display + p.SpPr.PrstGeom = dml.NewCT_PresetGeometry2D() + p.SpPr.PrstGeom.PrstAttr = dml.ST_ShapeTypeRect + + return ad, nil +} + +// AddDrawingInline adds an inline drawing from an ImageRef. +func (r Run) AddDrawingInline(img common.ImageRef) (InlineDrawing, error) { + ic := r.newIC() + ic.Drawing = wml.NewCT_Drawing() + + inl := wml.NewWdInline() + inline := InlineDrawing{r.d, inl} + + // required by Word on OSX for the file to open + //anchor.SimplePosAttr = gooxml.Bool(false) + + //anchor.AllowOverlapAttr = true + inl.CNvGraphicFramePr = dml.NewCT_NonVisualGraphicFrameProperties() + + ic.Drawing.Inline = append(ic.Drawing.Inline, inl) + inl.Graphic = dml.NewGraphic() + inl.Graphic.GraphicData = dml.NewCT_GraphicalObjectData() + inl.Graphic.GraphicData.UriAttr = "http://schemas.openxmlformats.org/drawingml/2006/picture" + + inl.DistTAttr = gooxml.Uint32(0) + inl.DistLAttr = gooxml.Uint32(0) + inl.DistBAttr = gooxml.Uint32(0) + inl.DistRAttr = gooxml.Uint32(0) + + inl.Extent.CxAttr = int64(float64(img.Size().X*measurement.Pixel72) / measurement.EMU) + inl.Extent.CyAttr = int64(float64(img.Size().Y*measurement.Pixel72) / measurement.EMU) + + // Mac Word chokes if the ID is greater than an int32, even though the field is a + // uint32 in the XSD + randID := 0x7FFFFFFF & rand.Uint32() + inl.DocPr.IdAttr = randID + p := pic.NewPic() + p.NvPicPr.CNvPr.IdAttr = randID + + // find the reference to the actual image file in the document relationships + // so we can embed via the relationship ID + imgID := img.RelID() + if imgID == "" { + return inline, errors.New("couldn't find reference to image within document relations") + } + + inl.Graphic.GraphicData.Any = append(inl.Graphic.GraphicData.Any, p) + p.BlipFill = dml.NewCT_BlipFillProperties() + p.BlipFill.Blip = dml.NewCT_Blip() + p.BlipFill.Blip.EmbedAttr = &imgID + p.BlipFill.Stretch = dml.NewCT_StretchInfoProperties() + p.BlipFill.Stretch.FillRect = dml.NewCT_RelativeRect() + + p.SpPr = dml.NewCT_ShapeProperties() + // Required to allow resizing + p.SpPr.Xfrm = dml.NewCT_Transform2D() + p.SpPr.Xfrm.Off = dml.NewCT_Point2D() + p.SpPr.Xfrm.Off.XAttr.ST_CoordinateUnqualified = gooxml.Int64(0) + p.SpPr.Xfrm.Off.YAttr.ST_CoordinateUnqualified = gooxml.Int64(0) + p.SpPr.Xfrm.Ext = dml.NewCT_PositiveSize2D() + p.SpPr.Xfrm.Ext.CxAttr = int64(img.Size().X * measurement.Point) + p.SpPr.Xfrm.Ext.CyAttr = int64(img.Size().Y * measurement.Point) + // required by Word on OSX for the image to display + p.SpPr.PrstGeom = dml.NewCT_PresetGeometry2D() + p.SpPr.PrstGeom.PrstAttr = dml.ST_ShapeTypeRect + + return inline, nil +} diff --git a/backend/vendor/baliance.com/gooxml/document/runproperties.go b/backend/vendor/baliance.com/gooxml/document/runproperties.go new file mode 100644 index 00000000..12222c7b --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/runproperties.go @@ -0,0 +1,246 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package document + +import ( + "baliance.com/gooxml" + "baliance.com/gooxml/color" + "baliance.com/gooxml/measurement" + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" + "baliance.com/gooxml/schema/soo/wml" +) + +// RunProperties controls run styling properties +type RunProperties struct { + x *wml.CT_RPr +} + +// X returns the inner wrapped XML type. +func (r RunProperties) X() *wml.CT_RPr { + return r.x +} + +// SetStyle sets the font size. +func (r RunProperties) SetStyle(style string) { + if style == "" { + r.x.RStyle = nil + } else { + r.x.RStyle = wml.NewCT_String() + r.x.RStyle.ValAttr = style + } +} + +// SetFontFamily sets the Ascii & HAnsi fonly family for a run. +func (r RunProperties) SetFontFamily(family string) { + if r.x.RFonts == nil { + r.x.RFonts = wml.NewCT_Fonts() + } + r.x.RFonts.AsciiAttr = gooxml.String(family) + r.x.RFonts.HAnsiAttr = gooxml.String(family) + r.x.RFonts.EastAsiaAttr = gooxml.String(family) +} + +// SetSize sets the font size for a run. +func (r RunProperties) SetSize(size measurement.Distance) { + r.x.Sz = wml.NewCT_HpsMeasure() + r.x.Sz.ValAttr.ST_UnsignedDecimalNumber = gooxml.Uint64(uint64(size / measurement.HalfPoint)) + r.x.SzCs = wml.NewCT_HpsMeasure() + r.x.SzCs.ValAttr.ST_UnsignedDecimalNumber = gooxml.Uint64(uint64(size / measurement.HalfPoint)) +} + +// SetKerning sets the run's font kerning. +func (r RunProperties) SetKerning(size measurement.Distance) { + r.x.Kern = wml.NewCT_HpsMeasure() + r.x.Kern.ValAttr.ST_UnsignedDecimalNumber = gooxml.Uint64(uint64(size / measurement.HalfPoint)) +} + +// SetCharacterSpacing sets the run's Character Spacing Adjustment. +func (r RunProperties) SetCharacterSpacing(size measurement.Distance) { + r.x.Spacing = wml.NewCT_SignedTwipsMeasure() + r.x.Spacing.ValAttr.Int64 = gooxml.Int64(int64(size / measurement.Twips)) +} + +// Fonts returns the style's Fonts. +func (r RunProperties) Fonts() Fonts { + if r.x.RFonts == nil { + r.x.RFonts = wml.NewCT_Fonts() + } + return Fonts{r.x.RFonts} +} + +// Color returns the style's Color. +func (r RunProperties) Color() Color { + if r.x.Color == nil { + r.x.Color = wml.NewCT_Color() + } + return Color{r.x.Color} +} + +// SetUnderline controls underline for a run style. +func (r RunProperties) SetUnderline(style wml.ST_Underline, c color.Color) { + if style == wml.ST_UnderlineUnset { + r.x.U = nil + } else { + r.x.U = wml.NewCT_Underline() + r.x.U.ColorAttr = &wml.ST_HexColor{} + r.x.U.ColorAttr.ST_HexColorRGB = c.AsRGBString() + r.x.U.ValAttr = style + } +} + +// BoldValue returns the precise nature of the bold setting (unset, off or on). +func (r RunProperties) BoldValue() OnOffValue { + return convertOnOff(r.x.B) +} + +// IsBold returns true if the run has been set to bold. +func (r RunProperties) IsBold() bool { + return r.BoldValue() == OnOffValueOn +} + +// SetBold sets the run to bold. +func (r RunProperties) SetBold(b bool) { + if !b { + r.x.B = nil + r.x.BCs = nil + } else { + r.x.B = wml.NewCT_OnOff() + r.x.BCs = wml.NewCT_OnOff() + } +} + +// ItalicValue returns the precise nature of the italic setting (unset, off or on). +func (r RunProperties) ItalicValue() OnOffValue { + return convertOnOff(r.x.I) +} + +// IsItalic returns true if the run has been set to italics. +func (r RunProperties) IsItalic() bool { + return r.ItalicValue() == OnOffValueOn +} + +// SetItalic sets the run to italic. +func (r RunProperties) SetItalic(b bool) { + if !b { + r.x.I = nil + r.x.ICs = nil + } else { + r.x.I = wml.NewCT_OnOff() + r.x.ICs = wml.NewCT_OnOff() + } +} + +// SetAllCaps sets the run to all caps. +func (r RunProperties) SetAllCaps(b bool) { + if !b { + r.x.Caps = nil + } else { + r.x.Caps = wml.NewCT_OnOff() + } +} + +// SetSmallCaps sets the run to small caps. +func (r RunProperties) SetSmallCaps(b bool) { + if !b { + r.x.SmallCaps = nil + } else { + r.x.SmallCaps = wml.NewCT_OnOff() + } +} + +// SetStrikeThrough sets the run to strike-through. +func (r RunProperties) SetStrikeThrough(b bool) { + if !b { + r.x.Strike = nil + } else { + r.x.Strike = wml.NewCT_OnOff() + } +} + +// SetDoubleStrikeThrough sets the run to double strike-through. +func (r RunProperties) SetDoubleStrikeThrough(b bool) { + if !b { + r.x.Dstrike = nil + } else { + r.x.Dstrike = wml.NewCT_OnOff() + } +} + +// SetOutline sets the run to outlined text. +func (r RunProperties) SetOutline(b bool) { + if !b { + r.x.Outline = nil + } else { + r.x.Outline = wml.NewCT_OnOff() + } +} + +// SetShadow sets the run to shadowed text. +func (r RunProperties) SetShadow(b bool) { + if !b { + r.x.Shadow = nil + } else { + r.x.Shadow = wml.NewCT_OnOff() + } +} + +// SetEmboss sets the run to embossed text. +func (r RunProperties) SetEmboss(b bool) { + if !b { + r.x.Emboss = nil + } else { + r.x.Emboss = wml.NewCT_OnOff() + } +} + +// SetImprint sets the run to imprinted text. +func (r RunProperties) SetImprint(b bool) { + if !b { + r.x.Imprint = nil + } else { + r.x.Imprint = wml.NewCT_OnOff() + } +} + +// ClearColor clears the text color. +func (r RunProperties) ClearColor() { + r.x.Color = nil +} + +// SetColor sets the text color. +func (r RunProperties) SetColor(c color.Color) { + r.x.Color = wml.NewCT_Color() + r.x.Color.ValAttr.ST_HexColorRGB = c.AsRGBString() +} + +// SetHighlight highlights text in a specified color. +func (r RunProperties) SetHighlight(c wml.ST_HighlightColor) { + r.x.Highlight = wml.NewCT_Highlight() + r.x.Highlight.ValAttr = c +} + +// SetEffect sets a text effect on the run. +func (r RunProperties) SetEffect(e wml.ST_TextEffect) { + if e == wml.ST_TextEffectUnset { + r.x.Effect = nil + } else { + r.x.Effect = wml.NewCT_TextEffect() + r.x.Effect.ValAttr = wml.ST_TextEffectShimmer + } +} + +// SetVerticalAlignment controls the vertical alignment of the run, this is used +// to control if text is superscript/subscript. +func (r RunProperties) SetVerticalAlignment(v sharedTypes.ST_VerticalAlignRun) { + if v == sharedTypes.ST_VerticalAlignRunUnset { + r.x.VertAlign = nil + } else { + r.x.VertAlign = wml.NewCT_VerticalAlignRun() + r.x.VertAlign.ValAttr = v + } +} diff --git a/backend/vendor/baliance.com/gooxml/document/section.go b/backend/vendor/baliance.com/gooxml/document/section.go new file mode 100644 index 00000000..7af8ec6b --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/section.go @@ -0,0 +1,68 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package document + +import ( + "log" + + "baliance.com/gooxml" + "baliance.com/gooxml/measurement" + "baliance.com/gooxml/schema/soo/wml" +) + +// Section is the beginning of a new section. +type Section struct { + d *Document + x *wml.CT_SectPr +} + +// X returns the internally wrapped *wml.CT_SectPr. +func (s Section) X() *wml.CT_SectPr { + return s.x +} + +// SetHeader sets a section header. +func (s Section) SetHeader(h Header, t wml.ST_HdrFtr) { + hdrRef := wml.NewEG_HdrFtrReferences() + s.x.EG_HdrFtrReferences = append(s.x.EG_HdrFtrReferences, hdrRef) + hdrRef.HeaderReference = wml.NewCT_HdrFtrRef() + hdrRef.HeaderReference.TypeAttr = t + hdrID := s.d.docRels.FindRIDForN(h.Index(), gooxml.HeaderType) + if hdrID == "" { + log.Print("unable to determine header ID") + } + hdrRef.HeaderReference.IdAttr = hdrID +} + +// SetFooter sets a section footer. +func (s Section) SetFooter(f Footer, t wml.ST_HdrFtr) { + ftrRef := wml.NewEG_HdrFtrReferences() + s.x.EG_HdrFtrReferences = append(s.x.EG_HdrFtrReferences, ftrRef) + ftrRef.FooterReference = wml.NewCT_HdrFtrRef() + ftrRef.FooterReference.TypeAttr = t + hdrID := s.d.docRels.FindRIDForN(f.Index(), gooxml.FooterType) + if hdrID == "" { + log.Print("unable to determine footer ID") + } + ftrRef.FooterReference.IdAttr = hdrID +} + +// SetPageMargins sets the page margins for a section +func (s Section) SetPageMargins(top, right, bottom, left, header, footer, gutter measurement.Distance) { + + margins := wml.NewCT_PageMar() + margins.TopAttr.Int64 = gooxml.Int64(int64(top / measurement.Twips)) + margins.BottomAttr.Int64 = gooxml.Int64(int64(bottom / measurement.Twips)) + margins.RightAttr.ST_UnsignedDecimalNumber = gooxml.Uint64(uint64(right / measurement.Twips)) + margins.LeftAttr.ST_UnsignedDecimalNumber = gooxml.Uint64(uint64(left / measurement.Twips)) + margins.HeaderAttr.ST_UnsignedDecimalNumber = gooxml.Uint64(uint64(header / measurement.Twips)) + margins.FooterAttr.ST_UnsignedDecimalNumber = gooxml.Uint64(uint64(footer / measurement.Twips)) + margins.GutterAttr.ST_UnsignedDecimalNumber = gooxml.Uint64(uint64(gutter / measurement.Twips)) + + s.x.PgMar = margins +} diff --git a/backend/vendor/baliance.com/gooxml/document/settings.go b/backend/vendor/baliance.com/gooxml/document/settings.go new file mode 100644 index 00000000..bc91a7c0 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/settings.go @@ -0,0 +1,52 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package document + +import ( + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/wml" +) + +// Settings controls the document settings. +type Settings struct { + x *wml.Settings +} + +// NewSettings constructs a new empty Settings +func NewSettings() Settings { + s := wml.NewSettings() + s.Compat = wml.NewCT_Compat() + stng := wml.NewCT_CompatSetting() + stng.NameAttr = gooxml.String("compatibilityMode") + stng.UriAttr = gooxml.String("http://schemas.microsoft.com/office/word") + stng.ValAttr = gooxml.String("15") + s.Compat.CompatSetting = append(s.Compat.CompatSetting, stng) + return Settings{s} +} + +// X returns the inner wrapped XML type. +func (s Settings) X() *wml.Settings { + return s.x +} + +// SetUpdateFieldsOnOpen controls if fields are recalculated upon opening the +// document. This is useful for things like a table of contents as the library +// only adds the field code and relies on Word/LibreOffice to actually compute +// the content. +func (s Settings) SetUpdateFieldsOnOpen(b bool) { + if !b { + s.x.UpdateFields = nil + } else { + s.x.UpdateFields = wml.NewCT_OnOff() + } +} + +// RemoveMailMerge removes any mail merge settings +func (s Settings) RemoveMailMerge() { + s.x.MailMerge = nil +} diff --git a/backend/vendor/baliance.com/gooxml/document/structuredocumenttag.go b/backend/vendor/baliance.com/gooxml/document/structuredocumenttag.go new file mode 100644 index 00000000..38b30a0d --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/structuredocumenttag.go @@ -0,0 +1,28 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package document + +import "baliance.com/gooxml/schema/soo/wml" + +// StructuredDocumentTag are a tagged bit of content in a document. +type StructuredDocumentTag struct { + d *Document + x *wml.CT_SdtBlock +} + +// Paragraphs returns the paragraphs within a structured document tag. +func (s StructuredDocumentTag) Paragraphs() []Paragraph { + if s.x.SdtContent == nil { + return nil + } + ret := []Paragraph{} + for _, p := range s.x.SdtContent.P { + ret = append(ret, Paragraph{s.d, p}) + } + return ret +} diff --git a/backend/vendor/baliance.com/gooxml/document/style.go b/backend/vendor/baliance.com/gooxml/document/style.go new file mode 100644 index 00000000..34ceeb2b --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/style.go @@ -0,0 +1,150 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package document + +import ( + "baliance.com/gooxml/schema/soo/wml" +) + +// Style is a style within the styles.xml file. +type Style struct { + x *wml.CT_Style +} + +// X returns the inner wrapped XML type. +func (s Style) X() *wml.CT_Style { + return s.x +} + +// Type returns the type of the style. +func (s Style) Type() wml.ST_StyleType { + return s.x.TypeAttr +} + +// StyleID returns the style ID. +func (s Style) StyleID() string { + if s.x.StyleIdAttr == nil { + return "" + } + return *s.x.StyleIdAttr +} + +// Name returns the name of the style if set. +func (s Style) Name() string { + if s.x.Name == nil { + return "" + } + return s.x.Name.ValAttr +} + +// SetName sets the name of the style. +func (s Style) SetName(name string) { + s.x.Name = wml.NewCT_String() + s.x.Name.ValAttr = name +} + +// SetPrimaryStyle marks the style as a primary style. +func (s Style) SetPrimaryStyle(b bool) { + if b { + s.x.QFormat = wml.NewCT_OnOff() + } else { + s.x.QFormat = nil + } +} + +// SetUISortOrder controls the order the style is displayed in the UI. +func (s Style) SetUISortOrder(order int) { + s.x.UiPriority = wml.NewCT_DecimalNumber() + s.x.UiPriority.ValAttr = int64(order) +} + +// SetSemiHidden controls if the style is hidden in the UI. +func (s Style) SetSemiHidden(b bool) { + if b { + s.x.SemiHidden = wml.NewCT_OnOff() + } else { + s.x.SemiHidden = nil + } +} + +// SetUnhideWhenUsed controls if a semi hidden style becomes visible when used. +func (s Style) SetUnhideWhenUsed(b bool) { + if b { + s.x.UnhideWhenUsed = wml.NewCT_OnOff() + } else { + s.x.UnhideWhenUsed = nil + } +} + +// SetBasedOn sets the style that this style is based on. +func (s Style) SetBasedOn(name string) { + if name == "" { + s.x.BasedOn = nil + } else { + s.x.BasedOn = wml.NewCT_String() + s.x.BasedOn.ValAttr = name + } +} + +// SetLinkedStyle sets the style that this style is linked to. +func (s Style) SetLinkedStyle(name string) { + if name == "" { + s.x.Link = nil + } else { + s.x.Link = wml.NewCT_String() + s.x.Link.ValAttr = name + } +} + +// SetNextStyle sets the style that the next paragraph will use. +func (s Style) SetNextStyle(name string) { + if name == "" { + s.x.Next = nil + } else { + s.x.Next = wml.NewCT_String() + s.x.Next.ValAttr = name + } +} + +// ParagraphProperties returns the paragraph style properties. +func (s Style) ParagraphProperties() ParagraphStyleProperties { + if s.x.PPr == nil { + s.x.PPr = wml.NewCT_PPrGeneral() + } + return ParagraphStyleProperties{s.x.PPr} +} + +// RunProperties returns the run style properties. +func (s Style) RunProperties() RunProperties { + if s.x.RPr == nil { + s.x.RPr = wml.NewCT_RPr() + } + return RunProperties{s.x.RPr} +} + +// TableProperties returns the table style properties. +func (s Style) TableProperties() TableStyleProperties { + if s.x.TblPr == nil { + s.x.TblPr = wml.NewCT_TblPrBase() + } + return TableStyleProperties{s.x.TblPr} +} + +// TableConditionalFormatting returns a conditional formatting object of a given +// type. Calling this method repeatedly will return the same object. +func (s Style) TableConditionalFormatting(typ wml.ST_TblStyleOverrideType) TableConditionalFormatting { + for _, pr := range s.x.TblStylePr { + if pr.TypeAttr == typ { + return TableConditionalFormatting{pr} + } + } + pr := wml.NewCT_TblStylePr() + pr.TypeAttr = typ + s.x.TblStylePr = append(s.x.TblStylePr, pr) + return TableConditionalFormatting{pr} +} diff --git a/backend/vendor/baliance.com/gooxml/document/styles.go b/backend/vendor/baliance.com/gooxml/document/styles.go new file mode 100644 index 00000000..75182020 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/styles.go @@ -0,0 +1,203 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package document + +import ( + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/measurement" + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" + "baliance.com/gooxml/schema/soo/wml" +) + +// Styles is the document wide styles contained in styles.xml. +type Styles struct { + x *wml.Styles +} + +// NewStyles constructs a new empty Styles +func NewStyles() Styles { + return Styles{wml.NewStyles()} +} + +// X returns the inner wrapped XML type. +func (s Styles) X() *wml.Styles { + return s.x +} + +// Clear clears the styes. +func (s Styles) Clear() { + s.x.DocDefaults = nil + s.x.LatentStyles = nil + s.x.Style = nil +} + +// AddStyle adds a new empty style. +func (s Styles) AddStyle(styleID string, t wml.ST_StyleType, isDefault bool) Style { + ss := wml.NewCT_Style() + ss.TypeAttr = t + if isDefault { + ss.DefaultAttr = &sharedTypes.ST_OnOff{} + ss.DefaultAttr.Bool = gooxml.Bool(isDefault) + } + ss.StyleIdAttr = gooxml.String(styleID) + s.x.Style = append(s.x.Style, ss) + return Style{ss} +} + +// InitializeDefault constructs the default styles. +func (s Styles) InitializeDefault() { + s.initializeDocDefaults() + s.initializeStyleDefaults() +} +func (s Styles) initializeStyleDefaults() { + // Normal + normal := s.AddStyle("Normal", wml.ST_StyleTypeParagraph, true) + normal.SetName("Normal") + normal.SetPrimaryStyle(true) + + // DefaultParagraphFont + dpf := s.AddStyle("DefaultParagraphFont", wml.ST_StyleTypeCharacter, true) + dpf.SetName("Default Paragraph Font") + dpf.SetUISortOrder(1) + dpf.SetSemiHidden(true) + dpf.SetUnhideWhenUsed(true) + + // Title + titleChar := s.AddStyle("TitleChar", wml.ST_StyleTypeCharacter, false) + titleChar.SetName("Title Char") + titleChar.SetBasedOn(dpf.StyleID()) + titleChar.SetLinkedStyle("Title") + titleChar.SetUISortOrder(10) + titleChar.RunProperties().Fonts().SetASCIITheme(wml.ST_ThemeMajorAscii) + titleChar.RunProperties().Fonts().SetEastAsiaTheme(wml.ST_ThemeMajorEastAsia) + titleChar.RunProperties().Fonts().SetHANSITheme(wml.ST_ThemeMajorHAnsi) + titleChar.RunProperties().Fonts().SetCSTheme(wml.ST_ThemeMajorBidi) + titleChar.RunProperties().SetSize(28 * measurement.Point) + titleChar.RunProperties().SetKerning(14 * measurement.Point) + titleChar.RunProperties().SetCharacterSpacing(-10 * measurement.Twips) + + titlePara := s.AddStyle("Title", wml.ST_StyleTypeParagraph, false) + titlePara.SetName("Title") + titlePara.SetBasedOn(normal.StyleID()) + titlePara.SetNextStyle(normal.StyleID()) + titlePara.SetLinkedStyle(titleChar.StyleID()) + titlePara.SetUISortOrder(10) + titlePara.SetPrimaryStyle(true) + titlePara.ParagraphProperties().SetContextualSpacing(true) + titlePara.RunProperties().Fonts().SetASCIITheme(wml.ST_ThemeMajorAscii) + titlePara.RunProperties().Fonts().SetEastAsiaTheme(wml.ST_ThemeMajorEastAsia) + titlePara.RunProperties().Fonts().SetHANSITheme(wml.ST_ThemeMajorHAnsi) + titlePara.RunProperties().Fonts().SetCSTheme(wml.ST_ThemeMajorBidi) + titlePara.RunProperties().SetSize(28 * measurement.Point) + titlePara.RunProperties().SetKerning(14 * measurement.Point) + titlePara.RunProperties().SetCharacterSpacing(-10 * measurement.Twips) + + // TableNormal + tbl := s.AddStyle("TableNormal", wml.ST_StyleTypeTable, false) + tbl.SetName("Normal Table") + tbl.SetUISortOrder(99) + tbl.SetSemiHidden(true) + tbl.SetUnhideWhenUsed(true) + tbl.X().TblPr = wml.NewCT_TblPrBase() + + tw := NewTableWidth() + tbl.X().TblPr.TblInd = tw.X() + tw.SetValue(0 * measurement.Dxa) + + tbl.X().TblPr.TblCellMar = wml.NewCT_TblCellMar() + + tw = NewTableWidth() + tbl.X().TblPr.TblCellMar.Top = tw.X() + tw.SetValue(0 * measurement.Dxa) + + tw = NewTableWidth() + tbl.X().TblPr.TblCellMar.Bottom = tw.X() + tw.SetValue(0 * measurement.Dxa) + + tw = NewTableWidth() + tbl.X().TblPr.TblCellMar.Left = tw.X() + tw.SetValue(108 * measurement.Dxa) + + tw = NewTableWidth() + tbl.X().TblPr.TblCellMar.Right = tw.X() + tw.SetValue(108 * measurement.Dxa) + + // NoList + nbr := s.AddStyle("NoList", wml.ST_StyleTypeNumbering, false) + nbr.SetName("No List") + nbr.SetUISortOrder(1) + nbr.SetSemiHidden(true) + nbr.SetUnhideWhenUsed(true) + + fontSizes := []measurement.Distance{16, 13, 12, 11, 11, 11, 11, 11, 11} + spacing := []measurement.Distance{240, 40, 40, 40, 40, 40, 40, 40, 40} + for i := 0; i < 9; i++ { + id := fmt.Sprintf("Heading%d", i+1) + + hdngChar := s.AddStyle(id+"Char", wml.ST_StyleTypeCharacter, false) + hdngChar.SetName(fmt.Sprintf("Heading %d Char", i+1)) + hdngChar.SetBasedOn(dpf.StyleID()) + hdngChar.SetLinkedStyle(id) + hdngChar.SetUISortOrder(9 + i) + hdngChar.RunProperties().SetSize(fontSizes[i] * measurement.Point) + + hdng := s.AddStyle(id, wml.ST_StyleTypeParagraph, false) + hdng.SetName(fmt.Sprintf("heading %d", i+1)) + hdng.SetNextStyle(normal.StyleID()) + hdng.SetLinkedStyle(hdng.StyleID()) + hdng.SetUISortOrder(9 + i) + hdng.SetPrimaryStyle(true) + hdng.ParagraphProperties().SetKeepNext(true) + hdng.ParagraphProperties().SetSpacing(spacing[i]*measurement.Twips, 0) + hdng.ParagraphProperties().SetOutlineLevel(i) + hdng.RunProperties().SetSize(fontSizes[i] * measurement.Point) + } +} + +func (s Styles) initializeDocDefaults() { + s.x.DocDefaults = wml.NewCT_DocDefaults() + s.x.DocDefaults.RPrDefault = wml.NewCT_RPrDefault() + s.x.DocDefaults.RPrDefault.RPr = wml.NewCT_RPr() + + rpr := RunProperties{s.x.DocDefaults.RPrDefault.RPr} + rpr.SetSize(12 * measurement.Point) + rpr.Fonts().SetASCIITheme(wml.ST_ThemeMajorAscii) + rpr.Fonts().SetEastAsiaTheme(wml.ST_ThemeMajorEastAsia) + rpr.Fonts().SetHANSITheme(wml.ST_ThemeMajorHAnsi) + rpr.Fonts().SetCSTheme(wml.ST_ThemeMajorBidi) + + rpr.X().Lang = wml.NewCT_Language() + rpr.X().Lang.ValAttr = gooxml.String("en-US") + rpr.X().Lang.EastAsiaAttr = gooxml.String("en-US") + rpr.X().Lang.BidiAttr = gooxml.String("ar-SA") + + s.x.DocDefaults.PPrDefault = wml.NewCT_PPrDefault() +} + +// Styles returns all styles. +func (s Styles) Styles() []Style { + ret := []Style{} + for _, s := range s.x.Style { + ret = append(ret, Style{s}) + } + return ret +} + +// ParagraphStyles returns only the paragraph styles. +func (s Styles) ParagraphStyles() []Style { + ret := []Style{} + for _, s := range s.x.Style { + if s.TypeAttr != wml.ST_StyleTypeParagraph { + continue + } + ret = append(ret, Style{s}) + } + return ret +} diff --git a/backend/vendor/baliance.com/gooxml/document/table.go b/backend/vendor/baliance.com/gooxml/document/table.go new file mode 100644 index 00000000..296d917c --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/table.go @@ -0,0 +1,86 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package document + +import ( + "baliance.com/gooxml/schema/soo/wml" +) + +// Table is a table within a document. +type Table struct { + d *Document + x *wml.CT_Tbl +} + +// X returns the inner wrapped XML type. +func (t Table) X() *wml.CT_Tbl { + return t.x +} + +// Properties returns the table properties. +func (t Table) Properties() TableProperties { + if t.x.TblPr == nil { + t.x.TblPr = wml.NewCT_TblPr() + } + return TableProperties{t.x.TblPr} +} + +// AddRow adds a row to a table. +func (t Table) AddRow() Row { + c := wml.NewEG_ContentRowContent() + t.x.EG_ContentRowContent = append(t.x.EG_ContentRowContent, c) + tr := wml.NewCT_Row() + c.Tr = append(c.Tr, tr) + return Row{t.d, tr} +} + +// InsertRowAfter inserts a row after another row +func (t Table) InsertRowAfter(r Row) Row { + for i, rc := range t.x.EG_ContentRowContent { + if len(rc.Tr) > 0 && r.X() == rc.Tr[0] { + c := wml.NewEG_ContentRowContent() + if len(t.x.EG_ContentRowContent) <= i+2 { + return t.AddRow() + } + t.x.EG_ContentRowContent = append(t.x.EG_ContentRowContent, nil) + copy(t.x.EG_ContentRowContent[i+2:], t.x.EG_ContentRowContent[i+1:]) + t.x.EG_ContentRowContent[i+1] = c + tr := wml.NewCT_Row() + c.Tr = append(c.Tr, tr) + return Row{t.d, tr} + } + } + return t.AddRow() +} + +// InsertRowBefore inserts a row before another row +func (t Table) InsertRowBefore(r Row) Row { + for i, rc := range t.x.EG_ContentRowContent { + if len(rc.Tr) > 0 && r.X() == rc.Tr[0] { + c := wml.NewEG_ContentRowContent() + t.x.EG_ContentRowContent = append(t.x.EG_ContentRowContent, nil) + copy(t.x.EG_ContentRowContent[i+1:], t.x.EG_ContentRowContent[i:]) + t.x.EG_ContentRowContent[i] = c + tr := wml.NewCT_Row() + c.Tr = append(c.Tr, tr) + return Row{t.d, tr} + } + } + return t.AddRow() +} + +// Rows returns the rows defined in the table. +func (t Table) Rows() []Row { + ret := []Row{} + for _, rc := range t.x.EG_ContentRowContent { + for _, ctRow := range rc.Tr { + ret = append(ret, Row{t.d, ctRow}) + } + } + return ret +} diff --git a/backend/vendor/baliance.com/gooxml/document/tableborders.go b/backend/vendor/baliance.com/gooxml/document/tableborders.go new file mode 100644 index 00000000..e7ba9912 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/tableborders.go @@ -0,0 +1,85 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package document + +import ( + "baliance.com/gooxml" + "baliance.com/gooxml/color" + "baliance.com/gooxml/measurement" + "baliance.com/gooxml/schema/soo/wml" +) + +// TableBorders allows manipulation of borders on a table. +type TableBorders struct { + x *wml.CT_TblBorders +} + +// X returns the inner wml.CT_TblBorders +func (b TableBorders) X() *wml.CT_TblBorders { + return b.x +} + +func setBorder(brd *wml.CT_Border, t wml.ST_Border, c color.Color, thickness measurement.Distance) { + brd.ValAttr = t + brd.ColorAttr = &wml.ST_HexColor{} + if c.IsAuto() { + brd.ColorAttr.ST_HexColorAuto = wml.ST_HexColorAutoAuto + } else { + brd.ColorAttr.ST_HexColorRGB = c.AsRGBString() + } + if thickness != measurement.Zero { + // sz here is in 1/8'th points, the range is 0.25 to 12 pts + brd.SzAttr = gooxml.Uint64(uint64(thickness / measurement.Point * 8)) + } +} + +// SetAll sets all of the borders to a given value. +func (b TableBorders) SetAll(t wml.ST_Border, c color.Color, thickness measurement.Distance) { + b.SetBottom(t, c, thickness) + b.SetLeft(t, c, thickness) + b.SetRight(t, c, thickness) + b.SetTop(t, c, thickness) + b.SetInsideHorizontal(t, c, thickness) + b.SetInsideVertical(t, c, thickness) +} + +// SetBottom sets the bottom border to a specified type, color and thickness. +func (b TableBorders) SetBottom(t wml.ST_Border, c color.Color, thickness measurement.Distance) { + b.x.Bottom = wml.NewCT_Border() + setBorder(b.x.Bottom, t, c, thickness) +} + +// SetTop sets the top border to a specified type, color and thickness. +func (b TableBorders) SetTop(t wml.ST_Border, c color.Color, thickness measurement.Distance) { + b.x.Top = wml.NewCT_Border() + setBorder(b.x.Top, t, c, thickness) +} + +// SetLeft sets the left border to a specified type, color and thickness. +func (b TableBorders) SetLeft(t wml.ST_Border, c color.Color, thickness measurement.Distance) { + b.x.Left = wml.NewCT_Border() + setBorder(b.x.Left, t, c, thickness) +} + +// SetRight sets the right border to a specified type, color and thickness. +func (b TableBorders) SetRight(t wml.ST_Border, c color.Color, thickness measurement.Distance) { + b.x.Right = wml.NewCT_Border() + setBorder(b.x.Right, t, c, thickness) +} + +// SetInsideHorizontal sets the interior horizontal borders to a specified type, color and thickness. +func (b TableBorders) SetInsideHorizontal(t wml.ST_Border, c color.Color, thickness measurement.Distance) { + b.x.InsideH = wml.NewCT_Border() + setBorder(b.x.InsideH, t, c, thickness) +} + +// SetInsideVertical sets the interior vertical borders to a specified type, color and thickness. +func (b TableBorders) SetInsideVertical(t wml.ST_Border, c color.Color, thickness measurement.Distance) { + b.x.InsideV = wml.NewCT_Border() + setBorder(b.x.InsideV, t, c, thickness) +} diff --git a/backend/vendor/baliance.com/gooxml/document/tableconditionalformatting.go b/backend/vendor/baliance.com/gooxml/document/tableconditionalformatting.go new file mode 100644 index 00000000..ac494687 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/tableconditionalformatting.go @@ -0,0 +1,45 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package document + +import "baliance.com/gooxml/schema/soo/wml" + +// TableConditionalFormatting controls the conditional formatting within a table +// style. +type TableConditionalFormatting struct { + x *wml.CT_TblStylePr +} + +// X returns the inner wrapped XML type. +func (t TableConditionalFormatting) X() *wml.CT_TblStylePr { + return t.x +} + +// CellProperties returns the cell properties. +func (t TableConditionalFormatting) CellProperties() CellProperties { + if t.x.TcPr == nil { + t.x.TcPr = wml.NewCT_TcPr() + } + return CellProperties{t.x.TcPr} +} + +// RunProperties returns the run properties controlling text formatting within the table. +func (t TableConditionalFormatting) RunProperties() RunProperties { + if t.x.RPr == nil { + t.x.RPr = wml.NewCT_RPr() + } + return RunProperties{t.x.RPr} +} + +// ParagraphProperties returns the paragraph properties controlling text formatting within the table. +func (t TableConditionalFormatting) ParagraphProperties() ParagraphStyleProperties { + if t.x.PPr == nil { + t.x.PPr = wml.NewCT_PPrGeneral() + } + return ParagraphStyleProperties{t.x.PPr} +} diff --git a/backend/vendor/baliance.com/gooxml/document/tableproperties.go b/backend/vendor/baliance.com/gooxml/document/tableproperties.go new file mode 100644 index 00000000..1d72828b --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/tableproperties.go @@ -0,0 +1,122 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package document + +import ( + "baliance.com/gooxml" + "baliance.com/gooxml/measurement" + "baliance.com/gooxml/schema/soo/wml" +) + +// TableProperties are the properties for a table within a document +type TableProperties struct { + x *wml.CT_TblPr +} + +// X returns the inner wrapped XML type. +func (t TableProperties) X() *wml.CT_TblPr { + return t.x +} + +// SetCellSpacingAuto sets the cell spacing within a table to automatic. +func (t TableProperties) SetCellSpacingAuto() { + t.x.TblCellSpacing = wml.NewCT_TblWidth() + t.x.TblCellSpacing.TypeAttr = wml.ST_TblWidthAuto +} + +// SetCellSpacingPercent sets the cell spacing within a table to a percent width. +func (t TableProperties) SetCellSpacingPercent(pct float64) { + t.x.TblCellSpacing = wml.NewCT_TblWidth() + t.x.TblCellSpacing.TypeAttr = wml.ST_TblWidthPct + t.x.TblCellSpacing.WAttr = &wml.ST_MeasurementOrPercent{} + t.x.TblCellSpacing.WAttr.ST_DecimalNumberOrPercent = &wml.ST_DecimalNumberOrPercent{} + t.x.TblCellSpacing.WAttr.ST_DecimalNumberOrPercent.ST_UnqualifiedPercentage = gooxml.Int64(int64(pct * 50)) +} + +// SetCellSpacing sets the cell spacing within a table. +func (t TableProperties) SetCellSpacing(m measurement.Distance) { + t.x.TblCellSpacing = wml.NewCT_TblWidth() + t.x.TblCellSpacing.TypeAttr = wml.ST_TblWidthDxa + t.x.TblCellSpacing.WAttr = &wml.ST_MeasurementOrPercent{} + t.x.TblCellSpacing.WAttr.ST_DecimalNumberOrPercent = &wml.ST_DecimalNumberOrPercent{} + t.x.TblCellSpacing.WAttr.ST_DecimalNumberOrPercent.ST_UnqualifiedPercentage = gooxml.Int64(int64(m / measurement.Dxa)) +} + +// SetWidthAuto sets the the table width to automatic. +func (t TableProperties) SetWidthAuto() { + t.x.TblW = wml.NewCT_TblWidth() + t.x.TblW.TypeAttr = wml.ST_TblWidthAuto +} + +// SetWidthPercent sets the table to a width percentage. +func (t TableProperties) SetWidthPercent(pct float64) { + t.x.TblW = wml.NewCT_TblWidth() + t.x.TblW.TypeAttr = wml.ST_TblWidthPct + t.x.TblW.WAttr = &wml.ST_MeasurementOrPercent{} + t.x.TblW.WAttr.ST_DecimalNumberOrPercent = &wml.ST_DecimalNumberOrPercent{} + // percent value is measured in 1/50'th of a percent + t.x.TblW.WAttr.ST_DecimalNumberOrPercent.ST_UnqualifiedPercentage = gooxml.Int64(int64(pct * 50)) +} + +// SetLayout controls the table layout. wml.ST_TblLayoutTypeAutofit corresponds +// to "Automatically resize to fit contents" being checked, while +// wml.ST_TblLayoutTypeFixed corresponds to it being unchecked. +func (t TableProperties) SetLayout(l wml.ST_TblLayoutType) { + // ST_TblLayoutTypeAutofit is the default + if l == wml.ST_TblLayoutTypeUnset || l == wml.ST_TblLayoutTypeAutofit { + t.x.TblLayout = nil + } else { + t.x.TblLayout = wml.NewCT_TblLayoutType() + t.x.TblLayout.TypeAttr = l + } +} + +// SetAlignment sets the alignment of a table within the page. +func (t TableProperties) SetAlignment(align wml.ST_JcTable) { + if align == wml.ST_JcTableUnset { + t.x.Jc = nil + } else { + t.x.Jc = wml.NewCT_JcTable() + t.x.Jc.ValAttr = align + } +} + +// SetWidth sets the table with to a specified width. +func (t TableProperties) SetWidth(d measurement.Distance) { + t.x.TblW = wml.NewCT_TblWidth() + t.x.TblW.TypeAttr = wml.ST_TblWidthDxa + t.x.TblW.WAttr = &wml.ST_MeasurementOrPercent{} + t.x.TblW.WAttr.ST_DecimalNumberOrPercent = &wml.ST_DecimalNumberOrPercent{} + t.x.TblW.WAttr.ST_DecimalNumberOrPercent.ST_UnqualifiedPercentage = gooxml.Int64(int64(d / measurement.Twips)) +} + +// SetStyle sets the table style name. +func (t TableProperties) SetStyle(name string) { + if name == "" { + t.x.TblStyle = nil + } else { + t.x.TblStyle = wml.NewCT_String() + t.x.TblStyle.ValAttr = name + } +} + +// TableLook returns the table look, or conditional formatting applied to a table style. +func (t TableProperties) TableLook() TableLook { + if t.x.TblLook == nil { + t.x.TblLook = wml.NewCT_TblLook() + } + return TableLook{t.x.TblLook} +} + +// Borders allows manipulation of the table borders. +func (t TableProperties) Borders() TableBorders { + if t.x.TblBorders == nil { + t.x.TblBorders = wml.NewCT_TblBorders() + } + return TableBorders{t.x.TblBorders} +} diff --git a/backend/vendor/baliance.com/gooxml/document/tablestyleproperties.go b/backend/vendor/baliance.com/gooxml/document/tablestyleproperties.go new file mode 100644 index 00000000..bbd9e82b --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/tablestyleproperties.go @@ -0,0 +1,68 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package document + +import ( + "baliance.com/gooxml" + "baliance.com/gooxml/measurement" + "baliance.com/gooxml/schema/soo/wml" +) + +// TableStyleProperties are table properties as defined in a style. +type TableStyleProperties struct { + x *wml.CT_TblPrBase +} + +// X returns the inner wrapped XML type. +func (t TableStyleProperties) X() *wml.CT_TblPrBase { + return t.x +} + +// SetRowBandSize sets the number of Rows in the row band +func (t TableStyleProperties) SetRowBandSize(rows int64) { + t.x.TblStyleRowBandSize = wml.NewCT_DecimalNumber() + t.x.TblStyleRowBandSize.ValAttr = rows +} + +// SetColumnBandSize sets the number of Columns in the column band +func (t TableStyleProperties) SetColumnBandSize(cols int64) { + t.x.TblStyleColBandSize = wml.NewCT_DecimalNumber() + t.x.TblStyleColBandSize.ValAttr = cols +} + +// SetTableIndent sets the Table Indent from the Leading Margin +func (t TableStyleProperties) SetTableIndent(ind measurement.Distance) { + t.x.TblInd = wml.NewCT_TblWidth() + t.x.TblInd.TypeAttr = wml.ST_TblWidthDxa + t.x.TblInd.WAttr = &wml.ST_MeasurementOrPercent{} + t.x.TblInd.WAttr.ST_DecimalNumberOrPercent = &wml.ST_DecimalNumberOrPercent{} + t.x.TblInd.WAttr.ST_DecimalNumberOrPercent.ST_UnqualifiedPercentage = gooxml.Int64(int64(ind / measurement.Dxa)) +} + +// SetCellSpacingAuto sets the cell spacing within a table to automatic. +func (t TableStyleProperties) SetCellSpacingAuto() { + t.x.TblCellSpacing = wml.NewCT_TblWidth() + t.x.TblCellSpacing.TypeAttr = wml.ST_TblWidthAuto +} + +// SetCellSpacingPercent sets the cell spacing within a table to a percent width. +func (t TableStyleProperties) SetCellSpacingPercent(pct float64) { + t.x.TblCellSpacing = wml.NewCT_TblWidth() + t.x.TblCellSpacing.TypeAttr = wml.ST_TblWidthPct + t.x.TblCellSpacing.WAttr = &wml.ST_MeasurementOrPercent{} + t.x.TblCellSpacing.WAttr.ST_DecimalNumberOrPercent = &wml.ST_DecimalNumberOrPercent{} + t.x.TblCellSpacing.WAttr.ST_DecimalNumberOrPercent.ST_UnqualifiedPercentage = gooxml.Int64(int64(pct * 50)) +} + +// Borders allows manipulation of the table borders. +func (t TableStyleProperties) Borders() TableBorders { + if t.x.TblBorders == nil { + t.x.TblBorders = wml.NewCT_TblBorders() + } + return TableBorders{t.x.TblBorders} +} diff --git a/backend/vendor/baliance.com/gooxml/document/tablewidth.go b/backend/vendor/baliance.com/gooxml/document/tablewidth.go new file mode 100644 index 00000000..c2a387cd --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/tablewidth.go @@ -0,0 +1,37 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package document + +import ( + "baliance.com/gooxml" + "baliance.com/gooxml/measurement" + "baliance.com/gooxml/schema/soo/wml" +) + +// TableWidth controls width values in table settings. +type TableWidth struct { + x *wml.CT_TblWidth +} + +// NewTableWidth returns a newly intialized TableWidth +func NewTableWidth() TableWidth { + return TableWidth{wml.NewCT_TblWidth()} +} + +// X returns the inner wrapped XML type. +func (s TableWidth) X() *wml.CT_TblWidth { + return s.x +} + +// SetValue sets the width value. +func (s TableWidth) SetValue(m measurement.Distance) { + s.x.WAttr = &wml.ST_MeasurementOrPercent{} + s.x.WAttr.ST_DecimalNumberOrPercent = &wml.ST_DecimalNumberOrPercent{} + s.x.WAttr.ST_DecimalNumberOrPercent.ST_UnqualifiedPercentage = gooxml.Int64(int64(m / measurement.Twips)) + s.x.TypeAttr = wml.ST_TblWidthDxa +} diff --git a/backend/vendor/baliance.com/gooxml/document/tbllook.go b/backend/vendor/baliance.com/gooxml/document/tbllook.go new file mode 100644 index 00000000..411c9a56 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/document/tbllook.go @@ -0,0 +1,93 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package document + +import ( + st "baliance.com/gooxml/schema/soo/ofc/sharedTypes" + "baliance.com/gooxml/schema/soo/wml" +) + +// TableLook is the conditional formatting associated with a table style that +// has been assigned to a table. +type TableLook struct { + x *wml.CT_TblLook +} + +// X returns the inner wrapped XML type. +func (t TableLook) X() *wml.CT_TblLook { + return t.x +} + +// SetFirstColumn controls the conditional formatting for the first column in a table. +func (t TableLook) SetFirstColumn(on bool) { + if !on { + t.x.FirstColumnAttr = &st.ST_OnOff{} + t.x.FirstColumnAttr.ST_OnOff1 = st.ST_OnOff1Off + } else { + t.x.FirstColumnAttr = &st.ST_OnOff{} + t.x.FirstColumnAttr.ST_OnOff1 = st.ST_OnOff1On + } +} + +// SetFirstRow controls the conditional formatting for the first row in a table. +func (t TableLook) SetFirstRow(on bool) { + if !on { + t.x.FirstRowAttr = &st.ST_OnOff{} + t.x.FirstRowAttr.ST_OnOff1 = st.ST_OnOff1Off + } else { + t.x.FirstRowAttr = &st.ST_OnOff{} + t.x.FirstRowAttr.ST_OnOff1 = st.ST_OnOff1On + } +} + +// SetLastColumn controls the conditional formatting for the last column in a table. +func (t TableLook) SetLastColumn(on bool) { + if !on { + t.x.LastColumnAttr = &st.ST_OnOff{} + t.x.LastColumnAttr.ST_OnOff1 = st.ST_OnOff1Off + } else { + t.x.LastColumnAttr = &st.ST_OnOff{} + t.x.LastColumnAttr.ST_OnOff1 = st.ST_OnOff1On + } +} + +// SetLastRow controls the conditional formatting for the last row in a table. +// This is called the 'Total' row within Word. +func (t TableLook) SetLastRow(on bool) { + if !on { + t.x.LastRowAttr = &st.ST_OnOff{} + t.x.LastRowAttr.ST_OnOff1 = st.ST_OnOff1Off + } else { + t.x.LastRowAttr = &st.ST_OnOff{} + t.x.LastRowAttr.ST_OnOff1 = st.ST_OnOff1On + } +} + +// SetHorizontalBanding controls the conditional formatting for horizontal banding. +func (t TableLook) SetHorizontalBanding(on bool) { + if !on { + // inverted logic + t.x.NoHBandAttr = &st.ST_OnOff{} + t.x.NoHBandAttr.ST_OnOff1 = st.ST_OnOff1On + } else { + t.x.NoHBandAttr = &st.ST_OnOff{} + t.x.NoHBandAttr.ST_OnOff1 = st.ST_OnOff1Off + } +} + +// SetVerticalBanding controls the conditional formatting for vertical banding. +func (t TableLook) SetVerticalBanding(on bool) { + if !on { + // inverted logic + t.x.NoVBandAttr = &st.ST_OnOff{} + t.x.NoVBandAttr.ST_OnOff1 = st.ST_OnOff1On + } else { + t.x.NoVBandAttr = &st.ST_OnOff{} + t.x.NoVBandAttr.ST_OnOff1 = st.ST_OnOff1Off + } +} diff --git a/backend/vendor/baliance.com/gooxml/filenames.go b/backend/vendor/baliance.com/gooxml/filenames.go new file mode 100644 index 00000000..49bdfa97 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/filenames.go @@ -0,0 +1,195 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package gooxml + +import ( + "fmt" + "strings" + + "baliance.com/gooxml/algo" +) + +// Common filenames used in zip packages. +const ( + ContentTypesFilename = "[Content_Types].xml" + BaseRelsFilename = "_rels/.rels" +) + +// DocType represents one of the three document types supported (docx/xlsx/pptx) +type DocType byte + +// Document Type constants +const ( + Unknown DocType = iota + DocTypeSpreadsheet + DocTypeDocument + DocTypePresentation +) + +// RelativeFilename returns a filename relative to the source file referenced +// from a relationships file. Index is used in some cases for files which there +// may be more than one of (e.g. worksheets/drawings/charts) +func RelativeFilename(dt DocType, relToTyp, typ string, index int) string { + orig := AbsoluteFilename(dt, typ, index) + if relToTyp == "" { + return orig + } + + relTo := AbsoluteFilename(dt, relToTyp, index) + relToSp := strings.Split(relTo, "/") + origSp := strings.Split(orig, "/") + + // determine how many segments match + matching := 0 + for i := 0; i < len(relToSp); i++ { + if relToSp[i] == origSp[i] { + matching++ + } + if i+1 == len(origSp) { + break + } + } + relToSp = relToSp[matching:] + origSp = origSp[matching:] + nm := len(relToSp) - 1 + if nm > 0 { + return algo.RepeatString("../", nm) + strings.Join(origSp, "/") + } + return strings.Join(origSp, "/") +} + +// AbsoluteFilename returns the full path to a file from the root of the zip +// container. Index is used in some cases for files which there may be more than +// one of (e.g. worksheets/drawings/charts) +func AbsoluteFilename(dt DocType, typ string, index int) string { + switch typ { + case CorePropertiesType: + return "docProps/core.xml" + case ExtendedPropertiesType: + return "docProps/app.xml" + case ThumbnailType: + return "docProps/thumbnail.jpeg" + + case OfficeDocumentType: + switch dt { + case DocTypeSpreadsheet: + return "xl/workbook.xml" + case DocTypeDocument: + return "word/document.xml" + case DocTypePresentation: + return "ppt/presentation.xml" + default: + Log("unsupported type %s pair and %v", typ, dt) + } + + case ThemeType, ThemeContentType: + switch dt { + case DocTypeSpreadsheet: + return fmt.Sprintf("xl/theme/theme%d.xml", index) + case DocTypeDocument: + return fmt.Sprintf("word/theme/theme%d.xml", index) + case DocTypePresentation: + return fmt.Sprintf("ppt/theme/theme%d.xml", index) + default: + Log("unsupported type %s pair and %v", typ, dt) + } + + case StylesType: + switch dt { + case DocTypeSpreadsheet: + return "xl/styles.xml" + case DocTypeDocument: + return "word/styles.xml" + case DocTypePresentation: + return "ppt/styles.xml" + default: + Log("unsupported type %s pair and %v", typ, dt) + } + + case ChartType, ChartContentType: + switch dt { + case DocTypeSpreadsheet: + return fmt.Sprintf("xl/charts/chart%d.xml", index) + default: + Log("unsupported type %s pair and %v", typ, dt) + } + case TableType, TableContentType: + return fmt.Sprintf("xl/tables/table%d.xml", index) + + case DrawingType, DrawingContentType: + switch dt { + case DocTypeSpreadsheet: + return fmt.Sprintf("xl/drawings/drawing%d.xml", index) + default: + Log("unsupported type %s pair and %v", typ, dt) + } + + case CommentsType, CommentsContentType: + switch dt { + case DocTypeSpreadsheet: + return fmt.Sprintf("xl/comments%d.xml", index) + default: + Log("unsupported type %s pair and %v", typ, dt) + } + + case VMLDrawingType, VMLDrawingContentType: + switch dt { + case DocTypeSpreadsheet: + return fmt.Sprintf("xl/drawings/vmlDrawing%d.vml", index) + default: + Log("unsupported type %s pair and %v", typ, dt) + } + + case ImageType: + switch dt { + case DocTypeDocument: + return fmt.Sprintf("word/media/image%d.png", index) + case DocTypeSpreadsheet: + return fmt.Sprintf("xl/media/image%d.png", index) + case DocTypePresentation: + return fmt.Sprintf("ppt/media/image%d.png", index) + default: + Log("unsupported type %s pair and %v", typ, dt) + } + // SML + case WorksheetType, WorksheetContentType: + return fmt.Sprintf("xl/worksheets/sheet%d.xml", index) + case SharedStingsType, SharedStringsContentType: + return "xl/sharedStrings.xml" + + // WML + case FontTableType: + return "word/fontTable.xml" + case EndNotesType: + return "word/endnotes.xml" + case FootNotesType: + return "word/footnotes.xml" + case NumberingType: + return "word/numbering.xml" + case WebSettingsType: + return "word/webSettings.xml" + case SettingsType: + return "word/settings.xml" + case HeaderType: + return fmt.Sprintf("word/header%d.xml", index) + case FooterType: + return fmt.Sprintf("word/footer%d.xml", index) + + // PML + case SlideType: + return fmt.Sprintf("ppt/slides/slide%d.xml", index) + case SlideLayoutType: + return fmt.Sprintf("ppt/slideLayouts/slideLayout%d.xml", index) + case SlideMasterType: + return fmt.Sprintf("ppt/slideMasters/slideMaster%d.xml", index) + + default: + Log("unsupported type %s", typ) + } + return "" +} diff --git a/backend/vendor/baliance.com/gooxml/license.go b/backend/vendor/baliance.com/gooxml/license.go new file mode 100644 index 00000000..cf8bb44c --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/license.go @@ -0,0 +1,186 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package gooxml + +import ( + "bytes" + "compress/gzip" + "crypto" + "crypto/rand" + "crypto/rsa" + "crypto/sha256" + "crypto/x509" + "encoding/base64" + "encoding/hex" + "encoding/json" + "errors" + "io" + "log" + "regexp" + "strings" + "time" +) + +// OpenSourceLicense is the AGPL open source license. It is installed by default +// if no license has previously been installed. +const OpenSourceLicense = ` +H4sIAAAAAAAC_xzJsU7DQAwA0J2vqDynks--y9nZ +2RAMLQubfeegDKRR2kogxL8jkN72vuHZPgImeNli +PZwu973F4fUaOwxwWt5Xu933v86Fqjfnlq1mKWzU +SXzEwCKoqWc0sREtvCYlsdlV2b12CwqyntVk7orZ +eTQRtMhMoonHaDh3DMsYVEir10JzbV3CW1FmyrM4 +wQCPn9uy2225rDABI-Ix0ZHTGXH69wYDPC0t1muc +v7aAKf08_AYAAP__z2E3oN8A` + +var license *License + +const pubKeyHex = `305c300d06092a864886f70d0101010500034b003048024100b87eafb6c07499eb97cc9d3565ecf3168196301907c841addc665086bb3ed8eb12d9da26cafa96450146da8bd0ccf155fcacc686955ef0302fa44aa3ec89417b0203010001` + +var pubKey *rsa.PublicKey + +func init() { + pubKeyBytes, err := hex.DecodeString(pubKeyHex) + if err != nil { + log.Fatalf("error reading key: %s", err) + } + pkRaw, err := x509.ParsePKIXPublicKey(pubKeyBytes) + if err != nil { + log.Fatalf("error reading key: %s", err) + } + pubKey = pkRaw.(*rsa.PublicKey) +} + +// LicenseType is the type of license +//go:generate stringer -type=LicenseType +type LicenseType byte + +// LicenseType constants +const ( + LicenseTypeInvalid LicenseType = iota + LicenseTypeAGPL + LicenseTypeCommercial +) + +// License holds the gooxml license information. +type License struct { + Name string + Signature string `json:",omitempty"` + Expiration time.Time + LicenseType LicenseType +} + +// Sign signs a license with a private key, setting the license's signature +// value +func (l *License) Sign(privKey *rsa.PrivateKey) error { + l.Signature = "" + buf := bytes.Buffer{} + enc := json.NewEncoder(&buf) + if err := enc.Encode(l); err != nil { + return err + } + + hashed := sha256.Sum256(buf.Bytes()) + signature, err := rsa.SignPKCS1v15(rand.Reader, privKey, crypto.SHA256, hashed[:]) + if err != nil { + return err + } + l.Signature = hex.EncodeToString(signature) + return nil +} + +// Verify verifies a license by checking the license content and signature +// against a public key. +func (l License) Verify(pubKey *rsa.PublicKey) error { + cp := l + cp.Signature = "" + buf := bytes.Buffer{} + enc := json.NewEncoder(&buf) + if err := enc.Encode(cp); err != nil { + return err + } + sig, err := hex.DecodeString(l.Signature) + if err != nil { + return err + } + hashed := sha256.Sum256(buf.Bytes()) + err = rsa.VerifyPKCS1v15(pubKey, crypto.SHA256, hashed[:], sig) + return err +} + +func (l License) String() string { + buf := bytes.Buffer{} + enc := json.NewEncoder(&buf) + enc.Encode(l) + return buf.String() +} + +// Encoded returns a base64 encoded version of the license for use with +// InstallLicense. +func (l License) Encoded() string { + buf := bytes.Buffer{} + w := base64.NewEncoder(base64.RawURLEncoding, &buf) + gz, _ := gzip.NewWriterLevel(w, gzip.BestCompression) + enc := json.NewEncoder(gz) + enc.Encode(l) + gz.Close() + + rsp := bytes.Buffer{} + const maxLen = 40 + raw := buf.Bytes() + for i := 0; i < buf.Len(); i += maxLen { + rsp.Write(raw[i : i+maxLen]) + rsp.WriteByte('\r') + rsp.WriteByte('\n') + } + return rsp.String() +} + +// InstallLicense installs a license, returning an error if the license is +// invalid or expired. Expiration checks the ReleaseDate variable in version.go. +func InstallLicense(s string) error { + re := regexp.MustCompile("\\s") + s = re.ReplaceAllString(s, "") + + var r io.Reader + r = strings.NewReader(s) + r = base64.NewDecoder(base64.RawURLEncoding, r) + r, err := gzip.NewReader(r) + if err != nil { + return err + } + + dec := json.NewDecoder(r) + l := &License{} + if err := dec.Decode(l); err != nil { + return err + } + // check signature + if err := l.Verify(pubKey); err != nil { + return errors.New("license validatin error") + } + + if l.Expiration.Before(ReleaseDate) { + return errors.New("license expired") + } + license = l + return nil +} + +// GetLicense returns the current license. This can be used by commercial +// customers to assist in ensuring that their license hasn't expired. +func GetLicense() License { + if license == nil { + if err := InstallLicense(OpenSourceLicense); err != nil { + log.Printf("open source license error: %s", err) + } + } + if license != nil { + return *license + } + return License{} +} diff --git a/backend/vendor/baliance.com/gooxml/licensetype_string.go b/backend/vendor/baliance.com/gooxml/licensetype_string.go new file mode 100644 index 00000000..dd72390a --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/licensetype_string.go @@ -0,0 +1,16 @@ +// Code generated by "stringer -type=LicenseType"; DO NOT EDIT. + +package gooxml + +import "fmt" + +const _LicenseType_name = "LicenseTypeInvalidLicenseTypeAGPLLicenseTypeCommercial" + +var _LicenseType_index = [...]uint8{0, 18, 33, 54} + +func (i LicenseType) String() string { + if i >= LicenseType(len(_LicenseType_index)-1) { + return fmt.Sprintf("LicenseType(%d)", i) + } + return _LicenseType_name[_LicenseType_index[i]:_LicenseType_index[i+1]] +} diff --git a/backend/vendor/baliance.com/gooxml/log.go b/backend/vendor/baliance.com/gooxml/log.go new file mode 100644 index 00000000..84c8470c --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/log.go @@ -0,0 +1,23 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package gooxml + +import ( + "log" +) + +// Log is used to log content from within the library. The intent is to use +// logging sparingly, preferring to return an error. At the very least this +// allows redirecting logs to somewhere more appropriate than stdout. +var Log = log.Printf + +// DisableLogging sets the Log function to a no-op so that any log messages are +// silently discarded. +func DisableLogging() { + Log = func(string, ...interface{}) {} +} diff --git a/backend/vendor/baliance.com/gooxml/measurement/distance.go b/backend/vendor/baliance.com/gooxml/measurement/distance.go new file mode 100644 index 00000000..63b42f44 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/measurement/distance.go @@ -0,0 +1,30 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package measurement + +// Distance represents a distance and is automatically converted +// to the units needed internally in the various ECMA 376 formats. +type Distance float64 + +// Constants for various distance units +const ( + Zero Distance = 0 + Point = 1 + Pixel72 = 1.0 / 72.0 * Inch + Pixel96 = 1.0 / 96.0 * Inch + HalfPoint = 1.0 / 2.0 * Point + Character = 7 * Point + Millimeter = 2.83465 * Point + Centimeter = 10 * Millimeter + Inch = 72 * Point + Foot = 12 * Inch + Twips = 1.0 / 20.0 * Point + EMU = 1.0 / 914400.0 * Inch + HundredthPoint = 1 / 100.0 + Dxa = Twips +) diff --git a/backend/vendor/baliance.com/gooxml/mingo.go b/backend/vendor/baliance.com/gooxml/mingo.go new file mode 100644 index 00000000..56faf5ff --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/mingo.go @@ -0,0 +1,14 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package gooxml + +// MinGoVersion is used to cause a compile time error if gooxml is compiled with +// an older version of go. Specifically it requires a feature in go 1.8 +// regarding collecting all attributes from arbitrary xml used in decode +// gooxml.XSDAny. +const MinGoVersion = requires_go_18 diff --git a/backend/vendor/baliance.com/gooxml/mingo_18.go b/backend/vendor/baliance.com/gooxml/mingo_18.go new file mode 100644 index 00000000..cccc13bd --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/mingo_18.go @@ -0,0 +1,12 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +// +build go1.8 + +package gooxml + +const requires_go_18 = true diff --git a/backend/vendor/baliance.com/gooxml/optional.go b/backend/vendor/baliance.com/gooxml/optional.go new file mode 100644 index 00000000..668d8430 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/optional.go @@ -0,0 +1,83 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package gooxml + +import "fmt" + +// Float32 returns a copy of v as a pointer. +func Float32(v float32) *float32 { + x := v + return &x +} + +// Float64 returns a copy of v as a pointer. +func Float64(v float64) *float64 { + x := v + return &x +} + +// Uint64 returns a copy of v as a pointer. +func Uint64(v uint64) *uint64 { + x := v + return &x +} + +// Uint32 returns a copy of v as a pointer. +func Uint32(v uint32) *uint32 { + x := v + return &x +} + +// Uint16 returns a copy of v as a pointer. +func Uint16(v uint16) *uint16 { + x := v + return &x +} + +// Uint8 returns a copy of v as a pointer. +func Uint8(v uint8) *uint8 { + x := v + return &x +} + +// Int64 returns a copy of v as a pointer. +func Int64(v int64) *int64 { + x := v + return &x +} + +// Int32 returns a copy of v as a pointer. +func Int32(v int32) *int32 { + x := v + return &x +} + +// Int8 returns a copy of v as a pointer. +func Int8(v int8) *int8 { + x := v + return &x +} + +// Bool returns a copy of v as a pointer. +func Bool(v bool) *bool { + x := v + return &x +} + +// String returns a copy of v as a pointer. +func String(v string) *string { + x := v + return &x +} + +// Stringf formats according to a format specifier and returns a pointer to the +// resulting string. +func Stringf(f string, args ...interface{}) *string { + x := fmt.Sprintf(f, args...) + return &x +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/AG_Blob.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/AG_Blob.go new file mode 100644 index 00000000..f7b6487b --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/AG_Blob.go @@ -0,0 +1,80 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type AG_Blob struct { + EmbedAttr *string + LinkAttr *string +} + +func NewAG_Blob() *AG_Blob { + ret := &AG_Blob{} + return ret +} + +func (m *AG_Blob) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.EmbedAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "r:embed"}, + Value: fmt.Sprintf("%v", *m.EmbedAttr)}) + } + if m.LinkAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "r:link"}, + Value: fmt.Sprintf("%v", *m.LinkAttr)}) + } + return nil +} + +func (m *AG_Blob) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Space == "http://schemas.openxmlformats.org/officeDocument/2006/relationships" && attr.Name.Local == "embed" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.EmbedAttr = &parsed + continue + } + if attr.Name.Space == "http://schemas.openxmlformats.org/officeDocument/2006/relationships" && attr.Name.Local == "link" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.LinkAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing AG_Blob: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the AG_Blob and its children +func (m *AG_Blob) Validate() error { + return m.ValidateWithPath("AG_Blob") +} + +// ValidateWithPath validates the AG_Blob and its children, prefixing error messages with path +func (m *AG_Blob) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/AG_Locking.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/AG_Locking.go new file mode 100644 index 00000000..72298cde --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/AG_Locking.go @@ -0,0 +1,185 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" +) + +type AG_Locking struct { + NoGrpAttr *bool + NoSelectAttr *bool + NoRotAttr *bool + NoChangeAspectAttr *bool + NoMoveAttr *bool + NoResizeAttr *bool + NoEditPointsAttr *bool + NoAdjustHandlesAttr *bool + NoChangeArrowheadsAttr *bool + NoChangeShapeTypeAttr *bool +} + +func NewAG_Locking() *AG_Locking { + ret := &AG_Locking{} + return ret +} + +func (m *AG_Locking) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.NoGrpAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noGrp"}, + Value: fmt.Sprintf("%d", b2i(*m.NoGrpAttr))}) + } + if m.NoSelectAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noSelect"}, + Value: fmt.Sprintf("%d", b2i(*m.NoSelectAttr))}) + } + if m.NoRotAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noRot"}, + Value: fmt.Sprintf("%d", b2i(*m.NoRotAttr))}) + } + if m.NoChangeAspectAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noChangeAspect"}, + Value: fmt.Sprintf("%d", b2i(*m.NoChangeAspectAttr))}) + } + if m.NoMoveAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noMove"}, + Value: fmt.Sprintf("%d", b2i(*m.NoMoveAttr))}) + } + if m.NoResizeAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noResize"}, + Value: fmt.Sprintf("%d", b2i(*m.NoResizeAttr))}) + } + if m.NoEditPointsAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noEditPoints"}, + Value: fmt.Sprintf("%d", b2i(*m.NoEditPointsAttr))}) + } + if m.NoAdjustHandlesAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noAdjustHandles"}, + Value: fmt.Sprintf("%d", b2i(*m.NoAdjustHandlesAttr))}) + } + if m.NoChangeArrowheadsAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noChangeArrowheads"}, + Value: fmt.Sprintf("%d", b2i(*m.NoChangeArrowheadsAttr))}) + } + if m.NoChangeShapeTypeAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noChangeShapeType"}, + Value: fmt.Sprintf("%d", b2i(*m.NoChangeShapeTypeAttr))}) + } + return nil +} + +func (m *AG_Locking) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "noGrp" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoGrpAttr = &parsed + continue + } + if attr.Name.Local == "noSelect" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoSelectAttr = &parsed + continue + } + if attr.Name.Local == "noRot" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoRotAttr = &parsed + continue + } + if attr.Name.Local == "noChangeAspect" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoChangeAspectAttr = &parsed + continue + } + if attr.Name.Local == "noMove" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoMoveAttr = &parsed + continue + } + if attr.Name.Local == "noResize" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoResizeAttr = &parsed + continue + } + if attr.Name.Local == "noEditPoints" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoEditPointsAttr = &parsed + continue + } + if attr.Name.Local == "noAdjustHandles" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoAdjustHandlesAttr = &parsed + continue + } + if attr.Name.Local == "noChangeArrowheads" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoChangeArrowheadsAttr = &parsed + continue + } + if attr.Name.Local == "noChangeShapeType" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoChangeShapeTypeAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing AG_Locking: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the AG_Locking and its children +func (m *AG_Locking) Validate() error { + return m.ValidateWithPath("AG_Locking") +} + +// ValidateWithPath validates the AG_Locking and its children, prefixing error messages with path +func (m *AG_Locking) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/Blip.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/Blip.go new file mode 100644 index 00000000..5f5704be --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/Blip.go @@ -0,0 +1,204 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type Blip struct { + CT_Blip +} + +func NewBlip() *Blip { + ret := &Blip{} + ret.CT_Blip = *NewCT_Blip() + return ret +} + +func (m *Blip) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:a"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:r"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/relationships"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:sh"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/sharedTypes"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:xml"}, Value: "http://www.w3.org/XML/1998/namespace"}) + start.Name.Local = "a:blip" + return m.CT_Blip.MarshalXML(e, start) +} + +func (m *Blip) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CT_Blip = *NewCT_Blip() + for _, attr := range start.Attr { + if attr.Name.Space == "http://schemas.openxmlformats.org/officeDocument/2006/relationships" && attr.Name.Local == "embed" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.EmbedAttr = &parsed + continue + } + if attr.Name.Space == "http://schemas.openxmlformats.org/officeDocument/2006/relationships" && attr.Name.Local == "link" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.LinkAttr = &parsed + continue + } + if attr.Name.Local == "cstate" { + m.CstateAttr.UnmarshalXMLAttr(attr) + continue + } + } +lBlip: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaBiLevel"}: + tmp := NewCT_BlipChoice() + if err := d.DecodeElement(&tmp.AlphaBiLevel, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaCeiling"}: + tmp := NewCT_BlipChoice() + if err := d.DecodeElement(&tmp.AlphaCeiling, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaFloor"}: + tmp := NewCT_BlipChoice() + if err := d.DecodeElement(&tmp.AlphaFloor, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaInv"}: + tmp := NewCT_BlipChoice() + if err := d.DecodeElement(&tmp.AlphaInv, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaMod"}: + tmp := NewCT_BlipChoice() + if err := d.DecodeElement(&tmp.AlphaMod, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaModFix"}: + tmp := NewCT_BlipChoice() + if err := d.DecodeElement(&tmp.AlphaModFix, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaRepl"}: + tmp := NewCT_BlipChoice() + if err := d.DecodeElement(&tmp.AlphaRepl, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "biLevel"}: + tmp := NewCT_BlipChoice() + if err := d.DecodeElement(&tmp.BiLevel, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blur"}: + tmp := NewCT_BlipChoice() + if err := d.DecodeElement(&tmp.Blur, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "clrChange"}: + tmp := NewCT_BlipChoice() + if err := d.DecodeElement(&tmp.ClrChange, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "clrRepl"}: + tmp := NewCT_BlipChoice() + if err := d.DecodeElement(&tmp.ClrRepl, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "duotone"}: + tmp := NewCT_BlipChoice() + if err := d.DecodeElement(&tmp.Duotone, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "fillOverlay"}: + tmp := NewCT_BlipChoice() + if err := d.DecodeElement(&tmp.FillOverlay, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "grayscl"}: + tmp := NewCT_BlipChoice() + if err := d.DecodeElement(&tmp.Grayscl, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hsl"}: + tmp := NewCT_BlipChoice() + if err := d.DecodeElement(&tmp.Hsl, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lum"}: + tmp := NewCT_BlipChoice() + if err := d.DecodeElement(&tmp.Lum, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "tint"}: + tmp := NewCT_BlipChoice() + if err := d.DecodeElement(&tmp.Tint, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on Blip %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lBlip + case xml.CharData: + } + } + return nil +} + +// Validate validates the Blip and its children +func (m *Blip) Validate() error { + return m.ValidateWithPath("Blip") +} + +// ValidateWithPath validates the Blip and its children, prefixing error messages with path +func (m *Blip) ValidateWithPath(path string) error { + if err := m.CT_Blip.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AdjPoint2D.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AdjPoint2D.go new file mode 100644 index 00000000..f507a627 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AdjPoint2D.go @@ -0,0 +1,84 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_AdjPoint2D struct { + XAttr ST_AdjCoordinate + YAttr ST_AdjCoordinate +} + +func NewCT_AdjPoint2D() *CT_AdjPoint2D { + ret := &CT_AdjPoint2D{} + return ret +} + +func (m *CT_AdjPoint2D) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "x"}, + Value: fmt.Sprintf("%v", m.XAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "y"}, + Value: fmt.Sprintf("%v", m.YAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_AdjPoint2D) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "x" { + parsed, err := ParseUnionST_AdjCoordinate(attr.Value) + if err != nil { + return err + } + m.XAttr = parsed + continue + } + if attr.Name.Local == "y" { + parsed, err := ParseUnionST_AdjCoordinate(attr.Value) + if err != nil { + return err + } + m.YAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_AdjPoint2D: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_AdjPoint2D and its children +func (m *CT_AdjPoint2D) Validate() error { + return m.ValidateWithPath("CT_AdjPoint2D") +} + +// ValidateWithPath validates the CT_AdjPoint2D and its children, prefixing error messages with path +func (m *CT_AdjPoint2D) ValidateWithPath(path string) error { + if err := m.XAttr.ValidateWithPath(path + "/XAttr"); err != nil { + return err + } + if err := m.YAttr.ValidateWithPath(path + "/YAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AdjustHandleList.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AdjustHandleList.go new file mode 100644 index 00000000..c24493c8 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AdjustHandleList.go @@ -0,0 +1,102 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_AdjustHandleList struct { + AhXY []*CT_XYAdjustHandle + AhPolar []*CT_PolarAdjustHandle +} + +func NewCT_AdjustHandleList() *CT_AdjustHandleList { + ret := &CT_AdjustHandleList{} + return ret +} + +func (m *CT_AdjustHandleList) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.AhXY != nil { + seahXY := xml.StartElement{Name: xml.Name{Local: "a:ahXY"}} + for _, c := range m.AhXY { + e.EncodeElement(c, seahXY) + } + } + if m.AhPolar != nil { + seahPolar := xml.StartElement{Name: xml.Name{Local: "a:ahPolar"}} + for _, c := range m.AhPolar { + e.EncodeElement(c, seahPolar) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_AdjustHandleList) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_AdjustHandleList: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "ahXY"}: + tmp := NewCT_XYAdjustHandle() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.AhXY = append(m.AhXY, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "ahPolar"}: + tmp := NewCT_PolarAdjustHandle() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.AhPolar = append(m.AhPolar, tmp) + default: + gooxml.Log("skipping unsupported element on CT_AdjustHandleList %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_AdjustHandleList + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_AdjustHandleList and its children +func (m *CT_AdjustHandleList) Validate() error { + return m.ValidateWithPath("CT_AdjustHandleList") +} + +// ValidateWithPath validates the CT_AdjustHandleList and its children, prefixing error messages with path +func (m *CT_AdjustHandleList) ValidateWithPath(path string) error { + for i, v := range m.AhXY { + if err := v.ValidateWithPath(fmt.Sprintf("%s/AhXY[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.AhPolar { + if err := v.ValidateWithPath(fmt.Sprintf("%s/AhPolar[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AlphaBiLevelEffect.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AlphaBiLevelEffect.go new file mode 100644 index 00000000..efed14a7 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AlphaBiLevelEffect.go @@ -0,0 +1,70 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_AlphaBiLevelEffect struct { + ThreshAttr ST_PositiveFixedPercentage +} + +func NewCT_AlphaBiLevelEffect() *CT_AlphaBiLevelEffect { + ret := &CT_AlphaBiLevelEffect{} + return ret +} + +func (m *CT_AlphaBiLevelEffect) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "thresh"}, + Value: fmt.Sprintf("%v", m.ThreshAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_AlphaBiLevelEffect) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "thresh" { + parsed, err := ParseUnionST_PositiveFixedPercentage(attr.Value) + if err != nil { + return err + } + m.ThreshAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_AlphaBiLevelEffect: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_AlphaBiLevelEffect and its children +func (m *CT_AlphaBiLevelEffect) Validate() error { + return m.ValidateWithPath("CT_AlphaBiLevelEffect") +} + +// ValidateWithPath validates the CT_AlphaBiLevelEffect and its children, prefixing error messages with path +func (m *CT_AlphaBiLevelEffect) ValidateWithPath(path string) error { + if err := m.ThreshAttr.ValidateWithPath(path + "/ThreshAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AlphaCeilingEffect.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AlphaCeilingEffect.go new file mode 100644 index 00000000..116ae7af --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AlphaCeilingEffect.go @@ -0,0 +1,54 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_AlphaCeilingEffect struct { +} + +func NewCT_AlphaCeilingEffect() *CT_AlphaCeilingEffect { + ret := &CT_AlphaCeilingEffect{} + return ret +} + +func (m *CT_AlphaCeilingEffect) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_AlphaCeilingEffect) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_AlphaCeilingEffect: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_AlphaCeilingEffect and its children +func (m *CT_AlphaCeilingEffect) Validate() error { + return m.ValidateWithPath("CT_AlphaCeilingEffect") +} + +// ValidateWithPath validates the CT_AlphaCeilingEffect and its children, prefixing error messages with path +func (m *CT_AlphaCeilingEffect) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AlphaFloorEffect.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AlphaFloorEffect.go new file mode 100644 index 00000000..242867a3 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AlphaFloorEffect.go @@ -0,0 +1,54 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_AlphaFloorEffect struct { +} + +func NewCT_AlphaFloorEffect() *CT_AlphaFloorEffect { + ret := &CT_AlphaFloorEffect{} + return ret +} + +func (m *CT_AlphaFloorEffect) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_AlphaFloorEffect) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_AlphaFloorEffect: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_AlphaFloorEffect and its children +func (m *CT_AlphaFloorEffect) Validate() error { + return m.ValidateWithPath("CT_AlphaFloorEffect") +} + +// ValidateWithPath validates the CT_AlphaFloorEffect and its children, prefixing error messages with path +func (m *CT_AlphaFloorEffect) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AlphaInverseEffect.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AlphaInverseEffect.go new file mode 100644 index 00000000..433c0a78 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AlphaInverseEffect.go @@ -0,0 +1,155 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_AlphaInverseEffect struct { + ScrgbClr *CT_ScRgbColor + SrgbClr *CT_SRgbColor + HslClr *CT_HslColor + SysClr *CT_SystemColor + SchemeClr *CT_SchemeColor + PrstClr *CT_PresetColor +} + +func NewCT_AlphaInverseEffect() *CT_AlphaInverseEffect { + ret := &CT_AlphaInverseEffect{} + return ret +} + +func (m *CT_AlphaInverseEffect) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.ScrgbClr != nil { + sescrgbClr := xml.StartElement{Name: xml.Name{Local: "a:scrgbClr"}} + e.EncodeElement(m.ScrgbClr, sescrgbClr) + } + if m.SrgbClr != nil { + sesrgbClr := xml.StartElement{Name: xml.Name{Local: "a:srgbClr"}} + e.EncodeElement(m.SrgbClr, sesrgbClr) + } + if m.HslClr != nil { + sehslClr := xml.StartElement{Name: xml.Name{Local: "a:hslClr"}} + e.EncodeElement(m.HslClr, sehslClr) + } + if m.SysClr != nil { + sesysClr := xml.StartElement{Name: xml.Name{Local: "a:sysClr"}} + e.EncodeElement(m.SysClr, sesysClr) + } + if m.SchemeClr != nil { + seschemeClr := xml.StartElement{Name: xml.Name{Local: "a:schemeClr"}} + e.EncodeElement(m.SchemeClr, seschemeClr) + } + if m.PrstClr != nil { + seprstClr := xml.StartElement{Name: xml.Name{Local: "a:prstClr"}} + e.EncodeElement(m.PrstClr, seprstClr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_AlphaInverseEffect) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_AlphaInverseEffect: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "scrgbClr"}: + m.ScrgbClr = NewCT_ScRgbColor() + if err := d.DecodeElement(m.ScrgbClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "srgbClr"}: + m.SrgbClr = NewCT_SRgbColor() + if err := d.DecodeElement(m.SrgbClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hslClr"}: + m.HslClr = NewCT_HslColor() + if err := d.DecodeElement(m.HslClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "sysClr"}: + m.SysClr = NewCT_SystemColor() + if err := d.DecodeElement(m.SysClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "schemeClr"}: + m.SchemeClr = NewCT_SchemeColor() + if err := d.DecodeElement(m.SchemeClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "prstClr"}: + m.PrstClr = NewCT_PresetColor() + if err := d.DecodeElement(m.PrstClr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_AlphaInverseEffect %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_AlphaInverseEffect + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_AlphaInverseEffect and its children +func (m *CT_AlphaInverseEffect) Validate() error { + return m.ValidateWithPath("CT_AlphaInverseEffect") +} + +// ValidateWithPath validates the CT_AlphaInverseEffect and its children, prefixing error messages with path +func (m *CT_AlphaInverseEffect) ValidateWithPath(path string) error { + if m.ScrgbClr != nil { + if err := m.ScrgbClr.ValidateWithPath(path + "/ScrgbClr"); err != nil { + return err + } + } + if m.SrgbClr != nil { + if err := m.SrgbClr.ValidateWithPath(path + "/SrgbClr"); err != nil { + return err + } + } + if m.HslClr != nil { + if err := m.HslClr.ValidateWithPath(path + "/HslClr"); err != nil { + return err + } + } + if m.SysClr != nil { + if err := m.SysClr.ValidateWithPath(path + "/SysClr"); err != nil { + return err + } + } + if m.SchemeClr != nil { + if err := m.SchemeClr.ValidateWithPath(path + "/SchemeClr"); err != nil { + return err + } + } + if m.PrstClr != nil { + if err := m.PrstClr.ValidateWithPath(path + "/PrstClr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AlphaModulateEffect.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AlphaModulateEffect.go new file mode 100644 index 00000000..d4b531fb --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AlphaModulateEffect.go @@ -0,0 +1,77 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_AlphaModulateEffect struct { + Cont *CT_EffectContainer +} + +func NewCT_AlphaModulateEffect() *CT_AlphaModulateEffect { + ret := &CT_AlphaModulateEffect{} + ret.Cont = NewCT_EffectContainer() + return ret +} + +func (m *CT_AlphaModulateEffect) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + secont := xml.StartElement{Name: xml.Name{Local: "a:cont"}} + e.EncodeElement(m.Cont, secont) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_AlphaModulateEffect) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.Cont = NewCT_EffectContainer() +lCT_AlphaModulateEffect: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "cont"}: + if err := d.DecodeElement(m.Cont, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_AlphaModulateEffect %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_AlphaModulateEffect + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_AlphaModulateEffect and its children +func (m *CT_AlphaModulateEffect) Validate() error { + return m.ValidateWithPath("CT_AlphaModulateEffect") +} + +// ValidateWithPath validates the CT_AlphaModulateEffect and its children, prefixing error messages with path +func (m *CT_AlphaModulateEffect) ValidateWithPath(path string) error { + if err := m.Cont.ValidateWithPath(path + "/Cont"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AlphaModulateFixedEffect.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AlphaModulateFixedEffect.go new file mode 100644 index 00000000..b8bcd498 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AlphaModulateFixedEffect.go @@ -0,0 +1,74 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_AlphaModulateFixedEffect struct { + AmtAttr *ST_PositivePercentage +} + +func NewCT_AlphaModulateFixedEffect() *CT_AlphaModulateFixedEffect { + ret := &CT_AlphaModulateFixedEffect{} + return ret +} + +func (m *CT_AlphaModulateFixedEffect) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.AmtAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "amt"}, + Value: fmt.Sprintf("%v", *m.AmtAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_AlphaModulateFixedEffect) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "amt" { + parsed, err := ParseUnionST_PositivePercentage(attr.Value) + if err != nil { + return err + } + m.AmtAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_AlphaModulateFixedEffect: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_AlphaModulateFixedEffect and its children +func (m *CT_AlphaModulateFixedEffect) Validate() error { + return m.ValidateWithPath("CT_AlphaModulateFixedEffect") +} + +// ValidateWithPath validates the CT_AlphaModulateFixedEffect and its children, prefixing error messages with path +func (m *CT_AlphaModulateFixedEffect) ValidateWithPath(path string) error { + if m.AmtAttr != nil { + if err := m.AmtAttr.ValidateWithPath(path + "/AmtAttr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AlphaOutsetEffect.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AlphaOutsetEffect.go new file mode 100644 index 00000000..55375ecd --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AlphaOutsetEffect.go @@ -0,0 +1,74 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_AlphaOutsetEffect struct { + RadAttr *ST_Coordinate +} + +func NewCT_AlphaOutsetEffect() *CT_AlphaOutsetEffect { + ret := &CT_AlphaOutsetEffect{} + return ret +} + +func (m *CT_AlphaOutsetEffect) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.RadAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "rad"}, + Value: fmt.Sprintf("%v", *m.RadAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_AlphaOutsetEffect) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "rad" { + parsed, err := ParseUnionST_Coordinate(attr.Value) + if err != nil { + return err + } + m.RadAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_AlphaOutsetEffect: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_AlphaOutsetEffect and its children +func (m *CT_AlphaOutsetEffect) Validate() error { + return m.ValidateWithPath("CT_AlphaOutsetEffect") +} + +// ValidateWithPath validates the CT_AlphaOutsetEffect and its children, prefixing error messages with path +func (m *CT_AlphaOutsetEffect) ValidateWithPath(path string) error { + if m.RadAttr != nil { + if err := m.RadAttr.ValidateWithPath(path + "/RadAttr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AlphaReplaceEffect.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AlphaReplaceEffect.go new file mode 100644 index 00000000..6acbffd9 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AlphaReplaceEffect.go @@ -0,0 +1,70 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_AlphaReplaceEffect struct { + AAttr ST_PositiveFixedPercentage +} + +func NewCT_AlphaReplaceEffect() *CT_AlphaReplaceEffect { + ret := &CT_AlphaReplaceEffect{} + return ret +} + +func (m *CT_AlphaReplaceEffect) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "a"}, + Value: fmt.Sprintf("%v", m.AAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_AlphaReplaceEffect) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "a" { + parsed, err := ParseUnionST_PositiveFixedPercentage(attr.Value) + if err != nil { + return err + } + m.AAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_AlphaReplaceEffect: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_AlphaReplaceEffect and its children +func (m *CT_AlphaReplaceEffect) Validate() error { + return m.ValidateWithPath("CT_AlphaReplaceEffect") +} + +// ValidateWithPath validates the CT_AlphaReplaceEffect and its children, prefixing error messages with path +func (m *CT_AlphaReplaceEffect) ValidateWithPath(path string) error { + if err := m.AAttr.ValidateWithPath(path + "/AAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Angle.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Angle.go new file mode 100644 index 00000000..802a2050 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Angle.go @@ -0,0 +1,68 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" +) + +type CT_Angle struct { + ValAttr int32 +} + +func NewCT_Angle() *CT_Angle { + ret := &CT_Angle{} + return ret +} + +func (m *CT_Angle) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "val"}, + Value: fmt.Sprintf("%v", m.ValAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Angle) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + m.ValAttr = int32(parsed) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Angle: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Angle and its children +func (m *CT_Angle) Validate() error { + return m.ValidateWithPath("CT_Angle") +} + +// ValidateWithPath validates the CT_Angle and its children, prefixing error messages with path +func (m *CT_Angle) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AnimationChartBuildProperties.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AnimationChartBuildProperties.go new file mode 100644 index 00000000..eedfecee --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AnimationChartBuildProperties.go @@ -0,0 +1,88 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" +) + +type CT_AnimationChartBuildProperties struct { + BldAttr *ST_AnimationChartBuildType + AnimBgAttr *bool +} + +func NewCT_AnimationChartBuildProperties() *CT_AnimationChartBuildProperties { + ret := &CT_AnimationChartBuildProperties{} + return ret +} + +func (m *CT_AnimationChartBuildProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.BldAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "bld"}, + Value: fmt.Sprintf("%v", *m.BldAttr)}) + } + if m.AnimBgAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "animBg"}, + Value: fmt.Sprintf("%d", b2i(*m.AnimBgAttr))}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_AnimationChartBuildProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "bld" { + parsed, err := ParseUnionST_AnimationChartBuildType(attr.Value) + if err != nil { + return err + } + m.BldAttr = &parsed + continue + } + if attr.Name.Local == "animBg" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.AnimBgAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_AnimationChartBuildProperties: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_AnimationChartBuildProperties and its children +func (m *CT_AnimationChartBuildProperties) Validate() error { + return m.ValidateWithPath("CT_AnimationChartBuildProperties") +} + +// ValidateWithPath validates the CT_AnimationChartBuildProperties and its children, prefixing error messages with path +func (m *CT_AnimationChartBuildProperties) ValidateWithPath(path string) error { + if m.BldAttr != nil { + if err := m.BldAttr.ValidateWithPath(path + "/BldAttr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AnimationChartElement.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AnimationChartElement.go new file mode 100644 index 00000000..78686124 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AnimationChartElement.go @@ -0,0 +1,103 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" +) + +type CT_AnimationChartElement struct { + SeriesIdxAttr *int32 + CategoryIdxAttr *int32 + BldStepAttr ST_ChartBuildStep +} + +func NewCT_AnimationChartElement() *CT_AnimationChartElement { + ret := &CT_AnimationChartElement{} + ret.BldStepAttr = ST_ChartBuildStep(1) + return ret +} + +func (m *CT_AnimationChartElement) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.SeriesIdxAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "seriesIdx"}, + Value: fmt.Sprintf("%v", *m.SeriesIdxAttr)}) + } + if m.CategoryIdxAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "categoryIdx"}, + Value: fmt.Sprintf("%v", *m.CategoryIdxAttr)}) + } + attr, err := m.BldStepAttr.MarshalXMLAttr(xml.Name{Local: "bldStep"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_AnimationChartElement) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.BldStepAttr = ST_ChartBuildStep(1) + for _, attr := range start.Attr { + if attr.Name.Local == "seriesIdx" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + pt := int32(parsed) + m.SeriesIdxAttr = &pt + continue + } + if attr.Name.Local == "categoryIdx" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + pt := int32(parsed) + m.CategoryIdxAttr = &pt + continue + } + if attr.Name.Local == "bldStep" { + m.BldStepAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_AnimationChartElement: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_AnimationChartElement and its children +func (m *CT_AnimationChartElement) Validate() error { + return m.ValidateWithPath("CT_AnimationChartElement") +} + +// ValidateWithPath validates the CT_AnimationChartElement and its children, prefixing error messages with path +func (m *CT_AnimationChartElement) ValidateWithPath(path string) error { + if m.BldStepAttr == ST_ChartBuildStepUnset { + return fmt.Errorf("%s/BldStepAttr is a mandatory field", path) + } + if err := m.BldStepAttr.ValidateWithPath(path + "/BldStepAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AnimationDgmBuildProperties.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AnimationDgmBuildProperties.go new file mode 100644 index 00000000..409cbff1 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AnimationDgmBuildProperties.go @@ -0,0 +1,88 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" +) + +type CT_AnimationDgmBuildProperties struct { + BldAttr *ST_AnimationDgmBuildType + RevAttr *bool +} + +func NewCT_AnimationDgmBuildProperties() *CT_AnimationDgmBuildProperties { + ret := &CT_AnimationDgmBuildProperties{} + return ret +} + +func (m *CT_AnimationDgmBuildProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.BldAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "bld"}, + Value: fmt.Sprintf("%v", *m.BldAttr)}) + } + if m.RevAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "rev"}, + Value: fmt.Sprintf("%d", b2i(*m.RevAttr))}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_AnimationDgmBuildProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "bld" { + parsed, err := ParseUnionST_AnimationDgmBuildType(attr.Value) + if err != nil { + return err + } + m.BldAttr = &parsed + continue + } + if attr.Name.Local == "rev" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.RevAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_AnimationDgmBuildProperties: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_AnimationDgmBuildProperties and its children +func (m *CT_AnimationDgmBuildProperties) Validate() error { + return m.ValidateWithPath("CT_AnimationDgmBuildProperties") +} + +// ValidateWithPath validates the CT_AnimationDgmBuildProperties and its children, prefixing error messages with path +func (m *CT_AnimationDgmBuildProperties) ValidateWithPath(path string) error { + if m.BldAttr != nil { + if err := m.BldAttr.ValidateWithPath(path + "/BldAttr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AnimationDgmElement.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AnimationDgmElement.go new file mode 100644 index 00000000..cca31f45 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AnimationDgmElement.go @@ -0,0 +1,91 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_AnimationDgmElement struct { + IdAttr *string + BldStepAttr ST_DgmBuildStep +} + +func NewCT_AnimationDgmElement() *CT_AnimationDgmElement { + ret := &CT_AnimationDgmElement{} + return ret +} + +func (m *CT_AnimationDgmElement) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.IdAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "id"}, + Value: fmt.Sprintf("%v", *m.IdAttr)}) + } + if m.BldStepAttr != ST_DgmBuildStepUnset { + attr, err := m.BldStepAttr.MarshalXMLAttr(xml.Name{Local: "bldStep"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_AnimationDgmElement) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "id" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.IdAttr = &parsed + continue + } + if attr.Name.Local == "bldStep" { + m.BldStepAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_AnimationDgmElement: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_AnimationDgmElement and its children +func (m *CT_AnimationDgmElement) Validate() error { + return m.ValidateWithPath("CT_AnimationDgmElement") +} + +// ValidateWithPath validates the CT_AnimationDgmElement and its children, prefixing error messages with path +func (m *CT_AnimationDgmElement) ValidateWithPath(path string) error { + if m.IdAttr != nil { + if !sharedTypes.ST_GuidPatternRe.MatchString(*m.IdAttr) { + return fmt.Errorf(`%s/m.IdAttr must match '%s' (have %v)`, path, sharedTypes.ST_GuidPatternRe, *m.IdAttr) + } + } + if err := m.BldStepAttr.ValidateWithPath(path + "/BldStepAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AnimationElementChoice.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AnimationElementChoice.go new file mode 100644 index 00000000..e043dd6c --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AnimationElementChoice.go @@ -0,0 +1,96 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_AnimationElementChoice struct { + Dgm *CT_AnimationDgmElement + Chart *CT_AnimationChartElement +} + +func NewCT_AnimationElementChoice() *CT_AnimationElementChoice { + ret := &CT_AnimationElementChoice{} + return ret +} + +func (m *CT_AnimationElementChoice) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Name.Local = "a:CT_AnimationElementChoice" + e.EncodeToken(start) + if m.Dgm != nil { + sedgm := xml.StartElement{Name: xml.Name{Local: "a:dgm"}} + e.EncodeElement(m.Dgm, sedgm) + } + if m.Chart != nil { + sechart := xml.StartElement{Name: xml.Name{Local: "a:chart"}} + e.EncodeElement(m.Chart, sechart) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_AnimationElementChoice) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_AnimationElementChoice: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "dgm"}: + m.Dgm = NewCT_AnimationDgmElement() + if err := d.DecodeElement(m.Dgm, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "chart"}: + m.Chart = NewCT_AnimationChartElement() + if err := d.DecodeElement(m.Chart, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_AnimationElementChoice %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_AnimationElementChoice + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_AnimationElementChoice and its children +func (m *CT_AnimationElementChoice) Validate() error { + return m.ValidateWithPath("CT_AnimationElementChoice") +} + +// ValidateWithPath validates the CT_AnimationElementChoice and its children, prefixing error messages with path +func (m *CT_AnimationElementChoice) ValidateWithPath(path string) error { + if m.Dgm != nil { + if err := m.Dgm.ValidateWithPath(path + "/Dgm"); err != nil { + return err + } + } + if m.Chart != nil { + if err := m.Chart.ValidateWithPath(path + "/Chart"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AnimationGraphicalObjectBuildProperties.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AnimationGraphicalObjectBuildProperties.go new file mode 100644 index 00000000..c295e27a --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AnimationGraphicalObjectBuildProperties.go @@ -0,0 +1,96 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_AnimationGraphicalObjectBuildProperties struct { + BldDgm *CT_AnimationDgmBuildProperties + BldChart *CT_AnimationChartBuildProperties +} + +func NewCT_AnimationGraphicalObjectBuildProperties() *CT_AnimationGraphicalObjectBuildProperties { + ret := &CT_AnimationGraphicalObjectBuildProperties{} + return ret +} + +func (m *CT_AnimationGraphicalObjectBuildProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Name.Local = "a:CT_AnimationGraphicalObjectBuildProperties" + e.EncodeToken(start) + if m.BldDgm != nil { + sebldDgm := xml.StartElement{Name: xml.Name{Local: "a:bldDgm"}} + e.EncodeElement(m.BldDgm, sebldDgm) + } + if m.BldChart != nil { + sebldChart := xml.StartElement{Name: xml.Name{Local: "a:bldChart"}} + e.EncodeElement(m.BldChart, sebldChart) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_AnimationGraphicalObjectBuildProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_AnimationGraphicalObjectBuildProperties: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "bldDgm"}: + m.BldDgm = NewCT_AnimationDgmBuildProperties() + if err := d.DecodeElement(m.BldDgm, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "bldChart"}: + m.BldChart = NewCT_AnimationChartBuildProperties() + if err := d.DecodeElement(m.BldChart, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_AnimationGraphicalObjectBuildProperties %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_AnimationGraphicalObjectBuildProperties + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_AnimationGraphicalObjectBuildProperties and its children +func (m *CT_AnimationGraphicalObjectBuildProperties) Validate() error { + return m.ValidateWithPath("CT_AnimationGraphicalObjectBuildProperties") +} + +// ValidateWithPath validates the CT_AnimationGraphicalObjectBuildProperties and its children, prefixing error messages with path +func (m *CT_AnimationGraphicalObjectBuildProperties) ValidateWithPath(path string) error { + if m.BldDgm != nil { + if err := m.BldDgm.ValidateWithPath(path + "/BldDgm"); err != nil { + return err + } + } + if m.BldChart != nil { + if err := m.BldChart.ValidateWithPath(path + "/BldChart"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AudioCD.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AudioCD.go new file mode 100644 index 00000000..4c552357 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AudioCD.go @@ -0,0 +1,104 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_AudioCD struct { + St *CT_AudioCDTime + End *CT_AudioCDTime + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_AudioCD() *CT_AudioCD { + ret := &CT_AudioCD{} + ret.St = NewCT_AudioCDTime() + ret.End = NewCT_AudioCDTime() + return ret +} + +func (m *CT_AudioCD) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + sest := xml.StartElement{Name: xml.Name{Local: "a:st"}} + e.EncodeElement(m.St, sest) + seend := xml.StartElement{Name: xml.Name{Local: "a:end"}} + e.EncodeElement(m.End, seend) + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_AudioCD) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.St = NewCT_AudioCDTime() + m.End = NewCT_AudioCDTime() +lCT_AudioCD: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "st"}: + if err := d.DecodeElement(m.St, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "end"}: + if err := d.DecodeElement(m.End, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_AudioCD %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_AudioCD + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_AudioCD and its children +func (m *CT_AudioCD) Validate() error { + return m.ValidateWithPath("CT_AudioCD") +} + +// ValidateWithPath validates the CT_AudioCD and its children, prefixing error messages with path +func (m *CT_AudioCD) ValidateWithPath(path string) error { + if err := m.St.ValidateWithPath(path + "/St"); err != nil { + return err + } + if err := m.End.ValidateWithPath(path + "/End"); err != nil { + return err + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AudioCDTime.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AudioCDTime.go new file mode 100644 index 00000000..05439af2 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AudioCDTime.go @@ -0,0 +1,82 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" +) + +type CT_AudioCDTime struct { + TrackAttr uint8 + TimeAttr *uint32 +} + +func NewCT_AudioCDTime() *CT_AudioCDTime { + ret := &CT_AudioCDTime{} + return ret +} + +func (m *CT_AudioCDTime) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "track"}, + Value: fmt.Sprintf("%v", m.TrackAttr)}) + if m.TimeAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "time"}, + Value: fmt.Sprintf("%v", *m.TimeAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_AudioCDTime) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "track" { + parsed, err := strconv.ParseUint(attr.Value, 10, 8) + if err != nil { + return err + } + m.TrackAttr = uint8(parsed) + continue + } + if attr.Name.Local == "time" { + parsed, err := strconv.ParseUint(attr.Value, 10, 32) + if err != nil { + return err + } + pt := uint32(parsed) + m.TimeAttr = &pt + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_AudioCDTime: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_AudioCDTime and its children +func (m *CT_AudioCDTime) Validate() error { + return m.ValidateWithPath("CT_AudioCDTime") +} + +// ValidateWithPath validates the CT_AudioCDTime and its children, prefixing error messages with path +func (m *CT_AudioCDTime) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AudioFile.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AudioFile.go new file mode 100644 index 00000000..e7692af2 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_AudioFile.go @@ -0,0 +1,107 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_AudioFile struct { + LinkAttr string + ContentTypeAttr *string + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_AudioFile() *CT_AudioFile { + ret := &CT_AudioFile{} + return ret +} + +func (m *CT_AudioFile) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "r:link"}, + Value: fmt.Sprintf("%v", m.LinkAttr)}) + if m.ContentTypeAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "contentType"}, + Value: fmt.Sprintf("%v", *m.ContentTypeAttr)}) + } + e.EncodeToken(start) + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_AudioFile) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Space == "http://schemas.openxmlformats.org/officeDocument/2006/relationships" && attr.Name.Local == "link" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.LinkAttr = parsed + continue + } + if attr.Name.Local == "contentType" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ContentTypeAttr = &parsed + continue + } + } +lCT_AudioFile: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_AudioFile %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_AudioFile + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_AudioFile and its children +func (m *CT_AudioFile) Validate() error { + return m.ValidateWithPath("CT_AudioFile") +} + +// ValidateWithPath validates the CT_AudioFile and its children, prefixing error messages with path +func (m *CT_AudioFile) ValidateWithPath(path string) error { + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Backdrop.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Backdrop.go new file mode 100644 index 00000000..a129cc3c --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Backdrop.go @@ -0,0 +1,116 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_Backdrop struct { + Anchor *CT_Point3D + Norm *CT_Vector3D + Up *CT_Vector3D + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_Backdrop() *CT_Backdrop { + ret := &CT_Backdrop{} + ret.Anchor = NewCT_Point3D() + ret.Norm = NewCT_Vector3D() + ret.Up = NewCT_Vector3D() + return ret +} + +func (m *CT_Backdrop) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + seanchor := xml.StartElement{Name: xml.Name{Local: "a:anchor"}} + e.EncodeElement(m.Anchor, seanchor) + senorm := xml.StartElement{Name: xml.Name{Local: "a:norm"}} + e.EncodeElement(m.Norm, senorm) + seup := xml.StartElement{Name: xml.Name{Local: "a:up"}} + e.EncodeElement(m.Up, seup) + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Backdrop) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.Anchor = NewCT_Point3D() + m.Norm = NewCT_Vector3D() + m.Up = NewCT_Vector3D() +lCT_Backdrop: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "anchor"}: + if err := d.DecodeElement(m.Anchor, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "norm"}: + if err := d.DecodeElement(m.Norm, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "up"}: + if err := d.DecodeElement(m.Up, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_Backdrop %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Backdrop + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Backdrop and its children +func (m *CT_Backdrop) Validate() error { + return m.ValidateWithPath("CT_Backdrop") +} + +// ValidateWithPath validates the CT_Backdrop and its children, prefixing error messages with path +func (m *CT_Backdrop) ValidateWithPath(path string) error { + if err := m.Anchor.ValidateWithPath(path + "/Anchor"); err != nil { + return err + } + if err := m.Norm.ValidateWithPath(path + "/Norm"); err != nil { + return err + } + if err := m.Up.ValidateWithPath(path + "/Up"); err != nil { + return err + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_BackgroundFillStyleList.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_BackgroundFillStyleList.go new file mode 100644 index 00000000..73e32422 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_BackgroundFillStyleList.go @@ -0,0 +1,117 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_BackgroundFillStyleList struct { + EG_FillProperties []*EG_FillProperties +} + +func NewCT_BackgroundFillStyleList() *CT_BackgroundFillStyleList { + ret := &CT_BackgroundFillStyleList{} + return ret +} + +func (m *CT_BackgroundFillStyleList) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + for _, c := range m.EG_FillProperties { + c.MarshalXML(e, xml.StartElement{}) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_BackgroundFillStyleList) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_BackgroundFillStyleList: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "noFill"}: + tmpfillproperties := NewEG_FillProperties() + tmpfillproperties.NoFill = NewCT_NoFillProperties() + if err := d.DecodeElement(tmpfillproperties.NoFill, &el); err != nil { + return err + } + m.EG_FillProperties = append(m.EG_FillProperties, tmpfillproperties) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "solidFill"}: + tmpfillproperties := NewEG_FillProperties() + tmpfillproperties.SolidFill = NewCT_SolidColorFillProperties() + if err := d.DecodeElement(tmpfillproperties.SolidFill, &el); err != nil { + return err + } + m.EG_FillProperties = append(m.EG_FillProperties, tmpfillproperties) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "gradFill"}: + tmpfillproperties := NewEG_FillProperties() + tmpfillproperties.GradFill = NewCT_GradientFillProperties() + if err := d.DecodeElement(tmpfillproperties.GradFill, &el); err != nil { + return err + } + m.EG_FillProperties = append(m.EG_FillProperties, tmpfillproperties) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blipFill"}: + tmpfillproperties := NewEG_FillProperties() + tmpfillproperties.BlipFill = NewCT_BlipFillProperties() + if err := d.DecodeElement(tmpfillproperties.BlipFill, &el); err != nil { + return err + } + m.EG_FillProperties = append(m.EG_FillProperties, tmpfillproperties) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "pattFill"}: + tmpfillproperties := NewEG_FillProperties() + tmpfillproperties.PattFill = NewCT_PatternFillProperties() + if err := d.DecodeElement(tmpfillproperties.PattFill, &el); err != nil { + return err + } + m.EG_FillProperties = append(m.EG_FillProperties, tmpfillproperties) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "grpFill"}: + tmpfillproperties := NewEG_FillProperties() + tmpfillproperties.GrpFill = NewCT_GroupFillProperties() + if err := d.DecodeElement(tmpfillproperties.GrpFill, &el); err != nil { + return err + } + m.EG_FillProperties = append(m.EG_FillProperties, tmpfillproperties) + default: + gooxml.Log("skipping unsupported element on CT_BackgroundFillStyleList %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_BackgroundFillStyleList + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_BackgroundFillStyleList and its children +func (m *CT_BackgroundFillStyleList) Validate() error { + return m.ValidateWithPath("CT_BackgroundFillStyleList") +} + +// ValidateWithPath validates the CT_BackgroundFillStyleList and its children, prefixing error messages with path +func (m *CT_BackgroundFillStyleList) ValidateWithPath(path string) error { + for i, v := range m.EG_FillProperties { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_FillProperties[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_BackgroundFormatting.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_BackgroundFormatting.go new file mode 100644 index 00000000..a1cca274 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_BackgroundFormatting.go @@ -0,0 +1,186 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_BackgroundFormatting struct { + NoFill *CT_NoFillProperties + SolidFill *CT_SolidColorFillProperties + GradFill *CT_GradientFillProperties + BlipFill *CT_BlipFillProperties + PattFill *CT_PatternFillProperties + GrpFill *CT_GroupFillProperties + EffectLst *CT_EffectList + EffectDag *CT_EffectContainer +} + +func NewCT_BackgroundFormatting() *CT_BackgroundFormatting { + ret := &CT_BackgroundFormatting{} + return ret +} + +func (m *CT_BackgroundFormatting) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Name.Local = "a:CT_BackgroundFormatting" + e.EncodeToken(start) + if m.NoFill != nil { + senoFill := xml.StartElement{Name: xml.Name{Local: "a:noFill"}} + e.EncodeElement(m.NoFill, senoFill) + } + if m.SolidFill != nil { + sesolidFill := xml.StartElement{Name: xml.Name{Local: "a:solidFill"}} + e.EncodeElement(m.SolidFill, sesolidFill) + } + if m.GradFill != nil { + segradFill := xml.StartElement{Name: xml.Name{Local: "a:gradFill"}} + e.EncodeElement(m.GradFill, segradFill) + } + if m.BlipFill != nil { + seblipFill := xml.StartElement{Name: xml.Name{Local: "a:blipFill"}} + e.EncodeElement(m.BlipFill, seblipFill) + } + if m.PattFill != nil { + sepattFill := xml.StartElement{Name: xml.Name{Local: "a:pattFill"}} + e.EncodeElement(m.PattFill, sepattFill) + } + if m.GrpFill != nil { + segrpFill := xml.StartElement{Name: xml.Name{Local: "a:grpFill"}} + e.EncodeElement(m.GrpFill, segrpFill) + } + if m.EffectLst != nil { + seeffectLst := xml.StartElement{Name: xml.Name{Local: "a:effectLst"}} + e.EncodeElement(m.EffectLst, seeffectLst) + } + if m.EffectDag != nil { + seeffectDag := xml.StartElement{Name: xml.Name{Local: "a:effectDag"}} + e.EncodeElement(m.EffectDag, seeffectDag) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_BackgroundFormatting) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_BackgroundFormatting: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "noFill"}: + m.NoFill = NewCT_NoFillProperties() + if err := d.DecodeElement(m.NoFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "solidFill"}: + m.SolidFill = NewCT_SolidColorFillProperties() + if err := d.DecodeElement(m.SolidFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "gradFill"}: + m.GradFill = NewCT_GradientFillProperties() + if err := d.DecodeElement(m.GradFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blipFill"}: + m.BlipFill = NewCT_BlipFillProperties() + if err := d.DecodeElement(m.BlipFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "pattFill"}: + m.PattFill = NewCT_PatternFillProperties() + if err := d.DecodeElement(m.PattFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "grpFill"}: + m.GrpFill = NewCT_GroupFillProperties() + if err := d.DecodeElement(m.GrpFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "effectLst"}: + m.EffectLst = NewCT_EffectList() + if err := d.DecodeElement(m.EffectLst, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "effectDag"}: + m.EffectDag = NewCT_EffectContainer() + if err := d.DecodeElement(m.EffectDag, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_BackgroundFormatting %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_BackgroundFormatting + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_BackgroundFormatting and its children +func (m *CT_BackgroundFormatting) Validate() error { + return m.ValidateWithPath("CT_BackgroundFormatting") +} + +// ValidateWithPath validates the CT_BackgroundFormatting and its children, prefixing error messages with path +func (m *CT_BackgroundFormatting) ValidateWithPath(path string) error { + if m.NoFill != nil { + if err := m.NoFill.ValidateWithPath(path + "/NoFill"); err != nil { + return err + } + } + if m.SolidFill != nil { + if err := m.SolidFill.ValidateWithPath(path + "/SolidFill"); err != nil { + return err + } + } + if m.GradFill != nil { + if err := m.GradFill.ValidateWithPath(path + "/GradFill"); err != nil { + return err + } + } + if m.BlipFill != nil { + if err := m.BlipFill.ValidateWithPath(path + "/BlipFill"); err != nil { + return err + } + } + if m.PattFill != nil { + if err := m.PattFill.ValidateWithPath(path + "/PattFill"); err != nil { + return err + } + } + if m.GrpFill != nil { + if err := m.GrpFill.ValidateWithPath(path + "/GrpFill"); err != nil { + return err + } + } + if m.EffectLst != nil { + if err := m.EffectLst.ValidateWithPath(path + "/EffectLst"); err != nil { + return err + } + } + if m.EffectDag != nil { + if err := m.EffectDag.ValidateWithPath(path + "/EffectDag"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_BaseStyles.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_BaseStyles.go new file mode 100644 index 00000000..73fd06f0 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_BaseStyles.go @@ -0,0 +1,116 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_BaseStyles struct { + ClrScheme *CT_ColorScheme + FontScheme *CT_FontScheme + FmtScheme *CT_StyleMatrix + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_BaseStyles() *CT_BaseStyles { + ret := &CT_BaseStyles{} + ret.ClrScheme = NewCT_ColorScheme() + ret.FontScheme = NewCT_FontScheme() + ret.FmtScheme = NewCT_StyleMatrix() + return ret +} + +func (m *CT_BaseStyles) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + seclrScheme := xml.StartElement{Name: xml.Name{Local: "a:clrScheme"}} + e.EncodeElement(m.ClrScheme, seclrScheme) + sefontScheme := xml.StartElement{Name: xml.Name{Local: "a:fontScheme"}} + e.EncodeElement(m.FontScheme, sefontScheme) + sefmtScheme := xml.StartElement{Name: xml.Name{Local: "a:fmtScheme"}} + e.EncodeElement(m.FmtScheme, sefmtScheme) + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_BaseStyles) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ClrScheme = NewCT_ColorScheme() + m.FontScheme = NewCT_FontScheme() + m.FmtScheme = NewCT_StyleMatrix() +lCT_BaseStyles: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "clrScheme"}: + if err := d.DecodeElement(m.ClrScheme, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "fontScheme"}: + if err := d.DecodeElement(m.FontScheme, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "fmtScheme"}: + if err := d.DecodeElement(m.FmtScheme, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_BaseStyles %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_BaseStyles + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_BaseStyles and its children +func (m *CT_BaseStyles) Validate() error { + return m.ValidateWithPath("CT_BaseStyles") +} + +// ValidateWithPath validates the CT_BaseStyles and its children, prefixing error messages with path +func (m *CT_BaseStyles) ValidateWithPath(path string) error { + if err := m.ClrScheme.ValidateWithPath(path + "/ClrScheme"); err != nil { + return err + } + if err := m.FontScheme.ValidateWithPath(path + "/FontScheme"); err != nil { + return err + } + if err := m.FmtScheme.ValidateWithPath(path + "/FmtScheme"); err != nil { + return err + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_BaseStylesOverride.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_BaseStylesOverride.go new file mode 100644 index 00000000..ec262322 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_BaseStylesOverride.go @@ -0,0 +1,110 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_BaseStylesOverride struct { + ClrScheme *CT_ColorScheme + FontScheme *CT_FontScheme + FmtScheme *CT_StyleMatrix +} + +func NewCT_BaseStylesOverride() *CT_BaseStylesOverride { + ret := &CT_BaseStylesOverride{} + return ret +} + +func (m *CT_BaseStylesOverride) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.ClrScheme != nil { + seclrScheme := xml.StartElement{Name: xml.Name{Local: "a:clrScheme"}} + e.EncodeElement(m.ClrScheme, seclrScheme) + } + if m.FontScheme != nil { + sefontScheme := xml.StartElement{Name: xml.Name{Local: "a:fontScheme"}} + e.EncodeElement(m.FontScheme, sefontScheme) + } + if m.FmtScheme != nil { + sefmtScheme := xml.StartElement{Name: xml.Name{Local: "a:fmtScheme"}} + e.EncodeElement(m.FmtScheme, sefmtScheme) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_BaseStylesOverride) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_BaseStylesOverride: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "clrScheme"}: + m.ClrScheme = NewCT_ColorScheme() + if err := d.DecodeElement(m.ClrScheme, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "fontScheme"}: + m.FontScheme = NewCT_FontScheme() + if err := d.DecodeElement(m.FontScheme, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "fmtScheme"}: + m.FmtScheme = NewCT_StyleMatrix() + if err := d.DecodeElement(m.FmtScheme, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_BaseStylesOverride %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_BaseStylesOverride + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_BaseStylesOverride and its children +func (m *CT_BaseStylesOverride) Validate() error { + return m.ValidateWithPath("CT_BaseStylesOverride") +} + +// ValidateWithPath validates the CT_BaseStylesOverride and its children, prefixing error messages with path +func (m *CT_BaseStylesOverride) ValidateWithPath(path string) error { + if m.ClrScheme != nil { + if err := m.ClrScheme.ValidateWithPath(path + "/ClrScheme"); err != nil { + return err + } + } + if m.FontScheme != nil { + if err := m.FontScheme.ValidateWithPath(path + "/FontScheme"); err != nil { + return err + } + } + if m.FmtScheme != nil { + if err := m.FmtScheme.ValidateWithPath(path + "/FmtScheme"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Bevel.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Bevel.go new file mode 100644 index 00000000..76103822 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Bevel.go @@ -0,0 +1,114 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" +) + +type CT_Bevel struct { + WAttr *int64 + HAttr *int64 + PrstAttr ST_BevelPresetType +} + +func NewCT_Bevel() *CT_Bevel { + ret := &CT_Bevel{} + return ret +} + +func (m *CT_Bevel) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.WAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w"}, + Value: fmt.Sprintf("%v", *m.WAttr)}) + } + if m.HAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "h"}, + Value: fmt.Sprintf("%v", *m.HAttr)}) + } + if m.PrstAttr != ST_BevelPresetTypeUnset { + attr, err := m.PrstAttr.MarshalXMLAttr(xml.Name{Local: "prst"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Bevel) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "w" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.WAttr = &parsed + continue + } + if attr.Name.Local == "h" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.HAttr = &parsed + continue + } + if attr.Name.Local == "prst" { + m.PrstAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Bevel: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Bevel and its children +func (m *CT_Bevel) Validate() error { + return m.ValidateWithPath("CT_Bevel") +} + +// ValidateWithPath validates the CT_Bevel and its children, prefixing error messages with path +func (m *CT_Bevel) ValidateWithPath(path string) error { + if m.WAttr != nil { + if *m.WAttr < 0 { + return fmt.Errorf("%s/m.WAttr must be >= 0 (have %v)", path, *m.WAttr) + } + if *m.WAttr > 27273042316900 { + return fmt.Errorf("%s/m.WAttr must be <= 27273042316900 (have %v)", path, *m.WAttr) + } + } + if m.HAttr != nil { + if *m.HAttr < 0 { + return fmt.Errorf("%s/m.HAttr must be >= 0 (have %v)", path, *m.HAttr) + } + if *m.HAttr > 27273042316900 { + return fmt.Errorf("%s/m.HAttr must be <= 27273042316900 (have %v)", path, *m.HAttr) + } + } + if err := m.PrstAttr.ValidateWithPath(path + "/PrstAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_BiLevelEffect.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_BiLevelEffect.go new file mode 100644 index 00000000..197ba8e5 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_BiLevelEffect.go @@ -0,0 +1,70 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_BiLevelEffect struct { + ThreshAttr ST_PositiveFixedPercentage +} + +func NewCT_BiLevelEffect() *CT_BiLevelEffect { + ret := &CT_BiLevelEffect{} + return ret +} + +func (m *CT_BiLevelEffect) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "thresh"}, + Value: fmt.Sprintf("%v", m.ThreshAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_BiLevelEffect) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "thresh" { + parsed, err := ParseUnionST_PositiveFixedPercentage(attr.Value) + if err != nil { + return err + } + m.ThreshAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_BiLevelEffect: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_BiLevelEffect and its children +func (m *CT_BiLevelEffect) Validate() error { + return m.ValidateWithPath("CT_BiLevelEffect") +} + +// ValidateWithPath validates the CT_BiLevelEffect and its children, prefixing error messages with path +func (m *CT_BiLevelEffect) ValidateWithPath(path string) error { + if err := m.ThreshAttr.ValidateWithPath(path + "/ThreshAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_BlendEffect.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_BlendEffect.go new file mode 100644 index 00000000..bd52c33b --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_BlendEffect.go @@ -0,0 +1,98 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_BlendEffect struct { + BlendAttr ST_BlendMode + Cont *CT_EffectContainer +} + +func NewCT_BlendEffect() *CT_BlendEffect { + ret := &CT_BlendEffect{} + ret.BlendAttr = ST_BlendMode(1) + ret.Cont = NewCT_EffectContainer() + return ret +} + +func (m *CT_BlendEffect) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.BlendAttr.MarshalXMLAttr(xml.Name{Local: "blend"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + secont := xml.StartElement{Name: xml.Name{Local: "a:cont"}} + e.EncodeElement(m.Cont, secont) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_BlendEffect) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.BlendAttr = ST_BlendMode(1) + m.Cont = NewCT_EffectContainer() + for _, attr := range start.Attr { + if attr.Name.Local == "blend" { + m.BlendAttr.UnmarshalXMLAttr(attr) + continue + } + } +lCT_BlendEffect: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "cont"}: + if err := d.DecodeElement(m.Cont, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_BlendEffect %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_BlendEffect + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_BlendEffect and its children +func (m *CT_BlendEffect) Validate() error { + return m.ValidateWithPath("CT_BlendEffect") +} + +// ValidateWithPath validates the CT_BlendEffect and its children, prefixing error messages with path +func (m *CT_BlendEffect) ValidateWithPath(path string) error { + if m.BlendAttr == ST_BlendModeUnset { + return fmt.Errorf("%s/BlendAttr is a mandatory field", path) + } + if err := m.BlendAttr.ValidateWithPath(path + "/BlendAttr"); err != nil { + return err + } + if err := m.Cont.ValidateWithPath(path + "/Cont"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Blip.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Blip.go new file mode 100644 index 00000000..503fdb91 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Blip.go @@ -0,0 +1,237 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_Blip struct { + CstateAttr ST_BlipCompression + Choice []*CT_BlipChoice + ExtLst *CT_OfficeArtExtensionList + EmbedAttr *string + LinkAttr *string +} + +func NewCT_Blip() *CT_Blip { + ret := &CT_Blip{} + return ret +} + +func (m *CT_Blip) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.CstateAttr != ST_BlipCompressionUnset { + attr, err := m.CstateAttr.MarshalXMLAttr(xml.Name{Local: "cstate"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.EmbedAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "r:embed"}, + Value: fmt.Sprintf("%v", *m.EmbedAttr)}) + } + if m.LinkAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "r:link"}, + Value: fmt.Sprintf("%v", *m.LinkAttr)}) + } + e.EncodeToken(start) + if m.Choice != nil { + for _, c := range m.Choice { + c.MarshalXML(e, xml.StartElement{}) + } + } + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Blip) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Space == "http://schemas.openxmlformats.org/officeDocument/2006/relationships" && attr.Name.Local == "embed" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.EmbedAttr = &parsed + continue + } + if attr.Name.Space == "http://schemas.openxmlformats.org/officeDocument/2006/relationships" && attr.Name.Local == "link" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.LinkAttr = &parsed + continue + } + if attr.Name.Local == "cstate" { + m.CstateAttr.UnmarshalXMLAttr(attr) + continue + } + } +lCT_Blip: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaBiLevel"}: + tmp := NewCT_BlipChoice() + if err := d.DecodeElement(&tmp.AlphaBiLevel, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaCeiling"}: + tmp := NewCT_BlipChoice() + if err := d.DecodeElement(&tmp.AlphaCeiling, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaFloor"}: + tmp := NewCT_BlipChoice() + if err := d.DecodeElement(&tmp.AlphaFloor, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaInv"}: + tmp := NewCT_BlipChoice() + if err := d.DecodeElement(&tmp.AlphaInv, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaMod"}: + tmp := NewCT_BlipChoice() + if err := d.DecodeElement(&tmp.AlphaMod, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaModFix"}: + tmp := NewCT_BlipChoice() + if err := d.DecodeElement(&tmp.AlphaModFix, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaRepl"}: + tmp := NewCT_BlipChoice() + if err := d.DecodeElement(&tmp.AlphaRepl, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "biLevel"}: + tmp := NewCT_BlipChoice() + if err := d.DecodeElement(&tmp.BiLevel, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blur"}: + tmp := NewCT_BlipChoice() + if err := d.DecodeElement(&tmp.Blur, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "clrChange"}: + tmp := NewCT_BlipChoice() + if err := d.DecodeElement(&tmp.ClrChange, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "clrRepl"}: + tmp := NewCT_BlipChoice() + if err := d.DecodeElement(&tmp.ClrRepl, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "duotone"}: + tmp := NewCT_BlipChoice() + if err := d.DecodeElement(&tmp.Duotone, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "fillOverlay"}: + tmp := NewCT_BlipChoice() + if err := d.DecodeElement(&tmp.FillOverlay, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "grayscl"}: + tmp := NewCT_BlipChoice() + if err := d.DecodeElement(&tmp.Grayscl, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hsl"}: + tmp := NewCT_BlipChoice() + if err := d.DecodeElement(&tmp.Hsl, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lum"}: + tmp := NewCT_BlipChoice() + if err := d.DecodeElement(&tmp.Lum, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "tint"}: + tmp := NewCT_BlipChoice() + if err := d.DecodeElement(&tmp.Tint, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_Blip %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Blip + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Blip and its children +func (m *CT_Blip) Validate() error { + return m.ValidateWithPath("CT_Blip") +} + +// ValidateWithPath validates the CT_Blip and its children, prefixing error messages with path +func (m *CT_Blip) ValidateWithPath(path string) error { + if err := m.CstateAttr.ValidateWithPath(path + "/CstateAttr"); err != nil { + return err + } + for i, v := range m.Choice { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Choice[%d]", path, i)); err != nil { + return err + } + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_BlipChoice.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_BlipChoice.go new file mode 100644 index 00000000..934c4a1c --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_BlipChoice.go @@ -0,0 +1,370 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_BlipChoice struct { + AlphaBiLevel []*CT_AlphaBiLevelEffect + AlphaCeiling []*CT_AlphaCeilingEffect + AlphaFloor []*CT_AlphaFloorEffect + AlphaInv []*CT_AlphaInverseEffect + AlphaMod []*CT_AlphaModulateEffect + AlphaModFix []*CT_AlphaModulateFixedEffect + AlphaRepl []*CT_AlphaReplaceEffect + BiLevel []*CT_BiLevelEffect + Blur []*CT_BlurEffect + ClrChange []*CT_ColorChangeEffect + ClrRepl []*CT_ColorReplaceEffect + Duotone []*CT_DuotoneEffect + FillOverlay []*CT_FillOverlayEffect + Grayscl []*CT_GrayscaleEffect + Hsl []*CT_HSLEffect + Lum []*CT_LuminanceEffect + Tint []*CT_TintEffect +} + +func NewCT_BlipChoice() *CT_BlipChoice { + ret := &CT_BlipChoice{} + return ret +} + +func (m *CT_BlipChoice) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.AlphaBiLevel != nil { + sealphaBiLevel := xml.StartElement{Name: xml.Name{Local: "a:alphaBiLevel"}} + for _, c := range m.AlphaBiLevel { + e.EncodeElement(c, sealphaBiLevel) + } + } + if m.AlphaCeiling != nil { + sealphaCeiling := xml.StartElement{Name: xml.Name{Local: "a:alphaCeiling"}} + for _, c := range m.AlphaCeiling { + e.EncodeElement(c, sealphaCeiling) + } + } + if m.AlphaFloor != nil { + sealphaFloor := xml.StartElement{Name: xml.Name{Local: "a:alphaFloor"}} + for _, c := range m.AlphaFloor { + e.EncodeElement(c, sealphaFloor) + } + } + if m.AlphaInv != nil { + sealphaInv := xml.StartElement{Name: xml.Name{Local: "a:alphaInv"}} + for _, c := range m.AlphaInv { + e.EncodeElement(c, sealphaInv) + } + } + if m.AlphaMod != nil { + sealphaMod := xml.StartElement{Name: xml.Name{Local: "a:alphaMod"}} + for _, c := range m.AlphaMod { + e.EncodeElement(c, sealphaMod) + } + } + if m.AlphaModFix != nil { + sealphaModFix := xml.StartElement{Name: xml.Name{Local: "a:alphaModFix"}} + for _, c := range m.AlphaModFix { + e.EncodeElement(c, sealphaModFix) + } + } + if m.AlphaRepl != nil { + sealphaRepl := xml.StartElement{Name: xml.Name{Local: "a:alphaRepl"}} + for _, c := range m.AlphaRepl { + e.EncodeElement(c, sealphaRepl) + } + } + if m.BiLevel != nil { + sebiLevel := xml.StartElement{Name: xml.Name{Local: "a:biLevel"}} + for _, c := range m.BiLevel { + e.EncodeElement(c, sebiLevel) + } + } + if m.Blur != nil { + seblur := xml.StartElement{Name: xml.Name{Local: "a:blur"}} + for _, c := range m.Blur { + e.EncodeElement(c, seblur) + } + } + if m.ClrChange != nil { + seclrChange := xml.StartElement{Name: xml.Name{Local: "a:clrChange"}} + for _, c := range m.ClrChange { + e.EncodeElement(c, seclrChange) + } + } + if m.ClrRepl != nil { + seclrRepl := xml.StartElement{Name: xml.Name{Local: "a:clrRepl"}} + for _, c := range m.ClrRepl { + e.EncodeElement(c, seclrRepl) + } + } + if m.Duotone != nil { + seduotone := xml.StartElement{Name: xml.Name{Local: "a:duotone"}} + for _, c := range m.Duotone { + e.EncodeElement(c, seduotone) + } + } + if m.FillOverlay != nil { + sefillOverlay := xml.StartElement{Name: xml.Name{Local: "a:fillOverlay"}} + for _, c := range m.FillOverlay { + e.EncodeElement(c, sefillOverlay) + } + } + if m.Grayscl != nil { + segrayscl := xml.StartElement{Name: xml.Name{Local: "a:grayscl"}} + for _, c := range m.Grayscl { + e.EncodeElement(c, segrayscl) + } + } + if m.Hsl != nil { + sehsl := xml.StartElement{Name: xml.Name{Local: "a:hsl"}} + for _, c := range m.Hsl { + e.EncodeElement(c, sehsl) + } + } + if m.Lum != nil { + selum := xml.StartElement{Name: xml.Name{Local: "a:lum"}} + for _, c := range m.Lum { + e.EncodeElement(c, selum) + } + } + if m.Tint != nil { + setint := xml.StartElement{Name: xml.Name{Local: "a:tint"}} + for _, c := range m.Tint { + e.EncodeElement(c, setint) + } + } + return nil +} + +func (m *CT_BlipChoice) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_BlipChoice: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaBiLevel"}: + tmp := NewCT_AlphaBiLevelEffect() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.AlphaBiLevel = append(m.AlphaBiLevel, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaCeiling"}: + tmp := NewCT_AlphaCeilingEffect() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.AlphaCeiling = append(m.AlphaCeiling, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaFloor"}: + tmp := NewCT_AlphaFloorEffect() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.AlphaFloor = append(m.AlphaFloor, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaInv"}: + tmp := NewCT_AlphaInverseEffect() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.AlphaInv = append(m.AlphaInv, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaMod"}: + tmp := NewCT_AlphaModulateEffect() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.AlphaMod = append(m.AlphaMod, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaModFix"}: + tmp := NewCT_AlphaModulateFixedEffect() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.AlphaModFix = append(m.AlphaModFix, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaRepl"}: + tmp := NewCT_AlphaReplaceEffect() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.AlphaRepl = append(m.AlphaRepl, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "biLevel"}: + tmp := NewCT_BiLevelEffect() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.BiLevel = append(m.BiLevel, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blur"}: + tmp := NewCT_BlurEffect() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Blur = append(m.Blur, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "clrChange"}: + tmp := NewCT_ColorChangeEffect() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.ClrChange = append(m.ClrChange, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "clrRepl"}: + tmp := NewCT_ColorReplaceEffect() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.ClrRepl = append(m.ClrRepl, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "duotone"}: + tmp := NewCT_DuotoneEffect() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Duotone = append(m.Duotone, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "fillOverlay"}: + tmp := NewCT_FillOverlayEffect() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.FillOverlay = append(m.FillOverlay, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "grayscl"}: + tmp := NewCT_GrayscaleEffect() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Grayscl = append(m.Grayscl, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hsl"}: + tmp := NewCT_HSLEffect() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Hsl = append(m.Hsl, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lum"}: + tmp := NewCT_LuminanceEffect() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Lum = append(m.Lum, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "tint"}: + tmp := NewCT_TintEffect() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Tint = append(m.Tint, tmp) + default: + gooxml.Log("skipping unsupported element on CT_BlipChoice %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_BlipChoice + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_BlipChoice and its children +func (m *CT_BlipChoice) Validate() error { + return m.ValidateWithPath("CT_BlipChoice") +} + +// ValidateWithPath validates the CT_BlipChoice and its children, prefixing error messages with path +func (m *CT_BlipChoice) ValidateWithPath(path string) error { + for i, v := range m.AlphaBiLevel { + if err := v.ValidateWithPath(fmt.Sprintf("%s/AlphaBiLevel[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.AlphaCeiling { + if err := v.ValidateWithPath(fmt.Sprintf("%s/AlphaCeiling[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.AlphaFloor { + if err := v.ValidateWithPath(fmt.Sprintf("%s/AlphaFloor[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.AlphaInv { + if err := v.ValidateWithPath(fmt.Sprintf("%s/AlphaInv[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.AlphaMod { + if err := v.ValidateWithPath(fmt.Sprintf("%s/AlphaMod[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.AlphaModFix { + if err := v.ValidateWithPath(fmt.Sprintf("%s/AlphaModFix[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.AlphaRepl { + if err := v.ValidateWithPath(fmt.Sprintf("%s/AlphaRepl[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.BiLevel { + if err := v.ValidateWithPath(fmt.Sprintf("%s/BiLevel[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.Blur { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Blur[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.ClrChange { + if err := v.ValidateWithPath(fmt.Sprintf("%s/ClrChange[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.ClrRepl { + if err := v.ValidateWithPath(fmt.Sprintf("%s/ClrRepl[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.Duotone { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Duotone[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.FillOverlay { + if err := v.ValidateWithPath(fmt.Sprintf("%s/FillOverlay[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.Grayscl { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Grayscl[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.Hsl { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Hsl[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.Lum { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Lum[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.Tint { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Tint[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_BlipFillProperties.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_BlipFillProperties.go new file mode 100644 index 00000000..3b34da7f --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_BlipFillProperties.go @@ -0,0 +1,156 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type CT_BlipFillProperties struct { + DpiAttr *uint32 + RotWithShapeAttr *bool + Blip *CT_Blip + SrcRect *CT_RelativeRect + Tile *CT_TileInfoProperties + Stretch *CT_StretchInfoProperties +} + +func NewCT_BlipFillProperties() *CT_BlipFillProperties { + ret := &CT_BlipFillProperties{} + return ret +} + +func (m *CT_BlipFillProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.DpiAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "dpi"}, + Value: fmt.Sprintf("%v", *m.DpiAttr)}) + } + if m.RotWithShapeAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "rotWithShape"}, + Value: fmt.Sprintf("%d", b2i(*m.RotWithShapeAttr))}) + } + e.EncodeToken(start) + if m.Blip != nil { + seblip := xml.StartElement{Name: xml.Name{Local: "a:blip"}} + e.EncodeElement(m.Blip, seblip) + } + if m.SrcRect != nil { + sesrcRect := xml.StartElement{Name: xml.Name{Local: "a:srcRect"}} + e.EncodeElement(m.SrcRect, sesrcRect) + } + if m.Tile != nil { + setile := xml.StartElement{Name: xml.Name{Local: "a:tile"}} + e.EncodeElement(m.Tile, setile) + } + if m.Stretch != nil { + sestretch := xml.StartElement{Name: xml.Name{Local: "a:stretch"}} + e.EncodeElement(m.Stretch, sestretch) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_BlipFillProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "dpi" { + parsed, err := strconv.ParseUint(attr.Value, 10, 32) + if err != nil { + return err + } + pt := uint32(parsed) + m.DpiAttr = &pt + continue + } + if attr.Name.Local == "rotWithShape" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.RotWithShapeAttr = &parsed + continue + } + } +lCT_BlipFillProperties: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blip"}: + m.Blip = NewCT_Blip() + if err := d.DecodeElement(m.Blip, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "srcRect"}: + m.SrcRect = NewCT_RelativeRect() + if err := d.DecodeElement(m.SrcRect, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "tile"}: + m.Tile = NewCT_TileInfoProperties() + if err := d.DecodeElement(m.Tile, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "stretch"}: + m.Stretch = NewCT_StretchInfoProperties() + if err := d.DecodeElement(m.Stretch, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_BlipFillProperties %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_BlipFillProperties + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_BlipFillProperties and its children +func (m *CT_BlipFillProperties) Validate() error { + return m.ValidateWithPath("CT_BlipFillProperties") +} + +// ValidateWithPath validates the CT_BlipFillProperties and its children, prefixing error messages with path +func (m *CT_BlipFillProperties) ValidateWithPath(path string) error { + if m.Blip != nil { + if err := m.Blip.ValidateWithPath(path + "/Blip"); err != nil { + return err + } + } + if m.SrcRect != nil { + if err := m.SrcRect.ValidateWithPath(path + "/SrcRect"); err != nil { + return err + } + } + if m.Tile != nil { + if err := m.Tile.ValidateWithPath(path + "/Tile"); err != nil { + return err + } + } + if m.Stretch != nil { + if err := m.Stretch.ValidateWithPath(path + "/Stretch"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_BlurEffect.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_BlurEffect.go new file mode 100644 index 00000000..cf63bbe6 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_BlurEffect.go @@ -0,0 +1,91 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" +) + +type CT_BlurEffect struct { + RadAttr *int64 + GrowAttr *bool +} + +func NewCT_BlurEffect() *CT_BlurEffect { + ret := &CT_BlurEffect{} + return ret +} + +func (m *CT_BlurEffect) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.RadAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "rad"}, + Value: fmt.Sprintf("%v", *m.RadAttr)}) + } + if m.GrowAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "grow"}, + Value: fmt.Sprintf("%d", b2i(*m.GrowAttr))}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_BlurEffect) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "rad" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.RadAttr = &parsed + continue + } + if attr.Name.Local == "grow" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.GrowAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_BlurEffect: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_BlurEffect and its children +func (m *CT_BlurEffect) Validate() error { + return m.ValidateWithPath("CT_BlurEffect") +} + +// ValidateWithPath validates the CT_BlurEffect and its children, prefixing error messages with path +func (m *CT_BlurEffect) ValidateWithPath(path string) error { + if m.RadAttr != nil { + if *m.RadAttr < 0 { + return fmt.Errorf("%s/m.RadAttr must be >= 0 (have %v)", path, *m.RadAttr) + } + if *m.RadAttr > 27273042316900 { + return fmt.Errorf("%s/m.RadAttr must be <= 27273042316900 (have %v)", path, *m.RadAttr) + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Boolean.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Boolean.go new file mode 100644 index 00000000..abf5e65d --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Boolean.go @@ -0,0 +1,76 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_Boolean struct { + ValAttr *sharedTypes.ST_OnOff +} + +func NewCT_Boolean() *CT_Boolean { + ret := &CT_Boolean{} + return ret +} + +func (m *CT_Boolean) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.ValAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "val"}, + Value: fmt.Sprintf("%v", *m.ValAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Boolean) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.ValAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Boolean: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Boolean and its children +func (m *CT_Boolean) Validate() error { + return m.ValidateWithPath("CT_Boolean") +} + +// ValidateWithPath validates the CT_Boolean and its children, prefixing error messages with path +func (m *CT_Boolean) ValidateWithPath(path string) error { + if m.ValAttr != nil { + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Camera.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Camera.go new file mode 100644 index 00000000..6132a822 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Camera.go @@ -0,0 +1,142 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type CT_Camera struct { + PrstAttr ST_PresetCameraType + FovAttr *int32 + ZoomAttr *ST_PositivePercentage + Rot *CT_SphereCoords +} + +func NewCT_Camera() *CT_Camera { + ret := &CT_Camera{} + ret.PrstAttr = ST_PresetCameraType(1) + return ret +} + +func (m *CT_Camera) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.PrstAttr.MarshalXMLAttr(xml.Name{Local: "prst"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + if m.FovAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "fov"}, + Value: fmt.Sprintf("%v", *m.FovAttr)}) + } + if m.ZoomAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "zoom"}, + Value: fmt.Sprintf("%v", *m.ZoomAttr)}) + } + e.EncodeToken(start) + if m.Rot != nil { + serot := xml.StartElement{Name: xml.Name{Local: "a:rot"}} + e.EncodeElement(m.Rot, serot) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Camera) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.PrstAttr = ST_PresetCameraType(1) + for _, attr := range start.Attr { + if attr.Name.Local == "prst" { + m.PrstAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "fov" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + pt := int32(parsed) + m.FovAttr = &pt + continue + } + if attr.Name.Local == "zoom" { + parsed, err := ParseUnionST_PositivePercentage(attr.Value) + if err != nil { + return err + } + m.ZoomAttr = &parsed + continue + } + } +lCT_Camera: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "rot"}: + m.Rot = NewCT_SphereCoords() + if err := d.DecodeElement(m.Rot, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_Camera %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Camera + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Camera and its children +func (m *CT_Camera) Validate() error { + return m.ValidateWithPath("CT_Camera") +} + +// ValidateWithPath validates the CT_Camera and its children, prefixing error messages with path +func (m *CT_Camera) ValidateWithPath(path string) error { + if m.PrstAttr == ST_PresetCameraTypeUnset { + return fmt.Errorf("%s/PrstAttr is a mandatory field", path) + } + if err := m.PrstAttr.ValidateWithPath(path + "/PrstAttr"); err != nil { + return err + } + if m.FovAttr != nil { + if *m.FovAttr < 0 { + return fmt.Errorf("%s/m.FovAttr must be >= 0 (have %v)", path, *m.FovAttr) + } + if *m.FovAttr > 10800000 { + return fmt.Errorf("%s/m.FovAttr must be <= 10800000 (have %v)", path, *m.FovAttr) + } + } + if m.ZoomAttr != nil { + if err := m.ZoomAttr.ValidateWithPath(path + "/ZoomAttr"); err != nil { + return err + } + } + if m.Rot != nil { + if err := m.Rot.ValidateWithPath(path + "/Rot"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Cell3D.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Cell3D.go new file mode 100644 index 00000000..ad989966 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Cell3D.go @@ -0,0 +1,124 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_Cell3D struct { + PrstMaterialAttr ST_PresetMaterialType + Bevel *CT_Bevel + LightRig *CT_LightRig + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_Cell3D() *CT_Cell3D { + ret := &CT_Cell3D{} + ret.Bevel = NewCT_Bevel() + return ret +} + +func (m *CT_Cell3D) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.PrstMaterialAttr != ST_PresetMaterialTypeUnset { + attr, err := m.PrstMaterialAttr.MarshalXMLAttr(xml.Name{Local: "prstMaterial"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + sebevel := xml.StartElement{Name: xml.Name{Local: "a:bevel"}} + e.EncodeElement(m.Bevel, sebevel) + if m.LightRig != nil { + selightRig := xml.StartElement{Name: xml.Name{Local: "a:lightRig"}} + e.EncodeElement(m.LightRig, selightRig) + } + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Cell3D) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.Bevel = NewCT_Bevel() + for _, attr := range start.Attr { + if attr.Name.Local == "prstMaterial" { + m.PrstMaterialAttr.UnmarshalXMLAttr(attr) + continue + } + } +lCT_Cell3D: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "bevel"}: + if err := d.DecodeElement(m.Bevel, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lightRig"}: + m.LightRig = NewCT_LightRig() + if err := d.DecodeElement(m.LightRig, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_Cell3D %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Cell3D + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Cell3D and its children +func (m *CT_Cell3D) Validate() error { + return m.ValidateWithPath("CT_Cell3D") +} + +// ValidateWithPath validates the CT_Cell3D and its children, prefixing error messages with path +func (m *CT_Cell3D) ValidateWithPath(path string) error { + if err := m.PrstMaterialAttr.ValidateWithPath(path + "/PrstMaterialAttr"); err != nil { + return err + } + if err := m.Bevel.ValidateWithPath(path + "/Bevel"); err != nil { + return err + } + if m.LightRig != nil { + if err := m.LightRig.ValidateWithPath(path + "/LightRig"); err != nil { + return err + } + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ClipboardStyleSheet.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ClipboardStyleSheet.go new file mode 100644 index 00000000..c0f7733e --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ClipboardStyleSheet.go @@ -0,0 +1,90 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_ClipboardStyleSheet struct { + ThemeElements *CT_BaseStyles + ClrMap *CT_ColorMapping +} + +func NewCT_ClipboardStyleSheet() *CT_ClipboardStyleSheet { + ret := &CT_ClipboardStyleSheet{} + ret.ThemeElements = NewCT_BaseStyles() + ret.ClrMap = NewCT_ColorMapping() + return ret +} + +func (m *CT_ClipboardStyleSheet) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Name.Local = "a:CT_ClipboardStyleSheet" + e.EncodeToken(start) + sethemeElements := xml.StartElement{Name: xml.Name{Local: "a:themeElements"}} + e.EncodeElement(m.ThemeElements, sethemeElements) + seclrMap := xml.StartElement{Name: xml.Name{Local: "a:clrMap"}} + e.EncodeElement(m.ClrMap, seclrMap) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_ClipboardStyleSheet) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ThemeElements = NewCT_BaseStyles() + m.ClrMap = NewCT_ColorMapping() +lCT_ClipboardStyleSheet: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "themeElements"}: + if err := d.DecodeElement(m.ThemeElements, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "clrMap"}: + if err := d.DecodeElement(m.ClrMap, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_ClipboardStyleSheet %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_ClipboardStyleSheet + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_ClipboardStyleSheet and its children +func (m *CT_ClipboardStyleSheet) Validate() error { + return m.ValidateWithPath("CT_ClipboardStyleSheet") +} + +// ValidateWithPath validates the CT_ClipboardStyleSheet and its children, prefixing error messages with path +func (m *CT_ClipboardStyleSheet) ValidateWithPath(path string) error { + if err := m.ThemeElements.ValidateWithPath(path + "/ThemeElements"); err != nil { + return err + } + if err := m.ClrMap.ValidateWithPath(path + "/ClrMap"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Color.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Color.go new file mode 100644 index 00000000..46f4a40a --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Color.go @@ -0,0 +1,155 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_Color struct { + ScrgbClr *CT_ScRgbColor + SrgbClr *CT_SRgbColor + HslClr *CT_HslColor + SysClr *CT_SystemColor + SchemeClr *CT_SchemeColor + PrstClr *CT_PresetColor +} + +func NewCT_Color() *CT_Color { + ret := &CT_Color{} + return ret +} + +func (m *CT_Color) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.ScrgbClr != nil { + sescrgbClr := xml.StartElement{Name: xml.Name{Local: "a:scrgbClr"}} + e.EncodeElement(m.ScrgbClr, sescrgbClr) + } + if m.SrgbClr != nil { + sesrgbClr := xml.StartElement{Name: xml.Name{Local: "a:srgbClr"}} + e.EncodeElement(m.SrgbClr, sesrgbClr) + } + if m.HslClr != nil { + sehslClr := xml.StartElement{Name: xml.Name{Local: "a:hslClr"}} + e.EncodeElement(m.HslClr, sehslClr) + } + if m.SysClr != nil { + sesysClr := xml.StartElement{Name: xml.Name{Local: "a:sysClr"}} + e.EncodeElement(m.SysClr, sesysClr) + } + if m.SchemeClr != nil { + seschemeClr := xml.StartElement{Name: xml.Name{Local: "a:schemeClr"}} + e.EncodeElement(m.SchemeClr, seschemeClr) + } + if m.PrstClr != nil { + seprstClr := xml.StartElement{Name: xml.Name{Local: "a:prstClr"}} + e.EncodeElement(m.PrstClr, seprstClr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Color) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_Color: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "scrgbClr"}: + m.ScrgbClr = NewCT_ScRgbColor() + if err := d.DecodeElement(m.ScrgbClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "srgbClr"}: + m.SrgbClr = NewCT_SRgbColor() + if err := d.DecodeElement(m.SrgbClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hslClr"}: + m.HslClr = NewCT_HslColor() + if err := d.DecodeElement(m.HslClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "sysClr"}: + m.SysClr = NewCT_SystemColor() + if err := d.DecodeElement(m.SysClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "schemeClr"}: + m.SchemeClr = NewCT_SchemeColor() + if err := d.DecodeElement(m.SchemeClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "prstClr"}: + m.PrstClr = NewCT_PresetColor() + if err := d.DecodeElement(m.PrstClr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_Color %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Color + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Color and its children +func (m *CT_Color) Validate() error { + return m.ValidateWithPath("CT_Color") +} + +// ValidateWithPath validates the CT_Color and its children, prefixing error messages with path +func (m *CT_Color) ValidateWithPath(path string) error { + if m.ScrgbClr != nil { + if err := m.ScrgbClr.ValidateWithPath(path + "/ScrgbClr"); err != nil { + return err + } + } + if m.SrgbClr != nil { + if err := m.SrgbClr.ValidateWithPath(path + "/SrgbClr"); err != nil { + return err + } + } + if m.HslClr != nil { + if err := m.HslClr.ValidateWithPath(path + "/HslClr"); err != nil { + return err + } + } + if m.SysClr != nil { + if err := m.SysClr.ValidateWithPath(path + "/SysClr"); err != nil { + return err + } + } + if m.SchemeClr != nil { + if err := m.SchemeClr.ValidateWithPath(path + "/SchemeClr"); err != nil { + return err + } + } + if m.PrstClr != nil { + if err := m.PrstClr.ValidateWithPath(path + "/PrstClr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ColorChangeEffect.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ColorChangeEffect.go new file mode 100644 index 00000000..0896033c --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ColorChangeEffect.go @@ -0,0 +1,106 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type CT_ColorChangeEffect struct { + UseAAttr *bool + ClrFrom *CT_Color + ClrTo *CT_Color +} + +func NewCT_ColorChangeEffect() *CT_ColorChangeEffect { + ret := &CT_ColorChangeEffect{} + ret.ClrFrom = NewCT_Color() + ret.ClrTo = NewCT_Color() + return ret +} + +func (m *CT_ColorChangeEffect) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.UseAAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "useA"}, + Value: fmt.Sprintf("%d", b2i(*m.UseAAttr))}) + } + e.EncodeToken(start) + seclrFrom := xml.StartElement{Name: xml.Name{Local: "a:clrFrom"}} + e.EncodeElement(m.ClrFrom, seclrFrom) + seclrTo := xml.StartElement{Name: xml.Name{Local: "a:clrTo"}} + e.EncodeElement(m.ClrTo, seclrTo) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_ColorChangeEffect) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ClrFrom = NewCT_Color() + m.ClrTo = NewCT_Color() + for _, attr := range start.Attr { + if attr.Name.Local == "useA" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.UseAAttr = &parsed + continue + } + } +lCT_ColorChangeEffect: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "clrFrom"}: + if err := d.DecodeElement(m.ClrFrom, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "clrTo"}: + if err := d.DecodeElement(m.ClrTo, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_ColorChangeEffect %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_ColorChangeEffect + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_ColorChangeEffect and its children +func (m *CT_ColorChangeEffect) Validate() error { + return m.ValidateWithPath("CT_ColorChangeEffect") +} + +// ValidateWithPath validates the CT_ColorChangeEffect and its children, prefixing error messages with path +func (m *CT_ColorChangeEffect) ValidateWithPath(path string) error { + if err := m.ClrFrom.ValidateWithPath(path + "/ClrFrom"); err != nil { + return err + } + if err := m.ClrTo.ValidateWithPath(path + "/ClrTo"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ColorMRU.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ColorMRU.go new file mode 100644 index 00000000..da1f82ef --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ColorMRU.go @@ -0,0 +1,120 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_ColorMRU struct { + EG_ColorChoice []*EG_ColorChoice +} + +func NewCT_ColorMRU() *CT_ColorMRU { + ret := &CT_ColorMRU{} + return ret +} + +func (m *CT_ColorMRU) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Name.Local = "a:CT_ColorMRU" + e.EncodeToken(start) + if m.EG_ColorChoice != nil { + for _, c := range m.EG_ColorChoice { + c.MarshalXML(e, xml.StartElement{}) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_ColorMRU) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_ColorMRU: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "scrgbClr"}: + tmpcolorchoice := NewEG_ColorChoice() + tmpcolorchoice.ScrgbClr = NewCT_ScRgbColor() + if err := d.DecodeElement(tmpcolorchoice.ScrgbClr, &el); err != nil { + return err + } + m.EG_ColorChoice = append(m.EG_ColorChoice, tmpcolorchoice) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "srgbClr"}: + tmpcolorchoice := NewEG_ColorChoice() + tmpcolorchoice.SrgbClr = NewCT_SRgbColor() + if err := d.DecodeElement(tmpcolorchoice.SrgbClr, &el); err != nil { + return err + } + m.EG_ColorChoice = append(m.EG_ColorChoice, tmpcolorchoice) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hslClr"}: + tmpcolorchoice := NewEG_ColorChoice() + tmpcolorchoice.HslClr = NewCT_HslColor() + if err := d.DecodeElement(tmpcolorchoice.HslClr, &el); err != nil { + return err + } + m.EG_ColorChoice = append(m.EG_ColorChoice, tmpcolorchoice) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "sysClr"}: + tmpcolorchoice := NewEG_ColorChoice() + tmpcolorchoice.SysClr = NewCT_SystemColor() + if err := d.DecodeElement(tmpcolorchoice.SysClr, &el); err != nil { + return err + } + m.EG_ColorChoice = append(m.EG_ColorChoice, tmpcolorchoice) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "schemeClr"}: + tmpcolorchoice := NewEG_ColorChoice() + tmpcolorchoice.SchemeClr = NewCT_SchemeColor() + if err := d.DecodeElement(tmpcolorchoice.SchemeClr, &el); err != nil { + return err + } + m.EG_ColorChoice = append(m.EG_ColorChoice, tmpcolorchoice) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "prstClr"}: + tmpcolorchoice := NewEG_ColorChoice() + tmpcolorchoice.PrstClr = NewCT_PresetColor() + if err := d.DecodeElement(tmpcolorchoice.PrstClr, &el); err != nil { + return err + } + m.EG_ColorChoice = append(m.EG_ColorChoice, tmpcolorchoice) + default: + gooxml.Log("skipping unsupported element on CT_ColorMRU %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_ColorMRU + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_ColorMRU and its children +func (m *CT_ColorMRU) Validate() error { + return m.ValidateWithPath("CT_ColorMRU") +} + +// ValidateWithPath validates the CT_ColorMRU and its children, prefixing error messages with path +func (m *CT_ColorMRU) ValidateWithPath(path string) error { + for i, v := range m.EG_ColorChoice { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_ColorChoice[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ColorMapping.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ColorMapping.go new file mode 100644 index 00000000..fda31c43 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ColorMapping.go @@ -0,0 +1,299 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_ColorMapping struct { + Bg1Attr ST_ColorSchemeIndex + Tx1Attr ST_ColorSchemeIndex + Bg2Attr ST_ColorSchemeIndex + Tx2Attr ST_ColorSchemeIndex + Accent1Attr ST_ColorSchemeIndex + Accent2Attr ST_ColorSchemeIndex + Accent3Attr ST_ColorSchemeIndex + Accent4Attr ST_ColorSchemeIndex + Accent5Attr ST_ColorSchemeIndex + Accent6Attr ST_ColorSchemeIndex + HlinkAttr ST_ColorSchemeIndex + FolHlinkAttr ST_ColorSchemeIndex + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_ColorMapping() *CT_ColorMapping { + ret := &CT_ColorMapping{} + ret.Bg1Attr = ST_ColorSchemeIndex(1) + ret.Tx1Attr = ST_ColorSchemeIndex(1) + ret.Bg2Attr = ST_ColorSchemeIndex(1) + ret.Tx2Attr = ST_ColorSchemeIndex(1) + ret.Accent1Attr = ST_ColorSchemeIndex(1) + ret.Accent2Attr = ST_ColorSchemeIndex(1) + ret.Accent3Attr = ST_ColorSchemeIndex(1) + ret.Accent4Attr = ST_ColorSchemeIndex(1) + ret.Accent5Attr = ST_ColorSchemeIndex(1) + ret.Accent6Attr = ST_ColorSchemeIndex(1) + ret.HlinkAttr = ST_ColorSchemeIndex(1) + ret.FolHlinkAttr = ST_ColorSchemeIndex(1) + return ret +} + +func (m *CT_ColorMapping) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.Bg1Attr.MarshalXMLAttr(xml.Name{Local: "bg1"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + attr, err = m.Tx1Attr.MarshalXMLAttr(xml.Name{Local: "tx1"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + attr, err = m.Bg2Attr.MarshalXMLAttr(xml.Name{Local: "bg2"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + attr, err = m.Tx2Attr.MarshalXMLAttr(xml.Name{Local: "tx2"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + attr, err = m.Accent1Attr.MarshalXMLAttr(xml.Name{Local: "accent1"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + attr, err = m.Accent2Attr.MarshalXMLAttr(xml.Name{Local: "accent2"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + attr, err = m.Accent3Attr.MarshalXMLAttr(xml.Name{Local: "accent3"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + attr, err = m.Accent4Attr.MarshalXMLAttr(xml.Name{Local: "accent4"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + attr, err = m.Accent5Attr.MarshalXMLAttr(xml.Name{Local: "accent5"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + attr, err = m.Accent6Attr.MarshalXMLAttr(xml.Name{Local: "accent6"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + attr, err = m.HlinkAttr.MarshalXMLAttr(xml.Name{Local: "hlink"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + attr, err = m.FolHlinkAttr.MarshalXMLAttr(xml.Name{Local: "folHlink"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_ColorMapping) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.Bg1Attr = ST_ColorSchemeIndex(1) + m.Tx1Attr = ST_ColorSchemeIndex(1) + m.Bg2Attr = ST_ColorSchemeIndex(1) + m.Tx2Attr = ST_ColorSchemeIndex(1) + m.Accent1Attr = ST_ColorSchemeIndex(1) + m.Accent2Attr = ST_ColorSchemeIndex(1) + m.Accent3Attr = ST_ColorSchemeIndex(1) + m.Accent4Attr = ST_ColorSchemeIndex(1) + m.Accent5Attr = ST_ColorSchemeIndex(1) + m.Accent6Attr = ST_ColorSchemeIndex(1) + m.HlinkAttr = ST_ColorSchemeIndex(1) + m.FolHlinkAttr = ST_ColorSchemeIndex(1) + for _, attr := range start.Attr { + if attr.Name.Local == "accent3" { + m.Accent3Attr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "tx1" { + m.Tx1Attr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "bg2" { + m.Bg2Attr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "tx2" { + m.Tx2Attr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "accent1" { + m.Accent1Attr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "accent2" { + m.Accent2Attr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "bg1" { + m.Bg1Attr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "accent4" { + m.Accent4Attr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "accent5" { + m.Accent5Attr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "accent6" { + m.Accent6Attr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "hlink" { + m.HlinkAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "folHlink" { + m.FolHlinkAttr.UnmarshalXMLAttr(attr) + continue + } + } +lCT_ColorMapping: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_ColorMapping %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_ColorMapping + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_ColorMapping and its children +func (m *CT_ColorMapping) Validate() error { + return m.ValidateWithPath("CT_ColorMapping") +} + +// ValidateWithPath validates the CT_ColorMapping and its children, prefixing error messages with path +func (m *CT_ColorMapping) ValidateWithPath(path string) error { + if m.Bg1Attr == ST_ColorSchemeIndexUnset { + return fmt.Errorf("%s/Bg1Attr is a mandatory field", path) + } + if err := m.Bg1Attr.ValidateWithPath(path + "/Bg1Attr"); err != nil { + return err + } + if m.Tx1Attr == ST_ColorSchemeIndexUnset { + return fmt.Errorf("%s/Tx1Attr is a mandatory field", path) + } + if err := m.Tx1Attr.ValidateWithPath(path + "/Tx1Attr"); err != nil { + return err + } + if m.Bg2Attr == ST_ColorSchemeIndexUnset { + return fmt.Errorf("%s/Bg2Attr is a mandatory field", path) + } + if err := m.Bg2Attr.ValidateWithPath(path + "/Bg2Attr"); err != nil { + return err + } + if m.Tx2Attr == ST_ColorSchemeIndexUnset { + return fmt.Errorf("%s/Tx2Attr is a mandatory field", path) + } + if err := m.Tx2Attr.ValidateWithPath(path + "/Tx2Attr"); err != nil { + return err + } + if m.Accent1Attr == ST_ColorSchemeIndexUnset { + return fmt.Errorf("%s/Accent1Attr is a mandatory field", path) + } + if err := m.Accent1Attr.ValidateWithPath(path + "/Accent1Attr"); err != nil { + return err + } + if m.Accent2Attr == ST_ColorSchemeIndexUnset { + return fmt.Errorf("%s/Accent2Attr is a mandatory field", path) + } + if err := m.Accent2Attr.ValidateWithPath(path + "/Accent2Attr"); err != nil { + return err + } + if m.Accent3Attr == ST_ColorSchemeIndexUnset { + return fmt.Errorf("%s/Accent3Attr is a mandatory field", path) + } + if err := m.Accent3Attr.ValidateWithPath(path + "/Accent3Attr"); err != nil { + return err + } + if m.Accent4Attr == ST_ColorSchemeIndexUnset { + return fmt.Errorf("%s/Accent4Attr is a mandatory field", path) + } + if err := m.Accent4Attr.ValidateWithPath(path + "/Accent4Attr"); err != nil { + return err + } + if m.Accent5Attr == ST_ColorSchemeIndexUnset { + return fmt.Errorf("%s/Accent5Attr is a mandatory field", path) + } + if err := m.Accent5Attr.ValidateWithPath(path + "/Accent5Attr"); err != nil { + return err + } + if m.Accent6Attr == ST_ColorSchemeIndexUnset { + return fmt.Errorf("%s/Accent6Attr is a mandatory field", path) + } + if err := m.Accent6Attr.ValidateWithPath(path + "/Accent6Attr"); err != nil { + return err + } + if m.HlinkAttr == ST_ColorSchemeIndexUnset { + return fmt.Errorf("%s/HlinkAttr is a mandatory field", path) + } + if err := m.HlinkAttr.ValidateWithPath(path + "/HlinkAttr"); err != nil { + return err + } + if m.FolHlinkAttr == ST_ColorSchemeIndexUnset { + return fmt.Errorf("%s/FolHlinkAttr is a mandatory field", path) + } + if err := m.FolHlinkAttr.ValidateWithPath(path + "/FolHlinkAttr"); err != nil { + return err + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ColorMappingOverride.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ColorMappingOverride.go new file mode 100644 index 00000000..9079d8fe --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ColorMappingOverride.go @@ -0,0 +1,83 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_ColorMappingOverride struct { + Choice *CT_ColorMappingOverrideChoice +} + +func NewCT_ColorMappingOverride() *CT_ColorMappingOverride { + ret := &CT_ColorMappingOverride{} + ret.Choice = NewCT_ColorMappingOverrideChoice() + return ret +} + +func (m *CT_ColorMappingOverride) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Name.Local = "a:CT_ColorMappingOverride" + e.EncodeToken(start) + m.Choice.MarshalXML(e, xml.StartElement{}) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_ColorMappingOverride) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.Choice = NewCT_ColorMappingOverrideChoice() +lCT_ColorMappingOverride: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "masterClrMapping"}: + m.Choice = NewCT_ColorMappingOverrideChoice() + if err := d.DecodeElement(&m.Choice.MasterClrMapping, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "overrideClrMapping"}: + m.Choice = NewCT_ColorMappingOverrideChoice() + if err := d.DecodeElement(&m.Choice.OverrideClrMapping, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_ColorMappingOverride %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_ColorMappingOverride + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_ColorMappingOverride and its children +func (m *CT_ColorMappingOverride) Validate() error { + return m.ValidateWithPath("CT_ColorMappingOverride") +} + +// ValidateWithPath validates the CT_ColorMappingOverride and its children, prefixing error messages with path +func (m *CT_ColorMappingOverride) ValidateWithPath(path string) error { + if err := m.Choice.ValidateWithPath(path + "/Choice"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ColorMappingOverrideChoice.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ColorMappingOverrideChoice.go new file mode 100644 index 00000000..8562b66a --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ColorMappingOverrideChoice.go @@ -0,0 +1,93 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_ColorMappingOverrideChoice struct { + MasterClrMapping *CT_EmptyElement + OverrideClrMapping *CT_ColorMapping +} + +func NewCT_ColorMappingOverrideChoice() *CT_ColorMappingOverrideChoice { + ret := &CT_ColorMappingOverrideChoice{} + return ret +} + +func (m *CT_ColorMappingOverrideChoice) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.MasterClrMapping != nil { + semasterClrMapping := xml.StartElement{Name: xml.Name{Local: "a:masterClrMapping"}} + e.EncodeElement(m.MasterClrMapping, semasterClrMapping) + } + if m.OverrideClrMapping != nil { + seoverrideClrMapping := xml.StartElement{Name: xml.Name{Local: "a:overrideClrMapping"}} + e.EncodeElement(m.OverrideClrMapping, seoverrideClrMapping) + } + return nil +} + +func (m *CT_ColorMappingOverrideChoice) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_ColorMappingOverrideChoice: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "masterClrMapping"}: + m.MasterClrMapping = NewCT_EmptyElement() + if err := d.DecodeElement(m.MasterClrMapping, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "overrideClrMapping"}: + m.OverrideClrMapping = NewCT_ColorMapping() + if err := d.DecodeElement(m.OverrideClrMapping, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_ColorMappingOverrideChoice %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_ColorMappingOverrideChoice + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_ColorMappingOverrideChoice and its children +func (m *CT_ColorMappingOverrideChoice) Validate() error { + return m.ValidateWithPath("CT_ColorMappingOverrideChoice") +} + +// ValidateWithPath validates the CT_ColorMappingOverrideChoice and its children, prefixing error messages with path +func (m *CT_ColorMappingOverrideChoice) ValidateWithPath(path string) error { + if m.MasterClrMapping != nil { + if err := m.MasterClrMapping.ValidateWithPath(path + "/MasterClrMapping"); err != nil { + return err + } + } + if m.OverrideClrMapping != nil { + if err := m.OverrideClrMapping.ValidateWithPath(path + "/OverrideClrMapping"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ColorReplaceEffect.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ColorReplaceEffect.go new file mode 100644 index 00000000..cce90f07 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ColorReplaceEffect.go @@ -0,0 +1,155 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_ColorReplaceEffect struct { + ScrgbClr *CT_ScRgbColor + SrgbClr *CT_SRgbColor + HslClr *CT_HslColor + SysClr *CT_SystemColor + SchemeClr *CT_SchemeColor + PrstClr *CT_PresetColor +} + +func NewCT_ColorReplaceEffect() *CT_ColorReplaceEffect { + ret := &CT_ColorReplaceEffect{} + return ret +} + +func (m *CT_ColorReplaceEffect) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.ScrgbClr != nil { + sescrgbClr := xml.StartElement{Name: xml.Name{Local: "a:scrgbClr"}} + e.EncodeElement(m.ScrgbClr, sescrgbClr) + } + if m.SrgbClr != nil { + sesrgbClr := xml.StartElement{Name: xml.Name{Local: "a:srgbClr"}} + e.EncodeElement(m.SrgbClr, sesrgbClr) + } + if m.HslClr != nil { + sehslClr := xml.StartElement{Name: xml.Name{Local: "a:hslClr"}} + e.EncodeElement(m.HslClr, sehslClr) + } + if m.SysClr != nil { + sesysClr := xml.StartElement{Name: xml.Name{Local: "a:sysClr"}} + e.EncodeElement(m.SysClr, sesysClr) + } + if m.SchemeClr != nil { + seschemeClr := xml.StartElement{Name: xml.Name{Local: "a:schemeClr"}} + e.EncodeElement(m.SchemeClr, seschemeClr) + } + if m.PrstClr != nil { + seprstClr := xml.StartElement{Name: xml.Name{Local: "a:prstClr"}} + e.EncodeElement(m.PrstClr, seprstClr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_ColorReplaceEffect) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_ColorReplaceEffect: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "scrgbClr"}: + m.ScrgbClr = NewCT_ScRgbColor() + if err := d.DecodeElement(m.ScrgbClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "srgbClr"}: + m.SrgbClr = NewCT_SRgbColor() + if err := d.DecodeElement(m.SrgbClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hslClr"}: + m.HslClr = NewCT_HslColor() + if err := d.DecodeElement(m.HslClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "sysClr"}: + m.SysClr = NewCT_SystemColor() + if err := d.DecodeElement(m.SysClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "schemeClr"}: + m.SchemeClr = NewCT_SchemeColor() + if err := d.DecodeElement(m.SchemeClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "prstClr"}: + m.PrstClr = NewCT_PresetColor() + if err := d.DecodeElement(m.PrstClr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_ColorReplaceEffect %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_ColorReplaceEffect + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_ColorReplaceEffect and its children +func (m *CT_ColorReplaceEffect) Validate() error { + return m.ValidateWithPath("CT_ColorReplaceEffect") +} + +// ValidateWithPath validates the CT_ColorReplaceEffect and its children, prefixing error messages with path +func (m *CT_ColorReplaceEffect) ValidateWithPath(path string) error { + if m.ScrgbClr != nil { + if err := m.ScrgbClr.ValidateWithPath(path + "/ScrgbClr"); err != nil { + return err + } + } + if m.SrgbClr != nil { + if err := m.SrgbClr.ValidateWithPath(path + "/SrgbClr"); err != nil { + return err + } + } + if m.HslClr != nil { + if err := m.HslClr.ValidateWithPath(path + "/HslClr"); err != nil { + return err + } + } + if m.SysClr != nil { + if err := m.SysClr.ValidateWithPath(path + "/SysClr"); err != nil { + return err + } + } + if m.SchemeClr != nil { + if err := m.SchemeClr.ValidateWithPath(path + "/SchemeClr"); err != nil { + return err + } + } + if m.PrstClr != nil { + if err := m.PrstClr.ValidateWithPath(path + "/PrstClr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ColorScheme.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ColorScheme.go new file mode 100644 index 00000000..92fb258e --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ColorScheme.go @@ -0,0 +1,238 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_ColorScheme struct { + NameAttr string + Dk1 *CT_Color + Lt1 *CT_Color + Dk2 *CT_Color + Lt2 *CT_Color + Accent1 *CT_Color + Accent2 *CT_Color + Accent3 *CT_Color + Accent4 *CT_Color + Accent5 *CT_Color + Accent6 *CT_Color + Hlink *CT_Color + FolHlink *CT_Color + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_ColorScheme() *CT_ColorScheme { + ret := &CT_ColorScheme{} + ret.Dk1 = NewCT_Color() + ret.Lt1 = NewCT_Color() + ret.Dk2 = NewCT_Color() + ret.Lt2 = NewCT_Color() + ret.Accent1 = NewCT_Color() + ret.Accent2 = NewCT_Color() + ret.Accent3 = NewCT_Color() + ret.Accent4 = NewCT_Color() + ret.Accent5 = NewCT_Color() + ret.Accent6 = NewCT_Color() + ret.Hlink = NewCT_Color() + ret.FolHlink = NewCT_Color() + return ret +} + +func (m *CT_ColorScheme) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "name"}, + Value: fmt.Sprintf("%v", m.NameAttr)}) + e.EncodeToken(start) + sedk1 := xml.StartElement{Name: xml.Name{Local: "a:dk1"}} + e.EncodeElement(m.Dk1, sedk1) + selt1 := xml.StartElement{Name: xml.Name{Local: "a:lt1"}} + e.EncodeElement(m.Lt1, selt1) + sedk2 := xml.StartElement{Name: xml.Name{Local: "a:dk2"}} + e.EncodeElement(m.Dk2, sedk2) + selt2 := xml.StartElement{Name: xml.Name{Local: "a:lt2"}} + e.EncodeElement(m.Lt2, selt2) + seaccent1 := xml.StartElement{Name: xml.Name{Local: "a:accent1"}} + e.EncodeElement(m.Accent1, seaccent1) + seaccent2 := xml.StartElement{Name: xml.Name{Local: "a:accent2"}} + e.EncodeElement(m.Accent2, seaccent2) + seaccent3 := xml.StartElement{Name: xml.Name{Local: "a:accent3"}} + e.EncodeElement(m.Accent3, seaccent3) + seaccent4 := xml.StartElement{Name: xml.Name{Local: "a:accent4"}} + e.EncodeElement(m.Accent4, seaccent4) + seaccent5 := xml.StartElement{Name: xml.Name{Local: "a:accent5"}} + e.EncodeElement(m.Accent5, seaccent5) + seaccent6 := xml.StartElement{Name: xml.Name{Local: "a:accent6"}} + e.EncodeElement(m.Accent6, seaccent6) + sehlink := xml.StartElement{Name: xml.Name{Local: "a:hlink"}} + e.EncodeElement(m.Hlink, sehlink) + sefolHlink := xml.StartElement{Name: xml.Name{Local: "a:folHlink"}} + e.EncodeElement(m.FolHlink, sefolHlink) + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_ColorScheme) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.Dk1 = NewCT_Color() + m.Lt1 = NewCT_Color() + m.Dk2 = NewCT_Color() + m.Lt2 = NewCT_Color() + m.Accent1 = NewCT_Color() + m.Accent2 = NewCT_Color() + m.Accent3 = NewCT_Color() + m.Accent4 = NewCT_Color() + m.Accent5 = NewCT_Color() + m.Accent6 = NewCT_Color() + m.Hlink = NewCT_Color() + m.FolHlink = NewCT_Color() + for _, attr := range start.Attr { + if attr.Name.Local == "name" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.NameAttr = parsed + continue + } + } +lCT_ColorScheme: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "dk1"}: + if err := d.DecodeElement(m.Dk1, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lt1"}: + if err := d.DecodeElement(m.Lt1, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "dk2"}: + if err := d.DecodeElement(m.Dk2, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lt2"}: + if err := d.DecodeElement(m.Lt2, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "accent1"}: + if err := d.DecodeElement(m.Accent1, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "accent2"}: + if err := d.DecodeElement(m.Accent2, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "accent3"}: + if err := d.DecodeElement(m.Accent3, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "accent4"}: + if err := d.DecodeElement(m.Accent4, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "accent5"}: + if err := d.DecodeElement(m.Accent5, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "accent6"}: + if err := d.DecodeElement(m.Accent6, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hlink"}: + if err := d.DecodeElement(m.Hlink, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "folHlink"}: + if err := d.DecodeElement(m.FolHlink, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_ColorScheme %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_ColorScheme + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_ColorScheme and its children +func (m *CT_ColorScheme) Validate() error { + return m.ValidateWithPath("CT_ColorScheme") +} + +// ValidateWithPath validates the CT_ColorScheme and its children, prefixing error messages with path +func (m *CT_ColorScheme) ValidateWithPath(path string) error { + if err := m.Dk1.ValidateWithPath(path + "/Dk1"); err != nil { + return err + } + if err := m.Lt1.ValidateWithPath(path + "/Lt1"); err != nil { + return err + } + if err := m.Dk2.ValidateWithPath(path + "/Dk2"); err != nil { + return err + } + if err := m.Lt2.ValidateWithPath(path + "/Lt2"); err != nil { + return err + } + if err := m.Accent1.ValidateWithPath(path + "/Accent1"); err != nil { + return err + } + if err := m.Accent2.ValidateWithPath(path + "/Accent2"); err != nil { + return err + } + if err := m.Accent3.ValidateWithPath(path + "/Accent3"); err != nil { + return err + } + if err := m.Accent4.ValidateWithPath(path + "/Accent4"); err != nil { + return err + } + if err := m.Accent5.ValidateWithPath(path + "/Accent5"); err != nil { + return err + } + if err := m.Accent6.ValidateWithPath(path + "/Accent6"); err != nil { + return err + } + if err := m.Hlink.ValidateWithPath(path + "/Hlink"); err != nil { + return err + } + if err := m.FolHlink.ValidateWithPath(path + "/FolHlink"); err != nil { + return err + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ColorSchemeAndMapping.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ColorSchemeAndMapping.go new file mode 100644 index 00000000..7175b3a7 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ColorSchemeAndMapping.go @@ -0,0 +1,92 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_ColorSchemeAndMapping struct { + ClrScheme *CT_ColorScheme + ClrMap *CT_ColorMapping +} + +func NewCT_ColorSchemeAndMapping() *CT_ColorSchemeAndMapping { + ret := &CT_ColorSchemeAndMapping{} + ret.ClrScheme = NewCT_ColorScheme() + return ret +} + +func (m *CT_ColorSchemeAndMapping) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + seclrScheme := xml.StartElement{Name: xml.Name{Local: "a:clrScheme"}} + e.EncodeElement(m.ClrScheme, seclrScheme) + if m.ClrMap != nil { + seclrMap := xml.StartElement{Name: xml.Name{Local: "a:clrMap"}} + e.EncodeElement(m.ClrMap, seclrMap) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_ColorSchemeAndMapping) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ClrScheme = NewCT_ColorScheme() +lCT_ColorSchemeAndMapping: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "clrScheme"}: + if err := d.DecodeElement(m.ClrScheme, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "clrMap"}: + m.ClrMap = NewCT_ColorMapping() + if err := d.DecodeElement(m.ClrMap, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_ColorSchemeAndMapping %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_ColorSchemeAndMapping + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_ColorSchemeAndMapping and its children +func (m *CT_ColorSchemeAndMapping) Validate() error { + return m.ValidateWithPath("CT_ColorSchemeAndMapping") +} + +// ValidateWithPath validates the CT_ColorSchemeAndMapping and its children, prefixing error messages with path +func (m *CT_ColorSchemeAndMapping) ValidateWithPath(path string) error { + if err := m.ClrScheme.ValidateWithPath(path + "/ClrScheme"); err != nil { + return err + } + if m.ClrMap != nil { + if err := m.ClrMap.ValidateWithPath(path + "/ClrMap"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ColorSchemeList.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ColorSchemeList.go new file mode 100644 index 00000000..4fd543f8 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ColorSchemeList.go @@ -0,0 +1,84 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_ColorSchemeList struct { + ExtraClrScheme []*CT_ColorSchemeAndMapping +} + +func NewCT_ColorSchemeList() *CT_ColorSchemeList { + ret := &CT_ColorSchemeList{} + return ret +} + +func (m *CT_ColorSchemeList) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.ExtraClrScheme != nil { + seextraClrScheme := xml.StartElement{Name: xml.Name{Local: "a:extraClrScheme"}} + for _, c := range m.ExtraClrScheme { + e.EncodeElement(c, seextraClrScheme) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_ColorSchemeList) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_ColorSchemeList: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extraClrScheme"}: + tmp := NewCT_ColorSchemeAndMapping() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.ExtraClrScheme = append(m.ExtraClrScheme, tmp) + default: + gooxml.Log("skipping unsupported element on CT_ColorSchemeList %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_ColorSchemeList + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_ColorSchemeList and its children +func (m *CT_ColorSchemeList) Validate() error { + return m.ValidateWithPath("CT_ColorSchemeList") +} + +// ValidateWithPath validates the CT_ColorSchemeList and its children, prefixing error messages with path +func (m *CT_ColorSchemeList) ValidateWithPath(path string) error { + for i, v := range m.ExtraClrScheme { + if err := v.ValidateWithPath(fmt.Sprintf("%s/ExtraClrScheme[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ComplementTransform.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ComplementTransform.go new file mode 100644 index 00000000..7c3216f0 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ComplementTransform.go @@ -0,0 +1,54 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_ComplementTransform struct { +} + +func NewCT_ComplementTransform() *CT_ComplementTransform { + ret := &CT_ComplementTransform{} + return ret +} + +func (m *CT_ComplementTransform) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_ComplementTransform) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_ComplementTransform: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_ComplementTransform and its children +func (m *CT_ComplementTransform) Validate() error { + return m.ValidateWithPath("CT_ComplementTransform") +} + +// ValidateWithPath validates the CT_ComplementTransform and its children, prefixing error messages with path +func (m *CT_ComplementTransform) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Connection.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Connection.go new file mode 100644 index 00000000..0432ffae --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Connection.go @@ -0,0 +1,79 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" +) + +type CT_Connection struct { + IdAttr uint32 + IdxAttr uint32 +} + +func NewCT_Connection() *CT_Connection { + ret := &CT_Connection{} + return ret +} + +func (m *CT_Connection) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "id"}, + Value: fmt.Sprintf("%v", m.IdAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "idx"}, + Value: fmt.Sprintf("%v", m.IdxAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Connection) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "id" { + parsed, err := strconv.ParseUint(attr.Value, 10, 32) + if err != nil { + return err + } + m.IdAttr = uint32(parsed) + continue + } + if attr.Name.Local == "idx" { + parsed, err := strconv.ParseUint(attr.Value, 10, 32) + if err != nil { + return err + } + m.IdxAttr = uint32(parsed) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Connection: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Connection and its children +func (m *CT_Connection) Validate() error { + return m.ValidateWithPath("CT_Connection") +} + +// ValidateWithPath validates the CT_Connection and its children, prefixing error messages with path +func (m *CT_Connection) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ConnectionSite.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ConnectionSite.go new file mode 100644 index 00000000..ce9e4293 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ConnectionSite.go @@ -0,0 +1,94 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_ConnectionSite struct { + AngAttr ST_AdjAngle + Pos *CT_AdjPoint2D +} + +func NewCT_ConnectionSite() *CT_ConnectionSite { + ret := &CT_ConnectionSite{} + ret.Pos = NewCT_AdjPoint2D() + return ret +} + +func (m *CT_ConnectionSite) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "ang"}, + Value: fmt.Sprintf("%v", m.AngAttr)}) + e.EncodeToken(start) + sepos := xml.StartElement{Name: xml.Name{Local: "a:pos"}} + e.EncodeElement(m.Pos, sepos) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_ConnectionSite) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.Pos = NewCT_AdjPoint2D() + for _, attr := range start.Attr { + if attr.Name.Local == "ang" { + parsed, err := ParseUnionST_AdjAngle(attr.Value) + if err != nil { + return err + } + m.AngAttr = parsed + continue + } + } +lCT_ConnectionSite: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "pos"}: + if err := d.DecodeElement(m.Pos, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_ConnectionSite %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_ConnectionSite + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_ConnectionSite and its children +func (m *CT_ConnectionSite) Validate() error { + return m.ValidateWithPath("CT_ConnectionSite") +} + +// ValidateWithPath validates the CT_ConnectionSite and its children, prefixing error messages with path +func (m *CT_ConnectionSite) ValidateWithPath(path string) error { + if err := m.AngAttr.ValidateWithPath(path + "/AngAttr"); err != nil { + return err + } + if err := m.Pos.ValidateWithPath(path + "/Pos"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ConnectionSiteList.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ConnectionSiteList.go new file mode 100644 index 00000000..41514456 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ConnectionSiteList.go @@ -0,0 +1,84 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_ConnectionSiteList struct { + Cxn []*CT_ConnectionSite +} + +func NewCT_ConnectionSiteList() *CT_ConnectionSiteList { + ret := &CT_ConnectionSiteList{} + return ret +} + +func (m *CT_ConnectionSiteList) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Cxn != nil { + secxn := xml.StartElement{Name: xml.Name{Local: "a:cxn"}} + for _, c := range m.Cxn { + e.EncodeElement(c, secxn) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_ConnectionSiteList) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_ConnectionSiteList: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "cxn"}: + tmp := NewCT_ConnectionSite() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Cxn = append(m.Cxn, tmp) + default: + gooxml.Log("skipping unsupported element on CT_ConnectionSiteList %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_ConnectionSiteList + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_ConnectionSiteList and its children +func (m *CT_ConnectionSiteList) Validate() error { + return m.ValidateWithPath("CT_ConnectionSiteList") +} + +// ValidateWithPath validates the CT_ConnectionSiteList and its children, prefixing error messages with path +func (m *CT_ConnectionSiteList) ValidateWithPath(path string) error { + for i, v := range m.Cxn { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Cxn[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ConnectorLocking.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ConnectorLocking.go new file mode 100644 index 00000000..f2f25e3c --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ConnectorLocking.go @@ -0,0 +1,214 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type CT_ConnectorLocking struct { + ExtLst *CT_OfficeArtExtensionList + NoGrpAttr *bool + NoSelectAttr *bool + NoRotAttr *bool + NoChangeAspectAttr *bool + NoMoveAttr *bool + NoResizeAttr *bool + NoEditPointsAttr *bool + NoAdjustHandlesAttr *bool + NoChangeArrowheadsAttr *bool + NoChangeShapeTypeAttr *bool +} + +func NewCT_ConnectorLocking() *CT_ConnectorLocking { + ret := &CT_ConnectorLocking{} + return ret +} + +func (m *CT_ConnectorLocking) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.NoGrpAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noGrp"}, + Value: fmt.Sprintf("%d", b2i(*m.NoGrpAttr))}) + } + if m.NoSelectAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noSelect"}, + Value: fmt.Sprintf("%d", b2i(*m.NoSelectAttr))}) + } + if m.NoRotAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noRot"}, + Value: fmt.Sprintf("%d", b2i(*m.NoRotAttr))}) + } + if m.NoChangeAspectAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noChangeAspect"}, + Value: fmt.Sprintf("%d", b2i(*m.NoChangeAspectAttr))}) + } + if m.NoMoveAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noMove"}, + Value: fmt.Sprintf("%d", b2i(*m.NoMoveAttr))}) + } + if m.NoResizeAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noResize"}, + Value: fmt.Sprintf("%d", b2i(*m.NoResizeAttr))}) + } + if m.NoEditPointsAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noEditPoints"}, + Value: fmt.Sprintf("%d", b2i(*m.NoEditPointsAttr))}) + } + if m.NoAdjustHandlesAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noAdjustHandles"}, + Value: fmt.Sprintf("%d", b2i(*m.NoAdjustHandlesAttr))}) + } + if m.NoChangeArrowheadsAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noChangeArrowheads"}, + Value: fmt.Sprintf("%d", b2i(*m.NoChangeArrowheadsAttr))}) + } + if m.NoChangeShapeTypeAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noChangeShapeType"}, + Value: fmt.Sprintf("%d", b2i(*m.NoChangeShapeTypeAttr))}) + } + e.EncodeToken(start) + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_ConnectorLocking) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "noGrp" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoGrpAttr = &parsed + continue + } + if attr.Name.Local == "noSelect" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoSelectAttr = &parsed + continue + } + if attr.Name.Local == "noRot" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoRotAttr = &parsed + continue + } + if attr.Name.Local == "noChangeAspect" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoChangeAspectAttr = &parsed + continue + } + if attr.Name.Local == "noMove" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoMoveAttr = &parsed + continue + } + if attr.Name.Local == "noResize" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoResizeAttr = &parsed + continue + } + if attr.Name.Local == "noEditPoints" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoEditPointsAttr = &parsed + continue + } + if attr.Name.Local == "noAdjustHandles" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoAdjustHandlesAttr = &parsed + continue + } + if attr.Name.Local == "noChangeArrowheads" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoChangeArrowheadsAttr = &parsed + continue + } + if attr.Name.Local == "noChangeShapeType" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoChangeShapeTypeAttr = &parsed + continue + } + } +lCT_ConnectorLocking: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_ConnectorLocking %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_ConnectorLocking + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_ConnectorLocking and its children +func (m *CT_ConnectorLocking) Validate() error { + return m.ValidateWithPath("CT_ConnectorLocking") +} + +// ValidateWithPath validates the CT_ConnectorLocking and its children, prefixing error messages with path +func (m *CT_ConnectorLocking) ValidateWithPath(path string) error { + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ContentPartLocking.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ContentPartLocking.go new file mode 100644 index 00000000..23cc088c --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ContentPartLocking.go @@ -0,0 +1,214 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type CT_ContentPartLocking struct { + ExtLst *CT_OfficeArtExtensionList + NoGrpAttr *bool + NoSelectAttr *bool + NoRotAttr *bool + NoChangeAspectAttr *bool + NoMoveAttr *bool + NoResizeAttr *bool + NoEditPointsAttr *bool + NoAdjustHandlesAttr *bool + NoChangeArrowheadsAttr *bool + NoChangeShapeTypeAttr *bool +} + +func NewCT_ContentPartLocking() *CT_ContentPartLocking { + ret := &CT_ContentPartLocking{} + return ret +} + +func (m *CT_ContentPartLocking) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.NoGrpAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noGrp"}, + Value: fmt.Sprintf("%d", b2i(*m.NoGrpAttr))}) + } + if m.NoSelectAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noSelect"}, + Value: fmt.Sprintf("%d", b2i(*m.NoSelectAttr))}) + } + if m.NoRotAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noRot"}, + Value: fmt.Sprintf("%d", b2i(*m.NoRotAttr))}) + } + if m.NoChangeAspectAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noChangeAspect"}, + Value: fmt.Sprintf("%d", b2i(*m.NoChangeAspectAttr))}) + } + if m.NoMoveAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noMove"}, + Value: fmt.Sprintf("%d", b2i(*m.NoMoveAttr))}) + } + if m.NoResizeAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noResize"}, + Value: fmt.Sprintf("%d", b2i(*m.NoResizeAttr))}) + } + if m.NoEditPointsAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noEditPoints"}, + Value: fmt.Sprintf("%d", b2i(*m.NoEditPointsAttr))}) + } + if m.NoAdjustHandlesAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noAdjustHandles"}, + Value: fmt.Sprintf("%d", b2i(*m.NoAdjustHandlesAttr))}) + } + if m.NoChangeArrowheadsAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noChangeArrowheads"}, + Value: fmt.Sprintf("%d", b2i(*m.NoChangeArrowheadsAttr))}) + } + if m.NoChangeShapeTypeAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noChangeShapeType"}, + Value: fmt.Sprintf("%d", b2i(*m.NoChangeShapeTypeAttr))}) + } + e.EncodeToken(start) + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_ContentPartLocking) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "noGrp" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoGrpAttr = &parsed + continue + } + if attr.Name.Local == "noSelect" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoSelectAttr = &parsed + continue + } + if attr.Name.Local == "noRot" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoRotAttr = &parsed + continue + } + if attr.Name.Local == "noChangeAspect" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoChangeAspectAttr = &parsed + continue + } + if attr.Name.Local == "noMove" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoMoveAttr = &parsed + continue + } + if attr.Name.Local == "noResize" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoResizeAttr = &parsed + continue + } + if attr.Name.Local == "noEditPoints" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoEditPointsAttr = &parsed + continue + } + if attr.Name.Local == "noAdjustHandles" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoAdjustHandlesAttr = &parsed + continue + } + if attr.Name.Local == "noChangeArrowheads" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoChangeArrowheadsAttr = &parsed + continue + } + if attr.Name.Local == "noChangeShapeType" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoChangeShapeTypeAttr = &parsed + continue + } + } +lCT_ContentPartLocking: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_ContentPartLocking %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_ContentPartLocking + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_ContentPartLocking and its children +func (m *CT_ContentPartLocking) Validate() error { + return m.ValidateWithPath("CT_ContentPartLocking") +} + +// ValidateWithPath validates the CT_ContentPartLocking and its children, prefixing error messages with path +func (m *CT_ContentPartLocking) ValidateWithPath(path string) error { + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_CustomColor.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_CustomColor.go new file mode 100644 index 00000000..549685a6 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_CustomColor.go @@ -0,0 +1,171 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_CustomColor struct { + NameAttr *string + ScrgbClr *CT_ScRgbColor + SrgbClr *CT_SRgbColor + HslClr *CT_HslColor + SysClr *CT_SystemColor + SchemeClr *CT_SchemeColor + PrstClr *CT_PresetColor +} + +func NewCT_CustomColor() *CT_CustomColor { + ret := &CT_CustomColor{} + return ret +} + +func (m *CT_CustomColor) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.NameAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "name"}, + Value: fmt.Sprintf("%v", *m.NameAttr)}) + } + e.EncodeToken(start) + if m.ScrgbClr != nil { + sescrgbClr := xml.StartElement{Name: xml.Name{Local: "a:scrgbClr"}} + e.EncodeElement(m.ScrgbClr, sescrgbClr) + } + if m.SrgbClr != nil { + sesrgbClr := xml.StartElement{Name: xml.Name{Local: "a:srgbClr"}} + e.EncodeElement(m.SrgbClr, sesrgbClr) + } + if m.HslClr != nil { + sehslClr := xml.StartElement{Name: xml.Name{Local: "a:hslClr"}} + e.EncodeElement(m.HslClr, sehslClr) + } + if m.SysClr != nil { + sesysClr := xml.StartElement{Name: xml.Name{Local: "a:sysClr"}} + e.EncodeElement(m.SysClr, sesysClr) + } + if m.SchemeClr != nil { + seschemeClr := xml.StartElement{Name: xml.Name{Local: "a:schemeClr"}} + e.EncodeElement(m.SchemeClr, seschemeClr) + } + if m.PrstClr != nil { + seprstClr := xml.StartElement{Name: xml.Name{Local: "a:prstClr"}} + e.EncodeElement(m.PrstClr, seprstClr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_CustomColor) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "name" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.NameAttr = &parsed + continue + } + } +lCT_CustomColor: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "scrgbClr"}: + m.ScrgbClr = NewCT_ScRgbColor() + if err := d.DecodeElement(m.ScrgbClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "srgbClr"}: + m.SrgbClr = NewCT_SRgbColor() + if err := d.DecodeElement(m.SrgbClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hslClr"}: + m.HslClr = NewCT_HslColor() + if err := d.DecodeElement(m.HslClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "sysClr"}: + m.SysClr = NewCT_SystemColor() + if err := d.DecodeElement(m.SysClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "schemeClr"}: + m.SchemeClr = NewCT_SchemeColor() + if err := d.DecodeElement(m.SchemeClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "prstClr"}: + m.PrstClr = NewCT_PresetColor() + if err := d.DecodeElement(m.PrstClr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_CustomColor %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_CustomColor + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_CustomColor and its children +func (m *CT_CustomColor) Validate() error { + return m.ValidateWithPath("CT_CustomColor") +} + +// ValidateWithPath validates the CT_CustomColor and its children, prefixing error messages with path +func (m *CT_CustomColor) ValidateWithPath(path string) error { + if m.ScrgbClr != nil { + if err := m.ScrgbClr.ValidateWithPath(path + "/ScrgbClr"); err != nil { + return err + } + } + if m.SrgbClr != nil { + if err := m.SrgbClr.ValidateWithPath(path + "/SrgbClr"); err != nil { + return err + } + } + if m.HslClr != nil { + if err := m.HslClr.ValidateWithPath(path + "/HslClr"); err != nil { + return err + } + } + if m.SysClr != nil { + if err := m.SysClr.ValidateWithPath(path + "/SysClr"); err != nil { + return err + } + } + if m.SchemeClr != nil { + if err := m.SchemeClr.ValidateWithPath(path + "/SchemeClr"); err != nil { + return err + } + } + if m.PrstClr != nil { + if err := m.PrstClr.ValidateWithPath(path + "/PrstClr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_CustomColorList.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_CustomColorList.go new file mode 100644 index 00000000..5ebe88a9 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_CustomColorList.go @@ -0,0 +1,84 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_CustomColorList struct { + CustClr []*CT_CustomColor +} + +func NewCT_CustomColorList() *CT_CustomColorList { + ret := &CT_CustomColorList{} + return ret +} + +func (m *CT_CustomColorList) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.CustClr != nil { + secustClr := xml.StartElement{Name: xml.Name{Local: "a:custClr"}} + for _, c := range m.CustClr { + e.EncodeElement(c, secustClr) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_CustomColorList) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_CustomColorList: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "custClr"}: + tmp := NewCT_CustomColor() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.CustClr = append(m.CustClr, tmp) + default: + gooxml.Log("skipping unsupported element on CT_CustomColorList %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_CustomColorList + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_CustomColorList and its children +func (m *CT_CustomColorList) Validate() error { + return m.ValidateWithPath("CT_CustomColorList") +} + +// ValidateWithPath validates the CT_CustomColorList and its children, prefixing error messages with path +func (m *CT_CustomColorList) ValidateWithPath(path string) error { + for i, v := range m.CustClr { + if err := v.ValidateWithPath(fmt.Sprintf("%s/CustClr[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_CustomGeometry2D.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_CustomGeometry2D.go new file mode 100644 index 00000000..6edaebaf --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_CustomGeometry2D.go @@ -0,0 +1,152 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_CustomGeometry2D struct { + AvLst *CT_GeomGuideList + GdLst *CT_GeomGuideList + AhLst *CT_AdjustHandleList + CxnLst *CT_ConnectionSiteList + Rect *CT_GeomRect + PathLst *CT_Path2DList +} + +func NewCT_CustomGeometry2D() *CT_CustomGeometry2D { + ret := &CT_CustomGeometry2D{} + ret.PathLst = NewCT_Path2DList() + return ret +} + +func (m *CT_CustomGeometry2D) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.AvLst != nil { + seavLst := xml.StartElement{Name: xml.Name{Local: "a:avLst"}} + e.EncodeElement(m.AvLst, seavLst) + } + if m.GdLst != nil { + segdLst := xml.StartElement{Name: xml.Name{Local: "a:gdLst"}} + e.EncodeElement(m.GdLst, segdLst) + } + if m.AhLst != nil { + seahLst := xml.StartElement{Name: xml.Name{Local: "a:ahLst"}} + e.EncodeElement(m.AhLst, seahLst) + } + if m.CxnLst != nil { + secxnLst := xml.StartElement{Name: xml.Name{Local: "a:cxnLst"}} + e.EncodeElement(m.CxnLst, secxnLst) + } + if m.Rect != nil { + serect := xml.StartElement{Name: xml.Name{Local: "a:rect"}} + e.EncodeElement(m.Rect, serect) + } + sepathLst := xml.StartElement{Name: xml.Name{Local: "a:pathLst"}} + e.EncodeElement(m.PathLst, sepathLst) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_CustomGeometry2D) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.PathLst = NewCT_Path2DList() +lCT_CustomGeometry2D: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "avLst"}: + m.AvLst = NewCT_GeomGuideList() + if err := d.DecodeElement(m.AvLst, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "gdLst"}: + m.GdLst = NewCT_GeomGuideList() + if err := d.DecodeElement(m.GdLst, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "ahLst"}: + m.AhLst = NewCT_AdjustHandleList() + if err := d.DecodeElement(m.AhLst, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "cxnLst"}: + m.CxnLst = NewCT_ConnectionSiteList() + if err := d.DecodeElement(m.CxnLst, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "rect"}: + m.Rect = NewCT_GeomRect() + if err := d.DecodeElement(m.Rect, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "pathLst"}: + if err := d.DecodeElement(m.PathLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_CustomGeometry2D %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_CustomGeometry2D + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_CustomGeometry2D and its children +func (m *CT_CustomGeometry2D) Validate() error { + return m.ValidateWithPath("CT_CustomGeometry2D") +} + +// ValidateWithPath validates the CT_CustomGeometry2D and its children, prefixing error messages with path +func (m *CT_CustomGeometry2D) ValidateWithPath(path string) error { + if m.AvLst != nil { + if err := m.AvLst.ValidateWithPath(path + "/AvLst"); err != nil { + return err + } + } + if m.GdLst != nil { + if err := m.GdLst.ValidateWithPath(path + "/GdLst"); err != nil { + return err + } + } + if m.AhLst != nil { + if err := m.AhLst.ValidateWithPath(path + "/AhLst"); err != nil { + return err + } + } + if m.CxnLst != nil { + if err := m.CxnLst.ValidateWithPath(path + "/CxnLst"); err != nil { + return err + } + } + if m.Rect != nil { + if err := m.Rect.ValidateWithPath(path + "/Rect"); err != nil { + return err + } + } + if err := m.PathLst.ValidateWithPath(path + "/PathLst"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_DashStop.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_DashStop.go new file mode 100644 index 00000000..8c3895b8 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_DashStop.go @@ -0,0 +1,84 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_DashStop struct { + DAttr ST_PositivePercentage + SpAttr ST_PositivePercentage +} + +func NewCT_DashStop() *CT_DashStop { + ret := &CT_DashStop{} + return ret +} + +func (m *CT_DashStop) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "d"}, + Value: fmt.Sprintf("%v", m.DAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "sp"}, + Value: fmt.Sprintf("%v", m.SpAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_DashStop) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "d" { + parsed, err := ParseUnionST_PositivePercentage(attr.Value) + if err != nil { + return err + } + m.DAttr = parsed + continue + } + if attr.Name.Local == "sp" { + parsed, err := ParseUnionST_PositivePercentage(attr.Value) + if err != nil { + return err + } + m.SpAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_DashStop: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_DashStop and its children +func (m *CT_DashStop) Validate() error { + return m.ValidateWithPath("CT_DashStop") +} + +// ValidateWithPath validates the CT_DashStop and its children, prefixing error messages with path +func (m *CT_DashStop) ValidateWithPath(path string) error { + if err := m.DAttr.ValidateWithPath(path + "/DAttr"); err != nil { + return err + } + if err := m.SpAttr.ValidateWithPath(path + "/SpAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_DashStopList.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_DashStopList.go new file mode 100644 index 00000000..eb87dbcc --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_DashStopList.go @@ -0,0 +1,84 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_DashStopList struct { + Ds []*CT_DashStop +} + +func NewCT_DashStopList() *CT_DashStopList { + ret := &CT_DashStopList{} + return ret +} + +func (m *CT_DashStopList) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Ds != nil { + seds := xml.StartElement{Name: xml.Name{Local: "a:ds"}} + for _, c := range m.Ds { + e.EncodeElement(c, seds) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_DashStopList) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_DashStopList: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "ds"}: + tmp := NewCT_DashStop() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Ds = append(m.Ds, tmp) + default: + gooxml.Log("skipping unsupported element on CT_DashStopList %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_DashStopList + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_DashStopList and its children +func (m *CT_DashStopList) Validate() error { + return m.ValidateWithPath("CT_DashStopList") +} + +// ValidateWithPath validates the CT_DashStopList and its children, prefixing error messages with path +func (m *CT_DashStopList) ValidateWithPath(path string) error { + for i, v := range m.Ds { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Ds[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_DefaultShapeDefinition.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_DefaultShapeDefinition.go new file mode 100644 index 00000000..03156177 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_DefaultShapeDefinition.go @@ -0,0 +1,131 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_DefaultShapeDefinition struct { + SpPr *CT_ShapeProperties + BodyPr *CT_TextBodyProperties + LstStyle *CT_TextListStyle + Style *CT_ShapeStyle + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_DefaultShapeDefinition() *CT_DefaultShapeDefinition { + ret := &CT_DefaultShapeDefinition{} + ret.SpPr = NewCT_ShapeProperties() + ret.BodyPr = NewCT_TextBodyProperties() + ret.LstStyle = NewCT_TextListStyle() + return ret +} + +func (m *CT_DefaultShapeDefinition) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + sespPr := xml.StartElement{Name: xml.Name{Local: "a:spPr"}} + e.EncodeElement(m.SpPr, sespPr) + sebodyPr := xml.StartElement{Name: xml.Name{Local: "a:bodyPr"}} + e.EncodeElement(m.BodyPr, sebodyPr) + selstStyle := xml.StartElement{Name: xml.Name{Local: "a:lstStyle"}} + e.EncodeElement(m.LstStyle, selstStyle) + if m.Style != nil { + sestyle := xml.StartElement{Name: xml.Name{Local: "a:style"}} + e.EncodeElement(m.Style, sestyle) + } + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_DefaultShapeDefinition) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.SpPr = NewCT_ShapeProperties() + m.BodyPr = NewCT_TextBodyProperties() + m.LstStyle = NewCT_TextListStyle() +lCT_DefaultShapeDefinition: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "spPr"}: + if err := d.DecodeElement(m.SpPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "bodyPr"}: + if err := d.DecodeElement(m.BodyPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lstStyle"}: + if err := d.DecodeElement(m.LstStyle, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "style"}: + m.Style = NewCT_ShapeStyle() + if err := d.DecodeElement(m.Style, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_DefaultShapeDefinition %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_DefaultShapeDefinition + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_DefaultShapeDefinition and its children +func (m *CT_DefaultShapeDefinition) Validate() error { + return m.ValidateWithPath("CT_DefaultShapeDefinition") +} + +// ValidateWithPath validates the CT_DefaultShapeDefinition and its children, prefixing error messages with path +func (m *CT_DefaultShapeDefinition) ValidateWithPath(path string) error { + if err := m.SpPr.ValidateWithPath(path + "/SpPr"); err != nil { + return err + } + if err := m.BodyPr.ValidateWithPath(path + "/BodyPr"); err != nil { + return err + } + if err := m.LstStyle.ValidateWithPath(path + "/LstStyle"); err != nil { + return err + } + if m.Style != nil { + if err := m.Style.ValidateWithPath(path + "/Style"); err != nil { + return err + } + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_DuotoneEffect.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_DuotoneEffect.go new file mode 100644 index 00000000..8210038d --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_DuotoneEffect.go @@ -0,0 +1,117 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_DuotoneEffect struct { + EG_ColorChoice []*EG_ColorChoice +} + +func NewCT_DuotoneEffect() *CT_DuotoneEffect { + ret := &CT_DuotoneEffect{} + return ret +} + +func (m *CT_DuotoneEffect) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + for _, c := range m.EG_ColorChoice { + c.MarshalXML(e, xml.StartElement{}) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_DuotoneEffect) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_DuotoneEffect: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "scrgbClr"}: + tmpcolorchoice := NewEG_ColorChoice() + tmpcolorchoice.ScrgbClr = NewCT_ScRgbColor() + if err := d.DecodeElement(tmpcolorchoice.ScrgbClr, &el); err != nil { + return err + } + m.EG_ColorChoice = append(m.EG_ColorChoice, tmpcolorchoice) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "srgbClr"}: + tmpcolorchoice := NewEG_ColorChoice() + tmpcolorchoice.SrgbClr = NewCT_SRgbColor() + if err := d.DecodeElement(tmpcolorchoice.SrgbClr, &el); err != nil { + return err + } + m.EG_ColorChoice = append(m.EG_ColorChoice, tmpcolorchoice) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hslClr"}: + tmpcolorchoice := NewEG_ColorChoice() + tmpcolorchoice.HslClr = NewCT_HslColor() + if err := d.DecodeElement(tmpcolorchoice.HslClr, &el); err != nil { + return err + } + m.EG_ColorChoice = append(m.EG_ColorChoice, tmpcolorchoice) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "sysClr"}: + tmpcolorchoice := NewEG_ColorChoice() + tmpcolorchoice.SysClr = NewCT_SystemColor() + if err := d.DecodeElement(tmpcolorchoice.SysClr, &el); err != nil { + return err + } + m.EG_ColorChoice = append(m.EG_ColorChoice, tmpcolorchoice) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "schemeClr"}: + tmpcolorchoice := NewEG_ColorChoice() + tmpcolorchoice.SchemeClr = NewCT_SchemeColor() + if err := d.DecodeElement(tmpcolorchoice.SchemeClr, &el); err != nil { + return err + } + m.EG_ColorChoice = append(m.EG_ColorChoice, tmpcolorchoice) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "prstClr"}: + tmpcolorchoice := NewEG_ColorChoice() + tmpcolorchoice.PrstClr = NewCT_PresetColor() + if err := d.DecodeElement(tmpcolorchoice.PrstClr, &el); err != nil { + return err + } + m.EG_ColorChoice = append(m.EG_ColorChoice, tmpcolorchoice) + default: + gooxml.Log("skipping unsupported element on CT_DuotoneEffect %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_DuotoneEffect + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_DuotoneEffect and its children +func (m *CT_DuotoneEffect) Validate() error { + return m.ValidateWithPath("CT_DuotoneEffect") +} + +// ValidateWithPath validates the CT_DuotoneEffect and its children, prefixing error messages with path +func (m *CT_DuotoneEffect) ValidateWithPath(path string) error { + for i, v := range m.EG_ColorChoice { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_ColorChoice[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_EffectContainer.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_EffectContainer.go new file mode 100644 index 00000000..4a3df7de --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_EffectContainer.go @@ -0,0 +1,546 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_EffectContainer struct { + TypeAttr ST_EffectContainerType + NameAttr *string + Cont *CT_EffectContainer + Effect *CT_EffectReference + AlphaBiLevel *CT_AlphaBiLevelEffect + AlphaCeiling *CT_AlphaCeilingEffect + AlphaFloor *CT_AlphaFloorEffect + AlphaInv *CT_AlphaInverseEffect + AlphaMod *CT_AlphaModulateEffect + AlphaModFix *CT_AlphaModulateFixedEffect + AlphaOutset *CT_AlphaOutsetEffect + AlphaRepl *CT_AlphaReplaceEffect + BiLevel *CT_BiLevelEffect + Blend *CT_BlendEffect + Blur *CT_BlurEffect + ClrChange *CT_ColorChangeEffect + ClrRepl *CT_ColorReplaceEffect + Duotone *CT_DuotoneEffect + Fill *CT_FillEffect + FillOverlay *CT_FillOverlayEffect + Glow *CT_GlowEffect + Grayscl *CT_GrayscaleEffect + Hsl *CT_HSLEffect + InnerShdw *CT_InnerShadowEffect + Lum *CT_LuminanceEffect + OuterShdw *CT_OuterShadowEffect + PrstShdw *CT_PresetShadowEffect + Reflection *CT_ReflectionEffect + RelOff *CT_RelativeOffsetEffect + SoftEdge *CT_SoftEdgesEffect + Tint *CT_TintEffect + Xfrm *CT_TransformEffect +} + +func NewCT_EffectContainer() *CT_EffectContainer { + ret := &CT_EffectContainer{} + return ret +} + +func (m *CT_EffectContainer) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.TypeAttr != ST_EffectContainerTypeUnset { + attr, err := m.TypeAttr.MarshalXMLAttr(xml.Name{Local: "type"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.NameAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "name"}, + Value: fmt.Sprintf("%v", *m.NameAttr)}) + } + e.EncodeToken(start) + if m.Cont != nil { + secont := xml.StartElement{Name: xml.Name{Local: "a:cont"}} + e.EncodeElement(m.Cont, secont) + } + if m.Effect != nil { + seeffect := xml.StartElement{Name: xml.Name{Local: "a:effect"}} + e.EncodeElement(m.Effect, seeffect) + } + if m.AlphaBiLevel != nil { + sealphaBiLevel := xml.StartElement{Name: xml.Name{Local: "a:alphaBiLevel"}} + e.EncodeElement(m.AlphaBiLevel, sealphaBiLevel) + } + if m.AlphaCeiling != nil { + sealphaCeiling := xml.StartElement{Name: xml.Name{Local: "a:alphaCeiling"}} + e.EncodeElement(m.AlphaCeiling, sealphaCeiling) + } + if m.AlphaFloor != nil { + sealphaFloor := xml.StartElement{Name: xml.Name{Local: "a:alphaFloor"}} + e.EncodeElement(m.AlphaFloor, sealphaFloor) + } + if m.AlphaInv != nil { + sealphaInv := xml.StartElement{Name: xml.Name{Local: "a:alphaInv"}} + e.EncodeElement(m.AlphaInv, sealphaInv) + } + if m.AlphaMod != nil { + sealphaMod := xml.StartElement{Name: xml.Name{Local: "a:alphaMod"}} + e.EncodeElement(m.AlphaMod, sealphaMod) + } + if m.AlphaModFix != nil { + sealphaModFix := xml.StartElement{Name: xml.Name{Local: "a:alphaModFix"}} + e.EncodeElement(m.AlphaModFix, sealphaModFix) + } + if m.AlphaOutset != nil { + sealphaOutset := xml.StartElement{Name: xml.Name{Local: "a:alphaOutset"}} + e.EncodeElement(m.AlphaOutset, sealphaOutset) + } + if m.AlphaRepl != nil { + sealphaRepl := xml.StartElement{Name: xml.Name{Local: "a:alphaRepl"}} + e.EncodeElement(m.AlphaRepl, sealphaRepl) + } + if m.BiLevel != nil { + sebiLevel := xml.StartElement{Name: xml.Name{Local: "a:biLevel"}} + e.EncodeElement(m.BiLevel, sebiLevel) + } + if m.Blend != nil { + seblend := xml.StartElement{Name: xml.Name{Local: "a:blend"}} + e.EncodeElement(m.Blend, seblend) + } + if m.Blur != nil { + seblur := xml.StartElement{Name: xml.Name{Local: "a:blur"}} + e.EncodeElement(m.Blur, seblur) + } + if m.ClrChange != nil { + seclrChange := xml.StartElement{Name: xml.Name{Local: "a:clrChange"}} + e.EncodeElement(m.ClrChange, seclrChange) + } + if m.ClrRepl != nil { + seclrRepl := xml.StartElement{Name: xml.Name{Local: "a:clrRepl"}} + e.EncodeElement(m.ClrRepl, seclrRepl) + } + if m.Duotone != nil { + seduotone := xml.StartElement{Name: xml.Name{Local: "a:duotone"}} + e.EncodeElement(m.Duotone, seduotone) + } + if m.Fill != nil { + sefill := xml.StartElement{Name: xml.Name{Local: "a:fill"}} + e.EncodeElement(m.Fill, sefill) + } + if m.FillOverlay != nil { + sefillOverlay := xml.StartElement{Name: xml.Name{Local: "a:fillOverlay"}} + e.EncodeElement(m.FillOverlay, sefillOverlay) + } + if m.Glow != nil { + seglow := xml.StartElement{Name: xml.Name{Local: "a:glow"}} + e.EncodeElement(m.Glow, seglow) + } + if m.Grayscl != nil { + segrayscl := xml.StartElement{Name: xml.Name{Local: "a:grayscl"}} + e.EncodeElement(m.Grayscl, segrayscl) + } + if m.Hsl != nil { + sehsl := xml.StartElement{Name: xml.Name{Local: "a:hsl"}} + e.EncodeElement(m.Hsl, sehsl) + } + if m.InnerShdw != nil { + seinnerShdw := xml.StartElement{Name: xml.Name{Local: "a:innerShdw"}} + e.EncodeElement(m.InnerShdw, seinnerShdw) + } + if m.Lum != nil { + selum := xml.StartElement{Name: xml.Name{Local: "a:lum"}} + e.EncodeElement(m.Lum, selum) + } + if m.OuterShdw != nil { + seouterShdw := xml.StartElement{Name: xml.Name{Local: "a:outerShdw"}} + e.EncodeElement(m.OuterShdw, seouterShdw) + } + if m.PrstShdw != nil { + seprstShdw := xml.StartElement{Name: xml.Name{Local: "a:prstShdw"}} + e.EncodeElement(m.PrstShdw, seprstShdw) + } + if m.Reflection != nil { + sereflection := xml.StartElement{Name: xml.Name{Local: "a:reflection"}} + e.EncodeElement(m.Reflection, sereflection) + } + if m.RelOff != nil { + serelOff := xml.StartElement{Name: xml.Name{Local: "a:relOff"}} + e.EncodeElement(m.RelOff, serelOff) + } + if m.SoftEdge != nil { + sesoftEdge := xml.StartElement{Name: xml.Name{Local: "a:softEdge"}} + e.EncodeElement(m.SoftEdge, sesoftEdge) + } + if m.Tint != nil { + setint := xml.StartElement{Name: xml.Name{Local: "a:tint"}} + e.EncodeElement(m.Tint, setint) + } + if m.Xfrm != nil { + sexfrm := xml.StartElement{Name: xml.Name{Local: "a:xfrm"}} + e.EncodeElement(m.Xfrm, sexfrm) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_EffectContainer) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "type" { + m.TypeAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "name" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.NameAttr = &parsed + continue + } + } +lCT_EffectContainer: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "cont"}: + m.Cont = NewCT_EffectContainer() + if err := d.DecodeElement(m.Cont, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "effect"}: + m.Effect = NewCT_EffectReference() + if err := d.DecodeElement(m.Effect, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaBiLevel"}: + m.AlphaBiLevel = NewCT_AlphaBiLevelEffect() + if err := d.DecodeElement(m.AlphaBiLevel, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaCeiling"}: + m.AlphaCeiling = NewCT_AlphaCeilingEffect() + if err := d.DecodeElement(m.AlphaCeiling, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaFloor"}: + m.AlphaFloor = NewCT_AlphaFloorEffect() + if err := d.DecodeElement(m.AlphaFloor, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaInv"}: + m.AlphaInv = NewCT_AlphaInverseEffect() + if err := d.DecodeElement(m.AlphaInv, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaMod"}: + m.AlphaMod = NewCT_AlphaModulateEffect() + if err := d.DecodeElement(m.AlphaMod, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaModFix"}: + m.AlphaModFix = NewCT_AlphaModulateFixedEffect() + if err := d.DecodeElement(m.AlphaModFix, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaOutset"}: + m.AlphaOutset = NewCT_AlphaOutsetEffect() + if err := d.DecodeElement(m.AlphaOutset, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaRepl"}: + m.AlphaRepl = NewCT_AlphaReplaceEffect() + if err := d.DecodeElement(m.AlphaRepl, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "biLevel"}: + m.BiLevel = NewCT_BiLevelEffect() + if err := d.DecodeElement(m.BiLevel, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blend"}: + m.Blend = NewCT_BlendEffect() + if err := d.DecodeElement(m.Blend, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blur"}: + m.Blur = NewCT_BlurEffect() + if err := d.DecodeElement(m.Blur, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "clrChange"}: + m.ClrChange = NewCT_ColorChangeEffect() + if err := d.DecodeElement(m.ClrChange, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "clrRepl"}: + m.ClrRepl = NewCT_ColorReplaceEffect() + if err := d.DecodeElement(m.ClrRepl, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "duotone"}: + m.Duotone = NewCT_DuotoneEffect() + if err := d.DecodeElement(m.Duotone, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "fill"}: + m.Fill = NewCT_FillEffect() + if err := d.DecodeElement(m.Fill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "fillOverlay"}: + m.FillOverlay = NewCT_FillOverlayEffect() + if err := d.DecodeElement(m.FillOverlay, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "glow"}: + m.Glow = NewCT_GlowEffect() + if err := d.DecodeElement(m.Glow, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "grayscl"}: + m.Grayscl = NewCT_GrayscaleEffect() + if err := d.DecodeElement(m.Grayscl, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hsl"}: + m.Hsl = NewCT_HSLEffect() + if err := d.DecodeElement(m.Hsl, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "innerShdw"}: + m.InnerShdw = NewCT_InnerShadowEffect() + if err := d.DecodeElement(m.InnerShdw, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lum"}: + m.Lum = NewCT_LuminanceEffect() + if err := d.DecodeElement(m.Lum, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "outerShdw"}: + m.OuterShdw = NewCT_OuterShadowEffect() + if err := d.DecodeElement(m.OuterShdw, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "prstShdw"}: + m.PrstShdw = NewCT_PresetShadowEffect() + if err := d.DecodeElement(m.PrstShdw, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "reflection"}: + m.Reflection = NewCT_ReflectionEffect() + if err := d.DecodeElement(m.Reflection, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "relOff"}: + m.RelOff = NewCT_RelativeOffsetEffect() + if err := d.DecodeElement(m.RelOff, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "softEdge"}: + m.SoftEdge = NewCT_SoftEdgesEffect() + if err := d.DecodeElement(m.SoftEdge, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "tint"}: + m.Tint = NewCT_TintEffect() + if err := d.DecodeElement(m.Tint, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "xfrm"}: + m.Xfrm = NewCT_TransformEffect() + if err := d.DecodeElement(m.Xfrm, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_EffectContainer %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_EffectContainer + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_EffectContainer and its children +func (m *CT_EffectContainer) Validate() error { + return m.ValidateWithPath("CT_EffectContainer") +} + +// ValidateWithPath validates the CT_EffectContainer and its children, prefixing error messages with path +func (m *CT_EffectContainer) ValidateWithPath(path string) error { + if err := m.TypeAttr.ValidateWithPath(path + "/TypeAttr"); err != nil { + return err + } + if m.Cont != nil { + if err := m.Cont.ValidateWithPath(path + "/Cont"); err != nil { + return err + } + } + if m.Effect != nil { + if err := m.Effect.ValidateWithPath(path + "/Effect"); err != nil { + return err + } + } + if m.AlphaBiLevel != nil { + if err := m.AlphaBiLevel.ValidateWithPath(path + "/AlphaBiLevel"); err != nil { + return err + } + } + if m.AlphaCeiling != nil { + if err := m.AlphaCeiling.ValidateWithPath(path + "/AlphaCeiling"); err != nil { + return err + } + } + if m.AlphaFloor != nil { + if err := m.AlphaFloor.ValidateWithPath(path + "/AlphaFloor"); err != nil { + return err + } + } + if m.AlphaInv != nil { + if err := m.AlphaInv.ValidateWithPath(path + "/AlphaInv"); err != nil { + return err + } + } + if m.AlphaMod != nil { + if err := m.AlphaMod.ValidateWithPath(path + "/AlphaMod"); err != nil { + return err + } + } + if m.AlphaModFix != nil { + if err := m.AlphaModFix.ValidateWithPath(path + "/AlphaModFix"); err != nil { + return err + } + } + if m.AlphaOutset != nil { + if err := m.AlphaOutset.ValidateWithPath(path + "/AlphaOutset"); err != nil { + return err + } + } + if m.AlphaRepl != nil { + if err := m.AlphaRepl.ValidateWithPath(path + "/AlphaRepl"); err != nil { + return err + } + } + if m.BiLevel != nil { + if err := m.BiLevel.ValidateWithPath(path + "/BiLevel"); err != nil { + return err + } + } + if m.Blend != nil { + if err := m.Blend.ValidateWithPath(path + "/Blend"); err != nil { + return err + } + } + if m.Blur != nil { + if err := m.Blur.ValidateWithPath(path + "/Blur"); err != nil { + return err + } + } + if m.ClrChange != nil { + if err := m.ClrChange.ValidateWithPath(path + "/ClrChange"); err != nil { + return err + } + } + if m.ClrRepl != nil { + if err := m.ClrRepl.ValidateWithPath(path + "/ClrRepl"); err != nil { + return err + } + } + if m.Duotone != nil { + if err := m.Duotone.ValidateWithPath(path + "/Duotone"); err != nil { + return err + } + } + if m.Fill != nil { + if err := m.Fill.ValidateWithPath(path + "/Fill"); err != nil { + return err + } + } + if m.FillOverlay != nil { + if err := m.FillOverlay.ValidateWithPath(path + "/FillOverlay"); err != nil { + return err + } + } + if m.Glow != nil { + if err := m.Glow.ValidateWithPath(path + "/Glow"); err != nil { + return err + } + } + if m.Grayscl != nil { + if err := m.Grayscl.ValidateWithPath(path + "/Grayscl"); err != nil { + return err + } + } + if m.Hsl != nil { + if err := m.Hsl.ValidateWithPath(path + "/Hsl"); err != nil { + return err + } + } + if m.InnerShdw != nil { + if err := m.InnerShdw.ValidateWithPath(path + "/InnerShdw"); err != nil { + return err + } + } + if m.Lum != nil { + if err := m.Lum.ValidateWithPath(path + "/Lum"); err != nil { + return err + } + } + if m.OuterShdw != nil { + if err := m.OuterShdw.ValidateWithPath(path + "/OuterShdw"); err != nil { + return err + } + } + if m.PrstShdw != nil { + if err := m.PrstShdw.ValidateWithPath(path + "/PrstShdw"); err != nil { + return err + } + } + if m.Reflection != nil { + if err := m.Reflection.ValidateWithPath(path + "/Reflection"); err != nil { + return err + } + } + if m.RelOff != nil { + if err := m.RelOff.ValidateWithPath(path + "/RelOff"); err != nil { + return err + } + } + if m.SoftEdge != nil { + if err := m.SoftEdge.ValidateWithPath(path + "/SoftEdge"); err != nil { + return err + } + } + if m.Tint != nil { + if err := m.Tint.ValidateWithPath(path + "/Tint"); err != nil { + return err + } + } + if m.Xfrm != nil { + if err := m.Xfrm.ValidateWithPath(path + "/Xfrm"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_EffectList.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_EffectList.go new file mode 100644 index 00000000..27ae929d --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_EffectList.go @@ -0,0 +1,185 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_EffectList struct { + Blur *CT_BlurEffect + FillOverlay *CT_FillOverlayEffect + Glow *CT_GlowEffect + InnerShdw *CT_InnerShadowEffect + OuterShdw *CT_OuterShadowEffect + PrstShdw *CT_PresetShadowEffect + Reflection *CT_ReflectionEffect + SoftEdge *CT_SoftEdgesEffect +} + +func NewCT_EffectList() *CT_EffectList { + ret := &CT_EffectList{} + return ret +} + +func (m *CT_EffectList) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Blur != nil { + seblur := xml.StartElement{Name: xml.Name{Local: "a:blur"}} + e.EncodeElement(m.Blur, seblur) + } + if m.FillOverlay != nil { + sefillOverlay := xml.StartElement{Name: xml.Name{Local: "a:fillOverlay"}} + e.EncodeElement(m.FillOverlay, sefillOverlay) + } + if m.Glow != nil { + seglow := xml.StartElement{Name: xml.Name{Local: "a:glow"}} + e.EncodeElement(m.Glow, seglow) + } + if m.InnerShdw != nil { + seinnerShdw := xml.StartElement{Name: xml.Name{Local: "a:innerShdw"}} + e.EncodeElement(m.InnerShdw, seinnerShdw) + } + if m.OuterShdw != nil { + seouterShdw := xml.StartElement{Name: xml.Name{Local: "a:outerShdw"}} + e.EncodeElement(m.OuterShdw, seouterShdw) + } + if m.PrstShdw != nil { + seprstShdw := xml.StartElement{Name: xml.Name{Local: "a:prstShdw"}} + e.EncodeElement(m.PrstShdw, seprstShdw) + } + if m.Reflection != nil { + sereflection := xml.StartElement{Name: xml.Name{Local: "a:reflection"}} + e.EncodeElement(m.Reflection, sereflection) + } + if m.SoftEdge != nil { + sesoftEdge := xml.StartElement{Name: xml.Name{Local: "a:softEdge"}} + e.EncodeElement(m.SoftEdge, sesoftEdge) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_EffectList) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_EffectList: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blur"}: + m.Blur = NewCT_BlurEffect() + if err := d.DecodeElement(m.Blur, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "fillOverlay"}: + m.FillOverlay = NewCT_FillOverlayEffect() + if err := d.DecodeElement(m.FillOverlay, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "glow"}: + m.Glow = NewCT_GlowEffect() + if err := d.DecodeElement(m.Glow, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "innerShdw"}: + m.InnerShdw = NewCT_InnerShadowEffect() + if err := d.DecodeElement(m.InnerShdw, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "outerShdw"}: + m.OuterShdw = NewCT_OuterShadowEffect() + if err := d.DecodeElement(m.OuterShdw, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "prstShdw"}: + m.PrstShdw = NewCT_PresetShadowEffect() + if err := d.DecodeElement(m.PrstShdw, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "reflection"}: + m.Reflection = NewCT_ReflectionEffect() + if err := d.DecodeElement(m.Reflection, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "softEdge"}: + m.SoftEdge = NewCT_SoftEdgesEffect() + if err := d.DecodeElement(m.SoftEdge, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_EffectList %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_EffectList + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_EffectList and its children +func (m *CT_EffectList) Validate() error { + return m.ValidateWithPath("CT_EffectList") +} + +// ValidateWithPath validates the CT_EffectList and its children, prefixing error messages with path +func (m *CT_EffectList) ValidateWithPath(path string) error { + if m.Blur != nil { + if err := m.Blur.ValidateWithPath(path + "/Blur"); err != nil { + return err + } + } + if m.FillOverlay != nil { + if err := m.FillOverlay.ValidateWithPath(path + "/FillOverlay"); err != nil { + return err + } + } + if m.Glow != nil { + if err := m.Glow.ValidateWithPath(path + "/Glow"); err != nil { + return err + } + } + if m.InnerShdw != nil { + if err := m.InnerShdw.ValidateWithPath(path + "/InnerShdw"); err != nil { + return err + } + } + if m.OuterShdw != nil { + if err := m.OuterShdw.ValidateWithPath(path + "/OuterShdw"); err != nil { + return err + } + } + if m.PrstShdw != nil { + if err := m.PrstShdw.ValidateWithPath(path + "/PrstShdw"); err != nil { + return err + } + } + if m.Reflection != nil { + if err := m.Reflection.ValidateWithPath(path + "/Reflection"); err != nil { + return err + } + } + if m.SoftEdge != nil { + if err := m.SoftEdge.ValidateWithPath(path + "/SoftEdge"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_EffectProperties.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_EffectProperties.go new file mode 100644 index 00000000..a8f24707 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_EffectProperties.go @@ -0,0 +1,95 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_EffectProperties struct { + EffectLst *CT_EffectList + EffectDag *CT_EffectContainer +} + +func NewCT_EffectProperties() *CT_EffectProperties { + ret := &CT_EffectProperties{} + return ret +} + +func (m *CT_EffectProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.EffectLst != nil { + seeffectLst := xml.StartElement{Name: xml.Name{Local: "a:effectLst"}} + e.EncodeElement(m.EffectLst, seeffectLst) + } + if m.EffectDag != nil { + seeffectDag := xml.StartElement{Name: xml.Name{Local: "a:effectDag"}} + e.EncodeElement(m.EffectDag, seeffectDag) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_EffectProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_EffectProperties: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "effectLst"}: + m.EffectLst = NewCT_EffectList() + if err := d.DecodeElement(m.EffectLst, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "effectDag"}: + m.EffectDag = NewCT_EffectContainer() + if err := d.DecodeElement(m.EffectDag, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_EffectProperties %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_EffectProperties + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_EffectProperties and its children +func (m *CT_EffectProperties) Validate() error { + return m.ValidateWithPath("CT_EffectProperties") +} + +// ValidateWithPath validates the CT_EffectProperties and its children, prefixing error messages with path +func (m *CT_EffectProperties) ValidateWithPath(path string) error { + if m.EffectLst != nil { + if err := m.EffectLst.ValidateWithPath(path + "/EffectLst"); err != nil { + return err + } + } + if m.EffectDag != nil { + if err := m.EffectDag.ValidateWithPath(path + "/EffectDag"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_EffectReference.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_EffectReference.go new file mode 100644 index 00000000..d5118f3c --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_EffectReference.go @@ -0,0 +1,67 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_EffectReference struct { + RefAttr string +} + +func NewCT_EffectReference() *CT_EffectReference { + ret := &CT_EffectReference{} + return ret +} + +func (m *CT_EffectReference) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "ref"}, + Value: fmt.Sprintf("%v", m.RefAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_EffectReference) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "ref" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.RefAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_EffectReference: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_EffectReference and its children +func (m *CT_EffectReference) Validate() error { + return m.ValidateWithPath("CT_EffectReference") +} + +// ValidateWithPath validates the CT_EffectReference and its children, prefixing error messages with path +func (m *CT_EffectReference) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_EffectStyleItem.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_EffectStyleItem.go new file mode 100644 index 00000000..3a445d82 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_EffectStyleItem.go @@ -0,0 +1,125 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_EffectStyleItem struct { + EffectLst *CT_EffectList + EffectDag *CT_EffectContainer + Scene3d *CT_Scene3D + Sp3d *CT_Shape3D +} + +func NewCT_EffectStyleItem() *CT_EffectStyleItem { + ret := &CT_EffectStyleItem{} + return ret +} + +func (m *CT_EffectStyleItem) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.EffectLst != nil { + seeffectLst := xml.StartElement{Name: xml.Name{Local: "a:effectLst"}} + e.EncodeElement(m.EffectLst, seeffectLst) + } + if m.EffectDag != nil { + seeffectDag := xml.StartElement{Name: xml.Name{Local: "a:effectDag"}} + e.EncodeElement(m.EffectDag, seeffectDag) + } + if m.Scene3d != nil { + sescene3d := xml.StartElement{Name: xml.Name{Local: "a:scene3d"}} + e.EncodeElement(m.Scene3d, sescene3d) + } + if m.Sp3d != nil { + sesp3d := xml.StartElement{Name: xml.Name{Local: "a:sp3d"}} + e.EncodeElement(m.Sp3d, sesp3d) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_EffectStyleItem) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_EffectStyleItem: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "effectLst"}: + m.EffectLst = NewCT_EffectList() + if err := d.DecodeElement(m.EffectLst, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "effectDag"}: + m.EffectDag = NewCT_EffectContainer() + if err := d.DecodeElement(m.EffectDag, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "scene3d"}: + m.Scene3d = NewCT_Scene3D() + if err := d.DecodeElement(m.Scene3d, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "sp3d"}: + m.Sp3d = NewCT_Shape3D() + if err := d.DecodeElement(m.Sp3d, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_EffectStyleItem %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_EffectStyleItem + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_EffectStyleItem and its children +func (m *CT_EffectStyleItem) Validate() error { + return m.ValidateWithPath("CT_EffectStyleItem") +} + +// ValidateWithPath validates the CT_EffectStyleItem and its children, prefixing error messages with path +func (m *CT_EffectStyleItem) ValidateWithPath(path string) error { + if m.EffectLst != nil { + if err := m.EffectLst.ValidateWithPath(path + "/EffectLst"); err != nil { + return err + } + } + if m.EffectDag != nil { + if err := m.EffectDag.ValidateWithPath(path + "/EffectDag"); err != nil { + return err + } + } + if m.Scene3d != nil { + if err := m.Scene3d.ValidateWithPath(path + "/Scene3d"); err != nil { + return err + } + } + if m.Sp3d != nil { + if err := m.Sp3d.ValidateWithPath(path + "/Sp3d"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_EffectStyleList.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_EffectStyleList.go new file mode 100644 index 00000000..357c74e0 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_EffectStyleList.go @@ -0,0 +1,82 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_EffectStyleList struct { + EffectStyle []*CT_EffectStyleItem +} + +func NewCT_EffectStyleList() *CT_EffectStyleList { + ret := &CT_EffectStyleList{} + return ret +} + +func (m *CT_EffectStyleList) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + seeffectStyle := xml.StartElement{Name: xml.Name{Local: "a:effectStyle"}} + for _, c := range m.EffectStyle { + e.EncodeElement(c, seeffectStyle) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_EffectStyleList) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_EffectStyleList: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "effectStyle"}: + tmp := NewCT_EffectStyleItem() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.EffectStyle = append(m.EffectStyle, tmp) + default: + gooxml.Log("skipping unsupported element on CT_EffectStyleList %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_EffectStyleList + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_EffectStyleList and its children +func (m *CT_EffectStyleList) Validate() error { + return m.ValidateWithPath("CT_EffectStyleList") +} + +// ValidateWithPath validates the CT_EffectStyleList and its children, prefixing error messages with path +func (m *CT_EffectStyleList) ValidateWithPath(path string) error { + for i, v := range m.EffectStyle { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EffectStyle[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_EmbeddedWAVAudioFile.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_EmbeddedWAVAudioFile.go new file mode 100644 index 00000000..d4c4f31d --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_EmbeddedWAVAudioFile.go @@ -0,0 +1,80 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_EmbeddedWAVAudioFile struct { + EmbedAttr string + NameAttr *string +} + +func NewCT_EmbeddedWAVAudioFile() *CT_EmbeddedWAVAudioFile { + ret := &CT_EmbeddedWAVAudioFile{} + return ret +} + +func (m *CT_EmbeddedWAVAudioFile) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "r:embed"}, + Value: fmt.Sprintf("%v", m.EmbedAttr)}) + if m.NameAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "name"}, + Value: fmt.Sprintf("%v", *m.NameAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_EmbeddedWAVAudioFile) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Space == "http://schemas.openxmlformats.org/officeDocument/2006/relationships" && attr.Name.Local == "embed" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.EmbedAttr = parsed + continue + } + if attr.Name.Local == "name" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.NameAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_EmbeddedWAVAudioFile: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_EmbeddedWAVAudioFile and its children +func (m *CT_EmbeddedWAVAudioFile) Validate() error { + return m.ValidateWithPath("CT_EmbeddedWAVAudioFile") +} + +// ValidateWithPath validates the CT_EmbeddedWAVAudioFile and its children, prefixing error messages with path +func (m *CT_EmbeddedWAVAudioFile) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_EmptyElement.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_EmptyElement.go new file mode 100644 index 00000000..f948bcef --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_EmptyElement.go @@ -0,0 +1,54 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_EmptyElement struct { +} + +func NewCT_EmptyElement() *CT_EmptyElement { + ret := &CT_EmptyElement{} + return ret +} + +func (m *CT_EmptyElement) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_EmptyElement) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_EmptyElement: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_EmptyElement and its children +func (m *CT_EmptyElement) Validate() error { + return m.ValidateWithPath("CT_EmptyElement") +} + +// ValidateWithPath validates the CT_EmptyElement and its children, prefixing error messages with path +func (m *CT_EmptyElement) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_FillEffect.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_FillEffect.go new file mode 100644 index 00000000..1ea7fda7 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_FillEffect.go @@ -0,0 +1,155 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_FillEffect struct { + NoFill *CT_NoFillProperties + SolidFill *CT_SolidColorFillProperties + GradFill *CT_GradientFillProperties + BlipFill *CT_BlipFillProperties + PattFill *CT_PatternFillProperties + GrpFill *CT_GroupFillProperties +} + +func NewCT_FillEffect() *CT_FillEffect { + ret := &CT_FillEffect{} + return ret +} + +func (m *CT_FillEffect) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.NoFill != nil { + senoFill := xml.StartElement{Name: xml.Name{Local: "a:noFill"}} + e.EncodeElement(m.NoFill, senoFill) + } + if m.SolidFill != nil { + sesolidFill := xml.StartElement{Name: xml.Name{Local: "a:solidFill"}} + e.EncodeElement(m.SolidFill, sesolidFill) + } + if m.GradFill != nil { + segradFill := xml.StartElement{Name: xml.Name{Local: "a:gradFill"}} + e.EncodeElement(m.GradFill, segradFill) + } + if m.BlipFill != nil { + seblipFill := xml.StartElement{Name: xml.Name{Local: "a:blipFill"}} + e.EncodeElement(m.BlipFill, seblipFill) + } + if m.PattFill != nil { + sepattFill := xml.StartElement{Name: xml.Name{Local: "a:pattFill"}} + e.EncodeElement(m.PattFill, sepattFill) + } + if m.GrpFill != nil { + segrpFill := xml.StartElement{Name: xml.Name{Local: "a:grpFill"}} + e.EncodeElement(m.GrpFill, segrpFill) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_FillEffect) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_FillEffect: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "noFill"}: + m.NoFill = NewCT_NoFillProperties() + if err := d.DecodeElement(m.NoFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "solidFill"}: + m.SolidFill = NewCT_SolidColorFillProperties() + if err := d.DecodeElement(m.SolidFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "gradFill"}: + m.GradFill = NewCT_GradientFillProperties() + if err := d.DecodeElement(m.GradFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blipFill"}: + m.BlipFill = NewCT_BlipFillProperties() + if err := d.DecodeElement(m.BlipFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "pattFill"}: + m.PattFill = NewCT_PatternFillProperties() + if err := d.DecodeElement(m.PattFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "grpFill"}: + m.GrpFill = NewCT_GroupFillProperties() + if err := d.DecodeElement(m.GrpFill, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_FillEffect %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_FillEffect + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_FillEffect and its children +func (m *CT_FillEffect) Validate() error { + return m.ValidateWithPath("CT_FillEffect") +} + +// ValidateWithPath validates the CT_FillEffect and its children, prefixing error messages with path +func (m *CT_FillEffect) ValidateWithPath(path string) error { + if m.NoFill != nil { + if err := m.NoFill.ValidateWithPath(path + "/NoFill"); err != nil { + return err + } + } + if m.SolidFill != nil { + if err := m.SolidFill.ValidateWithPath(path + "/SolidFill"); err != nil { + return err + } + } + if m.GradFill != nil { + if err := m.GradFill.ValidateWithPath(path + "/GradFill"); err != nil { + return err + } + } + if m.BlipFill != nil { + if err := m.BlipFill.ValidateWithPath(path + "/BlipFill"); err != nil { + return err + } + } + if m.PattFill != nil { + if err := m.PattFill.ValidateWithPath(path + "/PattFill"); err != nil { + return err + } + } + if m.GrpFill != nil { + if err := m.GrpFill.ValidateWithPath(path + "/GrpFill"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_FillOverlayEffect.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_FillOverlayEffect.go new file mode 100644 index 00000000..119dba4d --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_FillOverlayEffect.go @@ -0,0 +1,176 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_FillOverlayEffect struct { + BlendAttr ST_BlendMode + NoFill *CT_NoFillProperties + SolidFill *CT_SolidColorFillProperties + GradFill *CT_GradientFillProperties + BlipFill *CT_BlipFillProperties + PattFill *CT_PatternFillProperties + GrpFill *CT_GroupFillProperties +} + +func NewCT_FillOverlayEffect() *CT_FillOverlayEffect { + ret := &CT_FillOverlayEffect{} + ret.BlendAttr = ST_BlendMode(1) + return ret +} + +func (m *CT_FillOverlayEffect) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.BlendAttr.MarshalXMLAttr(xml.Name{Local: "blend"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + if m.NoFill != nil { + senoFill := xml.StartElement{Name: xml.Name{Local: "a:noFill"}} + e.EncodeElement(m.NoFill, senoFill) + } + if m.SolidFill != nil { + sesolidFill := xml.StartElement{Name: xml.Name{Local: "a:solidFill"}} + e.EncodeElement(m.SolidFill, sesolidFill) + } + if m.GradFill != nil { + segradFill := xml.StartElement{Name: xml.Name{Local: "a:gradFill"}} + e.EncodeElement(m.GradFill, segradFill) + } + if m.BlipFill != nil { + seblipFill := xml.StartElement{Name: xml.Name{Local: "a:blipFill"}} + e.EncodeElement(m.BlipFill, seblipFill) + } + if m.PattFill != nil { + sepattFill := xml.StartElement{Name: xml.Name{Local: "a:pattFill"}} + e.EncodeElement(m.PattFill, sepattFill) + } + if m.GrpFill != nil { + segrpFill := xml.StartElement{Name: xml.Name{Local: "a:grpFill"}} + e.EncodeElement(m.GrpFill, segrpFill) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_FillOverlayEffect) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.BlendAttr = ST_BlendMode(1) + for _, attr := range start.Attr { + if attr.Name.Local == "blend" { + m.BlendAttr.UnmarshalXMLAttr(attr) + continue + } + } +lCT_FillOverlayEffect: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "noFill"}: + m.NoFill = NewCT_NoFillProperties() + if err := d.DecodeElement(m.NoFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "solidFill"}: + m.SolidFill = NewCT_SolidColorFillProperties() + if err := d.DecodeElement(m.SolidFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "gradFill"}: + m.GradFill = NewCT_GradientFillProperties() + if err := d.DecodeElement(m.GradFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blipFill"}: + m.BlipFill = NewCT_BlipFillProperties() + if err := d.DecodeElement(m.BlipFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "pattFill"}: + m.PattFill = NewCT_PatternFillProperties() + if err := d.DecodeElement(m.PattFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "grpFill"}: + m.GrpFill = NewCT_GroupFillProperties() + if err := d.DecodeElement(m.GrpFill, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_FillOverlayEffect %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_FillOverlayEffect + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_FillOverlayEffect and its children +func (m *CT_FillOverlayEffect) Validate() error { + return m.ValidateWithPath("CT_FillOverlayEffect") +} + +// ValidateWithPath validates the CT_FillOverlayEffect and its children, prefixing error messages with path +func (m *CT_FillOverlayEffect) ValidateWithPath(path string) error { + if m.BlendAttr == ST_BlendModeUnset { + return fmt.Errorf("%s/BlendAttr is a mandatory field", path) + } + if err := m.BlendAttr.ValidateWithPath(path + "/BlendAttr"); err != nil { + return err + } + if m.NoFill != nil { + if err := m.NoFill.ValidateWithPath(path + "/NoFill"); err != nil { + return err + } + } + if m.SolidFill != nil { + if err := m.SolidFill.ValidateWithPath(path + "/SolidFill"); err != nil { + return err + } + } + if m.GradFill != nil { + if err := m.GradFill.ValidateWithPath(path + "/GradFill"); err != nil { + return err + } + } + if m.BlipFill != nil { + if err := m.BlipFill.ValidateWithPath(path + "/BlipFill"); err != nil { + return err + } + } + if m.PattFill != nil { + if err := m.PattFill.ValidateWithPath(path + "/PattFill"); err != nil { + return err + } + } + if m.GrpFill != nil { + if err := m.GrpFill.ValidateWithPath(path + "/GrpFill"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_FillProperties.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_FillProperties.go new file mode 100644 index 00000000..4b92d0c9 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_FillProperties.go @@ -0,0 +1,155 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_FillProperties struct { + NoFill *CT_NoFillProperties + SolidFill *CT_SolidColorFillProperties + GradFill *CT_GradientFillProperties + BlipFill *CT_BlipFillProperties + PattFill *CT_PatternFillProperties + GrpFill *CT_GroupFillProperties +} + +func NewCT_FillProperties() *CT_FillProperties { + ret := &CT_FillProperties{} + return ret +} + +func (m *CT_FillProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.NoFill != nil { + senoFill := xml.StartElement{Name: xml.Name{Local: "a:noFill"}} + e.EncodeElement(m.NoFill, senoFill) + } + if m.SolidFill != nil { + sesolidFill := xml.StartElement{Name: xml.Name{Local: "a:solidFill"}} + e.EncodeElement(m.SolidFill, sesolidFill) + } + if m.GradFill != nil { + segradFill := xml.StartElement{Name: xml.Name{Local: "a:gradFill"}} + e.EncodeElement(m.GradFill, segradFill) + } + if m.BlipFill != nil { + seblipFill := xml.StartElement{Name: xml.Name{Local: "a:blipFill"}} + e.EncodeElement(m.BlipFill, seblipFill) + } + if m.PattFill != nil { + sepattFill := xml.StartElement{Name: xml.Name{Local: "a:pattFill"}} + e.EncodeElement(m.PattFill, sepattFill) + } + if m.GrpFill != nil { + segrpFill := xml.StartElement{Name: xml.Name{Local: "a:grpFill"}} + e.EncodeElement(m.GrpFill, segrpFill) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_FillProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_FillProperties: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "noFill"}: + m.NoFill = NewCT_NoFillProperties() + if err := d.DecodeElement(m.NoFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "solidFill"}: + m.SolidFill = NewCT_SolidColorFillProperties() + if err := d.DecodeElement(m.SolidFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "gradFill"}: + m.GradFill = NewCT_GradientFillProperties() + if err := d.DecodeElement(m.GradFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blipFill"}: + m.BlipFill = NewCT_BlipFillProperties() + if err := d.DecodeElement(m.BlipFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "pattFill"}: + m.PattFill = NewCT_PatternFillProperties() + if err := d.DecodeElement(m.PattFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "grpFill"}: + m.GrpFill = NewCT_GroupFillProperties() + if err := d.DecodeElement(m.GrpFill, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_FillProperties %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_FillProperties + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_FillProperties and its children +func (m *CT_FillProperties) Validate() error { + return m.ValidateWithPath("CT_FillProperties") +} + +// ValidateWithPath validates the CT_FillProperties and its children, prefixing error messages with path +func (m *CT_FillProperties) ValidateWithPath(path string) error { + if m.NoFill != nil { + if err := m.NoFill.ValidateWithPath(path + "/NoFill"); err != nil { + return err + } + } + if m.SolidFill != nil { + if err := m.SolidFill.ValidateWithPath(path + "/SolidFill"); err != nil { + return err + } + } + if m.GradFill != nil { + if err := m.GradFill.ValidateWithPath(path + "/GradFill"); err != nil { + return err + } + } + if m.BlipFill != nil { + if err := m.BlipFill.ValidateWithPath(path + "/BlipFill"); err != nil { + return err + } + } + if m.PattFill != nil { + if err := m.PattFill.ValidateWithPath(path + "/PattFill"); err != nil { + return err + } + } + if m.GrpFill != nil { + if err := m.GrpFill.ValidateWithPath(path + "/GrpFill"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_FillStyleList.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_FillStyleList.go new file mode 100644 index 00000000..8d0a1baa --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_FillStyleList.go @@ -0,0 +1,117 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_FillStyleList struct { + EG_FillProperties []*EG_FillProperties +} + +func NewCT_FillStyleList() *CT_FillStyleList { + ret := &CT_FillStyleList{} + return ret +} + +func (m *CT_FillStyleList) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + for _, c := range m.EG_FillProperties { + c.MarshalXML(e, xml.StartElement{}) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_FillStyleList) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_FillStyleList: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "noFill"}: + tmpfillproperties := NewEG_FillProperties() + tmpfillproperties.NoFill = NewCT_NoFillProperties() + if err := d.DecodeElement(tmpfillproperties.NoFill, &el); err != nil { + return err + } + m.EG_FillProperties = append(m.EG_FillProperties, tmpfillproperties) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "solidFill"}: + tmpfillproperties := NewEG_FillProperties() + tmpfillproperties.SolidFill = NewCT_SolidColorFillProperties() + if err := d.DecodeElement(tmpfillproperties.SolidFill, &el); err != nil { + return err + } + m.EG_FillProperties = append(m.EG_FillProperties, tmpfillproperties) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "gradFill"}: + tmpfillproperties := NewEG_FillProperties() + tmpfillproperties.GradFill = NewCT_GradientFillProperties() + if err := d.DecodeElement(tmpfillproperties.GradFill, &el); err != nil { + return err + } + m.EG_FillProperties = append(m.EG_FillProperties, tmpfillproperties) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blipFill"}: + tmpfillproperties := NewEG_FillProperties() + tmpfillproperties.BlipFill = NewCT_BlipFillProperties() + if err := d.DecodeElement(tmpfillproperties.BlipFill, &el); err != nil { + return err + } + m.EG_FillProperties = append(m.EG_FillProperties, tmpfillproperties) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "pattFill"}: + tmpfillproperties := NewEG_FillProperties() + tmpfillproperties.PattFill = NewCT_PatternFillProperties() + if err := d.DecodeElement(tmpfillproperties.PattFill, &el); err != nil { + return err + } + m.EG_FillProperties = append(m.EG_FillProperties, tmpfillproperties) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "grpFill"}: + tmpfillproperties := NewEG_FillProperties() + tmpfillproperties.GrpFill = NewCT_GroupFillProperties() + if err := d.DecodeElement(tmpfillproperties.GrpFill, &el); err != nil { + return err + } + m.EG_FillProperties = append(m.EG_FillProperties, tmpfillproperties) + default: + gooxml.Log("skipping unsupported element on CT_FillStyleList %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_FillStyleList + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_FillStyleList and its children +func (m *CT_FillStyleList) Validate() error { + return m.ValidateWithPath("CT_FillStyleList") +} + +// ValidateWithPath validates the CT_FillStyleList and its children, prefixing error messages with path +func (m *CT_FillStyleList) ValidateWithPath(path string) error { + for i, v := range m.EG_FillProperties { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_FillProperties[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_FixedPercentage.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_FixedPercentage.go new file mode 100644 index 00000000..f4932374 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_FixedPercentage.go @@ -0,0 +1,70 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_FixedPercentage struct { + ValAttr ST_FixedPercentage +} + +func NewCT_FixedPercentage() *CT_FixedPercentage { + ret := &CT_FixedPercentage{} + return ret +} + +func (m *CT_FixedPercentage) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "val"}, + Value: fmt.Sprintf("%v", m.ValAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_FixedPercentage) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := ParseUnionST_FixedPercentage(attr.Value) + if err != nil { + return err + } + m.ValAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_FixedPercentage: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_FixedPercentage and its children +func (m *CT_FixedPercentage) Validate() error { + return m.ValidateWithPath("CT_FixedPercentage") +} + +// ValidateWithPath validates the CT_FixedPercentage and its children, prefixing error messages with path +func (m *CT_FixedPercentage) ValidateWithPath(path string) error { + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_FlatText.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_FlatText.go new file mode 100644 index 00000000..10367374 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_FlatText.go @@ -0,0 +1,74 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_FlatText struct { + ZAttr *ST_Coordinate +} + +func NewCT_FlatText() *CT_FlatText { + ret := &CT_FlatText{} + return ret +} + +func (m *CT_FlatText) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.ZAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "z"}, + Value: fmt.Sprintf("%v", *m.ZAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_FlatText) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "z" { + parsed, err := ParseUnionST_Coordinate(attr.Value) + if err != nil { + return err + } + m.ZAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_FlatText: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_FlatText and its children +func (m *CT_FlatText) Validate() error { + return m.ValidateWithPath("CT_FlatText") +} + +// ValidateWithPath validates the CT_FlatText and its children, prefixing error messages with path +func (m *CT_FlatText) ValidateWithPath(path string) error { + if m.ZAttr != nil { + if err := m.ZAttr.ValidateWithPath(path + "/ZAttr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_FontCollection.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_FontCollection.go new file mode 100644 index 00000000..bb86941e --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_FontCollection.go @@ -0,0 +1,135 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_FontCollection struct { + Latin *CT_TextFont + Ea *CT_TextFont + Cs *CT_TextFont + Font []*CT_SupplementalFont + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_FontCollection() *CT_FontCollection { + ret := &CT_FontCollection{} + ret.Latin = NewCT_TextFont() + ret.Ea = NewCT_TextFont() + ret.Cs = NewCT_TextFont() + return ret +} + +func (m *CT_FontCollection) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + selatin := xml.StartElement{Name: xml.Name{Local: "a:latin"}} + e.EncodeElement(m.Latin, selatin) + seea := xml.StartElement{Name: xml.Name{Local: "a:ea"}} + e.EncodeElement(m.Ea, seea) + secs := xml.StartElement{Name: xml.Name{Local: "a:cs"}} + e.EncodeElement(m.Cs, secs) + if m.Font != nil { + sefont := xml.StartElement{Name: xml.Name{Local: "a:font"}} + for _, c := range m.Font { + e.EncodeElement(c, sefont) + } + } + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_FontCollection) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.Latin = NewCT_TextFont() + m.Ea = NewCT_TextFont() + m.Cs = NewCT_TextFont() +lCT_FontCollection: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "latin"}: + if err := d.DecodeElement(m.Latin, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "ea"}: + if err := d.DecodeElement(m.Ea, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "cs"}: + if err := d.DecodeElement(m.Cs, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "font"}: + tmp := NewCT_SupplementalFont() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Font = append(m.Font, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_FontCollection %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_FontCollection + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_FontCollection and its children +func (m *CT_FontCollection) Validate() error { + return m.ValidateWithPath("CT_FontCollection") +} + +// ValidateWithPath validates the CT_FontCollection and its children, prefixing error messages with path +func (m *CT_FontCollection) ValidateWithPath(path string) error { + if err := m.Latin.ValidateWithPath(path + "/Latin"); err != nil { + return err + } + if err := m.Ea.ValidateWithPath(path + "/Ea"); err != nil { + return err + } + if err := m.Cs.ValidateWithPath(path + "/Cs"); err != nil { + return err + } + for i, v := range m.Font { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Font[%d]", path, i)); err != nil { + return err + } + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_FontReference.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_FontReference.go new file mode 100644 index 00000000..c3d23c3a --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_FontReference.go @@ -0,0 +1,176 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_FontReference struct { + IdxAttr ST_FontCollectionIndex + ScrgbClr *CT_ScRgbColor + SrgbClr *CT_SRgbColor + HslClr *CT_HslColor + SysClr *CT_SystemColor + SchemeClr *CT_SchemeColor + PrstClr *CT_PresetColor +} + +func NewCT_FontReference() *CT_FontReference { + ret := &CT_FontReference{} + ret.IdxAttr = ST_FontCollectionIndex(1) + return ret +} + +func (m *CT_FontReference) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.IdxAttr.MarshalXMLAttr(xml.Name{Local: "idx"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + if m.ScrgbClr != nil { + sescrgbClr := xml.StartElement{Name: xml.Name{Local: "a:scrgbClr"}} + e.EncodeElement(m.ScrgbClr, sescrgbClr) + } + if m.SrgbClr != nil { + sesrgbClr := xml.StartElement{Name: xml.Name{Local: "a:srgbClr"}} + e.EncodeElement(m.SrgbClr, sesrgbClr) + } + if m.HslClr != nil { + sehslClr := xml.StartElement{Name: xml.Name{Local: "a:hslClr"}} + e.EncodeElement(m.HslClr, sehslClr) + } + if m.SysClr != nil { + sesysClr := xml.StartElement{Name: xml.Name{Local: "a:sysClr"}} + e.EncodeElement(m.SysClr, sesysClr) + } + if m.SchemeClr != nil { + seschemeClr := xml.StartElement{Name: xml.Name{Local: "a:schemeClr"}} + e.EncodeElement(m.SchemeClr, seschemeClr) + } + if m.PrstClr != nil { + seprstClr := xml.StartElement{Name: xml.Name{Local: "a:prstClr"}} + e.EncodeElement(m.PrstClr, seprstClr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_FontReference) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.IdxAttr = ST_FontCollectionIndex(1) + for _, attr := range start.Attr { + if attr.Name.Local == "idx" { + m.IdxAttr.UnmarshalXMLAttr(attr) + continue + } + } +lCT_FontReference: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "scrgbClr"}: + m.ScrgbClr = NewCT_ScRgbColor() + if err := d.DecodeElement(m.ScrgbClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "srgbClr"}: + m.SrgbClr = NewCT_SRgbColor() + if err := d.DecodeElement(m.SrgbClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hslClr"}: + m.HslClr = NewCT_HslColor() + if err := d.DecodeElement(m.HslClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "sysClr"}: + m.SysClr = NewCT_SystemColor() + if err := d.DecodeElement(m.SysClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "schemeClr"}: + m.SchemeClr = NewCT_SchemeColor() + if err := d.DecodeElement(m.SchemeClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "prstClr"}: + m.PrstClr = NewCT_PresetColor() + if err := d.DecodeElement(m.PrstClr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_FontReference %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_FontReference + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_FontReference and its children +func (m *CT_FontReference) Validate() error { + return m.ValidateWithPath("CT_FontReference") +} + +// ValidateWithPath validates the CT_FontReference and its children, prefixing error messages with path +func (m *CT_FontReference) ValidateWithPath(path string) error { + if m.IdxAttr == ST_FontCollectionIndexUnset { + return fmt.Errorf("%s/IdxAttr is a mandatory field", path) + } + if err := m.IdxAttr.ValidateWithPath(path + "/IdxAttr"); err != nil { + return err + } + if m.ScrgbClr != nil { + if err := m.ScrgbClr.ValidateWithPath(path + "/ScrgbClr"); err != nil { + return err + } + } + if m.SrgbClr != nil { + if err := m.SrgbClr.ValidateWithPath(path + "/SrgbClr"); err != nil { + return err + } + } + if m.HslClr != nil { + if err := m.HslClr.ValidateWithPath(path + "/HslClr"); err != nil { + return err + } + } + if m.SysClr != nil { + if err := m.SysClr.ValidateWithPath(path + "/SysClr"); err != nil { + return err + } + } + if m.SchemeClr != nil { + if err := m.SchemeClr.ValidateWithPath(path + "/SchemeClr"); err != nil { + return err + } + } + if m.PrstClr != nil { + if err := m.PrstClr.ValidateWithPath(path + "/PrstClr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_FontScheme.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_FontScheme.go new file mode 100644 index 00000000..0d9b723f --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_FontScheme.go @@ -0,0 +1,118 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_FontScheme struct { + NameAttr string + MajorFont *CT_FontCollection + MinorFont *CT_FontCollection + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_FontScheme() *CT_FontScheme { + ret := &CT_FontScheme{} + ret.MajorFont = NewCT_FontCollection() + ret.MinorFont = NewCT_FontCollection() + return ret +} + +func (m *CT_FontScheme) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "name"}, + Value: fmt.Sprintf("%v", m.NameAttr)}) + e.EncodeToken(start) + semajorFont := xml.StartElement{Name: xml.Name{Local: "a:majorFont"}} + e.EncodeElement(m.MajorFont, semajorFont) + seminorFont := xml.StartElement{Name: xml.Name{Local: "a:minorFont"}} + e.EncodeElement(m.MinorFont, seminorFont) + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_FontScheme) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.MajorFont = NewCT_FontCollection() + m.MinorFont = NewCT_FontCollection() + for _, attr := range start.Attr { + if attr.Name.Local == "name" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.NameAttr = parsed + continue + } + } +lCT_FontScheme: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "majorFont"}: + if err := d.DecodeElement(m.MajorFont, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "minorFont"}: + if err := d.DecodeElement(m.MinorFont, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_FontScheme %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_FontScheme + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_FontScheme and its children +func (m *CT_FontScheme) Validate() error { + return m.ValidateWithPath("CT_FontScheme") +} + +// ValidateWithPath validates the CT_FontScheme and its children, prefixing error messages with path +func (m *CT_FontScheme) ValidateWithPath(path string) error { + if err := m.MajorFont.ValidateWithPath(path + "/MajorFont"); err != nil { + return err + } + if err := m.MinorFont.ValidateWithPath(path + "/MinorFont"); err != nil { + return err + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GammaTransform.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GammaTransform.go new file mode 100644 index 00000000..4f5db182 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GammaTransform.go @@ -0,0 +1,54 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_GammaTransform struct { +} + +func NewCT_GammaTransform() *CT_GammaTransform { + ret := &CT_GammaTransform{} + return ret +} + +func (m *CT_GammaTransform) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_GammaTransform) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_GammaTransform: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_GammaTransform and its children +func (m *CT_GammaTransform) Validate() error { + return m.ValidateWithPath("CT_GammaTransform") +} + +// ValidateWithPath validates the CT_GammaTransform and its children, prefixing error messages with path +func (m *CT_GammaTransform) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GeomGuide.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GeomGuide.go new file mode 100644 index 00000000..262ed588 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GeomGuide.go @@ -0,0 +1,78 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_GeomGuide struct { + NameAttr string + FmlaAttr string +} + +func NewCT_GeomGuide() *CT_GeomGuide { + ret := &CT_GeomGuide{} + return ret +} + +func (m *CT_GeomGuide) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "name"}, + Value: fmt.Sprintf("%v", m.NameAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "fmla"}, + Value: fmt.Sprintf("%v", m.FmlaAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_GeomGuide) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "name" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.NameAttr = parsed + continue + } + if attr.Name.Local == "fmla" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.FmlaAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_GeomGuide: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_GeomGuide and its children +func (m *CT_GeomGuide) Validate() error { + return m.ValidateWithPath("CT_GeomGuide") +} + +// ValidateWithPath validates the CT_GeomGuide and its children, prefixing error messages with path +func (m *CT_GeomGuide) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GeomGuideList.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GeomGuideList.go new file mode 100644 index 00000000..c30dbb81 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GeomGuideList.go @@ -0,0 +1,84 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_GeomGuideList struct { + Gd []*CT_GeomGuide +} + +func NewCT_GeomGuideList() *CT_GeomGuideList { + ret := &CT_GeomGuideList{} + return ret +} + +func (m *CT_GeomGuideList) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Gd != nil { + segd := xml.StartElement{Name: xml.Name{Local: "a:gd"}} + for _, c := range m.Gd { + e.EncodeElement(c, segd) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_GeomGuideList) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_GeomGuideList: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "gd"}: + tmp := NewCT_GeomGuide() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Gd = append(m.Gd, tmp) + default: + gooxml.Log("skipping unsupported element on CT_GeomGuideList %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_GeomGuideList + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_GeomGuideList and its children +func (m *CT_GeomGuideList) Validate() error { + return m.ValidateWithPath("CT_GeomGuideList") +} + +// ValidateWithPath validates the CT_GeomGuideList and its children, prefixing error messages with path +func (m *CT_GeomGuideList) ValidateWithPath(path string) error { + for i, v := range m.Gd { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Gd[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GeomRect.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GeomRect.go new file mode 100644 index 00000000..32a9726c --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GeomRect.go @@ -0,0 +1,112 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_GeomRect struct { + LAttr ST_AdjCoordinate + TAttr ST_AdjCoordinate + RAttr ST_AdjCoordinate + BAttr ST_AdjCoordinate +} + +func NewCT_GeomRect() *CT_GeomRect { + ret := &CT_GeomRect{} + return ret +} + +func (m *CT_GeomRect) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "l"}, + Value: fmt.Sprintf("%v", m.LAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "t"}, + Value: fmt.Sprintf("%v", m.TAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "r"}, + Value: fmt.Sprintf("%v", m.RAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "b"}, + Value: fmt.Sprintf("%v", m.BAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_GeomRect) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "l" { + parsed, err := ParseUnionST_AdjCoordinate(attr.Value) + if err != nil { + return err + } + m.LAttr = parsed + continue + } + if attr.Name.Local == "t" { + parsed, err := ParseUnionST_AdjCoordinate(attr.Value) + if err != nil { + return err + } + m.TAttr = parsed + continue + } + if attr.Name.Local == "r" { + parsed, err := ParseUnionST_AdjCoordinate(attr.Value) + if err != nil { + return err + } + m.RAttr = parsed + continue + } + if attr.Name.Local == "b" { + parsed, err := ParseUnionST_AdjCoordinate(attr.Value) + if err != nil { + return err + } + m.BAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_GeomRect: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_GeomRect and its children +func (m *CT_GeomRect) Validate() error { + return m.ValidateWithPath("CT_GeomRect") +} + +// ValidateWithPath validates the CT_GeomRect and its children, prefixing error messages with path +func (m *CT_GeomRect) ValidateWithPath(path string) error { + if err := m.LAttr.ValidateWithPath(path + "/LAttr"); err != nil { + return err + } + if err := m.TAttr.ValidateWithPath(path + "/TAttr"); err != nil { + return err + } + if err := m.RAttr.ValidateWithPath(path + "/RAttr"); err != nil { + return err + } + if err := m.BAttr.ValidateWithPath(path + "/BAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GlowEffect.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GlowEffect.go new file mode 100644 index 00000000..3ad475a7 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GlowEffect.go @@ -0,0 +1,180 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type CT_GlowEffect struct { + RadAttr *int64 + ScrgbClr *CT_ScRgbColor + SrgbClr *CT_SRgbColor + HslClr *CT_HslColor + SysClr *CT_SystemColor + SchemeClr *CT_SchemeColor + PrstClr *CT_PresetColor +} + +func NewCT_GlowEffect() *CT_GlowEffect { + ret := &CT_GlowEffect{} + return ret +} + +func (m *CT_GlowEffect) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.RadAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "rad"}, + Value: fmt.Sprintf("%v", *m.RadAttr)}) + } + e.EncodeToken(start) + if m.ScrgbClr != nil { + sescrgbClr := xml.StartElement{Name: xml.Name{Local: "a:scrgbClr"}} + e.EncodeElement(m.ScrgbClr, sescrgbClr) + } + if m.SrgbClr != nil { + sesrgbClr := xml.StartElement{Name: xml.Name{Local: "a:srgbClr"}} + e.EncodeElement(m.SrgbClr, sesrgbClr) + } + if m.HslClr != nil { + sehslClr := xml.StartElement{Name: xml.Name{Local: "a:hslClr"}} + e.EncodeElement(m.HslClr, sehslClr) + } + if m.SysClr != nil { + sesysClr := xml.StartElement{Name: xml.Name{Local: "a:sysClr"}} + e.EncodeElement(m.SysClr, sesysClr) + } + if m.SchemeClr != nil { + seschemeClr := xml.StartElement{Name: xml.Name{Local: "a:schemeClr"}} + e.EncodeElement(m.SchemeClr, seschemeClr) + } + if m.PrstClr != nil { + seprstClr := xml.StartElement{Name: xml.Name{Local: "a:prstClr"}} + e.EncodeElement(m.PrstClr, seprstClr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_GlowEffect) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "rad" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.RadAttr = &parsed + continue + } + } +lCT_GlowEffect: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "scrgbClr"}: + m.ScrgbClr = NewCT_ScRgbColor() + if err := d.DecodeElement(m.ScrgbClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "srgbClr"}: + m.SrgbClr = NewCT_SRgbColor() + if err := d.DecodeElement(m.SrgbClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hslClr"}: + m.HslClr = NewCT_HslColor() + if err := d.DecodeElement(m.HslClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "sysClr"}: + m.SysClr = NewCT_SystemColor() + if err := d.DecodeElement(m.SysClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "schemeClr"}: + m.SchemeClr = NewCT_SchemeColor() + if err := d.DecodeElement(m.SchemeClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "prstClr"}: + m.PrstClr = NewCT_PresetColor() + if err := d.DecodeElement(m.PrstClr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_GlowEffect %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_GlowEffect + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_GlowEffect and its children +func (m *CT_GlowEffect) Validate() error { + return m.ValidateWithPath("CT_GlowEffect") +} + +// ValidateWithPath validates the CT_GlowEffect and its children, prefixing error messages with path +func (m *CT_GlowEffect) ValidateWithPath(path string) error { + if m.RadAttr != nil { + if *m.RadAttr < 0 { + return fmt.Errorf("%s/m.RadAttr must be >= 0 (have %v)", path, *m.RadAttr) + } + if *m.RadAttr > 27273042316900 { + return fmt.Errorf("%s/m.RadAttr must be <= 27273042316900 (have %v)", path, *m.RadAttr) + } + } + if m.ScrgbClr != nil { + if err := m.ScrgbClr.ValidateWithPath(path + "/ScrgbClr"); err != nil { + return err + } + } + if m.SrgbClr != nil { + if err := m.SrgbClr.ValidateWithPath(path + "/SrgbClr"); err != nil { + return err + } + } + if m.HslClr != nil { + if err := m.HslClr.ValidateWithPath(path + "/HslClr"); err != nil { + return err + } + } + if m.SysClr != nil { + if err := m.SysClr.ValidateWithPath(path + "/SysClr"); err != nil { + return err + } + } + if m.SchemeClr != nil { + if err := m.SchemeClr.ValidateWithPath(path + "/SchemeClr"); err != nil { + return err + } + } + if m.PrstClr != nil { + if err := m.PrstClr.ValidateWithPath(path + "/PrstClr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GradientFillProperties.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GradientFillProperties.go new file mode 100644 index 00000000..3a0bfea7 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GradientFillProperties.go @@ -0,0 +1,157 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type CT_GradientFillProperties struct { + FlipAttr ST_TileFlipMode + RotWithShapeAttr *bool + GsLst *CT_GradientStopList + Lin *CT_LinearShadeProperties + Path *CT_PathShadeProperties + TileRect *CT_RelativeRect +} + +func NewCT_GradientFillProperties() *CT_GradientFillProperties { + ret := &CT_GradientFillProperties{} + return ret +} + +func (m *CT_GradientFillProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.FlipAttr != ST_TileFlipModeUnset { + attr, err := m.FlipAttr.MarshalXMLAttr(xml.Name{Local: "flip"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.RotWithShapeAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "rotWithShape"}, + Value: fmt.Sprintf("%d", b2i(*m.RotWithShapeAttr))}) + } + e.EncodeToken(start) + if m.GsLst != nil { + segsLst := xml.StartElement{Name: xml.Name{Local: "a:gsLst"}} + e.EncodeElement(m.GsLst, segsLst) + } + if m.Lin != nil { + selin := xml.StartElement{Name: xml.Name{Local: "a:lin"}} + e.EncodeElement(m.Lin, selin) + } + if m.Path != nil { + sepath := xml.StartElement{Name: xml.Name{Local: "a:path"}} + e.EncodeElement(m.Path, sepath) + } + if m.TileRect != nil { + setileRect := xml.StartElement{Name: xml.Name{Local: "a:tileRect"}} + e.EncodeElement(m.TileRect, setileRect) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_GradientFillProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "flip" { + m.FlipAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "rotWithShape" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.RotWithShapeAttr = &parsed + continue + } + } +lCT_GradientFillProperties: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "gsLst"}: + m.GsLst = NewCT_GradientStopList() + if err := d.DecodeElement(m.GsLst, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lin"}: + m.Lin = NewCT_LinearShadeProperties() + if err := d.DecodeElement(m.Lin, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "path"}: + m.Path = NewCT_PathShadeProperties() + if err := d.DecodeElement(m.Path, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "tileRect"}: + m.TileRect = NewCT_RelativeRect() + if err := d.DecodeElement(m.TileRect, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_GradientFillProperties %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_GradientFillProperties + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_GradientFillProperties and its children +func (m *CT_GradientFillProperties) Validate() error { + return m.ValidateWithPath("CT_GradientFillProperties") +} + +// ValidateWithPath validates the CT_GradientFillProperties and its children, prefixing error messages with path +func (m *CT_GradientFillProperties) ValidateWithPath(path string) error { + if err := m.FlipAttr.ValidateWithPath(path + "/FlipAttr"); err != nil { + return err + } + if m.GsLst != nil { + if err := m.GsLst.ValidateWithPath(path + "/GsLst"); err != nil { + return err + } + } + if m.Lin != nil { + if err := m.Lin.ValidateWithPath(path + "/Lin"); err != nil { + return err + } + } + if m.Path != nil { + if err := m.Path.ValidateWithPath(path + "/Path"); err != nil { + return err + } + } + if m.TileRect != nil { + if err := m.TileRect.ValidateWithPath(path + "/TileRect"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GradientStop.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GradientStop.go new file mode 100644 index 00000000..b65d3e3e --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GradientStop.go @@ -0,0 +1,172 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_GradientStop struct { + PosAttr ST_PositiveFixedPercentage + ScrgbClr *CT_ScRgbColor + SrgbClr *CT_SRgbColor + HslClr *CT_HslColor + SysClr *CT_SystemColor + SchemeClr *CT_SchemeColor + PrstClr *CT_PresetColor +} + +func NewCT_GradientStop() *CT_GradientStop { + ret := &CT_GradientStop{} + return ret +} + +func (m *CT_GradientStop) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "pos"}, + Value: fmt.Sprintf("%v", m.PosAttr)}) + e.EncodeToken(start) + if m.ScrgbClr != nil { + sescrgbClr := xml.StartElement{Name: xml.Name{Local: "a:scrgbClr"}} + e.EncodeElement(m.ScrgbClr, sescrgbClr) + } + if m.SrgbClr != nil { + sesrgbClr := xml.StartElement{Name: xml.Name{Local: "a:srgbClr"}} + e.EncodeElement(m.SrgbClr, sesrgbClr) + } + if m.HslClr != nil { + sehslClr := xml.StartElement{Name: xml.Name{Local: "a:hslClr"}} + e.EncodeElement(m.HslClr, sehslClr) + } + if m.SysClr != nil { + sesysClr := xml.StartElement{Name: xml.Name{Local: "a:sysClr"}} + e.EncodeElement(m.SysClr, sesysClr) + } + if m.SchemeClr != nil { + seschemeClr := xml.StartElement{Name: xml.Name{Local: "a:schemeClr"}} + e.EncodeElement(m.SchemeClr, seschemeClr) + } + if m.PrstClr != nil { + seprstClr := xml.StartElement{Name: xml.Name{Local: "a:prstClr"}} + e.EncodeElement(m.PrstClr, seprstClr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_GradientStop) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "pos" { + parsed, err := ParseUnionST_PositiveFixedPercentage(attr.Value) + if err != nil { + return err + } + m.PosAttr = parsed + continue + } + } +lCT_GradientStop: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "scrgbClr"}: + m.ScrgbClr = NewCT_ScRgbColor() + if err := d.DecodeElement(m.ScrgbClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "srgbClr"}: + m.SrgbClr = NewCT_SRgbColor() + if err := d.DecodeElement(m.SrgbClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hslClr"}: + m.HslClr = NewCT_HslColor() + if err := d.DecodeElement(m.HslClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "sysClr"}: + m.SysClr = NewCT_SystemColor() + if err := d.DecodeElement(m.SysClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "schemeClr"}: + m.SchemeClr = NewCT_SchemeColor() + if err := d.DecodeElement(m.SchemeClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "prstClr"}: + m.PrstClr = NewCT_PresetColor() + if err := d.DecodeElement(m.PrstClr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_GradientStop %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_GradientStop + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_GradientStop and its children +func (m *CT_GradientStop) Validate() error { + return m.ValidateWithPath("CT_GradientStop") +} + +// ValidateWithPath validates the CT_GradientStop and its children, prefixing error messages with path +func (m *CT_GradientStop) ValidateWithPath(path string) error { + if err := m.PosAttr.ValidateWithPath(path + "/PosAttr"); err != nil { + return err + } + if m.ScrgbClr != nil { + if err := m.ScrgbClr.ValidateWithPath(path + "/ScrgbClr"); err != nil { + return err + } + } + if m.SrgbClr != nil { + if err := m.SrgbClr.ValidateWithPath(path + "/SrgbClr"); err != nil { + return err + } + } + if m.HslClr != nil { + if err := m.HslClr.ValidateWithPath(path + "/HslClr"); err != nil { + return err + } + } + if m.SysClr != nil { + if err := m.SysClr.ValidateWithPath(path + "/SysClr"); err != nil { + return err + } + } + if m.SchemeClr != nil { + if err := m.SchemeClr.ValidateWithPath(path + "/SchemeClr"); err != nil { + return err + } + } + if m.PrstClr != nil { + if err := m.PrstClr.ValidateWithPath(path + "/PrstClr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GradientStopList.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GradientStopList.go new file mode 100644 index 00000000..3a02bda8 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GradientStopList.go @@ -0,0 +1,82 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_GradientStopList struct { + Gs []*CT_GradientStop +} + +func NewCT_GradientStopList() *CT_GradientStopList { + ret := &CT_GradientStopList{} + return ret +} + +func (m *CT_GradientStopList) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + segs := xml.StartElement{Name: xml.Name{Local: "a:gs"}} + for _, c := range m.Gs { + e.EncodeElement(c, segs) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_GradientStopList) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_GradientStopList: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "gs"}: + tmp := NewCT_GradientStop() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Gs = append(m.Gs, tmp) + default: + gooxml.Log("skipping unsupported element on CT_GradientStopList %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_GradientStopList + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_GradientStopList and its children +func (m *CT_GradientStopList) Validate() error { + return m.ValidateWithPath("CT_GradientStopList") +} + +// ValidateWithPath validates the CT_GradientStopList and its children, prefixing error messages with path +func (m *CT_GradientStopList) ValidateWithPath(path string) error { + for i, v := range m.Gs { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Gs[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GraphicalObject.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GraphicalObject.go new file mode 100644 index 00000000..cc257170 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GraphicalObject.go @@ -0,0 +1,77 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_GraphicalObject struct { + GraphicData *CT_GraphicalObjectData +} + +func NewCT_GraphicalObject() *CT_GraphicalObject { + ret := &CT_GraphicalObject{} + ret.GraphicData = NewCT_GraphicalObjectData() + return ret +} + +func (m *CT_GraphicalObject) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + segraphicData := xml.StartElement{Name: xml.Name{Local: "a:graphicData"}} + e.EncodeElement(m.GraphicData, segraphicData) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_GraphicalObject) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.GraphicData = NewCT_GraphicalObjectData() +lCT_GraphicalObject: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "graphicData"}: + if err := d.DecodeElement(m.GraphicData, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_GraphicalObject %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_GraphicalObject + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_GraphicalObject and its children +func (m *CT_GraphicalObject) Validate() error { + return m.ValidateWithPath("CT_GraphicalObject") +} + +// ValidateWithPath validates the CT_GraphicalObject and its children, prefixing error messages with path +func (m *CT_GraphicalObject) ValidateWithPath(path string) error { + if err := m.GraphicData.ValidateWithPath(path + "/GraphicData"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GraphicalObjectData.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GraphicalObjectData.go new file mode 100644 index 00000000..f88800de --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GraphicalObjectData.go @@ -0,0 +1,89 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_GraphicalObjectData struct { + UriAttr string + Any []gooxml.Any +} + +func NewCT_GraphicalObjectData() *CT_GraphicalObjectData { + ret := &CT_GraphicalObjectData{} + return ret +} + +func (m *CT_GraphicalObjectData) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "uri"}, + Value: fmt.Sprintf("%v", m.UriAttr)}) + e.EncodeToken(start) + if m.Any != nil { + for _, c := range m.Any { + c.MarshalXML(e, xml.StartElement{}) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_GraphicalObjectData) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "uri" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.UriAttr = parsed + continue + } + } +lCT_GraphicalObjectData: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + default: + if anyEl, err := gooxml.CreateElement(el); err != nil { + return err + } else { + if err := d.DecodeElement(anyEl, &el); err != nil { + return err + } + m.Any = append(m.Any, anyEl) + } + } + case xml.EndElement: + break lCT_GraphicalObjectData + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_GraphicalObjectData and its children +func (m *CT_GraphicalObjectData) Validate() error { + return m.ValidateWithPath("CT_GraphicalObjectData") +} + +// ValidateWithPath validates the CT_GraphicalObjectData and its children, prefixing error messages with path +func (m *CT_GraphicalObjectData) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GraphicalObjectFrameLocking.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GraphicalObjectFrameLocking.go new file mode 100644 index 00000000..9bbfb386 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GraphicalObjectFrameLocking.go @@ -0,0 +1,162 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type CT_GraphicalObjectFrameLocking struct { + NoGrpAttr *bool + NoDrilldownAttr *bool + NoSelectAttr *bool + NoChangeAspectAttr *bool + NoMoveAttr *bool + NoResizeAttr *bool + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_GraphicalObjectFrameLocking() *CT_GraphicalObjectFrameLocking { + ret := &CT_GraphicalObjectFrameLocking{} + return ret +} + +func (m *CT_GraphicalObjectFrameLocking) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.NoGrpAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noGrp"}, + Value: fmt.Sprintf("%d", b2i(*m.NoGrpAttr))}) + } + if m.NoDrilldownAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noDrilldown"}, + Value: fmt.Sprintf("%d", b2i(*m.NoDrilldownAttr))}) + } + if m.NoSelectAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noSelect"}, + Value: fmt.Sprintf("%d", b2i(*m.NoSelectAttr))}) + } + if m.NoChangeAspectAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noChangeAspect"}, + Value: fmt.Sprintf("%d", b2i(*m.NoChangeAspectAttr))}) + } + if m.NoMoveAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noMove"}, + Value: fmt.Sprintf("%d", b2i(*m.NoMoveAttr))}) + } + if m.NoResizeAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noResize"}, + Value: fmt.Sprintf("%d", b2i(*m.NoResizeAttr))}) + } + e.EncodeToken(start) + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_GraphicalObjectFrameLocking) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "noGrp" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoGrpAttr = &parsed + continue + } + if attr.Name.Local == "noDrilldown" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoDrilldownAttr = &parsed + continue + } + if attr.Name.Local == "noSelect" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoSelectAttr = &parsed + continue + } + if attr.Name.Local == "noChangeAspect" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoChangeAspectAttr = &parsed + continue + } + if attr.Name.Local == "noMove" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoMoveAttr = &parsed + continue + } + if attr.Name.Local == "noResize" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoResizeAttr = &parsed + continue + } + } +lCT_GraphicalObjectFrameLocking: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_GraphicalObjectFrameLocking %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_GraphicalObjectFrameLocking + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_GraphicalObjectFrameLocking and its children +func (m *CT_GraphicalObjectFrameLocking) Validate() error { + return m.ValidateWithPath("CT_GraphicalObjectFrameLocking") +} + +// ValidateWithPath validates the CT_GraphicalObjectFrameLocking and its children, prefixing error messages with path +func (m *CT_GraphicalObjectFrameLocking) ValidateWithPath(path string) error { + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GrayscaleEffect.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GrayscaleEffect.go new file mode 100644 index 00000000..c6dfd4b3 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GrayscaleEffect.go @@ -0,0 +1,54 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_GrayscaleEffect struct { +} + +func NewCT_GrayscaleEffect() *CT_GrayscaleEffect { + ret := &CT_GrayscaleEffect{} + return ret +} + +func (m *CT_GrayscaleEffect) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_GrayscaleEffect) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_GrayscaleEffect: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_GrayscaleEffect and its children +func (m *CT_GrayscaleEffect) Validate() error { + return m.ValidateWithPath("CT_GrayscaleEffect") +} + +// ValidateWithPath validates the CT_GrayscaleEffect and its children, prefixing error messages with path +func (m *CT_GrayscaleEffect) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GrayscaleTransform.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GrayscaleTransform.go new file mode 100644 index 00000000..88df944a --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GrayscaleTransform.go @@ -0,0 +1,54 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_GrayscaleTransform struct { +} + +func NewCT_GrayscaleTransform() *CT_GrayscaleTransform { + ret := &CT_GrayscaleTransform{} + return ret +} + +func (m *CT_GrayscaleTransform) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_GrayscaleTransform) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_GrayscaleTransform: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_GrayscaleTransform and its children +func (m *CT_GrayscaleTransform) Validate() error { + return m.ValidateWithPath("CT_GrayscaleTransform") +} + +// ValidateWithPath validates the CT_GrayscaleTransform and its children, prefixing error messages with path +func (m *CT_GrayscaleTransform) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GroupFillProperties.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GroupFillProperties.go new file mode 100644 index 00000000..3f168c3f --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GroupFillProperties.go @@ -0,0 +1,54 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_GroupFillProperties struct { +} + +func NewCT_GroupFillProperties() *CT_GroupFillProperties { + ret := &CT_GroupFillProperties{} + return ret +} + +func (m *CT_GroupFillProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_GroupFillProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_GroupFillProperties: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_GroupFillProperties and its children +func (m *CT_GroupFillProperties) Validate() error { + return m.ValidateWithPath("CT_GroupFillProperties") +} + +// ValidateWithPath validates the CT_GroupFillProperties and its children, prefixing error messages with path +func (m *CT_GroupFillProperties) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GroupLocking.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GroupLocking.go new file mode 100644 index 00000000..fc1090ad --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GroupLocking.go @@ -0,0 +1,175 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type CT_GroupLocking struct { + NoGrpAttr *bool + NoUngrpAttr *bool + NoSelectAttr *bool + NoRotAttr *bool + NoChangeAspectAttr *bool + NoMoveAttr *bool + NoResizeAttr *bool + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_GroupLocking() *CT_GroupLocking { + ret := &CT_GroupLocking{} + return ret +} + +func (m *CT_GroupLocking) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.NoGrpAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noGrp"}, + Value: fmt.Sprintf("%d", b2i(*m.NoGrpAttr))}) + } + if m.NoUngrpAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noUngrp"}, + Value: fmt.Sprintf("%d", b2i(*m.NoUngrpAttr))}) + } + if m.NoSelectAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noSelect"}, + Value: fmt.Sprintf("%d", b2i(*m.NoSelectAttr))}) + } + if m.NoRotAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noRot"}, + Value: fmt.Sprintf("%d", b2i(*m.NoRotAttr))}) + } + if m.NoChangeAspectAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noChangeAspect"}, + Value: fmt.Sprintf("%d", b2i(*m.NoChangeAspectAttr))}) + } + if m.NoMoveAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noMove"}, + Value: fmt.Sprintf("%d", b2i(*m.NoMoveAttr))}) + } + if m.NoResizeAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noResize"}, + Value: fmt.Sprintf("%d", b2i(*m.NoResizeAttr))}) + } + e.EncodeToken(start) + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_GroupLocking) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "noGrp" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoGrpAttr = &parsed + continue + } + if attr.Name.Local == "noUngrp" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoUngrpAttr = &parsed + continue + } + if attr.Name.Local == "noSelect" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoSelectAttr = &parsed + continue + } + if attr.Name.Local == "noRot" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoRotAttr = &parsed + continue + } + if attr.Name.Local == "noChangeAspect" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoChangeAspectAttr = &parsed + continue + } + if attr.Name.Local == "noMove" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoMoveAttr = &parsed + continue + } + if attr.Name.Local == "noResize" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoResizeAttr = &parsed + continue + } + } +lCT_GroupLocking: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_GroupLocking %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_GroupLocking + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_GroupLocking and its children +func (m *CT_GroupLocking) Validate() error { + return m.ValidateWithPath("CT_GroupLocking") +} + +// ValidateWithPath validates the CT_GroupLocking and its children, prefixing error messages with path +func (m *CT_GroupLocking) ValidateWithPath(path string) error { + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GroupShapeProperties.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GroupShapeProperties.go new file mode 100644 index 00000000..271f47bc --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GroupShapeProperties.go @@ -0,0 +1,247 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_GroupShapeProperties struct { + BwModeAttr ST_BlackWhiteMode + Xfrm *CT_GroupTransform2D + NoFill *CT_NoFillProperties + SolidFill *CT_SolidColorFillProperties + GradFill *CT_GradientFillProperties + BlipFill *CT_BlipFillProperties + PattFill *CT_PatternFillProperties + GrpFill *CT_GroupFillProperties + EffectLst *CT_EffectList + EffectDag *CT_EffectContainer + Scene3d *CT_Scene3D + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_GroupShapeProperties() *CT_GroupShapeProperties { + ret := &CT_GroupShapeProperties{} + return ret +} + +func (m *CT_GroupShapeProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.BwModeAttr != ST_BlackWhiteModeUnset { + attr, err := m.BwModeAttr.MarshalXMLAttr(xml.Name{Local: "bwMode"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + if m.Xfrm != nil { + sexfrm := xml.StartElement{Name: xml.Name{Local: "a:xfrm"}} + e.EncodeElement(m.Xfrm, sexfrm) + } + if m.NoFill != nil { + senoFill := xml.StartElement{Name: xml.Name{Local: "a:noFill"}} + e.EncodeElement(m.NoFill, senoFill) + } + if m.SolidFill != nil { + sesolidFill := xml.StartElement{Name: xml.Name{Local: "a:solidFill"}} + e.EncodeElement(m.SolidFill, sesolidFill) + } + if m.GradFill != nil { + segradFill := xml.StartElement{Name: xml.Name{Local: "a:gradFill"}} + e.EncodeElement(m.GradFill, segradFill) + } + if m.BlipFill != nil { + seblipFill := xml.StartElement{Name: xml.Name{Local: "a:blipFill"}} + e.EncodeElement(m.BlipFill, seblipFill) + } + if m.PattFill != nil { + sepattFill := xml.StartElement{Name: xml.Name{Local: "a:pattFill"}} + e.EncodeElement(m.PattFill, sepattFill) + } + if m.GrpFill != nil { + segrpFill := xml.StartElement{Name: xml.Name{Local: "a:grpFill"}} + e.EncodeElement(m.GrpFill, segrpFill) + } + if m.EffectLst != nil { + seeffectLst := xml.StartElement{Name: xml.Name{Local: "a:effectLst"}} + e.EncodeElement(m.EffectLst, seeffectLst) + } + if m.EffectDag != nil { + seeffectDag := xml.StartElement{Name: xml.Name{Local: "a:effectDag"}} + e.EncodeElement(m.EffectDag, seeffectDag) + } + if m.Scene3d != nil { + sescene3d := xml.StartElement{Name: xml.Name{Local: "a:scene3d"}} + e.EncodeElement(m.Scene3d, sescene3d) + } + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_GroupShapeProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "bwMode" { + m.BwModeAttr.UnmarshalXMLAttr(attr) + continue + } + } +lCT_GroupShapeProperties: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "xfrm"}: + m.Xfrm = NewCT_GroupTransform2D() + if err := d.DecodeElement(m.Xfrm, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "noFill"}: + m.NoFill = NewCT_NoFillProperties() + if err := d.DecodeElement(m.NoFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "solidFill"}: + m.SolidFill = NewCT_SolidColorFillProperties() + if err := d.DecodeElement(m.SolidFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "gradFill"}: + m.GradFill = NewCT_GradientFillProperties() + if err := d.DecodeElement(m.GradFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blipFill"}: + m.BlipFill = NewCT_BlipFillProperties() + if err := d.DecodeElement(m.BlipFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "pattFill"}: + m.PattFill = NewCT_PatternFillProperties() + if err := d.DecodeElement(m.PattFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "grpFill"}: + m.GrpFill = NewCT_GroupFillProperties() + if err := d.DecodeElement(m.GrpFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "effectLst"}: + m.EffectLst = NewCT_EffectList() + if err := d.DecodeElement(m.EffectLst, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "effectDag"}: + m.EffectDag = NewCT_EffectContainer() + if err := d.DecodeElement(m.EffectDag, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "scene3d"}: + m.Scene3d = NewCT_Scene3D() + if err := d.DecodeElement(m.Scene3d, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_GroupShapeProperties %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_GroupShapeProperties + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_GroupShapeProperties and its children +func (m *CT_GroupShapeProperties) Validate() error { + return m.ValidateWithPath("CT_GroupShapeProperties") +} + +// ValidateWithPath validates the CT_GroupShapeProperties and its children, prefixing error messages with path +func (m *CT_GroupShapeProperties) ValidateWithPath(path string) error { + if err := m.BwModeAttr.ValidateWithPath(path + "/BwModeAttr"); err != nil { + return err + } + if m.Xfrm != nil { + if err := m.Xfrm.ValidateWithPath(path + "/Xfrm"); err != nil { + return err + } + } + if m.NoFill != nil { + if err := m.NoFill.ValidateWithPath(path + "/NoFill"); err != nil { + return err + } + } + if m.SolidFill != nil { + if err := m.SolidFill.ValidateWithPath(path + "/SolidFill"); err != nil { + return err + } + } + if m.GradFill != nil { + if err := m.GradFill.ValidateWithPath(path + "/GradFill"); err != nil { + return err + } + } + if m.BlipFill != nil { + if err := m.BlipFill.ValidateWithPath(path + "/BlipFill"); err != nil { + return err + } + } + if m.PattFill != nil { + if err := m.PattFill.ValidateWithPath(path + "/PattFill"); err != nil { + return err + } + } + if m.GrpFill != nil { + if err := m.GrpFill.ValidateWithPath(path + "/GrpFill"); err != nil { + return err + } + } + if m.EffectLst != nil { + if err := m.EffectLst.ValidateWithPath(path + "/EffectLst"); err != nil { + return err + } + } + if m.EffectDag != nil { + if err := m.EffectDag.ValidateWithPath(path + "/EffectDag"); err != nil { + return err + } + } + if m.Scene3d != nil { + if err := m.Scene3d.ValidateWithPath(path + "/Scene3d"); err != nil { + return err + } + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GroupTransform2D.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GroupTransform2D.go new file mode 100644 index 00000000..dd561686 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GroupTransform2D.go @@ -0,0 +1,169 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type CT_GroupTransform2D struct { + RotAttr *int32 + FlipHAttr *bool + FlipVAttr *bool + Off *CT_Point2D + Ext *CT_PositiveSize2D + ChOff *CT_Point2D + ChExt *CT_PositiveSize2D +} + +func NewCT_GroupTransform2D() *CT_GroupTransform2D { + ret := &CT_GroupTransform2D{} + return ret +} + +func (m *CT_GroupTransform2D) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.RotAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "rot"}, + Value: fmt.Sprintf("%v", *m.RotAttr)}) + } + if m.FlipHAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "flipH"}, + Value: fmt.Sprintf("%d", b2i(*m.FlipHAttr))}) + } + if m.FlipVAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "flipV"}, + Value: fmt.Sprintf("%d", b2i(*m.FlipVAttr))}) + } + e.EncodeToken(start) + if m.Off != nil { + seoff := xml.StartElement{Name: xml.Name{Local: "a:off"}} + e.EncodeElement(m.Off, seoff) + } + if m.Ext != nil { + seext := xml.StartElement{Name: xml.Name{Local: "a:ext"}} + e.EncodeElement(m.Ext, seext) + } + if m.ChOff != nil { + sechOff := xml.StartElement{Name: xml.Name{Local: "a:chOff"}} + e.EncodeElement(m.ChOff, sechOff) + } + if m.ChExt != nil { + sechExt := xml.StartElement{Name: xml.Name{Local: "a:chExt"}} + e.EncodeElement(m.ChExt, sechExt) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_GroupTransform2D) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "rot" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + pt := int32(parsed) + m.RotAttr = &pt + continue + } + if attr.Name.Local == "flipH" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.FlipHAttr = &parsed + continue + } + if attr.Name.Local == "flipV" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.FlipVAttr = &parsed + continue + } + } +lCT_GroupTransform2D: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "off"}: + m.Off = NewCT_Point2D() + if err := d.DecodeElement(m.Off, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "ext"}: + m.Ext = NewCT_PositiveSize2D() + if err := d.DecodeElement(m.Ext, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "chOff"}: + m.ChOff = NewCT_Point2D() + if err := d.DecodeElement(m.ChOff, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "chExt"}: + m.ChExt = NewCT_PositiveSize2D() + if err := d.DecodeElement(m.ChExt, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_GroupTransform2D %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_GroupTransform2D + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_GroupTransform2D and its children +func (m *CT_GroupTransform2D) Validate() error { + return m.ValidateWithPath("CT_GroupTransform2D") +} + +// ValidateWithPath validates the CT_GroupTransform2D and its children, prefixing error messages with path +func (m *CT_GroupTransform2D) ValidateWithPath(path string) error { + if m.Off != nil { + if err := m.Off.ValidateWithPath(path + "/Off"); err != nil { + return err + } + } + if m.Ext != nil { + if err := m.Ext.ValidateWithPath(path + "/Ext"); err != nil { + return err + } + } + if m.ChOff != nil { + if err := m.ChOff.ValidateWithPath(path + "/ChOff"); err != nil { + return err + } + } + if m.ChExt != nil { + if err := m.ChExt.ValidateWithPath(path + "/ChExt"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlConnector.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlConnector.go new file mode 100644 index 00000000..dcd53ec3 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlConnector.go @@ -0,0 +1,119 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_GvmlConnector struct { + NvCxnSpPr *CT_GvmlConnectorNonVisual + SpPr *CT_ShapeProperties + Style *CT_ShapeStyle + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_GvmlConnector() *CT_GvmlConnector { + ret := &CT_GvmlConnector{} + ret.NvCxnSpPr = NewCT_GvmlConnectorNonVisual() + ret.SpPr = NewCT_ShapeProperties() + return ret +} + +func (m *CT_GvmlConnector) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + senvCxnSpPr := xml.StartElement{Name: xml.Name{Local: "a:nvCxnSpPr"}} + e.EncodeElement(m.NvCxnSpPr, senvCxnSpPr) + sespPr := xml.StartElement{Name: xml.Name{Local: "a:spPr"}} + e.EncodeElement(m.SpPr, sespPr) + if m.Style != nil { + sestyle := xml.StartElement{Name: xml.Name{Local: "a:style"}} + e.EncodeElement(m.Style, sestyle) + } + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_GvmlConnector) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.NvCxnSpPr = NewCT_GvmlConnectorNonVisual() + m.SpPr = NewCT_ShapeProperties() +lCT_GvmlConnector: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "nvCxnSpPr"}: + if err := d.DecodeElement(m.NvCxnSpPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "spPr"}: + if err := d.DecodeElement(m.SpPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "style"}: + m.Style = NewCT_ShapeStyle() + if err := d.DecodeElement(m.Style, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_GvmlConnector %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_GvmlConnector + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_GvmlConnector and its children +func (m *CT_GvmlConnector) Validate() error { + return m.ValidateWithPath("CT_GvmlConnector") +} + +// ValidateWithPath validates the CT_GvmlConnector and its children, prefixing error messages with path +func (m *CT_GvmlConnector) ValidateWithPath(path string) error { + if err := m.NvCxnSpPr.ValidateWithPath(path + "/NvCxnSpPr"); err != nil { + return err + } + if err := m.SpPr.ValidateWithPath(path + "/SpPr"); err != nil { + return err + } + if m.Style != nil { + if err := m.Style.ValidateWithPath(path + "/Style"); err != nil { + return err + } + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlConnectorNonVisual.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlConnectorNonVisual.go new file mode 100644 index 00000000..570bd465 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlConnectorNonVisual.go @@ -0,0 +1,89 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_GvmlConnectorNonVisual struct { + CNvPr *CT_NonVisualDrawingProps + CNvCxnSpPr *CT_NonVisualConnectorProperties +} + +func NewCT_GvmlConnectorNonVisual() *CT_GvmlConnectorNonVisual { + ret := &CT_GvmlConnectorNonVisual{} + ret.CNvPr = NewCT_NonVisualDrawingProps() + ret.CNvCxnSpPr = NewCT_NonVisualConnectorProperties() + return ret +} + +func (m *CT_GvmlConnectorNonVisual) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + secNvPr := xml.StartElement{Name: xml.Name{Local: "a:cNvPr"}} + e.EncodeElement(m.CNvPr, secNvPr) + secNvCxnSpPr := xml.StartElement{Name: xml.Name{Local: "a:cNvCxnSpPr"}} + e.EncodeElement(m.CNvCxnSpPr, secNvCxnSpPr) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_GvmlConnectorNonVisual) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CNvPr = NewCT_NonVisualDrawingProps() + m.CNvCxnSpPr = NewCT_NonVisualConnectorProperties() +lCT_GvmlConnectorNonVisual: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "cNvPr"}: + if err := d.DecodeElement(m.CNvPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "cNvCxnSpPr"}: + if err := d.DecodeElement(m.CNvCxnSpPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_GvmlConnectorNonVisual %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_GvmlConnectorNonVisual + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_GvmlConnectorNonVisual and its children +func (m *CT_GvmlConnectorNonVisual) Validate() error { + return m.ValidateWithPath("CT_GvmlConnectorNonVisual") +} + +// ValidateWithPath validates the CT_GvmlConnectorNonVisual and its children, prefixing error messages with path +func (m *CT_GvmlConnectorNonVisual) ValidateWithPath(path string) error { + if err := m.CNvPr.ValidateWithPath(path + "/CNvPr"); err != nil { + return err + } + if err := m.CNvCxnSpPr.ValidateWithPath(path + "/CNvCxnSpPr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlGraphicFrameNonVisual.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlGraphicFrameNonVisual.go new file mode 100644 index 00000000..f9716059 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlGraphicFrameNonVisual.go @@ -0,0 +1,89 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_GvmlGraphicFrameNonVisual struct { + CNvPr *CT_NonVisualDrawingProps + CNvGraphicFramePr *CT_NonVisualGraphicFrameProperties +} + +func NewCT_GvmlGraphicFrameNonVisual() *CT_GvmlGraphicFrameNonVisual { + ret := &CT_GvmlGraphicFrameNonVisual{} + ret.CNvPr = NewCT_NonVisualDrawingProps() + ret.CNvGraphicFramePr = NewCT_NonVisualGraphicFrameProperties() + return ret +} + +func (m *CT_GvmlGraphicFrameNonVisual) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + secNvPr := xml.StartElement{Name: xml.Name{Local: "a:cNvPr"}} + e.EncodeElement(m.CNvPr, secNvPr) + secNvGraphicFramePr := xml.StartElement{Name: xml.Name{Local: "a:cNvGraphicFramePr"}} + e.EncodeElement(m.CNvGraphicFramePr, secNvGraphicFramePr) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_GvmlGraphicFrameNonVisual) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CNvPr = NewCT_NonVisualDrawingProps() + m.CNvGraphicFramePr = NewCT_NonVisualGraphicFrameProperties() +lCT_GvmlGraphicFrameNonVisual: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "cNvPr"}: + if err := d.DecodeElement(m.CNvPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "cNvGraphicFramePr"}: + if err := d.DecodeElement(m.CNvGraphicFramePr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_GvmlGraphicFrameNonVisual %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_GvmlGraphicFrameNonVisual + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_GvmlGraphicFrameNonVisual and its children +func (m *CT_GvmlGraphicFrameNonVisual) Validate() error { + return m.ValidateWithPath("CT_GvmlGraphicFrameNonVisual") +} + +// ValidateWithPath validates the CT_GvmlGraphicFrameNonVisual and its children, prefixing error messages with path +func (m *CT_GvmlGraphicFrameNonVisual) ValidateWithPath(path string) error { + if err := m.CNvPr.ValidateWithPath(path + "/CNvPr"); err != nil { + return err + } + if err := m.CNvGraphicFramePr.ValidateWithPath(path + "/CNvGraphicFramePr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlGraphicalObjectFrame.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlGraphicalObjectFrame.go new file mode 100644 index 00000000..a46ac653 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlGraphicalObjectFrame.go @@ -0,0 +1,116 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_GvmlGraphicalObjectFrame struct { + NvGraphicFramePr *CT_GvmlGraphicFrameNonVisual + Graphic *Graphic + Xfrm *CT_Transform2D + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_GvmlGraphicalObjectFrame() *CT_GvmlGraphicalObjectFrame { + ret := &CT_GvmlGraphicalObjectFrame{} + ret.NvGraphicFramePr = NewCT_GvmlGraphicFrameNonVisual() + ret.Graphic = NewGraphic() + ret.Xfrm = NewCT_Transform2D() + return ret +} + +func (m *CT_GvmlGraphicalObjectFrame) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + senvGraphicFramePr := xml.StartElement{Name: xml.Name{Local: "a:nvGraphicFramePr"}} + e.EncodeElement(m.NvGraphicFramePr, senvGraphicFramePr) + segraphic := xml.StartElement{Name: xml.Name{Local: "a:graphic"}} + e.EncodeElement(m.Graphic, segraphic) + sexfrm := xml.StartElement{Name: xml.Name{Local: "a:xfrm"}} + e.EncodeElement(m.Xfrm, sexfrm) + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_GvmlGraphicalObjectFrame) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.NvGraphicFramePr = NewCT_GvmlGraphicFrameNonVisual() + m.Graphic = NewGraphic() + m.Xfrm = NewCT_Transform2D() +lCT_GvmlGraphicalObjectFrame: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "nvGraphicFramePr"}: + if err := d.DecodeElement(m.NvGraphicFramePr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "graphic"}: + if err := d.DecodeElement(m.Graphic, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "xfrm"}: + if err := d.DecodeElement(m.Xfrm, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_GvmlGraphicalObjectFrame %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_GvmlGraphicalObjectFrame + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_GvmlGraphicalObjectFrame and its children +func (m *CT_GvmlGraphicalObjectFrame) Validate() error { + return m.ValidateWithPath("CT_GvmlGraphicalObjectFrame") +} + +// ValidateWithPath validates the CT_GvmlGraphicalObjectFrame and its children, prefixing error messages with path +func (m *CT_GvmlGraphicalObjectFrame) ValidateWithPath(path string) error { + if err := m.NvGraphicFramePr.ValidateWithPath(path + "/NvGraphicFramePr"); err != nil { + return err + } + if err := m.Graphic.ValidateWithPath(path + "/Graphic"); err != nil { + return err + } + if err := m.Xfrm.ValidateWithPath(path + "/Xfrm"); err != nil { + return err + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlGroupShape.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlGroupShape.go new file mode 100644 index 00000000..4e715667 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlGroupShape.go @@ -0,0 +1,152 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_GvmlGroupShape struct { + NvGrpSpPr *CT_GvmlGroupShapeNonVisual + GrpSpPr *CT_GroupShapeProperties + Choice []*CT_GvmlGroupShapeChoice + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_GvmlGroupShape() *CT_GvmlGroupShape { + ret := &CT_GvmlGroupShape{} + ret.NvGrpSpPr = NewCT_GvmlGroupShapeNonVisual() + ret.GrpSpPr = NewCT_GroupShapeProperties() + return ret +} + +func (m *CT_GvmlGroupShape) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + senvGrpSpPr := xml.StartElement{Name: xml.Name{Local: "a:nvGrpSpPr"}} + e.EncodeElement(m.NvGrpSpPr, senvGrpSpPr) + segrpSpPr := xml.StartElement{Name: xml.Name{Local: "a:grpSpPr"}} + e.EncodeElement(m.GrpSpPr, segrpSpPr) + if m.Choice != nil { + for _, c := range m.Choice { + c.MarshalXML(e, xml.StartElement{}) + } + } + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_GvmlGroupShape) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.NvGrpSpPr = NewCT_GvmlGroupShapeNonVisual() + m.GrpSpPr = NewCT_GroupShapeProperties() +lCT_GvmlGroupShape: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "nvGrpSpPr"}: + if err := d.DecodeElement(m.NvGrpSpPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "grpSpPr"}: + if err := d.DecodeElement(m.GrpSpPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "txSp"}: + tmp := NewCT_GvmlGroupShapeChoice() + if err := d.DecodeElement(&tmp.TxSp, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "sp"}: + tmp := NewCT_GvmlGroupShapeChoice() + if err := d.DecodeElement(&tmp.Sp, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "cxnSp"}: + tmp := NewCT_GvmlGroupShapeChoice() + if err := d.DecodeElement(&tmp.CxnSp, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "pic"}: + tmp := NewCT_GvmlGroupShapeChoice() + if err := d.DecodeElement(&tmp.Pic, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "graphicFrame"}: + tmp := NewCT_GvmlGroupShapeChoice() + if err := d.DecodeElement(&tmp.GraphicFrame, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "grpSp"}: + tmp := NewCT_GvmlGroupShapeChoice() + if err := d.DecodeElement(&tmp.GrpSp, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_GvmlGroupShape %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_GvmlGroupShape + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_GvmlGroupShape and its children +func (m *CT_GvmlGroupShape) Validate() error { + return m.ValidateWithPath("CT_GvmlGroupShape") +} + +// ValidateWithPath validates the CT_GvmlGroupShape and its children, prefixing error messages with path +func (m *CT_GvmlGroupShape) ValidateWithPath(path string) error { + if err := m.NvGrpSpPr.ValidateWithPath(path + "/NvGrpSpPr"); err != nil { + return err + } + if err := m.GrpSpPr.ValidateWithPath(path + "/GrpSpPr"); err != nil { + return err + } + for i, v := range m.Choice { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Choice[%d]", path, i)); err != nil { + return err + } + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlGroupShapeChoice.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlGroupShapeChoice.go new file mode 100644 index 00000000..cee6dc56 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlGroupShapeChoice.go @@ -0,0 +1,172 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_GvmlGroupShapeChoice struct { + TxSp []*CT_GvmlTextShape + Sp []*CT_GvmlShape + CxnSp []*CT_GvmlConnector + Pic []*CT_GvmlPicture + GraphicFrame []*CT_GvmlGraphicalObjectFrame + GrpSp []*CT_GvmlGroupShape +} + +func NewCT_GvmlGroupShapeChoice() *CT_GvmlGroupShapeChoice { + ret := &CT_GvmlGroupShapeChoice{} + return ret +} + +func (m *CT_GvmlGroupShapeChoice) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.TxSp != nil { + setxSp := xml.StartElement{Name: xml.Name{Local: "a:txSp"}} + for _, c := range m.TxSp { + e.EncodeElement(c, setxSp) + } + } + if m.Sp != nil { + sesp := xml.StartElement{Name: xml.Name{Local: "a:sp"}} + for _, c := range m.Sp { + e.EncodeElement(c, sesp) + } + } + if m.CxnSp != nil { + secxnSp := xml.StartElement{Name: xml.Name{Local: "a:cxnSp"}} + for _, c := range m.CxnSp { + e.EncodeElement(c, secxnSp) + } + } + if m.Pic != nil { + sepic := xml.StartElement{Name: xml.Name{Local: "a:pic"}} + for _, c := range m.Pic { + e.EncodeElement(c, sepic) + } + } + if m.GraphicFrame != nil { + segraphicFrame := xml.StartElement{Name: xml.Name{Local: "a:graphicFrame"}} + for _, c := range m.GraphicFrame { + e.EncodeElement(c, segraphicFrame) + } + } + if m.GrpSp != nil { + segrpSp := xml.StartElement{Name: xml.Name{Local: "a:grpSp"}} + for _, c := range m.GrpSp { + e.EncodeElement(c, segrpSp) + } + } + return nil +} + +func (m *CT_GvmlGroupShapeChoice) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_GvmlGroupShapeChoice: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "txSp"}: + tmp := NewCT_GvmlTextShape() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.TxSp = append(m.TxSp, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "sp"}: + tmp := NewCT_GvmlShape() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Sp = append(m.Sp, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "cxnSp"}: + tmp := NewCT_GvmlConnector() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.CxnSp = append(m.CxnSp, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "pic"}: + tmp := NewCT_GvmlPicture() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Pic = append(m.Pic, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "graphicFrame"}: + tmp := NewCT_GvmlGraphicalObjectFrame() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.GraphicFrame = append(m.GraphicFrame, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "grpSp"}: + tmp := NewCT_GvmlGroupShape() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.GrpSp = append(m.GrpSp, tmp) + default: + gooxml.Log("skipping unsupported element on CT_GvmlGroupShapeChoice %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_GvmlGroupShapeChoice + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_GvmlGroupShapeChoice and its children +func (m *CT_GvmlGroupShapeChoice) Validate() error { + return m.ValidateWithPath("CT_GvmlGroupShapeChoice") +} + +// ValidateWithPath validates the CT_GvmlGroupShapeChoice and its children, prefixing error messages with path +func (m *CT_GvmlGroupShapeChoice) ValidateWithPath(path string) error { + for i, v := range m.TxSp { + if err := v.ValidateWithPath(fmt.Sprintf("%s/TxSp[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.Sp { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Sp[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.CxnSp { + if err := v.ValidateWithPath(fmt.Sprintf("%s/CxnSp[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.Pic { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Pic[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.GraphicFrame { + if err := v.ValidateWithPath(fmt.Sprintf("%s/GraphicFrame[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.GrpSp { + if err := v.ValidateWithPath(fmt.Sprintf("%s/GrpSp[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlGroupShapeNonVisual.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlGroupShapeNonVisual.go new file mode 100644 index 00000000..7e08f6f2 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlGroupShapeNonVisual.go @@ -0,0 +1,89 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_GvmlGroupShapeNonVisual struct { + CNvPr *CT_NonVisualDrawingProps + CNvGrpSpPr *CT_NonVisualGroupDrawingShapeProps +} + +func NewCT_GvmlGroupShapeNonVisual() *CT_GvmlGroupShapeNonVisual { + ret := &CT_GvmlGroupShapeNonVisual{} + ret.CNvPr = NewCT_NonVisualDrawingProps() + ret.CNvGrpSpPr = NewCT_NonVisualGroupDrawingShapeProps() + return ret +} + +func (m *CT_GvmlGroupShapeNonVisual) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + secNvPr := xml.StartElement{Name: xml.Name{Local: "a:cNvPr"}} + e.EncodeElement(m.CNvPr, secNvPr) + secNvGrpSpPr := xml.StartElement{Name: xml.Name{Local: "a:cNvGrpSpPr"}} + e.EncodeElement(m.CNvGrpSpPr, secNvGrpSpPr) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_GvmlGroupShapeNonVisual) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CNvPr = NewCT_NonVisualDrawingProps() + m.CNvGrpSpPr = NewCT_NonVisualGroupDrawingShapeProps() +lCT_GvmlGroupShapeNonVisual: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "cNvPr"}: + if err := d.DecodeElement(m.CNvPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "cNvGrpSpPr"}: + if err := d.DecodeElement(m.CNvGrpSpPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_GvmlGroupShapeNonVisual %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_GvmlGroupShapeNonVisual + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_GvmlGroupShapeNonVisual and its children +func (m *CT_GvmlGroupShapeNonVisual) Validate() error { + return m.ValidateWithPath("CT_GvmlGroupShapeNonVisual") +} + +// ValidateWithPath validates the CT_GvmlGroupShapeNonVisual and its children, prefixing error messages with path +func (m *CT_GvmlGroupShapeNonVisual) ValidateWithPath(path string) error { + if err := m.CNvPr.ValidateWithPath(path + "/CNvPr"); err != nil { + return err + } + if err := m.CNvGrpSpPr.ValidateWithPath(path + "/CNvGrpSpPr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlPicture.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlPicture.go new file mode 100644 index 00000000..f781778d --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlPicture.go @@ -0,0 +1,131 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_GvmlPicture struct { + NvPicPr *CT_GvmlPictureNonVisual + BlipFill *CT_BlipFillProperties + SpPr *CT_ShapeProperties + Style *CT_ShapeStyle + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_GvmlPicture() *CT_GvmlPicture { + ret := &CT_GvmlPicture{} + ret.NvPicPr = NewCT_GvmlPictureNonVisual() + ret.BlipFill = NewCT_BlipFillProperties() + ret.SpPr = NewCT_ShapeProperties() + return ret +} + +func (m *CT_GvmlPicture) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + senvPicPr := xml.StartElement{Name: xml.Name{Local: "a:nvPicPr"}} + e.EncodeElement(m.NvPicPr, senvPicPr) + seblipFill := xml.StartElement{Name: xml.Name{Local: "a:blipFill"}} + e.EncodeElement(m.BlipFill, seblipFill) + sespPr := xml.StartElement{Name: xml.Name{Local: "a:spPr"}} + e.EncodeElement(m.SpPr, sespPr) + if m.Style != nil { + sestyle := xml.StartElement{Name: xml.Name{Local: "a:style"}} + e.EncodeElement(m.Style, sestyle) + } + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_GvmlPicture) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.NvPicPr = NewCT_GvmlPictureNonVisual() + m.BlipFill = NewCT_BlipFillProperties() + m.SpPr = NewCT_ShapeProperties() +lCT_GvmlPicture: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "nvPicPr"}: + if err := d.DecodeElement(m.NvPicPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blipFill"}: + if err := d.DecodeElement(m.BlipFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "spPr"}: + if err := d.DecodeElement(m.SpPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "style"}: + m.Style = NewCT_ShapeStyle() + if err := d.DecodeElement(m.Style, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_GvmlPicture %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_GvmlPicture + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_GvmlPicture and its children +func (m *CT_GvmlPicture) Validate() error { + return m.ValidateWithPath("CT_GvmlPicture") +} + +// ValidateWithPath validates the CT_GvmlPicture and its children, prefixing error messages with path +func (m *CT_GvmlPicture) ValidateWithPath(path string) error { + if err := m.NvPicPr.ValidateWithPath(path + "/NvPicPr"); err != nil { + return err + } + if err := m.BlipFill.ValidateWithPath(path + "/BlipFill"); err != nil { + return err + } + if err := m.SpPr.ValidateWithPath(path + "/SpPr"); err != nil { + return err + } + if m.Style != nil { + if err := m.Style.ValidateWithPath(path + "/Style"); err != nil { + return err + } + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlPictureNonVisual.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlPictureNonVisual.go new file mode 100644 index 00000000..65b92957 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlPictureNonVisual.go @@ -0,0 +1,89 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_GvmlPictureNonVisual struct { + CNvPr *CT_NonVisualDrawingProps + CNvPicPr *CT_NonVisualPictureProperties +} + +func NewCT_GvmlPictureNonVisual() *CT_GvmlPictureNonVisual { + ret := &CT_GvmlPictureNonVisual{} + ret.CNvPr = NewCT_NonVisualDrawingProps() + ret.CNvPicPr = NewCT_NonVisualPictureProperties() + return ret +} + +func (m *CT_GvmlPictureNonVisual) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + secNvPr := xml.StartElement{Name: xml.Name{Local: "a:cNvPr"}} + e.EncodeElement(m.CNvPr, secNvPr) + secNvPicPr := xml.StartElement{Name: xml.Name{Local: "a:cNvPicPr"}} + e.EncodeElement(m.CNvPicPr, secNvPicPr) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_GvmlPictureNonVisual) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CNvPr = NewCT_NonVisualDrawingProps() + m.CNvPicPr = NewCT_NonVisualPictureProperties() +lCT_GvmlPictureNonVisual: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "cNvPr"}: + if err := d.DecodeElement(m.CNvPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "cNvPicPr"}: + if err := d.DecodeElement(m.CNvPicPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_GvmlPictureNonVisual %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_GvmlPictureNonVisual + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_GvmlPictureNonVisual and its children +func (m *CT_GvmlPictureNonVisual) Validate() error { + return m.ValidateWithPath("CT_GvmlPictureNonVisual") +} + +// ValidateWithPath validates the CT_GvmlPictureNonVisual and its children, prefixing error messages with path +func (m *CT_GvmlPictureNonVisual) ValidateWithPath(path string) error { + if err := m.CNvPr.ValidateWithPath(path + "/CNvPr"); err != nil { + return err + } + if err := m.CNvPicPr.ValidateWithPath(path + "/CNvPicPr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlShape.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlShape.go new file mode 100644 index 00000000..03ede0e4 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlShape.go @@ -0,0 +1,134 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_GvmlShape struct { + NvSpPr *CT_GvmlShapeNonVisual + SpPr *CT_ShapeProperties + TxSp *CT_GvmlTextShape + Style *CT_ShapeStyle + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_GvmlShape() *CT_GvmlShape { + ret := &CT_GvmlShape{} + ret.NvSpPr = NewCT_GvmlShapeNonVisual() + ret.SpPr = NewCT_ShapeProperties() + return ret +} + +func (m *CT_GvmlShape) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + senvSpPr := xml.StartElement{Name: xml.Name{Local: "a:nvSpPr"}} + e.EncodeElement(m.NvSpPr, senvSpPr) + sespPr := xml.StartElement{Name: xml.Name{Local: "a:spPr"}} + e.EncodeElement(m.SpPr, sespPr) + if m.TxSp != nil { + setxSp := xml.StartElement{Name: xml.Name{Local: "a:txSp"}} + e.EncodeElement(m.TxSp, setxSp) + } + if m.Style != nil { + sestyle := xml.StartElement{Name: xml.Name{Local: "a:style"}} + e.EncodeElement(m.Style, sestyle) + } + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_GvmlShape) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.NvSpPr = NewCT_GvmlShapeNonVisual() + m.SpPr = NewCT_ShapeProperties() +lCT_GvmlShape: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "nvSpPr"}: + if err := d.DecodeElement(m.NvSpPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "spPr"}: + if err := d.DecodeElement(m.SpPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "txSp"}: + m.TxSp = NewCT_GvmlTextShape() + if err := d.DecodeElement(m.TxSp, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "style"}: + m.Style = NewCT_ShapeStyle() + if err := d.DecodeElement(m.Style, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_GvmlShape %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_GvmlShape + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_GvmlShape and its children +func (m *CT_GvmlShape) Validate() error { + return m.ValidateWithPath("CT_GvmlShape") +} + +// ValidateWithPath validates the CT_GvmlShape and its children, prefixing error messages with path +func (m *CT_GvmlShape) ValidateWithPath(path string) error { + if err := m.NvSpPr.ValidateWithPath(path + "/NvSpPr"); err != nil { + return err + } + if err := m.SpPr.ValidateWithPath(path + "/SpPr"); err != nil { + return err + } + if m.TxSp != nil { + if err := m.TxSp.ValidateWithPath(path + "/TxSp"); err != nil { + return err + } + } + if m.Style != nil { + if err := m.Style.ValidateWithPath(path + "/Style"); err != nil { + return err + } + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlShapeNonVisual.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlShapeNonVisual.go new file mode 100644 index 00000000..c916eb02 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlShapeNonVisual.go @@ -0,0 +1,89 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_GvmlShapeNonVisual struct { + CNvPr *CT_NonVisualDrawingProps + CNvSpPr *CT_NonVisualDrawingShapeProps +} + +func NewCT_GvmlShapeNonVisual() *CT_GvmlShapeNonVisual { + ret := &CT_GvmlShapeNonVisual{} + ret.CNvPr = NewCT_NonVisualDrawingProps() + ret.CNvSpPr = NewCT_NonVisualDrawingShapeProps() + return ret +} + +func (m *CT_GvmlShapeNonVisual) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + secNvPr := xml.StartElement{Name: xml.Name{Local: "a:cNvPr"}} + e.EncodeElement(m.CNvPr, secNvPr) + secNvSpPr := xml.StartElement{Name: xml.Name{Local: "a:cNvSpPr"}} + e.EncodeElement(m.CNvSpPr, secNvSpPr) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_GvmlShapeNonVisual) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CNvPr = NewCT_NonVisualDrawingProps() + m.CNvSpPr = NewCT_NonVisualDrawingShapeProps() +lCT_GvmlShapeNonVisual: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "cNvPr"}: + if err := d.DecodeElement(m.CNvPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "cNvSpPr"}: + if err := d.DecodeElement(m.CNvSpPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_GvmlShapeNonVisual %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_GvmlShapeNonVisual + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_GvmlShapeNonVisual and its children +func (m *CT_GvmlShapeNonVisual) Validate() error { + return m.ValidateWithPath("CT_GvmlShapeNonVisual") +} + +// ValidateWithPath validates the CT_GvmlShapeNonVisual and its children, prefixing error messages with path +func (m *CT_GvmlShapeNonVisual) ValidateWithPath(path string) error { + if err := m.CNvPr.ValidateWithPath(path + "/CNvPr"); err != nil { + return err + } + if err := m.CNvSpPr.ValidateWithPath(path + "/CNvSpPr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlTextShape.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlTextShape.go new file mode 100644 index 00000000..d1b84b2f --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlTextShape.go @@ -0,0 +1,111 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_GvmlTextShape struct { + TxBody *CT_TextBody + Choice *CT_GvmlTextShapeChoice + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_GvmlTextShape() *CT_GvmlTextShape { + ret := &CT_GvmlTextShape{} + ret.TxBody = NewCT_TextBody() + return ret +} + +func (m *CT_GvmlTextShape) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + setxBody := xml.StartElement{Name: xml.Name{Local: "a:txBody"}} + e.EncodeElement(m.TxBody, setxBody) + if m.Choice != nil { + m.Choice.MarshalXML(e, xml.StartElement{}) + } + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_GvmlTextShape) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.TxBody = NewCT_TextBody() +lCT_GvmlTextShape: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "txBody"}: + if err := d.DecodeElement(m.TxBody, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "useSpRect"}: + m.Choice = NewCT_GvmlTextShapeChoice() + if err := d.DecodeElement(&m.Choice.UseSpRect, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "xfrm"}: + m.Choice = NewCT_GvmlTextShapeChoice() + if err := d.DecodeElement(&m.Choice.Xfrm, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_GvmlTextShape %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_GvmlTextShape + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_GvmlTextShape and its children +func (m *CT_GvmlTextShape) Validate() error { + return m.ValidateWithPath("CT_GvmlTextShape") +} + +// ValidateWithPath validates the CT_GvmlTextShape and its children, prefixing error messages with path +func (m *CT_GvmlTextShape) ValidateWithPath(path string) error { + if err := m.TxBody.ValidateWithPath(path + "/TxBody"); err != nil { + return err + } + if m.Choice != nil { + if err := m.Choice.ValidateWithPath(path + "/Choice"); err != nil { + return err + } + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlTextShapeChoice.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlTextShapeChoice.go new file mode 100644 index 00000000..fbca3175 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlTextShapeChoice.go @@ -0,0 +1,93 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_GvmlTextShapeChoice struct { + UseSpRect *CT_GvmlUseShapeRectangle + Xfrm *CT_Transform2D +} + +func NewCT_GvmlTextShapeChoice() *CT_GvmlTextShapeChoice { + ret := &CT_GvmlTextShapeChoice{} + return ret +} + +func (m *CT_GvmlTextShapeChoice) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.UseSpRect != nil { + seuseSpRect := xml.StartElement{Name: xml.Name{Local: "a:useSpRect"}} + e.EncodeElement(m.UseSpRect, seuseSpRect) + } + if m.Xfrm != nil { + sexfrm := xml.StartElement{Name: xml.Name{Local: "a:xfrm"}} + e.EncodeElement(m.Xfrm, sexfrm) + } + return nil +} + +func (m *CT_GvmlTextShapeChoice) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_GvmlTextShapeChoice: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "useSpRect"}: + m.UseSpRect = NewCT_GvmlUseShapeRectangle() + if err := d.DecodeElement(m.UseSpRect, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "xfrm"}: + m.Xfrm = NewCT_Transform2D() + if err := d.DecodeElement(m.Xfrm, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_GvmlTextShapeChoice %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_GvmlTextShapeChoice + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_GvmlTextShapeChoice and its children +func (m *CT_GvmlTextShapeChoice) Validate() error { + return m.ValidateWithPath("CT_GvmlTextShapeChoice") +} + +// ValidateWithPath validates the CT_GvmlTextShapeChoice and its children, prefixing error messages with path +func (m *CT_GvmlTextShapeChoice) ValidateWithPath(path string) error { + if m.UseSpRect != nil { + if err := m.UseSpRect.ValidateWithPath(path + "/UseSpRect"); err != nil { + return err + } + } + if m.Xfrm != nil { + if err := m.Xfrm.ValidateWithPath(path + "/Xfrm"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlUseShapeRectangle.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlUseShapeRectangle.go new file mode 100644 index 00000000..326740e0 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_GvmlUseShapeRectangle.go @@ -0,0 +1,54 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_GvmlUseShapeRectangle struct { +} + +func NewCT_GvmlUseShapeRectangle() *CT_GvmlUseShapeRectangle { + ret := &CT_GvmlUseShapeRectangle{} + return ret +} + +func (m *CT_GvmlUseShapeRectangle) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_GvmlUseShapeRectangle) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_GvmlUseShapeRectangle: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_GvmlUseShapeRectangle and its children +func (m *CT_GvmlUseShapeRectangle) Validate() error { + return m.ValidateWithPath("CT_GvmlUseShapeRectangle") +} + +// ValidateWithPath validates the CT_GvmlUseShapeRectangle and its children, prefixing error messages with path +func (m *CT_GvmlUseShapeRectangle) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_HSLEffect.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_HSLEffect.go new file mode 100644 index 00000000..191ff059 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_HSLEffect.go @@ -0,0 +1,115 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" +) + +type CT_HSLEffect struct { + HueAttr *int32 + SatAttr *ST_FixedPercentage + LumAttr *ST_FixedPercentage +} + +func NewCT_HSLEffect() *CT_HSLEffect { + ret := &CT_HSLEffect{} + return ret +} + +func (m *CT_HSLEffect) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.HueAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "hue"}, + Value: fmt.Sprintf("%v", *m.HueAttr)}) + } + if m.SatAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "sat"}, + Value: fmt.Sprintf("%v", *m.SatAttr)}) + } + if m.LumAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "lum"}, + Value: fmt.Sprintf("%v", *m.LumAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_HSLEffect) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "hue" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + pt := int32(parsed) + m.HueAttr = &pt + continue + } + if attr.Name.Local == "sat" { + parsed, err := ParseUnionST_FixedPercentage(attr.Value) + if err != nil { + return err + } + m.SatAttr = &parsed + continue + } + if attr.Name.Local == "lum" { + parsed, err := ParseUnionST_FixedPercentage(attr.Value) + if err != nil { + return err + } + m.LumAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_HSLEffect: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_HSLEffect and its children +func (m *CT_HSLEffect) Validate() error { + return m.ValidateWithPath("CT_HSLEffect") +} + +// ValidateWithPath validates the CT_HSLEffect and its children, prefixing error messages with path +func (m *CT_HSLEffect) ValidateWithPath(path string) error { + if m.HueAttr != nil { + if *m.HueAttr < 0 { + return fmt.Errorf("%s/m.HueAttr must be >= 0 (have %v)", path, *m.HueAttr) + } + if *m.HueAttr >= 21600000 { + return fmt.Errorf("%s/m.HueAttr must be < 21600000 (have %v)", path, *m.HueAttr) + } + } + if m.SatAttr != nil { + if err := m.SatAttr.ValidateWithPath(path + "/SatAttr"); err != nil { + return err + } + } + if m.LumAttr != nil { + if err := m.LumAttr.ValidateWithPath(path + "/LumAttr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Headers.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Headers.go new file mode 100644 index 00000000..8bdf5456 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Headers.go @@ -0,0 +1,76 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_Headers struct { + Header []string +} + +func NewCT_Headers() *CT_Headers { + ret := &CT_Headers{} + return ret +} + +func (m *CT_Headers) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + seheader := xml.StartElement{Name: xml.Name{Local: "a:header"}} + for _, c := range m.Header { + e.EncodeElement(c, seheader) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Headers) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_Headers: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "header"}: + var tmp string + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Header = append(m.Header, tmp) + default: + gooxml.Log("skipping unsupported element on CT_Headers %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Headers + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Headers and its children +func (m *CT_Headers) Validate() error { + return m.ValidateWithPath("CT_Headers") +} + +// ValidateWithPath validates the CT_Headers and its children, prefixing error messages with path +func (m *CT_Headers) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_HslColor.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_HslColor.go new file mode 100644 index 00000000..68d2f821 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_HslColor.go @@ -0,0 +1,323 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type CT_HslColor struct { + HueAttr int32 + SatAttr ST_Percentage + LumAttr ST_Percentage + EG_ColorTransform []*EG_ColorTransform +} + +func NewCT_HslColor() *CT_HslColor { + ret := &CT_HslColor{} + ret.HueAttr = 0 + return ret +} + +func (m *CT_HslColor) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "hue"}, + Value: fmt.Sprintf("%v", m.HueAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "sat"}, + Value: fmt.Sprintf("%v", m.SatAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "lum"}, + Value: fmt.Sprintf("%v", m.LumAttr)}) + e.EncodeToken(start) + if m.EG_ColorTransform != nil { + for _, c := range m.EG_ColorTransform { + c.MarshalXML(e, xml.StartElement{}) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_HslColor) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.HueAttr = 0 + for _, attr := range start.Attr { + if attr.Name.Local == "hue" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + m.HueAttr = int32(parsed) + continue + } + if attr.Name.Local == "sat" { + parsed, err := ParseUnionST_Percentage(attr.Value) + if err != nil { + return err + } + m.SatAttr = parsed + continue + } + if attr.Name.Local == "lum" { + parsed, err := ParseUnionST_Percentage(attr.Value) + if err != nil { + return err + } + m.LumAttr = parsed + continue + } + } +lCT_HslColor: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "tint"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Tint = NewCT_PositiveFixedPercentage() + if err := d.DecodeElement(tmpcolortransform.Tint, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "shade"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Shade = NewCT_PositiveFixedPercentage() + if err := d.DecodeElement(tmpcolortransform.Shade, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "comp"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Comp = NewCT_ComplementTransform() + if err := d.DecodeElement(tmpcolortransform.Comp, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "inv"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Inv = NewCT_InverseTransform() + if err := d.DecodeElement(tmpcolortransform.Inv, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "gray"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Gray = NewCT_GrayscaleTransform() + if err := d.DecodeElement(tmpcolortransform.Gray, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alpha"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Alpha = NewCT_PositiveFixedPercentage() + if err := d.DecodeElement(tmpcolortransform.Alpha, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.AlphaOff = NewCT_FixedPercentage() + if err := d.DecodeElement(tmpcolortransform.AlphaOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.AlphaMod = NewCT_PositivePercentage() + if err := d.DecodeElement(tmpcolortransform.AlphaMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hue"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Hue = NewCT_PositiveFixedAngle() + if err := d.DecodeElement(tmpcolortransform.Hue, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hueOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.HueOff = NewCT_Angle() + if err := d.DecodeElement(tmpcolortransform.HueOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hueMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.HueMod = NewCT_PositivePercentage() + if err := d.DecodeElement(tmpcolortransform.HueMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "sat"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Sat = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.Sat, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "satOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.SatOff = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.SatOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "satMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.SatMod = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.SatMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lum"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Lum = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.Lum, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lumOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.LumOff = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.LumOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lumMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.LumMod = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.LumMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "red"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Red = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.Red, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "redOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.RedOff = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.RedOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "redMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.RedMod = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.RedMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "green"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Green = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.Green, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "greenOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.GreenOff = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.GreenOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "greenMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.GreenMod = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.GreenMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blue"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Blue = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.Blue, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blueOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.BlueOff = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.BlueOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blueMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.BlueMod = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.BlueMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "gamma"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Gamma = NewCT_GammaTransform() + if err := d.DecodeElement(tmpcolortransform.Gamma, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "invGamma"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.InvGamma = NewCT_InverseGammaTransform() + if err := d.DecodeElement(tmpcolortransform.InvGamma, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + default: + gooxml.Log("skipping unsupported element on CT_HslColor %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_HslColor + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_HslColor and its children +func (m *CT_HslColor) Validate() error { + return m.ValidateWithPath("CT_HslColor") +} + +// ValidateWithPath validates the CT_HslColor and its children, prefixing error messages with path +func (m *CT_HslColor) ValidateWithPath(path string) error { + if m.HueAttr < 0 { + return fmt.Errorf("%s/m.HueAttr must be >= 0 (have %v)", path, m.HueAttr) + } + if m.HueAttr >= 21600000 { + return fmt.Errorf("%s/m.HueAttr must be < 21600000 (have %v)", path, m.HueAttr) + } + if err := m.SatAttr.ValidateWithPath(path + "/SatAttr"); err != nil { + return err + } + if err := m.LumAttr.ValidateWithPath(path + "/LumAttr"); err != nil { + return err + } + for i, v := range m.EG_ColorTransform { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_ColorTransform[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Hyperlink.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Hyperlink.go new file mode 100644 index 00000000..59cff137 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Hyperlink.go @@ -0,0 +1,203 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type CT_Hyperlink struct { + IdAttr *string + InvalidUrlAttr *string + ActionAttr *string + TgtFrameAttr *string + TooltipAttr *string + HistoryAttr *bool + HighlightClickAttr *bool + EndSndAttr *bool + Snd *CT_EmbeddedWAVAudioFile + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_Hyperlink() *CT_Hyperlink { + ret := &CT_Hyperlink{} + return ret +} + +func (m *CT_Hyperlink) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.IdAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "r:id"}, + Value: fmt.Sprintf("%v", *m.IdAttr)}) + } + if m.InvalidUrlAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "invalidUrl"}, + Value: fmt.Sprintf("%v", *m.InvalidUrlAttr)}) + } + if m.ActionAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "action"}, + Value: fmt.Sprintf("%v", *m.ActionAttr)}) + } + if m.TgtFrameAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "tgtFrame"}, + Value: fmt.Sprintf("%v", *m.TgtFrameAttr)}) + } + if m.TooltipAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "tooltip"}, + Value: fmt.Sprintf("%v", *m.TooltipAttr)}) + } + if m.HistoryAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "history"}, + Value: fmt.Sprintf("%d", b2i(*m.HistoryAttr))}) + } + if m.HighlightClickAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "highlightClick"}, + Value: fmt.Sprintf("%d", b2i(*m.HighlightClickAttr))}) + } + if m.EndSndAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "endSnd"}, + Value: fmt.Sprintf("%d", b2i(*m.EndSndAttr))}) + } + e.EncodeToken(start) + if m.Snd != nil { + sesnd := xml.StartElement{Name: xml.Name{Local: "a:snd"}} + e.EncodeElement(m.Snd, sesnd) + } + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Hyperlink) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Space == "http://schemas.openxmlformats.org/officeDocument/2006/relationships" && attr.Name.Local == "id" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.IdAttr = &parsed + continue + } + if attr.Name.Local == "invalidUrl" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.InvalidUrlAttr = &parsed + continue + } + if attr.Name.Local == "action" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ActionAttr = &parsed + continue + } + if attr.Name.Local == "tgtFrame" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.TgtFrameAttr = &parsed + continue + } + if attr.Name.Local == "tooltip" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.TooltipAttr = &parsed + continue + } + if attr.Name.Local == "history" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.HistoryAttr = &parsed + continue + } + if attr.Name.Local == "highlightClick" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.HighlightClickAttr = &parsed + continue + } + if attr.Name.Local == "endSnd" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.EndSndAttr = &parsed + continue + } + } +lCT_Hyperlink: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "snd"}: + m.Snd = NewCT_EmbeddedWAVAudioFile() + if err := d.DecodeElement(m.Snd, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_Hyperlink %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Hyperlink + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Hyperlink and its children +func (m *CT_Hyperlink) Validate() error { + return m.ValidateWithPath("CT_Hyperlink") +} + +// ValidateWithPath validates the CT_Hyperlink and its children, prefixing error messages with path +func (m *CT_Hyperlink) ValidateWithPath(path string) error { + if m.Snd != nil { + if err := m.Snd.ValidateWithPath(path + "/Snd"); err != nil { + return err + } + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_InnerShadowEffect.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_InnerShadowEffect.go new file mode 100644 index 00000000..c875e942 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_InnerShadowEffect.go @@ -0,0 +1,223 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type CT_InnerShadowEffect struct { + BlurRadAttr *int64 + DistAttr *int64 + DirAttr *int32 + ScrgbClr *CT_ScRgbColor + SrgbClr *CT_SRgbColor + HslClr *CT_HslColor + SysClr *CT_SystemColor + SchemeClr *CT_SchemeColor + PrstClr *CT_PresetColor +} + +func NewCT_InnerShadowEffect() *CT_InnerShadowEffect { + ret := &CT_InnerShadowEffect{} + return ret +} + +func (m *CT_InnerShadowEffect) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.BlurRadAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "blurRad"}, + Value: fmt.Sprintf("%v", *m.BlurRadAttr)}) + } + if m.DistAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "dist"}, + Value: fmt.Sprintf("%v", *m.DistAttr)}) + } + if m.DirAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "dir"}, + Value: fmt.Sprintf("%v", *m.DirAttr)}) + } + e.EncodeToken(start) + if m.ScrgbClr != nil { + sescrgbClr := xml.StartElement{Name: xml.Name{Local: "a:scrgbClr"}} + e.EncodeElement(m.ScrgbClr, sescrgbClr) + } + if m.SrgbClr != nil { + sesrgbClr := xml.StartElement{Name: xml.Name{Local: "a:srgbClr"}} + e.EncodeElement(m.SrgbClr, sesrgbClr) + } + if m.HslClr != nil { + sehslClr := xml.StartElement{Name: xml.Name{Local: "a:hslClr"}} + e.EncodeElement(m.HslClr, sehslClr) + } + if m.SysClr != nil { + sesysClr := xml.StartElement{Name: xml.Name{Local: "a:sysClr"}} + e.EncodeElement(m.SysClr, sesysClr) + } + if m.SchemeClr != nil { + seschemeClr := xml.StartElement{Name: xml.Name{Local: "a:schemeClr"}} + e.EncodeElement(m.SchemeClr, seschemeClr) + } + if m.PrstClr != nil { + seprstClr := xml.StartElement{Name: xml.Name{Local: "a:prstClr"}} + e.EncodeElement(m.PrstClr, seprstClr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_InnerShadowEffect) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "blurRad" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.BlurRadAttr = &parsed + continue + } + if attr.Name.Local == "dist" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.DistAttr = &parsed + continue + } + if attr.Name.Local == "dir" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + pt := int32(parsed) + m.DirAttr = &pt + continue + } + } +lCT_InnerShadowEffect: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "scrgbClr"}: + m.ScrgbClr = NewCT_ScRgbColor() + if err := d.DecodeElement(m.ScrgbClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "srgbClr"}: + m.SrgbClr = NewCT_SRgbColor() + if err := d.DecodeElement(m.SrgbClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hslClr"}: + m.HslClr = NewCT_HslColor() + if err := d.DecodeElement(m.HslClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "sysClr"}: + m.SysClr = NewCT_SystemColor() + if err := d.DecodeElement(m.SysClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "schemeClr"}: + m.SchemeClr = NewCT_SchemeColor() + if err := d.DecodeElement(m.SchemeClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "prstClr"}: + m.PrstClr = NewCT_PresetColor() + if err := d.DecodeElement(m.PrstClr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_InnerShadowEffect %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_InnerShadowEffect + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_InnerShadowEffect and its children +func (m *CT_InnerShadowEffect) Validate() error { + return m.ValidateWithPath("CT_InnerShadowEffect") +} + +// ValidateWithPath validates the CT_InnerShadowEffect and its children, prefixing error messages with path +func (m *CT_InnerShadowEffect) ValidateWithPath(path string) error { + if m.BlurRadAttr != nil { + if *m.BlurRadAttr < 0 { + return fmt.Errorf("%s/m.BlurRadAttr must be >= 0 (have %v)", path, *m.BlurRadAttr) + } + if *m.BlurRadAttr > 27273042316900 { + return fmt.Errorf("%s/m.BlurRadAttr must be <= 27273042316900 (have %v)", path, *m.BlurRadAttr) + } + } + if m.DistAttr != nil { + if *m.DistAttr < 0 { + return fmt.Errorf("%s/m.DistAttr must be >= 0 (have %v)", path, *m.DistAttr) + } + if *m.DistAttr > 27273042316900 { + return fmt.Errorf("%s/m.DistAttr must be <= 27273042316900 (have %v)", path, *m.DistAttr) + } + } + if m.DirAttr != nil { + if *m.DirAttr < 0 { + return fmt.Errorf("%s/m.DirAttr must be >= 0 (have %v)", path, *m.DirAttr) + } + if *m.DirAttr >= 21600000 { + return fmt.Errorf("%s/m.DirAttr must be < 21600000 (have %v)", path, *m.DirAttr) + } + } + if m.ScrgbClr != nil { + if err := m.ScrgbClr.ValidateWithPath(path + "/ScrgbClr"); err != nil { + return err + } + } + if m.SrgbClr != nil { + if err := m.SrgbClr.ValidateWithPath(path + "/SrgbClr"); err != nil { + return err + } + } + if m.HslClr != nil { + if err := m.HslClr.ValidateWithPath(path + "/HslClr"); err != nil { + return err + } + } + if m.SysClr != nil { + if err := m.SysClr.ValidateWithPath(path + "/SysClr"); err != nil { + return err + } + } + if m.SchemeClr != nil { + if err := m.SchemeClr.ValidateWithPath(path + "/SchemeClr"); err != nil { + return err + } + } + if m.PrstClr != nil { + if err := m.PrstClr.ValidateWithPath(path + "/PrstClr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_InverseGammaTransform.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_InverseGammaTransform.go new file mode 100644 index 00000000..a10ee33b --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_InverseGammaTransform.go @@ -0,0 +1,54 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_InverseGammaTransform struct { +} + +func NewCT_InverseGammaTransform() *CT_InverseGammaTransform { + ret := &CT_InverseGammaTransform{} + return ret +} + +func (m *CT_InverseGammaTransform) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_InverseGammaTransform) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_InverseGammaTransform: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_InverseGammaTransform and its children +func (m *CT_InverseGammaTransform) Validate() error { + return m.ValidateWithPath("CT_InverseGammaTransform") +} + +// ValidateWithPath validates the CT_InverseGammaTransform and its children, prefixing error messages with path +func (m *CT_InverseGammaTransform) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_InverseTransform.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_InverseTransform.go new file mode 100644 index 00000000..bd34c985 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_InverseTransform.go @@ -0,0 +1,54 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_InverseTransform struct { +} + +func NewCT_InverseTransform() *CT_InverseTransform { + ret := &CT_InverseTransform{} + return ret +} + +func (m *CT_InverseTransform) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_InverseTransform) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_InverseTransform: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_InverseTransform and its children +func (m *CT_InverseTransform) Validate() error { + return m.ValidateWithPath("CT_InverseTransform") +} + +// ValidateWithPath validates the CT_InverseTransform and its children, prefixing error messages with path +func (m *CT_InverseTransform) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_LightRig.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_LightRig.go new file mode 100644 index 00000000..945aeea8 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_LightRig.go @@ -0,0 +1,119 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_LightRig struct { + RigAttr ST_LightRigType + DirAttr ST_LightRigDirection + Rot *CT_SphereCoords +} + +func NewCT_LightRig() *CT_LightRig { + ret := &CT_LightRig{} + ret.RigAttr = ST_LightRigType(1) + ret.DirAttr = ST_LightRigDirection(1) + return ret +} + +func (m *CT_LightRig) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.RigAttr.MarshalXMLAttr(xml.Name{Local: "rig"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + attr, err = m.DirAttr.MarshalXMLAttr(xml.Name{Local: "dir"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + if m.Rot != nil { + serot := xml.StartElement{Name: xml.Name{Local: "a:rot"}} + e.EncodeElement(m.Rot, serot) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_LightRig) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.RigAttr = ST_LightRigType(1) + m.DirAttr = ST_LightRigDirection(1) + for _, attr := range start.Attr { + if attr.Name.Local == "rig" { + m.RigAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "dir" { + m.DirAttr.UnmarshalXMLAttr(attr) + continue + } + } +lCT_LightRig: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "rot"}: + m.Rot = NewCT_SphereCoords() + if err := d.DecodeElement(m.Rot, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_LightRig %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_LightRig + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_LightRig and its children +func (m *CT_LightRig) Validate() error { + return m.ValidateWithPath("CT_LightRig") +} + +// ValidateWithPath validates the CT_LightRig and its children, prefixing error messages with path +func (m *CT_LightRig) ValidateWithPath(path string) error { + if m.RigAttr == ST_LightRigTypeUnset { + return fmt.Errorf("%s/RigAttr is a mandatory field", path) + } + if err := m.RigAttr.ValidateWithPath(path + "/RigAttr"); err != nil { + return err + } + if m.DirAttr == ST_LightRigDirectionUnset { + return fmt.Errorf("%s/DirAttr is a mandatory field", path) + } + if err := m.DirAttr.ValidateWithPath(path + "/DirAttr"); err != nil { + return err + } + if m.Rot != nil { + if err := m.Rot.ValidateWithPath(path + "/Rot"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_LineEndProperties.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_LineEndProperties.go new file mode 100644 index 00000000..f1a3cacd --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_LineEndProperties.go @@ -0,0 +1,101 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_LineEndProperties struct { + TypeAttr ST_LineEndType + WAttr ST_LineEndWidth + LenAttr ST_LineEndLength +} + +func NewCT_LineEndProperties() *CT_LineEndProperties { + ret := &CT_LineEndProperties{} + return ret +} + +func (m *CT_LineEndProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.TypeAttr != ST_LineEndTypeUnset { + attr, err := m.TypeAttr.MarshalXMLAttr(xml.Name{Local: "type"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.WAttr != ST_LineEndWidthUnset { + attr, err := m.WAttr.MarshalXMLAttr(xml.Name{Local: "w"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.LenAttr != ST_LineEndLengthUnset { + attr, err := m.LenAttr.MarshalXMLAttr(xml.Name{Local: "len"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_LineEndProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "type" { + m.TypeAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "w" { + m.WAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "len" { + m.LenAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_LineEndProperties: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_LineEndProperties and its children +func (m *CT_LineEndProperties) Validate() error { + return m.ValidateWithPath("CT_LineEndProperties") +} + +// ValidateWithPath validates the CT_LineEndProperties and its children, prefixing error messages with path +func (m *CT_LineEndProperties) ValidateWithPath(path string) error { + if err := m.TypeAttr.ValidateWithPath(path + "/TypeAttr"); err != nil { + return err + } + if err := m.WAttr.ValidateWithPath(path + "/WAttr"); err != nil { + return err + } + if err := m.LenAttr.ValidateWithPath(path + "/LenAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_LineJoinBevel.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_LineJoinBevel.go new file mode 100644 index 00000000..16e65ad1 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_LineJoinBevel.go @@ -0,0 +1,54 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_LineJoinBevel struct { +} + +func NewCT_LineJoinBevel() *CT_LineJoinBevel { + ret := &CT_LineJoinBevel{} + return ret +} + +func (m *CT_LineJoinBevel) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_LineJoinBevel) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_LineJoinBevel: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_LineJoinBevel and its children +func (m *CT_LineJoinBevel) Validate() error { + return m.ValidateWithPath("CT_LineJoinBevel") +} + +// ValidateWithPath validates the CT_LineJoinBevel and its children, prefixing error messages with path +func (m *CT_LineJoinBevel) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_LineJoinMiterProperties.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_LineJoinMiterProperties.go new file mode 100644 index 00000000..521ce8fe --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_LineJoinMiterProperties.go @@ -0,0 +1,74 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_LineJoinMiterProperties struct { + LimAttr *ST_PositivePercentage +} + +func NewCT_LineJoinMiterProperties() *CT_LineJoinMiterProperties { + ret := &CT_LineJoinMiterProperties{} + return ret +} + +func (m *CT_LineJoinMiterProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.LimAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "lim"}, + Value: fmt.Sprintf("%v", *m.LimAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_LineJoinMiterProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "lim" { + parsed, err := ParseUnionST_PositivePercentage(attr.Value) + if err != nil { + return err + } + m.LimAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_LineJoinMiterProperties: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_LineJoinMiterProperties and its children +func (m *CT_LineJoinMiterProperties) Validate() error { + return m.ValidateWithPath("CT_LineJoinMiterProperties") +} + +// ValidateWithPath validates the CT_LineJoinMiterProperties and its children, prefixing error messages with path +func (m *CT_LineJoinMiterProperties) ValidateWithPath(path string) error { + if m.LimAttr != nil { + if err := m.LimAttr.ValidateWithPath(path + "/LimAttr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_LineJoinRound.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_LineJoinRound.go new file mode 100644 index 00000000..81a40a45 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_LineJoinRound.go @@ -0,0 +1,54 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_LineJoinRound struct { +} + +func NewCT_LineJoinRound() *CT_LineJoinRound { + ret := &CT_LineJoinRound{} + return ret +} + +func (m *CT_LineJoinRound) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_LineJoinRound) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_LineJoinRound: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_LineJoinRound and its children +func (m *CT_LineJoinRound) Validate() error { + return m.ValidateWithPath("CT_LineJoinRound") +} + +// ValidateWithPath validates the CT_LineJoinRound and its children, prefixing error messages with path +func (m *CT_LineJoinRound) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_LineProperties.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_LineProperties.go new file mode 100644 index 00000000..d4543cea --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_LineProperties.go @@ -0,0 +1,316 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type CT_LineProperties struct { + WAttr *int32 + CapAttr ST_LineCap + CmpdAttr ST_CompoundLine + AlgnAttr ST_PenAlignment + NoFill *CT_NoFillProperties + SolidFill *CT_SolidColorFillProperties + GradFill *CT_GradientFillProperties + PattFill *CT_PatternFillProperties + PrstDash *CT_PresetLineDashProperties + CustDash *CT_DashStopList + Round *CT_LineJoinRound + Bevel *CT_LineJoinBevel + Miter *CT_LineJoinMiterProperties + HeadEnd *CT_LineEndProperties + TailEnd *CT_LineEndProperties + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_LineProperties() *CT_LineProperties { + ret := &CT_LineProperties{} + return ret +} + +func (m *CT_LineProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.WAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w"}, + Value: fmt.Sprintf("%v", *m.WAttr)}) + } + if m.CapAttr != ST_LineCapUnset { + attr, err := m.CapAttr.MarshalXMLAttr(xml.Name{Local: "cap"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.CmpdAttr != ST_CompoundLineUnset { + attr, err := m.CmpdAttr.MarshalXMLAttr(xml.Name{Local: "cmpd"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.AlgnAttr != ST_PenAlignmentUnset { + attr, err := m.AlgnAttr.MarshalXMLAttr(xml.Name{Local: "algn"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + if m.NoFill != nil { + senoFill := xml.StartElement{Name: xml.Name{Local: "a:noFill"}} + e.EncodeElement(m.NoFill, senoFill) + } + if m.SolidFill != nil { + sesolidFill := xml.StartElement{Name: xml.Name{Local: "a:solidFill"}} + e.EncodeElement(m.SolidFill, sesolidFill) + } + if m.GradFill != nil { + segradFill := xml.StartElement{Name: xml.Name{Local: "a:gradFill"}} + e.EncodeElement(m.GradFill, segradFill) + } + if m.PattFill != nil { + sepattFill := xml.StartElement{Name: xml.Name{Local: "a:pattFill"}} + e.EncodeElement(m.PattFill, sepattFill) + } + if m.PrstDash != nil { + seprstDash := xml.StartElement{Name: xml.Name{Local: "a:prstDash"}} + e.EncodeElement(m.PrstDash, seprstDash) + } + if m.CustDash != nil { + secustDash := xml.StartElement{Name: xml.Name{Local: "a:custDash"}} + e.EncodeElement(m.CustDash, secustDash) + } + if m.Round != nil { + seround := xml.StartElement{Name: xml.Name{Local: "a:round"}} + e.EncodeElement(m.Round, seround) + } + if m.Bevel != nil { + sebevel := xml.StartElement{Name: xml.Name{Local: "a:bevel"}} + e.EncodeElement(m.Bevel, sebevel) + } + if m.Miter != nil { + semiter := xml.StartElement{Name: xml.Name{Local: "a:miter"}} + e.EncodeElement(m.Miter, semiter) + } + if m.HeadEnd != nil { + seheadEnd := xml.StartElement{Name: xml.Name{Local: "a:headEnd"}} + e.EncodeElement(m.HeadEnd, seheadEnd) + } + if m.TailEnd != nil { + setailEnd := xml.StartElement{Name: xml.Name{Local: "a:tailEnd"}} + e.EncodeElement(m.TailEnd, setailEnd) + } + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_LineProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "w" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + pt := int32(parsed) + m.WAttr = &pt + continue + } + if attr.Name.Local == "cmpd" { + m.CmpdAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "cap" { + m.CapAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "algn" { + m.AlgnAttr.UnmarshalXMLAttr(attr) + continue + } + } +lCT_LineProperties: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "noFill"}: + m.NoFill = NewCT_NoFillProperties() + if err := d.DecodeElement(m.NoFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "solidFill"}: + m.SolidFill = NewCT_SolidColorFillProperties() + if err := d.DecodeElement(m.SolidFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "gradFill"}: + m.GradFill = NewCT_GradientFillProperties() + if err := d.DecodeElement(m.GradFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "pattFill"}: + m.PattFill = NewCT_PatternFillProperties() + if err := d.DecodeElement(m.PattFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "prstDash"}: + m.PrstDash = NewCT_PresetLineDashProperties() + if err := d.DecodeElement(m.PrstDash, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "custDash"}: + m.CustDash = NewCT_DashStopList() + if err := d.DecodeElement(m.CustDash, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "round"}: + m.Round = NewCT_LineJoinRound() + if err := d.DecodeElement(m.Round, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "bevel"}: + m.Bevel = NewCT_LineJoinBevel() + if err := d.DecodeElement(m.Bevel, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "miter"}: + m.Miter = NewCT_LineJoinMiterProperties() + if err := d.DecodeElement(m.Miter, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "headEnd"}: + m.HeadEnd = NewCT_LineEndProperties() + if err := d.DecodeElement(m.HeadEnd, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "tailEnd"}: + m.TailEnd = NewCT_LineEndProperties() + if err := d.DecodeElement(m.TailEnd, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_LineProperties %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_LineProperties + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_LineProperties and its children +func (m *CT_LineProperties) Validate() error { + return m.ValidateWithPath("CT_LineProperties") +} + +// ValidateWithPath validates the CT_LineProperties and its children, prefixing error messages with path +func (m *CT_LineProperties) ValidateWithPath(path string) error { + if m.WAttr != nil { + if *m.WAttr < 0 { + return fmt.Errorf("%s/m.WAttr must be >= 0 (have %v)", path, *m.WAttr) + } + if *m.WAttr > 20116800 { + return fmt.Errorf("%s/m.WAttr must be <= 20116800 (have %v)", path, *m.WAttr) + } + } + if err := m.CapAttr.ValidateWithPath(path + "/CapAttr"); err != nil { + return err + } + if err := m.CmpdAttr.ValidateWithPath(path + "/CmpdAttr"); err != nil { + return err + } + if err := m.AlgnAttr.ValidateWithPath(path + "/AlgnAttr"); err != nil { + return err + } + if m.NoFill != nil { + if err := m.NoFill.ValidateWithPath(path + "/NoFill"); err != nil { + return err + } + } + if m.SolidFill != nil { + if err := m.SolidFill.ValidateWithPath(path + "/SolidFill"); err != nil { + return err + } + } + if m.GradFill != nil { + if err := m.GradFill.ValidateWithPath(path + "/GradFill"); err != nil { + return err + } + } + if m.PattFill != nil { + if err := m.PattFill.ValidateWithPath(path + "/PattFill"); err != nil { + return err + } + } + if m.PrstDash != nil { + if err := m.PrstDash.ValidateWithPath(path + "/PrstDash"); err != nil { + return err + } + } + if m.CustDash != nil { + if err := m.CustDash.ValidateWithPath(path + "/CustDash"); err != nil { + return err + } + } + if m.Round != nil { + if err := m.Round.ValidateWithPath(path + "/Round"); err != nil { + return err + } + } + if m.Bevel != nil { + if err := m.Bevel.ValidateWithPath(path + "/Bevel"); err != nil { + return err + } + } + if m.Miter != nil { + if err := m.Miter.ValidateWithPath(path + "/Miter"); err != nil { + return err + } + } + if m.HeadEnd != nil { + if err := m.HeadEnd.ValidateWithPath(path + "/HeadEnd"); err != nil { + return err + } + } + if m.TailEnd != nil { + if err := m.TailEnd.ValidateWithPath(path + "/TailEnd"); err != nil { + return err + } + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_LineStyleList.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_LineStyleList.go new file mode 100644 index 00000000..bee95e24 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_LineStyleList.go @@ -0,0 +1,82 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_LineStyleList struct { + Ln []*CT_LineProperties +} + +func NewCT_LineStyleList() *CT_LineStyleList { + ret := &CT_LineStyleList{} + return ret +} + +func (m *CT_LineStyleList) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + seln := xml.StartElement{Name: xml.Name{Local: "a:ln"}} + for _, c := range m.Ln { + e.EncodeElement(c, seln) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_LineStyleList) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_LineStyleList: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "ln"}: + tmp := NewCT_LineProperties() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Ln = append(m.Ln, tmp) + default: + gooxml.Log("skipping unsupported element on CT_LineStyleList %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_LineStyleList + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_LineStyleList and its children +func (m *CT_LineStyleList) Validate() error { + return m.ValidateWithPath("CT_LineStyleList") +} + +// ValidateWithPath validates the CT_LineStyleList and its children, prefixing error messages with path +func (m *CT_LineStyleList) ValidateWithPath(path string) error { + for i, v := range m.Ln { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Ln[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_LinearShadeProperties.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_LinearShadeProperties.go new file mode 100644 index 00000000..e02e5bb2 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_LinearShadeProperties.go @@ -0,0 +1,92 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" +) + +type CT_LinearShadeProperties struct { + AngAttr *int32 + ScaledAttr *bool +} + +func NewCT_LinearShadeProperties() *CT_LinearShadeProperties { + ret := &CT_LinearShadeProperties{} + return ret +} + +func (m *CT_LinearShadeProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.AngAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "ang"}, + Value: fmt.Sprintf("%v", *m.AngAttr)}) + } + if m.ScaledAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "scaled"}, + Value: fmt.Sprintf("%d", b2i(*m.ScaledAttr))}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_LinearShadeProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "ang" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + pt := int32(parsed) + m.AngAttr = &pt + continue + } + if attr.Name.Local == "scaled" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.ScaledAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_LinearShadeProperties: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_LinearShadeProperties and its children +func (m *CT_LinearShadeProperties) Validate() error { + return m.ValidateWithPath("CT_LinearShadeProperties") +} + +// ValidateWithPath validates the CT_LinearShadeProperties and its children, prefixing error messages with path +func (m *CT_LinearShadeProperties) ValidateWithPath(path string) error { + if m.AngAttr != nil { + if *m.AngAttr < 0 { + return fmt.Errorf("%s/m.AngAttr must be >= 0 (have %v)", path, *m.AngAttr) + } + if *m.AngAttr >= 21600000 { + return fmt.Errorf("%s/m.AngAttr must be < 21600000 (have %v)", path, *m.AngAttr) + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_LuminanceEffect.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_LuminanceEffect.go new file mode 100644 index 00000000..d65211bb --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_LuminanceEffect.go @@ -0,0 +1,92 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_LuminanceEffect struct { + BrightAttr *ST_FixedPercentage + ContrastAttr *ST_FixedPercentage +} + +func NewCT_LuminanceEffect() *CT_LuminanceEffect { + ret := &CT_LuminanceEffect{} + return ret +} + +func (m *CT_LuminanceEffect) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.BrightAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "bright"}, + Value: fmt.Sprintf("%v", *m.BrightAttr)}) + } + if m.ContrastAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "contrast"}, + Value: fmt.Sprintf("%v", *m.ContrastAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_LuminanceEffect) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "bright" { + parsed, err := ParseUnionST_FixedPercentage(attr.Value) + if err != nil { + return err + } + m.BrightAttr = &parsed + continue + } + if attr.Name.Local == "contrast" { + parsed, err := ParseUnionST_FixedPercentage(attr.Value) + if err != nil { + return err + } + m.ContrastAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_LuminanceEffect: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_LuminanceEffect and its children +func (m *CT_LuminanceEffect) Validate() error { + return m.ValidateWithPath("CT_LuminanceEffect") +} + +// ValidateWithPath validates the CT_LuminanceEffect and its children, prefixing error messages with path +func (m *CT_LuminanceEffect) ValidateWithPath(path string) error { + if m.BrightAttr != nil { + if err := m.BrightAttr.ValidateWithPath(path + "/BrightAttr"); err != nil { + return err + } + } + if m.ContrastAttr != nil { + if err := m.ContrastAttr.ValidateWithPath(path + "/ContrastAttr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_NoFillProperties.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_NoFillProperties.go new file mode 100644 index 00000000..92097479 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_NoFillProperties.go @@ -0,0 +1,54 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_NoFillProperties struct { +} + +func NewCT_NoFillProperties() *CT_NoFillProperties { + ret := &CT_NoFillProperties{} + return ret +} + +func (m *CT_NoFillProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_NoFillProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_NoFillProperties: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_NoFillProperties and its children +func (m *CT_NoFillProperties) Validate() error { + return m.ValidateWithPath("CT_NoFillProperties") +} + +// ValidateWithPath validates the CT_NoFillProperties and its children, prefixing error messages with path +func (m *CT_NoFillProperties) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_NonVisualConnectorProperties.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_NonVisualConnectorProperties.go new file mode 100644 index 00000000..8bed4f94 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_NonVisualConnectorProperties.go @@ -0,0 +1,125 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_NonVisualConnectorProperties struct { + CxnSpLocks *CT_ConnectorLocking + StCxn *CT_Connection + EndCxn *CT_Connection + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_NonVisualConnectorProperties() *CT_NonVisualConnectorProperties { + ret := &CT_NonVisualConnectorProperties{} + return ret +} + +func (m *CT_NonVisualConnectorProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.CxnSpLocks != nil { + secxnSpLocks := xml.StartElement{Name: xml.Name{Local: "a:cxnSpLocks"}} + e.EncodeElement(m.CxnSpLocks, secxnSpLocks) + } + if m.StCxn != nil { + sestCxn := xml.StartElement{Name: xml.Name{Local: "a:stCxn"}} + e.EncodeElement(m.StCxn, sestCxn) + } + if m.EndCxn != nil { + seendCxn := xml.StartElement{Name: xml.Name{Local: "a:endCxn"}} + e.EncodeElement(m.EndCxn, seendCxn) + } + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_NonVisualConnectorProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_NonVisualConnectorProperties: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "cxnSpLocks"}: + m.CxnSpLocks = NewCT_ConnectorLocking() + if err := d.DecodeElement(m.CxnSpLocks, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "stCxn"}: + m.StCxn = NewCT_Connection() + if err := d.DecodeElement(m.StCxn, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "endCxn"}: + m.EndCxn = NewCT_Connection() + if err := d.DecodeElement(m.EndCxn, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_NonVisualConnectorProperties %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_NonVisualConnectorProperties + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_NonVisualConnectorProperties and its children +func (m *CT_NonVisualConnectorProperties) Validate() error { + return m.ValidateWithPath("CT_NonVisualConnectorProperties") +} + +// ValidateWithPath validates the CT_NonVisualConnectorProperties and its children, prefixing error messages with path +func (m *CT_NonVisualConnectorProperties) ValidateWithPath(path string) error { + if m.CxnSpLocks != nil { + if err := m.CxnSpLocks.ValidateWithPath(path + "/CxnSpLocks"); err != nil { + return err + } + } + if m.StCxn != nil { + if err := m.StCxn.ValidateWithPath(path + "/StCxn"); err != nil { + return err + } + } + if m.EndCxn != nil { + if err := m.EndCxn.ValidateWithPath(path + "/EndCxn"); err != nil { + return err + } + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_NonVisualContentPartProperties.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_NonVisualContentPartProperties.go new file mode 100644 index 00000000..de714c77 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_NonVisualContentPartProperties.go @@ -0,0 +1,113 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type CT_NonVisualContentPartProperties struct { + IsCommentAttr *bool + CpLocks *CT_ContentPartLocking + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_NonVisualContentPartProperties() *CT_NonVisualContentPartProperties { + ret := &CT_NonVisualContentPartProperties{} + return ret +} + +func (m *CT_NonVisualContentPartProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.IsCommentAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "isComment"}, + Value: fmt.Sprintf("%d", b2i(*m.IsCommentAttr))}) + } + start.Name.Local = "a:CT_NonVisualContentPartProperties" + e.EncodeToken(start) + if m.CpLocks != nil { + secpLocks := xml.StartElement{Name: xml.Name{Local: "a:cpLocks"}} + e.EncodeElement(m.CpLocks, secpLocks) + } + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_NonVisualContentPartProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "isComment" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.IsCommentAttr = &parsed + continue + } + } +lCT_NonVisualContentPartProperties: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "cpLocks"}: + m.CpLocks = NewCT_ContentPartLocking() + if err := d.DecodeElement(m.CpLocks, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_NonVisualContentPartProperties %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_NonVisualContentPartProperties + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_NonVisualContentPartProperties and its children +func (m *CT_NonVisualContentPartProperties) Validate() error { + return m.ValidateWithPath("CT_NonVisualContentPartProperties") +} + +// ValidateWithPath validates the CT_NonVisualContentPartProperties and its children, prefixing error messages with path +func (m *CT_NonVisualContentPartProperties) ValidateWithPath(path string) error { + if m.CpLocks != nil { + if err := m.CpLocks.ValidateWithPath(path + "/CpLocks"); err != nil { + return err + } + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_NonVisualDrawingProps.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_NonVisualDrawingProps.go new file mode 100644 index 00000000..71fd6c89 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_NonVisualDrawingProps.go @@ -0,0 +1,175 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type CT_NonVisualDrawingProps struct { + IdAttr uint32 + NameAttr string + DescrAttr *string + HiddenAttr *bool + TitleAttr *string + HlinkClick *CT_Hyperlink + HlinkHover *CT_Hyperlink + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_NonVisualDrawingProps() *CT_NonVisualDrawingProps { + ret := &CT_NonVisualDrawingProps{} + return ret +} + +func (m *CT_NonVisualDrawingProps) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "id"}, + Value: fmt.Sprintf("%v", m.IdAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "name"}, + Value: fmt.Sprintf("%v", m.NameAttr)}) + if m.DescrAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "descr"}, + Value: fmt.Sprintf("%v", *m.DescrAttr)}) + } + if m.HiddenAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "hidden"}, + Value: fmt.Sprintf("%d", b2i(*m.HiddenAttr))}) + } + if m.TitleAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "title"}, + Value: fmt.Sprintf("%v", *m.TitleAttr)}) + } + e.EncodeToken(start) + if m.HlinkClick != nil { + sehlinkClick := xml.StartElement{Name: xml.Name{Local: "a:hlinkClick"}} + e.EncodeElement(m.HlinkClick, sehlinkClick) + } + if m.HlinkHover != nil { + sehlinkHover := xml.StartElement{Name: xml.Name{Local: "a:hlinkHover"}} + e.EncodeElement(m.HlinkHover, sehlinkHover) + } + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_NonVisualDrawingProps) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "id" { + parsed, err := strconv.ParseUint(attr.Value, 10, 32) + if err != nil { + return err + } + m.IdAttr = uint32(parsed) + continue + } + if attr.Name.Local == "name" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.NameAttr = parsed + continue + } + if attr.Name.Local == "descr" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.DescrAttr = &parsed + continue + } + if attr.Name.Local == "hidden" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.HiddenAttr = &parsed + continue + } + if attr.Name.Local == "title" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.TitleAttr = &parsed + continue + } + } +lCT_NonVisualDrawingProps: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hlinkClick"}: + m.HlinkClick = NewCT_Hyperlink() + if err := d.DecodeElement(m.HlinkClick, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hlinkHover"}: + m.HlinkHover = NewCT_Hyperlink() + if err := d.DecodeElement(m.HlinkHover, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_NonVisualDrawingProps %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_NonVisualDrawingProps + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_NonVisualDrawingProps and its children +func (m *CT_NonVisualDrawingProps) Validate() error { + return m.ValidateWithPath("CT_NonVisualDrawingProps") +} + +// ValidateWithPath validates the CT_NonVisualDrawingProps and its children, prefixing error messages with path +func (m *CT_NonVisualDrawingProps) ValidateWithPath(path string) error { + if m.HlinkClick != nil { + if err := m.HlinkClick.ValidateWithPath(path + "/HlinkClick"); err != nil { + return err + } + } + if m.HlinkHover != nil { + if err := m.HlinkHover.ValidateWithPath(path + "/HlinkHover"); err != nil { + return err + } + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_NonVisualDrawingShapeProps.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_NonVisualDrawingShapeProps.go new file mode 100644 index 00000000..77261ea2 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_NonVisualDrawingShapeProps.go @@ -0,0 +1,112 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type CT_NonVisualDrawingShapeProps struct { + TxBoxAttr *bool + SpLocks *CT_ShapeLocking + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_NonVisualDrawingShapeProps() *CT_NonVisualDrawingShapeProps { + ret := &CT_NonVisualDrawingShapeProps{} + return ret +} + +func (m *CT_NonVisualDrawingShapeProps) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.TxBoxAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "txBox"}, + Value: fmt.Sprintf("%d", b2i(*m.TxBoxAttr))}) + } + e.EncodeToken(start) + if m.SpLocks != nil { + sespLocks := xml.StartElement{Name: xml.Name{Local: "a:spLocks"}} + e.EncodeElement(m.SpLocks, sespLocks) + } + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_NonVisualDrawingShapeProps) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "txBox" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.TxBoxAttr = &parsed + continue + } + } +lCT_NonVisualDrawingShapeProps: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "spLocks"}: + m.SpLocks = NewCT_ShapeLocking() + if err := d.DecodeElement(m.SpLocks, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_NonVisualDrawingShapeProps %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_NonVisualDrawingShapeProps + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_NonVisualDrawingShapeProps and its children +func (m *CT_NonVisualDrawingShapeProps) Validate() error { + return m.ValidateWithPath("CT_NonVisualDrawingShapeProps") +} + +// ValidateWithPath validates the CT_NonVisualDrawingShapeProps and its children, prefixing error messages with path +func (m *CT_NonVisualDrawingShapeProps) ValidateWithPath(path string) error { + if m.SpLocks != nil { + if err := m.SpLocks.ValidateWithPath(path + "/SpLocks"); err != nil { + return err + } + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_NonVisualGraphicFrameProperties.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_NonVisualGraphicFrameProperties.go new file mode 100644 index 00000000..6afbc126 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_NonVisualGraphicFrameProperties.go @@ -0,0 +1,95 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_NonVisualGraphicFrameProperties struct { + GraphicFrameLocks *CT_GraphicalObjectFrameLocking + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_NonVisualGraphicFrameProperties() *CT_NonVisualGraphicFrameProperties { + ret := &CT_NonVisualGraphicFrameProperties{} + return ret +} + +func (m *CT_NonVisualGraphicFrameProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.GraphicFrameLocks != nil { + segraphicFrameLocks := xml.StartElement{Name: xml.Name{Local: "a:graphicFrameLocks"}} + e.EncodeElement(m.GraphicFrameLocks, segraphicFrameLocks) + } + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_NonVisualGraphicFrameProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_NonVisualGraphicFrameProperties: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "graphicFrameLocks"}: + m.GraphicFrameLocks = NewCT_GraphicalObjectFrameLocking() + if err := d.DecodeElement(m.GraphicFrameLocks, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_NonVisualGraphicFrameProperties %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_NonVisualGraphicFrameProperties + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_NonVisualGraphicFrameProperties and its children +func (m *CT_NonVisualGraphicFrameProperties) Validate() error { + return m.ValidateWithPath("CT_NonVisualGraphicFrameProperties") +} + +// ValidateWithPath validates the CT_NonVisualGraphicFrameProperties and its children, prefixing error messages with path +func (m *CT_NonVisualGraphicFrameProperties) ValidateWithPath(path string) error { + if m.GraphicFrameLocks != nil { + if err := m.GraphicFrameLocks.ValidateWithPath(path + "/GraphicFrameLocks"); err != nil { + return err + } + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_NonVisualGroupDrawingShapeProps.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_NonVisualGroupDrawingShapeProps.go new file mode 100644 index 00000000..690e87c6 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_NonVisualGroupDrawingShapeProps.go @@ -0,0 +1,95 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_NonVisualGroupDrawingShapeProps struct { + GrpSpLocks *CT_GroupLocking + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_NonVisualGroupDrawingShapeProps() *CT_NonVisualGroupDrawingShapeProps { + ret := &CT_NonVisualGroupDrawingShapeProps{} + return ret +} + +func (m *CT_NonVisualGroupDrawingShapeProps) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.GrpSpLocks != nil { + segrpSpLocks := xml.StartElement{Name: xml.Name{Local: "a:grpSpLocks"}} + e.EncodeElement(m.GrpSpLocks, segrpSpLocks) + } + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_NonVisualGroupDrawingShapeProps) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_NonVisualGroupDrawingShapeProps: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "grpSpLocks"}: + m.GrpSpLocks = NewCT_GroupLocking() + if err := d.DecodeElement(m.GrpSpLocks, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_NonVisualGroupDrawingShapeProps %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_NonVisualGroupDrawingShapeProps + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_NonVisualGroupDrawingShapeProps and its children +func (m *CT_NonVisualGroupDrawingShapeProps) Validate() error { + return m.ValidateWithPath("CT_NonVisualGroupDrawingShapeProps") +} + +// ValidateWithPath validates the CT_NonVisualGroupDrawingShapeProps and its children, prefixing error messages with path +func (m *CT_NonVisualGroupDrawingShapeProps) ValidateWithPath(path string) error { + if m.GrpSpLocks != nil { + if err := m.GrpSpLocks.ValidateWithPath(path + "/GrpSpLocks"); err != nil { + return err + } + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_NonVisualPictureProperties.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_NonVisualPictureProperties.go new file mode 100644 index 00000000..7e4eb149 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_NonVisualPictureProperties.go @@ -0,0 +1,112 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type CT_NonVisualPictureProperties struct { + PreferRelativeResizeAttr *bool + PicLocks *CT_PictureLocking + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_NonVisualPictureProperties() *CT_NonVisualPictureProperties { + ret := &CT_NonVisualPictureProperties{} + return ret +} + +func (m *CT_NonVisualPictureProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.PreferRelativeResizeAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "preferRelativeResize"}, + Value: fmt.Sprintf("%d", b2i(*m.PreferRelativeResizeAttr))}) + } + e.EncodeToken(start) + if m.PicLocks != nil { + sepicLocks := xml.StartElement{Name: xml.Name{Local: "a:picLocks"}} + e.EncodeElement(m.PicLocks, sepicLocks) + } + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_NonVisualPictureProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "preferRelativeResize" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.PreferRelativeResizeAttr = &parsed + continue + } + } +lCT_NonVisualPictureProperties: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "picLocks"}: + m.PicLocks = NewCT_PictureLocking() + if err := d.DecodeElement(m.PicLocks, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_NonVisualPictureProperties %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_NonVisualPictureProperties + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_NonVisualPictureProperties and its children +func (m *CT_NonVisualPictureProperties) Validate() error { + return m.ValidateWithPath("CT_NonVisualPictureProperties") +} + +// ValidateWithPath validates the CT_NonVisualPictureProperties and its children, prefixing error messages with path +func (m *CT_NonVisualPictureProperties) ValidateWithPath(path string) error { + if m.PicLocks != nil { + if err := m.PicLocks.ValidateWithPath(path + "/PicLocks"); err != nil { + return err + } + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ObjectStyleDefaults.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ObjectStyleDefaults.go new file mode 100644 index 00000000..e10c58fc --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ObjectStyleDefaults.go @@ -0,0 +1,125 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_ObjectStyleDefaults struct { + SpDef *CT_DefaultShapeDefinition + LnDef *CT_DefaultShapeDefinition + TxDef *CT_DefaultShapeDefinition + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_ObjectStyleDefaults() *CT_ObjectStyleDefaults { + ret := &CT_ObjectStyleDefaults{} + return ret +} + +func (m *CT_ObjectStyleDefaults) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.SpDef != nil { + sespDef := xml.StartElement{Name: xml.Name{Local: "a:spDef"}} + e.EncodeElement(m.SpDef, sespDef) + } + if m.LnDef != nil { + selnDef := xml.StartElement{Name: xml.Name{Local: "a:lnDef"}} + e.EncodeElement(m.LnDef, selnDef) + } + if m.TxDef != nil { + setxDef := xml.StartElement{Name: xml.Name{Local: "a:txDef"}} + e.EncodeElement(m.TxDef, setxDef) + } + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_ObjectStyleDefaults) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_ObjectStyleDefaults: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "spDef"}: + m.SpDef = NewCT_DefaultShapeDefinition() + if err := d.DecodeElement(m.SpDef, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lnDef"}: + m.LnDef = NewCT_DefaultShapeDefinition() + if err := d.DecodeElement(m.LnDef, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "txDef"}: + m.TxDef = NewCT_DefaultShapeDefinition() + if err := d.DecodeElement(m.TxDef, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_ObjectStyleDefaults %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_ObjectStyleDefaults + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_ObjectStyleDefaults and its children +func (m *CT_ObjectStyleDefaults) Validate() error { + return m.ValidateWithPath("CT_ObjectStyleDefaults") +} + +// ValidateWithPath validates the CT_ObjectStyleDefaults and its children, prefixing error messages with path +func (m *CT_ObjectStyleDefaults) ValidateWithPath(path string) error { + if m.SpDef != nil { + if err := m.SpDef.ValidateWithPath(path + "/SpDef"); err != nil { + return err + } + } + if m.LnDef != nil { + if err := m.LnDef.ValidateWithPath(path + "/LnDef"); err != nil { + return err + } + } + if m.TxDef != nil { + if err := m.TxDef.ValidateWithPath(path + "/TxDef"); err != nil { + return err + } + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_OfficeArtExtension.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_OfficeArtExtension.go new file mode 100644 index 00000000..69d3f2fc --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_OfficeArtExtension.go @@ -0,0 +1,89 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_OfficeArtExtension struct { + UriAttr string + Any []gooxml.Any +} + +func NewCT_OfficeArtExtension() *CT_OfficeArtExtension { + ret := &CT_OfficeArtExtension{} + return ret +} + +func (m *CT_OfficeArtExtension) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "uri"}, + Value: fmt.Sprintf("%v", m.UriAttr)}) + e.EncodeToken(start) + if m.Any != nil { + for _, c := range m.Any { + c.MarshalXML(e, xml.StartElement{}) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_OfficeArtExtension) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "uri" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.UriAttr = parsed + continue + } + } +lCT_OfficeArtExtension: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + default: + if anyEl, err := gooxml.CreateElement(el); err != nil { + return err + } else { + if err := d.DecodeElement(anyEl, &el); err != nil { + return err + } + m.Any = append(m.Any, anyEl) + } + } + case xml.EndElement: + break lCT_OfficeArtExtension + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_OfficeArtExtension and its children +func (m *CT_OfficeArtExtension) Validate() error { + return m.ValidateWithPath("CT_OfficeArtExtension") +} + +// ValidateWithPath validates the CT_OfficeArtExtension and its children, prefixing error messages with path +func (m *CT_OfficeArtExtension) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_OfficeArtExtensionList.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_OfficeArtExtensionList.go new file mode 100644 index 00000000..bce95326 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_OfficeArtExtensionList.go @@ -0,0 +1,84 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_OfficeArtExtensionList struct { + Ext []*CT_OfficeArtExtension +} + +func NewCT_OfficeArtExtensionList() *CT_OfficeArtExtensionList { + ret := &CT_OfficeArtExtensionList{} + return ret +} + +func (m *CT_OfficeArtExtensionList) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Ext != nil { + seext := xml.StartElement{Name: xml.Name{Local: "a:ext"}} + for _, c := range m.Ext { + e.EncodeElement(c, seext) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_OfficeArtExtensionList) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_OfficeArtExtensionList: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "ext"}: + tmp := NewCT_OfficeArtExtension() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Ext = append(m.Ext, tmp) + default: + gooxml.Log("skipping unsupported element on CT_OfficeArtExtensionList %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_OfficeArtExtensionList + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_OfficeArtExtensionList and its children +func (m *CT_OfficeArtExtensionList) Validate() error { + return m.ValidateWithPath("CT_OfficeArtExtensionList") +} + +// ValidateWithPath validates the CT_OfficeArtExtensionList and its children, prefixing error messages with path +func (m *CT_OfficeArtExtensionList) ValidateWithPath(path string) error { + for i, v := range m.Ext { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Ext[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_OfficeStyleSheet.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_OfficeStyleSheet.go new file mode 100644 index 00000000..799ee7d1 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_OfficeStyleSheet.go @@ -0,0 +1,153 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_OfficeStyleSheet struct { + NameAttr *string + ThemeElements *CT_BaseStyles + ObjectDefaults *CT_ObjectStyleDefaults + ExtraClrSchemeLst *CT_ColorSchemeList + CustClrLst *CT_CustomColorList + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_OfficeStyleSheet() *CT_OfficeStyleSheet { + ret := &CT_OfficeStyleSheet{} + ret.ThemeElements = NewCT_BaseStyles() + return ret +} + +func (m *CT_OfficeStyleSheet) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.NameAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "name"}, + Value: fmt.Sprintf("%v", *m.NameAttr)}) + } + e.EncodeToken(start) + sethemeElements := xml.StartElement{Name: xml.Name{Local: "a:themeElements"}} + e.EncodeElement(m.ThemeElements, sethemeElements) + if m.ObjectDefaults != nil { + seobjectDefaults := xml.StartElement{Name: xml.Name{Local: "a:objectDefaults"}} + e.EncodeElement(m.ObjectDefaults, seobjectDefaults) + } + if m.ExtraClrSchemeLst != nil { + seextraClrSchemeLst := xml.StartElement{Name: xml.Name{Local: "a:extraClrSchemeLst"}} + e.EncodeElement(m.ExtraClrSchemeLst, seextraClrSchemeLst) + } + if m.CustClrLst != nil { + secustClrLst := xml.StartElement{Name: xml.Name{Local: "a:custClrLst"}} + e.EncodeElement(m.CustClrLst, secustClrLst) + } + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_OfficeStyleSheet) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ThemeElements = NewCT_BaseStyles() + for _, attr := range start.Attr { + if attr.Name.Local == "name" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.NameAttr = &parsed + continue + } + } +lCT_OfficeStyleSheet: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "themeElements"}: + if err := d.DecodeElement(m.ThemeElements, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "objectDefaults"}: + m.ObjectDefaults = NewCT_ObjectStyleDefaults() + if err := d.DecodeElement(m.ObjectDefaults, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extraClrSchemeLst"}: + m.ExtraClrSchemeLst = NewCT_ColorSchemeList() + if err := d.DecodeElement(m.ExtraClrSchemeLst, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "custClrLst"}: + m.CustClrLst = NewCT_CustomColorList() + if err := d.DecodeElement(m.CustClrLst, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_OfficeStyleSheet %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_OfficeStyleSheet + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_OfficeStyleSheet and its children +func (m *CT_OfficeStyleSheet) Validate() error { + return m.ValidateWithPath("CT_OfficeStyleSheet") +} + +// ValidateWithPath validates the CT_OfficeStyleSheet and its children, prefixing error messages with path +func (m *CT_OfficeStyleSheet) ValidateWithPath(path string) error { + if err := m.ThemeElements.ValidateWithPath(path + "/ThemeElements"); err != nil { + return err + } + if m.ObjectDefaults != nil { + if err := m.ObjectDefaults.ValidateWithPath(path + "/ObjectDefaults"); err != nil { + return err + } + } + if m.ExtraClrSchemeLst != nil { + if err := m.ExtraClrSchemeLst.ValidateWithPath(path + "/ExtraClrSchemeLst"); err != nil { + return err + } + } + if m.CustClrLst != nil { + if err := m.CustClrLst.ValidateWithPath(path + "/CustClrLst"); err != nil { + return err + } + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_OuterShadowEffect.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_OuterShadowEffect.go new file mode 100644 index 00000000..23473c47 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_OuterShadowEffect.go @@ -0,0 +1,331 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type CT_OuterShadowEffect struct { + BlurRadAttr *int64 + DistAttr *int64 + DirAttr *int32 + SxAttr *ST_Percentage + SyAttr *ST_Percentage + KxAttr *int32 + KyAttr *int32 + AlgnAttr ST_RectAlignment + RotWithShapeAttr *bool + ScrgbClr *CT_ScRgbColor + SrgbClr *CT_SRgbColor + HslClr *CT_HslColor + SysClr *CT_SystemColor + SchemeClr *CT_SchemeColor + PrstClr *CT_PresetColor +} + +func NewCT_OuterShadowEffect() *CT_OuterShadowEffect { + ret := &CT_OuterShadowEffect{} + return ret +} + +func (m *CT_OuterShadowEffect) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.BlurRadAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "blurRad"}, + Value: fmt.Sprintf("%v", *m.BlurRadAttr)}) + } + if m.DistAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "dist"}, + Value: fmt.Sprintf("%v", *m.DistAttr)}) + } + if m.DirAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "dir"}, + Value: fmt.Sprintf("%v", *m.DirAttr)}) + } + if m.SxAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "sx"}, + Value: fmt.Sprintf("%v", *m.SxAttr)}) + } + if m.SyAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "sy"}, + Value: fmt.Sprintf("%v", *m.SyAttr)}) + } + if m.KxAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "kx"}, + Value: fmt.Sprintf("%v", *m.KxAttr)}) + } + if m.KyAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "ky"}, + Value: fmt.Sprintf("%v", *m.KyAttr)}) + } + if m.AlgnAttr != ST_RectAlignmentUnset { + attr, err := m.AlgnAttr.MarshalXMLAttr(xml.Name{Local: "algn"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.RotWithShapeAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "rotWithShape"}, + Value: fmt.Sprintf("%d", b2i(*m.RotWithShapeAttr))}) + } + e.EncodeToken(start) + if m.ScrgbClr != nil { + sescrgbClr := xml.StartElement{Name: xml.Name{Local: "a:scrgbClr"}} + e.EncodeElement(m.ScrgbClr, sescrgbClr) + } + if m.SrgbClr != nil { + sesrgbClr := xml.StartElement{Name: xml.Name{Local: "a:srgbClr"}} + e.EncodeElement(m.SrgbClr, sesrgbClr) + } + if m.HslClr != nil { + sehslClr := xml.StartElement{Name: xml.Name{Local: "a:hslClr"}} + e.EncodeElement(m.HslClr, sehslClr) + } + if m.SysClr != nil { + sesysClr := xml.StartElement{Name: xml.Name{Local: "a:sysClr"}} + e.EncodeElement(m.SysClr, sesysClr) + } + if m.SchemeClr != nil { + seschemeClr := xml.StartElement{Name: xml.Name{Local: "a:schemeClr"}} + e.EncodeElement(m.SchemeClr, seschemeClr) + } + if m.PrstClr != nil { + seprstClr := xml.StartElement{Name: xml.Name{Local: "a:prstClr"}} + e.EncodeElement(m.PrstClr, seprstClr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_OuterShadowEffect) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "algn" { + m.AlgnAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "rotWithShape" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.RotWithShapeAttr = &parsed + continue + } + if attr.Name.Local == "dist" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.DistAttr = &parsed + continue + } + if attr.Name.Local == "sx" { + parsed, err := ParseUnionST_Percentage(attr.Value) + if err != nil { + return err + } + m.SxAttr = &parsed + continue + } + if attr.Name.Local == "sy" { + parsed, err := ParseUnionST_Percentage(attr.Value) + if err != nil { + return err + } + m.SyAttr = &parsed + continue + } + if attr.Name.Local == "kx" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + pt := int32(parsed) + m.KxAttr = &pt + continue + } + if attr.Name.Local == "ky" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + pt := int32(parsed) + m.KyAttr = &pt + continue + } + if attr.Name.Local == "blurRad" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.BlurRadAttr = &parsed + continue + } + if attr.Name.Local == "dir" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + pt := int32(parsed) + m.DirAttr = &pt + continue + } + } +lCT_OuterShadowEffect: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "scrgbClr"}: + m.ScrgbClr = NewCT_ScRgbColor() + if err := d.DecodeElement(m.ScrgbClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "srgbClr"}: + m.SrgbClr = NewCT_SRgbColor() + if err := d.DecodeElement(m.SrgbClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hslClr"}: + m.HslClr = NewCT_HslColor() + if err := d.DecodeElement(m.HslClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "sysClr"}: + m.SysClr = NewCT_SystemColor() + if err := d.DecodeElement(m.SysClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "schemeClr"}: + m.SchemeClr = NewCT_SchemeColor() + if err := d.DecodeElement(m.SchemeClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "prstClr"}: + m.PrstClr = NewCT_PresetColor() + if err := d.DecodeElement(m.PrstClr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_OuterShadowEffect %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_OuterShadowEffect + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_OuterShadowEffect and its children +func (m *CT_OuterShadowEffect) Validate() error { + return m.ValidateWithPath("CT_OuterShadowEffect") +} + +// ValidateWithPath validates the CT_OuterShadowEffect and its children, prefixing error messages with path +func (m *CT_OuterShadowEffect) ValidateWithPath(path string) error { + if m.BlurRadAttr != nil { + if *m.BlurRadAttr < 0 { + return fmt.Errorf("%s/m.BlurRadAttr must be >= 0 (have %v)", path, *m.BlurRadAttr) + } + if *m.BlurRadAttr > 27273042316900 { + return fmt.Errorf("%s/m.BlurRadAttr must be <= 27273042316900 (have %v)", path, *m.BlurRadAttr) + } + } + if m.DistAttr != nil { + if *m.DistAttr < 0 { + return fmt.Errorf("%s/m.DistAttr must be >= 0 (have %v)", path, *m.DistAttr) + } + if *m.DistAttr > 27273042316900 { + return fmt.Errorf("%s/m.DistAttr must be <= 27273042316900 (have %v)", path, *m.DistAttr) + } + } + if m.DirAttr != nil { + if *m.DirAttr < 0 { + return fmt.Errorf("%s/m.DirAttr must be >= 0 (have %v)", path, *m.DirAttr) + } + if *m.DirAttr >= 21600000 { + return fmt.Errorf("%s/m.DirAttr must be < 21600000 (have %v)", path, *m.DirAttr) + } + } + if m.SxAttr != nil { + if err := m.SxAttr.ValidateWithPath(path + "/SxAttr"); err != nil { + return err + } + } + if m.SyAttr != nil { + if err := m.SyAttr.ValidateWithPath(path + "/SyAttr"); err != nil { + return err + } + } + if m.KxAttr != nil { + if *m.KxAttr <= -5400000 { + return fmt.Errorf("%s/m.KxAttr must be > -5400000 (have %v)", path, *m.KxAttr) + } + if *m.KxAttr >= 5400000 { + return fmt.Errorf("%s/m.KxAttr must be < 5400000 (have %v)", path, *m.KxAttr) + } + } + if m.KyAttr != nil { + if *m.KyAttr <= -5400000 { + return fmt.Errorf("%s/m.KyAttr must be > -5400000 (have %v)", path, *m.KyAttr) + } + if *m.KyAttr >= 5400000 { + return fmt.Errorf("%s/m.KyAttr must be < 5400000 (have %v)", path, *m.KyAttr) + } + } + if err := m.AlgnAttr.ValidateWithPath(path + "/AlgnAttr"); err != nil { + return err + } + if m.ScrgbClr != nil { + if err := m.ScrgbClr.ValidateWithPath(path + "/ScrgbClr"); err != nil { + return err + } + } + if m.SrgbClr != nil { + if err := m.SrgbClr.ValidateWithPath(path + "/SrgbClr"); err != nil { + return err + } + } + if m.HslClr != nil { + if err := m.HslClr.ValidateWithPath(path + "/HslClr"); err != nil { + return err + } + } + if m.SysClr != nil { + if err := m.SysClr.ValidateWithPath(path + "/SysClr"); err != nil { + return err + } + } + if m.SchemeClr != nil { + if err := m.SchemeClr.ValidateWithPath(path + "/SchemeClr"); err != nil { + return err + } + } + if m.PrstClr != nil { + if err := m.PrstClr.ValidateWithPath(path + "/PrstClr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Path2D.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Path2D.go new file mode 100644 index 00000000..f0d638bf --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Path2D.go @@ -0,0 +1,260 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type CT_Path2D struct { + WAttr *int64 + HAttr *int64 + FillAttr ST_PathFillMode + StrokeAttr *bool + ExtrusionOkAttr *bool + Close []*CT_Path2DClose + MoveTo []*CT_Path2DMoveTo + LnTo []*CT_Path2DLineTo + ArcTo []*CT_Path2DArcTo + QuadBezTo []*CT_Path2DQuadBezierTo + CubicBezTo []*CT_Path2DCubicBezierTo +} + +func NewCT_Path2D() *CT_Path2D { + ret := &CT_Path2D{} + return ret +} + +func (m *CT_Path2D) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.WAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w"}, + Value: fmt.Sprintf("%v", *m.WAttr)}) + } + if m.HAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "h"}, + Value: fmt.Sprintf("%v", *m.HAttr)}) + } + if m.FillAttr != ST_PathFillModeUnset { + attr, err := m.FillAttr.MarshalXMLAttr(xml.Name{Local: "fill"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.StrokeAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "stroke"}, + Value: fmt.Sprintf("%d", b2i(*m.StrokeAttr))}) + } + if m.ExtrusionOkAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "extrusionOk"}, + Value: fmt.Sprintf("%d", b2i(*m.ExtrusionOkAttr))}) + } + e.EncodeToken(start) + if m.Close != nil { + seclose := xml.StartElement{Name: xml.Name{Local: "a:close"}} + for _, c := range m.Close { + e.EncodeElement(c, seclose) + } + } + if m.MoveTo != nil { + semoveTo := xml.StartElement{Name: xml.Name{Local: "a:moveTo"}} + for _, c := range m.MoveTo { + e.EncodeElement(c, semoveTo) + } + } + if m.LnTo != nil { + selnTo := xml.StartElement{Name: xml.Name{Local: "a:lnTo"}} + for _, c := range m.LnTo { + e.EncodeElement(c, selnTo) + } + } + if m.ArcTo != nil { + searcTo := xml.StartElement{Name: xml.Name{Local: "a:arcTo"}} + for _, c := range m.ArcTo { + e.EncodeElement(c, searcTo) + } + } + if m.QuadBezTo != nil { + sequadBezTo := xml.StartElement{Name: xml.Name{Local: "a:quadBezTo"}} + for _, c := range m.QuadBezTo { + e.EncodeElement(c, sequadBezTo) + } + } + if m.CubicBezTo != nil { + secubicBezTo := xml.StartElement{Name: xml.Name{Local: "a:cubicBezTo"}} + for _, c := range m.CubicBezTo { + e.EncodeElement(c, secubicBezTo) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Path2D) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "w" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.WAttr = &parsed + continue + } + if attr.Name.Local == "h" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.HAttr = &parsed + continue + } + if attr.Name.Local == "fill" { + m.FillAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "stroke" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.StrokeAttr = &parsed + continue + } + if attr.Name.Local == "extrusionOk" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.ExtrusionOkAttr = &parsed + continue + } + } +lCT_Path2D: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "close"}: + tmp := NewCT_Path2DClose() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Close = append(m.Close, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "moveTo"}: + tmp := NewCT_Path2DMoveTo() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.MoveTo = append(m.MoveTo, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lnTo"}: + tmp := NewCT_Path2DLineTo() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.LnTo = append(m.LnTo, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "arcTo"}: + tmp := NewCT_Path2DArcTo() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.ArcTo = append(m.ArcTo, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "quadBezTo"}: + tmp := NewCT_Path2DQuadBezierTo() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.QuadBezTo = append(m.QuadBezTo, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "cubicBezTo"}: + tmp := NewCT_Path2DCubicBezierTo() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.CubicBezTo = append(m.CubicBezTo, tmp) + default: + gooxml.Log("skipping unsupported element on CT_Path2D %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Path2D + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Path2D and its children +func (m *CT_Path2D) Validate() error { + return m.ValidateWithPath("CT_Path2D") +} + +// ValidateWithPath validates the CT_Path2D and its children, prefixing error messages with path +func (m *CT_Path2D) ValidateWithPath(path string) error { + if m.WAttr != nil { + if *m.WAttr < 0 { + return fmt.Errorf("%s/m.WAttr must be >= 0 (have %v)", path, *m.WAttr) + } + if *m.WAttr > 27273042316900 { + return fmt.Errorf("%s/m.WAttr must be <= 27273042316900 (have %v)", path, *m.WAttr) + } + } + if m.HAttr != nil { + if *m.HAttr < 0 { + return fmt.Errorf("%s/m.HAttr must be >= 0 (have %v)", path, *m.HAttr) + } + if *m.HAttr > 27273042316900 { + return fmt.Errorf("%s/m.HAttr must be <= 27273042316900 (have %v)", path, *m.HAttr) + } + } + if err := m.FillAttr.ValidateWithPath(path + "/FillAttr"); err != nil { + return err + } + for i, v := range m.Close { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Close[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.MoveTo { + if err := v.ValidateWithPath(fmt.Sprintf("%s/MoveTo[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.LnTo { + if err := v.ValidateWithPath(fmt.Sprintf("%s/LnTo[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.ArcTo { + if err := v.ValidateWithPath(fmt.Sprintf("%s/ArcTo[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.QuadBezTo { + if err := v.ValidateWithPath(fmt.Sprintf("%s/QuadBezTo[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.CubicBezTo { + if err := v.ValidateWithPath(fmt.Sprintf("%s/CubicBezTo[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Path2DArcTo.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Path2DArcTo.go new file mode 100644 index 00000000..db64e7d6 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Path2DArcTo.go @@ -0,0 +1,112 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_Path2DArcTo struct { + WRAttr ST_AdjCoordinate + HRAttr ST_AdjCoordinate + StAngAttr ST_AdjAngle + SwAngAttr ST_AdjAngle +} + +func NewCT_Path2DArcTo() *CT_Path2DArcTo { + ret := &CT_Path2DArcTo{} + return ret +} + +func (m *CT_Path2DArcTo) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "wR"}, + Value: fmt.Sprintf("%v", m.WRAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "hR"}, + Value: fmt.Sprintf("%v", m.HRAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "stAng"}, + Value: fmt.Sprintf("%v", m.StAngAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "swAng"}, + Value: fmt.Sprintf("%v", m.SwAngAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Path2DArcTo) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "wR" { + parsed, err := ParseUnionST_AdjCoordinate(attr.Value) + if err != nil { + return err + } + m.WRAttr = parsed + continue + } + if attr.Name.Local == "hR" { + parsed, err := ParseUnionST_AdjCoordinate(attr.Value) + if err != nil { + return err + } + m.HRAttr = parsed + continue + } + if attr.Name.Local == "stAng" { + parsed, err := ParseUnionST_AdjAngle(attr.Value) + if err != nil { + return err + } + m.StAngAttr = parsed + continue + } + if attr.Name.Local == "swAng" { + parsed, err := ParseUnionST_AdjAngle(attr.Value) + if err != nil { + return err + } + m.SwAngAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Path2DArcTo: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Path2DArcTo and its children +func (m *CT_Path2DArcTo) Validate() error { + return m.ValidateWithPath("CT_Path2DArcTo") +} + +// ValidateWithPath validates the CT_Path2DArcTo and its children, prefixing error messages with path +func (m *CT_Path2DArcTo) ValidateWithPath(path string) error { + if err := m.WRAttr.ValidateWithPath(path + "/WRAttr"); err != nil { + return err + } + if err := m.HRAttr.ValidateWithPath(path + "/HRAttr"); err != nil { + return err + } + if err := m.StAngAttr.ValidateWithPath(path + "/StAngAttr"); err != nil { + return err + } + if err := m.SwAngAttr.ValidateWithPath(path + "/SwAngAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Path2DClose.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Path2DClose.go new file mode 100644 index 00000000..652cef10 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Path2DClose.go @@ -0,0 +1,54 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_Path2DClose struct { +} + +func NewCT_Path2DClose() *CT_Path2DClose { + ret := &CT_Path2DClose{} + return ret +} + +func (m *CT_Path2DClose) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Path2DClose) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Path2DClose: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Path2DClose and its children +func (m *CT_Path2DClose) Validate() error { + return m.ValidateWithPath("CT_Path2DClose") +} + +// ValidateWithPath validates the CT_Path2DClose and its children, prefixing error messages with path +func (m *CT_Path2DClose) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Path2DCubicBezierTo.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Path2DCubicBezierTo.go new file mode 100644 index 00000000..2ac28f9b --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Path2DCubicBezierTo.go @@ -0,0 +1,82 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_Path2DCubicBezierTo struct { + Pt []*CT_AdjPoint2D +} + +func NewCT_Path2DCubicBezierTo() *CT_Path2DCubicBezierTo { + ret := &CT_Path2DCubicBezierTo{} + return ret +} + +func (m *CT_Path2DCubicBezierTo) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + sept := xml.StartElement{Name: xml.Name{Local: "a:pt"}} + for _, c := range m.Pt { + e.EncodeElement(c, sept) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Path2DCubicBezierTo) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_Path2DCubicBezierTo: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "pt"}: + tmp := NewCT_AdjPoint2D() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Pt = append(m.Pt, tmp) + default: + gooxml.Log("skipping unsupported element on CT_Path2DCubicBezierTo %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Path2DCubicBezierTo + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Path2DCubicBezierTo and its children +func (m *CT_Path2DCubicBezierTo) Validate() error { + return m.ValidateWithPath("CT_Path2DCubicBezierTo") +} + +// ValidateWithPath validates the CT_Path2DCubicBezierTo and its children, prefixing error messages with path +func (m *CT_Path2DCubicBezierTo) ValidateWithPath(path string) error { + for i, v := range m.Pt { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Pt[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Path2DLineTo.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Path2DLineTo.go new file mode 100644 index 00000000..ea3ea71a --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Path2DLineTo.go @@ -0,0 +1,77 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_Path2DLineTo struct { + Pt *CT_AdjPoint2D +} + +func NewCT_Path2DLineTo() *CT_Path2DLineTo { + ret := &CT_Path2DLineTo{} + ret.Pt = NewCT_AdjPoint2D() + return ret +} + +func (m *CT_Path2DLineTo) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + sept := xml.StartElement{Name: xml.Name{Local: "a:pt"}} + e.EncodeElement(m.Pt, sept) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Path2DLineTo) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.Pt = NewCT_AdjPoint2D() +lCT_Path2DLineTo: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "pt"}: + if err := d.DecodeElement(m.Pt, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_Path2DLineTo %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Path2DLineTo + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Path2DLineTo and its children +func (m *CT_Path2DLineTo) Validate() error { + return m.ValidateWithPath("CT_Path2DLineTo") +} + +// ValidateWithPath validates the CT_Path2DLineTo and its children, prefixing error messages with path +func (m *CT_Path2DLineTo) ValidateWithPath(path string) error { + if err := m.Pt.ValidateWithPath(path + "/Pt"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Path2DList.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Path2DList.go new file mode 100644 index 00000000..d449e2f8 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Path2DList.go @@ -0,0 +1,84 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_Path2DList struct { + Path []*CT_Path2D +} + +func NewCT_Path2DList() *CT_Path2DList { + ret := &CT_Path2DList{} + return ret +} + +func (m *CT_Path2DList) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Path != nil { + sepath := xml.StartElement{Name: xml.Name{Local: "a:path"}} + for _, c := range m.Path { + e.EncodeElement(c, sepath) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Path2DList) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_Path2DList: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "path"}: + tmp := NewCT_Path2D() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Path = append(m.Path, tmp) + default: + gooxml.Log("skipping unsupported element on CT_Path2DList %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Path2DList + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Path2DList and its children +func (m *CT_Path2DList) Validate() error { + return m.ValidateWithPath("CT_Path2DList") +} + +// ValidateWithPath validates the CT_Path2DList and its children, prefixing error messages with path +func (m *CT_Path2DList) ValidateWithPath(path string) error { + for i, v := range m.Path { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Path[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Path2DMoveTo.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Path2DMoveTo.go new file mode 100644 index 00000000..e1c70d0e --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Path2DMoveTo.go @@ -0,0 +1,77 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_Path2DMoveTo struct { + Pt *CT_AdjPoint2D +} + +func NewCT_Path2DMoveTo() *CT_Path2DMoveTo { + ret := &CT_Path2DMoveTo{} + ret.Pt = NewCT_AdjPoint2D() + return ret +} + +func (m *CT_Path2DMoveTo) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + sept := xml.StartElement{Name: xml.Name{Local: "a:pt"}} + e.EncodeElement(m.Pt, sept) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Path2DMoveTo) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.Pt = NewCT_AdjPoint2D() +lCT_Path2DMoveTo: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "pt"}: + if err := d.DecodeElement(m.Pt, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_Path2DMoveTo %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Path2DMoveTo + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Path2DMoveTo and its children +func (m *CT_Path2DMoveTo) Validate() error { + return m.ValidateWithPath("CT_Path2DMoveTo") +} + +// ValidateWithPath validates the CT_Path2DMoveTo and its children, prefixing error messages with path +func (m *CT_Path2DMoveTo) ValidateWithPath(path string) error { + if err := m.Pt.ValidateWithPath(path + "/Pt"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Path2DQuadBezierTo.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Path2DQuadBezierTo.go new file mode 100644 index 00000000..b0c5a6ee --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Path2DQuadBezierTo.go @@ -0,0 +1,82 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_Path2DQuadBezierTo struct { + Pt []*CT_AdjPoint2D +} + +func NewCT_Path2DQuadBezierTo() *CT_Path2DQuadBezierTo { + ret := &CT_Path2DQuadBezierTo{} + return ret +} + +func (m *CT_Path2DQuadBezierTo) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + sept := xml.StartElement{Name: xml.Name{Local: "a:pt"}} + for _, c := range m.Pt { + e.EncodeElement(c, sept) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Path2DQuadBezierTo) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_Path2DQuadBezierTo: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "pt"}: + tmp := NewCT_AdjPoint2D() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Pt = append(m.Pt, tmp) + default: + gooxml.Log("skipping unsupported element on CT_Path2DQuadBezierTo %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Path2DQuadBezierTo + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Path2DQuadBezierTo and its children +func (m *CT_Path2DQuadBezierTo) Validate() error { + return m.ValidateWithPath("CT_Path2DQuadBezierTo") +} + +// ValidateWithPath validates the CT_Path2DQuadBezierTo and its children, prefixing error messages with path +func (m *CT_Path2DQuadBezierTo) ValidateWithPath(path string) error { + for i, v := range m.Pt { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Pt[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_PathShadeProperties.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_PathShadeProperties.go new file mode 100644 index 00000000..8a755f24 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_PathShadeProperties.go @@ -0,0 +1,97 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_PathShadeProperties struct { + PathAttr ST_PathShadeType + FillToRect *CT_RelativeRect +} + +func NewCT_PathShadeProperties() *CT_PathShadeProperties { + ret := &CT_PathShadeProperties{} + return ret +} + +func (m *CT_PathShadeProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.PathAttr != ST_PathShadeTypeUnset { + attr, err := m.PathAttr.MarshalXMLAttr(xml.Name{Local: "path"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + if m.FillToRect != nil { + sefillToRect := xml.StartElement{Name: xml.Name{Local: "a:fillToRect"}} + e.EncodeElement(m.FillToRect, sefillToRect) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_PathShadeProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "path" { + m.PathAttr.UnmarshalXMLAttr(attr) + continue + } + } +lCT_PathShadeProperties: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "fillToRect"}: + m.FillToRect = NewCT_RelativeRect() + if err := d.DecodeElement(m.FillToRect, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_PathShadeProperties %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_PathShadeProperties + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_PathShadeProperties and its children +func (m *CT_PathShadeProperties) Validate() error { + return m.ValidateWithPath("CT_PathShadeProperties") +} + +// ValidateWithPath validates the CT_PathShadeProperties and its children, prefixing error messages with path +func (m *CT_PathShadeProperties) ValidateWithPath(path string) error { + if err := m.PathAttr.ValidateWithPath(path + "/PathAttr"); err != nil { + return err + } + if m.FillToRect != nil { + if err := m.FillToRect.ValidateWithPath(path + "/FillToRect"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_PatternFillProperties.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_PatternFillProperties.go new file mode 100644 index 00000000..80f39a42 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_PatternFillProperties.go @@ -0,0 +1,112 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_PatternFillProperties struct { + PrstAttr ST_PresetPatternVal + FgClr *CT_Color + BgClr *CT_Color +} + +func NewCT_PatternFillProperties() *CT_PatternFillProperties { + ret := &CT_PatternFillProperties{} + return ret +} + +func (m *CT_PatternFillProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.PrstAttr != ST_PresetPatternValUnset { + attr, err := m.PrstAttr.MarshalXMLAttr(xml.Name{Local: "prst"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + if m.FgClr != nil { + sefgClr := xml.StartElement{Name: xml.Name{Local: "a:fgClr"}} + e.EncodeElement(m.FgClr, sefgClr) + } + if m.BgClr != nil { + sebgClr := xml.StartElement{Name: xml.Name{Local: "a:bgClr"}} + e.EncodeElement(m.BgClr, sebgClr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_PatternFillProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "prst" { + m.PrstAttr.UnmarshalXMLAttr(attr) + continue + } + } +lCT_PatternFillProperties: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "fgClr"}: + m.FgClr = NewCT_Color() + if err := d.DecodeElement(m.FgClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "bgClr"}: + m.BgClr = NewCT_Color() + if err := d.DecodeElement(m.BgClr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_PatternFillProperties %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_PatternFillProperties + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_PatternFillProperties and its children +func (m *CT_PatternFillProperties) Validate() error { + return m.ValidateWithPath("CT_PatternFillProperties") +} + +// ValidateWithPath validates the CT_PatternFillProperties and its children, prefixing error messages with path +func (m *CT_PatternFillProperties) ValidateWithPath(path string) error { + if err := m.PrstAttr.ValidateWithPath(path + "/PrstAttr"); err != nil { + return err + } + if m.FgClr != nil { + if err := m.FgClr.ValidateWithPath(path + "/FgClr"); err != nil { + return err + } + } + if m.BgClr != nil { + if err := m.BgClr.ValidateWithPath(path + "/BgClr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Percentage.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Percentage.go new file mode 100644 index 00000000..a5656c67 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Percentage.go @@ -0,0 +1,70 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_Percentage struct { + ValAttr ST_Percentage +} + +func NewCT_Percentage() *CT_Percentage { + ret := &CT_Percentage{} + return ret +} + +func (m *CT_Percentage) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "val"}, + Value: fmt.Sprintf("%v", m.ValAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Percentage) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := ParseUnionST_Percentage(attr.Value) + if err != nil { + return err + } + m.ValAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Percentage: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Percentage and its children +func (m *CT_Percentage) Validate() error { + return m.ValidateWithPath("CT_Percentage") +} + +// ValidateWithPath validates the CT_Percentage and its children, prefixing error messages with path +func (m *CT_Percentage) ValidateWithPath(path string) error { + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_PictureLocking.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_PictureLocking.go new file mode 100644 index 00000000..c600e816 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_PictureLocking.go @@ -0,0 +1,227 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type CT_PictureLocking struct { + NoCropAttr *bool + ExtLst *CT_OfficeArtExtensionList + NoGrpAttr *bool + NoSelectAttr *bool + NoRotAttr *bool + NoChangeAspectAttr *bool + NoMoveAttr *bool + NoResizeAttr *bool + NoEditPointsAttr *bool + NoAdjustHandlesAttr *bool + NoChangeArrowheadsAttr *bool + NoChangeShapeTypeAttr *bool +} + +func NewCT_PictureLocking() *CT_PictureLocking { + ret := &CT_PictureLocking{} + return ret +} + +func (m *CT_PictureLocking) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.NoCropAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noCrop"}, + Value: fmt.Sprintf("%d", b2i(*m.NoCropAttr))}) + } + if m.NoGrpAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noGrp"}, + Value: fmt.Sprintf("%d", b2i(*m.NoGrpAttr))}) + } + if m.NoSelectAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noSelect"}, + Value: fmt.Sprintf("%d", b2i(*m.NoSelectAttr))}) + } + if m.NoRotAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noRot"}, + Value: fmt.Sprintf("%d", b2i(*m.NoRotAttr))}) + } + if m.NoChangeAspectAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noChangeAspect"}, + Value: fmt.Sprintf("%d", b2i(*m.NoChangeAspectAttr))}) + } + if m.NoMoveAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noMove"}, + Value: fmt.Sprintf("%d", b2i(*m.NoMoveAttr))}) + } + if m.NoResizeAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noResize"}, + Value: fmt.Sprintf("%d", b2i(*m.NoResizeAttr))}) + } + if m.NoEditPointsAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noEditPoints"}, + Value: fmt.Sprintf("%d", b2i(*m.NoEditPointsAttr))}) + } + if m.NoAdjustHandlesAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noAdjustHandles"}, + Value: fmt.Sprintf("%d", b2i(*m.NoAdjustHandlesAttr))}) + } + if m.NoChangeArrowheadsAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noChangeArrowheads"}, + Value: fmt.Sprintf("%d", b2i(*m.NoChangeArrowheadsAttr))}) + } + if m.NoChangeShapeTypeAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noChangeShapeType"}, + Value: fmt.Sprintf("%d", b2i(*m.NoChangeShapeTypeAttr))}) + } + e.EncodeToken(start) + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_PictureLocking) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "noCrop" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoCropAttr = &parsed + continue + } + if attr.Name.Local == "noGrp" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoGrpAttr = &parsed + continue + } + if attr.Name.Local == "noSelect" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoSelectAttr = &parsed + continue + } + if attr.Name.Local == "noRot" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoRotAttr = &parsed + continue + } + if attr.Name.Local == "noChangeAspect" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoChangeAspectAttr = &parsed + continue + } + if attr.Name.Local == "noMove" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoMoveAttr = &parsed + continue + } + if attr.Name.Local == "noResize" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoResizeAttr = &parsed + continue + } + if attr.Name.Local == "noEditPoints" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoEditPointsAttr = &parsed + continue + } + if attr.Name.Local == "noAdjustHandles" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoAdjustHandlesAttr = &parsed + continue + } + if attr.Name.Local == "noChangeArrowheads" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoChangeArrowheadsAttr = &parsed + continue + } + if attr.Name.Local == "noChangeShapeType" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoChangeShapeTypeAttr = &parsed + continue + } + } +lCT_PictureLocking: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_PictureLocking %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_PictureLocking + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_PictureLocking and its children +func (m *CT_PictureLocking) Validate() error { + return m.ValidateWithPath("CT_PictureLocking") +} + +// ValidateWithPath validates the CT_PictureLocking and its children, prefixing error messages with path +func (m *CT_PictureLocking) ValidateWithPath(path string) error { + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Point2D.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Point2D.go new file mode 100644 index 00000000..9b0a220a --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Point2D.go @@ -0,0 +1,84 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_Point2D struct { + XAttr ST_Coordinate + YAttr ST_Coordinate +} + +func NewCT_Point2D() *CT_Point2D { + ret := &CT_Point2D{} + return ret +} + +func (m *CT_Point2D) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "x"}, + Value: fmt.Sprintf("%v", m.XAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "y"}, + Value: fmt.Sprintf("%v", m.YAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Point2D) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "x" { + parsed, err := ParseUnionST_Coordinate(attr.Value) + if err != nil { + return err + } + m.XAttr = parsed + continue + } + if attr.Name.Local == "y" { + parsed, err := ParseUnionST_Coordinate(attr.Value) + if err != nil { + return err + } + m.YAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Point2D: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Point2D and its children +func (m *CT_Point2D) Validate() error { + return m.ValidateWithPath("CT_Point2D") +} + +// ValidateWithPath validates the CT_Point2D and its children, prefixing error messages with path +func (m *CT_Point2D) ValidateWithPath(path string) error { + if err := m.XAttr.ValidateWithPath(path + "/XAttr"); err != nil { + return err + } + if err := m.YAttr.ValidateWithPath(path + "/YAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Point3D.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Point3D.go new file mode 100644 index 00000000..a593e852 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Point3D.go @@ -0,0 +1,98 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_Point3D struct { + XAttr ST_Coordinate + YAttr ST_Coordinate + ZAttr ST_Coordinate +} + +func NewCT_Point3D() *CT_Point3D { + ret := &CT_Point3D{} + return ret +} + +func (m *CT_Point3D) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "x"}, + Value: fmt.Sprintf("%v", m.XAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "y"}, + Value: fmt.Sprintf("%v", m.YAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "z"}, + Value: fmt.Sprintf("%v", m.ZAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Point3D) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "x" { + parsed, err := ParseUnionST_Coordinate(attr.Value) + if err != nil { + return err + } + m.XAttr = parsed + continue + } + if attr.Name.Local == "y" { + parsed, err := ParseUnionST_Coordinate(attr.Value) + if err != nil { + return err + } + m.YAttr = parsed + continue + } + if attr.Name.Local == "z" { + parsed, err := ParseUnionST_Coordinate(attr.Value) + if err != nil { + return err + } + m.ZAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Point3D: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Point3D and its children +func (m *CT_Point3D) Validate() error { + return m.ValidateWithPath("CT_Point3D") +} + +// ValidateWithPath validates the CT_Point3D and its children, prefixing error messages with path +func (m *CT_Point3D) ValidateWithPath(path string) error { + if err := m.XAttr.ValidateWithPath(path + "/XAttr"); err != nil { + return err + } + if err := m.YAttr.ValidateWithPath(path + "/YAttr"); err != nil { + return err + } + if err := m.ZAttr.ValidateWithPath(path + "/ZAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_PolarAdjustHandle.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_PolarAdjustHandle.go new file mode 100644 index 00000000..58c16cc8 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_PolarAdjustHandle.go @@ -0,0 +1,178 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_PolarAdjustHandle struct { + GdRefRAttr *string + MinRAttr *ST_AdjCoordinate + MaxRAttr *ST_AdjCoordinate + GdRefAngAttr *string + MinAngAttr *ST_AdjAngle + MaxAngAttr *ST_AdjAngle + Pos *CT_AdjPoint2D +} + +func NewCT_PolarAdjustHandle() *CT_PolarAdjustHandle { + ret := &CT_PolarAdjustHandle{} + ret.Pos = NewCT_AdjPoint2D() + return ret +} + +func (m *CT_PolarAdjustHandle) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.GdRefRAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "gdRefR"}, + Value: fmt.Sprintf("%v", *m.GdRefRAttr)}) + } + if m.MinRAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "minR"}, + Value: fmt.Sprintf("%v", *m.MinRAttr)}) + } + if m.MaxRAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "maxR"}, + Value: fmt.Sprintf("%v", *m.MaxRAttr)}) + } + if m.GdRefAngAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "gdRefAng"}, + Value: fmt.Sprintf("%v", *m.GdRefAngAttr)}) + } + if m.MinAngAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "minAng"}, + Value: fmt.Sprintf("%v", *m.MinAngAttr)}) + } + if m.MaxAngAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "maxAng"}, + Value: fmt.Sprintf("%v", *m.MaxAngAttr)}) + } + e.EncodeToken(start) + sepos := xml.StartElement{Name: xml.Name{Local: "a:pos"}} + e.EncodeElement(m.Pos, sepos) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_PolarAdjustHandle) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.Pos = NewCT_AdjPoint2D() + for _, attr := range start.Attr { + if attr.Name.Local == "gdRefR" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.GdRefRAttr = &parsed + continue + } + if attr.Name.Local == "minR" { + parsed, err := ParseUnionST_AdjCoordinate(attr.Value) + if err != nil { + return err + } + m.MinRAttr = &parsed + continue + } + if attr.Name.Local == "maxR" { + parsed, err := ParseUnionST_AdjCoordinate(attr.Value) + if err != nil { + return err + } + m.MaxRAttr = &parsed + continue + } + if attr.Name.Local == "gdRefAng" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.GdRefAngAttr = &parsed + continue + } + if attr.Name.Local == "minAng" { + parsed, err := ParseUnionST_AdjAngle(attr.Value) + if err != nil { + return err + } + m.MinAngAttr = &parsed + continue + } + if attr.Name.Local == "maxAng" { + parsed, err := ParseUnionST_AdjAngle(attr.Value) + if err != nil { + return err + } + m.MaxAngAttr = &parsed + continue + } + } +lCT_PolarAdjustHandle: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "pos"}: + if err := d.DecodeElement(m.Pos, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_PolarAdjustHandle %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_PolarAdjustHandle + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_PolarAdjustHandle and its children +func (m *CT_PolarAdjustHandle) Validate() error { + return m.ValidateWithPath("CT_PolarAdjustHandle") +} + +// ValidateWithPath validates the CT_PolarAdjustHandle and its children, prefixing error messages with path +func (m *CT_PolarAdjustHandle) ValidateWithPath(path string) error { + if m.MinRAttr != nil { + if err := m.MinRAttr.ValidateWithPath(path + "/MinRAttr"); err != nil { + return err + } + } + if m.MaxRAttr != nil { + if err := m.MaxRAttr.ValidateWithPath(path + "/MaxRAttr"); err != nil { + return err + } + } + if m.MinAngAttr != nil { + if err := m.MinAngAttr.ValidateWithPath(path + "/MinAngAttr"); err != nil { + return err + } + } + if m.MaxAngAttr != nil { + if err := m.MaxAngAttr.ValidateWithPath(path + "/MaxAngAttr"); err != nil { + return err + } + } + if err := m.Pos.ValidateWithPath(path + "/Pos"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_PositiveFixedAngle.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_PositiveFixedAngle.go new file mode 100644 index 00000000..4a51dadd --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_PositiveFixedAngle.go @@ -0,0 +1,76 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" +) + +type CT_PositiveFixedAngle struct { + ValAttr int32 +} + +func NewCT_PositiveFixedAngle() *CT_PositiveFixedAngle { + ret := &CT_PositiveFixedAngle{} + ret.ValAttr = 0 + return ret +} + +func (m *CT_PositiveFixedAngle) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "val"}, + Value: fmt.Sprintf("%v", m.ValAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_PositiveFixedAngle) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = 0 + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + m.ValAttr = int32(parsed) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_PositiveFixedAngle: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_PositiveFixedAngle and its children +func (m *CT_PositiveFixedAngle) Validate() error { + return m.ValidateWithPath("CT_PositiveFixedAngle") +} + +// ValidateWithPath validates the CT_PositiveFixedAngle and its children, prefixing error messages with path +func (m *CT_PositiveFixedAngle) ValidateWithPath(path string) error { + if m.ValAttr < 0 { + return fmt.Errorf("%s/m.ValAttr must be >= 0 (have %v)", path, m.ValAttr) + } + if m.ValAttr >= 21600000 { + return fmt.Errorf("%s/m.ValAttr must be < 21600000 (have %v)", path, m.ValAttr) + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_PositiveFixedPercentage.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_PositiveFixedPercentage.go new file mode 100644 index 00000000..0e27bc19 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_PositiveFixedPercentage.go @@ -0,0 +1,70 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_PositiveFixedPercentage struct { + ValAttr ST_PositiveFixedPercentage +} + +func NewCT_PositiveFixedPercentage() *CT_PositiveFixedPercentage { + ret := &CT_PositiveFixedPercentage{} + return ret +} + +func (m *CT_PositiveFixedPercentage) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "val"}, + Value: fmt.Sprintf("%v", m.ValAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_PositiveFixedPercentage) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := ParseUnionST_PositiveFixedPercentage(attr.Value) + if err != nil { + return err + } + m.ValAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_PositiveFixedPercentage: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_PositiveFixedPercentage and its children +func (m *CT_PositiveFixedPercentage) Validate() error { + return m.ValidateWithPath("CT_PositiveFixedPercentage") +} + +// ValidateWithPath validates the CT_PositiveFixedPercentage and its children, prefixing error messages with path +func (m *CT_PositiveFixedPercentage) ValidateWithPath(path string) error { + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_PositivePercentage.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_PositivePercentage.go new file mode 100644 index 00000000..bdd86617 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_PositivePercentage.go @@ -0,0 +1,70 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_PositivePercentage struct { + ValAttr ST_PositivePercentage +} + +func NewCT_PositivePercentage() *CT_PositivePercentage { + ret := &CT_PositivePercentage{} + return ret +} + +func (m *CT_PositivePercentage) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "val"}, + Value: fmt.Sprintf("%v", m.ValAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_PositivePercentage) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := ParseUnionST_PositivePercentage(attr.Value) + if err != nil { + return err + } + m.ValAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_PositivePercentage: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_PositivePercentage and its children +func (m *CT_PositivePercentage) Validate() error { + return m.ValidateWithPath("CT_PositivePercentage") +} + +// ValidateWithPath validates the CT_PositivePercentage and its children, prefixing error messages with path +func (m *CT_PositivePercentage) ValidateWithPath(path string) error { + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_PositiveSize2D.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_PositiveSize2D.go new file mode 100644 index 00000000..a8a0bdd3 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_PositiveSize2D.go @@ -0,0 +1,95 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" +) + +type CT_PositiveSize2D struct { + CxAttr int64 + CyAttr int64 +} + +func NewCT_PositiveSize2D() *CT_PositiveSize2D { + ret := &CT_PositiveSize2D{} + ret.CxAttr = 0 + ret.CyAttr = 0 + return ret +} + +func (m *CT_PositiveSize2D) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "cx"}, + Value: fmt.Sprintf("%v", m.CxAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "cy"}, + Value: fmt.Sprintf("%v", m.CyAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_PositiveSize2D) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CxAttr = 0 + m.CyAttr = 0 + for _, attr := range start.Attr { + if attr.Name.Local == "cx" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.CxAttr = parsed + continue + } + if attr.Name.Local == "cy" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.CyAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_PositiveSize2D: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_PositiveSize2D and its children +func (m *CT_PositiveSize2D) Validate() error { + return m.ValidateWithPath("CT_PositiveSize2D") +} + +// ValidateWithPath validates the CT_PositiveSize2D and its children, prefixing error messages with path +func (m *CT_PositiveSize2D) ValidateWithPath(path string) error { + if m.CxAttr < 0 { + return fmt.Errorf("%s/m.CxAttr must be >= 0 (have %v)", path, m.CxAttr) + } + if m.CxAttr > 27273042316900 { + return fmt.Errorf("%s/m.CxAttr must be <= 27273042316900 (have %v)", path, m.CxAttr) + } + if m.CyAttr < 0 { + return fmt.Errorf("%s/m.CyAttr must be >= 0 (have %v)", path, m.CyAttr) + } + if m.CyAttr > 27273042316900 { + return fmt.Errorf("%s/m.CyAttr must be <= 27273042316900 (have %v)", path, m.CyAttr) + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_PresetColor.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_PresetColor.go new file mode 100644 index 00000000..ca22c584 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_PresetColor.go @@ -0,0 +1,293 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_PresetColor struct { + ValAttr ST_PresetColorVal + EG_ColorTransform []*EG_ColorTransform +} + +func NewCT_PresetColor() *CT_PresetColor { + ret := &CT_PresetColor{} + ret.ValAttr = ST_PresetColorVal(1) + return ret +} + +func (m *CT_PresetColor) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + if m.EG_ColorTransform != nil { + for _, c := range m.EG_ColorTransform { + c.MarshalXML(e, xml.StartElement{}) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_PresetColor) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_PresetColorVal(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } +lCT_PresetColor: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "tint"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Tint = NewCT_PositiveFixedPercentage() + if err := d.DecodeElement(tmpcolortransform.Tint, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "shade"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Shade = NewCT_PositiveFixedPercentage() + if err := d.DecodeElement(tmpcolortransform.Shade, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "comp"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Comp = NewCT_ComplementTransform() + if err := d.DecodeElement(tmpcolortransform.Comp, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "inv"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Inv = NewCT_InverseTransform() + if err := d.DecodeElement(tmpcolortransform.Inv, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "gray"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Gray = NewCT_GrayscaleTransform() + if err := d.DecodeElement(tmpcolortransform.Gray, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alpha"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Alpha = NewCT_PositiveFixedPercentage() + if err := d.DecodeElement(tmpcolortransform.Alpha, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.AlphaOff = NewCT_FixedPercentage() + if err := d.DecodeElement(tmpcolortransform.AlphaOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.AlphaMod = NewCT_PositivePercentage() + if err := d.DecodeElement(tmpcolortransform.AlphaMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hue"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Hue = NewCT_PositiveFixedAngle() + if err := d.DecodeElement(tmpcolortransform.Hue, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hueOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.HueOff = NewCT_Angle() + if err := d.DecodeElement(tmpcolortransform.HueOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hueMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.HueMod = NewCT_PositivePercentage() + if err := d.DecodeElement(tmpcolortransform.HueMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "sat"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Sat = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.Sat, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "satOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.SatOff = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.SatOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "satMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.SatMod = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.SatMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lum"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Lum = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.Lum, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lumOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.LumOff = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.LumOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lumMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.LumMod = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.LumMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "red"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Red = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.Red, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "redOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.RedOff = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.RedOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "redMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.RedMod = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.RedMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "green"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Green = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.Green, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "greenOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.GreenOff = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.GreenOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "greenMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.GreenMod = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.GreenMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blue"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Blue = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.Blue, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blueOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.BlueOff = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.BlueOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blueMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.BlueMod = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.BlueMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "gamma"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Gamma = NewCT_GammaTransform() + if err := d.DecodeElement(tmpcolortransform.Gamma, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "invGamma"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.InvGamma = NewCT_InverseGammaTransform() + if err := d.DecodeElement(tmpcolortransform.InvGamma, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + default: + gooxml.Log("skipping unsupported element on CT_PresetColor %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_PresetColor + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_PresetColor and its children +func (m *CT_PresetColor) Validate() error { + return m.ValidateWithPath("CT_PresetColor") +} + +// ValidateWithPath validates the CT_PresetColor and its children, prefixing error messages with path +func (m *CT_PresetColor) ValidateWithPath(path string) error { + if m.ValAttr == ST_PresetColorValUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + for i, v := range m.EG_ColorTransform { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_ColorTransform[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_PresetGeometry2D.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_PresetGeometry2D.go new file mode 100644 index 00000000..84ba84c4 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_PresetGeometry2D.go @@ -0,0 +1,101 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_PresetGeometry2D struct { + PrstAttr ST_ShapeType + AvLst *CT_GeomGuideList +} + +func NewCT_PresetGeometry2D() *CT_PresetGeometry2D { + ret := &CT_PresetGeometry2D{} + ret.PrstAttr = ST_ShapeType(1) + return ret +} + +func (m *CT_PresetGeometry2D) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.PrstAttr.MarshalXMLAttr(xml.Name{Local: "prst"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + if m.AvLst != nil { + seavLst := xml.StartElement{Name: xml.Name{Local: "a:avLst"}} + e.EncodeElement(m.AvLst, seavLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_PresetGeometry2D) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.PrstAttr = ST_ShapeType(1) + for _, attr := range start.Attr { + if attr.Name.Local == "prst" { + m.PrstAttr.UnmarshalXMLAttr(attr) + continue + } + } +lCT_PresetGeometry2D: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "avLst"}: + m.AvLst = NewCT_GeomGuideList() + if err := d.DecodeElement(m.AvLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_PresetGeometry2D %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_PresetGeometry2D + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_PresetGeometry2D and its children +func (m *CT_PresetGeometry2D) Validate() error { + return m.ValidateWithPath("CT_PresetGeometry2D") +} + +// ValidateWithPath validates the CT_PresetGeometry2D and its children, prefixing error messages with path +func (m *CT_PresetGeometry2D) ValidateWithPath(path string) error { + if m.PrstAttr == ST_ShapeTypeUnset { + return fmt.Errorf("%s/PrstAttr is a mandatory field", path) + } + if err := m.PrstAttr.ValidateWithPath(path + "/PrstAttr"); err != nil { + return err + } + if m.AvLst != nil { + if err := m.AvLst.ValidateWithPath(path + "/AvLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_PresetLineDashProperties.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_PresetLineDashProperties.go new file mode 100644 index 00000000..9ae9cf9f --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_PresetLineDashProperties.go @@ -0,0 +1,71 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_PresetLineDashProperties struct { + ValAttr ST_PresetLineDashVal +} + +func NewCT_PresetLineDashProperties() *CT_PresetLineDashProperties { + ret := &CT_PresetLineDashProperties{} + return ret +} + +func (m *CT_PresetLineDashProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.ValAttr != ST_PresetLineDashValUnset { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_PresetLineDashProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_PresetLineDashProperties: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_PresetLineDashProperties and its children +func (m *CT_PresetLineDashProperties) Validate() error { + return m.ValidateWithPath("CT_PresetLineDashProperties") +} + +// ValidateWithPath validates the CT_PresetLineDashProperties and its children, prefixing error messages with path +func (m *CT_PresetLineDashProperties) ValidateWithPath(path string) error { + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_PresetShadowEffect.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_PresetShadowEffect.go new file mode 100644 index 00000000..d860580b --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_PresetShadowEffect.go @@ -0,0 +1,220 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type CT_PresetShadowEffect struct { + PrstAttr ST_PresetShadowVal + DistAttr *int64 + DirAttr *int32 + ScrgbClr *CT_ScRgbColor + SrgbClr *CT_SRgbColor + HslClr *CT_HslColor + SysClr *CT_SystemColor + SchemeClr *CT_SchemeColor + PrstClr *CT_PresetColor +} + +func NewCT_PresetShadowEffect() *CT_PresetShadowEffect { + ret := &CT_PresetShadowEffect{} + ret.PrstAttr = ST_PresetShadowVal(1) + return ret +} + +func (m *CT_PresetShadowEffect) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.PrstAttr.MarshalXMLAttr(xml.Name{Local: "prst"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + if m.DistAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "dist"}, + Value: fmt.Sprintf("%v", *m.DistAttr)}) + } + if m.DirAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "dir"}, + Value: fmt.Sprintf("%v", *m.DirAttr)}) + } + e.EncodeToken(start) + if m.ScrgbClr != nil { + sescrgbClr := xml.StartElement{Name: xml.Name{Local: "a:scrgbClr"}} + e.EncodeElement(m.ScrgbClr, sescrgbClr) + } + if m.SrgbClr != nil { + sesrgbClr := xml.StartElement{Name: xml.Name{Local: "a:srgbClr"}} + e.EncodeElement(m.SrgbClr, sesrgbClr) + } + if m.HslClr != nil { + sehslClr := xml.StartElement{Name: xml.Name{Local: "a:hslClr"}} + e.EncodeElement(m.HslClr, sehslClr) + } + if m.SysClr != nil { + sesysClr := xml.StartElement{Name: xml.Name{Local: "a:sysClr"}} + e.EncodeElement(m.SysClr, sesysClr) + } + if m.SchemeClr != nil { + seschemeClr := xml.StartElement{Name: xml.Name{Local: "a:schemeClr"}} + e.EncodeElement(m.SchemeClr, seschemeClr) + } + if m.PrstClr != nil { + seprstClr := xml.StartElement{Name: xml.Name{Local: "a:prstClr"}} + e.EncodeElement(m.PrstClr, seprstClr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_PresetShadowEffect) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.PrstAttr = ST_PresetShadowVal(1) + for _, attr := range start.Attr { + if attr.Name.Local == "prst" { + m.PrstAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "dist" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.DistAttr = &parsed + continue + } + if attr.Name.Local == "dir" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + pt := int32(parsed) + m.DirAttr = &pt + continue + } + } +lCT_PresetShadowEffect: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "scrgbClr"}: + m.ScrgbClr = NewCT_ScRgbColor() + if err := d.DecodeElement(m.ScrgbClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "srgbClr"}: + m.SrgbClr = NewCT_SRgbColor() + if err := d.DecodeElement(m.SrgbClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hslClr"}: + m.HslClr = NewCT_HslColor() + if err := d.DecodeElement(m.HslClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "sysClr"}: + m.SysClr = NewCT_SystemColor() + if err := d.DecodeElement(m.SysClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "schemeClr"}: + m.SchemeClr = NewCT_SchemeColor() + if err := d.DecodeElement(m.SchemeClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "prstClr"}: + m.PrstClr = NewCT_PresetColor() + if err := d.DecodeElement(m.PrstClr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_PresetShadowEffect %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_PresetShadowEffect + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_PresetShadowEffect and its children +func (m *CT_PresetShadowEffect) Validate() error { + return m.ValidateWithPath("CT_PresetShadowEffect") +} + +// ValidateWithPath validates the CT_PresetShadowEffect and its children, prefixing error messages with path +func (m *CT_PresetShadowEffect) ValidateWithPath(path string) error { + if m.PrstAttr == ST_PresetShadowValUnset { + return fmt.Errorf("%s/PrstAttr is a mandatory field", path) + } + if err := m.PrstAttr.ValidateWithPath(path + "/PrstAttr"); err != nil { + return err + } + if m.DistAttr != nil { + if *m.DistAttr < 0 { + return fmt.Errorf("%s/m.DistAttr must be >= 0 (have %v)", path, *m.DistAttr) + } + if *m.DistAttr > 27273042316900 { + return fmt.Errorf("%s/m.DistAttr must be <= 27273042316900 (have %v)", path, *m.DistAttr) + } + } + if m.DirAttr != nil { + if *m.DirAttr < 0 { + return fmt.Errorf("%s/m.DirAttr must be >= 0 (have %v)", path, *m.DirAttr) + } + if *m.DirAttr >= 21600000 { + return fmt.Errorf("%s/m.DirAttr must be < 21600000 (have %v)", path, *m.DirAttr) + } + } + if m.ScrgbClr != nil { + if err := m.ScrgbClr.ValidateWithPath(path + "/ScrgbClr"); err != nil { + return err + } + } + if m.SrgbClr != nil { + if err := m.SrgbClr.ValidateWithPath(path + "/SrgbClr"); err != nil { + return err + } + } + if m.HslClr != nil { + if err := m.HslClr.ValidateWithPath(path + "/HslClr"); err != nil { + return err + } + } + if m.SysClr != nil { + if err := m.SysClr.ValidateWithPath(path + "/SysClr"); err != nil { + return err + } + } + if m.SchemeClr != nil { + if err := m.SchemeClr.ValidateWithPath(path + "/SchemeClr"); err != nil { + return err + } + } + if m.PrstClr != nil { + if err := m.PrstClr.ValidateWithPath(path + "/PrstClr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_PresetTextShape.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_PresetTextShape.go new file mode 100644 index 00000000..bb6ec73e --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_PresetTextShape.go @@ -0,0 +1,101 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_PresetTextShape struct { + PrstAttr ST_TextShapeType + AvLst *CT_GeomGuideList +} + +func NewCT_PresetTextShape() *CT_PresetTextShape { + ret := &CT_PresetTextShape{} + ret.PrstAttr = ST_TextShapeType(1) + return ret +} + +func (m *CT_PresetTextShape) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.PrstAttr.MarshalXMLAttr(xml.Name{Local: "prst"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + if m.AvLst != nil { + seavLst := xml.StartElement{Name: xml.Name{Local: "a:avLst"}} + e.EncodeElement(m.AvLst, seavLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_PresetTextShape) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.PrstAttr = ST_TextShapeType(1) + for _, attr := range start.Attr { + if attr.Name.Local == "prst" { + m.PrstAttr.UnmarshalXMLAttr(attr) + continue + } + } +lCT_PresetTextShape: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "avLst"}: + m.AvLst = NewCT_GeomGuideList() + if err := d.DecodeElement(m.AvLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_PresetTextShape %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_PresetTextShape + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_PresetTextShape and its children +func (m *CT_PresetTextShape) Validate() error { + return m.ValidateWithPath("CT_PresetTextShape") +} + +// ValidateWithPath validates the CT_PresetTextShape and its children, prefixing error messages with path +func (m *CT_PresetTextShape) ValidateWithPath(path string) error { + if m.PrstAttr == ST_TextShapeTypeUnset { + return fmt.Errorf("%s/PrstAttr is a mandatory field", path) + } + if err := m.PrstAttr.ValidateWithPath(path + "/PrstAttr"); err != nil { + return err + } + if m.AvLst != nil { + if err := m.AvLst.ValidateWithPath(path + "/AvLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_QuickTimeFile.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_QuickTimeFile.go new file mode 100644 index 00000000..80143477 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_QuickTimeFile.go @@ -0,0 +1,94 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_QuickTimeFile struct { + LinkAttr string + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_QuickTimeFile() *CT_QuickTimeFile { + ret := &CT_QuickTimeFile{} + return ret +} + +func (m *CT_QuickTimeFile) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "r:link"}, + Value: fmt.Sprintf("%v", m.LinkAttr)}) + e.EncodeToken(start) + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_QuickTimeFile) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Space == "http://schemas.openxmlformats.org/officeDocument/2006/relationships" && attr.Name.Local == "link" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.LinkAttr = parsed + continue + } + } +lCT_QuickTimeFile: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_QuickTimeFile %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_QuickTimeFile + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_QuickTimeFile and its children +func (m *CT_QuickTimeFile) Validate() error { + return m.ValidateWithPath("CT_QuickTimeFile") +} + +// ValidateWithPath validates the CT_QuickTimeFile and its children, prefixing error messages with path +func (m *CT_QuickTimeFile) ValidateWithPath(path string) error { + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Ratio.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Ratio.go new file mode 100644 index 00000000..d389ba8f --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Ratio.go @@ -0,0 +1,79 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" +) + +type CT_Ratio struct { + NAttr int64 + DAttr int64 +} + +func NewCT_Ratio() *CT_Ratio { + ret := &CT_Ratio{} + return ret +} + +func (m *CT_Ratio) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "n"}, + Value: fmt.Sprintf("%v", m.NAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "d"}, + Value: fmt.Sprintf("%v", m.DAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Ratio) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "n" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.NAttr = parsed + continue + } + if attr.Name.Local == "d" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.DAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Ratio: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Ratio and its children +func (m *CT_Ratio) Validate() error { + return m.ValidateWithPath("CT_Ratio") +} + +// ValidateWithPath validates the CT_Ratio and its children, prefixing error messages with path +func (m *CT_Ratio) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ReflectionEffect.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ReflectionEffect.go new file mode 100644 index 00000000..02c60977 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ReflectionEffect.go @@ -0,0 +1,323 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" +) + +type CT_ReflectionEffect struct { + BlurRadAttr *int64 + StAAttr *ST_PositiveFixedPercentage + StPosAttr *ST_PositiveFixedPercentage + EndAAttr *ST_PositiveFixedPercentage + EndPosAttr *ST_PositiveFixedPercentage + DistAttr *int64 + DirAttr *int32 + FadeDirAttr *int32 + SxAttr *ST_Percentage + SyAttr *ST_Percentage + KxAttr *int32 + KyAttr *int32 + AlgnAttr ST_RectAlignment + RotWithShapeAttr *bool +} + +func NewCT_ReflectionEffect() *CT_ReflectionEffect { + ret := &CT_ReflectionEffect{} + return ret +} + +func (m *CT_ReflectionEffect) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.BlurRadAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "blurRad"}, + Value: fmt.Sprintf("%v", *m.BlurRadAttr)}) + } + if m.StAAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "stA"}, + Value: fmt.Sprintf("%v", *m.StAAttr)}) + } + if m.StPosAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "stPos"}, + Value: fmt.Sprintf("%v", *m.StPosAttr)}) + } + if m.EndAAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "endA"}, + Value: fmt.Sprintf("%v", *m.EndAAttr)}) + } + if m.EndPosAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "endPos"}, + Value: fmt.Sprintf("%v", *m.EndPosAttr)}) + } + if m.DistAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "dist"}, + Value: fmt.Sprintf("%v", *m.DistAttr)}) + } + if m.DirAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "dir"}, + Value: fmt.Sprintf("%v", *m.DirAttr)}) + } + if m.FadeDirAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "fadeDir"}, + Value: fmt.Sprintf("%v", *m.FadeDirAttr)}) + } + if m.SxAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "sx"}, + Value: fmt.Sprintf("%v", *m.SxAttr)}) + } + if m.SyAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "sy"}, + Value: fmt.Sprintf("%v", *m.SyAttr)}) + } + if m.KxAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "kx"}, + Value: fmt.Sprintf("%v", *m.KxAttr)}) + } + if m.KyAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "ky"}, + Value: fmt.Sprintf("%v", *m.KyAttr)}) + } + if m.AlgnAttr != ST_RectAlignmentUnset { + attr, err := m.AlgnAttr.MarshalXMLAttr(xml.Name{Local: "algn"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.RotWithShapeAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "rotWithShape"}, + Value: fmt.Sprintf("%d", b2i(*m.RotWithShapeAttr))}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_ReflectionEffect) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "fadeDir" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + pt := int32(parsed) + m.FadeDirAttr = &pt + continue + } + if attr.Name.Local == "blurRad" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.BlurRadAttr = &parsed + continue + } + if attr.Name.Local == "stPos" { + parsed, err := ParseUnionST_PositiveFixedPercentage(attr.Value) + if err != nil { + return err + } + m.StPosAttr = &parsed + continue + } + if attr.Name.Local == "endA" { + parsed, err := ParseUnionST_PositiveFixedPercentage(attr.Value) + if err != nil { + return err + } + m.EndAAttr = &parsed + continue + } + if attr.Name.Local == "endPos" { + parsed, err := ParseUnionST_PositiveFixedPercentage(attr.Value) + if err != nil { + return err + } + m.EndPosAttr = &parsed + continue + } + if attr.Name.Local == "dist" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.DistAttr = &parsed + continue + } + if attr.Name.Local == "dir" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + pt := int32(parsed) + m.DirAttr = &pt + continue + } + if attr.Name.Local == "stA" { + parsed, err := ParseUnionST_PositiveFixedPercentage(attr.Value) + if err != nil { + return err + } + m.StAAttr = &parsed + continue + } + if attr.Name.Local == "sx" { + parsed, err := ParseUnionST_Percentage(attr.Value) + if err != nil { + return err + } + m.SxAttr = &parsed + continue + } + if attr.Name.Local == "sy" { + parsed, err := ParseUnionST_Percentage(attr.Value) + if err != nil { + return err + } + m.SyAttr = &parsed + continue + } + if attr.Name.Local == "kx" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + pt := int32(parsed) + m.KxAttr = &pt + continue + } + if attr.Name.Local == "ky" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + pt := int32(parsed) + m.KyAttr = &pt + continue + } + if attr.Name.Local == "algn" { + m.AlgnAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "rotWithShape" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.RotWithShapeAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_ReflectionEffect: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_ReflectionEffect and its children +func (m *CT_ReflectionEffect) Validate() error { + return m.ValidateWithPath("CT_ReflectionEffect") +} + +// ValidateWithPath validates the CT_ReflectionEffect and its children, prefixing error messages with path +func (m *CT_ReflectionEffect) ValidateWithPath(path string) error { + if m.BlurRadAttr != nil { + if *m.BlurRadAttr < 0 { + return fmt.Errorf("%s/m.BlurRadAttr must be >= 0 (have %v)", path, *m.BlurRadAttr) + } + if *m.BlurRadAttr > 27273042316900 { + return fmt.Errorf("%s/m.BlurRadAttr must be <= 27273042316900 (have %v)", path, *m.BlurRadAttr) + } + } + if m.StAAttr != nil { + if err := m.StAAttr.ValidateWithPath(path + "/StAAttr"); err != nil { + return err + } + } + if m.StPosAttr != nil { + if err := m.StPosAttr.ValidateWithPath(path + "/StPosAttr"); err != nil { + return err + } + } + if m.EndAAttr != nil { + if err := m.EndAAttr.ValidateWithPath(path + "/EndAAttr"); err != nil { + return err + } + } + if m.EndPosAttr != nil { + if err := m.EndPosAttr.ValidateWithPath(path + "/EndPosAttr"); err != nil { + return err + } + } + if m.DistAttr != nil { + if *m.DistAttr < 0 { + return fmt.Errorf("%s/m.DistAttr must be >= 0 (have %v)", path, *m.DistAttr) + } + if *m.DistAttr > 27273042316900 { + return fmt.Errorf("%s/m.DistAttr must be <= 27273042316900 (have %v)", path, *m.DistAttr) + } + } + if m.DirAttr != nil { + if *m.DirAttr < 0 { + return fmt.Errorf("%s/m.DirAttr must be >= 0 (have %v)", path, *m.DirAttr) + } + if *m.DirAttr >= 21600000 { + return fmt.Errorf("%s/m.DirAttr must be < 21600000 (have %v)", path, *m.DirAttr) + } + } + if m.FadeDirAttr != nil { + if *m.FadeDirAttr < 0 { + return fmt.Errorf("%s/m.FadeDirAttr must be >= 0 (have %v)", path, *m.FadeDirAttr) + } + if *m.FadeDirAttr >= 21600000 { + return fmt.Errorf("%s/m.FadeDirAttr must be < 21600000 (have %v)", path, *m.FadeDirAttr) + } + } + if m.SxAttr != nil { + if err := m.SxAttr.ValidateWithPath(path + "/SxAttr"); err != nil { + return err + } + } + if m.SyAttr != nil { + if err := m.SyAttr.ValidateWithPath(path + "/SyAttr"); err != nil { + return err + } + } + if m.KxAttr != nil { + if *m.KxAttr <= -5400000 { + return fmt.Errorf("%s/m.KxAttr must be > -5400000 (have %v)", path, *m.KxAttr) + } + if *m.KxAttr >= 5400000 { + return fmt.Errorf("%s/m.KxAttr must be < 5400000 (have %v)", path, *m.KxAttr) + } + } + if m.KyAttr != nil { + if *m.KyAttr <= -5400000 { + return fmt.Errorf("%s/m.KyAttr must be > -5400000 (have %v)", path, *m.KyAttr) + } + if *m.KyAttr >= 5400000 { + return fmt.Errorf("%s/m.KyAttr must be < 5400000 (have %v)", path, *m.KyAttr) + } + } + if err := m.AlgnAttr.ValidateWithPath(path + "/AlgnAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_RegularTextRun.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_RegularTextRun.go new file mode 100644 index 00000000..15291c96 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_RegularTextRun.go @@ -0,0 +1,88 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_RegularTextRun struct { + RPr *CT_TextCharacterProperties + T string +} + +func NewCT_RegularTextRun() *CT_RegularTextRun { + ret := &CT_RegularTextRun{} + return ret +} + +func (m *CT_RegularTextRun) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.RPr != nil { + serPr := xml.StartElement{Name: xml.Name{Local: "a:rPr"}} + e.EncodeElement(m.RPr, serPr) + } + set := xml.StartElement{Name: xml.Name{Local: "a:t"}} + gooxml.AddPreserveSpaceAttr(&set, m.T) + e.EncodeElement(m.T, set) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_RegularTextRun) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_RegularTextRun: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "rPr"}: + m.RPr = NewCT_TextCharacterProperties() + if err := d.DecodeElement(m.RPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "t"}: + if err := d.DecodeElement(&m.T, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_RegularTextRun %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_RegularTextRun + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_RegularTextRun and its children +func (m *CT_RegularTextRun) Validate() error { + return m.ValidateWithPath("CT_RegularTextRun") +} + +// ValidateWithPath validates the CT_RegularTextRun and its children, prefixing error messages with path +func (m *CT_RegularTextRun) ValidateWithPath(path string) error { + if m.RPr != nil { + if err := m.RPr.ValidateWithPath(path + "/RPr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_RelativeOffsetEffect.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_RelativeOffsetEffect.go new file mode 100644 index 00000000..8e96d55d --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_RelativeOffsetEffect.go @@ -0,0 +1,92 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_RelativeOffsetEffect struct { + TxAttr *ST_Percentage + TyAttr *ST_Percentage +} + +func NewCT_RelativeOffsetEffect() *CT_RelativeOffsetEffect { + ret := &CT_RelativeOffsetEffect{} + return ret +} + +func (m *CT_RelativeOffsetEffect) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.TxAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "tx"}, + Value: fmt.Sprintf("%v", *m.TxAttr)}) + } + if m.TyAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "ty"}, + Value: fmt.Sprintf("%v", *m.TyAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_RelativeOffsetEffect) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "tx" { + parsed, err := ParseUnionST_Percentage(attr.Value) + if err != nil { + return err + } + m.TxAttr = &parsed + continue + } + if attr.Name.Local == "ty" { + parsed, err := ParseUnionST_Percentage(attr.Value) + if err != nil { + return err + } + m.TyAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_RelativeOffsetEffect: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_RelativeOffsetEffect and its children +func (m *CT_RelativeOffsetEffect) Validate() error { + return m.ValidateWithPath("CT_RelativeOffsetEffect") +} + +// ValidateWithPath validates the CT_RelativeOffsetEffect and its children, prefixing error messages with path +func (m *CT_RelativeOffsetEffect) ValidateWithPath(path string) error { + if m.TxAttr != nil { + if err := m.TxAttr.ValidateWithPath(path + "/TxAttr"); err != nil { + return err + } + } + if m.TyAttr != nil { + if err := m.TyAttr.ValidateWithPath(path + "/TyAttr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_RelativeRect.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_RelativeRect.go new file mode 100644 index 00000000..9a332075 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_RelativeRect.go @@ -0,0 +1,128 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_RelativeRect struct { + LAttr *ST_Percentage + TAttr *ST_Percentage + RAttr *ST_Percentage + BAttr *ST_Percentage +} + +func NewCT_RelativeRect() *CT_RelativeRect { + ret := &CT_RelativeRect{} + return ret +} + +func (m *CT_RelativeRect) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.LAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "l"}, + Value: fmt.Sprintf("%v", *m.LAttr)}) + } + if m.TAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "t"}, + Value: fmt.Sprintf("%v", *m.TAttr)}) + } + if m.RAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "r"}, + Value: fmt.Sprintf("%v", *m.RAttr)}) + } + if m.BAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "b"}, + Value: fmt.Sprintf("%v", *m.BAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_RelativeRect) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "l" { + parsed, err := ParseUnionST_Percentage(attr.Value) + if err != nil { + return err + } + m.LAttr = &parsed + continue + } + if attr.Name.Local == "t" { + parsed, err := ParseUnionST_Percentage(attr.Value) + if err != nil { + return err + } + m.TAttr = &parsed + continue + } + if attr.Name.Local == "r" { + parsed, err := ParseUnionST_Percentage(attr.Value) + if err != nil { + return err + } + m.RAttr = &parsed + continue + } + if attr.Name.Local == "b" { + parsed, err := ParseUnionST_Percentage(attr.Value) + if err != nil { + return err + } + m.BAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_RelativeRect: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_RelativeRect and its children +func (m *CT_RelativeRect) Validate() error { + return m.ValidateWithPath("CT_RelativeRect") +} + +// ValidateWithPath validates the CT_RelativeRect and its children, prefixing error messages with path +func (m *CT_RelativeRect) ValidateWithPath(path string) error { + if m.LAttr != nil { + if err := m.LAttr.ValidateWithPath(path + "/LAttr"); err != nil { + return err + } + } + if m.TAttr != nil { + if err := m.TAttr.ValidateWithPath(path + "/TAttr"); err != nil { + return err + } + } + if m.RAttr != nil { + if err := m.RAttr.ValidateWithPath(path + "/RAttr"); err != nil { + return err + } + } + if m.BAttr != nil { + if err := m.BAttr.ValidateWithPath(path + "/BAttr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_SRgbColor.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_SRgbColor.go new file mode 100644 index 00000000..91ec1a5d --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_SRgbColor.go @@ -0,0 +1,286 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_SRgbColor struct { + ValAttr string + EG_ColorTransform []*EG_ColorTransform +} + +func NewCT_SRgbColor() *CT_SRgbColor { + ret := &CT_SRgbColor{} + return ret +} + +func (m *CT_SRgbColor) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "val"}, + Value: fmt.Sprintf("%v", m.ValAttr)}) + e.EncodeToken(start) + if m.EG_ColorTransform != nil { + for _, c := range m.EG_ColorTransform { + c.MarshalXML(e, xml.StartElement{}) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SRgbColor) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ValAttr = parsed + continue + } + } +lCT_SRgbColor: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "tint"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Tint = NewCT_PositiveFixedPercentage() + if err := d.DecodeElement(tmpcolortransform.Tint, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "shade"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Shade = NewCT_PositiveFixedPercentage() + if err := d.DecodeElement(tmpcolortransform.Shade, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "comp"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Comp = NewCT_ComplementTransform() + if err := d.DecodeElement(tmpcolortransform.Comp, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "inv"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Inv = NewCT_InverseTransform() + if err := d.DecodeElement(tmpcolortransform.Inv, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "gray"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Gray = NewCT_GrayscaleTransform() + if err := d.DecodeElement(tmpcolortransform.Gray, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alpha"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Alpha = NewCT_PositiveFixedPercentage() + if err := d.DecodeElement(tmpcolortransform.Alpha, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.AlphaOff = NewCT_FixedPercentage() + if err := d.DecodeElement(tmpcolortransform.AlphaOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.AlphaMod = NewCT_PositivePercentage() + if err := d.DecodeElement(tmpcolortransform.AlphaMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hue"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Hue = NewCT_PositiveFixedAngle() + if err := d.DecodeElement(tmpcolortransform.Hue, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hueOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.HueOff = NewCT_Angle() + if err := d.DecodeElement(tmpcolortransform.HueOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hueMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.HueMod = NewCT_PositivePercentage() + if err := d.DecodeElement(tmpcolortransform.HueMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "sat"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Sat = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.Sat, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "satOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.SatOff = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.SatOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "satMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.SatMod = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.SatMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lum"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Lum = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.Lum, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lumOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.LumOff = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.LumOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lumMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.LumMod = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.LumMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "red"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Red = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.Red, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "redOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.RedOff = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.RedOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "redMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.RedMod = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.RedMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "green"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Green = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.Green, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "greenOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.GreenOff = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.GreenOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "greenMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.GreenMod = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.GreenMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blue"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Blue = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.Blue, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blueOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.BlueOff = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.BlueOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blueMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.BlueMod = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.BlueMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "gamma"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Gamma = NewCT_GammaTransform() + if err := d.DecodeElement(tmpcolortransform.Gamma, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "invGamma"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.InvGamma = NewCT_InverseGammaTransform() + if err := d.DecodeElement(tmpcolortransform.InvGamma, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + default: + gooxml.Log("skipping unsupported element on CT_SRgbColor %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_SRgbColor + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_SRgbColor and its children +func (m *CT_SRgbColor) Validate() error { + return m.ValidateWithPath("CT_SRgbColor") +} + +// ValidateWithPath validates the CT_SRgbColor and its children, prefixing error messages with path +func (m *CT_SRgbColor) ValidateWithPath(path string) error { + for i, v := range m.EG_ColorTransform { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_ColorTransform[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ScRgbColor.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ScRgbColor.go new file mode 100644 index 00000000..a306e7b8 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ScRgbColor.go @@ -0,0 +1,317 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_ScRgbColor struct { + RAttr ST_Percentage + GAttr ST_Percentage + BAttr ST_Percentage + EG_ColorTransform []*EG_ColorTransform +} + +func NewCT_ScRgbColor() *CT_ScRgbColor { + ret := &CT_ScRgbColor{} + return ret +} + +func (m *CT_ScRgbColor) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "r"}, + Value: fmt.Sprintf("%v", m.RAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "g"}, + Value: fmt.Sprintf("%v", m.GAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "b"}, + Value: fmt.Sprintf("%v", m.BAttr)}) + e.EncodeToken(start) + if m.EG_ColorTransform != nil { + for _, c := range m.EG_ColorTransform { + c.MarshalXML(e, xml.StartElement{}) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_ScRgbColor) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "r" { + parsed, err := ParseUnionST_Percentage(attr.Value) + if err != nil { + return err + } + m.RAttr = parsed + continue + } + if attr.Name.Local == "g" { + parsed, err := ParseUnionST_Percentage(attr.Value) + if err != nil { + return err + } + m.GAttr = parsed + continue + } + if attr.Name.Local == "b" { + parsed, err := ParseUnionST_Percentage(attr.Value) + if err != nil { + return err + } + m.BAttr = parsed + continue + } + } +lCT_ScRgbColor: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "tint"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Tint = NewCT_PositiveFixedPercentage() + if err := d.DecodeElement(tmpcolortransform.Tint, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "shade"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Shade = NewCT_PositiveFixedPercentage() + if err := d.DecodeElement(tmpcolortransform.Shade, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "comp"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Comp = NewCT_ComplementTransform() + if err := d.DecodeElement(tmpcolortransform.Comp, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "inv"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Inv = NewCT_InverseTransform() + if err := d.DecodeElement(tmpcolortransform.Inv, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "gray"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Gray = NewCT_GrayscaleTransform() + if err := d.DecodeElement(tmpcolortransform.Gray, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alpha"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Alpha = NewCT_PositiveFixedPercentage() + if err := d.DecodeElement(tmpcolortransform.Alpha, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.AlphaOff = NewCT_FixedPercentage() + if err := d.DecodeElement(tmpcolortransform.AlphaOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.AlphaMod = NewCT_PositivePercentage() + if err := d.DecodeElement(tmpcolortransform.AlphaMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hue"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Hue = NewCT_PositiveFixedAngle() + if err := d.DecodeElement(tmpcolortransform.Hue, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hueOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.HueOff = NewCT_Angle() + if err := d.DecodeElement(tmpcolortransform.HueOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hueMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.HueMod = NewCT_PositivePercentage() + if err := d.DecodeElement(tmpcolortransform.HueMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "sat"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Sat = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.Sat, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "satOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.SatOff = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.SatOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "satMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.SatMod = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.SatMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lum"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Lum = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.Lum, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lumOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.LumOff = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.LumOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lumMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.LumMod = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.LumMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "red"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Red = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.Red, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "redOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.RedOff = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.RedOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "redMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.RedMod = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.RedMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "green"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Green = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.Green, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "greenOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.GreenOff = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.GreenOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "greenMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.GreenMod = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.GreenMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blue"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Blue = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.Blue, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blueOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.BlueOff = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.BlueOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blueMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.BlueMod = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.BlueMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "gamma"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Gamma = NewCT_GammaTransform() + if err := d.DecodeElement(tmpcolortransform.Gamma, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "invGamma"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.InvGamma = NewCT_InverseGammaTransform() + if err := d.DecodeElement(tmpcolortransform.InvGamma, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + default: + gooxml.Log("skipping unsupported element on CT_ScRgbColor %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_ScRgbColor + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_ScRgbColor and its children +func (m *CT_ScRgbColor) Validate() error { + return m.ValidateWithPath("CT_ScRgbColor") +} + +// ValidateWithPath validates the CT_ScRgbColor and its children, prefixing error messages with path +func (m *CT_ScRgbColor) ValidateWithPath(path string) error { + if err := m.RAttr.ValidateWithPath(path + "/RAttr"); err != nil { + return err + } + if err := m.GAttr.ValidateWithPath(path + "/GAttr"); err != nil { + return err + } + if err := m.BAttr.ValidateWithPath(path + "/BAttr"); err != nil { + return err + } + for i, v := range m.EG_ColorTransform { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_ColorTransform[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Scale2D.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Scale2D.go new file mode 100644 index 00000000..a8da4d29 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Scale2D.go @@ -0,0 +1,90 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_Scale2D struct { + Sx *CT_Ratio + Sy *CT_Ratio +} + +func NewCT_Scale2D() *CT_Scale2D { + ret := &CT_Scale2D{} + ret.Sx = NewCT_Ratio() + ret.Sy = NewCT_Ratio() + return ret +} + +func (m *CT_Scale2D) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Name.Local = "a:CT_Scale2D" + e.EncodeToken(start) + sesx := xml.StartElement{Name: xml.Name{Local: "a:sx"}} + e.EncodeElement(m.Sx, sesx) + sesy := xml.StartElement{Name: xml.Name{Local: "a:sy"}} + e.EncodeElement(m.Sy, sesy) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Scale2D) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.Sx = NewCT_Ratio() + m.Sy = NewCT_Ratio() +lCT_Scale2D: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "sx"}: + if err := d.DecodeElement(m.Sx, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "sy"}: + if err := d.DecodeElement(m.Sy, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_Scale2D %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Scale2D + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Scale2D and its children +func (m *CT_Scale2D) Validate() error { + return m.ValidateWithPath("CT_Scale2D") +} + +// ValidateWithPath validates the CT_Scale2D and its children, prefixing error messages with path +func (m *CT_Scale2D) ValidateWithPath(path string) error { + if err := m.Sx.ValidateWithPath(path + "/Sx"); err != nil { + return err + } + if err := m.Sy.ValidateWithPath(path + "/Sy"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Scene3D.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Scene3D.go new file mode 100644 index 00000000..56fca2c9 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Scene3D.go @@ -0,0 +1,119 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_Scene3D struct { + Camera *CT_Camera + LightRig *CT_LightRig + Backdrop *CT_Backdrop + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_Scene3D() *CT_Scene3D { + ret := &CT_Scene3D{} + ret.Camera = NewCT_Camera() + ret.LightRig = NewCT_LightRig() + return ret +} + +func (m *CT_Scene3D) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + secamera := xml.StartElement{Name: xml.Name{Local: "a:camera"}} + e.EncodeElement(m.Camera, secamera) + selightRig := xml.StartElement{Name: xml.Name{Local: "a:lightRig"}} + e.EncodeElement(m.LightRig, selightRig) + if m.Backdrop != nil { + sebackdrop := xml.StartElement{Name: xml.Name{Local: "a:backdrop"}} + e.EncodeElement(m.Backdrop, sebackdrop) + } + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Scene3D) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.Camera = NewCT_Camera() + m.LightRig = NewCT_LightRig() +lCT_Scene3D: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "camera"}: + if err := d.DecodeElement(m.Camera, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lightRig"}: + if err := d.DecodeElement(m.LightRig, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "backdrop"}: + m.Backdrop = NewCT_Backdrop() + if err := d.DecodeElement(m.Backdrop, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_Scene3D %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Scene3D + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Scene3D and its children +func (m *CT_Scene3D) Validate() error { + return m.ValidateWithPath("CT_Scene3D") +} + +// ValidateWithPath validates the CT_Scene3D and its children, prefixing error messages with path +func (m *CT_Scene3D) ValidateWithPath(path string) error { + if err := m.Camera.ValidateWithPath(path + "/Camera"); err != nil { + return err + } + if err := m.LightRig.ValidateWithPath(path + "/LightRig"); err != nil { + return err + } + if m.Backdrop != nil { + if err := m.Backdrop.ValidateWithPath(path + "/Backdrop"); err != nil { + return err + } + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_SchemeColor.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_SchemeColor.go new file mode 100644 index 00000000..f8a04cfe --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_SchemeColor.go @@ -0,0 +1,293 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_SchemeColor struct { + ValAttr ST_SchemeColorVal + EG_ColorTransform []*EG_ColorTransform +} + +func NewCT_SchemeColor() *CT_SchemeColor { + ret := &CT_SchemeColor{} + ret.ValAttr = ST_SchemeColorVal(1) + return ret +} + +func (m *CT_SchemeColor) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + if m.EG_ColorTransform != nil { + for _, c := range m.EG_ColorTransform { + c.MarshalXML(e, xml.StartElement{}) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SchemeColor) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_SchemeColorVal(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } +lCT_SchemeColor: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "tint"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Tint = NewCT_PositiveFixedPercentage() + if err := d.DecodeElement(tmpcolortransform.Tint, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "shade"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Shade = NewCT_PositiveFixedPercentage() + if err := d.DecodeElement(tmpcolortransform.Shade, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "comp"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Comp = NewCT_ComplementTransform() + if err := d.DecodeElement(tmpcolortransform.Comp, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "inv"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Inv = NewCT_InverseTransform() + if err := d.DecodeElement(tmpcolortransform.Inv, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "gray"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Gray = NewCT_GrayscaleTransform() + if err := d.DecodeElement(tmpcolortransform.Gray, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alpha"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Alpha = NewCT_PositiveFixedPercentage() + if err := d.DecodeElement(tmpcolortransform.Alpha, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.AlphaOff = NewCT_FixedPercentage() + if err := d.DecodeElement(tmpcolortransform.AlphaOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.AlphaMod = NewCT_PositivePercentage() + if err := d.DecodeElement(tmpcolortransform.AlphaMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hue"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Hue = NewCT_PositiveFixedAngle() + if err := d.DecodeElement(tmpcolortransform.Hue, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hueOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.HueOff = NewCT_Angle() + if err := d.DecodeElement(tmpcolortransform.HueOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hueMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.HueMod = NewCT_PositivePercentage() + if err := d.DecodeElement(tmpcolortransform.HueMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "sat"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Sat = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.Sat, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "satOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.SatOff = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.SatOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "satMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.SatMod = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.SatMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lum"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Lum = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.Lum, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lumOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.LumOff = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.LumOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lumMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.LumMod = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.LumMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "red"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Red = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.Red, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "redOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.RedOff = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.RedOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "redMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.RedMod = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.RedMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "green"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Green = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.Green, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "greenOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.GreenOff = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.GreenOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "greenMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.GreenMod = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.GreenMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blue"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Blue = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.Blue, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blueOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.BlueOff = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.BlueOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blueMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.BlueMod = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.BlueMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "gamma"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Gamma = NewCT_GammaTransform() + if err := d.DecodeElement(tmpcolortransform.Gamma, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "invGamma"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.InvGamma = NewCT_InverseGammaTransform() + if err := d.DecodeElement(tmpcolortransform.InvGamma, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + default: + gooxml.Log("skipping unsupported element on CT_SchemeColor %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_SchemeColor + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_SchemeColor and its children +func (m *CT_SchemeColor) Validate() error { + return m.ValidateWithPath("CT_SchemeColor") +} + +// ValidateWithPath validates the CT_SchemeColor and its children, prefixing error messages with path +func (m *CT_SchemeColor) ValidateWithPath(path string) error { + if m.ValAttr == ST_SchemeColorValUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + for i, v := range m.EG_ColorTransform { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_ColorTransform[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Shape3D.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Shape3D.go new file mode 100644 index 00000000..0e38b41a --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Shape3D.go @@ -0,0 +1,219 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type CT_Shape3D struct { + ZAttr *ST_Coordinate + ExtrusionHAttr *int64 + ContourWAttr *int64 + PrstMaterialAttr ST_PresetMaterialType + BevelT *CT_Bevel + BevelB *CT_Bevel + ExtrusionClr *CT_Color + ContourClr *CT_Color + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_Shape3D() *CT_Shape3D { + ret := &CT_Shape3D{} + return ret +} + +func (m *CT_Shape3D) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.ZAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "z"}, + Value: fmt.Sprintf("%v", *m.ZAttr)}) + } + if m.ExtrusionHAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "extrusionH"}, + Value: fmt.Sprintf("%v", *m.ExtrusionHAttr)}) + } + if m.ContourWAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "contourW"}, + Value: fmt.Sprintf("%v", *m.ContourWAttr)}) + } + if m.PrstMaterialAttr != ST_PresetMaterialTypeUnset { + attr, err := m.PrstMaterialAttr.MarshalXMLAttr(xml.Name{Local: "prstMaterial"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + if m.BevelT != nil { + sebevelT := xml.StartElement{Name: xml.Name{Local: "a:bevelT"}} + e.EncodeElement(m.BevelT, sebevelT) + } + if m.BevelB != nil { + sebevelB := xml.StartElement{Name: xml.Name{Local: "a:bevelB"}} + e.EncodeElement(m.BevelB, sebevelB) + } + if m.ExtrusionClr != nil { + seextrusionClr := xml.StartElement{Name: xml.Name{Local: "a:extrusionClr"}} + e.EncodeElement(m.ExtrusionClr, seextrusionClr) + } + if m.ContourClr != nil { + secontourClr := xml.StartElement{Name: xml.Name{Local: "a:contourClr"}} + e.EncodeElement(m.ContourClr, secontourClr) + } + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Shape3D) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "z" { + parsed, err := ParseUnionST_Coordinate(attr.Value) + if err != nil { + return err + } + m.ZAttr = &parsed + continue + } + if attr.Name.Local == "extrusionH" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.ExtrusionHAttr = &parsed + continue + } + if attr.Name.Local == "contourW" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.ContourWAttr = &parsed + continue + } + if attr.Name.Local == "prstMaterial" { + m.PrstMaterialAttr.UnmarshalXMLAttr(attr) + continue + } + } +lCT_Shape3D: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "bevelT"}: + m.BevelT = NewCT_Bevel() + if err := d.DecodeElement(m.BevelT, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "bevelB"}: + m.BevelB = NewCT_Bevel() + if err := d.DecodeElement(m.BevelB, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extrusionClr"}: + m.ExtrusionClr = NewCT_Color() + if err := d.DecodeElement(m.ExtrusionClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "contourClr"}: + m.ContourClr = NewCT_Color() + if err := d.DecodeElement(m.ContourClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_Shape3D %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Shape3D + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Shape3D and its children +func (m *CT_Shape3D) Validate() error { + return m.ValidateWithPath("CT_Shape3D") +} + +// ValidateWithPath validates the CT_Shape3D and its children, prefixing error messages with path +func (m *CT_Shape3D) ValidateWithPath(path string) error { + if m.ZAttr != nil { + if err := m.ZAttr.ValidateWithPath(path + "/ZAttr"); err != nil { + return err + } + } + if m.ExtrusionHAttr != nil { + if *m.ExtrusionHAttr < 0 { + return fmt.Errorf("%s/m.ExtrusionHAttr must be >= 0 (have %v)", path, *m.ExtrusionHAttr) + } + if *m.ExtrusionHAttr > 27273042316900 { + return fmt.Errorf("%s/m.ExtrusionHAttr must be <= 27273042316900 (have %v)", path, *m.ExtrusionHAttr) + } + } + if m.ContourWAttr != nil { + if *m.ContourWAttr < 0 { + return fmt.Errorf("%s/m.ContourWAttr must be >= 0 (have %v)", path, *m.ContourWAttr) + } + if *m.ContourWAttr > 27273042316900 { + return fmt.Errorf("%s/m.ContourWAttr must be <= 27273042316900 (have %v)", path, *m.ContourWAttr) + } + } + if err := m.PrstMaterialAttr.ValidateWithPath(path + "/PrstMaterialAttr"); err != nil { + return err + } + if m.BevelT != nil { + if err := m.BevelT.ValidateWithPath(path + "/BevelT"); err != nil { + return err + } + } + if m.BevelB != nil { + if err := m.BevelB.ValidateWithPath(path + "/BevelB"); err != nil { + return err + } + } + if m.ExtrusionClr != nil { + if err := m.ExtrusionClr.ValidateWithPath(path + "/ExtrusionClr"); err != nil { + return err + } + } + if m.ContourClr != nil { + if err := m.ContourClr.ValidateWithPath(path + "/ContourClr"); err != nil { + return err + } + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ShapeLocking.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ShapeLocking.go new file mode 100644 index 00000000..5fa1c2c0 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ShapeLocking.go @@ -0,0 +1,227 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type CT_ShapeLocking struct { + NoTextEditAttr *bool + ExtLst *CT_OfficeArtExtensionList + NoGrpAttr *bool + NoSelectAttr *bool + NoRotAttr *bool + NoChangeAspectAttr *bool + NoMoveAttr *bool + NoResizeAttr *bool + NoEditPointsAttr *bool + NoAdjustHandlesAttr *bool + NoChangeArrowheadsAttr *bool + NoChangeShapeTypeAttr *bool +} + +func NewCT_ShapeLocking() *CT_ShapeLocking { + ret := &CT_ShapeLocking{} + return ret +} + +func (m *CT_ShapeLocking) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.NoTextEditAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noTextEdit"}, + Value: fmt.Sprintf("%d", b2i(*m.NoTextEditAttr))}) + } + if m.NoGrpAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noGrp"}, + Value: fmt.Sprintf("%d", b2i(*m.NoGrpAttr))}) + } + if m.NoSelectAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noSelect"}, + Value: fmt.Sprintf("%d", b2i(*m.NoSelectAttr))}) + } + if m.NoRotAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noRot"}, + Value: fmt.Sprintf("%d", b2i(*m.NoRotAttr))}) + } + if m.NoChangeAspectAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noChangeAspect"}, + Value: fmt.Sprintf("%d", b2i(*m.NoChangeAspectAttr))}) + } + if m.NoMoveAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noMove"}, + Value: fmt.Sprintf("%d", b2i(*m.NoMoveAttr))}) + } + if m.NoResizeAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noResize"}, + Value: fmt.Sprintf("%d", b2i(*m.NoResizeAttr))}) + } + if m.NoEditPointsAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noEditPoints"}, + Value: fmt.Sprintf("%d", b2i(*m.NoEditPointsAttr))}) + } + if m.NoAdjustHandlesAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noAdjustHandles"}, + Value: fmt.Sprintf("%d", b2i(*m.NoAdjustHandlesAttr))}) + } + if m.NoChangeArrowheadsAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noChangeArrowheads"}, + Value: fmt.Sprintf("%d", b2i(*m.NoChangeArrowheadsAttr))}) + } + if m.NoChangeShapeTypeAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noChangeShapeType"}, + Value: fmt.Sprintf("%d", b2i(*m.NoChangeShapeTypeAttr))}) + } + e.EncodeToken(start) + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_ShapeLocking) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "noTextEdit" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoTextEditAttr = &parsed + continue + } + if attr.Name.Local == "noGrp" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoGrpAttr = &parsed + continue + } + if attr.Name.Local == "noSelect" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoSelectAttr = &parsed + continue + } + if attr.Name.Local == "noRot" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoRotAttr = &parsed + continue + } + if attr.Name.Local == "noChangeAspect" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoChangeAspectAttr = &parsed + continue + } + if attr.Name.Local == "noMove" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoMoveAttr = &parsed + continue + } + if attr.Name.Local == "noResize" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoResizeAttr = &parsed + continue + } + if attr.Name.Local == "noEditPoints" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoEditPointsAttr = &parsed + continue + } + if attr.Name.Local == "noAdjustHandles" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoAdjustHandlesAttr = &parsed + continue + } + if attr.Name.Local == "noChangeArrowheads" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoChangeArrowheadsAttr = &parsed + continue + } + if attr.Name.Local == "noChangeShapeType" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoChangeShapeTypeAttr = &parsed + continue + } + } +lCT_ShapeLocking: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_ShapeLocking %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_ShapeLocking + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_ShapeLocking and its children +func (m *CT_ShapeLocking) Validate() error { + return m.ValidateWithPath("CT_ShapeLocking") +} + +// ValidateWithPath validates the CT_ShapeLocking and its children, prefixing error messages with path +func (m *CT_ShapeLocking) ValidateWithPath(path string) error { + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ShapeProperties.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ShapeProperties.go new file mode 100644 index 00000000..14553535 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ShapeProperties.go @@ -0,0 +1,307 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_ShapeProperties struct { + BwModeAttr ST_BlackWhiteMode + Xfrm *CT_Transform2D + CustGeom *CT_CustomGeometry2D + PrstGeom *CT_PresetGeometry2D + NoFill *CT_NoFillProperties + SolidFill *CT_SolidColorFillProperties + GradFill *CT_GradientFillProperties + BlipFill *CT_BlipFillProperties + PattFill *CT_PatternFillProperties + GrpFill *CT_GroupFillProperties + Ln *CT_LineProperties + EffectLst *CT_EffectList + EffectDag *CT_EffectContainer + Scene3d *CT_Scene3D + Sp3d *CT_Shape3D + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_ShapeProperties() *CT_ShapeProperties { + ret := &CT_ShapeProperties{} + return ret +} + +func (m *CT_ShapeProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.BwModeAttr != ST_BlackWhiteModeUnset { + attr, err := m.BwModeAttr.MarshalXMLAttr(xml.Name{Local: "bwMode"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + if m.Xfrm != nil { + sexfrm := xml.StartElement{Name: xml.Name{Local: "a:xfrm"}} + e.EncodeElement(m.Xfrm, sexfrm) + } + if m.CustGeom != nil { + secustGeom := xml.StartElement{Name: xml.Name{Local: "a:custGeom"}} + e.EncodeElement(m.CustGeom, secustGeom) + } + if m.PrstGeom != nil { + seprstGeom := xml.StartElement{Name: xml.Name{Local: "a:prstGeom"}} + e.EncodeElement(m.PrstGeom, seprstGeom) + } + if m.NoFill != nil { + senoFill := xml.StartElement{Name: xml.Name{Local: "a:noFill"}} + e.EncodeElement(m.NoFill, senoFill) + } + if m.SolidFill != nil { + sesolidFill := xml.StartElement{Name: xml.Name{Local: "a:solidFill"}} + e.EncodeElement(m.SolidFill, sesolidFill) + } + if m.GradFill != nil { + segradFill := xml.StartElement{Name: xml.Name{Local: "a:gradFill"}} + e.EncodeElement(m.GradFill, segradFill) + } + if m.BlipFill != nil { + seblipFill := xml.StartElement{Name: xml.Name{Local: "a:blipFill"}} + e.EncodeElement(m.BlipFill, seblipFill) + } + if m.PattFill != nil { + sepattFill := xml.StartElement{Name: xml.Name{Local: "a:pattFill"}} + e.EncodeElement(m.PattFill, sepattFill) + } + if m.GrpFill != nil { + segrpFill := xml.StartElement{Name: xml.Name{Local: "a:grpFill"}} + e.EncodeElement(m.GrpFill, segrpFill) + } + if m.Ln != nil { + seln := xml.StartElement{Name: xml.Name{Local: "a:ln"}} + e.EncodeElement(m.Ln, seln) + } + if m.EffectLst != nil { + seeffectLst := xml.StartElement{Name: xml.Name{Local: "a:effectLst"}} + e.EncodeElement(m.EffectLst, seeffectLst) + } + if m.EffectDag != nil { + seeffectDag := xml.StartElement{Name: xml.Name{Local: "a:effectDag"}} + e.EncodeElement(m.EffectDag, seeffectDag) + } + if m.Scene3d != nil { + sescene3d := xml.StartElement{Name: xml.Name{Local: "a:scene3d"}} + e.EncodeElement(m.Scene3d, sescene3d) + } + if m.Sp3d != nil { + sesp3d := xml.StartElement{Name: xml.Name{Local: "a:sp3d"}} + e.EncodeElement(m.Sp3d, sesp3d) + } + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_ShapeProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "bwMode" { + m.BwModeAttr.UnmarshalXMLAttr(attr) + continue + } + } +lCT_ShapeProperties: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "xfrm"}: + m.Xfrm = NewCT_Transform2D() + if err := d.DecodeElement(m.Xfrm, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "custGeom"}: + m.CustGeom = NewCT_CustomGeometry2D() + if err := d.DecodeElement(m.CustGeom, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "prstGeom"}: + m.PrstGeom = NewCT_PresetGeometry2D() + if err := d.DecodeElement(m.PrstGeom, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "noFill"}: + m.NoFill = NewCT_NoFillProperties() + if err := d.DecodeElement(m.NoFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "solidFill"}: + m.SolidFill = NewCT_SolidColorFillProperties() + if err := d.DecodeElement(m.SolidFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "gradFill"}: + m.GradFill = NewCT_GradientFillProperties() + if err := d.DecodeElement(m.GradFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blipFill"}: + m.BlipFill = NewCT_BlipFillProperties() + if err := d.DecodeElement(m.BlipFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "pattFill"}: + m.PattFill = NewCT_PatternFillProperties() + if err := d.DecodeElement(m.PattFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "grpFill"}: + m.GrpFill = NewCT_GroupFillProperties() + if err := d.DecodeElement(m.GrpFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "ln"}: + m.Ln = NewCT_LineProperties() + if err := d.DecodeElement(m.Ln, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "effectLst"}: + m.EffectLst = NewCT_EffectList() + if err := d.DecodeElement(m.EffectLst, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "effectDag"}: + m.EffectDag = NewCT_EffectContainer() + if err := d.DecodeElement(m.EffectDag, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "scene3d"}: + m.Scene3d = NewCT_Scene3D() + if err := d.DecodeElement(m.Scene3d, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "sp3d"}: + m.Sp3d = NewCT_Shape3D() + if err := d.DecodeElement(m.Sp3d, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_ShapeProperties %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_ShapeProperties + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_ShapeProperties and its children +func (m *CT_ShapeProperties) Validate() error { + return m.ValidateWithPath("CT_ShapeProperties") +} + +// ValidateWithPath validates the CT_ShapeProperties and its children, prefixing error messages with path +func (m *CT_ShapeProperties) ValidateWithPath(path string) error { + if err := m.BwModeAttr.ValidateWithPath(path + "/BwModeAttr"); err != nil { + return err + } + if m.Xfrm != nil { + if err := m.Xfrm.ValidateWithPath(path + "/Xfrm"); err != nil { + return err + } + } + if m.CustGeom != nil { + if err := m.CustGeom.ValidateWithPath(path + "/CustGeom"); err != nil { + return err + } + } + if m.PrstGeom != nil { + if err := m.PrstGeom.ValidateWithPath(path + "/PrstGeom"); err != nil { + return err + } + } + if m.NoFill != nil { + if err := m.NoFill.ValidateWithPath(path + "/NoFill"); err != nil { + return err + } + } + if m.SolidFill != nil { + if err := m.SolidFill.ValidateWithPath(path + "/SolidFill"); err != nil { + return err + } + } + if m.GradFill != nil { + if err := m.GradFill.ValidateWithPath(path + "/GradFill"); err != nil { + return err + } + } + if m.BlipFill != nil { + if err := m.BlipFill.ValidateWithPath(path + "/BlipFill"); err != nil { + return err + } + } + if m.PattFill != nil { + if err := m.PattFill.ValidateWithPath(path + "/PattFill"); err != nil { + return err + } + } + if m.GrpFill != nil { + if err := m.GrpFill.ValidateWithPath(path + "/GrpFill"); err != nil { + return err + } + } + if m.Ln != nil { + if err := m.Ln.ValidateWithPath(path + "/Ln"); err != nil { + return err + } + } + if m.EffectLst != nil { + if err := m.EffectLst.ValidateWithPath(path + "/EffectLst"); err != nil { + return err + } + } + if m.EffectDag != nil { + if err := m.EffectDag.ValidateWithPath(path + "/EffectDag"); err != nil { + return err + } + } + if m.Scene3d != nil { + if err := m.Scene3d.ValidateWithPath(path + "/Scene3d"); err != nil { + return err + } + } + if m.Sp3d != nil { + if err := m.Sp3d.ValidateWithPath(path + "/Sp3d"); err != nil { + return err + } + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ShapeStyle.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ShapeStyle.go new file mode 100644 index 00000000..648e534a --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ShapeStyle.go @@ -0,0 +1,113 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_ShapeStyle struct { + LnRef *CT_StyleMatrixReference + FillRef *CT_StyleMatrixReference + EffectRef *CT_StyleMatrixReference + FontRef *CT_FontReference +} + +func NewCT_ShapeStyle() *CT_ShapeStyle { + ret := &CT_ShapeStyle{} + ret.LnRef = NewCT_StyleMatrixReference() + ret.FillRef = NewCT_StyleMatrixReference() + ret.EffectRef = NewCT_StyleMatrixReference() + ret.FontRef = NewCT_FontReference() + return ret +} + +func (m *CT_ShapeStyle) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + selnRef := xml.StartElement{Name: xml.Name{Local: "a:lnRef"}} + e.EncodeElement(m.LnRef, selnRef) + sefillRef := xml.StartElement{Name: xml.Name{Local: "a:fillRef"}} + e.EncodeElement(m.FillRef, sefillRef) + seeffectRef := xml.StartElement{Name: xml.Name{Local: "a:effectRef"}} + e.EncodeElement(m.EffectRef, seeffectRef) + sefontRef := xml.StartElement{Name: xml.Name{Local: "a:fontRef"}} + e.EncodeElement(m.FontRef, sefontRef) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_ShapeStyle) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.LnRef = NewCT_StyleMatrixReference() + m.FillRef = NewCT_StyleMatrixReference() + m.EffectRef = NewCT_StyleMatrixReference() + m.FontRef = NewCT_FontReference() +lCT_ShapeStyle: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lnRef"}: + if err := d.DecodeElement(m.LnRef, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "fillRef"}: + if err := d.DecodeElement(m.FillRef, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "effectRef"}: + if err := d.DecodeElement(m.EffectRef, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "fontRef"}: + if err := d.DecodeElement(m.FontRef, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_ShapeStyle %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_ShapeStyle + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_ShapeStyle and its children +func (m *CT_ShapeStyle) Validate() error { + return m.ValidateWithPath("CT_ShapeStyle") +} + +// ValidateWithPath validates the CT_ShapeStyle and its children, prefixing error messages with path +func (m *CT_ShapeStyle) ValidateWithPath(path string) error { + if err := m.LnRef.ValidateWithPath(path + "/LnRef"); err != nil { + return err + } + if err := m.FillRef.ValidateWithPath(path + "/FillRef"); err != nil { + return err + } + if err := m.EffectRef.ValidateWithPath(path + "/EffectRef"); err != nil { + return err + } + if err := m.FontRef.ValidateWithPath(path + "/FontRef"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_SoftEdgesEffect.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_SoftEdgesEffect.go new file mode 100644 index 00000000..bdf15831 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_SoftEdgesEffect.go @@ -0,0 +1,76 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" +) + +type CT_SoftEdgesEffect struct { + RadAttr int64 +} + +func NewCT_SoftEdgesEffect() *CT_SoftEdgesEffect { + ret := &CT_SoftEdgesEffect{} + ret.RadAttr = 0 + return ret +} + +func (m *CT_SoftEdgesEffect) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "rad"}, + Value: fmt.Sprintf("%v", m.RadAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SoftEdgesEffect) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.RadAttr = 0 + for _, attr := range start.Attr { + if attr.Name.Local == "rad" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.RadAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_SoftEdgesEffect: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_SoftEdgesEffect and its children +func (m *CT_SoftEdgesEffect) Validate() error { + return m.ValidateWithPath("CT_SoftEdgesEffect") +} + +// ValidateWithPath validates the CT_SoftEdgesEffect and its children, prefixing error messages with path +func (m *CT_SoftEdgesEffect) ValidateWithPath(path string) error { + if m.RadAttr < 0 { + return fmt.Errorf("%s/m.RadAttr must be >= 0 (have %v)", path, m.RadAttr) + } + if m.RadAttr > 27273042316900 { + return fmt.Errorf("%s/m.RadAttr must be <= 27273042316900 (have %v)", path, m.RadAttr) + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_SolidColorFillProperties.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_SolidColorFillProperties.go new file mode 100644 index 00000000..e49588ab --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_SolidColorFillProperties.go @@ -0,0 +1,155 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_SolidColorFillProperties struct { + ScrgbClr *CT_ScRgbColor + SrgbClr *CT_SRgbColor + HslClr *CT_HslColor + SysClr *CT_SystemColor + SchemeClr *CT_SchemeColor + PrstClr *CT_PresetColor +} + +func NewCT_SolidColorFillProperties() *CT_SolidColorFillProperties { + ret := &CT_SolidColorFillProperties{} + return ret +} + +func (m *CT_SolidColorFillProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.ScrgbClr != nil { + sescrgbClr := xml.StartElement{Name: xml.Name{Local: "a:scrgbClr"}} + e.EncodeElement(m.ScrgbClr, sescrgbClr) + } + if m.SrgbClr != nil { + sesrgbClr := xml.StartElement{Name: xml.Name{Local: "a:srgbClr"}} + e.EncodeElement(m.SrgbClr, sesrgbClr) + } + if m.HslClr != nil { + sehslClr := xml.StartElement{Name: xml.Name{Local: "a:hslClr"}} + e.EncodeElement(m.HslClr, sehslClr) + } + if m.SysClr != nil { + sesysClr := xml.StartElement{Name: xml.Name{Local: "a:sysClr"}} + e.EncodeElement(m.SysClr, sesysClr) + } + if m.SchemeClr != nil { + seschemeClr := xml.StartElement{Name: xml.Name{Local: "a:schemeClr"}} + e.EncodeElement(m.SchemeClr, seschemeClr) + } + if m.PrstClr != nil { + seprstClr := xml.StartElement{Name: xml.Name{Local: "a:prstClr"}} + e.EncodeElement(m.PrstClr, seprstClr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SolidColorFillProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_SolidColorFillProperties: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "scrgbClr"}: + m.ScrgbClr = NewCT_ScRgbColor() + if err := d.DecodeElement(m.ScrgbClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "srgbClr"}: + m.SrgbClr = NewCT_SRgbColor() + if err := d.DecodeElement(m.SrgbClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hslClr"}: + m.HslClr = NewCT_HslColor() + if err := d.DecodeElement(m.HslClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "sysClr"}: + m.SysClr = NewCT_SystemColor() + if err := d.DecodeElement(m.SysClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "schemeClr"}: + m.SchemeClr = NewCT_SchemeColor() + if err := d.DecodeElement(m.SchemeClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "prstClr"}: + m.PrstClr = NewCT_PresetColor() + if err := d.DecodeElement(m.PrstClr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_SolidColorFillProperties %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_SolidColorFillProperties + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_SolidColorFillProperties and its children +func (m *CT_SolidColorFillProperties) Validate() error { + return m.ValidateWithPath("CT_SolidColorFillProperties") +} + +// ValidateWithPath validates the CT_SolidColorFillProperties and its children, prefixing error messages with path +func (m *CT_SolidColorFillProperties) ValidateWithPath(path string) error { + if m.ScrgbClr != nil { + if err := m.ScrgbClr.ValidateWithPath(path + "/ScrgbClr"); err != nil { + return err + } + } + if m.SrgbClr != nil { + if err := m.SrgbClr.ValidateWithPath(path + "/SrgbClr"); err != nil { + return err + } + } + if m.HslClr != nil { + if err := m.HslClr.ValidateWithPath(path + "/HslClr"); err != nil { + return err + } + } + if m.SysClr != nil { + if err := m.SysClr.ValidateWithPath(path + "/SysClr"); err != nil { + return err + } + } + if m.SchemeClr != nil { + if err := m.SchemeClr.ValidateWithPath(path + "/SchemeClr"); err != nil { + return err + } + } + if m.PrstClr != nil { + if err := m.PrstClr.ValidateWithPath(path + "/PrstClr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_SphereCoords.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_SphereCoords.go new file mode 100644 index 00000000..220e9c54 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_SphereCoords.go @@ -0,0 +1,114 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" +) + +type CT_SphereCoords struct { + LatAttr int32 + LonAttr int32 + RevAttr int32 +} + +func NewCT_SphereCoords() *CT_SphereCoords { + ret := &CT_SphereCoords{} + ret.LatAttr = 0 + ret.LonAttr = 0 + ret.RevAttr = 0 + return ret +} + +func (m *CT_SphereCoords) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "lat"}, + Value: fmt.Sprintf("%v", m.LatAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "lon"}, + Value: fmt.Sprintf("%v", m.LonAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "rev"}, + Value: fmt.Sprintf("%v", m.RevAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SphereCoords) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.LatAttr = 0 + m.LonAttr = 0 + m.RevAttr = 0 + for _, attr := range start.Attr { + if attr.Name.Local == "lat" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + m.LatAttr = int32(parsed) + continue + } + if attr.Name.Local == "lon" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + m.LonAttr = int32(parsed) + continue + } + if attr.Name.Local == "rev" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + m.RevAttr = int32(parsed) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_SphereCoords: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_SphereCoords and its children +func (m *CT_SphereCoords) Validate() error { + return m.ValidateWithPath("CT_SphereCoords") +} + +// ValidateWithPath validates the CT_SphereCoords and its children, prefixing error messages with path +func (m *CT_SphereCoords) ValidateWithPath(path string) error { + if m.LatAttr < 0 { + return fmt.Errorf("%s/m.LatAttr must be >= 0 (have %v)", path, m.LatAttr) + } + if m.LatAttr >= 21600000 { + return fmt.Errorf("%s/m.LatAttr must be < 21600000 (have %v)", path, m.LatAttr) + } + if m.LonAttr < 0 { + return fmt.Errorf("%s/m.LonAttr must be >= 0 (have %v)", path, m.LonAttr) + } + if m.LonAttr >= 21600000 { + return fmt.Errorf("%s/m.LonAttr must be < 21600000 (have %v)", path, m.LonAttr) + } + if m.RevAttr < 0 { + return fmt.Errorf("%s/m.RevAttr must be >= 0 (have %v)", path, m.RevAttr) + } + if m.RevAttr >= 21600000 { + return fmt.Errorf("%s/m.RevAttr must be < 21600000 (have %v)", path, m.RevAttr) + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_StretchInfoProperties.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_StretchInfoProperties.go new file mode 100644 index 00000000..84e4938d --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_StretchInfoProperties.go @@ -0,0 +1,80 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_StretchInfoProperties struct { + FillRect *CT_RelativeRect +} + +func NewCT_StretchInfoProperties() *CT_StretchInfoProperties { + ret := &CT_StretchInfoProperties{} + return ret +} + +func (m *CT_StretchInfoProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.FillRect != nil { + sefillRect := xml.StartElement{Name: xml.Name{Local: "a:fillRect"}} + e.EncodeElement(m.FillRect, sefillRect) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_StretchInfoProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_StretchInfoProperties: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "fillRect"}: + m.FillRect = NewCT_RelativeRect() + if err := d.DecodeElement(m.FillRect, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_StretchInfoProperties %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_StretchInfoProperties + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_StretchInfoProperties and its children +func (m *CT_StretchInfoProperties) Validate() error { + return m.ValidateWithPath("CT_StretchInfoProperties") +} + +// ValidateWithPath validates the CT_StretchInfoProperties and its children, prefixing error messages with path +func (m *CT_StretchInfoProperties) ValidateWithPath(path string) error { + if m.FillRect != nil { + if err := m.FillRect.ValidateWithPath(path + "/FillRect"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_StyleMatrix.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_StyleMatrix.go new file mode 100644 index 00000000..7f4e6d3e --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_StyleMatrix.go @@ -0,0 +1,129 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_StyleMatrix struct { + NameAttr *string + FillStyleLst *CT_FillStyleList + LnStyleLst *CT_LineStyleList + EffectStyleLst *CT_EffectStyleList + BgFillStyleLst *CT_BackgroundFillStyleList +} + +func NewCT_StyleMatrix() *CT_StyleMatrix { + ret := &CT_StyleMatrix{} + ret.FillStyleLst = NewCT_FillStyleList() + ret.LnStyleLst = NewCT_LineStyleList() + ret.EffectStyleLst = NewCT_EffectStyleList() + ret.BgFillStyleLst = NewCT_BackgroundFillStyleList() + return ret +} + +func (m *CT_StyleMatrix) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.NameAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "name"}, + Value: fmt.Sprintf("%v", *m.NameAttr)}) + } + e.EncodeToken(start) + sefillStyleLst := xml.StartElement{Name: xml.Name{Local: "a:fillStyleLst"}} + e.EncodeElement(m.FillStyleLst, sefillStyleLst) + selnStyleLst := xml.StartElement{Name: xml.Name{Local: "a:lnStyleLst"}} + e.EncodeElement(m.LnStyleLst, selnStyleLst) + seeffectStyleLst := xml.StartElement{Name: xml.Name{Local: "a:effectStyleLst"}} + e.EncodeElement(m.EffectStyleLst, seeffectStyleLst) + sebgFillStyleLst := xml.StartElement{Name: xml.Name{Local: "a:bgFillStyleLst"}} + e.EncodeElement(m.BgFillStyleLst, sebgFillStyleLst) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_StyleMatrix) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.FillStyleLst = NewCT_FillStyleList() + m.LnStyleLst = NewCT_LineStyleList() + m.EffectStyleLst = NewCT_EffectStyleList() + m.BgFillStyleLst = NewCT_BackgroundFillStyleList() + for _, attr := range start.Attr { + if attr.Name.Local == "name" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.NameAttr = &parsed + continue + } + } +lCT_StyleMatrix: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "fillStyleLst"}: + if err := d.DecodeElement(m.FillStyleLst, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lnStyleLst"}: + if err := d.DecodeElement(m.LnStyleLst, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "effectStyleLst"}: + if err := d.DecodeElement(m.EffectStyleLst, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "bgFillStyleLst"}: + if err := d.DecodeElement(m.BgFillStyleLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_StyleMatrix %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_StyleMatrix + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_StyleMatrix and its children +func (m *CT_StyleMatrix) Validate() error { + return m.ValidateWithPath("CT_StyleMatrix") +} + +// ValidateWithPath validates the CT_StyleMatrix and its children, prefixing error messages with path +func (m *CT_StyleMatrix) ValidateWithPath(path string) error { + if err := m.FillStyleLst.ValidateWithPath(path + "/FillStyleLst"); err != nil { + return err + } + if err := m.LnStyleLst.ValidateWithPath(path + "/LnStyleLst"); err != nil { + return err + } + if err := m.EffectStyleLst.ValidateWithPath(path + "/EffectStyleLst"); err != nil { + return err + } + if err := m.BgFillStyleLst.ValidateWithPath(path + "/BgFillStyleLst"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_StyleMatrixReference.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_StyleMatrixReference.go new file mode 100644 index 00000000..fb3c4bda --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_StyleMatrixReference.go @@ -0,0 +1,170 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type CT_StyleMatrixReference struct { + IdxAttr uint32 + ScrgbClr *CT_ScRgbColor + SrgbClr *CT_SRgbColor + HslClr *CT_HslColor + SysClr *CT_SystemColor + SchemeClr *CT_SchemeColor + PrstClr *CT_PresetColor +} + +func NewCT_StyleMatrixReference() *CT_StyleMatrixReference { + ret := &CT_StyleMatrixReference{} + return ret +} + +func (m *CT_StyleMatrixReference) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "idx"}, + Value: fmt.Sprintf("%v", m.IdxAttr)}) + e.EncodeToken(start) + if m.ScrgbClr != nil { + sescrgbClr := xml.StartElement{Name: xml.Name{Local: "a:scrgbClr"}} + e.EncodeElement(m.ScrgbClr, sescrgbClr) + } + if m.SrgbClr != nil { + sesrgbClr := xml.StartElement{Name: xml.Name{Local: "a:srgbClr"}} + e.EncodeElement(m.SrgbClr, sesrgbClr) + } + if m.HslClr != nil { + sehslClr := xml.StartElement{Name: xml.Name{Local: "a:hslClr"}} + e.EncodeElement(m.HslClr, sehslClr) + } + if m.SysClr != nil { + sesysClr := xml.StartElement{Name: xml.Name{Local: "a:sysClr"}} + e.EncodeElement(m.SysClr, sesysClr) + } + if m.SchemeClr != nil { + seschemeClr := xml.StartElement{Name: xml.Name{Local: "a:schemeClr"}} + e.EncodeElement(m.SchemeClr, seschemeClr) + } + if m.PrstClr != nil { + seprstClr := xml.StartElement{Name: xml.Name{Local: "a:prstClr"}} + e.EncodeElement(m.PrstClr, seprstClr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_StyleMatrixReference) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "idx" { + parsed, err := strconv.ParseUint(attr.Value, 10, 32) + if err != nil { + return err + } + m.IdxAttr = uint32(parsed) + continue + } + } +lCT_StyleMatrixReference: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "scrgbClr"}: + m.ScrgbClr = NewCT_ScRgbColor() + if err := d.DecodeElement(m.ScrgbClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "srgbClr"}: + m.SrgbClr = NewCT_SRgbColor() + if err := d.DecodeElement(m.SrgbClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hslClr"}: + m.HslClr = NewCT_HslColor() + if err := d.DecodeElement(m.HslClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "sysClr"}: + m.SysClr = NewCT_SystemColor() + if err := d.DecodeElement(m.SysClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "schemeClr"}: + m.SchemeClr = NewCT_SchemeColor() + if err := d.DecodeElement(m.SchemeClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "prstClr"}: + m.PrstClr = NewCT_PresetColor() + if err := d.DecodeElement(m.PrstClr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_StyleMatrixReference %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_StyleMatrixReference + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_StyleMatrixReference and its children +func (m *CT_StyleMatrixReference) Validate() error { + return m.ValidateWithPath("CT_StyleMatrixReference") +} + +// ValidateWithPath validates the CT_StyleMatrixReference and its children, prefixing error messages with path +func (m *CT_StyleMatrixReference) ValidateWithPath(path string) error { + if m.ScrgbClr != nil { + if err := m.ScrgbClr.ValidateWithPath(path + "/ScrgbClr"); err != nil { + return err + } + } + if m.SrgbClr != nil { + if err := m.SrgbClr.ValidateWithPath(path + "/SrgbClr"); err != nil { + return err + } + } + if m.HslClr != nil { + if err := m.HslClr.ValidateWithPath(path + "/HslClr"); err != nil { + return err + } + } + if m.SysClr != nil { + if err := m.SysClr.ValidateWithPath(path + "/SysClr"); err != nil { + return err + } + } + if m.SchemeClr != nil { + if err := m.SchemeClr.ValidateWithPath(path + "/SchemeClr"); err != nil { + return err + } + } + if m.PrstClr != nil { + if err := m.PrstClr.ValidateWithPath(path + "/PrstClr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_SupplementalFont.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_SupplementalFont.go new file mode 100644 index 00000000..02df8eed --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_SupplementalFont.go @@ -0,0 +1,78 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_SupplementalFont struct { + ScriptAttr string + TypefaceAttr string +} + +func NewCT_SupplementalFont() *CT_SupplementalFont { + ret := &CT_SupplementalFont{} + return ret +} + +func (m *CT_SupplementalFont) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "script"}, + Value: fmt.Sprintf("%v", m.ScriptAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "typeface"}, + Value: fmt.Sprintf("%v", m.TypefaceAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SupplementalFont) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "script" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ScriptAttr = parsed + continue + } + if attr.Name.Local == "typeface" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.TypefaceAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_SupplementalFont: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_SupplementalFont and its children +func (m *CT_SupplementalFont) Validate() error { + return m.ValidateWithPath("CT_SupplementalFont") +} + +// ValidateWithPath validates the CT_SupplementalFont and its children, prefixing error messages with path +func (m *CT_SupplementalFont) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_SystemColor.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_SystemColor.go new file mode 100644 index 00000000..8482eda3 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_SystemColor.go @@ -0,0 +1,306 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_SystemColor struct { + ValAttr ST_SystemColorVal + LastClrAttr *string + EG_ColorTransform []*EG_ColorTransform +} + +func NewCT_SystemColor() *CT_SystemColor { + ret := &CT_SystemColor{} + ret.ValAttr = ST_SystemColorVal(1) + return ret +} + +func (m *CT_SystemColor) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + if m.LastClrAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "lastClr"}, + Value: fmt.Sprintf("%v", *m.LastClrAttr)}) + } + e.EncodeToken(start) + if m.EG_ColorTransform != nil { + for _, c := range m.EG_ColorTransform { + c.MarshalXML(e, xml.StartElement{}) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SystemColor) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_SystemColorVal(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "lastClr" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.LastClrAttr = &parsed + continue + } + } +lCT_SystemColor: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "tint"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Tint = NewCT_PositiveFixedPercentage() + if err := d.DecodeElement(tmpcolortransform.Tint, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "shade"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Shade = NewCT_PositiveFixedPercentage() + if err := d.DecodeElement(tmpcolortransform.Shade, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "comp"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Comp = NewCT_ComplementTransform() + if err := d.DecodeElement(tmpcolortransform.Comp, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "inv"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Inv = NewCT_InverseTransform() + if err := d.DecodeElement(tmpcolortransform.Inv, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "gray"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Gray = NewCT_GrayscaleTransform() + if err := d.DecodeElement(tmpcolortransform.Gray, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alpha"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Alpha = NewCT_PositiveFixedPercentage() + if err := d.DecodeElement(tmpcolortransform.Alpha, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.AlphaOff = NewCT_FixedPercentage() + if err := d.DecodeElement(tmpcolortransform.AlphaOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.AlphaMod = NewCT_PositivePercentage() + if err := d.DecodeElement(tmpcolortransform.AlphaMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hue"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Hue = NewCT_PositiveFixedAngle() + if err := d.DecodeElement(tmpcolortransform.Hue, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hueOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.HueOff = NewCT_Angle() + if err := d.DecodeElement(tmpcolortransform.HueOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hueMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.HueMod = NewCT_PositivePercentage() + if err := d.DecodeElement(tmpcolortransform.HueMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "sat"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Sat = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.Sat, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "satOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.SatOff = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.SatOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "satMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.SatMod = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.SatMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lum"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Lum = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.Lum, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lumOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.LumOff = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.LumOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lumMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.LumMod = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.LumMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "red"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Red = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.Red, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "redOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.RedOff = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.RedOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "redMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.RedMod = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.RedMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "green"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Green = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.Green, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "greenOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.GreenOff = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.GreenOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "greenMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.GreenMod = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.GreenMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blue"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Blue = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.Blue, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blueOff"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.BlueOff = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.BlueOff, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blueMod"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.BlueMod = NewCT_Percentage() + if err := d.DecodeElement(tmpcolortransform.BlueMod, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "gamma"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.Gamma = NewCT_GammaTransform() + if err := d.DecodeElement(tmpcolortransform.Gamma, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "invGamma"}: + tmpcolortransform := NewEG_ColorTransform() + tmpcolortransform.InvGamma = NewCT_InverseGammaTransform() + if err := d.DecodeElement(tmpcolortransform.InvGamma, &el); err != nil { + return err + } + m.EG_ColorTransform = append(m.EG_ColorTransform, tmpcolortransform) + default: + gooxml.Log("skipping unsupported element on CT_SystemColor %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_SystemColor + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_SystemColor and its children +func (m *CT_SystemColor) Validate() error { + return m.ValidateWithPath("CT_SystemColor") +} + +// ValidateWithPath validates the CT_SystemColor and its children, prefixing error messages with path +func (m *CT_SystemColor) ValidateWithPath(path string) error { + if m.ValAttr == ST_SystemColorValUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + for i, v := range m.EG_ColorTransform { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_ColorTransform[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Table.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Table.go new file mode 100644 index 00000000..0216877f --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Table.go @@ -0,0 +1,111 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_Table struct { + TblPr *CT_TableProperties + TblGrid *CT_TableGrid + Tr []*CT_TableRow +} + +func NewCT_Table() *CT_Table { + ret := &CT_Table{} + ret.TblGrid = NewCT_TableGrid() + return ret +} + +func (m *CT_Table) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.TblPr != nil { + setblPr := xml.StartElement{Name: xml.Name{Local: "a:tblPr"}} + e.EncodeElement(m.TblPr, setblPr) + } + setblGrid := xml.StartElement{Name: xml.Name{Local: "a:tblGrid"}} + e.EncodeElement(m.TblGrid, setblGrid) + if m.Tr != nil { + setr := xml.StartElement{Name: xml.Name{Local: "a:tr"}} + for _, c := range m.Tr { + e.EncodeElement(c, setr) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Table) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.TblGrid = NewCT_TableGrid() +lCT_Table: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "tblPr"}: + m.TblPr = NewCT_TableProperties() + if err := d.DecodeElement(m.TblPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "tblGrid"}: + if err := d.DecodeElement(m.TblGrid, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "tr"}: + tmp := NewCT_TableRow() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Tr = append(m.Tr, tmp) + default: + gooxml.Log("skipping unsupported element on CT_Table %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Table + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Table and its children +func (m *CT_Table) Validate() error { + return m.ValidateWithPath("CT_Table") +} + +// ValidateWithPath validates the CT_Table and its children, prefixing error messages with path +func (m *CT_Table) ValidateWithPath(path string) error { + if m.TblPr != nil { + if err := m.TblPr.ValidateWithPath(path + "/TblPr"); err != nil { + return err + } + } + if err := m.TblGrid.ValidateWithPath(path + "/TblGrid"); err != nil { + return err + } + for i, v := range m.Tr { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Tr[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TableBackgroundStyle.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TableBackgroundStyle.go new file mode 100644 index 00000000..dd06e470 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TableBackgroundStyle.go @@ -0,0 +1,125 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_TableBackgroundStyle struct { + Fill *CT_FillProperties + FillRef *CT_StyleMatrixReference + Effect *CT_EffectProperties + EffectRef *CT_StyleMatrixReference +} + +func NewCT_TableBackgroundStyle() *CT_TableBackgroundStyle { + ret := &CT_TableBackgroundStyle{} + return ret +} + +func (m *CT_TableBackgroundStyle) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Fill != nil { + sefill := xml.StartElement{Name: xml.Name{Local: "a:fill"}} + e.EncodeElement(m.Fill, sefill) + } + if m.FillRef != nil { + sefillRef := xml.StartElement{Name: xml.Name{Local: "a:fillRef"}} + e.EncodeElement(m.FillRef, sefillRef) + } + if m.Effect != nil { + seeffect := xml.StartElement{Name: xml.Name{Local: "a:effect"}} + e.EncodeElement(m.Effect, seeffect) + } + if m.EffectRef != nil { + seeffectRef := xml.StartElement{Name: xml.Name{Local: "a:effectRef"}} + e.EncodeElement(m.EffectRef, seeffectRef) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TableBackgroundStyle) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_TableBackgroundStyle: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "fill"}: + m.Fill = NewCT_FillProperties() + if err := d.DecodeElement(m.Fill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "fillRef"}: + m.FillRef = NewCT_StyleMatrixReference() + if err := d.DecodeElement(m.FillRef, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "effect"}: + m.Effect = NewCT_EffectProperties() + if err := d.DecodeElement(m.Effect, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "effectRef"}: + m.EffectRef = NewCT_StyleMatrixReference() + if err := d.DecodeElement(m.EffectRef, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_TableBackgroundStyle %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TableBackgroundStyle + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TableBackgroundStyle and its children +func (m *CT_TableBackgroundStyle) Validate() error { + return m.ValidateWithPath("CT_TableBackgroundStyle") +} + +// ValidateWithPath validates the CT_TableBackgroundStyle and its children, prefixing error messages with path +func (m *CT_TableBackgroundStyle) ValidateWithPath(path string) error { + if m.Fill != nil { + if err := m.Fill.ValidateWithPath(path + "/Fill"); err != nil { + return err + } + } + if m.FillRef != nil { + if err := m.FillRef.ValidateWithPath(path + "/FillRef"); err != nil { + return err + } + } + if m.Effect != nil { + if err := m.Effect.ValidateWithPath(path + "/Effect"); err != nil { + return err + } + } + if m.EffectRef != nil { + if err := m.EffectRef.ValidateWithPath(path + "/EffectRef"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TableCell.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TableCell.go new file mode 100644 index 00000000..ad47f281 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TableCell.go @@ -0,0 +1,181 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type CT_TableCell struct { + RowSpanAttr *int32 + GridSpanAttr *int32 + HMergeAttr *bool + VMergeAttr *bool + IdAttr *string + TxBody *CT_TextBody + TcPr *CT_TableCellProperties + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_TableCell() *CT_TableCell { + ret := &CT_TableCell{} + return ret +} + +func (m *CT_TableCell) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.RowSpanAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "rowSpan"}, + Value: fmt.Sprintf("%v", *m.RowSpanAttr)}) + } + if m.GridSpanAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "gridSpan"}, + Value: fmt.Sprintf("%v", *m.GridSpanAttr)}) + } + if m.HMergeAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "hMerge"}, + Value: fmt.Sprintf("%d", b2i(*m.HMergeAttr))}) + } + if m.VMergeAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "vMerge"}, + Value: fmt.Sprintf("%d", b2i(*m.VMergeAttr))}) + } + if m.IdAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "id"}, + Value: fmt.Sprintf("%v", *m.IdAttr)}) + } + e.EncodeToken(start) + if m.TxBody != nil { + setxBody := xml.StartElement{Name: xml.Name{Local: "a:txBody"}} + e.EncodeElement(m.TxBody, setxBody) + } + if m.TcPr != nil { + setcPr := xml.StartElement{Name: xml.Name{Local: "a:tcPr"}} + e.EncodeElement(m.TcPr, setcPr) + } + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TableCell) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "rowSpan" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + pt := int32(parsed) + m.RowSpanAttr = &pt + continue + } + if attr.Name.Local == "gridSpan" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + pt := int32(parsed) + m.GridSpanAttr = &pt + continue + } + if attr.Name.Local == "hMerge" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.HMergeAttr = &parsed + continue + } + if attr.Name.Local == "vMerge" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.VMergeAttr = &parsed + continue + } + if attr.Name.Local == "id" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.IdAttr = &parsed + continue + } + } +lCT_TableCell: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "txBody"}: + m.TxBody = NewCT_TextBody() + if err := d.DecodeElement(m.TxBody, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "tcPr"}: + m.TcPr = NewCT_TableCellProperties() + if err := d.DecodeElement(m.TcPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_TableCell %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TableCell + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TableCell and its children +func (m *CT_TableCell) Validate() error { + return m.ValidateWithPath("CT_TableCell") +} + +// ValidateWithPath validates the CT_TableCell and its children, prefixing error messages with path +func (m *CT_TableCell) ValidateWithPath(path string) error { + if m.TxBody != nil { + if err := m.TxBody.ValidateWithPath(path + "/TxBody"); err != nil { + return err + } + } + if m.TcPr != nil { + if err := m.TcPr.ValidateWithPath(path + "/TcPr"); err != nil { + return err + } + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TableCellBorderStyle.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TableCellBorderStyle.go new file mode 100644 index 00000000..2be0c125 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TableCellBorderStyle.go @@ -0,0 +1,200 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_TableCellBorderStyle struct { + Left *CT_ThemeableLineStyle + Right *CT_ThemeableLineStyle + Top *CT_ThemeableLineStyle + Bottom *CT_ThemeableLineStyle + InsideH *CT_ThemeableLineStyle + InsideV *CT_ThemeableLineStyle + Tl2br *CT_ThemeableLineStyle + Tr2bl *CT_ThemeableLineStyle + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_TableCellBorderStyle() *CT_TableCellBorderStyle { + ret := &CT_TableCellBorderStyle{} + return ret +} + +func (m *CT_TableCellBorderStyle) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Left != nil { + seleft := xml.StartElement{Name: xml.Name{Local: "a:left"}} + e.EncodeElement(m.Left, seleft) + } + if m.Right != nil { + seright := xml.StartElement{Name: xml.Name{Local: "a:right"}} + e.EncodeElement(m.Right, seright) + } + if m.Top != nil { + setop := xml.StartElement{Name: xml.Name{Local: "a:top"}} + e.EncodeElement(m.Top, setop) + } + if m.Bottom != nil { + sebottom := xml.StartElement{Name: xml.Name{Local: "a:bottom"}} + e.EncodeElement(m.Bottom, sebottom) + } + if m.InsideH != nil { + seinsideH := xml.StartElement{Name: xml.Name{Local: "a:insideH"}} + e.EncodeElement(m.InsideH, seinsideH) + } + if m.InsideV != nil { + seinsideV := xml.StartElement{Name: xml.Name{Local: "a:insideV"}} + e.EncodeElement(m.InsideV, seinsideV) + } + if m.Tl2br != nil { + setl2br := xml.StartElement{Name: xml.Name{Local: "a:tl2br"}} + e.EncodeElement(m.Tl2br, setl2br) + } + if m.Tr2bl != nil { + setr2bl := xml.StartElement{Name: xml.Name{Local: "a:tr2bl"}} + e.EncodeElement(m.Tr2bl, setr2bl) + } + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TableCellBorderStyle) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_TableCellBorderStyle: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "left"}: + m.Left = NewCT_ThemeableLineStyle() + if err := d.DecodeElement(m.Left, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "right"}: + m.Right = NewCT_ThemeableLineStyle() + if err := d.DecodeElement(m.Right, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "top"}: + m.Top = NewCT_ThemeableLineStyle() + if err := d.DecodeElement(m.Top, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "bottom"}: + m.Bottom = NewCT_ThemeableLineStyle() + if err := d.DecodeElement(m.Bottom, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "insideH"}: + m.InsideH = NewCT_ThemeableLineStyle() + if err := d.DecodeElement(m.InsideH, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "insideV"}: + m.InsideV = NewCT_ThemeableLineStyle() + if err := d.DecodeElement(m.InsideV, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "tl2br"}: + m.Tl2br = NewCT_ThemeableLineStyle() + if err := d.DecodeElement(m.Tl2br, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "tr2bl"}: + m.Tr2bl = NewCT_ThemeableLineStyle() + if err := d.DecodeElement(m.Tr2bl, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_TableCellBorderStyle %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TableCellBorderStyle + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TableCellBorderStyle and its children +func (m *CT_TableCellBorderStyle) Validate() error { + return m.ValidateWithPath("CT_TableCellBorderStyle") +} + +// ValidateWithPath validates the CT_TableCellBorderStyle and its children, prefixing error messages with path +func (m *CT_TableCellBorderStyle) ValidateWithPath(path string) error { + if m.Left != nil { + if err := m.Left.ValidateWithPath(path + "/Left"); err != nil { + return err + } + } + if m.Right != nil { + if err := m.Right.ValidateWithPath(path + "/Right"); err != nil { + return err + } + } + if m.Top != nil { + if err := m.Top.ValidateWithPath(path + "/Top"); err != nil { + return err + } + } + if m.Bottom != nil { + if err := m.Bottom.ValidateWithPath(path + "/Bottom"); err != nil { + return err + } + } + if m.InsideH != nil { + if err := m.InsideH.ValidateWithPath(path + "/InsideH"); err != nil { + return err + } + } + if m.InsideV != nil { + if err := m.InsideV.ValidateWithPath(path + "/InsideV"); err != nil { + return err + } + } + if m.Tl2br != nil { + if err := m.Tl2br.ValidateWithPath(path + "/Tl2br"); err != nil { + return err + } + } + if m.Tr2bl != nil { + if err := m.Tr2bl.ValidateWithPath(path + "/Tr2bl"); err != nil { + return err + } + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TableCellProperties.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TableCellProperties.go new file mode 100644 index 00000000..b4cd9a29 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TableCellProperties.go @@ -0,0 +1,424 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type CT_TableCellProperties struct { + MarLAttr *ST_Coordinate32 + MarRAttr *ST_Coordinate32 + MarTAttr *ST_Coordinate32 + MarBAttr *ST_Coordinate32 + VertAttr ST_TextVerticalType + AnchorAttr ST_TextAnchoringType + AnchorCtrAttr *bool + HorzOverflowAttr ST_TextHorzOverflowType + LnL *CT_LineProperties + LnR *CT_LineProperties + LnT *CT_LineProperties + LnB *CT_LineProperties + LnTlToBr *CT_LineProperties + LnBlToTr *CT_LineProperties + Cell3D *CT_Cell3D + NoFill *CT_NoFillProperties + SolidFill *CT_SolidColorFillProperties + GradFill *CT_GradientFillProperties + BlipFill *CT_BlipFillProperties + PattFill *CT_PatternFillProperties + GrpFill *CT_GroupFillProperties + Headers *CT_Headers + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_TableCellProperties() *CT_TableCellProperties { + ret := &CT_TableCellProperties{} + return ret +} + +func (m *CT_TableCellProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.MarLAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "marL"}, + Value: fmt.Sprintf("%v", *m.MarLAttr)}) + } + if m.MarRAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "marR"}, + Value: fmt.Sprintf("%v", *m.MarRAttr)}) + } + if m.MarTAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "marT"}, + Value: fmt.Sprintf("%v", *m.MarTAttr)}) + } + if m.MarBAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "marB"}, + Value: fmt.Sprintf("%v", *m.MarBAttr)}) + } + if m.VertAttr != ST_TextVerticalTypeUnset { + attr, err := m.VertAttr.MarshalXMLAttr(xml.Name{Local: "vert"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.AnchorAttr != ST_TextAnchoringTypeUnset { + attr, err := m.AnchorAttr.MarshalXMLAttr(xml.Name{Local: "anchor"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.AnchorCtrAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "anchorCtr"}, + Value: fmt.Sprintf("%d", b2i(*m.AnchorCtrAttr))}) + } + if m.HorzOverflowAttr != ST_TextHorzOverflowTypeUnset { + attr, err := m.HorzOverflowAttr.MarshalXMLAttr(xml.Name{Local: "horzOverflow"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + if m.LnL != nil { + selnL := xml.StartElement{Name: xml.Name{Local: "a:lnL"}} + e.EncodeElement(m.LnL, selnL) + } + if m.LnR != nil { + selnR := xml.StartElement{Name: xml.Name{Local: "a:lnR"}} + e.EncodeElement(m.LnR, selnR) + } + if m.LnT != nil { + selnT := xml.StartElement{Name: xml.Name{Local: "a:lnT"}} + e.EncodeElement(m.LnT, selnT) + } + if m.LnB != nil { + selnB := xml.StartElement{Name: xml.Name{Local: "a:lnB"}} + e.EncodeElement(m.LnB, selnB) + } + if m.LnTlToBr != nil { + selnTlToBr := xml.StartElement{Name: xml.Name{Local: "a:lnTlToBr"}} + e.EncodeElement(m.LnTlToBr, selnTlToBr) + } + if m.LnBlToTr != nil { + selnBlToTr := xml.StartElement{Name: xml.Name{Local: "a:lnBlToTr"}} + e.EncodeElement(m.LnBlToTr, selnBlToTr) + } + if m.Cell3D != nil { + secell3D := xml.StartElement{Name: xml.Name{Local: "a:cell3D"}} + e.EncodeElement(m.Cell3D, secell3D) + } + if m.NoFill != nil { + senoFill := xml.StartElement{Name: xml.Name{Local: "a:noFill"}} + e.EncodeElement(m.NoFill, senoFill) + } + if m.SolidFill != nil { + sesolidFill := xml.StartElement{Name: xml.Name{Local: "a:solidFill"}} + e.EncodeElement(m.SolidFill, sesolidFill) + } + if m.GradFill != nil { + segradFill := xml.StartElement{Name: xml.Name{Local: "a:gradFill"}} + e.EncodeElement(m.GradFill, segradFill) + } + if m.BlipFill != nil { + seblipFill := xml.StartElement{Name: xml.Name{Local: "a:blipFill"}} + e.EncodeElement(m.BlipFill, seblipFill) + } + if m.PattFill != nil { + sepattFill := xml.StartElement{Name: xml.Name{Local: "a:pattFill"}} + e.EncodeElement(m.PattFill, sepattFill) + } + if m.GrpFill != nil { + segrpFill := xml.StartElement{Name: xml.Name{Local: "a:grpFill"}} + e.EncodeElement(m.GrpFill, segrpFill) + } + if m.Headers != nil { + seheaders := xml.StartElement{Name: xml.Name{Local: "a:headers"}} + e.EncodeElement(m.Headers, seheaders) + } + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TableCellProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "marR" { + parsed, err := ParseUnionST_Coordinate32(attr.Value) + if err != nil { + return err + } + m.MarRAttr = &parsed + continue + } + if attr.Name.Local == "marB" { + parsed, err := ParseUnionST_Coordinate32(attr.Value) + if err != nil { + return err + } + m.MarBAttr = &parsed + continue + } + if attr.Name.Local == "anchor" { + m.AnchorAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "horzOverflow" { + m.HorzOverflowAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "anchorCtr" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.AnchorCtrAttr = &parsed + continue + } + if attr.Name.Local == "vert" { + m.VertAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "marL" { + parsed, err := ParseUnionST_Coordinate32(attr.Value) + if err != nil { + return err + } + m.MarLAttr = &parsed + continue + } + if attr.Name.Local == "marT" { + parsed, err := ParseUnionST_Coordinate32(attr.Value) + if err != nil { + return err + } + m.MarTAttr = &parsed + continue + } + } +lCT_TableCellProperties: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lnL"}: + m.LnL = NewCT_LineProperties() + if err := d.DecodeElement(m.LnL, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lnR"}: + m.LnR = NewCT_LineProperties() + if err := d.DecodeElement(m.LnR, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lnT"}: + m.LnT = NewCT_LineProperties() + if err := d.DecodeElement(m.LnT, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lnB"}: + m.LnB = NewCT_LineProperties() + if err := d.DecodeElement(m.LnB, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lnTlToBr"}: + m.LnTlToBr = NewCT_LineProperties() + if err := d.DecodeElement(m.LnTlToBr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lnBlToTr"}: + m.LnBlToTr = NewCT_LineProperties() + if err := d.DecodeElement(m.LnBlToTr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "cell3D"}: + m.Cell3D = NewCT_Cell3D() + if err := d.DecodeElement(m.Cell3D, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "noFill"}: + m.NoFill = NewCT_NoFillProperties() + if err := d.DecodeElement(m.NoFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "solidFill"}: + m.SolidFill = NewCT_SolidColorFillProperties() + if err := d.DecodeElement(m.SolidFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "gradFill"}: + m.GradFill = NewCT_GradientFillProperties() + if err := d.DecodeElement(m.GradFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blipFill"}: + m.BlipFill = NewCT_BlipFillProperties() + if err := d.DecodeElement(m.BlipFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "pattFill"}: + m.PattFill = NewCT_PatternFillProperties() + if err := d.DecodeElement(m.PattFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "grpFill"}: + m.GrpFill = NewCT_GroupFillProperties() + if err := d.DecodeElement(m.GrpFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "headers"}: + m.Headers = NewCT_Headers() + if err := d.DecodeElement(m.Headers, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_TableCellProperties %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TableCellProperties + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TableCellProperties and its children +func (m *CT_TableCellProperties) Validate() error { + return m.ValidateWithPath("CT_TableCellProperties") +} + +// ValidateWithPath validates the CT_TableCellProperties and its children, prefixing error messages with path +func (m *CT_TableCellProperties) ValidateWithPath(path string) error { + if m.MarLAttr != nil { + if err := m.MarLAttr.ValidateWithPath(path + "/MarLAttr"); err != nil { + return err + } + } + if m.MarRAttr != nil { + if err := m.MarRAttr.ValidateWithPath(path + "/MarRAttr"); err != nil { + return err + } + } + if m.MarTAttr != nil { + if err := m.MarTAttr.ValidateWithPath(path + "/MarTAttr"); err != nil { + return err + } + } + if m.MarBAttr != nil { + if err := m.MarBAttr.ValidateWithPath(path + "/MarBAttr"); err != nil { + return err + } + } + if err := m.VertAttr.ValidateWithPath(path + "/VertAttr"); err != nil { + return err + } + if err := m.AnchorAttr.ValidateWithPath(path + "/AnchorAttr"); err != nil { + return err + } + if err := m.HorzOverflowAttr.ValidateWithPath(path + "/HorzOverflowAttr"); err != nil { + return err + } + if m.LnL != nil { + if err := m.LnL.ValidateWithPath(path + "/LnL"); err != nil { + return err + } + } + if m.LnR != nil { + if err := m.LnR.ValidateWithPath(path + "/LnR"); err != nil { + return err + } + } + if m.LnT != nil { + if err := m.LnT.ValidateWithPath(path + "/LnT"); err != nil { + return err + } + } + if m.LnB != nil { + if err := m.LnB.ValidateWithPath(path + "/LnB"); err != nil { + return err + } + } + if m.LnTlToBr != nil { + if err := m.LnTlToBr.ValidateWithPath(path + "/LnTlToBr"); err != nil { + return err + } + } + if m.LnBlToTr != nil { + if err := m.LnBlToTr.ValidateWithPath(path + "/LnBlToTr"); err != nil { + return err + } + } + if m.Cell3D != nil { + if err := m.Cell3D.ValidateWithPath(path + "/Cell3D"); err != nil { + return err + } + } + if m.NoFill != nil { + if err := m.NoFill.ValidateWithPath(path + "/NoFill"); err != nil { + return err + } + } + if m.SolidFill != nil { + if err := m.SolidFill.ValidateWithPath(path + "/SolidFill"); err != nil { + return err + } + } + if m.GradFill != nil { + if err := m.GradFill.ValidateWithPath(path + "/GradFill"); err != nil { + return err + } + } + if m.BlipFill != nil { + if err := m.BlipFill.ValidateWithPath(path + "/BlipFill"); err != nil { + return err + } + } + if m.PattFill != nil { + if err := m.PattFill.ValidateWithPath(path + "/PattFill"); err != nil { + return err + } + } + if m.GrpFill != nil { + if err := m.GrpFill.ValidateWithPath(path + "/GrpFill"); err != nil { + return err + } + } + if m.Headers != nil { + if err := m.Headers.ValidateWithPath(path + "/Headers"); err != nil { + return err + } + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TableCol.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TableCol.go new file mode 100644 index 00000000..ac50eff2 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TableCol.go @@ -0,0 +1,97 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_TableCol struct { + WAttr ST_Coordinate + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_TableCol() *CT_TableCol { + ret := &CT_TableCol{} + return ret +} + +func (m *CT_TableCol) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w"}, + Value: fmt.Sprintf("%v", m.WAttr)}) + e.EncodeToken(start) + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TableCol) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "w" { + parsed, err := ParseUnionST_Coordinate(attr.Value) + if err != nil { + return err + } + m.WAttr = parsed + continue + } + } +lCT_TableCol: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_TableCol %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TableCol + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TableCol and its children +func (m *CT_TableCol) Validate() error { + return m.ValidateWithPath("CT_TableCol") +} + +// ValidateWithPath validates the CT_TableCol and its children, prefixing error messages with path +func (m *CT_TableCol) ValidateWithPath(path string) error { + if err := m.WAttr.ValidateWithPath(path + "/WAttr"); err != nil { + return err + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TableGrid.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TableGrid.go new file mode 100644 index 00000000..eb7c2a59 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TableGrid.go @@ -0,0 +1,84 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_TableGrid struct { + GridCol []*CT_TableCol +} + +func NewCT_TableGrid() *CT_TableGrid { + ret := &CT_TableGrid{} + return ret +} + +func (m *CT_TableGrid) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.GridCol != nil { + segridCol := xml.StartElement{Name: xml.Name{Local: "a:gridCol"}} + for _, c := range m.GridCol { + e.EncodeElement(c, segridCol) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TableGrid) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_TableGrid: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "gridCol"}: + tmp := NewCT_TableCol() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.GridCol = append(m.GridCol, tmp) + default: + gooxml.Log("skipping unsupported element on CT_TableGrid %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TableGrid + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TableGrid and its children +func (m *CT_TableGrid) Validate() error { + return m.ValidateWithPath("CT_TableGrid") +} + +// ValidateWithPath validates the CT_TableGrid and its children, prefixing error messages with path +func (m *CT_TableGrid) ValidateWithPath(path string) error { + for i, v := range m.GridCol { + if err := v.ValidateWithPath(fmt.Sprintf("%s/GridCol[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TablePartStyle.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TablePartStyle.go new file mode 100644 index 00000000..a067958e --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TablePartStyle.go @@ -0,0 +1,95 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_TablePartStyle struct { + TcTxStyle *CT_TableStyleTextStyle + TcStyle *CT_TableStyleCellStyle +} + +func NewCT_TablePartStyle() *CT_TablePartStyle { + ret := &CT_TablePartStyle{} + return ret +} + +func (m *CT_TablePartStyle) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.TcTxStyle != nil { + setcTxStyle := xml.StartElement{Name: xml.Name{Local: "a:tcTxStyle"}} + e.EncodeElement(m.TcTxStyle, setcTxStyle) + } + if m.TcStyle != nil { + setcStyle := xml.StartElement{Name: xml.Name{Local: "a:tcStyle"}} + e.EncodeElement(m.TcStyle, setcStyle) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TablePartStyle) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_TablePartStyle: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "tcTxStyle"}: + m.TcTxStyle = NewCT_TableStyleTextStyle() + if err := d.DecodeElement(m.TcTxStyle, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "tcStyle"}: + m.TcStyle = NewCT_TableStyleCellStyle() + if err := d.DecodeElement(m.TcStyle, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_TablePartStyle %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TablePartStyle + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TablePartStyle and its children +func (m *CT_TablePartStyle) Validate() error { + return m.ValidateWithPath("CT_TablePartStyle") +} + +// ValidateWithPath validates the CT_TablePartStyle and its children, prefixing error messages with path +func (m *CT_TablePartStyle) ValidateWithPath(path string) error { + if m.TcTxStyle != nil { + if err := m.TcTxStyle.ValidateWithPath(path + "/TcTxStyle"); err != nil { + return err + } + } + if m.TcStyle != nil { + if err := m.TcStyle.ValidateWithPath(path + "/TcStyle"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TableProperties.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TableProperties.go new file mode 100644 index 00000000..078a1f10 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TableProperties.go @@ -0,0 +1,314 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type CT_TableProperties struct { + RtlAttr *bool + FirstRowAttr *bool + FirstColAttr *bool + LastRowAttr *bool + LastColAttr *bool + BandRowAttr *bool + BandColAttr *bool + NoFill *CT_NoFillProperties + SolidFill *CT_SolidColorFillProperties + GradFill *CT_GradientFillProperties + BlipFill *CT_BlipFillProperties + PattFill *CT_PatternFillProperties + GrpFill *CT_GroupFillProperties + EffectLst *CT_EffectList + EffectDag *CT_EffectContainer + Choice *CT_TablePropertiesChoice + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_TableProperties() *CT_TableProperties { + ret := &CT_TableProperties{} + return ret +} + +func (m *CT_TableProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.RtlAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "rtl"}, + Value: fmt.Sprintf("%d", b2i(*m.RtlAttr))}) + } + if m.FirstRowAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "firstRow"}, + Value: fmt.Sprintf("%d", b2i(*m.FirstRowAttr))}) + } + if m.FirstColAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "firstCol"}, + Value: fmt.Sprintf("%d", b2i(*m.FirstColAttr))}) + } + if m.LastRowAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "lastRow"}, + Value: fmt.Sprintf("%d", b2i(*m.LastRowAttr))}) + } + if m.LastColAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "lastCol"}, + Value: fmt.Sprintf("%d", b2i(*m.LastColAttr))}) + } + if m.BandRowAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "bandRow"}, + Value: fmt.Sprintf("%d", b2i(*m.BandRowAttr))}) + } + if m.BandColAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "bandCol"}, + Value: fmt.Sprintf("%d", b2i(*m.BandColAttr))}) + } + e.EncodeToken(start) + if m.NoFill != nil { + senoFill := xml.StartElement{Name: xml.Name{Local: "a:noFill"}} + e.EncodeElement(m.NoFill, senoFill) + } + if m.SolidFill != nil { + sesolidFill := xml.StartElement{Name: xml.Name{Local: "a:solidFill"}} + e.EncodeElement(m.SolidFill, sesolidFill) + } + if m.GradFill != nil { + segradFill := xml.StartElement{Name: xml.Name{Local: "a:gradFill"}} + e.EncodeElement(m.GradFill, segradFill) + } + if m.BlipFill != nil { + seblipFill := xml.StartElement{Name: xml.Name{Local: "a:blipFill"}} + e.EncodeElement(m.BlipFill, seblipFill) + } + if m.PattFill != nil { + sepattFill := xml.StartElement{Name: xml.Name{Local: "a:pattFill"}} + e.EncodeElement(m.PattFill, sepattFill) + } + if m.GrpFill != nil { + segrpFill := xml.StartElement{Name: xml.Name{Local: "a:grpFill"}} + e.EncodeElement(m.GrpFill, segrpFill) + } + if m.EffectLst != nil { + seeffectLst := xml.StartElement{Name: xml.Name{Local: "a:effectLst"}} + e.EncodeElement(m.EffectLst, seeffectLst) + } + if m.EffectDag != nil { + seeffectDag := xml.StartElement{Name: xml.Name{Local: "a:effectDag"}} + e.EncodeElement(m.EffectDag, seeffectDag) + } + if m.Choice != nil { + m.Choice.MarshalXML(e, xml.StartElement{}) + } + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TableProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "firstRow" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.FirstRowAttr = &parsed + continue + } + if attr.Name.Local == "lastRow" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.LastRowAttr = &parsed + continue + } + if attr.Name.Local == "bandRow" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.BandRowAttr = &parsed + continue + } + if attr.Name.Local == "bandCol" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.BandColAttr = &parsed + continue + } + if attr.Name.Local == "rtl" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.RtlAttr = &parsed + continue + } + if attr.Name.Local == "firstCol" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.FirstColAttr = &parsed + continue + } + if attr.Name.Local == "lastCol" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.LastColAttr = &parsed + continue + } + } +lCT_TableProperties: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "noFill"}: + m.NoFill = NewCT_NoFillProperties() + if err := d.DecodeElement(m.NoFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "solidFill"}: + m.SolidFill = NewCT_SolidColorFillProperties() + if err := d.DecodeElement(m.SolidFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "gradFill"}: + m.GradFill = NewCT_GradientFillProperties() + if err := d.DecodeElement(m.GradFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blipFill"}: + m.BlipFill = NewCT_BlipFillProperties() + if err := d.DecodeElement(m.BlipFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "pattFill"}: + m.PattFill = NewCT_PatternFillProperties() + if err := d.DecodeElement(m.PattFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "grpFill"}: + m.GrpFill = NewCT_GroupFillProperties() + if err := d.DecodeElement(m.GrpFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "effectLst"}: + m.EffectLst = NewCT_EffectList() + if err := d.DecodeElement(m.EffectLst, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "effectDag"}: + m.EffectDag = NewCT_EffectContainer() + if err := d.DecodeElement(m.EffectDag, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "tableStyle"}: + m.Choice = NewCT_TablePropertiesChoice() + if err := d.DecodeElement(&m.Choice.TableStyle, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "tableStyleId"}: + m.Choice = NewCT_TablePropertiesChoice() + if err := d.DecodeElement(&m.Choice.TableStyleId, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_TableProperties %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TableProperties + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TableProperties and its children +func (m *CT_TableProperties) Validate() error { + return m.ValidateWithPath("CT_TableProperties") +} + +// ValidateWithPath validates the CT_TableProperties and its children, prefixing error messages with path +func (m *CT_TableProperties) ValidateWithPath(path string) error { + if m.NoFill != nil { + if err := m.NoFill.ValidateWithPath(path + "/NoFill"); err != nil { + return err + } + } + if m.SolidFill != nil { + if err := m.SolidFill.ValidateWithPath(path + "/SolidFill"); err != nil { + return err + } + } + if m.GradFill != nil { + if err := m.GradFill.ValidateWithPath(path + "/GradFill"); err != nil { + return err + } + } + if m.BlipFill != nil { + if err := m.BlipFill.ValidateWithPath(path + "/BlipFill"); err != nil { + return err + } + } + if m.PattFill != nil { + if err := m.PattFill.ValidateWithPath(path + "/PattFill"); err != nil { + return err + } + } + if m.GrpFill != nil { + if err := m.GrpFill.ValidateWithPath(path + "/GrpFill"); err != nil { + return err + } + } + if m.EffectLst != nil { + if err := m.EffectLst.ValidateWithPath(path + "/EffectLst"); err != nil { + return err + } + } + if m.EffectDag != nil { + if err := m.EffectDag.ValidateWithPath(path + "/EffectDag"); err != nil { + return err + } + } + if m.Choice != nil { + if err := m.Choice.ValidateWithPath(path + "/Choice"); err != nil { + return err + } + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TablePropertiesChoice.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TablePropertiesChoice.go new file mode 100644 index 00000000..2e1e0340 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TablePropertiesChoice.go @@ -0,0 +1,96 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_TablePropertiesChoice struct { + TableStyle *CT_TableStyle + TableStyleId *string +} + +func NewCT_TablePropertiesChoice() *CT_TablePropertiesChoice { + ret := &CT_TablePropertiesChoice{} + return ret +} + +func (m *CT_TablePropertiesChoice) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.TableStyle != nil { + setableStyle := xml.StartElement{Name: xml.Name{Local: "a:tableStyle"}} + e.EncodeElement(m.TableStyle, setableStyle) + } + if m.TableStyleId != nil { + setableStyleId := xml.StartElement{Name: xml.Name{Local: "a:tableStyleId"}} + gooxml.AddPreserveSpaceAttr(&setableStyleId, *m.TableStyleId) + e.EncodeElement(m.TableStyleId, setableStyleId) + } + return nil +} + +func (m *CT_TablePropertiesChoice) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_TablePropertiesChoice: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "tableStyle"}: + m.TableStyle = NewCT_TableStyle() + if err := d.DecodeElement(m.TableStyle, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "tableStyleId"}: + m.TableStyleId = new(string) + if err := d.DecodeElement(m.TableStyleId, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_TablePropertiesChoice %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TablePropertiesChoice + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TablePropertiesChoice and its children +func (m *CT_TablePropertiesChoice) Validate() error { + return m.ValidateWithPath("CT_TablePropertiesChoice") +} + +// ValidateWithPath validates the CT_TablePropertiesChoice and its children, prefixing error messages with path +func (m *CT_TablePropertiesChoice) ValidateWithPath(path string) error { + if m.TableStyle != nil { + if err := m.TableStyle.ValidateWithPath(path + "/TableStyle"); err != nil { + return err + } + } + if m.TableStyleId != nil { + if !sharedTypes.ST_GuidPatternRe.MatchString(*m.TableStyleId) { + return fmt.Errorf(`%s/m.TableStyleId must match '%s' (have %v)`, path, sharedTypes.ST_GuidPatternRe, *m.TableStyleId) + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TableRow.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TableRow.go new file mode 100644 index 00000000..83795b07 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TableRow.go @@ -0,0 +1,115 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_TableRow struct { + HAttr ST_Coordinate + Tc []*CT_TableCell + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_TableRow() *CT_TableRow { + ret := &CT_TableRow{} + return ret +} + +func (m *CT_TableRow) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "h"}, + Value: fmt.Sprintf("%v", m.HAttr)}) + e.EncodeToken(start) + if m.Tc != nil { + setc := xml.StartElement{Name: xml.Name{Local: "a:tc"}} + for _, c := range m.Tc { + e.EncodeElement(c, setc) + } + } + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TableRow) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "h" { + parsed, err := ParseUnionST_Coordinate(attr.Value) + if err != nil { + return err + } + m.HAttr = parsed + continue + } + } +lCT_TableRow: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "tc"}: + tmp := NewCT_TableCell() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Tc = append(m.Tc, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_TableRow %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TableRow + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TableRow and its children +func (m *CT_TableRow) Validate() error { + return m.ValidateWithPath("CT_TableRow") +} + +// ValidateWithPath validates the CT_TableRow and its children, prefixing error messages with path +func (m *CT_TableRow) ValidateWithPath(path string) error { + if err := m.HAttr.ValidateWithPath(path + "/HAttr"); err != nil { + return err + } + for i, v := range m.Tc { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Tc[%d]", path, i)); err != nil { + return err + } + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TableStyle.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TableStyle.go new file mode 100644 index 00000000..9c9379d2 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TableStyle.go @@ -0,0 +1,321 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_TableStyle struct { + StyleIdAttr string + StyleNameAttr string + TblBg *CT_TableBackgroundStyle + WholeTbl *CT_TablePartStyle + Band1H *CT_TablePartStyle + Band2H *CT_TablePartStyle + Band1V *CT_TablePartStyle + Band2V *CT_TablePartStyle + LastCol *CT_TablePartStyle + FirstCol *CT_TablePartStyle + LastRow *CT_TablePartStyle + SeCell *CT_TablePartStyle + SwCell *CT_TablePartStyle + FirstRow *CT_TablePartStyle + NeCell *CT_TablePartStyle + NwCell *CT_TablePartStyle + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_TableStyle() *CT_TableStyle { + ret := &CT_TableStyle{} + ret.StyleIdAttr = "{00000000-0000-0000-0000-000000000000}" + return ret +} + +func (m *CT_TableStyle) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "styleId"}, + Value: fmt.Sprintf("%v", m.StyleIdAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "styleName"}, + Value: fmt.Sprintf("%v", m.StyleNameAttr)}) + e.EncodeToken(start) + if m.TblBg != nil { + setblBg := xml.StartElement{Name: xml.Name{Local: "a:tblBg"}} + e.EncodeElement(m.TblBg, setblBg) + } + if m.WholeTbl != nil { + sewholeTbl := xml.StartElement{Name: xml.Name{Local: "a:wholeTbl"}} + e.EncodeElement(m.WholeTbl, sewholeTbl) + } + if m.Band1H != nil { + seband1H := xml.StartElement{Name: xml.Name{Local: "a:band1H"}} + e.EncodeElement(m.Band1H, seband1H) + } + if m.Band2H != nil { + seband2H := xml.StartElement{Name: xml.Name{Local: "a:band2H"}} + e.EncodeElement(m.Band2H, seband2H) + } + if m.Band1V != nil { + seband1V := xml.StartElement{Name: xml.Name{Local: "a:band1V"}} + e.EncodeElement(m.Band1V, seband1V) + } + if m.Band2V != nil { + seband2V := xml.StartElement{Name: xml.Name{Local: "a:band2V"}} + e.EncodeElement(m.Band2V, seband2V) + } + if m.LastCol != nil { + selastCol := xml.StartElement{Name: xml.Name{Local: "a:lastCol"}} + e.EncodeElement(m.LastCol, selastCol) + } + if m.FirstCol != nil { + sefirstCol := xml.StartElement{Name: xml.Name{Local: "a:firstCol"}} + e.EncodeElement(m.FirstCol, sefirstCol) + } + if m.LastRow != nil { + selastRow := xml.StartElement{Name: xml.Name{Local: "a:lastRow"}} + e.EncodeElement(m.LastRow, selastRow) + } + if m.SeCell != nil { + seseCell := xml.StartElement{Name: xml.Name{Local: "a:seCell"}} + e.EncodeElement(m.SeCell, seseCell) + } + if m.SwCell != nil { + seswCell := xml.StartElement{Name: xml.Name{Local: "a:swCell"}} + e.EncodeElement(m.SwCell, seswCell) + } + if m.FirstRow != nil { + sefirstRow := xml.StartElement{Name: xml.Name{Local: "a:firstRow"}} + e.EncodeElement(m.FirstRow, sefirstRow) + } + if m.NeCell != nil { + seneCell := xml.StartElement{Name: xml.Name{Local: "a:neCell"}} + e.EncodeElement(m.NeCell, seneCell) + } + if m.NwCell != nil { + senwCell := xml.StartElement{Name: xml.Name{Local: "a:nwCell"}} + e.EncodeElement(m.NwCell, senwCell) + } + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TableStyle) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.StyleIdAttr = "{00000000-0000-0000-0000-000000000000}" + for _, attr := range start.Attr { + if attr.Name.Local == "styleName" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.StyleNameAttr = parsed + continue + } + if attr.Name.Local == "styleId" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.StyleIdAttr = parsed + continue + } + } +lCT_TableStyle: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "tblBg"}: + m.TblBg = NewCT_TableBackgroundStyle() + if err := d.DecodeElement(m.TblBg, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "wholeTbl"}: + m.WholeTbl = NewCT_TablePartStyle() + if err := d.DecodeElement(m.WholeTbl, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "band1H"}: + m.Band1H = NewCT_TablePartStyle() + if err := d.DecodeElement(m.Band1H, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "band2H"}: + m.Band2H = NewCT_TablePartStyle() + if err := d.DecodeElement(m.Band2H, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "band1V"}: + m.Band1V = NewCT_TablePartStyle() + if err := d.DecodeElement(m.Band1V, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "band2V"}: + m.Band2V = NewCT_TablePartStyle() + if err := d.DecodeElement(m.Band2V, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lastCol"}: + m.LastCol = NewCT_TablePartStyle() + if err := d.DecodeElement(m.LastCol, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "firstCol"}: + m.FirstCol = NewCT_TablePartStyle() + if err := d.DecodeElement(m.FirstCol, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lastRow"}: + m.LastRow = NewCT_TablePartStyle() + if err := d.DecodeElement(m.LastRow, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "seCell"}: + m.SeCell = NewCT_TablePartStyle() + if err := d.DecodeElement(m.SeCell, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "swCell"}: + m.SwCell = NewCT_TablePartStyle() + if err := d.DecodeElement(m.SwCell, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "firstRow"}: + m.FirstRow = NewCT_TablePartStyle() + if err := d.DecodeElement(m.FirstRow, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "neCell"}: + m.NeCell = NewCT_TablePartStyle() + if err := d.DecodeElement(m.NeCell, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "nwCell"}: + m.NwCell = NewCT_TablePartStyle() + if err := d.DecodeElement(m.NwCell, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_TableStyle %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TableStyle + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TableStyle and its children +func (m *CT_TableStyle) Validate() error { + return m.ValidateWithPath("CT_TableStyle") +} + +// ValidateWithPath validates the CT_TableStyle and its children, prefixing error messages with path +func (m *CT_TableStyle) ValidateWithPath(path string) error { + if !sharedTypes.ST_GuidPatternRe.MatchString(m.StyleIdAttr) { + return fmt.Errorf(`%s/m.StyleIdAttr must match '%s' (have %v)`, path, sharedTypes.ST_GuidPatternRe, m.StyleIdAttr) + } + if m.TblBg != nil { + if err := m.TblBg.ValidateWithPath(path + "/TblBg"); err != nil { + return err + } + } + if m.WholeTbl != nil { + if err := m.WholeTbl.ValidateWithPath(path + "/WholeTbl"); err != nil { + return err + } + } + if m.Band1H != nil { + if err := m.Band1H.ValidateWithPath(path + "/Band1H"); err != nil { + return err + } + } + if m.Band2H != nil { + if err := m.Band2H.ValidateWithPath(path + "/Band2H"); err != nil { + return err + } + } + if m.Band1V != nil { + if err := m.Band1V.ValidateWithPath(path + "/Band1V"); err != nil { + return err + } + } + if m.Band2V != nil { + if err := m.Band2V.ValidateWithPath(path + "/Band2V"); err != nil { + return err + } + } + if m.LastCol != nil { + if err := m.LastCol.ValidateWithPath(path + "/LastCol"); err != nil { + return err + } + } + if m.FirstCol != nil { + if err := m.FirstCol.ValidateWithPath(path + "/FirstCol"); err != nil { + return err + } + } + if m.LastRow != nil { + if err := m.LastRow.ValidateWithPath(path + "/LastRow"); err != nil { + return err + } + } + if m.SeCell != nil { + if err := m.SeCell.ValidateWithPath(path + "/SeCell"); err != nil { + return err + } + } + if m.SwCell != nil { + if err := m.SwCell.ValidateWithPath(path + "/SwCell"); err != nil { + return err + } + } + if m.FirstRow != nil { + if err := m.FirstRow.ValidateWithPath(path + "/FirstRow"); err != nil { + return err + } + } + if m.NeCell != nil { + if err := m.NeCell.ValidateWithPath(path + "/NeCell"); err != nil { + return err + } + } + if m.NwCell != nil { + if err := m.NwCell.ValidateWithPath(path + "/NwCell"); err != nil { + return err + } + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TableStyleCellStyle.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TableStyleCellStyle.go new file mode 100644 index 00000000..4268640d --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TableStyleCellStyle.go @@ -0,0 +1,125 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_TableStyleCellStyle struct { + TcBdr *CT_TableCellBorderStyle + Fill *CT_FillProperties + FillRef *CT_StyleMatrixReference + Cell3D *CT_Cell3D +} + +func NewCT_TableStyleCellStyle() *CT_TableStyleCellStyle { + ret := &CT_TableStyleCellStyle{} + return ret +} + +func (m *CT_TableStyleCellStyle) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.TcBdr != nil { + setcBdr := xml.StartElement{Name: xml.Name{Local: "a:tcBdr"}} + e.EncodeElement(m.TcBdr, setcBdr) + } + if m.Fill != nil { + sefill := xml.StartElement{Name: xml.Name{Local: "a:fill"}} + e.EncodeElement(m.Fill, sefill) + } + if m.FillRef != nil { + sefillRef := xml.StartElement{Name: xml.Name{Local: "a:fillRef"}} + e.EncodeElement(m.FillRef, sefillRef) + } + if m.Cell3D != nil { + secell3D := xml.StartElement{Name: xml.Name{Local: "a:cell3D"}} + e.EncodeElement(m.Cell3D, secell3D) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TableStyleCellStyle) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_TableStyleCellStyle: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "tcBdr"}: + m.TcBdr = NewCT_TableCellBorderStyle() + if err := d.DecodeElement(m.TcBdr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "fill"}: + m.Fill = NewCT_FillProperties() + if err := d.DecodeElement(m.Fill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "fillRef"}: + m.FillRef = NewCT_StyleMatrixReference() + if err := d.DecodeElement(m.FillRef, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "cell3D"}: + m.Cell3D = NewCT_Cell3D() + if err := d.DecodeElement(m.Cell3D, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_TableStyleCellStyle %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TableStyleCellStyle + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TableStyleCellStyle and its children +func (m *CT_TableStyleCellStyle) Validate() error { + return m.ValidateWithPath("CT_TableStyleCellStyle") +} + +// ValidateWithPath validates the CT_TableStyleCellStyle and its children, prefixing error messages with path +func (m *CT_TableStyleCellStyle) ValidateWithPath(path string) error { + if m.TcBdr != nil { + if err := m.TcBdr.ValidateWithPath(path + "/TcBdr"); err != nil { + return err + } + } + if m.Fill != nil { + if err := m.Fill.ValidateWithPath(path + "/Fill"); err != nil { + return err + } + } + if m.FillRef != nil { + if err := m.FillRef.ValidateWithPath(path + "/FillRef"); err != nil { + return err + } + } + if m.Cell3D != nil { + if err := m.Cell3D.ValidateWithPath(path + "/Cell3D"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TableStyleList.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TableStyleList.go new file mode 100644 index 00000000..2f6db6ec --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TableStyleList.go @@ -0,0 +1,103 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_TableStyleList struct { + DefAttr string + TblStyle []*CT_TableStyle +} + +func NewCT_TableStyleList() *CT_TableStyleList { + ret := &CT_TableStyleList{} + ret.DefAttr = "{00000000-0000-0000-0000-000000000000}" + return ret +} + +func (m *CT_TableStyleList) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "def"}, + Value: fmt.Sprintf("%v", m.DefAttr)}) + e.EncodeToken(start) + if m.TblStyle != nil { + setblStyle := xml.StartElement{Name: xml.Name{Local: "a:tblStyle"}} + for _, c := range m.TblStyle { + e.EncodeElement(c, setblStyle) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TableStyleList) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.DefAttr = "{00000000-0000-0000-0000-000000000000}" + for _, attr := range start.Attr { + if attr.Name.Local == "def" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.DefAttr = parsed + continue + } + } +lCT_TableStyleList: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "tblStyle"}: + tmp := NewCT_TableStyle() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.TblStyle = append(m.TblStyle, tmp) + default: + gooxml.Log("skipping unsupported element on CT_TableStyleList %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TableStyleList + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TableStyleList and its children +func (m *CT_TableStyleList) Validate() error { + return m.ValidateWithPath("CT_TableStyleList") +} + +// ValidateWithPath validates the CT_TableStyleList and its children, prefixing error messages with path +func (m *CT_TableStyleList) ValidateWithPath(path string) error { + if !sharedTypes.ST_GuidPatternRe.MatchString(m.DefAttr) { + return fmt.Errorf(`%s/m.DefAttr must match '%s' (have %v)`, path, sharedTypes.ST_GuidPatternRe, m.DefAttr) + } + for i, v := range m.TblStyle { + if err := v.ValidateWithPath(fmt.Sprintf("%s/TblStyle[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TableStyleTextStyle.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TableStyleTextStyle.go new file mode 100644 index 00000000..8dc900a7 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TableStyleTextStyle.go @@ -0,0 +1,232 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_TableStyleTextStyle struct { + BAttr ST_OnOffStyleType + IAttr ST_OnOffStyleType + Font *CT_FontCollection + FontRef *CT_FontReference + ScrgbClr *CT_ScRgbColor + SrgbClr *CT_SRgbColor + HslClr *CT_HslColor + SysClr *CT_SystemColor + SchemeClr *CT_SchemeColor + PrstClr *CT_PresetColor + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_TableStyleTextStyle() *CT_TableStyleTextStyle { + ret := &CT_TableStyleTextStyle{} + return ret +} + +func (m *CT_TableStyleTextStyle) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.BAttr != ST_OnOffStyleTypeUnset { + attr, err := m.BAttr.MarshalXMLAttr(xml.Name{Local: "b"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.IAttr != ST_OnOffStyleTypeUnset { + attr, err := m.IAttr.MarshalXMLAttr(xml.Name{Local: "i"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + if m.Font != nil { + sefont := xml.StartElement{Name: xml.Name{Local: "a:font"}} + e.EncodeElement(m.Font, sefont) + } + if m.FontRef != nil { + sefontRef := xml.StartElement{Name: xml.Name{Local: "a:fontRef"}} + e.EncodeElement(m.FontRef, sefontRef) + } + if m.ScrgbClr != nil { + sescrgbClr := xml.StartElement{Name: xml.Name{Local: "a:scrgbClr"}} + e.EncodeElement(m.ScrgbClr, sescrgbClr) + } + if m.SrgbClr != nil { + sesrgbClr := xml.StartElement{Name: xml.Name{Local: "a:srgbClr"}} + e.EncodeElement(m.SrgbClr, sesrgbClr) + } + if m.HslClr != nil { + sehslClr := xml.StartElement{Name: xml.Name{Local: "a:hslClr"}} + e.EncodeElement(m.HslClr, sehslClr) + } + if m.SysClr != nil { + sesysClr := xml.StartElement{Name: xml.Name{Local: "a:sysClr"}} + e.EncodeElement(m.SysClr, sesysClr) + } + if m.SchemeClr != nil { + seschemeClr := xml.StartElement{Name: xml.Name{Local: "a:schemeClr"}} + e.EncodeElement(m.SchemeClr, seschemeClr) + } + if m.PrstClr != nil { + seprstClr := xml.StartElement{Name: xml.Name{Local: "a:prstClr"}} + e.EncodeElement(m.PrstClr, seprstClr) + } + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TableStyleTextStyle) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "b" { + m.BAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "i" { + m.IAttr.UnmarshalXMLAttr(attr) + continue + } + } +lCT_TableStyleTextStyle: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "font"}: + m.Font = NewCT_FontCollection() + if err := d.DecodeElement(m.Font, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "fontRef"}: + m.FontRef = NewCT_FontReference() + if err := d.DecodeElement(m.FontRef, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "scrgbClr"}: + m.ScrgbClr = NewCT_ScRgbColor() + if err := d.DecodeElement(m.ScrgbClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "srgbClr"}: + m.SrgbClr = NewCT_SRgbColor() + if err := d.DecodeElement(m.SrgbClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hslClr"}: + m.HslClr = NewCT_HslColor() + if err := d.DecodeElement(m.HslClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "sysClr"}: + m.SysClr = NewCT_SystemColor() + if err := d.DecodeElement(m.SysClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "schemeClr"}: + m.SchemeClr = NewCT_SchemeColor() + if err := d.DecodeElement(m.SchemeClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "prstClr"}: + m.PrstClr = NewCT_PresetColor() + if err := d.DecodeElement(m.PrstClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_TableStyleTextStyle %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TableStyleTextStyle + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TableStyleTextStyle and its children +func (m *CT_TableStyleTextStyle) Validate() error { + return m.ValidateWithPath("CT_TableStyleTextStyle") +} + +// ValidateWithPath validates the CT_TableStyleTextStyle and its children, prefixing error messages with path +func (m *CT_TableStyleTextStyle) ValidateWithPath(path string) error { + if err := m.BAttr.ValidateWithPath(path + "/BAttr"); err != nil { + return err + } + if err := m.IAttr.ValidateWithPath(path + "/IAttr"); err != nil { + return err + } + if m.Font != nil { + if err := m.Font.ValidateWithPath(path + "/Font"); err != nil { + return err + } + } + if m.FontRef != nil { + if err := m.FontRef.ValidateWithPath(path + "/FontRef"); err != nil { + return err + } + } + if m.ScrgbClr != nil { + if err := m.ScrgbClr.ValidateWithPath(path + "/ScrgbClr"); err != nil { + return err + } + } + if m.SrgbClr != nil { + if err := m.SrgbClr.ValidateWithPath(path + "/SrgbClr"); err != nil { + return err + } + } + if m.HslClr != nil { + if err := m.HslClr.ValidateWithPath(path + "/HslClr"); err != nil { + return err + } + } + if m.SysClr != nil { + if err := m.SysClr.ValidateWithPath(path + "/SysClr"); err != nil { + return err + } + } + if m.SchemeClr != nil { + if err := m.SchemeClr.ValidateWithPath(path + "/SchemeClr"); err != nil { + return err + } + } + if m.PrstClr != nil { + if err := m.PrstClr.ValidateWithPath(path + "/PrstClr"); err != nil { + return err + } + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextAutonumberBullet.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextAutonumberBullet.go new file mode 100644 index 00000000..0bfc2977 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextAutonumberBullet.go @@ -0,0 +1,97 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" +) + +type CT_TextAutonumberBullet struct { + TypeAttr ST_TextAutonumberScheme + StartAtAttr *int32 +} + +func NewCT_TextAutonumberBullet() *CT_TextAutonumberBullet { + ret := &CT_TextAutonumberBullet{} + ret.TypeAttr = ST_TextAutonumberScheme(1) + return ret +} + +func (m *CT_TextAutonumberBullet) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.TypeAttr.MarshalXMLAttr(xml.Name{Local: "type"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + if m.StartAtAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "startAt"}, + Value: fmt.Sprintf("%v", *m.StartAtAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TextAutonumberBullet) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.TypeAttr = ST_TextAutonumberScheme(1) + for _, attr := range start.Attr { + if attr.Name.Local == "type" { + m.TypeAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "startAt" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + pt := int32(parsed) + m.StartAtAttr = &pt + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_TextAutonumberBullet: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_TextAutonumberBullet and its children +func (m *CT_TextAutonumberBullet) Validate() error { + return m.ValidateWithPath("CT_TextAutonumberBullet") +} + +// ValidateWithPath validates the CT_TextAutonumberBullet and its children, prefixing error messages with path +func (m *CT_TextAutonumberBullet) ValidateWithPath(path string) error { + if m.TypeAttr == ST_TextAutonumberSchemeUnset { + return fmt.Errorf("%s/TypeAttr is a mandatory field", path) + } + if err := m.TypeAttr.ValidateWithPath(path + "/TypeAttr"); err != nil { + return err + } + if m.StartAtAttr != nil { + if *m.StartAtAttr < 1 { + return fmt.Errorf("%s/m.StartAtAttr must be >= 1 (have %v)", path, *m.StartAtAttr) + } + if *m.StartAtAttr > 32767 { + return fmt.Errorf("%s/m.StartAtAttr must be <= 32767 (have %v)", path, *m.StartAtAttr) + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextBlipBullet.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextBlipBullet.go new file mode 100644 index 00000000..7d9109ef --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextBlipBullet.go @@ -0,0 +1,77 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_TextBlipBullet struct { + Blip *CT_Blip +} + +func NewCT_TextBlipBullet() *CT_TextBlipBullet { + ret := &CT_TextBlipBullet{} + ret.Blip = NewCT_Blip() + return ret +} + +func (m *CT_TextBlipBullet) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + seblip := xml.StartElement{Name: xml.Name{Local: "a:blip"}} + e.EncodeElement(m.Blip, seblip) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TextBlipBullet) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.Blip = NewCT_Blip() +lCT_TextBlipBullet: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blip"}: + if err := d.DecodeElement(m.Blip, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_TextBlipBullet %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TextBlipBullet + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TextBlipBullet and its children +func (m *CT_TextBlipBullet) Validate() error { + return m.ValidateWithPath("CT_TextBlipBullet") +} + +// ValidateWithPath validates the CT_TextBlipBullet and its children, prefixing error messages with path +func (m *CT_TextBlipBullet) ValidateWithPath(path string) error { + if err := m.Blip.ValidateWithPath(path + "/Blip"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextBody.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextBody.go new file mode 100644 index 00000000..1b8824f6 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextBody.go @@ -0,0 +1,109 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_TextBody struct { + BodyPr *CT_TextBodyProperties + LstStyle *CT_TextListStyle + P []*CT_TextParagraph +} + +func NewCT_TextBody() *CT_TextBody { + ret := &CT_TextBody{} + ret.BodyPr = NewCT_TextBodyProperties() + return ret +} + +func (m *CT_TextBody) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + sebodyPr := xml.StartElement{Name: xml.Name{Local: "a:bodyPr"}} + e.EncodeElement(m.BodyPr, sebodyPr) + if m.LstStyle != nil { + selstStyle := xml.StartElement{Name: xml.Name{Local: "a:lstStyle"}} + e.EncodeElement(m.LstStyle, selstStyle) + } + sep := xml.StartElement{Name: xml.Name{Local: "a:p"}} + for _, c := range m.P { + e.EncodeElement(c, sep) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TextBody) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.BodyPr = NewCT_TextBodyProperties() +lCT_TextBody: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "bodyPr"}: + if err := d.DecodeElement(m.BodyPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lstStyle"}: + m.LstStyle = NewCT_TextListStyle() + if err := d.DecodeElement(m.LstStyle, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "p"}: + tmp := NewCT_TextParagraph() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.P = append(m.P, tmp) + default: + gooxml.Log("skipping unsupported element on CT_TextBody %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TextBody + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TextBody and its children +func (m *CT_TextBody) Validate() error { + return m.ValidateWithPath("CT_TextBody") +} + +// ValidateWithPath validates the CT_TextBody and its children, prefixing error messages with path +func (m *CT_TextBody) ValidateWithPath(path string) error { + if err := m.BodyPr.ValidateWithPath(path + "/BodyPr"); err != nil { + return err + } + if m.LstStyle != nil { + if err := m.LstStyle.ValidateWithPath(path + "/LstStyle"); err != nil { + return err + } + } + for i, v := range m.P { + if err := v.ValidateWithPath(fmt.Sprintf("%s/P[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextBodyProperties.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextBodyProperties.go new file mode 100644 index 00000000..0ab70543 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextBodyProperties.go @@ -0,0 +1,482 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type CT_TextBodyProperties struct { + RotAttr *int32 + SpcFirstLastParaAttr *bool + VertOverflowAttr ST_TextVertOverflowType + HorzOverflowAttr ST_TextHorzOverflowType + VertAttr ST_TextVerticalType + WrapAttr ST_TextWrappingType + LInsAttr *ST_Coordinate32 + TInsAttr *ST_Coordinate32 + RInsAttr *ST_Coordinate32 + BInsAttr *ST_Coordinate32 + NumColAttr *int32 + SpcColAttr *int32 + RtlColAttr *bool + FromWordArtAttr *bool + AnchorAttr ST_TextAnchoringType + AnchorCtrAttr *bool + ForceAAAttr *bool + UprightAttr *bool + CompatLnSpcAttr *bool + PrstTxWarp *CT_PresetTextShape + NoAutofit *CT_TextNoAutofit + NormAutofit *CT_TextNormalAutofit + SpAutoFit *CT_TextShapeAutofit + Scene3d *CT_Scene3D + Sp3d *CT_Shape3D + FlatTx *CT_FlatText + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_TextBodyProperties() *CT_TextBodyProperties { + ret := &CT_TextBodyProperties{} + return ret +} + +func (m *CT_TextBodyProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.RotAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "rot"}, + Value: fmt.Sprintf("%v", *m.RotAttr)}) + } + if m.SpcFirstLastParaAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "spcFirstLastPara"}, + Value: fmt.Sprintf("%d", b2i(*m.SpcFirstLastParaAttr))}) + } + if m.VertOverflowAttr != ST_TextVertOverflowTypeUnset { + attr, err := m.VertOverflowAttr.MarshalXMLAttr(xml.Name{Local: "vertOverflow"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.HorzOverflowAttr != ST_TextHorzOverflowTypeUnset { + attr, err := m.HorzOverflowAttr.MarshalXMLAttr(xml.Name{Local: "horzOverflow"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.VertAttr != ST_TextVerticalTypeUnset { + attr, err := m.VertAttr.MarshalXMLAttr(xml.Name{Local: "vert"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.WrapAttr != ST_TextWrappingTypeUnset { + attr, err := m.WrapAttr.MarshalXMLAttr(xml.Name{Local: "wrap"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.LInsAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "lIns"}, + Value: fmt.Sprintf("%v", *m.LInsAttr)}) + } + if m.TInsAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "tIns"}, + Value: fmt.Sprintf("%v", *m.TInsAttr)}) + } + if m.RInsAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "rIns"}, + Value: fmt.Sprintf("%v", *m.RInsAttr)}) + } + if m.BInsAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "bIns"}, + Value: fmt.Sprintf("%v", *m.BInsAttr)}) + } + if m.NumColAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "numCol"}, + Value: fmt.Sprintf("%v", *m.NumColAttr)}) + } + if m.SpcColAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "spcCol"}, + Value: fmt.Sprintf("%v", *m.SpcColAttr)}) + } + if m.RtlColAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "rtlCol"}, + Value: fmt.Sprintf("%d", b2i(*m.RtlColAttr))}) + } + if m.FromWordArtAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "fromWordArt"}, + Value: fmt.Sprintf("%d", b2i(*m.FromWordArtAttr))}) + } + if m.AnchorAttr != ST_TextAnchoringTypeUnset { + attr, err := m.AnchorAttr.MarshalXMLAttr(xml.Name{Local: "anchor"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.AnchorCtrAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "anchorCtr"}, + Value: fmt.Sprintf("%d", b2i(*m.AnchorCtrAttr))}) + } + if m.ForceAAAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "forceAA"}, + Value: fmt.Sprintf("%d", b2i(*m.ForceAAAttr))}) + } + if m.UprightAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "upright"}, + Value: fmt.Sprintf("%d", b2i(*m.UprightAttr))}) + } + if m.CompatLnSpcAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "compatLnSpc"}, + Value: fmt.Sprintf("%d", b2i(*m.CompatLnSpcAttr))}) + } + e.EncodeToken(start) + if m.PrstTxWarp != nil { + seprstTxWarp := xml.StartElement{Name: xml.Name{Local: "a:prstTxWarp"}} + e.EncodeElement(m.PrstTxWarp, seprstTxWarp) + } + if m.NoAutofit != nil { + senoAutofit := xml.StartElement{Name: xml.Name{Local: "a:noAutofit"}} + e.EncodeElement(m.NoAutofit, senoAutofit) + } + if m.NormAutofit != nil { + senormAutofit := xml.StartElement{Name: xml.Name{Local: "a:normAutofit"}} + e.EncodeElement(m.NormAutofit, senormAutofit) + } + if m.SpAutoFit != nil { + sespAutoFit := xml.StartElement{Name: xml.Name{Local: "a:spAutoFit"}} + e.EncodeElement(m.SpAutoFit, sespAutoFit) + } + if m.Scene3d != nil { + sescene3d := xml.StartElement{Name: xml.Name{Local: "a:scene3d"}} + e.EncodeElement(m.Scene3d, sescene3d) + } + if m.Sp3d != nil { + sesp3d := xml.StartElement{Name: xml.Name{Local: "a:sp3d"}} + e.EncodeElement(m.Sp3d, sesp3d) + } + if m.FlatTx != nil { + seflatTx := xml.StartElement{Name: xml.Name{Local: "a:flatTx"}} + e.EncodeElement(m.FlatTx, seflatTx) + } + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TextBodyProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "fromWordArt" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.FromWordArtAttr = &parsed + continue + } + if attr.Name.Local == "anchor" { + m.AnchorAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "spcFirstLastPara" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.SpcFirstLastParaAttr = &parsed + continue + } + if attr.Name.Local == "anchorCtr" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.AnchorCtrAttr = &parsed + continue + } + if attr.Name.Local == "horzOverflow" { + m.HorzOverflowAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "forceAA" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.ForceAAAttr = &parsed + continue + } + if attr.Name.Local == "wrap" { + m.WrapAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "upright" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.UprightAttr = &parsed + continue + } + if attr.Name.Local == "tIns" { + parsed, err := ParseUnionST_Coordinate32(attr.Value) + if err != nil { + return err + } + m.TInsAttr = &parsed + continue + } + if attr.Name.Local == "compatLnSpc" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.CompatLnSpcAttr = &parsed + continue + } + if attr.Name.Local == "bIns" { + parsed, err := ParseUnionST_Coordinate32(attr.Value) + if err != nil { + return err + } + m.BInsAttr = &parsed + continue + } + if attr.Name.Local == "vertOverflow" { + m.VertOverflowAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "rot" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + pt := int32(parsed) + m.RotAttr = &pt + continue + } + if attr.Name.Local == "spcCol" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + pt := int32(parsed) + m.SpcColAttr = &pt + continue + } + if attr.Name.Local == "vert" { + m.VertAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "rIns" { + parsed, err := ParseUnionST_Coordinate32(attr.Value) + if err != nil { + return err + } + m.RInsAttr = &parsed + continue + } + if attr.Name.Local == "numCol" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + pt := int32(parsed) + m.NumColAttr = &pt + continue + } + if attr.Name.Local == "rtlCol" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.RtlColAttr = &parsed + continue + } + if attr.Name.Local == "lIns" { + parsed, err := ParseUnionST_Coordinate32(attr.Value) + if err != nil { + return err + } + m.LInsAttr = &parsed + continue + } + } +lCT_TextBodyProperties: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "prstTxWarp"}: + m.PrstTxWarp = NewCT_PresetTextShape() + if err := d.DecodeElement(m.PrstTxWarp, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "noAutofit"}: + m.NoAutofit = NewCT_TextNoAutofit() + if err := d.DecodeElement(m.NoAutofit, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "normAutofit"}: + m.NormAutofit = NewCT_TextNormalAutofit() + if err := d.DecodeElement(m.NormAutofit, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "spAutoFit"}: + m.SpAutoFit = NewCT_TextShapeAutofit() + if err := d.DecodeElement(m.SpAutoFit, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "scene3d"}: + m.Scene3d = NewCT_Scene3D() + if err := d.DecodeElement(m.Scene3d, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "sp3d"}: + m.Sp3d = NewCT_Shape3D() + if err := d.DecodeElement(m.Sp3d, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "flatTx"}: + m.FlatTx = NewCT_FlatText() + if err := d.DecodeElement(m.FlatTx, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_TextBodyProperties %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TextBodyProperties + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TextBodyProperties and its children +func (m *CT_TextBodyProperties) Validate() error { + return m.ValidateWithPath("CT_TextBodyProperties") +} + +// ValidateWithPath validates the CT_TextBodyProperties and its children, prefixing error messages with path +func (m *CT_TextBodyProperties) ValidateWithPath(path string) error { + if err := m.VertOverflowAttr.ValidateWithPath(path + "/VertOverflowAttr"); err != nil { + return err + } + if err := m.HorzOverflowAttr.ValidateWithPath(path + "/HorzOverflowAttr"); err != nil { + return err + } + if err := m.VertAttr.ValidateWithPath(path + "/VertAttr"); err != nil { + return err + } + if err := m.WrapAttr.ValidateWithPath(path + "/WrapAttr"); err != nil { + return err + } + if m.LInsAttr != nil { + if err := m.LInsAttr.ValidateWithPath(path + "/LInsAttr"); err != nil { + return err + } + } + if m.TInsAttr != nil { + if err := m.TInsAttr.ValidateWithPath(path + "/TInsAttr"); err != nil { + return err + } + } + if m.RInsAttr != nil { + if err := m.RInsAttr.ValidateWithPath(path + "/RInsAttr"); err != nil { + return err + } + } + if m.BInsAttr != nil { + if err := m.BInsAttr.ValidateWithPath(path + "/BInsAttr"); err != nil { + return err + } + } + if m.NumColAttr != nil { + if *m.NumColAttr < 1 { + return fmt.Errorf("%s/m.NumColAttr must be >= 1 (have %v)", path, *m.NumColAttr) + } + if *m.NumColAttr > 16 { + return fmt.Errorf("%s/m.NumColAttr must be <= 16 (have %v)", path, *m.NumColAttr) + } + } + if m.SpcColAttr != nil { + if *m.SpcColAttr < 0 { + return fmt.Errorf("%s/m.SpcColAttr must be >= 0 (have %v)", path, *m.SpcColAttr) + } + } + if err := m.AnchorAttr.ValidateWithPath(path + "/AnchorAttr"); err != nil { + return err + } + if m.PrstTxWarp != nil { + if err := m.PrstTxWarp.ValidateWithPath(path + "/PrstTxWarp"); err != nil { + return err + } + } + if m.NoAutofit != nil { + if err := m.NoAutofit.ValidateWithPath(path + "/NoAutofit"); err != nil { + return err + } + } + if m.NormAutofit != nil { + if err := m.NormAutofit.ValidateWithPath(path + "/NormAutofit"); err != nil { + return err + } + } + if m.SpAutoFit != nil { + if err := m.SpAutoFit.ValidateWithPath(path + "/SpAutoFit"); err != nil { + return err + } + } + if m.Scene3d != nil { + if err := m.Scene3d.ValidateWithPath(path + "/Scene3d"); err != nil { + return err + } + } + if m.Sp3d != nil { + if err := m.Sp3d.ValidateWithPath(path + "/Sp3d"); err != nil { + return err + } + } + if m.FlatTx != nil { + if err := m.FlatTx.ValidateWithPath(path + "/FlatTx"); err != nil { + return err + } + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextBulletColorFollowText.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextBulletColorFollowText.go new file mode 100644 index 00000000..fda72db2 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextBulletColorFollowText.go @@ -0,0 +1,54 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_TextBulletColorFollowText struct { +} + +func NewCT_TextBulletColorFollowText() *CT_TextBulletColorFollowText { + ret := &CT_TextBulletColorFollowText{} + return ret +} + +func (m *CT_TextBulletColorFollowText) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TextBulletColorFollowText) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_TextBulletColorFollowText: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_TextBulletColorFollowText and its children +func (m *CT_TextBulletColorFollowText) Validate() error { + return m.ValidateWithPath("CT_TextBulletColorFollowText") +} + +// ValidateWithPath validates the CT_TextBulletColorFollowText and its children, prefixing error messages with path +func (m *CT_TextBulletColorFollowText) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextBulletSizeFollowText.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextBulletSizeFollowText.go new file mode 100644 index 00000000..1ec2abc9 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextBulletSizeFollowText.go @@ -0,0 +1,54 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_TextBulletSizeFollowText struct { +} + +func NewCT_TextBulletSizeFollowText() *CT_TextBulletSizeFollowText { + ret := &CT_TextBulletSizeFollowText{} + return ret +} + +func (m *CT_TextBulletSizeFollowText) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TextBulletSizeFollowText) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_TextBulletSizeFollowText: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_TextBulletSizeFollowText and its children +func (m *CT_TextBulletSizeFollowText) Validate() error { + return m.ValidateWithPath("CT_TextBulletSizeFollowText") +} + +// ValidateWithPath validates the CT_TextBulletSizeFollowText and its children, prefixing error messages with path +func (m *CT_TextBulletSizeFollowText) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextBulletSizePercent.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextBulletSizePercent.go new file mode 100644 index 00000000..7371d8f7 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextBulletSizePercent.go @@ -0,0 +1,72 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_TextBulletSizePercent struct { + ValAttr string +} + +func NewCT_TextBulletSizePercent() *CT_TextBulletSizePercent { + ret := &CT_TextBulletSizePercent{} + ret.ValAttr = "100%" + return ret +} + +func (m *CT_TextBulletSizePercent) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "val"}, + Value: fmt.Sprintf("%v", m.ValAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TextBulletSizePercent) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = "100%" + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ValAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_TextBulletSizePercent: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_TextBulletSizePercent and its children +func (m *CT_TextBulletSizePercent) Validate() error { + return m.ValidateWithPath("CT_TextBulletSizePercent") +} + +// ValidateWithPath validates the CT_TextBulletSizePercent and its children, prefixing error messages with path +func (m *CT_TextBulletSizePercent) ValidateWithPath(path string) error { + if !ST_TextBulletSizePercentPatternRe.MatchString(m.ValAttr) { + return fmt.Errorf(`%s/m.ValAttr must match '%s' (have %v)`, path, ST_TextBulletSizePercentPatternRe, m.ValAttr) + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextBulletSizePoint.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextBulletSizePoint.go new file mode 100644 index 00000000..2dce4335 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextBulletSizePoint.go @@ -0,0 +1,76 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" +) + +type CT_TextBulletSizePoint struct { + ValAttr int32 +} + +func NewCT_TextBulletSizePoint() *CT_TextBulletSizePoint { + ret := &CT_TextBulletSizePoint{} + ret.ValAttr = 100 + return ret +} + +func (m *CT_TextBulletSizePoint) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "val"}, + Value: fmt.Sprintf("%v", m.ValAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TextBulletSizePoint) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = 100 + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + m.ValAttr = int32(parsed) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_TextBulletSizePoint: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_TextBulletSizePoint and its children +func (m *CT_TextBulletSizePoint) Validate() error { + return m.ValidateWithPath("CT_TextBulletSizePoint") +} + +// ValidateWithPath validates the CT_TextBulletSizePoint and its children, prefixing error messages with path +func (m *CT_TextBulletSizePoint) ValidateWithPath(path string) error { + if m.ValAttr < 100 { + return fmt.Errorf("%s/m.ValAttr must be >= 100 (have %v)", path, m.ValAttr) + } + if m.ValAttr > 400000 { + return fmt.Errorf("%s/m.ValAttr must be <= 400000 (have %v)", path, m.ValAttr) + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextBulletTypefaceFollowText.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextBulletTypefaceFollowText.go new file mode 100644 index 00000000..9c32dd60 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextBulletTypefaceFollowText.go @@ -0,0 +1,54 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_TextBulletTypefaceFollowText struct { +} + +func NewCT_TextBulletTypefaceFollowText() *CT_TextBulletTypefaceFollowText { + ret := &CT_TextBulletTypefaceFollowText{} + return ret +} + +func (m *CT_TextBulletTypefaceFollowText) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TextBulletTypefaceFollowText) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_TextBulletTypefaceFollowText: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_TextBulletTypefaceFollowText and its children +func (m *CT_TextBulletTypefaceFollowText) Validate() error { + return m.ValidateWithPath("CT_TextBulletTypefaceFollowText") +} + +// ValidateWithPath validates the CT_TextBulletTypefaceFollowText and its children, prefixing error messages with path +func (m *CT_TextBulletTypefaceFollowText) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextCharBullet.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextCharBullet.go new file mode 100644 index 00000000..8d7fcad0 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextCharBullet.go @@ -0,0 +1,67 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_TextCharBullet struct { + CharAttr string +} + +func NewCT_TextCharBullet() *CT_TextCharBullet { + ret := &CT_TextCharBullet{} + return ret +} + +func (m *CT_TextCharBullet) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "char"}, + Value: fmt.Sprintf("%v", m.CharAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TextCharBullet) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "char" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.CharAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_TextCharBullet: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_TextCharBullet and its children +func (m *CT_TextCharBullet) Validate() error { + return m.ValidateWithPath("CT_TextCharBullet") +} + +// ValidateWithPath validates the CT_TextCharBullet and its children, prefixing error messages with path +func (m *CT_TextCharBullet) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextCharacterProperties.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextCharacterProperties.go new file mode 100644 index 00000000..66bde2e9 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextCharacterProperties.go @@ -0,0 +1,681 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type CT_TextCharacterProperties struct { + KumimojiAttr *bool + LangAttr *string + AltLangAttr *string + SzAttr *int32 + BAttr *bool + IAttr *bool + UAttr ST_TextUnderlineType + StrikeAttr ST_TextStrikeType + KernAttr *int32 + CapAttr ST_TextCapsType + SpcAttr *ST_TextPoint + NormalizeHAttr *bool + BaselineAttr *ST_Percentage + NoProofAttr *bool + DirtyAttr *bool + ErrAttr *bool + SmtCleanAttr *bool + SmtIdAttr *uint32 + BmkAttr *string + Ln *CT_LineProperties + NoFill *CT_NoFillProperties + SolidFill *CT_SolidColorFillProperties + GradFill *CT_GradientFillProperties + BlipFill *CT_BlipFillProperties + PattFill *CT_PatternFillProperties + GrpFill *CT_GroupFillProperties + EffectLst *CT_EffectList + EffectDag *CT_EffectContainer + Highlight *CT_Color + ULnTx *CT_TextUnderlineLineFollowText + ULn *CT_LineProperties + UFillTx *CT_TextUnderlineFillFollowText + UFill *CT_TextUnderlineFillGroupWrapper + Latin *CT_TextFont + Ea *CT_TextFont + Cs *CT_TextFont + Sym *CT_TextFont + HlinkClick *CT_Hyperlink + HlinkMouseOver *CT_Hyperlink + Rtl *CT_Boolean + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_TextCharacterProperties() *CT_TextCharacterProperties { + ret := &CT_TextCharacterProperties{} + return ret +} + +func (m *CT_TextCharacterProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.KumimojiAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "kumimoji"}, + Value: fmt.Sprintf("%d", b2i(*m.KumimojiAttr))}) + } + if m.LangAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "lang"}, + Value: fmt.Sprintf("%v", *m.LangAttr)}) + } + if m.AltLangAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "altLang"}, + Value: fmt.Sprintf("%v", *m.AltLangAttr)}) + } + if m.SzAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "sz"}, + Value: fmt.Sprintf("%v", *m.SzAttr)}) + } + if m.BAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "b"}, + Value: fmt.Sprintf("%d", b2i(*m.BAttr))}) + } + if m.IAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "i"}, + Value: fmt.Sprintf("%d", b2i(*m.IAttr))}) + } + if m.UAttr != ST_TextUnderlineTypeUnset { + attr, err := m.UAttr.MarshalXMLAttr(xml.Name{Local: "u"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.StrikeAttr != ST_TextStrikeTypeUnset { + attr, err := m.StrikeAttr.MarshalXMLAttr(xml.Name{Local: "strike"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.KernAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "kern"}, + Value: fmt.Sprintf("%v", *m.KernAttr)}) + } + if m.CapAttr != ST_TextCapsTypeUnset { + attr, err := m.CapAttr.MarshalXMLAttr(xml.Name{Local: "cap"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.SpcAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "spc"}, + Value: fmt.Sprintf("%v", *m.SpcAttr)}) + } + if m.NormalizeHAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "normalizeH"}, + Value: fmt.Sprintf("%d", b2i(*m.NormalizeHAttr))}) + } + if m.BaselineAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "baseline"}, + Value: fmt.Sprintf("%v", *m.BaselineAttr)}) + } + if m.NoProofAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "noProof"}, + Value: fmt.Sprintf("%d", b2i(*m.NoProofAttr))}) + } + if m.DirtyAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "dirty"}, + Value: fmt.Sprintf("%d", b2i(*m.DirtyAttr))}) + } + if m.ErrAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "err"}, + Value: fmt.Sprintf("%d", b2i(*m.ErrAttr))}) + } + if m.SmtCleanAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "smtClean"}, + Value: fmt.Sprintf("%d", b2i(*m.SmtCleanAttr))}) + } + if m.SmtIdAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "smtId"}, + Value: fmt.Sprintf("%v", *m.SmtIdAttr)}) + } + if m.BmkAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "bmk"}, + Value: fmt.Sprintf("%v", *m.BmkAttr)}) + } + e.EncodeToken(start) + if m.Ln != nil { + seln := xml.StartElement{Name: xml.Name{Local: "a:ln"}} + e.EncodeElement(m.Ln, seln) + } + if m.NoFill != nil { + senoFill := xml.StartElement{Name: xml.Name{Local: "a:noFill"}} + e.EncodeElement(m.NoFill, senoFill) + } + if m.SolidFill != nil { + sesolidFill := xml.StartElement{Name: xml.Name{Local: "a:solidFill"}} + e.EncodeElement(m.SolidFill, sesolidFill) + } + if m.GradFill != nil { + segradFill := xml.StartElement{Name: xml.Name{Local: "a:gradFill"}} + e.EncodeElement(m.GradFill, segradFill) + } + if m.BlipFill != nil { + seblipFill := xml.StartElement{Name: xml.Name{Local: "a:blipFill"}} + e.EncodeElement(m.BlipFill, seblipFill) + } + if m.PattFill != nil { + sepattFill := xml.StartElement{Name: xml.Name{Local: "a:pattFill"}} + e.EncodeElement(m.PattFill, sepattFill) + } + if m.GrpFill != nil { + segrpFill := xml.StartElement{Name: xml.Name{Local: "a:grpFill"}} + e.EncodeElement(m.GrpFill, segrpFill) + } + if m.EffectLst != nil { + seeffectLst := xml.StartElement{Name: xml.Name{Local: "a:effectLst"}} + e.EncodeElement(m.EffectLst, seeffectLst) + } + if m.EffectDag != nil { + seeffectDag := xml.StartElement{Name: xml.Name{Local: "a:effectDag"}} + e.EncodeElement(m.EffectDag, seeffectDag) + } + if m.Highlight != nil { + sehighlight := xml.StartElement{Name: xml.Name{Local: "a:highlight"}} + e.EncodeElement(m.Highlight, sehighlight) + } + if m.ULnTx != nil { + seuLnTx := xml.StartElement{Name: xml.Name{Local: "a:uLnTx"}} + e.EncodeElement(m.ULnTx, seuLnTx) + } + if m.ULn != nil { + seuLn := xml.StartElement{Name: xml.Name{Local: "a:uLn"}} + e.EncodeElement(m.ULn, seuLn) + } + if m.UFillTx != nil { + seuFillTx := xml.StartElement{Name: xml.Name{Local: "a:uFillTx"}} + e.EncodeElement(m.UFillTx, seuFillTx) + } + if m.UFill != nil { + seuFill := xml.StartElement{Name: xml.Name{Local: "a:uFill"}} + e.EncodeElement(m.UFill, seuFill) + } + if m.Latin != nil { + selatin := xml.StartElement{Name: xml.Name{Local: "a:latin"}} + e.EncodeElement(m.Latin, selatin) + } + if m.Ea != nil { + seea := xml.StartElement{Name: xml.Name{Local: "a:ea"}} + e.EncodeElement(m.Ea, seea) + } + if m.Cs != nil { + secs := xml.StartElement{Name: xml.Name{Local: "a:cs"}} + e.EncodeElement(m.Cs, secs) + } + if m.Sym != nil { + sesym := xml.StartElement{Name: xml.Name{Local: "a:sym"}} + e.EncodeElement(m.Sym, sesym) + } + if m.HlinkClick != nil { + sehlinkClick := xml.StartElement{Name: xml.Name{Local: "a:hlinkClick"}} + e.EncodeElement(m.HlinkClick, sehlinkClick) + } + if m.HlinkMouseOver != nil { + sehlinkMouseOver := xml.StartElement{Name: xml.Name{Local: "a:hlinkMouseOver"}} + e.EncodeElement(m.HlinkMouseOver, sehlinkMouseOver) + } + if m.Rtl != nil { + sertl := xml.StartElement{Name: xml.Name{Local: "a:rtl"}} + e.EncodeElement(m.Rtl, sertl) + } + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TextCharacterProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "lang" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.LangAttr = &parsed + continue + } + if attr.Name.Local == "sz" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + pt := int32(parsed) + m.SzAttr = &pt + continue + } + if attr.Name.Local == "kumimoji" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.KumimojiAttr = &parsed + continue + } + if attr.Name.Local == "strike" { + m.StrikeAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "cap" { + m.CapAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "b" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.BAttr = &parsed + continue + } + if attr.Name.Local == "i" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.IAttr = &parsed + continue + } + if attr.Name.Local == "smtClean" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.SmtCleanAttr = &parsed + continue + } + if attr.Name.Local == "kern" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + pt := int32(parsed) + m.KernAttr = &pt + continue + } + if attr.Name.Local == "err" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.ErrAttr = &parsed + continue + } + if attr.Name.Local == "altLang" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.AltLangAttr = &parsed + continue + } + if attr.Name.Local == "noProof" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NoProofAttr = &parsed + continue + } + if attr.Name.Local == "u" { + m.UAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "smtId" { + parsed, err := strconv.ParseUint(attr.Value, 10, 32) + if err != nil { + return err + } + pt := uint32(parsed) + m.SmtIdAttr = &pt + continue + } + if attr.Name.Local == "spc" { + parsed, err := ParseUnionST_TextPoint(attr.Value) + if err != nil { + return err + } + m.SpcAttr = &parsed + continue + } + if attr.Name.Local == "baseline" { + parsed, err := ParseUnionST_Percentage(attr.Value) + if err != nil { + return err + } + m.BaselineAttr = &parsed + continue + } + if attr.Name.Local == "dirty" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.DirtyAttr = &parsed + continue + } + if attr.Name.Local == "bmk" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.BmkAttr = &parsed + continue + } + if attr.Name.Local == "normalizeH" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NormalizeHAttr = &parsed + continue + } + } +lCT_TextCharacterProperties: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "ln"}: + m.Ln = NewCT_LineProperties() + if err := d.DecodeElement(m.Ln, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "noFill"}: + m.NoFill = NewCT_NoFillProperties() + if err := d.DecodeElement(m.NoFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "solidFill"}: + m.SolidFill = NewCT_SolidColorFillProperties() + if err := d.DecodeElement(m.SolidFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "gradFill"}: + m.GradFill = NewCT_GradientFillProperties() + if err := d.DecodeElement(m.GradFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blipFill"}: + m.BlipFill = NewCT_BlipFillProperties() + if err := d.DecodeElement(m.BlipFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "pattFill"}: + m.PattFill = NewCT_PatternFillProperties() + if err := d.DecodeElement(m.PattFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "grpFill"}: + m.GrpFill = NewCT_GroupFillProperties() + if err := d.DecodeElement(m.GrpFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "effectLst"}: + m.EffectLst = NewCT_EffectList() + if err := d.DecodeElement(m.EffectLst, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "effectDag"}: + m.EffectDag = NewCT_EffectContainer() + if err := d.DecodeElement(m.EffectDag, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "highlight"}: + m.Highlight = NewCT_Color() + if err := d.DecodeElement(m.Highlight, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "uLnTx"}: + m.ULnTx = NewCT_TextUnderlineLineFollowText() + if err := d.DecodeElement(m.ULnTx, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "uLn"}: + m.ULn = NewCT_LineProperties() + if err := d.DecodeElement(m.ULn, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "uFillTx"}: + m.UFillTx = NewCT_TextUnderlineFillFollowText() + if err := d.DecodeElement(m.UFillTx, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "uFill"}: + m.UFill = NewCT_TextUnderlineFillGroupWrapper() + if err := d.DecodeElement(m.UFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "latin"}: + m.Latin = NewCT_TextFont() + if err := d.DecodeElement(m.Latin, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "ea"}: + m.Ea = NewCT_TextFont() + if err := d.DecodeElement(m.Ea, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "cs"}: + m.Cs = NewCT_TextFont() + if err := d.DecodeElement(m.Cs, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "sym"}: + m.Sym = NewCT_TextFont() + if err := d.DecodeElement(m.Sym, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hlinkClick"}: + m.HlinkClick = NewCT_Hyperlink() + if err := d.DecodeElement(m.HlinkClick, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hlinkMouseOver"}: + m.HlinkMouseOver = NewCT_Hyperlink() + if err := d.DecodeElement(m.HlinkMouseOver, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "rtl"}: + m.Rtl = NewCT_Boolean() + if err := d.DecodeElement(m.Rtl, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_TextCharacterProperties %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TextCharacterProperties + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TextCharacterProperties and its children +func (m *CT_TextCharacterProperties) Validate() error { + return m.ValidateWithPath("CT_TextCharacterProperties") +} + +// ValidateWithPath validates the CT_TextCharacterProperties and its children, prefixing error messages with path +func (m *CT_TextCharacterProperties) ValidateWithPath(path string) error { + if m.SzAttr != nil { + if *m.SzAttr < 100 { + return fmt.Errorf("%s/m.SzAttr must be >= 100 (have %v)", path, *m.SzAttr) + } + if *m.SzAttr > 400000 { + return fmt.Errorf("%s/m.SzAttr must be <= 400000 (have %v)", path, *m.SzAttr) + } + } + if err := m.UAttr.ValidateWithPath(path + "/UAttr"); err != nil { + return err + } + if err := m.StrikeAttr.ValidateWithPath(path + "/StrikeAttr"); err != nil { + return err + } + if m.KernAttr != nil { + if *m.KernAttr < 0 { + return fmt.Errorf("%s/m.KernAttr must be >= 0 (have %v)", path, *m.KernAttr) + } + if *m.KernAttr > 400000 { + return fmt.Errorf("%s/m.KernAttr must be <= 400000 (have %v)", path, *m.KernAttr) + } + } + if err := m.CapAttr.ValidateWithPath(path + "/CapAttr"); err != nil { + return err + } + if m.SpcAttr != nil { + if err := m.SpcAttr.ValidateWithPath(path + "/SpcAttr"); err != nil { + return err + } + } + if m.BaselineAttr != nil { + if err := m.BaselineAttr.ValidateWithPath(path + "/BaselineAttr"); err != nil { + return err + } + } + if m.Ln != nil { + if err := m.Ln.ValidateWithPath(path + "/Ln"); err != nil { + return err + } + } + if m.NoFill != nil { + if err := m.NoFill.ValidateWithPath(path + "/NoFill"); err != nil { + return err + } + } + if m.SolidFill != nil { + if err := m.SolidFill.ValidateWithPath(path + "/SolidFill"); err != nil { + return err + } + } + if m.GradFill != nil { + if err := m.GradFill.ValidateWithPath(path + "/GradFill"); err != nil { + return err + } + } + if m.BlipFill != nil { + if err := m.BlipFill.ValidateWithPath(path + "/BlipFill"); err != nil { + return err + } + } + if m.PattFill != nil { + if err := m.PattFill.ValidateWithPath(path + "/PattFill"); err != nil { + return err + } + } + if m.GrpFill != nil { + if err := m.GrpFill.ValidateWithPath(path + "/GrpFill"); err != nil { + return err + } + } + if m.EffectLst != nil { + if err := m.EffectLst.ValidateWithPath(path + "/EffectLst"); err != nil { + return err + } + } + if m.EffectDag != nil { + if err := m.EffectDag.ValidateWithPath(path + "/EffectDag"); err != nil { + return err + } + } + if m.Highlight != nil { + if err := m.Highlight.ValidateWithPath(path + "/Highlight"); err != nil { + return err + } + } + if m.ULnTx != nil { + if err := m.ULnTx.ValidateWithPath(path + "/ULnTx"); err != nil { + return err + } + } + if m.ULn != nil { + if err := m.ULn.ValidateWithPath(path + "/ULn"); err != nil { + return err + } + } + if m.UFillTx != nil { + if err := m.UFillTx.ValidateWithPath(path + "/UFillTx"); err != nil { + return err + } + } + if m.UFill != nil { + if err := m.UFill.ValidateWithPath(path + "/UFill"); err != nil { + return err + } + } + if m.Latin != nil { + if err := m.Latin.ValidateWithPath(path + "/Latin"); err != nil { + return err + } + } + if m.Ea != nil { + if err := m.Ea.ValidateWithPath(path + "/Ea"); err != nil { + return err + } + } + if m.Cs != nil { + if err := m.Cs.ValidateWithPath(path + "/Cs"); err != nil { + return err + } + } + if m.Sym != nil { + if err := m.Sym.ValidateWithPath(path + "/Sym"); err != nil { + return err + } + } + if m.HlinkClick != nil { + if err := m.HlinkClick.ValidateWithPath(path + "/HlinkClick"); err != nil { + return err + } + } + if m.HlinkMouseOver != nil { + if err := m.HlinkMouseOver.ValidateWithPath(path + "/HlinkMouseOver"); err != nil { + return err + } + } + if m.Rtl != nil { + if err := m.Rtl.ValidateWithPath(path + "/Rtl"); err != nil { + return err + } + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextField.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextField.go new file mode 100644 index 00000000..299996bd --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextField.go @@ -0,0 +1,139 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_TextField struct { + IdAttr string + TypeAttr *string + RPr *CT_TextCharacterProperties + PPr *CT_TextParagraphProperties + T *string +} + +func NewCT_TextField() *CT_TextField { + ret := &CT_TextField{} + ret.IdAttr = "{00000000-0000-0000-0000-000000000000}" + return ret +} + +func (m *CT_TextField) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "id"}, + Value: fmt.Sprintf("%v", m.IdAttr)}) + if m.TypeAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "type"}, + Value: fmt.Sprintf("%v", *m.TypeAttr)}) + } + e.EncodeToken(start) + if m.RPr != nil { + serPr := xml.StartElement{Name: xml.Name{Local: "a:rPr"}} + e.EncodeElement(m.RPr, serPr) + } + if m.PPr != nil { + sepPr := xml.StartElement{Name: xml.Name{Local: "a:pPr"}} + e.EncodeElement(m.PPr, sepPr) + } + if m.T != nil { + set := xml.StartElement{Name: xml.Name{Local: "a:t"}} + gooxml.AddPreserveSpaceAttr(&set, *m.T) + e.EncodeElement(m.T, set) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TextField) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.IdAttr = "{00000000-0000-0000-0000-000000000000}" + for _, attr := range start.Attr { + if attr.Name.Local == "id" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.IdAttr = parsed + continue + } + if attr.Name.Local == "type" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.TypeAttr = &parsed + continue + } + } +lCT_TextField: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "rPr"}: + m.RPr = NewCT_TextCharacterProperties() + if err := d.DecodeElement(m.RPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "pPr"}: + m.PPr = NewCT_TextParagraphProperties() + if err := d.DecodeElement(m.PPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "t"}: + m.T = new(string) + if err := d.DecodeElement(m.T, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_TextField %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TextField + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TextField and its children +func (m *CT_TextField) Validate() error { + return m.ValidateWithPath("CT_TextField") +} + +// ValidateWithPath validates the CT_TextField and its children, prefixing error messages with path +func (m *CT_TextField) ValidateWithPath(path string) error { + if !sharedTypes.ST_GuidPatternRe.MatchString(m.IdAttr) { + return fmt.Errorf(`%s/m.IdAttr must match '%s' (have %v)`, path, sharedTypes.ST_GuidPatternRe, m.IdAttr) + } + if m.RPr != nil { + if err := m.RPr.ValidateWithPath(path + "/RPr"); err != nil { + return err + } + } + if m.PPr != nil { + if err := m.PPr.ValidateWithPath(path + "/PPr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextFont.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextFont.go new file mode 100644 index 00000000..f166a2e4 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextFont.go @@ -0,0 +1,110 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" +) + +type CT_TextFont struct { + TypefaceAttr string + PanoseAttr *string + PitchFamilyAttr ST_PitchFamily + CharsetAttr *int8 +} + +func NewCT_TextFont() *CT_TextFont { + ret := &CT_TextFont{} + return ret +} + +func (m *CT_TextFont) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "typeface"}, + Value: fmt.Sprintf("%v", m.TypefaceAttr)}) + if m.PanoseAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "panose"}, + Value: fmt.Sprintf("%v", *m.PanoseAttr)}) + } + if m.PitchFamilyAttr != ST_PitchFamilyUnset { + attr, err := m.PitchFamilyAttr.MarshalXMLAttr(xml.Name{Local: "pitchFamily"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.CharsetAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "charset"}, + Value: fmt.Sprintf("%v", *m.CharsetAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TextFont) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "typeface" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.TypefaceAttr = parsed + continue + } + if attr.Name.Local == "panose" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.PanoseAttr = &parsed + continue + } + if attr.Name.Local == "pitchFamily" { + m.PitchFamilyAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "charset" { + parsed, err := strconv.ParseInt(attr.Value, 10, 8) + if err != nil { + return err + } + pt := int8(parsed) + m.CharsetAttr = &pt + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_TextFont: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_TextFont and its children +func (m *CT_TextFont) Validate() error { + return m.ValidateWithPath("CT_TextFont") +} + +// ValidateWithPath validates the CT_TextFont and its children, prefixing error messages with path +func (m *CT_TextFont) ValidateWithPath(path string) error { + if err := m.PitchFamilyAttr.ValidateWithPath(path + "/PitchFamilyAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextLineBreak.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextLineBreak.go new file mode 100644 index 00000000..0327116e --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextLineBreak.go @@ -0,0 +1,80 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_TextLineBreak struct { + RPr *CT_TextCharacterProperties +} + +func NewCT_TextLineBreak() *CT_TextLineBreak { + ret := &CT_TextLineBreak{} + return ret +} + +func (m *CT_TextLineBreak) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.RPr != nil { + serPr := xml.StartElement{Name: xml.Name{Local: "a:rPr"}} + e.EncodeElement(m.RPr, serPr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TextLineBreak) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_TextLineBreak: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "rPr"}: + m.RPr = NewCT_TextCharacterProperties() + if err := d.DecodeElement(m.RPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_TextLineBreak %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TextLineBreak + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TextLineBreak and its children +func (m *CT_TextLineBreak) Validate() error { + return m.ValidateWithPath("CT_TextLineBreak") +} + +// ValidateWithPath validates the CT_TextLineBreak and its children, prefixing error messages with path +func (m *CT_TextLineBreak) ValidateWithPath(path string) error { + if m.RPr != nil { + if err := m.RPr.ValidateWithPath(path + "/RPr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextListStyle.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextListStyle.go new file mode 100644 index 00000000..1bbf5453 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextListStyle.go @@ -0,0 +1,230 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_TextListStyle struct { + DefPPr *CT_TextParagraphProperties + Lvl1pPr *CT_TextParagraphProperties + Lvl2pPr *CT_TextParagraphProperties + Lvl3pPr *CT_TextParagraphProperties + Lvl4pPr *CT_TextParagraphProperties + Lvl5pPr *CT_TextParagraphProperties + Lvl6pPr *CT_TextParagraphProperties + Lvl7pPr *CT_TextParagraphProperties + Lvl8pPr *CT_TextParagraphProperties + Lvl9pPr *CT_TextParagraphProperties + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_TextListStyle() *CT_TextListStyle { + ret := &CT_TextListStyle{} + return ret +} + +func (m *CT_TextListStyle) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.DefPPr != nil { + sedefPPr := xml.StartElement{Name: xml.Name{Local: "a:defPPr"}} + e.EncodeElement(m.DefPPr, sedefPPr) + } + if m.Lvl1pPr != nil { + selvl1pPr := xml.StartElement{Name: xml.Name{Local: "a:lvl1pPr"}} + e.EncodeElement(m.Lvl1pPr, selvl1pPr) + } + if m.Lvl2pPr != nil { + selvl2pPr := xml.StartElement{Name: xml.Name{Local: "a:lvl2pPr"}} + e.EncodeElement(m.Lvl2pPr, selvl2pPr) + } + if m.Lvl3pPr != nil { + selvl3pPr := xml.StartElement{Name: xml.Name{Local: "a:lvl3pPr"}} + e.EncodeElement(m.Lvl3pPr, selvl3pPr) + } + if m.Lvl4pPr != nil { + selvl4pPr := xml.StartElement{Name: xml.Name{Local: "a:lvl4pPr"}} + e.EncodeElement(m.Lvl4pPr, selvl4pPr) + } + if m.Lvl5pPr != nil { + selvl5pPr := xml.StartElement{Name: xml.Name{Local: "a:lvl5pPr"}} + e.EncodeElement(m.Lvl5pPr, selvl5pPr) + } + if m.Lvl6pPr != nil { + selvl6pPr := xml.StartElement{Name: xml.Name{Local: "a:lvl6pPr"}} + e.EncodeElement(m.Lvl6pPr, selvl6pPr) + } + if m.Lvl7pPr != nil { + selvl7pPr := xml.StartElement{Name: xml.Name{Local: "a:lvl7pPr"}} + e.EncodeElement(m.Lvl7pPr, selvl7pPr) + } + if m.Lvl8pPr != nil { + selvl8pPr := xml.StartElement{Name: xml.Name{Local: "a:lvl8pPr"}} + e.EncodeElement(m.Lvl8pPr, selvl8pPr) + } + if m.Lvl9pPr != nil { + selvl9pPr := xml.StartElement{Name: xml.Name{Local: "a:lvl9pPr"}} + e.EncodeElement(m.Lvl9pPr, selvl9pPr) + } + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TextListStyle) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_TextListStyle: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "defPPr"}: + m.DefPPr = NewCT_TextParagraphProperties() + if err := d.DecodeElement(m.DefPPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lvl1pPr"}: + m.Lvl1pPr = NewCT_TextParagraphProperties() + if err := d.DecodeElement(m.Lvl1pPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lvl2pPr"}: + m.Lvl2pPr = NewCT_TextParagraphProperties() + if err := d.DecodeElement(m.Lvl2pPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lvl3pPr"}: + m.Lvl3pPr = NewCT_TextParagraphProperties() + if err := d.DecodeElement(m.Lvl3pPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lvl4pPr"}: + m.Lvl4pPr = NewCT_TextParagraphProperties() + if err := d.DecodeElement(m.Lvl4pPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lvl5pPr"}: + m.Lvl5pPr = NewCT_TextParagraphProperties() + if err := d.DecodeElement(m.Lvl5pPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lvl6pPr"}: + m.Lvl6pPr = NewCT_TextParagraphProperties() + if err := d.DecodeElement(m.Lvl6pPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lvl7pPr"}: + m.Lvl7pPr = NewCT_TextParagraphProperties() + if err := d.DecodeElement(m.Lvl7pPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lvl8pPr"}: + m.Lvl8pPr = NewCT_TextParagraphProperties() + if err := d.DecodeElement(m.Lvl8pPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lvl9pPr"}: + m.Lvl9pPr = NewCT_TextParagraphProperties() + if err := d.DecodeElement(m.Lvl9pPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_TextListStyle %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TextListStyle + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TextListStyle and its children +func (m *CT_TextListStyle) Validate() error { + return m.ValidateWithPath("CT_TextListStyle") +} + +// ValidateWithPath validates the CT_TextListStyle and its children, prefixing error messages with path +func (m *CT_TextListStyle) ValidateWithPath(path string) error { + if m.DefPPr != nil { + if err := m.DefPPr.ValidateWithPath(path + "/DefPPr"); err != nil { + return err + } + } + if m.Lvl1pPr != nil { + if err := m.Lvl1pPr.ValidateWithPath(path + "/Lvl1pPr"); err != nil { + return err + } + } + if m.Lvl2pPr != nil { + if err := m.Lvl2pPr.ValidateWithPath(path + "/Lvl2pPr"); err != nil { + return err + } + } + if m.Lvl3pPr != nil { + if err := m.Lvl3pPr.ValidateWithPath(path + "/Lvl3pPr"); err != nil { + return err + } + } + if m.Lvl4pPr != nil { + if err := m.Lvl4pPr.ValidateWithPath(path + "/Lvl4pPr"); err != nil { + return err + } + } + if m.Lvl5pPr != nil { + if err := m.Lvl5pPr.ValidateWithPath(path + "/Lvl5pPr"); err != nil { + return err + } + } + if m.Lvl6pPr != nil { + if err := m.Lvl6pPr.ValidateWithPath(path + "/Lvl6pPr"); err != nil { + return err + } + } + if m.Lvl7pPr != nil { + if err := m.Lvl7pPr.ValidateWithPath(path + "/Lvl7pPr"); err != nil { + return err + } + } + if m.Lvl8pPr != nil { + if err := m.Lvl8pPr.ValidateWithPath(path + "/Lvl8pPr"); err != nil { + return err + } + } + if m.Lvl9pPr != nil { + if err := m.Lvl9pPr.ValidateWithPath(path + "/Lvl9pPr"); err != nil { + return err + } + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextNoAutofit.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextNoAutofit.go new file mode 100644 index 00000000..2c44014f --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextNoAutofit.go @@ -0,0 +1,54 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_TextNoAutofit struct { +} + +func NewCT_TextNoAutofit() *CT_TextNoAutofit { + ret := &CT_TextNoAutofit{} + return ret +} + +func (m *CT_TextNoAutofit) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TextNoAutofit) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_TextNoAutofit: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_TextNoAutofit and its children +func (m *CT_TextNoAutofit) Validate() error { + return m.ValidateWithPath("CT_TextNoAutofit") +} + +// ValidateWithPath validates the CT_TextNoAutofit and its children, prefixing error messages with path +func (m *CT_TextNoAutofit) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextNoBullet.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextNoBullet.go new file mode 100644 index 00000000..2631667b --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextNoBullet.go @@ -0,0 +1,54 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_TextNoBullet struct { +} + +func NewCT_TextNoBullet() *CT_TextNoBullet { + ret := &CT_TextNoBullet{} + return ret +} + +func (m *CT_TextNoBullet) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TextNoBullet) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_TextNoBullet: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_TextNoBullet and its children +func (m *CT_TextNoBullet) Validate() error { + return m.ValidateWithPath("CT_TextNoBullet") +} + +// ValidateWithPath validates the CT_TextNoBullet and its children, prefixing error messages with path +func (m *CT_TextNoBullet) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextNormalAutofit.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextNormalAutofit.go new file mode 100644 index 00000000..0be5b7e3 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextNormalAutofit.go @@ -0,0 +1,92 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_TextNormalAutofit struct { + FontScaleAttr *ST_TextFontScalePercentOrPercentString + LnSpcReductionAttr *ST_TextSpacingPercentOrPercentString +} + +func NewCT_TextNormalAutofit() *CT_TextNormalAutofit { + ret := &CT_TextNormalAutofit{} + return ret +} + +func (m *CT_TextNormalAutofit) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.FontScaleAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "fontScale"}, + Value: fmt.Sprintf("%v", *m.FontScaleAttr)}) + } + if m.LnSpcReductionAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "lnSpcReduction"}, + Value: fmt.Sprintf("%v", *m.LnSpcReductionAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TextNormalAutofit) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "fontScale" { + parsed, err := ParseUnionST_TextFontScalePercentOrPercentString(attr.Value) + if err != nil { + return err + } + m.FontScaleAttr = &parsed + continue + } + if attr.Name.Local == "lnSpcReduction" { + parsed, err := ParseUnionST_TextSpacingPercentOrPercentString(attr.Value) + if err != nil { + return err + } + m.LnSpcReductionAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_TextNormalAutofit: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_TextNormalAutofit and its children +func (m *CT_TextNormalAutofit) Validate() error { + return m.ValidateWithPath("CT_TextNormalAutofit") +} + +// ValidateWithPath validates the CT_TextNormalAutofit and its children, prefixing error messages with path +func (m *CT_TextNormalAutofit) ValidateWithPath(path string) error { + if m.FontScaleAttr != nil { + if err := m.FontScaleAttr.ValidateWithPath(path + "/FontScaleAttr"); err != nil { + return err + } + } + if m.LnSpcReductionAttr != nil { + if err := m.LnSpcReductionAttr.ValidateWithPath(path + "/LnSpcReductionAttr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextParagraph.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextParagraph.go new file mode 100644 index 00000000..3cf7b945 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextParagraph.go @@ -0,0 +1,128 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_TextParagraph struct { + PPr *CT_TextParagraphProperties + EG_TextRun []*EG_TextRun + EndParaRPr *CT_TextCharacterProperties +} + +func NewCT_TextParagraph() *CT_TextParagraph { + ret := &CT_TextParagraph{} + return ret +} + +func (m *CT_TextParagraph) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.PPr != nil { + sepPr := xml.StartElement{Name: xml.Name{Local: "a:pPr"}} + e.EncodeElement(m.PPr, sepPr) + } + if m.EG_TextRun != nil { + for _, c := range m.EG_TextRun { + c.MarshalXML(e, xml.StartElement{}) + } + } + if m.EndParaRPr != nil { + seendParaRPr := xml.StartElement{Name: xml.Name{Local: "a:endParaRPr"}} + e.EncodeElement(m.EndParaRPr, seendParaRPr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TextParagraph) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_TextParagraph: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "pPr"}: + m.PPr = NewCT_TextParagraphProperties() + if err := d.DecodeElement(m.PPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "r"}: + tmptextrun := NewEG_TextRun() + tmptextrun.R = NewCT_RegularTextRun() + if err := d.DecodeElement(tmptextrun.R, &el); err != nil { + return err + } + m.EG_TextRun = append(m.EG_TextRun, tmptextrun) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "br"}: + tmptextrun := NewEG_TextRun() + tmptextrun.Br = NewCT_TextLineBreak() + if err := d.DecodeElement(tmptextrun.Br, &el); err != nil { + return err + } + m.EG_TextRun = append(m.EG_TextRun, tmptextrun) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "fld"}: + tmptextrun := NewEG_TextRun() + tmptextrun.Fld = NewCT_TextField() + if err := d.DecodeElement(tmptextrun.Fld, &el); err != nil { + return err + } + m.EG_TextRun = append(m.EG_TextRun, tmptextrun) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "endParaRPr"}: + m.EndParaRPr = NewCT_TextCharacterProperties() + if err := d.DecodeElement(m.EndParaRPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_TextParagraph %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TextParagraph + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TextParagraph and its children +func (m *CT_TextParagraph) Validate() error { + return m.ValidateWithPath("CT_TextParagraph") +} + +// ValidateWithPath validates the CT_TextParagraph and its children, prefixing error messages with path +func (m *CT_TextParagraph) ValidateWithPath(path string) error { + if m.PPr != nil { + if err := m.PPr.ValidateWithPath(path + "/PPr"); err != nil { + return err + } + } + for i, v := range m.EG_TextRun { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_TextRun[%d]", path, i)); err != nil { + return err + } + } + if m.EndParaRPr != nil { + if err := m.EndParaRPr.ValidateWithPath(path + "/EndParaRPr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextParagraphProperties.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextParagraphProperties.go new file mode 100644 index 00000000..28b422ec --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextParagraphProperties.go @@ -0,0 +1,512 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type CT_TextParagraphProperties struct { + MarLAttr *int32 + MarRAttr *int32 + LvlAttr *int32 + IndentAttr *int32 + AlgnAttr ST_TextAlignType + DefTabSzAttr *ST_Coordinate32 + RtlAttr *bool + EaLnBrkAttr *bool + FontAlgnAttr ST_TextFontAlignType + LatinLnBrkAttr *bool + HangingPunctAttr *bool + LnSpc *CT_TextSpacing + SpcBef *CT_TextSpacing + SpcAft *CT_TextSpacing + BuClrTx *CT_TextBulletColorFollowText + BuClr *CT_Color + BuSzTx *CT_TextBulletSizeFollowText + BuSzPct *CT_TextBulletSizePercent + BuSzPts *CT_TextBulletSizePoint + BuFontTx *CT_TextBulletTypefaceFollowText + BuFont *CT_TextFont + BuNone *CT_TextNoBullet + BuAutoNum *CT_TextAutonumberBullet + BuChar *CT_TextCharBullet + BuBlip *CT_TextBlipBullet + TabLst *CT_TextTabStopList + DefRPr *CT_TextCharacterProperties + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_TextParagraphProperties() *CT_TextParagraphProperties { + ret := &CT_TextParagraphProperties{} + return ret +} + +func (m *CT_TextParagraphProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.MarLAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "marL"}, + Value: fmt.Sprintf("%v", *m.MarLAttr)}) + } + if m.MarRAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "marR"}, + Value: fmt.Sprintf("%v", *m.MarRAttr)}) + } + if m.LvlAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "lvl"}, + Value: fmt.Sprintf("%v", *m.LvlAttr)}) + } + if m.IndentAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "indent"}, + Value: fmt.Sprintf("%v", *m.IndentAttr)}) + } + if m.AlgnAttr != ST_TextAlignTypeUnset { + attr, err := m.AlgnAttr.MarshalXMLAttr(xml.Name{Local: "algn"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.DefTabSzAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "defTabSz"}, + Value: fmt.Sprintf("%v", *m.DefTabSzAttr)}) + } + if m.RtlAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "rtl"}, + Value: fmt.Sprintf("%d", b2i(*m.RtlAttr))}) + } + if m.EaLnBrkAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "eaLnBrk"}, + Value: fmt.Sprintf("%d", b2i(*m.EaLnBrkAttr))}) + } + if m.FontAlgnAttr != ST_TextFontAlignTypeUnset { + attr, err := m.FontAlgnAttr.MarshalXMLAttr(xml.Name{Local: "fontAlgn"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.LatinLnBrkAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "latinLnBrk"}, + Value: fmt.Sprintf("%d", b2i(*m.LatinLnBrkAttr))}) + } + if m.HangingPunctAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "hangingPunct"}, + Value: fmt.Sprintf("%d", b2i(*m.HangingPunctAttr))}) + } + e.EncodeToken(start) + if m.LnSpc != nil { + selnSpc := xml.StartElement{Name: xml.Name{Local: "a:lnSpc"}} + e.EncodeElement(m.LnSpc, selnSpc) + } + if m.SpcBef != nil { + sespcBef := xml.StartElement{Name: xml.Name{Local: "a:spcBef"}} + e.EncodeElement(m.SpcBef, sespcBef) + } + if m.SpcAft != nil { + sespcAft := xml.StartElement{Name: xml.Name{Local: "a:spcAft"}} + e.EncodeElement(m.SpcAft, sespcAft) + } + if m.BuClrTx != nil { + sebuClrTx := xml.StartElement{Name: xml.Name{Local: "a:buClrTx"}} + e.EncodeElement(m.BuClrTx, sebuClrTx) + } + if m.BuClr != nil { + sebuClr := xml.StartElement{Name: xml.Name{Local: "a:buClr"}} + e.EncodeElement(m.BuClr, sebuClr) + } + if m.BuSzTx != nil { + sebuSzTx := xml.StartElement{Name: xml.Name{Local: "a:buSzTx"}} + e.EncodeElement(m.BuSzTx, sebuSzTx) + } + if m.BuSzPct != nil { + sebuSzPct := xml.StartElement{Name: xml.Name{Local: "a:buSzPct"}} + e.EncodeElement(m.BuSzPct, sebuSzPct) + } + if m.BuSzPts != nil { + sebuSzPts := xml.StartElement{Name: xml.Name{Local: "a:buSzPts"}} + e.EncodeElement(m.BuSzPts, sebuSzPts) + } + if m.BuFontTx != nil { + sebuFontTx := xml.StartElement{Name: xml.Name{Local: "a:buFontTx"}} + e.EncodeElement(m.BuFontTx, sebuFontTx) + } + if m.BuFont != nil { + sebuFont := xml.StartElement{Name: xml.Name{Local: "a:buFont"}} + e.EncodeElement(m.BuFont, sebuFont) + } + if m.BuNone != nil { + sebuNone := xml.StartElement{Name: xml.Name{Local: "a:buNone"}} + e.EncodeElement(m.BuNone, sebuNone) + } + if m.BuAutoNum != nil { + sebuAutoNum := xml.StartElement{Name: xml.Name{Local: "a:buAutoNum"}} + e.EncodeElement(m.BuAutoNum, sebuAutoNum) + } + if m.BuChar != nil { + sebuChar := xml.StartElement{Name: xml.Name{Local: "a:buChar"}} + e.EncodeElement(m.BuChar, sebuChar) + } + if m.BuBlip != nil { + sebuBlip := xml.StartElement{Name: xml.Name{Local: "a:buBlip"}} + e.EncodeElement(m.BuBlip, sebuBlip) + } + if m.TabLst != nil { + setabLst := xml.StartElement{Name: xml.Name{Local: "a:tabLst"}} + e.EncodeElement(m.TabLst, setabLst) + } + if m.DefRPr != nil { + sedefRPr := xml.StartElement{Name: xml.Name{Local: "a:defRPr"}} + e.EncodeElement(m.DefRPr, sedefRPr) + } + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TextParagraphProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "marL" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + pt := int32(parsed) + m.MarLAttr = &pt + continue + } + if attr.Name.Local == "lvl" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + pt := int32(parsed) + m.LvlAttr = &pt + continue + } + if attr.Name.Local == "algn" { + m.AlgnAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "rtl" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.RtlAttr = &parsed + continue + } + if attr.Name.Local == "fontAlgn" { + m.FontAlgnAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "marR" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + pt := int32(parsed) + m.MarRAttr = &pt + continue + } + if attr.Name.Local == "latinLnBrk" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.LatinLnBrkAttr = &parsed + continue + } + if attr.Name.Local == "indent" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + pt := int32(parsed) + m.IndentAttr = &pt + continue + } + if attr.Name.Local == "eaLnBrk" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.EaLnBrkAttr = &parsed + continue + } + if attr.Name.Local == "hangingPunct" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.HangingPunctAttr = &parsed + continue + } + if attr.Name.Local == "defTabSz" { + parsed, err := ParseUnionST_Coordinate32(attr.Value) + if err != nil { + return err + } + m.DefTabSzAttr = &parsed + continue + } + } +lCT_TextParagraphProperties: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lnSpc"}: + m.LnSpc = NewCT_TextSpacing() + if err := d.DecodeElement(m.LnSpc, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "spcBef"}: + m.SpcBef = NewCT_TextSpacing() + if err := d.DecodeElement(m.SpcBef, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "spcAft"}: + m.SpcAft = NewCT_TextSpacing() + if err := d.DecodeElement(m.SpcAft, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "buClrTx"}: + m.BuClrTx = NewCT_TextBulletColorFollowText() + if err := d.DecodeElement(m.BuClrTx, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "buClr"}: + m.BuClr = NewCT_Color() + if err := d.DecodeElement(m.BuClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "buSzTx"}: + m.BuSzTx = NewCT_TextBulletSizeFollowText() + if err := d.DecodeElement(m.BuSzTx, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "buSzPct"}: + m.BuSzPct = NewCT_TextBulletSizePercent() + if err := d.DecodeElement(m.BuSzPct, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "buSzPts"}: + m.BuSzPts = NewCT_TextBulletSizePoint() + if err := d.DecodeElement(m.BuSzPts, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "buFontTx"}: + m.BuFontTx = NewCT_TextBulletTypefaceFollowText() + if err := d.DecodeElement(m.BuFontTx, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "buFont"}: + m.BuFont = NewCT_TextFont() + if err := d.DecodeElement(m.BuFont, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "buNone"}: + m.BuNone = NewCT_TextNoBullet() + if err := d.DecodeElement(m.BuNone, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "buAutoNum"}: + m.BuAutoNum = NewCT_TextAutonumberBullet() + if err := d.DecodeElement(m.BuAutoNum, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "buChar"}: + m.BuChar = NewCT_TextCharBullet() + if err := d.DecodeElement(m.BuChar, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "buBlip"}: + m.BuBlip = NewCT_TextBlipBullet() + if err := d.DecodeElement(m.BuBlip, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "tabLst"}: + m.TabLst = NewCT_TextTabStopList() + if err := d.DecodeElement(m.TabLst, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "defRPr"}: + m.DefRPr = NewCT_TextCharacterProperties() + if err := d.DecodeElement(m.DefRPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_TextParagraphProperties %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TextParagraphProperties + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TextParagraphProperties and its children +func (m *CT_TextParagraphProperties) Validate() error { + return m.ValidateWithPath("CT_TextParagraphProperties") +} + +// ValidateWithPath validates the CT_TextParagraphProperties and its children, prefixing error messages with path +func (m *CT_TextParagraphProperties) ValidateWithPath(path string) error { + if m.MarLAttr != nil { + if *m.MarLAttr < 0 { + return fmt.Errorf("%s/m.MarLAttr must be >= 0 (have %v)", path, *m.MarLAttr) + } + if *m.MarLAttr > 51206400 { + return fmt.Errorf("%s/m.MarLAttr must be <= 51206400 (have %v)", path, *m.MarLAttr) + } + } + if m.MarRAttr != nil { + if *m.MarRAttr < 0 { + return fmt.Errorf("%s/m.MarRAttr must be >= 0 (have %v)", path, *m.MarRAttr) + } + if *m.MarRAttr > 51206400 { + return fmt.Errorf("%s/m.MarRAttr must be <= 51206400 (have %v)", path, *m.MarRAttr) + } + } + if m.LvlAttr != nil { + if *m.LvlAttr < 0 { + return fmt.Errorf("%s/m.LvlAttr must be >= 0 (have %v)", path, *m.LvlAttr) + } + if *m.LvlAttr > 8 { + return fmt.Errorf("%s/m.LvlAttr must be <= 8 (have %v)", path, *m.LvlAttr) + } + } + if m.IndentAttr != nil { + if *m.IndentAttr < -51206400 { + return fmt.Errorf("%s/m.IndentAttr must be >= -51206400 (have %v)", path, *m.IndentAttr) + } + if *m.IndentAttr > 51206400 { + return fmt.Errorf("%s/m.IndentAttr must be <= 51206400 (have %v)", path, *m.IndentAttr) + } + } + if err := m.AlgnAttr.ValidateWithPath(path + "/AlgnAttr"); err != nil { + return err + } + if m.DefTabSzAttr != nil { + if err := m.DefTabSzAttr.ValidateWithPath(path + "/DefTabSzAttr"); err != nil { + return err + } + } + if err := m.FontAlgnAttr.ValidateWithPath(path + "/FontAlgnAttr"); err != nil { + return err + } + if m.LnSpc != nil { + if err := m.LnSpc.ValidateWithPath(path + "/LnSpc"); err != nil { + return err + } + } + if m.SpcBef != nil { + if err := m.SpcBef.ValidateWithPath(path + "/SpcBef"); err != nil { + return err + } + } + if m.SpcAft != nil { + if err := m.SpcAft.ValidateWithPath(path + "/SpcAft"); err != nil { + return err + } + } + if m.BuClrTx != nil { + if err := m.BuClrTx.ValidateWithPath(path + "/BuClrTx"); err != nil { + return err + } + } + if m.BuClr != nil { + if err := m.BuClr.ValidateWithPath(path + "/BuClr"); err != nil { + return err + } + } + if m.BuSzTx != nil { + if err := m.BuSzTx.ValidateWithPath(path + "/BuSzTx"); err != nil { + return err + } + } + if m.BuSzPct != nil { + if err := m.BuSzPct.ValidateWithPath(path + "/BuSzPct"); err != nil { + return err + } + } + if m.BuSzPts != nil { + if err := m.BuSzPts.ValidateWithPath(path + "/BuSzPts"); err != nil { + return err + } + } + if m.BuFontTx != nil { + if err := m.BuFontTx.ValidateWithPath(path + "/BuFontTx"); err != nil { + return err + } + } + if m.BuFont != nil { + if err := m.BuFont.ValidateWithPath(path + "/BuFont"); err != nil { + return err + } + } + if m.BuNone != nil { + if err := m.BuNone.ValidateWithPath(path + "/BuNone"); err != nil { + return err + } + } + if m.BuAutoNum != nil { + if err := m.BuAutoNum.ValidateWithPath(path + "/BuAutoNum"); err != nil { + return err + } + } + if m.BuChar != nil { + if err := m.BuChar.ValidateWithPath(path + "/BuChar"); err != nil { + return err + } + } + if m.BuBlip != nil { + if err := m.BuBlip.ValidateWithPath(path + "/BuBlip"); err != nil { + return err + } + } + if m.TabLst != nil { + if err := m.TabLst.ValidateWithPath(path + "/TabLst"); err != nil { + return err + } + } + if m.DefRPr != nil { + if err := m.DefRPr.ValidateWithPath(path + "/DefRPr"); err != nil { + return err + } + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextShapeAutofit.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextShapeAutofit.go new file mode 100644 index 00000000..74791f77 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextShapeAutofit.go @@ -0,0 +1,54 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_TextShapeAutofit struct { +} + +func NewCT_TextShapeAutofit() *CT_TextShapeAutofit { + ret := &CT_TextShapeAutofit{} + return ret +} + +func (m *CT_TextShapeAutofit) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TextShapeAutofit) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_TextShapeAutofit: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_TextShapeAutofit and its children +func (m *CT_TextShapeAutofit) Validate() error { + return m.ValidateWithPath("CT_TextShapeAutofit") +} + +// ValidateWithPath validates the CT_TextShapeAutofit and its children, prefixing error messages with path +func (m *CT_TextShapeAutofit) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextSpacing.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextSpacing.go new file mode 100644 index 00000000..4d1fb366 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextSpacing.go @@ -0,0 +1,95 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_TextSpacing struct { + SpcPct *CT_TextSpacingPercent + SpcPts *CT_TextSpacingPoint +} + +func NewCT_TextSpacing() *CT_TextSpacing { + ret := &CT_TextSpacing{} + return ret +} + +func (m *CT_TextSpacing) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.SpcPct != nil { + sespcPct := xml.StartElement{Name: xml.Name{Local: "a:spcPct"}} + e.EncodeElement(m.SpcPct, sespcPct) + } + if m.SpcPts != nil { + sespcPts := xml.StartElement{Name: xml.Name{Local: "a:spcPts"}} + e.EncodeElement(m.SpcPts, sespcPts) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TextSpacing) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_TextSpacing: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "spcPct"}: + m.SpcPct = NewCT_TextSpacingPercent() + if err := d.DecodeElement(m.SpcPct, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "spcPts"}: + m.SpcPts = NewCT_TextSpacingPoint() + if err := d.DecodeElement(m.SpcPts, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_TextSpacing %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TextSpacing + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TextSpacing and its children +func (m *CT_TextSpacing) Validate() error { + return m.ValidateWithPath("CT_TextSpacing") +} + +// ValidateWithPath validates the CT_TextSpacing and its children, prefixing error messages with path +func (m *CT_TextSpacing) ValidateWithPath(path string) error { + if m.SpcPct != nil { + if err := m.SpcPct.ValidateWithPath(path + "/SpcPct"); err != nil { + return err + } + } + if m.SpcPts != nil { + if err := m.SpcPts.ValidateWithPath(path + "/SpcPts"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextSpacingPercent.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextSpacingPercent.go new file mode 100644 index 00000000..b629669f --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextSpacingPercent.go @@ -0,0 +1,70 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_TextSpacingPercent struct { + ValAttr ST_TextSpacingPercentOrPercentString +} + +func NewCT_TextSpacingPercent() *CT_TextSpacingPercent { + ret := &CT_TextSpacingPercent{} + return ret +} + +func (m *CT_TextSpacingPercent) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "val"}, + Value: fmt.Sprintf("%v", m.ValAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TextSpacingPercent) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := ParseUnionST_TextSpacingPercentOrPercentString(attr.Value) + if err != nil { + return err + } + m.ValAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_TextSpacingPercent: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_TextSpacingPercent and its children +func (m *CT_TextSpacingPercent) Validate() error { + return m.ValidateWithPath("CT_TextSpacingPercent") +} + +// ValidateWithPath validates the CT_TextSpacingPercent and its children, prefixing error messages with path +func (m *CT_TextSpacingPercent) ValidateWithPath(path string) error { + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextSpacingPoint.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextSpacingPoint.go new file mode 100644 index 00000000..3da5630c --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextSpacingPoint.go @@ -0,0 +1,76 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" +) + +type CT_TextSpacingPoint struct { + ValAttr int32 +} + +func NewCT_TextSpacingPoint() *CT_TextSpacingPoint { + ret := &CT_TextSpacingPoint{} + ret.ValAttr = 0 + return ret +} + +func (m *CT_TextSpacingPoint) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "val"}, + Value: fmt.Sprintf("%v", m.ValAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TextSpacingPoint) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = 0 + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + m.ValAttr = int32(parsed) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_TextSpacingPoint: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_TextSpacingPoint and its children +func (m *CT_TextSpacingPoint) Validate() error { + return m.ValidateWithPath("CT_TextSpacingPoint") +} + +// ValidateWithPath validates the CT_TextSpacingPoint and its children, prefixing error messages with path +func (m *CT_TextSpacingPoint) ValidateWithPath(path string) error { + if m.ValAttr < 0 { + return fmt.Errorf("%s/m.ValAttr must be >= 0 (have %v)", path, m.ValAttr) + } + if m.ValAttr > 158400 { + return fmt.Errorf("%s/m.ValAttr must be <= 158400 (have %v)", path, m.ValAttr) + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextTabStop.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextTabStop.go new file mode 100644 index 00000000..e0539397 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextTabStop.go @@ -0,0 +1,89 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_TextTabStop struct { + PosAttr *ST_Coordinate32 + AlgnAttr ST_TextTabAlignType +} + +func NewCT_TextTabStop() *CT_TextTabStop { + ret := &CT_TextTabStop{} + return ret +} + +func (m *CT_TextTabStop) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.PosAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "pos"}, + Value: fmt.Sprintf("%v", *m.PosAttr)}) + } + if m.AlgnAttr != ST_TextTabAlignTypeUnset { + attr, err := m.AlgnAttr.MarshalXMLAttr(xml.Name{Local: "algn"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TextTabStop) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "pos" { + parsed, err := ParseUnionST_Coordinate32(attr.Value) + if err != nil { + return err + } + m.PosAttr = &parsed + continue + } + if attr.Name.Local == "algn" { + m.AlgnAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_TextTabStop: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_TextTabStop and its children +func (m *CT_TextTabStop) Validate() error { + return m.ValidateWithPath("CT_TextTabStop") +} + +// ValidateWithPath validates the CT_TextTabStop and its children, prefixing error messages with path +func (m *CT_TextTabStop) ValidateWithPath(path string) error { + if m.PosAttr != nil { + if err := m.PosAttr.ValidateWithPath(path + "/PosAttr"); err != nil { + return err + } + } + if err := m.AlgnAttr.ValidateWithPath(path + "/AlgnAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextTabStopList.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextTabStopList.go new file mode 100644 index 00000000..aeb6f384 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextTabStopList.go @@ -0,0 +1,84 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_TextTabStopList struct { + Tab []*CT_TextTabStop +} + +func NewCT_TextTabStopList() *CT_TextTabStopList { + ret := &CT_TextTabStopList{} + return ret +} + +func (m *CT_TextTabStopList) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Tab != nil { + setab := xml.StartElement{Name: xml.Name{Local: "a:tab"}} + for _, c := range m.Tab { + e.EncodeElement(c, setab) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TextTabStopList) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_TextTabStopList: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "tab"}: + tmp := NewCT_TextTabStop() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Tab = append(m.Tab, tmp) + default: + gooxml.Log("skipping unsupported element on CT_TextTabStopList %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TextTabStopList + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TextTabStopList and its children +func (m *CT_TextTabStopList) Validate() error { + return m.ValidateWithPath("CT_TextTabStopList") +} + +// ValidateWithPath validates the CT_TextTabStopList and its children, prefixing error messages with path +func (m *CT_TextTabStopList) ValidateWithPath(path string) error { + for i, v := range m.Tab { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Tab[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextUnderlineFillFollowText.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextUnderlineFillFollowText.go new file mode 100644 index 00000000..8e52430d --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextUnderlineFillFollowText.go @@ -0,0 +1,54 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_TextUnderlineFillFollowText struct { +} + +func NewCT_TextUnderlineFillFollowText() *CT_TextUnderlineFillFollowText { + ret := &CT_TextUnderlineFillFollowText{} + return ret +} + +func (m *CT_TextUnderlineFillFollowText) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TextUnderlineFillFollowText) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_TextUnderlineFillFollowText: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_TextUnderlineFillFollowText and its children +func (m *CT_TextUnderlineFillFollowText) Validate() error { + return m.ValidateWithPath("CT_TextUnderlineFillFollowText") +} + +// ValidateWithPath validates the CT_TextUnderlineFillFollowText and its children, prefixing error messages with path +func (m *CT_TextUnderlineFillFollowText) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextUnderlineFillGroupWrapper.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextUnderlineFillGroupWrapper.go new file mode 100644 index 00000000..e24542ec --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextUnderlineFillGroupWrapper.go @@ -0,0 +1,155 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_TextUnderlineFillGroupWrapper struct { + NoFill *CT_NoFillProperties + SolidFill *CT_SolidColorFillProperties + GradFill *CT_GradientFillProperties + BlipFill *CT_BlipFillProperties + PattFill *CT_PatternFillProperties + GrpFill *CT_GroupFillProperties +} + +func NewCT_TextUnderlineFillGroupWrapper() *CT_TextUnderlineFillGroupWrapper { + ret := &CT_TextUnderlineFillGroupWrapper{} + return ret +} + +func (m *CT_TextUnderlineFillGroupWrapper) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.NoFill != nil { + senoFill := xml.StartElement{Name: xml.Name{Local: "a:noFill"}} + e.EncodeElement(m.NoFill, senoFill) + } + if m.SolidFill != nil { + sesolidFill := xml.StartElement{Name: xml.Name{Local: "a:solidFill"}} + e.EncodeElement(m.SolidFill, sesolidFill) + } + if m.GradFill != nil { + segradFill := xml.StartElement{Name: xml.Name{Local: "a:gradFill"}} + e.EncodeElement(m.GradFill, segradFill) + } + if m.BlipFill != nil { + seblipFill := xml.StartElement{Name: xml.Name{Local: "a:blipFill"}} + e.EncodeElement(m.BlipFill, seblipFill) + } + if m.PattFill != nil { + sepattFill := xml.StartElement{Name: xml.Name{Local: "a:pattFill"}} + e.EncodeElement(m.PattFill, sepattFill) + } + if m.GrpFill != nil { + segrpFill := xml.StartElement{Name: xml.Name{Local: "a:grpFill"}} + e.EncodeElement(m.GrpFill, segrpFill) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TextUnderlineFillGroupWrapper) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_TextUnderlineFillGroupWrapper: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "noFill"}: + m.NoFill = NewCT_NoFillProperties() + if err := d.DecodeElement(m.NoFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "solidFill"}: + m.SolidFill = NewCT_SolidColorFillProperties() + if err := d.DecodeElement(m.SolidFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "gradFill"}: + m.GradFill = NewCT_GradientFillProperties() + if err := d.DecodeElement(m.GradFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blipFill"}: + m.BlipFill = NewCT_BlipFillProperties() + if err := d.DecodeElement(m.BlipFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "pattFill"}: + m.PattFill = NewCT_PatternFillProperties() + if err := d.DecodeElement(m.PattFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "grpFill"}: + m.GrpFill = NewCT_GroupFillProperties() + if err := d.DecodeElement(m.GrpFill, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_TextUnderlineFillGroupWrapper %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TextUnderlineFillGroupWrapper + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TextUnderlineFillGroupWrapper and its children +func (m *CT_TextUnderlineFillGroupWrapper) Validate() error { + return m.ValidateWithPath("CT_TextUnderlineFillGroupWrapper") +} + +// ValidateWithPath validates the CT_TextUnderlineFillGroupWrapper and its children, prefixing error messages with path +func (m *CT_TextUnderlineFillGroupWrapper) ValidateWithPath(path string) error { + if m.NoFill != nil { + if err := m.NoFill.ValidateWithPath(path + "/NoFill"); err != nil { + return err + } + } + if m.SolidFill != nil { + if err := m.SolidFill.ValidateWithPath(path + "/SolidFill"); err != nil { + return err + } + } + if m.GradFill != nil { + if err := m.GradFill.ValidateWithPath(path + "/GradFill"); err != nil { + return err + } + } + if m.BlipFill != nil { + if err := m.BlipFill.ValidateWithPath(path + "/BlipFill"); err != nil { + return err + } + } + if m.PattFill != nil { + if err := m.PattFill.ValidateWithPath(path + "/PattFill"); err != nil { + return err + } + } + if m.GrpFill != nil { + if err := m.GrpFill.ValidateWithPath(path + "/GrpFill"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextUnderlineLineFollowText.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextUnderlineLineFollowText.go new file mode 100644 index 00000000..c79eaf47 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TextUnderlineLineFollowText.go @@ -0,0 +1,54 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_TextUnderlineLineFollowText struct { +} + +func NewCT_TextUnderlineLineFollowText() *CT_TextUnderlineLineFollowText { + ret := &CT_TextUnderlineLineFollowText{} + return ret +} + +func (m *CT_TextUnderlineLineFollowText) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TextUnderlineLineFollowText) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_TextUnderlineLineFollowText: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_TextUnderlineLineFollowText and its children +func (m *CT_TextUnderlineLineFollowText) Validate() error { + return m.ValidateWithPath("CT_TextUnderlineLineFollowText") +} + +// ValidateWithPath validates the CT_TextUnderlineLineFollowText and its children, prefixing error messages with path +func (m *CT_TextUnderlineLineFollowText) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ThemeableLineStyle.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ThemeableLineStyle.go new file mode 100644 index 00000000..7970c94c --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_ThemeableLineStyle.go @@ -0,0 +1,95 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_ThemeableLineStyle struct { + Ln *CT_LineProperties + LnRef *CT_StyleMatrixReference +} + +func NewCT_ThemeableLineStyle() *CT_ThemeableLineStyle { + ret := &CT_ThemeableLineStyle{} + return ret +} + +func (m *CT_ThemeableLineStyle) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Ln != nil { + seln := xml.StartElement{Name: xml.Name{Local: "a:ln"}} + e.EncodeElement(m.Ln, seln) + } + if m.LnRef != nil { + selnRef := xml.StartElement{Name: xml.Name{Local: "a:lnRef"}} + e.EncodeElement(m.LnRef, selnRef) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_ThemeableLineStyle) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_ThemeableLineStyle: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "ln"}: + m.Ln = NewCT_LineProperties() + if err := d.DecodeElement(m.Ln, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lnRef"}: + m.LnRef = NewCT_StyleMatrixReference() + if err := d.DecodeElement(m.LnRef, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_ThemeableLineStyle %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_ThemeableLineStyle + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_ThemeableLineStyle and its children +func (m *CT_ThemeableLineStyle) Validate() error { + return m.ValidateWithPath("CT_ThemeableLineStyle") +} + +// ValidateWithPath validates the CT_ThemeableLineStyle and its children, prefixing error messages with path +func (m *CT_ThemeableLineStyle) ValidateWithPath(path string) error { + if m.Ln != nil { + if err := m.Ln.ValidateWithPath(path + "/Ln"); err != nil { + return err + } + } + if m.LnRef != nil { + if err := m.LnRef.ValidateWithPath(path + "/LnRef"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TileInfoProperties.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TileInfoProperties.go new file mode 100644 index 00000000..c23863b3 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TileInfoProperties.go @@ -0,0 +1,158 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_TileInfoProperties struct { + TxAttr *ST_Coordinate + TyAttr *ST_Coordinate + SxAttr *ST_Percentage + SyAttr *ST_Percentage + FlipAttr ST_TileFlipMode + AlgnAttr ST_RectAlignment +} + +func NewCT_TileInfoProperties() *CT_TileInfoProperties { + ret := &CT_TileInfoProperties{} + return ret +} + +func (m *CT_TileInfoProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.TxAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "tx"}, + Value: fmt.Sprintf("%v", *m.TxAttr)}) + } + if m.TyAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "ty"}, + Value: fmt.Sprintf("%v", *m.TyAttr)}) + } + if m.SxAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "sx"}, + Value: fmt.Sprintf("%v", *m.SxAttr)}) + } + if m.SyAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "sy"}, + Value: fmt.Sprintf("%v", *m.SyAttr)}) + } + if m.FlipAttr != ST_TileFlipModeUnset { + attr, err := m.FlipAttr.MarshalXMLAttr(xml.Name{Local: "flip"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.AlgnAttr != ST_RectAlignmentUnset { + attr, err := m.AlgnAttr.MarshalXMLAttr(xml.Name{Local: "algn"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TileInfoProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "tx" { + parsed, err := ParseUnionST_Coordinate(attr.Value) + if err != nil { + return err + } + m.TxAttr = &parsed + continue + } + if attr.Name.Local == "ty" { + parsed, err := ParseUnionST_Coordinate(attr.Value) + if err != nil { + return err + } + m.TyAttr = &parsed + continue + } + if attr.Name.Local == "sx" { + parsed, err := ParseUnionST_Percentage(attr.Value) + if err != nil { + return err + } + m.SxAttr = &parsed + continue + } + if attr.Name.Local == "sy" { + parsed, err := ParseUnionST_Percentage(attr.Value) + if err != nil { + return err + } + m.SyAttr = &parsed + continue + } + if attr.Name.Local == "flip" { + m.FlipAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "algn" { + m.AlgnAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_TileInfoProperties: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_TileInfoProperties and its children +func (m *CT_TileInfoProperties) Validate() error { + return m.ValidateWithPath("CT_TileInfoProperties") +} + +// ValidateWithPath validates the CT_TileInfoProperties and its children, prefixing error messages with path +func (m *CT_TileInfoProperties) ValidateWithPath(path string) error { + if m.TxAttr != nil { + if err := m.TxAttr.ValidateWithPath(path + "/TxAttr"); err != nil { + return err + } + } + if m.TyAttr != nil { + if err := m.TyAttr.ValidateWithPath(path + "/TyAttr"); err != nil { + return err + } + } + if m.SxAttr != nil { + if err := m.SxAttr.ValidateWithPath(path + "/SxAttr"); err != nil { + return err + } + } + if m.SyAttr != nil { + if err := m.SyAttr.ValidateWithPath(path + "/SyAttr"); err != nil { + return err + } + } + if err := m.FlipAttr.ValidateWithPath(path + "/FlipAttr"); err != nil { + return err + } + if err := m.AlgnAttr.ValidateWithPath(path + "/AlgnAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TintEffect.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TintEffect.go new file mode 100644 index 00000000..a0d4e151 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TintEffect.go @@ -0,0 +1,97 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" +) + +type CT_TintEffect struct { + HueAttr *int32 + AmtAttr *ST_FixedPercentage +} + +func NewCT_TintEffect() *CT_TintEffect { + ret := &CT_TintEffect{} + return ret +} + +func (m *CT_TintEffect) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.HueAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "hue"}, + Value: fmt.Sprintf("%v", *m.HueAttr)}) + } + if m.AmtAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "amt"}, + Value: fmt.Sprintf("%v", *m.AmtAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TintEffect) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "hue" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + pt := int32(parsed) + m.HueAttr = &pt + continue + } + if attr.Name.Local == "amt" { + parsed, err := ParseUnionST_FixedPercentage(attr.Value) + if err != nil { + return err + } + m.AmtAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_TintEffect: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_TintEffect and its children +func (m *CT_TintEffect) Validate() error { + return m.ValidateWithPath("CT_TintEffect") +} + +// ValidateWithPath validates the CT_TintEffect and its children, prefixing error messages with path +func (m *CT_TintEffect) ValidateWithPath(path string) error { + if m.HueAttr != nil { + if *m.HueAttr < 0 { + return fmt.Errorf("%s/m.HueAttr must be >= 0 (have %v)", path, *m.HueAttr) + } + if *m.HueAttr >= 21600000 { + return fmt.Errorf("%s/m.HueAttr must be < 21600000 (have %v)", path, *m.HueAttr) + } + } + if m.AmtAttr != nil { + if err := m.AmtAttr.ValidateWithPath(path + "/AmtAttr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Transform2D.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Transform2D.go new file mode 100644 index 00000000..44a9f145 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Transform2D.go @@ -0,0 +1,139 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type CT_Transform2D struct { + RotAttr *int32 + FlipHAttr *bool + FlipVAttr *bool + Off *CT_Point2D + Ext *CT_PositiveSize2D +} + +func NewCT_Transform2D() *CT_Transform2D { + ret := &CT_Transform2D{} + return ret +} + +func (m *CT_Transform2D) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.RotAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "rot"}, + Value: fmt.Sprintf("%v", *m.RotAttr)}) + } + if m.FlipHAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "flipH"}, + Value: fmt.Sprintf("%d", b2i(*m.FlipHAttr))}) + } + if m.FlipVAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "flipV"}, + Value: fmt.Sprintf("%d", b2i(*m.FlipVAttr))}) + } + e.EncodeToken(start) + if m.Off != nil { + seoff := xml.StartElement{Name: xml.Name{Local: "a:off"}} + e.EncodeElement(m.Off, seoff) + } + if m.Ext != nil { + seext := xml.StartElement{Name: xml.Name{Local: "a:ext"}} + e.EncodeElement(m.Ext, seext) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Transform2D) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "rot" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + pt := int32(parsed) + m.RotAttr = &pt + continue + } + if attr.Name.Local == "flipH" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.FlipHAttr = &parsed + continue + } + if attr.Name.Local == "flipV" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.FlipVAttr = &parsed + continue + } + } +lCT_Transform2D: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "off"}: + m.Off = NewCT_Point2D() + if err := d.DecodeElement(m.Off, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "ext"}: + m.Ext = NewCT_PositiveSize2D() + if err := d.DecodeElement(m.Ext, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_Transform2D %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Transform2D + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Transform2D and its children +func (m *CT_Transform2D) Validate() error { + return m.ValidateWithPath("CT_Transform2D") +} + +// ValidateWithPath validates the CT_Transform2D and its children, prefixing error messages with path +func (m *CT_Transform2D) ValidateWithPath(path string) error { + if m.Off != nil { + if err := m.Off.ValidateWithPath(path + "/Off"); err != nil { + return err + } + } + if m.Ext != nil { + if err := m.Ext.ValidateWithPath(path + "/Ext"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TransformEffect.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TransformEffect.go new file mode 100644 index 00000000..bfb06fa9 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_TransformEffect.go @@ -0,0 +1,173 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "strconv" +) + +type CT_TransformEffect struct { + SxAttr *ST_Percentage + SyAttr *ST_Percentage + KxAttr *int32 + KyAttr *int32 + TxAttr *ST_Coordinate + TyAttr *ST_Coordinate +} + +func NewCT_TransformEffect() *CT_TransformEffect { + ret := &CT_TransformEffect{} + return ret +} + +func (m *CT_TransformEffect) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.SxAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "sx"}, + Value: fmt.Sprintf("%v", *m.SxAttr)}) + } + if m.SyAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "sy"}, + Value: fmt.Sprintf("%v", *m.SyAttr)}) + } + if m.KxAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "kx"}, + Value: fmt.Sprintf("%v", *m.KxAttr)}) + } + if m.KyAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "ky"}, + Value: fmt.Sprintf("%v", *m.KyAttr)}) + } + if m.TxAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "tx"}, + Value: fmt.Sprintf("%v", *m.TxAttr)}) + } + if m.TyAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "ty"}, + Value: fmt.Sprintf("%v", *m.TyAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TransformEffect) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "sx" { + parsed, err := ParseUnionST_Percentage(attr.Value) + if err != nil { + return err + } + m.SxAttr = &parsed + continue + } + if attr.Name.Local == "sy" { + parsed, err := ParseUnionST_Percentage(attr.Value) + if err != nil { + return err + } + m.SyAttr = &parsed + continue + } + if attr.Name.Local == "kx" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + pt := int32(parsed) + m.KxAttr = &pt + continue + } + if attr.Name.Local == "ky" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + pt := int32(parsed) + m.KyAttr = &pt + continue + } + if attr.Name.Local == "tx" { + parsed, err := ParseUnionST_Coordinate(attr.Value) + if err != nil { + return err + } + m.TxAttr = &parsed + continue + } + if attr.Name.Local == "ty" { + parsed, err := ParseUnionST_Coordinate(attr.Value) + if err != nil { + return err + } + m.TyAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_TransformEffect: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_TransformEffect and its children +func (m *CT_TransformEffect) Validate() error { + return m.ValidateWithPath("CT_TransformEffect") +} + +// ValidateWithPath validates the CT_TransformEffect and its children, prefixing error messages with path +func (m *CT_TransformEffect) ValidateWithPath(path string) error { + if m.SxAttr != nil { + if err := m.SxAttr.ValidateWithPath(path + "/SxAttr"); err != nil { + return err + } + } + if m.SyAttr != nil { + if err := m.SyAttr.ValidateWithPath(path + "/SyAttr"); err != nil { + return err + } + } + if m.KxAttr != nil { + if *m.KxAttr <= -5400000 { + return fmt.Errorf("%s/m.KxAttr must be > -5400000 (have %v)", path, *m.KxAttr) + } + if *m.KxAttr >= 5400000 { + return fmt.Errorf("%s/m.KxAttr must be < 5400000 (have %v)", path, *m.KxAttr) + } + } + if m.KyAttr != nil { + if *m.KyAttr <= -5400000 { + return fmt.Errorf("%s/m.KyAttr must be > -5400000 (have %v)", path, *m.KyAttr) + } + if *m.KyAttr >= 5400000 { + return fmt.Errorf("%s/m.KyAttr must be < 5400000 (have %v)", path, *m.KyAttr) + } + } + if m.TxAttr != nil { + if err := m.TxAttr.ValidateWithPath(path + "/TxAttr"); err != nil { + return err + } + } + if m.TyAttr != nil { + if err := m.TyAttr.ValidateWithPath(path + "/TyAttr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Vector3D.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Vector3D.go new file mode 100644 index 00000000..f347d00a --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_Vector3D.go @@ -0,0 +1,98 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type CT_Vector3D struct { + DxAttr ST_Coordinate + DyAttr ST_Coordinate + DzAttr ST_Coordinate +} + +func NewCT_Vector3D() *CT_Vector3D { + ret := &CT_Vector3D{} + return ret +} + +func (m *CT_Vector3D) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "dx"}, + Value: fmt.Sprintf("%v", m.DxAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "dy"}, + Value: fmt.Sprintf("%v", m.DyAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "dz"}, + Value: fmt.Sprintf("%v", m.DzAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Vector3D) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "dx" { + parsed, err := ParseUnionST_Coordinate(attr.Value) + if err != nil { + return err + } + m.DxAttr = parsed + continue + } + if attr.Name.Local == "dy" { + parsed, err := ParseUnionST_Coordinate(attr.Value) + if err != nil { + return err + } + m.DyAttr = parsed + continue + } + if attr.Name.Local == "dz" { + parsed, err := ParseUnionST_Coordinate(attr.Value) + if err != nil { + return err + } + m.DzAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Vector3D: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Vector3D and its children +func (m *CT_Vector3D) Validate() error { + return m.ValidateWithPath("CT_Vector3D") +} + +// ValidateWithPath validates the CT_Vector3D and its children, prefixing error messages with path +func (m *CT_Vector3D) ValidateWithPath(path string) error { + if err := m.DxAttr.ValidateWithPath(path + "/DxAttr"); err != nil { + return err + } + if err := m.DyAttr.ValidateWithPath(path + "/DyAttr"); err != nil { + return err + } + if err := m.DzAttr.ValidateWithPath(path + "/DzAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_VideoFile.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_VideoFile.go new file mode 100644 index 00000000..3e113107 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_VideoFile.go @@ -0,0 +1,107 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_VideoFile struct { + LinkAttr string + ContentTypeAttr *string + ExtLst *CT_OfficeArtExtensionList +} + +func NewCT_VideoFile() *CT_VideoFile { + ret := &CT_VideoFile{} + return ret +} + +func (m *CT_VideoFile) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "r:link"}, + Value: fmt.Sprintf("%v", m.LinkAttr)}) + if m.ContentTypeAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "contentType"}, + Value: fmt.Sprintf("%v", *m.ContentTypeAttr)}) + } + e.EncodeToken(start) + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "a:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_VideoFile) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Space == "http://schemas.openxmlformats.org/officeDocument/2006/relationships" && attr.Name.Local == "link" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.LinkAttr = parsed + continue + } + if attr.Name.Local == "contentType" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ContentTypeAttr = &parsed + continue + } + } +lCT_VideoFile: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_VideoFile %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_VideoFile + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_VideoFile and its children +func (m *CT_VideoFile) Validate() error { + return m.ValidateWithPath("CT_VideoFile") +} + +// ValidateWithPath validates the CT_VideoFile and its children, prefixing error messages with path +func (m *CT_VideoFile) ValidateWithPath(path string) error { + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_WholeE2oFormatting.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_WholeE2oFormatting.go new file mode 100644 index 00000000..b94e04e7 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_WholeE2oFormatting.go @@ -0,0 +1,111 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_WholeE2oFormatting struct { + Ln *CT_LineProperties + EffectLst *CT_EffectList + EffectDag *CT_EffectContainer +} + +func NewCT_WholeE2oFormatting() *CT_WholeE2oFormatting { + ret := &CT_WholeE2oFormatting{} + return ret +} + +func (m *CT_WholeE2oFormatting) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Name.Local = "a:CT_WholeE2oFormatting" + e.EncodeToken(start) + if m.Ln != nil { + seln := xml.StartElement{Name: xml.Name{Local: "a:ln"}} + e.EncodeElement(m.Ln, seln) + } + if m.EffectLst != nil { + seeffectLst := xml.StartElement{Name: xml.Name{Local: "a:effectLst"}} + e.EncodeElement(m.EffectLst, seeffectLst) + } + if m.EffectDag != nil { + seeffectDag := xml.StartElement{Name: xml.Name{Local: "a:effectDag"}} + e.EncodeElement(m.EffectDag, seeffectDag) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_WholeE2oFormatting) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_WholeE2oFormatting: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "ln"}: + m.Ln = NewCT_LineProperties() + if err := d.DecodeElement(m.Ln, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "effectLst"}: + m.EffectLst = NewCT_EffectList() + if err := d.DecodeElement(m.EffectLst, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "effectDag"}: + m.EffectDag = NewCT_EffectContainer() + if err := d.DecodeElement(m.EffectDag, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_WholeE2oFormatting %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_WholeE2oFormatting + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_WholeE2oFormatting and its children +func (m *CT_WholeE2oFormatting) Validate() error { + return m.ValidateWithPath("CT_WholeE2oFormatting") +} + +// ValidateWithPath validates the CT_WholeE2oFormatting and its children, prefixing error messages with path +func (m *CT_WholeE2oFormatting) ValidateWithPath(path string) error { + if m.Ln != nil { + if err := m.Ln.ValidateWithPath(path + "/Ln"); err != nil { + return err + } + } + if m.EffectLst != nil { + if err := m.EffectLst.ValidateWithPath(path + "/EffectLst"); err != nil { + return err + } + } + if m.EffectDag != nil { + if err := m.EffectDag.ValidateWithPath(path + "/EffectDag"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_XYAdjustHandle.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_XYAdjustHandle.go new file mode 100644 index 00000000..41f9b33f --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/CT_XYAdjustHandle.go @@ -0,0 +1,178 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_XYAdjustHandle struct { + GdRefXAttr *string + MinXAttr *ST_AdjCoordinate + MaxXAttr *ST_AdjCoordinate + GdRefYAttr *string + MinYAttr *ST_AdjCoordinate + MaxYAttr *ST_AdjCoordinate + Pos *CT_AdjPoint2D +} + +func NewCT_XYAdjustHandle() *CT_XYAdjustHandle { + ret := &CT_XYAdjustHandle{} + ret.Pos = NewCT_AdjPoint2D() + return ret +} + +func (m *CT_XYAdjustHandle) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.GdRefXAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "gdRefX"}, + Value: fmt.Sprintf("%v", *m.GdRefXAttr)}) + } + if m.MinXAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "minX"}, + Value: fmt.Sprintf("%v", *m.MinXAttr)}) + } + if m.MaxXAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "maxX"}, + Value: fmt.Sprintf("%v", *m.MaxXAttr)}) + } + if m.GdRefYAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "gdRefY"}, + Value: fmt.Sprintf("%v", *m.GdRefYAttr)}) + } + if m.MinYAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "minY"}, + Value: fmt.Sprintf("%v", *m.MinYAttr)}) + } + if m.MaxYAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "maxY"}, + Value: fmt.Sprintf("%v", *m.MaxYAttr)}) + } + e.EncodeToken(start) + sepos := xml.StartElement{Name: xml.Name{Local: "a:pos"}} + e.EncodeElement(m.Pos, sepos) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_XYAdjustHandle) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.Pos = NewCT_AdjPoint2D() + for _, attr := range start.Attr { + if attr.Name.Local == "gdRefX" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.GdRefXAttr = &parsed + continue + } + if attr.Name.Local == "minX" { + parsed, err := ParseUnionST_AdjCoordinate(attr.Value) + if err != nil { + return err + } + m.MinXAttr = &parsed + continue + } + if attr.Name.Local == "maxX" { + parsed, err := ParseUnionST_AdjCoordinate(attr.Value) + if err != nil { + return err + } + m.MaxXAttr = &parsed + continue + } + if attr.Name.Local == "gdRefY" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.GdRefYAttr = &parsed + continue + } + if attr.Name.Local == "minY" { + parsed, err := ParseUnionST_AdjCoordinate(attr.Value) + if err != nil { + return err + } + m.MinYAttr = &parsed + continue + } + if attr.Name.Local == "maxY" { + parsed, err := ParseUnionST_AdjCoordinate(attr.Value) + if err != nil { + return err + } + m.MaxYAttr = &parsed + continue + } + } +lCT_XYAdjustHandle: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "pos"}: + if err := d.DecodeElement(m.Pos, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_XYAdjustHandle %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_XYAdjustHandle + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_XYAdjustHandle and its children +func (m *CT_XYAdjustHandle) Validate() error { + return m.ValidateWithPath("CT_XYAdjustHandle") +} + +// ValidateWithPath validates the CT_XYAdjustHandle and its children, prefixing error messages with path +func (m *CT_XYAdjustHandle) ValidateWithPath(path string) error { + if m.MinXAttr != nil { + if err := m.MinXAttr.ValidateWithPath(path + "/MinXAttr"); err != nil { + return err + } + } + if m.MaxXAttr != nil { + if err := m.MaxXAttr.ValidateWithPath(path + "/MaxXAttr"); err != nil { + return err + } + } + if m.MinYAttr != nil { + if err := m.MinYAttr.ValidateWithPath(path + "/MinYAttr"); err != nil { + return err + } + } + if m.MaxYAttr != nil { + if err := m.MaxYAttr.ValidateWithPath(path + "/MaxYAttr"); err != nil { + return err + } + } + if err := m.Pos.ValidateWithPath(path + "/Pos"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_ColorChoice.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_ColorChoice.go new file mode 100644 index 00000000..322e6623 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_ColorChoice.go @@ -0,0 +1,153 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type EG_ColorChoice struct { + ScrgbClr *CT_ScRgbColor + SrgbClr *CT_SRgbColor + HslClr *CT_HslColor + SysClr *CT_SystemColor + SchemeClr *CT_SchemeColor + PrstClr *CT_PresetColor +} + +func NewEG_ColorChoice() *EG_ColorChoice { + ret := &EG_ColorChoice{} + return ret +} + +func (m *EG_ColorChoice) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.ScrgbClr != nil { + sescrgbClr := xml.StartElement{Name: xml.Name{Local: "a:scrgbClr"}} + e.EncodeElement(m.ScrgbClr, sescrgbClr) + } + if m.SrgbClr != nil { + sesrgbClr := xml.StartElement{Name: xml.Name{Local: "a:srgbClr"}} + e.EncodeElement(m.SrgbClr, sesrgbClr) + } + if m.HslClr != nil { + sehslClr := xml.StartElement{Name: xml.Name{Local: "a:hslClr"}} + e.EncodeElement(m.HslClr, sehslClr) + } + if m.SysClr != nil { + sesysClr := xml.StartElement{Name: xml.Name{Local: "a:sysClr"}} + e.EncodeElement(m.SysClr, sesysClr) + } + if m.SchemeClr != nil { + seschemeClr := xml.StartElement{Name: xml.Name{Local: "a:schemeClr"}} + e.EncodeElement(m.SchemeClr, seschemeClr) + } + if m.PrstClr != nil { + seprstClr := xml.StartElement{Name: xml.Name{Local: "a:prstClr"}} + e.EncodeElement(m.PrstClr, seprstClr) + } + return nil +} + +func (m *EG_ColorChoice) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_ColorChoice: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "scrgbClr"}: + m.ScrgbClr = NewCT_ScRgbColor() + if err := d.DecodeElement(m.ScrgbClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "srgbClr"}: + m.SrgbClr = NewCT_SRgbColor() + if err := d.DecodeElement(m.SrgbClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hslClr"}: + m.HslClr = NewCT_HslColor() + if err := d.DecodeElement(m.HslClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "sysClr"}: + m.SysClr = NewCT_SystemColor() + if err := d.DecodeElement(m.SysClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "schemeClr"}: + m.SchemeClr = NewCT_SchemeColor() + if err := d.DecodeElement(m.SchemeClr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "prstClr"}: + m.PrstClr = NewCT_PresetColor() + if err := d.DecodeElement(m.PrstClr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on EG_ColorChoice %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_ColorChoice + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_ColorChoice and its children +func (m *EG_ColorChoice) Validate() error { + return m.ValidateWithPath("EG_ColorChoice") +} + +// ValidateWithPath validates the EG_ColorChoice and its children, prefixing error messages with path +func (m *EG_ColorChoice) ValidateWithPath(path string) error { + if m.ScrgbClr != nil { + if err := m.ScrgbClr.ValidateWithPath(path + "/ScrgbClr"); err != nil { + return err + } + } + if m.SrgbClr != nil { + if err := m.SrgbClr.ValidateWithPath(path + "/SrgbClr"); err != nil { + return err + } + } + if m.HslClr != nil { + if err := m.HslClr.ValidateWithPath(path + "/HslClr"); err != nil { + return err + } + } + if m.SysClr != nil { + if err := m.SysClr.ValidateWithPath(path + "/SysClr"); err != nil { + return err + } + } + if m.SchemeClr != nil { + if err := m.SchemeClr.ValidateWithPath(path + "/SchemeClr"); err != nil { + return err + } + } + if m.PrstClr != nil { + if err := m.PrstClr.ValidateWithPath(path + "/PrstClr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_ColorTransform.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_ColorTransform.go new file mode 100644 index 00000000..40c8ce2c --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_ColorTransform.go @@ -0,0 +1,483 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type EG_ColorTransform struct { + Tint *CT_PositiveFixedPercentage + Shade *CT_PositiveFixedPercentage + Comp *CT_ComplementTransform + Inv *CT_InverseTransform + Gray *CT_GrayscaleTransform + Alpha *CT_PositiveFixedPercentage + AlphaOff *CT_FixedPercentage + AlphaMod *CT_PositivePercentage + Hue *CT_PositiveFixedAngle + HueOff *CT_Angle + HueMod *CT_PositivePercentage + Sat *CT_Percentage + SatOff *CT_Percentage + SatMod *CT_Percentage + Lum *CT_Percentage + LumOff *CT_Percentage + LumMod *CT_Percentage + Red *CT_Percentage + RedOff *CT_Percentage + RedMod *CT_Percentage + Green *CT_Percentage + GreenOff *CT_Percentage + GreenMod *CT_Percentage + Blue *CT_Percentage + BlueOff *CT_Percentage + BlueMod *CT_Percentage + Gamma *CT_GammaTransform + InvGamma *CT_InverseGammaTransform +} + +func NewEG_ColorTransform() *EG_ColorTransform { + ret := &EG_ColorTransform{} + return ret +} + +func (m *EG_ColorTransform) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.Tint != nil { + setint := xml.StartElement{Name: xml.Name{Local: "a:tint"}} + e.EncodeElement(m.Tint, setint) + } + if m.Shade != nil { + seshade := xml.StartElement{Name: xml.Name{Local: "a:shade"}} + e.EncodeElement(m.Shade, seshade) + } + if m.Comp != nil { + secomp := xml.StartElement{Name: xml.Name{Local: "a:comp"}} + e.EncodeElement(m.Comp, secomp) + } + if m.Inv != nil { + seinv := xml.StartElement{Name: xml.Name{Local: "a:inv"}} + e.EncodeElement(m.Inv, seinv) + } + if m.Gray != nil { + segray := xml.StartElement{Name: xml.Name{Local: "a:gray"}} + e.EncodeElement(m.Gray, segray) + } + if m.Alpha != nil { + sealpha := xml.StartElement{Name: xml.Name{Local: "a:alpha"}} + e.EncodeElement(m.Alpha, sealpha) + } + if m.AlphaOff != nil { + sealphaOff := xml.StartElement{Name: xml.Name{Local: "a:alphaOff"}} + e.EncodeElement(m.AlphaOff, sealphaOff) + } + if m.AlphaMod != nil { + sealphaMod := xml.StartElement{Name: xml.Name{Local: "a:alphaMod"}} + e.EncodeElement(m.AlphaMod, sealphaMod) + } + if m.Hue != nil { + sehue := xml.StartElement{Name: xml.Name{Local: "a:hue"}} + e.EncodeElement(m.Hue, sehue) + } + if m.HueOff != nil { + sehueOff := xml.StartElement{Name: xml.Name{Local: "a:hueOff"}} + e.EncodeElement(m.HueOff, sehueOff) + } + if m.HueMod != nil { + sehueMod := xml.StartElement{Name: xml.Name{Local: "a:hueMod"}} + e.EncodeElement(m.HueMod, sehueMod) + } + if m.Sat != nil { + sesat := xml.StartElement{Name: xml.Name{Local: "a:sat"}} + e.EncodeElement(m.Sat, sesat) + } + if m.SatOff != nil { + sesatOff := xml.StartElement{Name: xml.Name{Local: "a:satOff"}} + e.EncodeElement(m.SatOff, sesatOff) + } + if m.SatMod != nil { + sesatMod := xml.StartElement{Name: xml.Name{Local: "a:satMod"}} + e.EncodeElement(m.SatMod, sesatMod) + } + if m.Lum != nil { + selum := xml.StartElement{Name: xml.Name{Local: "a:lum"}} + e.EncodeElement(m.Lum, selum) + } + if m.LumOff != nil { + selumOff := xml.StartElement{Name: xml.Name{Local: "a:lumOff"}} + e.EncodeElement(m.LumOff, selumOff) + } + if m.LumMod != nil { + selumMod := xml.StartElement{Name: xml.Name{Local: "a:lumMod"}} + e.EncodeElement(m.LumMod, selumMod) + } + if m.Red != nil { + sered := xml.StartElement{Name: xml.Name{Local: "a:red"}} + e.EncodeElement(m.Red, sered) + } + if m.RedOff != nil { + seredOff := xml.StartElement{Name: xml.Name{Local: "a:redOff"}} + e.EncodeElement(m.RedOff, seredOff) + } + if m.RedMod != nil { + seredMod := xml.StartElement{Name: xml.Name{Local: "a:redMod"}} + e.EncodeElement(m.RedMod, seredMod) + } + if m.Green != nil { + segreen := xml.StartElement{Name: xml.Name{Local: "a:green"}} + e.EncodeElement(m.Green, segreen) + } + if m.GreenOff != nil { + segreenOff := xml.StartElement{Name: xml.Name{Local: "a:greenOff"}} + e.EncodeElement(m.GreenOff, segreenOff) + } + if m.GreenMod != nil { + segreenMod := xml.StartElement{Name: xml.Name{Local: "a:greenMod"}} + e.EncodeElement(m.GreenMod, segreenMod) + } + if m.Blue != nil { + seblue := xml.StartElement{Name: xml.Name{Local: "a:blue"}} + e.EncodeElement(m.Blue, seblue) + } + if m.BlueOff != nil { + seblueOff := xml.StartElement{Name: xml.Name{Local: "a:blueOff"}} + e.EncodeElement(m.BlueOff, seblueOff) + } + if m.BlueMod != nil { + seblueMod := xml.StartElement{Name: xml.Name{Local: "a:blueMod"}} + e.EncodeElement(m.BlueMod, seblueMod) + } + if m.Gamma != nil { + segamma := xml.StartElement{Name: xml.Name{Local: "a:gamma"}} + e.EncodeElement(m.Gamma, segamma) + } + if m.InvGamma != nil { + seinvGamma := xml.StartElement{Name: xml.Name{Local: "a:invGamma"}} + e.EncodeElement(m.InvGamma, seinvGamma) + } + return nil +} + +func (m *EG_ColorTransform) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_ColorTransform: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "tint"}: + m.Tint = NewCT_PositiveFixedPercentage() + if err := d.DecodeElement(m.Tint, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "shade"}: + m.Shade = NewCT_PositiveFixedPercentage() + if err := d.DecodeElement(m.Shade, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "comp"}: + m.Comp = NewCT_ComplementTransform() + if err := d.DecodeElement(m.Comp, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "inv"}: + m.Inv = NewCT_InverseTransform() + if err := d.DecodeElement(m.Inv, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "gray"}: + m.Gray = NewCT_GrayscaleTransform() + if err := d.DecodeElement(m.Gray, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alpha"}: + m.Alpha = NewCT_PositiveFixedPercentage() + if err := d.DecodeElement(m.Alpha, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaOff"}: + m.AlphaOff = NewCT_FixedPercentage() + if err := d.DecodeElement(m.AlphaOff, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaMod"}: + m.AlphaMod = NewCT_PositivePercentage() + if err := d.DecodeElement(m.AlphaMod, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hue"}: + m.Hue = NewCT_PositiveFixedAngle() + if err := d.DecodeElement(m.Hue, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hueOff"}: + m.HueOff = NewCT_Angle() + if err := d.DecodeElement(m.HueOff, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hueMod"}: + m.HueMod = NewCT_PositivePercentage() + if err := d.DecodeElement(m.HueMod, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "sat"}: + m.Sat = NewCT_Percentage() + if err := d.DecodeElement(m.Sat, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "satOff"}: + m.SatOff = NewCT_Percentage() + if err := d.DecodeElement(m.SatOff, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "satMod"}: + m.SatMod = NewCT_Percentage() + if err := d.DecodeElement(m.SatMod, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lum"}: + m.Lum = NewCT_Percentage() + if err := d.DecodeElement(m.Lum, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lumOff"}: + m.LumOff = NewCT_Percentage() + if err := d.DecodeElement(m.LumOff, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lumMod"}: + m.LumMod = NewCT_Percentage() + if err := d.DecodeElement(m.LumMod, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "red"}: + m.Red = NewCT_Percentage() + if err := d.DecodeElement(m.Red, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "redOff"}: + m.RedOff = NewCT_Percentage() + if err := d.DecodeElement(m.RedOff, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "redMod"}: + m.RedMod = NewCT_Percentage() + if err := d.DecodeElement(m.RedMod, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "green"}: + m.Green = NewCT_Percentage() + if err := d.DecodeElement(m.Green, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "greenOff"}: + m.GreenOff = NewCT_Percentage() + if err := d.DecodeElement(m.GreenOff, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "greenMod"}: + m.GreenMod = NewCT_Percentage() + if err := d.DecodeElement(m.GreenMod, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blue"}: + m.Blue = NewCT_Percentage() + if err := d.DecodeElement(m.Blue, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blueOff"}: + m.BlueOff = NewCT_Percentage() + if err := d.DecodeElement(m.BlueOff, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blueMod"}: + m.BlueMod = NewCT_Percentage() + if err := d.DecodeElement(m.BlueMod, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "gamma"}: + m.Gamma = NewCT_GammaTransform() + if err := d.DecodeElement(m.Gamma, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "invGamma"}: + m.InvGamma = NewCT_InverseGammaTransform() + if err := d.DecodeElement(m.InvGamma, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on EG_ColorTransform %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_ColorTransform + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_ColorTransform and its children +func (m *EG_ColorTransform) Validate() error { + return m.ValidateWithPath("EG_ColorTransform") +} + +// ValidateWithPath validates the EG_ColorTransform and its children, prefixing error messages with path +func (m *EG_ColorTransform) ValidateWithPath(path string) error { + if m.Tint != nil { + if err := m.Tint.ValidateWithPath(path + "/Tint"); err != nil { + return err + } + } + if m.Shade != nil { + if err := m.Shade.ValidateWithPath(path + "/Shade"); err != nil { + return err + } + } + if m.Comp != nil { + if err := m.Comp.ValidateWithPath(path + "/Comp"); err != nil { + return err + } + } + if m.Inv != nil { + if err := m.Inv.ValidateWithPath(path + "/Inv"); err != nil { + return err + } + } + if m.Gray != nil { + if err := m.Gray.ValidateWithPath(path + "/Gray"); err != nil { + return err + } + } + if m.Alpha != nil { + if err := m.Alpha.ValidateWithPath(path + "/Alpha"); err != nil { + return err + } + } + if m.AlphaOff != nil { + if err := m.AlphaOff.ValidateWithPath(path + "/AlphaOff"); err != nil { + return err + } + } + if m.AlphaMod != nil { + if err := m.AlphaMod.ValidateWithPath(path + "/AlphaMod"); err != nil { + return err + } + } + if m.Hue != nil { + if err := m.Hue.ValidateWithPath(path + "/Hue"); err != nil { + return err + } + } + if m.HueOff != nil { + if err := m.HueOff.ValidateWithPath(path + "/HueOff"); err != nil { + return err + } + } + if m.HueMod != nil { + if err := m.HueMod.ValidateWithPath(path + "/HueMod"); err != nil { + return err + } + } + if m.Sat != nil { + if err := m.Sat.ValidateWithPath(path + "/Sat"); err != nil { + return err + } + } + if m.SatOff != nil { + if err := m.SatOff.ValidateWithPath(path + "/SatOff"); err != nil { + return err + } + } + if m.SatMod != nil { + if err := m.SatMod.ValidateWithPath(path + "/SatMod"); err != nil { + return err + } + } + if m.Lum != nil { + if err := m.Lum.ValidateWithPath(path + "/Lum"); err != nil { + return err + } + } + if m.LumOff != nil { + if err := m.LumOff.ValidateWithPath(path + "/LumOff"); err != nil { + return err + } + } + if m.LumMod != nil { + if err := m.LumMod.ValidateWithPath(path + "/LumMod"); err != nil { + return err + } + } + if m.Red != nil { + if err := m.Red.ValidateWithPath(path + "/Red"); err != nil { + return err + } + } + if m.RedOff != nil { + if err := m.RedOff.ValidateWithPath(path + "/RedOff"); err != nil { + return err + } + } + if m.RedMod != nil { + if err := m.RedMod.ValidateWithPath(path + "/RedMod"); err != nil { + return err + } + } + if m.Green != nil { + if err := m.Green.ValidateWithPath(path + "/Green"); err != nil { + return err + } + } + if m.GreenOff != nil { + if err := m.GreenOff.ValidateWithPath(path + "/GreenOff"); err != nil { + return err + } + } + if m.GreenMod != nil { + if err := m.GreenMod.ValidateWithPath(path + "/GreenMod"); err != nil { + return err + } + } + if m.Blue != nil { + if err := m.Blue.ValidateWithPath(path + "/Blue"); err != nil { + return err + } + } + if m.BlueOff != nil { + if err := m.BlueOff.ValidateWithPath(path + "/BlueOff"); err != nil { + return err + } + } + if m.BlueMod != nil { + if err := m.BlueMod.ValidateWithPath(path + "/BlueMod"); err != nil { + return err + } + } + if m.Gamma != nil { + if err := m.Gamma.ValidateWithPath(path + "/Gamma"); err != nil { + return err + } + } + if m.InvGamma != nil { + if err := m.InvGamma.ValidateWithPath(path + "/InvGamma"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_Effect.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_Effect.go new file mode 100644 index 00000000..286adc78 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_Effect.go @@ -0,0 +1,513 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type EG_Effect struct { + Cont *CT_EffectContainer + Effect *CT_EffectReference + AlphaBiLevel *CT_AlphaBiLevelEffect + AlphaCeiling *CT_AlphaCeilingEffect + AlphaFloor *CT_AlphaFloorEffect + AlphaInv *CT_AlphaInverseEffect + AlphaMod *CT_AlphaModulateEffect + AlphaModFix *CT_AlphaModulateFixedEffect + AlphaOutset *CT_AlphaOutsetEffect + AlphaRepl *CT_AlphaReplaceEffect + BiLevel *CT_BiLevelEffect + Blend *CT_BlendEffect + Blur *CT_BlurEffect + ClrChange *CT_ColorChangeEffect + ClrRepl *CT_ColorReplaceEffect + Duotone *CT_DuotoneEffect + Fill *CT_FillEffect + FillOverlay *CT_FillOverlayEffect + Glow *CT_GlowEffect + Grayscl *CT_GrayscaleEffect + Hsl *CT_HSLEffect + InnerShdw *CT_InnerShadowEffect + Lum *CT_LuminanceEffect + OuterShdw *CT_OuterShadowEffect + PrstShdw *CT_PresetShadowEffect + Reflection *CT_ReflectionEffect + RelOff *CT_RelativeOffsetEffect + SoftEdge *CT_SoftEdgesEffect + Tint *CT_TintEffect + Xfrm *CT_TransformEffect +} + +func NewEG_Effect() *EG_Effect { + ret := &EG_Effect{} + return ret +} + +func (m *EG_Effect) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.Cont != nil { + secont := xml.StartElement{Name: xml.Name{Local: "a:cont"}} + e.EncodeElement(m.Cont, secont) + } + if m.Effect != nil { + seeffect := xml.StartElement{Name: xml.Name{Local: "a:effect"}} + e.EncodeElement(m.Effect, seeffect) + } + if m.AlphaBiLevel != nil { + sealphaBiLevel := xml.StartElement{Name: xml.Name{Local: "a:alphaBiLevel"}} + e.EncodeElement(m.AlphaBiLevel, sealphaBiLevel) + } + if m.AlphaCeiling != nil { + sealphaCeiling := xml.StartElement{Name: xml.Name{Local: "a:alphaCeiling"}} + e.EncodeElement(m.AlphaCeiling, sealphaCeiling) + } + if m.AlphaFloor != nil { + sealphaFloor := xml.StartElement{Name: xml.Name{Local: "a:alphaFloor"}} + e.EncodeElement(m.AlphaFloor, sealphaFloor) + } + if m.AlphaInv != nil { + sealphaInv := xml.StartElement{Name: xml.Name{Local: "a:alphaInv"}} + e.EncodeElement(m.AlphaInv, sealphaInv) + } + if m.AlphaMod != nil { + sealphaMod := xml.StartElement{Name: xml.Name{Local: "a:alphaMod"}} + e.EncodeElement(m.AlphaMod, sealphaMod) + } + if m.AlphaModFix != nil { + sealphaModFix := xml.StartElement{Name: xml.Name{Local: "a:alphaModFix"}} + e.EncodeElement(m.AlphaModFix, sealphaModFix) + } + if m.AlphaOutset != nil { + sealphaOutset := xml.StartElement{Name: xml.Name{Local: "a:alphaOutset"}} + e.EncodeElement(m.AlphaOutset, sealphaOutset) + } + if m.AlphaRepl != nil { + sealphaRepl := xml.StartElement{Name: xml.Name{Local: "a:alphaRepl"}} + e.EncodeElement(m.AlphaRepl, sealphaRepl) + } + if m.BiLevel != nil { + sebiLevel := xml.StartElement{Name: xml.Name{Local: "a:biLevel"}} + e.EncodeElement(m.BiLevel, sebiLevel) + } + if m.Blend != nil { + seblend := xml.StartElement{Name: xml.Name{Local: "a:blend"}} + e.EncodeElement(m.Blend, seblend) + } + if m.Blur != nil { + seblur := xml.StartElement{Name: xml.Name{Local: "a:blur"}} + e.EncodeElement(m.Blur, seblur) + } + if m.ClrChange != nil { + seclrChange := xml.StartElement{Name: xml.Name{Local: "a:clrChange"}} + e.EncodeElement(m.ClrChange, seclrChange) + } + if m.ClrRepl != nil { + seclrRepl := xml.StartElement{Name: xml.Name{Local: "a:clrRepl"}} + e.EncodeElement(m.ClrRepl, seclrRepl) + } + if m.Duotone != nil { + seduotone := xml.StartElement{Name: xml.Name{Local: "a:duotone"}} + e.EncodeElement(m.Duotone, seduotone) + } + if m.Fill != nil { + sefill := xml.StartElement{Name: xml.Name{Local: "a:fill"}} + e.EncodeElement(m.Fill, sefill) + } + if m.FillOverlay != nil { + sefillOverlay := xml.StartElement{Name: xml.Name{Local: "a:fillOverlay"}} + e.EncodeElement(m.FillOverlay, sefillOverlay) + } + if m.Glow != nil { + seglow := xml.StartElement{Name: xml.Name{Local: "a:glow"}} + e.EncodeElement(m.Glow, seglow) + } + if m.Grayscl != nil { + segrayscl := xml.StartElement{Name: xml.Name{Local: "a:grayscl"}} + e.EncodeElement(m.Grayscl, segrayscl) + } + if m.Hsl != nil { + sehsl := xml.StartElement{Name: xml.Name{Local: "a:hsl"}} + e.EncodeElement(m.Hsl, sehsl) + } + if m.InnerShdw != nil { + seinnerShdw := xml.StartElement{Name: xml.Name{Local: "a:innerShdw"}} + e.EncodeElement(m.InnerShdw, seinnerShdw) + } + if m.Lum != nil { + selum := xml.StartElement{Name: xml.Name{Local: "a:lum"}} + e.EncodeElement(m.Lum, selum) + } + if m.OuterShdw != nil { + seouterShdw := xml.StartElement{Name: xml.Name{Local: "a:outerShdw"}} + e.EncodeElement(m.OuterShdw, seouterShdw) + } + if m.PrstShdw != nil { + seprstShdw := xml.StartElement{Name: xml.Name{Local: "a:prstShdw"}} + e.EncodeElement(m.PrstShdw, seprstShdw) + } + if m.Reflection != nil { + sereflection := xml.StartElement{Name: xml.Name{Local: "a:reflection"}} + e.EncodeElement(m.Reflection, sereflection) + } + if m.RelOff != nil { + serelOff := xml.StartElement{Name: xml.Name{Local: "a:relOff"}} + e.EncodeElement(m.RelOff, serelOff) + } + if m.SoftEdge != nil { + sesoftEdge := xml.StartElement{Name: xml.Name{Local: "a:softEdge"}} + e.EncodeElement(m.SoftEdge, sesoftEdge) + } + if m.Tint != nil { + setint := xml.StartElement{Name: xml.Name{Local: "a:tint"}} + e.EncodeElement(m.Tint, setint) + } + if m.Xfrm != nil { + sexfrm := xml.StartElement{Name: xml.Name{Local: "a:xfrm"}} + e.EncodeElement(m.Xfrm, sexfrm) + } + return nil +} + +func (m *EG_Effect) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_Effect: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "cont"}: + m.Cont = NewCT_EffectContainer() + if err := d.DecodeElement(m.Cont, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "effect"}: + m.Effect = NewCT_EffectReference() + if err := d.DecodeElement(m.Effect, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaBiLevel"}: + m.AlphaBiLevel = NewCT_AlphaBiLevelEffect() + if err := d.DecodeElement(m.AlphaBiLevel, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaCeiling"}: + m.AlphaCeiling = NewCT_AlphaCeilingEffect() + if err := d.DecodeElement(m.AlphaCeiling, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaFloor"}: + m.AlphaFloor = NewCT_AlphaFloorEffect() + if err := d.DecodeElement(m.AlphaFloor, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaInv"}: + m.AlphaInv = NewCT_AlphaInverseEffect() + if err := d.DecodeElement(m.AlphaInv, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaMod"}: + m.AlphaMod = NewCT_AlphaModulateEffect() + if err := d.DecodeElement(m.AlphaMod, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaModFix"}: + m.AlphaModFix = NewCT_AlphaModulateFixedEffect() + if err := d.DecodeElement(m.AlphaModFix, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaOutset"}: + m.AlphaOutset = NewCT_AlphaOutsetEffect() + if err := d.DecodeElement(m.AlphaOutset, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "alphaRepl"}: + m.AlphaRepl = NewCT_AlphaReplaceEffect() + if err := d.DecodeElement(m.AlphaRepl, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "biLevel"}: + m.BiLevel = NewCT_BiLevelEffect() + if err := d.DecodeElement(m.BiLevel, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blend"}: + m.Blend = NewCT_BlendEffect() + if err := d.DecodeElement(m.Blend, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blur"}: + m.Blur = NewCT_BlurEffect() + if err := d.DecodeElement(m.Blur, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "clrChange"}: + m.ClrChange = NewCT_ColorChangeEffect() + if err := d.DecodeElement(m.ClrChange, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "clrRepl"}: + m.ClrRepl = NewCT_ColorReplaceEffect() + if err := d.DecodeElement(m.ClrRepl, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "duotone"}: + m.Duotone = NewCT_DuotoneEffect() + if err := d.DecodeElement(m.Duotone, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "fill"}: + m.Fill = NewCT_FillEffect() + if err := d.DecodeElement(m.Fill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "fillOverlay"}: + m.FillOverlay = NewCT_FillOverlayEffect() + if err := d.DecodeElement(m.FillOverlay, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "glow"}: + m.Glow = NewCT_GlowEffect() + if err := d.DecodeElement(m.Glow, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "grayscl"}: + m.Grayscl = NewCT_GrayscaleEffect() + if err := d.DecodeElement(m.Grayscl, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "hsl"}: + m.Hsl = NewCT_HSLEffect() + if err := d.DecodeElement(m.Hsl, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "innerShdw"}: + m.InnerShdw = NewCT_InnerShadowEffect() + if err := d.DecodeElement(m.InnerShdw, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lum"}: + m.Lum = NewCT_LuminanceEffect() + if err := d.DecodeElement(m.Lum, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "outerShdw"}: + m.OuterShdw = NewCT_OuterShadowEffect() + if err := d.DecodeElement(m.OuterShdw, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "prstShdw"}: + m.PrstShdw = NewCT_PresetShadowEffect() + if err := d.DecodeElement(m.PrstShdw, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "reflection"}: + m.Reflection = NewCT_ReflectionEffect() + if err := d.DecodeElement(m.Reflection, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "relOff"}: + m.RelOff = NewCT_RelativeOffsetEffect() + if err := d.DecodeElement(m.RelOff, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "softEdge"}: + m.SoftEdge = NewCT_SoftEdgesEffect() + if err := d.DecodeElement(m.SoftEdge, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "tint"}: + m.Tint = NewCT_TintEffect() + if err := d.DecodeElement(m.Tint, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "xfrm"}: + m.Xfrm = NewCT_TransformEffect() + if err := d.DecodeElement(m.Xfrm, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on EG_Effect %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_Effect + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_Effect and its children +func (m *EG_Effect) Validate() error { + return m.ValidateWithPath("EG_Effect") +} + +// ValidateWithPath validates the EG_Effect and its children, prefixing error messages with path +func (m *EG_Effect) ValidateWithPath(path string) error { + if m.Cont != nil { + if err := m.Cont.ValidateWithPath(path + "/Cont"); err != nil { + return err + } + } + if m.Effect != nil { + if err := m.Effect.ValidateWithPath(path + "/Effect"); err != nil { + return err + } + } + if m.AlphaBiLevel != nil { + if err := m.AlphaBiLevel.ValidateWithPath(path + "/AlphaBiLevel"); err != nil { + return err + } + } + if m.AlphaCeiling != nil { + if err := m.AlphaCeiling.ValidateWithPath(path + "/AlphaCeiling"); err != nil { + return err + } + } + if m.AlphaFloor != nil { + if err := m.AlphaFloor.ValidateWithPath(path + "/AlphaFloor"); err != nil { + return err + } + } + if m.AlphaInv != nil { + if err := m.AlphaInv.ValidateWithPath(path + "/AlphaInv"); err != nil { + return err + } + } + if m.AlphaMod != nil { + if err := m.AlphaMod.ValidateWithPath(path + "/AlphaMod"); err != nil { + return err + } + } + if m.AlphaModFix != nil { + if err := m.AlphaModFix.ValidateWithPath(path + "/AlphaModFix"); err != nil { + return err + } + } + if m.AlphaOutset != nil { + if err := m.AlphaOutset.ValidateWithPath(path + "/AlphaOutset"); err != nil { + return err + } + } + if m.AlphaRepl != nil { + if err := m.AlphaRepl.ValidateWithPath(path + "/AlphaRepl"); err != nil { + return err + } + } + if m.BiLevel != nil { + if err := m.BiLevel.ValidateWithPath(path + "/BiLevel"); err != nil { + return err + } + } + if m.Blend != nil { + if err := m.Blend.ValidateWithPath(path + "/Blend"); err != nil { + return err + } + } + if m.Blur != nil { + if err := m.Blur.ValidateWithPath(path + "/Blur"); err != nil { + return err + } + } + if m.ClrChange != nil { + if err := m.ClrChange.ValidateWithPath(path + "/ClrChange"); err != nil { + return err + } + } + if m.ClrRepl != nil { + if err := m.ClrRepl.ValidateWithPath(path + "/ClrRepl"); err != nil { + return err + } + } + if m.Duotone != nil { + if err := m.Duotone.ValidateWithPath(path + "/Duotone"); err != nil { + return err + } + } + if m.Fill != nil { + if err := m.Fill.ValidateWithPath(path + "/Fill"); err != nil { + return err + } + } + if m.FillOverlay != nil { + if err := m.FillOverlay.ValidateWithPath(path + "/FillOverlay"); err != nil { + return err + } + } + if m.Glow != nil { + if err := m.Glow.ValidateWithPath(path + "/Glow"); err != nil { + return err + } + } + if m.Grayscl != nil { + if err := m.Grayscl.ValidateWithPath(path + "/Grayscl"); err != nil { + return err + } + } + if m.Hsl != nil { + if err := m.Hsl.ValidateWithPath(path + "/Hsl"); err != nil { + return err + } + } + if m.InnerShdw != nil { + if err := m.InnerShdw.ValidateWithPath(path + "/InnerShdw"); err != nil { + return err + } + } + if m.Lum != nil { + if err := m.Lum.ValidateWithPath(path + "/Lum"); err != nil { + return err + } + } + if m.OuterShdw != nil { + if err := m.OuterShdw.ValidateWithPath(path + "/OuterShdw"); err != nil { + return err + } + } + if m.PrstShdw != nil { + if err := m.PrstShdw.ValidateWithPath(path + "/PrstShdw"); err != nil { + return err + } + } + if m.Reflection != nil { + if err := m.Reflection.ValidateWithPath(path + "/Reflection"); err != nil { + return err + } + } + if m.RelOff != nil { + if err := m.RelOff.ValidateWithPath(path + "/RelOff"); err != nil { + return err + } + } + if m.SoftEdge != nil { + if err := m.SoftEdge.ValidateWithPath(path + "/SoftEdge"); err != nil { + return err + } + } + if m.Tint != nil { + if err := m.Tint.ValidateWithPath(path + "/Tint"); err != nil { + return err + } + } + if m.Xfrm != nil { + if err := m.Xfrm.ValidateWithPath(path + "/Xfrm"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_EffectProperties.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_EffectProperties.go new file mode 100644 index 00000000..4652c260 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_EffectProperties.go @@ -0,0 +1,93 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type EG_EffectProperties struct { + EffectLst *CT_EffectList + EffectDag *CT_EffectContainer +} + +func NewEG_EffectProperties() *EG_EffectProperties { + ret := &EG_EffectProperties{} + return ret +} + +func (m *EG_EffectProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.EffectLst != nil { + seeffectLst := xml.StartElement{Name: xml.Name{Local: "a:effectLst"}} + e.EncodeElement(m.EffectLst, seeffectLst) + } + if m.EffectDag != nil { + seeffectDag := xml.StartElement{Name: xml.Name{Local: "a:effectDag"}} + e.EncodeElement(m.EffectDag, seeffectDag) + } + return nil +} + +func (m *EG_EffectProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_EffectProperties: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "effectLst"}: + m.EffectLst = NewCT_EffectList() + if err := d.DecodeElement(m.EffectLst, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "effectDag"}: + m.EffectDag = NewCT_EffectContainer() + if err := d.DecodeElement(m.EffectDag, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on EG_EffectProperties %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_EffectProperties + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_EffectProperties and its children +func (m *EG_EffectProperties) Validate() error { + return m.ValidateWithPath("EG_EffectProperties") +} + +// ValidateWithPath validates the EG_EffectProperties and its children, prefixing error messages with path +func (m *EG_EffectProperties) ValidateWithPath(path string) error { + if m.EffectLst != nil { + if err := m.EffectLst.ValidateWithPath(path + "/EffectLst"); err != nil { + return err + } + } + if m.EffectDag != nil { + if err := m.EffectDag.ValidateWithPath(path + "/EffectDag"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_FillModeProperties.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_FillModeProperties.go new file mode 100644 index 00000000..226c870e --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_FillModeProperties.go @@ -0,0 +1,93 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type EG_FillModeProperties struct { + Tile *CT_TileInfoProperties + Stretch *CT_StretchInfoProperties +} + +func NewEG_FillModeProperties() *EG_FillModeProperties { + ret := &EG_FillModeProperties{} + return ret +} + +func (m *EG_FillModeProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.Tile != nil { + setile := xml.StartElement{Name: xml.Name{Local: "a:tile"}} + e.EncodeElement(m.Tile, setile) + } + if m.Stretch != nil { + sestretch := xml.StartElement{Name: xml.Name{Local: "a:stretch"}} + e.EncodeElement(m.Stretch, sestretch) + } + return nil +} + +func (m *EG_FillModeProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_FillModeProperties: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "tile"}: + m.Tile = NewCT_TileInfoProperties() + if err := d.DecodeElement(m.Tile, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "stretch"}: + m.Stretch = NewCT_StretchInfoProperties() + if err := d.DecodeElement(m.Stretch, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on EG_FillModeProperties %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_FillModeProperties + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_FillModeProperties and its children +func (m *EG_FillModeProperties) Validate() error { + return m.ValidateWithPath("EG_FillModeProperties") +} + +// ValidateWithPath validates the EG_FillModeProperties and its children, prefixing error messages with path +func (m *EG_FillModeProperties) ValidateWithPath(path string) error { + if m.Tile != nil { + if err := m.Tile.ValidateWithPath(path + "/Tile"); err != nil { + return err + } + } + if m.Stretch != nil { + if err := m.Stretch.ValidateWithPath(path + "/Stretch"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_FillProperties.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_FillProperties.go new file mode 100644 index 00000000..e0067811 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_FillProperties.go @@ -0,0 +1,153 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type EG_FillProperties struct { + NoFill *CT_NoFillProperties + SolidFill *CT_SolidColorFillProperties + GradFill *CT_GradientFillProperties + BlipFill *CT_BlipFillProperties + PattFill *CT_PatternFillProperties + GrpFill *CT_GroupFillProperties +} + +func NewEG_FillProperties() *EG_FillProperties { + ret := &EG_FillProperties{} + return ret +} + +func (m *EG_FillProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.NoFill != nil { + senoFill := xml.StartElement{Name: xml.Name{Local: "a:noFill"}} + e.EncodeElement(m.NoFill, senoFill) + } + if m.SolidFill != nil { + sesolidFill := xml.StartElement{Name: xml.Name{Local: "a:solidFill"}} + e.EncodeElement(m.SolidFill, sesolidFill) + } + if m.GradFill != nil { + segradFill := xml.StartElement{Name: xml.Name{Local: "a:gradFill"}} + e.EncodeElement(m.GradFill, segradFill) + } + if m.BlipFill != nil { + seblipFill := xml.StartElement{Name: xml.Name{Local: "a:blipFill"}} + e.EncodeElement(m.BlipFill, seblipFill) + } + if m.PattFill != nil { + sepattFill := xml.StartElement{Name: xml.Name{Local: "a:pattFill"}} + e.EncodeElement(m.PattFill, sepattFill) + } + if m.GrpFill != nil { + segrpFill := xml.StartElement{Name: xml.Name{Local: "a:grpFill"}} + e.EncodeElement(m.GrpFill, segrpFill) + } + return nil +} + +func (m *EG_FillProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_FillProperties: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "noFill"}: + m.NoFill = NewCT_NoFillProperties() + if err := d.DecodeElement(m.NoFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "solidFill"}: + m.SolidFill = NewCT_SolidColorFillProperties() + if err := d.DecodeElement(m.SolidFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "gradFill"}: + m.GradFill = NewCT_GradientFillProperties() + if err := d.DecodeElement(m.GradFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "blipFill"}: + m.BlipFill = NewCT_BlipFillProperties() + if err := d.DecodeElement(m.BlipFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "pattFill"}: + m.PattFill = NewCT_PatternFillProperties() + if err := d.DecodeElement(m.PattFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "grpFill"}: + m.GrpFill = NewCT_GroupFillProperties() + if err := d.DecodeElement(m.GrpFill, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on EG_FillProperties %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_FillProperties + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_FillProperties and its children +func (m *EG_FillProperties) Validate() error { + return m.ValidateWithPath("EG_FillProperties") +} + +// ValidateWithPath validates the EG_FillProperties and its children, prefixing error messages with path +func (m *EG_FillProperties) ValidateWithPath(path string) error { + if m.NoFill != nil { + if err := m.NoFill.ValidateWithPath(path + "/NoFill"); err != nil { + return err + } + } + if m.SolidFill != nil { + if err := m.SolidFill.ValidateWithPath(path + "/SolidFill"); err != nil { + return err + } + } + if m.GradFill != nil { + if err := m.GradFill.ValidateWithPath(path + "/GradFill"); err != nil { + return err + } + } + if m.BlipFill != nil { + if err := m.BlipFill.ValidateWithPath(path + "/BlipFill"); err != nil { + return err + } + } + if m.PattFill != nil { + if err := m.PattFill.ValidateWithPath(path + "/PattFill"); err != nil { + return err + } + } + if m.GrpFill != nil { + if err := m.GrpFill.ValidateWithPath(path + "/GrpFill"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_Geometry.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_Geometry.go new file mode 100644 index 00000000..10af0bbf --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_Geometry.go @@ -0,0 +1,93 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type EG_Geometry struct { + CustGeom *CT_CustomGeometry2D + PrstGeom *CT_PresetGeometry2D +} + +func NewEG_Geometry() *EG_Geometry { + ret := &EG_Geometry{} + return ret +} + +func (m *EG_Geometry) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.CustGeom != nil { + secustGeom := xml.StartElement{Name: xml.Name{Local: "a:custGeom"}} + e.EncodeElement(m.CustGeom, secustGeom) + } + if m.PrstGeom != nil { + seprstGeom := xml.StartElement{Name: xml.Name{Local: "a:prstGeom"}} + e.EncodeElement(m.PrstGeom, seprstGeom) + } + return nil +} + +func (m *EG_Geometry) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_Geometry: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "custGeom"}: + m.CustGeom = NewCT_CustomGeometry2D() + if err := d.DecodeElement(m.CustGeom, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "prstGeom"}: + m.PrstGeom = NewCT_PresetGeometry2D() + if err := d.DecodeElement(m.PrstGeom, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on EG_Geometry %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_Geometry + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_Geometry and its children +func (m *EG_Geometry) Validate() error { + return m.ValidateWithPath("EG_Geometry") +} + +// ValidateWithPath validates the EG_Geometry and its children, prefixing error messages with path +func (m *EG_Geometry) ValidateWithPath(path string) error { + if m.CustGeom != nil { + if err := m.CustGeom.ValidateWithPath(path + "/CustGeom"); err != nil { + return err + } + } + if m.PrstGeom != nil { + if err := m.PrstGeom.ValidateWithPath(path + "/PrstGeom"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_LineDashProperties.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_LineDashProperties.go new file mode 100644 index 00000000..96e62354 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_LineDashProperties.go @@ -0,0 +1,93 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type EG_LineDashProperties struct { + PrstDash *CT_PresetLineDashProperties + CustDash *CT_DashStopList +} + +func NewEG_LineDashProperties() *EG_LineDashProperties { + ret := &EG_LineDashProperties{} + return ret +} + +func (m *EG_LineDashProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.PrstDash != nil { + seprstDash := xml.StartElement{Name: xml.Name{Local: "a:prstDash"}} + e.EncodeElement(m.PrstDash, seprstDash) + } + if m.CustDash != nil { + secustDash := xml.StartElement{Name: xml.Name{Local: "a:custDash"}} + e.EncodeElement(m.CustDash, secustDash) + } + return nil +} + +func (m *EG_LineDashProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_LineDashProperties: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "prstDash"}: + m.PrstDash = NewCT_PresetLineDashProperties() + if err := d.DecodeElement(m.PrstDash, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "custDash"}: + m.CustDash = NewCT_DashStopList() + if err := d.DecodeElement(m.CustDash, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on EG_LineDashProperties %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_LineDashProperties + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_LineDashProperties and its children +func (m *EG_LineDashProperties) Validate() error { + return m.ValidateWithPath("EG_LineDashProperties") +} + +// ValidateWithPath validates the EG_LineDashProperties and its children, prefixing error messages with path +func (m *EG_LineDashProperties) ValidateWithPath(path string) error { + if m.PrstDash != nil { + if err := m.PrstDash.ValidateWithPath(path + "/PrstDash"); err != nil { + return err + } + } + if m.CustDash != nil { + if err := m.CustDash.ValidateWithPath(path + "/CustDash"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_LineFillProperties.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_LineFillProperties.go new file mode 100644 index 00000000..548a5c66 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_LineFillProperties.go @@ -0,0 +1,123 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type EG_LineFillProperties struct { + NoFill *CT_NoFillProperties + SolidFill *CT_SolidColorFillProperties + GradFill *CT_GradientFillProperties + PattFill *CT_PatternFillProperties +} + +func NewEG_LineFillProperties() *EG_LineFillProperties { + ret := &EG_LineFillProperties{} + return ret +} + +func (m *EG_LineFillProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.NoFill != nil { + senoFill := xml.StartElement{Name: xml.Name{Local: "a:noFill"}} + e.EncodeElement(m.NoFill, senoFill) + } + if m.SolidFill != nil { + sesolidFill := xml.StartElement{Name: xml.Name{Local: "a:solidFill"}} + e.EncodeElement(m.SolidFill, sesolidFill) + } + if m.GradFill != nil { + segradFill := xml.StartElement{Name: xml.Name{Local: "a:gradFill"}} + e.EncodeElement(m.GradFill, segradFill) + } + if m.PattFill != nil { + sepattFill := xml.StartElement{Name: xml.Name{Local: "a:pattFill"}} + e.EncodeElement(m.PattFill, sepattFill) + } + return nil +} + +func (m *EG_LineFillProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_LineFillProperties: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "noFill"}: + m.NoFill = NewCT_NoFillProperties() + if err := d.DecodeElement(m.NoFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "solidFill"}: + m.SolidFill = NewCT_SolidColorFillProperties() + if err := d.DecodeElement(m.SolidFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "gradFill"}: + m.GradFill = NewCT_GradientFillProperties() + if err := d.DecodeElement(m.GradFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "pattFill"}: + m.PattFill = NewCT_PatternFillProperties() + if err := d.DecodeElement(m.PattFill, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on EG_LineFillProperties %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_LineFillProperties + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_LineFillProperties and its children +func (m *EG_LineFillProperties) Validate() error { + return m.ValidateWithPath("EG_LineFillProperties") +} + +// ValidateWithPath validates the EG_LineFillProperties and its children, prefixing error messages with path +func (m *EG_LineFillProperties) ValidateWithPath(path string) error { + if m.NoFill != nil { + if err := m.NoFill.ValidateWithPath(path + "/NoFill"); err != nil { + return err + } + } + if m.SolidFill != nil { + if err := m.SolidFill.ValidateWithPath(path + "/SolidFill"); err != nil { + return err + } + } + if m.GradFill != nil { + if err := m.GradFill.ValidateWithPath(path + "/GradFill"); err != nil { + return err + } + } + if m.PattFill != nil { + if err := m.PattFill.ValidateWithPath(path + "/PattFill"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_LineJoinProperties.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_LineJoinProperties.go new file mode 100644 index 00000000..8f49c2b6 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_LineJoinProperties.go @@ -0,0 +1,108 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type EG_LineJoinProperties struct { + Round *CT_LineJoinRound + Bevel *CT_LineJoinBevel + Miter *CT_LineJoinMiterProperties +} + +func NewEG_LineJoinProperties() *EG_LineJoinProperties { + ret := &EG_LineJoinProperties{} + return ret +} + +func (m *EG_LineJoinProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.Round != nil { + seround := xml.StartElement{Name: xml.Name{Local: "a:round"}} + e.EncodeElement(m.Round, seround) + } + if m.Bevel != nil { + sebevel := xml.StartElement{Name: xml.Name{Local: "a:bevel"}} + e.EncodeElement(m.Bevel, sebevel) + } + if m.Miter != nil { + semiter := xml.StartElement{Name: xml.Name{Local: "a:miter"}} + e.EncodeElement(m.Miter, semiter) + } + return nil +} + +func (m *EG_LineJoinProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_LineJoinProperties: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "round"}: + m.Round = NewCT_LineJoinRound() + if err := d.DecodeElement(m.Round, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "bevel"}: + m.Bevel = NewCT_LineJoinBevel() + if err := d.DecodeElement(m.Bevel, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "miter"}: + m.Miter = NewCT_LineJoinMiterProperties() + if err := d.DecodeElement(m.Miter, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on EG_LineJoinProperties %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_LineJoinProperties + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_LineJoinProperties and its children +func (m *EG_LineJoinProperties) Validate() error { + return m.ValidateWithPath("EG_LineJoinProperties") +} + +// ValidateWithPath validates the EG_LineJoinProperties and its children, prefixing error messages with path +func (m *EG_LineJoinProperties) ValidateWithPath(path string) error { + if m.Round != nil { + if err := m.Round.ValidateWithPath(path + "/Round"); err != nil { + return err + } + } + if m.Bevel != nil { + if err := m.Bevel.ValidateWithPath(path + "/Bevel"); err != nil { + return err + } + } + if m.Miter != nil { + if err := m.Miter.ValidateWithPath(path + "/Miter"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_Media.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_Media.go new file mode 100644 index 00000000..6d9a4d21 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_Media.go @@ -0,0 +1,139 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type EG_Media struct { + AudioCd *CT_AudioCD + WavAudioFile *CT_EmbeddedWAVAudioFile + AudioFile *CT_AudioFile + VideoFile *CT_VideoFile + QuickTimeFile *CT_QuickTimeFile +} + +func NewEG_Media() *EG_Media { + ret := &EG_Media{} + return ret +} + +func (m *EG_Media) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Name.Local = "a:EG_Media" + if m.AudioCd != nil { + seaudioCd := xml.StartElement{Name: xml.Name{Local: "a:audioCd"}} + e.EncodeElement(m.AudioCd, seaudioCd) + } + if m.WavAudioFile != nil { + sewavAudioFile := xml.StartElement{Name: xml.Name{Local: "a:wavAudioFile"}} + e.EncodeElement(m.WavAudioFile, sewavAudioFile) + } + if m.AudioFile != nil { + seaudioFile := xml.StartElement{Name: xml.Name{Local: "a:audioFile"}} + e.EncodeElement(m.AudioFile, seaudioFile) + } + if m.VideoFile != nil { + sevideoFile := xml.StartElement{Name: xml.Name{Local: "a:videoFile"}} + e.EncodeElement(m.VideoFile, sevideoFile) + } + if m.QuickTimeFile != nil { + sequickTimeFile := xml.StartElement{Name: xml.Name{Local: "a:quickTimeFile"}} + e.EncodeElement(m.QuickTimeFile, sequickTimeFile) + } + return nil +} + +func (m *EG_Media) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_Media: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "audioCd"}: + m.AudioCd = NewCT_AudioCD() + if err := d.DecodeElement(m.AudioCd, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "wavAudioFile"}: + m.WavAudioFile = NewCT_EmbeddedWAVAudioFile() + if err := d.DecodeElement(m.WavAudioFile, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "audioFile"}: + m.AudioFile = NewCT_AudioFile() + if err := d.DecodeElement(m.AudioFile, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "videoFile"}: + m.VideoFile = NewCT_VideoFile() + if err := d.DecodeElement(m.VideoFile, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "quickTimeFile"}: + m.QuickTimeFile = NewCT_QuickTimeFile() + if err := d.DecodeElement(m.QuickTimeFile, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on EG_Media %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_Media + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_Media and its children +func (m *EG_Media) Validate() error { + return m.ValidateWithPath("EG_Media") +} + +// ValidateWithPath validates the EG_Media and its children, prefixing error messages with path +func (m *EG_Media) ValidateWithPath(path string) error { + if m.AudioCd != nil { + if err := m.AudioCd.ValidateWithPath(path + "/AudioCd"); err != nil { + return err + } + } + if m.WavAudioFile != nil { + if err := m.WavAudioFile.ValidateWithPath(path + "/WavAudioFile"); err != nil { + return err + } + } + if m.AudioFile != nil { + if err := m.AudioFile.ValidateWithPath(path + "/AudioFile"); err != nil { + return err + } + } + if m.VideoFile != nil { + if err := m.VideoFile.ValidateWithPath(path + "/VideoFile"); err != nil { + return err + } + } + if m.QuickTimeFile != nil { + if err := m.QuickTimeFile.ValidateWithPath(path + "/QuickTimeFile"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_OfficeArtExtensionList.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_OfficeArtExtensionList.go new file mode 100644 index 00000000..b65b4817 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_OfficeArtExtensionList.go @@ -0,0 +1,82 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type EG_OfficeArtExtensionList struct { + Ext []*CT_OfficeArtExtension +} + +func NewEG_OfficeArtExtensionList() *EG_OfficeArtExtensionList { + ret := &EG_OfficeArtExtensionList{} + return ret +} + +func (m *EG_OfficeArtExtensionList) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.Ext != nil { + seext := xml.StartElement{Name: xml.Name{Local: "a:ext"}} + for _, c := range m.Ext { + e.EncodeElement(c, seext) + } + } + return nil +} + +func (m *EG_OfficeArtExtensionList) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_OfficeArtExtensionList: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "ext"}: + tmp := NewCT_OfficeArtExtension() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Ext = append(m.Ext, tmp) + default: + gooxml.Log("skipping unsupported element on EG_OfficeArtExtensionList %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_OfficeArtExtensionList + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_OfficeArtExtensionList and its children +func (m *EG_OfficeArtExtensionList) Validate() error { + return m.ValidateWithPath("EG_OfficeArtExtensionList") +} + +// ValidateWithPath validates the EG_OfficeArtExtensionList and its children, prefixing error messages with path +func (m *EG_OfficeArtExtensionList) ValidateWithPath(path string) error { + for i, v := range m.Ext { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Ext[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_ShadeProperties.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_ShadeProperties.go new file mode 100644 index 00000000..6e6a88c2 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_ShadeProperties.go @@ -0,0 +1,93 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type EG_ShadeProperties struct { + Lin *CT_LinearShadeProperties + Path *CT_PathShadeProperties +} + +func NewEG_ShadeProperties() *EG_ShadeProperties { + ret := &EG_ShadeProperties{} + return ret +} + +func (m *EG_ShadeProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.Lin != nil { + selin := xml.StartElement{Name: xml.Name{Local: "a:lin"}} + e.EncodeElement(m.Lin, selin) + } + if m.Path != nil { + sepath := xml.StartElement{Name: xml.Name{Local: "a:path"}} + e.EncodeElement(m.Path, sepath) + } + return nil +} + +func (m *EG_ShadeProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_ShadeProperties: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "lin"}: + m.Lin = NewCT_LinearShadeProperties() + if err := d.DecodeElement(m.Lin, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "path"}: + m.Path = NewCT_PathShadeProperties() + if err := d.DecodeElement(m.Path, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on EG_ShadeProperties %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_ShadeProperties + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_ShadeProperties and its children +func (m *EG_ShadeProperties) Validate() error { + return m.ValidateWithPath("EG_ShadeProperties") +} + +// ValidateWithPath validates the EG_ShadeProperties and its children, prefixing error messages with path +func (m *EG_ShadeProperties) ValidateWithPath(path string) error { + if m.Lin != nil { + if err := m.Lin.ValidateWithPath(path + "/Lin"); err != nil { + return err + } + } + if m.Path != nil { + if err := m.Path.ValidateWithPath(path + "/Path"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_Text3D.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_Text3D.go new file mode 100644 index 00000000..6c046c35 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_Text3D.go @@ -0,0 +1,93 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type EG_Text3D struct { + Sp3d *CT_Shape3D + FlatTx *CT_FlatText +} + +func NewEG_Text3D() *EG_Text3D { + ret := &EG_Text3D{} + return ret +} + +func (m *EG_Text3D) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.Sp3d != nil { + sesp3d := xml.StartElement{Name: xml.Name{Local: "a:sp3d"}} + e.EncodeElement(m.Sp3d, sesp3d) + } + if m.FlatTx != nil { + seflatTx := xml.StartElement{Name: xml.Name{Local: "a:flatTx"}} + e.EncodeElement(m.FlatTx, seflatTx) + } + return nil +} + +func (m *EG_Text3D) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_Text3D: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "sp3d"}: + m.Sp3d = NewCT_Shape3D() + if err := d.DecodeElement(m.Sp3d, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "flatTx"}: + m.FlatTx = NewCT_FlatText() + if err := d.DecodeElement(m.FlatTx, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on EG_Text3D %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_Text3D + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_Text3D and its children +func (m *EG_Text3D) Validate() error { + return m.ValidateWithPath("EG_Text3D") +} + +// ValidateWithPath validates the EG_Text3D and its children, prefixing error messages with path +func (m *EG_Text3D) ValidateWithPath(path string) error { + if m.Sp3d != nil { + if err := m.Sp3d.ValidateWithPath(path + "/Sp3d"); err != nil { + return err + } + } + if m.FlatTx != nil { + if err := m.FlatTx.ValidateWithPath(path + "/FlatTx"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_TextAutofit.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_TextAutofit.go new file mode 100644 index 00000000..50928bee --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_TextAutofit.go @@ -0,0 +1,108 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type EG_TextAutofit struct { + NoAutofit *CT_TextNoAutofit + NormAutofit *CT_TextNormalAutofit + SpAutoFit *CT_TextShapeAutofit +} + +func NewEG_TextAutofit() *EG_TextAutofit { + ret := &EG_TextAutofit{} + return ret +} + +func (m *EG_TextAutofit) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.NoAutofit != nil { + senoAutofit := xml.StartElement{Name: xml.Name{Local: "a:noAutofit"}} + e.EncodeElement(m.NoAutofit, senoAutofit) + } + if m.NormAutofit != nil { + senormAutofit := xml.StartElement{Name: xml.Name{Local: "a:normAutofit"}} + e.EncodeElement(m.NormAutofit, senormAutofit) + } + if m.SpAutoFit != nil { + sespAutoFit := xml.StartElement{Name: xml.Name{Local: "a:spAutoFit"}} + e.EncodeElement(m.SpAutoFit, sespAutoFit) + } + return nil +} + +func (m *EG_TextAutofit) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_TextAutofit: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "noAutofit"}: + m.NoAutofit = NewCT_TextNoAutofit() + if err := d.DecodeElement(m.NoAutofit, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "normAutofit"}: + m.NormAutofit = NewCT_TextNormalAutofit() + if err := d.DecodeElement(m.NormAutofit, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "spAutoFit"}: + m.SpAutoFit = NewCT_TextShapeAutofit() + if err := d.DecodeElement(m.SpAutoFit, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on EG_TextAutofit %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_TextAutofit + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_TextAutofit and its children +func (m *EG_TextAutofit) Validate() error { + return m.ValidateWithPath("EG_TextAutofit") +} + +// ValidateWithPath validates the EG_TextAutofit and its children, prefixing error messages with path +func (m *EG_TextAutofit) ValidateWithPath(path string) error { + if m.NoAutofit != nil { + if err := m.NoAutofit.ValidateWithPath(path + "/NoAutofit"); err != nil { + return err + } + } + if m.NormAutofit != nil { + if err := m.NormAutofit.ValidateWithPath(path + "/NormAutofit"); err != nil { + return err + } + } + if m.SpAutoFit != nil { + if err := m.SpAutoFit.ValidateWithPath(path + "/SpAutoFit"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_TextBullet.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_TextBullet.go new file mode 100644 index 00000000..2f2e2a1f --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_TextBullet.go @@ -0,0 +1,123 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type EG_TextBullet struct { + BuNone *CT_TextNoBullet + BuAutoNum *CT_TextAutonumberBullet + BuChar *CT_TextCharBullet + BuBlip *CT_TextBlipBullet +} + +func NewEG_TextBullet() *EG_TextBullet { + ret := &EG_TextBullet{} + return ret +} + +func (m *EG_TextBullet) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.BuNone != nil { + sebuNone := xml.StartElement{Name: xml.Name{Local: "a:buNone"}} + e.EncodeElement(m.BuNone, sebuNone) + } + if m.BuAutoNum != nil { + sebuAutoNum := xml.StartElement{Name: xml.Name{Local: "a:buAutoNum"}} + e.EncodeElement(m.BuAutoNum, sebuAutoNum) + } + if m.BuChar != nil { + sebuChar := xml.StartElement{Name: xml.Name{Local: "a:buChar"}} + e.EncodeElement(m.BuChar, sebuChar) + } + if m.BuBlip != nil { + sebuBlip := xml.StartElement{Name: xml.Name{Local: "a:buBlip"}} + e.EncodeElement(m.BuBlip, sebuBlip) + } + return nil +} + +func (m *EG_TextBullet) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_TextBullet: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "buNone"}: + m.BuNone = NewCT_TextNoBullet() + if err := d.DecodeElement(m.BuNone, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "buAutoNum"}: + m.BuAutoNum = NewCT_TextAutonumberBullet() + if err := d.DecodeElement(m.BuAutoNum, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "buChar"}: + m.BuChar = NewCT_TextCharBullet() + if err := d.DecodeElement(m.BuChar, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "buBlip"}: + m.BuBlip = NewCT_TextBlipBullet() + if err := d.DecodeElement(m.BuBlip, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on EG_TextBullet %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_TextBullet + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_TextBullet and its children +func (m *EG_TextBullet) Validate() error { + return m.ValidateWithPath("EG_TextBullet") +} + +// ValidateWithPath validates the EG_TextBullet and its children, prefixing error messages with path +func (m *EG_TextBullet) ValidateWithPath(path string) error { + if m.BuNone != nil { + if err := m.BuNone.ValidateWithPath(path + "/BuNone"); err != nil { + return err + } + } + if m.BuAutoNum != nil { + if err := m.BuAutoNum.ValidateWithPath(path + "/BuAutoNum"); err != nil { + return err + } + } + if m.BuChar != nil { + if err := m.BuChar.ValidateWithPath(path + "/BuChar"); err != nil { + return err + } + } + if m.BuBlip != nil { + if err := m.BuBlip.ValidateWithPath(path + "/BuBlip"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_TextBulletColor.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_TextBulletColor.go new file mode 100644 index 00000000..3b32b6e4 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_TextBulletColor.go @@ -0,0 +1,93 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type EG_TextBulletColor struct { + BuClrTx *CT_TextBulletColorFollowText + BuClr *CT_Color +} + +func NewEG_TextBulletColor() *EG_TextBulletColor { + ret := &EG_TextBulletColor{} + return ret +} + +func (m *EG_TextBulletColor) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.BuClrTx != nil { + sebuClrTx := xml.StartElement{Name: xml.Name{Local: "a:buClrTx"}} + e.EncodeElement(m.BuClrTx, sebuClrTx) + } + if m.BuClr != nil { + sebuClr := xml.StartElement{Name: xml.Name{Local: "a:buClr"}} + e.EncodeElement(m.BuClr, sebuClr) + } + return nil +} + +func (m *EG_TextBulletColor) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_TextBulletColor: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "buClrTx"}: + m.BuClrTx = NewCT_TextBulletColorFollowText() + if err := d.DecodeElement(m.BuClrTx, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "buClr"}: + m.BuClr = NewCT_Color() + if err := d.DecodeElement(m.BuClr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on EG_TextBulletColor %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_TextBulletColor + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_TextBulletColor and its children +func (m *EG_TextBulletColor) Validate() error { + return m.ValidateWithPath("EG_TextBulletColor") +} + +// ValidateWithPath validates the EG_TextBulletColor and its children, prefixing error messages with path +func (m *EG_TextBulletColor) ValidateWithPath(path string) error { + if m.BuClrTx != nil { + if err := m.BuClrTx.ValidateWithPath(path + "/BuClrTx"); err != nil { + return err + } + } + if m.BuClr != nil { + if err := m.BuClr.ValidateWithPath(path + "/BuClr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_TextBulletSize.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_TextBulletSize.go new file mode 100644 index 00000000..696dbd16 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_TextBulletSize.go @@ -0,0 +1,108 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type EG_TextBulletSize struct { + BuSzTx *CT_TextBulletSizeFollowText + BuSzPct *CT_TextBulletSizePercent + BuSzPts *CT_TextBulletSizePoint +} + +func NewEG_TextBulletSize() *EG_TextBulletSize { + ret := &EG_TextBulletSize{} + return ret +} + +func (m *EG_TextBulletSize) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.BuSzTx != nil { + sebuSzTx := xml.StartElement{Name: xml.Name{Local: "a:buSzTx"}} + e.EncodeElement(m.BuSzTx, sebuSzTx) + } + if m.BuSzPct != nil { + sebuSzPct := xml.StartElement{Name: xml.Name{Local: "a:buSzPct"}} + e.EncodeElement(m.BuSzPct, sebuSzPct) + } + if m.BuSzPts != nil { + sebuSzPts := xml.StartElement{Name: xml.Name{Local: "a:buSzPts"}} + e.EncodeElement(m.BuSzPts, sebuSzPts) + } + return nil +} + +func (m *EG_TextBulletSize) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_TextBulletSize: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "buSzTx"}: + m.BuSzTx = NewCT_TextBulletSizeFollowText() + if err := d.DecodeElement(m.BuSzTx, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "buSzPct"}: + m.BuSzPct = NewCT_TextBulletSizePercent() + if err := d.DecodeElement(m.BuSzPct, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "buSzPts"}: + m.BuSzPts = NewCT_TextBulletSizePoint() + if err := d.DecodeElement(m.BuSzPts, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on EG_TextBulletSize %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_TextBulletSize + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_TextBulletSize and its children +func (m *EG_TextBulletSize) Validate() error { + return m.ValidateWithPath("EG_TextBulletSize") +} + +// ValidateWithPath validates the EG_TextBulletSize and its children, prefixing error messages with path +func (m *EG_TextBulletSize) ValidateWithPath(path string) error { + if m.BuSzTx != nil { + if err := m.BuSzTx.ValidateWithPath(path + "/BuSzTx"); err != nil { + return err + } + } + if m.BuSzPct != nil { + if err := m.BuSzPct.ValidateWithPath(path + "/BuSzPct"); err != nil { + return err + } + } + if m.BuSzPts != nil { + if err := m.BuSzPts.ValidateWithPath(path + "/BuSzPts"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_TextBulletTypeface.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_TextBulletTypeface.go new file mode 100644 index 00000000..33736402 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_TextBulletTypeface.go @@ -0,0 +1,93 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type EG_TextBulletTypeface struct { + BuFontTx *CT_TextBulletTypefaceFollowText + BuFont *CT_TextFont +} + +func NewEG_TextBulletTypeface() *EG_TextBulletTypeface { + ret := &EG_TextBulletTypeface{} + return ret +} + +func (m *EG_TextBulletTypeface) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.BuFontTx != nil { + sebuFontTx := xml.StartElement{Name: xml.Name{Local: "a:buFontTx"}} + e.EncodeElement(m.BuFontTx, sebuFontTx) + } + if m.BuFont != nil { + sebuFont := xml.StartElement{Name: xml.Name{Local: "a:buFont"}} + e.EncodeElement(m.BuFont, sebuFont) + } + return nil +} + +func (m *EG_TextBulletTypeface) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_TextBulletTypeface: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "buFontTx"}: + m.BuFontTx = NewCT_TextBulletTypefaceFollowText() + if err := d.DecodeElement(m.BuFontTx, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "buFont"}: + m.BuFont = NewCT_TextFont() + if err := d.DecodeElement(m.BuFont, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on EG_TextBulletTypeface %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_TextBulletTypeface + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_TextBulletTypeface and its children +func (m *EG_TextBulletTypeface) Validate() error { + return m.ValidateWithPath("EG_TextBulletTypeface") +} + +// ValidateWithPath validates the EG_TextBulletTypeface and its children, prefixing error messages with path +func (m *EG_TextBulletTypeface) ValidateWithPath(path string) error { + if m.BuFontTx != nil { + if err := m.BuFontTx.ValidateWithPath(path + "/BuFontTx"); err != nil { + return err + } + } + if m.BuFont != nil { + if err := m.BuFont.ValidateWithPath(path + "/BuFont"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_TextGeometry.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_TextGeometry.go new file mode 100644 index 00000000..9fec4457 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_TextGeometry.go @@ -0,0 +1,94 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type EG_TextGeometry struct { + CustGeom *CT_CustomGeometry2D + PrstTxWarp *CT_PresetTextShape +} + +func NewEG_TextGeometry() *EG_TextGeometry { + ret := &EG_TextGeometry{} + return ret +} + +func (m *EG_TextGeometry) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Name.Local = "a:EG_TextGeometry" + if m.CustGeom != nil { + secustGeom := xml.StartElement{Name: xml.Name{Local: "a:custGeom"}} + e.EncodeElement(m.CustGeom, secustGeom) + } + if m.PrstTxWarp != nil { + seprstTxWarp := xml.StartElement{Name: xml.Name{Local: "a:prstTxWarp"}} + e.EncodeElement(m.PrstTxWarp, seprstTxWarp) + } + return nil +} + +func (m *EG_TextGeometry) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_TextGeometry: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "custGeom"}: + m.CustGeom = NewCT_CustomGeometry2D() + if err := d.DecodeElement(m.CustGeom, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "prstTxWarp"}: + m.PrstTxWarp = NewCT_PresetTextShape() + if err := d.DecodeElement(m.PrstTxWarp, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on EG_TextGeometry %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_TextGeometry + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_TextGeometry and its children +func (m *EG_TextGeometry) Validate() error { + return m.ValidateWithPath("EG_TextGeometry") +} + +// ValidateWithPath validates the EG_TextGeometry and its children, prefixing error messages with path +func (m *EG_TextGeometry) ValidateWithPath(path string) error { + if m.CustGeom != nil { + if err := m.CustGeom.ValidateWithPath(path + "/CustGeom"); err != nil { + return err + } + } + if m.PrstTxWarp != nil { + if err := m.PrstTxWarp.ValidateWithPath(path + "/PrstTxWarp"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_TextRun.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_TextRun.go new file mode 100644 index 00000000..1913e233 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_TextRun.go @@ -0,0 +1,108 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type EG_TextRun struct { + R *CT_RegularTextRun + Br *CT_TextLineBreak + Fld *CT_TextField +} + +func NewEG_TextRun() *EG_TextRun { + ret := &EG_TextRun{} + return ret +} + +func (m *EG_TextRun) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.R != nil { + ser := xml.StartElement{Name: xml.Name{Local: "a:r"}} + e.EncodeElement(m.R, ser) + } + if m.Br != nil { + sebr := xml.StartElement{Name: xml.Name{Local: "a:br"}} + e.EncodeElement(m.Br, sebr) + } + if m.Fld != nil { + sefld := xml.StartElement{Name: xml.Name{Local: "a:fld"}} + e.EncodeElement(m.Fld, sefld) + } + return nil +} + +func (m *EG_TextRun) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_TextRun: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "r"}: + m.R = NewCT_RegularTextRun() + if err := d.DecodeElement(m.R, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "br"}: + m.Br = NewCT_TextLineBreak() + if err := d.DecodeElement(m.Br, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "fld"}: + m.Fld = NewCT_TextField() + if err := d.DecodeElement(m.Fld, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on EG_TextRun %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_TextRun + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_TextRun and its children +func (m *EG_TextRun) Validate() error { + return m.ValidateWithPath("EG_TextRun") +} + +// ValidateWithPath validates the EG_TextRun and its children, prefixing error messages with path +func (m *EG_TextRun) ValidateWithPath(path string) error { + if m.R != nil { + if err := m.R.ValidateWithPath(path + "/R"); err != nil { + return err + } + } + if m.Br != nil { + if err := m.Br.ValidateWithPath(path + "/Br"); err != nil { + return err + } + } + if m.Fld != nil { + if err := m.Fld.ValidateWithPath(path + "/Fld"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_TextUnderlineFill.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_TextUnderlineFill.go new file mode 100644 index 00000000..950633ef --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_TextUnderlineFill.go @@ -0,0 +1,93 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type EG_TextUnderlineFill struct { + UFillTx *CT_TextUnderlineFillFollowText + UFill *CT_TextUnderlineFillGroupWrapper +} + +func NewEG_TextUnderlineFill() *EG_TextUnderlineFill { + ret := &EG_TextUnderlineFill{} + return ret +} + +func (m *EG_TextUnderlineFill) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.UFillTx != nil { + seuFillTx := xml.StartElement{Name: xml.Name{Local: "a:uFillTx"}} + e.EncodeElement(m.UFillTx, seuFillTx) + } + if m.UFill != nil { + seuFill := xml.StartElement{Name: xml.Name{Local: "a:uFill"}} + e.EncodeElement(m.UFill, seuFill) + } + return nil +} + +func (m *EG_TextUnderlineFill) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_TextUnderlineFill: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "uFillTx"}: + m.UFillTx = NewCT_TextUnderlineFillFollowText() + if err := d.DecodeElement(m.UFillTx, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "uFill"}: + m.UFill = NewCT_TextUnderlineFillGroupWrapper() + if err := d.DecodeElement(m.UFill, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on EG_TextUnderlineFill %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_TextUnderlineFill + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_TextUnderlineFill and its children +func (m *EG_TextUnderlineFill) Validate() error { + return m.ValidateWithPath("EG_TextUnderlineFill") +} + +// ValidateWithPath validates the EG_TextUnderlineFill and its children, prefixing error messages with path +func (m *EG_TextUnderlineFill) ValidateWithPath(path string) error { + if m.UFillTx != nil { + if err := m.UFillTx.ValidateWithPath(path + "/UFillTx"); err != nil { + return err + } + } + if m.UFill != nil { + if err := m.UFill.ValidateWithPath(path + "/UFill"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_TextUnderlineLine.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_TextUnderlineLine.go new file mode 100644 index 00000000..3515864b --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_TextUnderlineLine.go @@ -0,0 +1,93 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type EG_TextUnderlineLine struct { + ULnTx *CT_TextUnderlineLineFollowText + ULn *CT_LineProperties +} + +func NewEG_TextUnderlineLine() *EG_TextUnderlineLine { + ret := &EG_TextUnderlineLine{} + return ret +} + +func (m *EG_TextUnderlineLine) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.ULnTx != nil { + seuLnTx := xml.StartElement{Name: xml.Name{Local: "a:uLnTx"}} + e.EncodeElement(m.ULnTx, seuLnTx) + } + if m.ULn != nil { + seuLn := xml.StartElement{Name: xml.Name{Local: "a:uLn"}} + e.EncodeElement(m.ULn, seuLn) + } + return nil +} + +func (m *EG_TextUnderlineLine) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_TextUnderlineLine: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "uLnTx"}: + m.ULnTx = NewCT_TextUnderlineLineFollowText() + if err := d.DecodeElement(m.ULnTx, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "uLn"}: + m.ULn = NewCT_LineProperties() + if err := d.DecodeElement(m.ULn, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on EG_TextUnderlineLine %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_TextUnderlineLine + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_TextUnderlineLine and its children +func (m *EG_TextUnderlineLine) Validate() error { + return m.ValidateWithPath("EG_TextUnderlineLine") +} + +// ValidateWithPath validates the EG_TextUnderlineLine and its children, prefixing error messages with path +func (m *EG_TextUnderlineLine) ValidateWithPath(path string) error { + if m.ULnTx != nil { + if err := m.ULnTx.ValidateWithPath(path + "/ULnTx"); err != nil { + return err + } + } + if m.ULn != nil { + if err := m.ULn.ValidateWithPath(path + "/ULn"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_ThemeableEffectStyle.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_ThemeableEffectStyle.go new file mode 100644 index 00000000..323beccb --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_ThemeableEffectStyle.go @@ -0,0 +1,93 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type EG_ThemeableEffectStyle struct { + Effect *CT_EffectProperties + EffectRef *CT_StyleMatrixReference +} + +func NewEG_ThemeableEffectStyle() *EG_ThemeableEffectStyle { + ret := &EG_ThemeableEffectStyle{} + return ret +} + +func (m *EG_ThemeableEffectStyle) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.Effect != nil { + seeffect := xml.StartElement{Name: xml.Name{Local: "a:effect"}} + e.EncodeElement(m.Effect, seeffect) + } + if m.EffectRef != nil { + seeffectRef := xml.StartElement{Name: xml.Name{Local: "a:effectRef"}} + e.EncodeElement(m.EffectRef, seeffectRef) + } + return nil +} + +func (m *EG_ThemeableEffectStyle) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_ThemeableEffectStyle: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "effect"}: + m.Effect = NewCT_EffectProperties() + if err := d.DecodeElement(m.Effect, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "effectRef"}: + m.EffectRef = NewCT_StyleMatrixReference() + if err := d.DecodeElement(m.EffectRef, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on EG_ThemeableEffectStyle %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_ThemeableEffectStyle + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_ThemeableEffectStyle and its children +func (m *EG_ThemeableEffectStyle) Validate() error { + return m.ValidateWithPath("EG_ThemeableEffectStyle") +} + +// ValidateWithPath validates the EG_ThemeableEffectStyle and its children, prefixing error messages with path +func (m *EG_ThemeableEffectStyle) ValidateWithPath(path string) error { + if m.Effect != nil { + if err := m.Effect.ValidateWithPath(path + "/Effect"); err != nil { + return err + } + } + if m.EffectRef != nil { + if err := m.EffectRef.ValidateWithPath(path + "/EffectRef"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_ThemeableFillStyle.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_ThemeableFillStyle.go new file mode 100644 index 00000000..b82f24a4 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_ThemeableFillStyle.go @@ -0,0 +1,93 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type EG_ThemeableFillStyle struct { + Fill *CT_FillProperties + FillRef *CT_StyleMatrixReference +} + +func NewEG_ThemeableFillStyle() *EG_ThemeableFillStyle { + ret := &EG_ThemeableFillStyle{} + return ret +} + +func (m *EG_ThemeableFillStyle) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.Fill != nil { + sefill := xml.StartElement{Name: xml.Name{Local: "a:fill"}} + e.EncodeElement(m.Fill, sefill) + } + if m.FillRef != nil { + sefillRef := xml.StartElement{Name: xml.Name{Local: "a:fillRef"}} + e.EncodeElement(m.FillRef, sefillRef) + } + return nil +} + +func (m *EG_ThemeableFillStyle) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_ThemeableFillStyle: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "fill"}: + m.Fill = NewCT_FillProperties() + if err := d.DecodeElement(m.Fill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "fillRef"}: + m.FillRef = NewCT_StyleMatrixReference() + if err := d.DecodeElement(m.FillRef, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on EG_ThemeableFillStyle %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_ThemeableFillStyle + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_ThemeableFillStyle and its children +func (m *EG_ThemeableFillStyle) Validate() error { + return m.ValidateWithPath("EG_ThemeableFillStyle") +} + +// ValidateWithPath validates the EG_ThemeableFillStyle and its children, prefixing error messages with path +func (m *EG_ThemeableFillStyle) ValidateWithPath(path string) error { + if m.Fill != nil { + if err := m.Fill.ValidateWithPath(path + "/Fill"); err != nil { + return err + } + } + if m.FillRef != nil { + if err := m.FillRef.ValidateWithPath(path + "/FillRef"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_ThemeableFontStyles.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_ThemeableFontStyles.go new file mode 100644 index 00000000..57e1418b --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/EG_ThemeableFontStyles.go @@ -0,0 +1,93 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type EG_ThemeableFontStyles struct { + Font *CT_FontCollection + FontRef *CT_FontReference +} + +func NewEG_ThemeableFontStyles() *EG_ThemeableFontStyles { + ret := &EG_ThemeableFontStyles{} + return ret +} + +func (m *EG_ThemeableFontStyles) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.Font != nil { + sefont := xml.StartElement{Name: xml.Name{Local: "a:font"}} + e.EncodeElement(m.Font, sefont) + } + if m.FontRef != nil { + sefontRef := xml.StartElement{Name: xml.Name{Local: "a:fontRef"}} + e.EncodeElement(m.FontRef, sefontRef) + } + return nil +} + +func (m *EG_ThemeableFontStyles) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_ThemeableFontStyles: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "font"}: + m.Font = NewCT_FontCollection() + if err := d.DecodeElement(m.Font, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "fontRef"}: + m.FontRef = NewCT_FontReference() + if err := d.DecodeElement(m.FontRef, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on EG_ThemeableFontStyles %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_ThemeableFontStyles + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_ThemeableFontStyles and its children +func (m *EG_ThemeableFontStyles) Validate() error { + return m.ValidateWithPath("EG_ThemeableFontStyles") +} + +// ValidateWithPath validates the EG_ThemeableFontStyles and its children, prefixing error messages with path +func (m *EG_ThemeableFontStyles) ValidateWithPath(path string) error { + if m.Font != nil { + if err := m.Font.ValidateWithPath(path + "/Font"); err != nil { + return err + } + } + if m.FontRef != nil { + if err := m.FontRef.ValidateWithPath(path + "/FontRef"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/Graphic.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/Graphic.go new file mode 100644 index 00000000..91c9a815 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/Graphic.go @@ -0,0 +1,73 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type Graphic struct { + CT_GraphicalObject +} + +func NewGraphic() *Graphic { + ret := &Graphic{} + ret.CT_GraphicalObject = *NewCT_GraphicalObject() + return ret +} + +func (m *Graphic) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return m.CT_GraphicalObject.MarshalXML(e, start) +} + +func (m *Graphic) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CT_GraphicalObject = *NewCT_GraphicalObject() +lGraphic: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "graphicData"}: + if err := d.DecodeElement(m.GraphicData, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on Graphic %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lGraphic + case xml.CharData: + } + } + return nil +} + +// Validate validates the Graphic and its children +func (m *Graphic) Validate() error { + return m.ValidateWithPath("Graphic") +} + +// ValidateWithPath validates the Graphic and its children, prefixing error messages with path +func (m *Graphic) ValidateWithPath(path string) error { + if err := m.CT_GraphicalObject.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_AdjAngle.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_AdjAngle.go new file mode 100644 index 00000000..ba4cbe38 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_AdjAngle.go @@ -0,0 +1,60 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +// ST_AdjAngle is a union type +type ST_AdjAngle struct { + ST_Angle *int32 + ST_GeomGuideName *string +} + +func (m *ST_AdjAngle) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_AdjAngle) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.ST_Angle != nil { + e.EncodeToken(xml.CharData(fmt.Sprintf("%d", *m.ST_Angle))) + } + if m.ST_GeomGuideName != nil { + e.EncodeToken(xml.CharData(*m.ST_GeomGuideName)) + } + return e.EncodeToken(xml.EndElement{Name: start.Name}) +} + +func (m *ST_AdjAngle) ValidateWithPath(path string) error { + mems := []string{} + if m.ST_Angle != nil { + mems = append(mems, "ST_Angle") + } + if m.ST_GeomGuideName != nil { + mems = append(mems, "ST_GeomGuideName") + } + if len(mems) > 1 { + return fmt.Errorf("%s too many members set: %v", path, mems) + } + return nil +} + +func (m ST_AdjAngle) String() string { + if m.ST_Angle != nil { + return fmt.Sprintf("%v", *m.ST_Angle) + } + if m.ST_GeomGuideName != nil { + return fmt.Sprintf("%v", *m.ST_GeomGuideName) + } + return "" +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_AdjCoordinate.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_AdjCoordinate.go new file mode 100644 index 00000000..1c64393f --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_AdjCoordinate.go @@ -0,0 +1,63 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +// ST_AdjCoordinate is a union type +type ST_AdjCoordinate struct { + ST_Coordinate *ST_Coordinate + ST_GeomGuideName *string +} + +func (m *ST_AdjCoordinate) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_AdjCoordinate) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.ST_Coordinate != nil { + e.Encode(m.ST_Coordinate) + } + if m.ST_GeomGuideName != nil { + e.EncodeToken(xml.CharData(*m.ST_GeomGuideName)) + } + return e.EncodeToken(xml.EndElement{Name: start.Name}) +} + +func (m *ST_AdjCoordinate) ValidateWithPath(path string) error { + mems := []string{} + if m.ST_Coordinate != nil { + if err := m.ST_Coordinate.ValidateWithPath(path + "/ST_Coordinate"); err != nil { + return err + } + mems = append(mems, "ST_Coordinate") + } + if m.ST_GeomGuideName != nil { + mems = append(mems, "ST_GeomGuideName") + } + if len(mems) > 1 { + return fmt.Errorf("%s too many members set: %v", path, mems) + } + return nil +} + +func (m ST_AdjCoordinate) String() string { + if m.ST_Coordinate != nil { + return m.ST_Coordinate.String() + } + if m.ST_GeomGuideName != nil { + return fmt.Sprintf("%v", *m.ST_GeomGuideName) + } + return "" +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_AnimationChartBuildType.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_AnimationChartBuildType.go new file mode 100644 index 00000000..db790451 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_AnimationChartBuildType.go @@ -0,0 +1,60 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +// ST_AnimationChartBuildType is a union type +type ST_AnimationChartBuildType struct { + ST_AnimationBuildType ST_AnimationBuildType + ST_AnimationChartOnlyBuildType ST_AnimationChartOnlyBuildType +} + +func (m *ST_AnimationChartBuildType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_AnimationChartBuildType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.ST_AnimationBuildType != ST_AnimationBuildTypeUnset { + e.EncodeToken(xml.CharData(m.ST_AnimationBuildType.String())) + } + if m.ST_AnimationChartOnlyBuildType != ST_AnimationChartOnlyBuildTypeUnset { + e.EncodeToken(xml.CharData(m.ST_AnimationChartOnlyBuildType.String())) + } + return e.EncodeToken(xml.EndElement{Name: start.Name}) +} + +func (m *ST_AnimationChartBuildType) ValidateWithPath(path string) error { + mems := []string{} + if m.ST_AnimationBuildType != ST_AnimationBuildTypeUnset { + mems = append(mems, "ST_AnimationBuildType") + } + if m.ST_AnimationChartOnlyBuildType != ST_AnimationChartOnlyBuildTypeUnset { + mems = append(mems, "ST_AnimationChartOnlyBuildType") + } + if len(mems) > 1 { + return fmt.Errorf("%s too many members set: %v", path, mems) + } + return nil +} + +func (m ST_AnimationChartBuildType) String() string { + if m.ST_AnimationBuildType != ST_AnimationBuildTypeUnset { + return m.ST_AnimationBuildType.String() + } + if m.ST_AnimationChartOnlyBuildType != ST_AnimationChartOnlyBuildTypeUnset { + return m.ST_AnimationChartOnlyBuildType.String() + } + return "" +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_AnimationDgmBuildType.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_AnimationDgmBuildType.go new file mode 100644 index 00000000..05a95f7a --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_AnimationDgmBuildType.go @@ -0,0 +1,60 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +// ST_AnimationDgmBuildType is a union type +type ST_AnimationDgmBuildType struct { + ST_AnimationBuildType ST_AnimationBuildType + ST_AnimationDgmOnlyBuildType ST_AnimationDgmOnlyBuildType +} + +func (m *ST_AnimationDgmBuildType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_AnimationDgmBuildType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.ST_AnimationBuildType != ST_AnimationBuildTypeUnset { + e.EncodeToken(xml.CharData(m.ST_AnimationBuildType.String())) + } + if m.ST_AnimationDgmOnlyBuildType != ST_AnimationDgmOnlyBuildTypeUnset { + e.EncodeToken(xml.CharData(m.ST_AnimationDgmOnlyBuildType.String())) + } + return e.EncodeToken(xml.EndElement{Name: start.Name}) +} + +func (m *ST_AnimationDgmBuildType) ValidateWithPath(path string) error { + mems := []string{} + if m.ST_AnimationBuildType != ST_AnimationBuildTypeUnset { + mems = append(mems, "ST_AnimationBuildType") + } + if m.ST_AnimationDgmOnlyBuildType != ST_AnimationDgmOnlyBuildTypeUnset { + mems = append(mems, "ST_AnimationDgmOnlyBuildType") + } + if len(mems) > 1 { + return fmt.Errorf("%s too many members set: %v", path, mems) + } + return nil +} + +func (m ST_AnimationDgmBuildType) String() string { + if m.ST_AnimationBuildType != ST_AnimationBuildTypeUnset { + return m.ST_AnimationBuildType.String() + } + if m.ST_AnimationDgmOnlyBuildType != ST_AnimationDgmOnlyBuildTypeUnset { + return m.ST_AnimationDgmOnlyBuildType.String() + } + return "" +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_Coordinate.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_Coordinate.go new file mode 100644 index 00000000..160f8742 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_Coordinate.go @@ -0,0 +1,60 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +// ST_Coordinate is a union type +type ST_Coordinate struct { + ST_CoordinateUnqualified *int64 + ST_UniversalMeasure *string +} + +func (m *ST_Coordinate) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_Coordinate) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.ST_CoordinateUnqualified != nil { + e.EncodeToken(xml.CharData(fmt.Sprintf("%d", *m.ST_CoordinateUnqualified))) + } + if m.ST_UniversalMeasure != nil { + e.EncodeToken(xml.CharData(*m.ST_UniversalMeasure)) + } + return e.EncodeToken(xml.EndElement{Name: start.Name}) +} + +func (m *ST_Coordinate) ValidateWithPath(path string) error { + mems := []string{} + if m.ST_CoordinateUnqualified != nil { + mems = append(mems, "ST_CoordinateUnqualified") + } + if m.ST_UniversalMeasure != nil { + mems = append(mems, "ST_UniversalMeasure") + } + if len(mems) > 1 { + return fmt.Errorf("%s too many members set: %v", path, mems) + } + return nil +} + +func (m ST_Coordinate) String() string { + if m.ST_CoordinateUnqualified != nil { + return fmt.Sprintf("%v", *m.ST_CoordinateUnqualified) + } + if m.ST_UniversalMeasure != nil { + return fmt.Sprintf("%v", *m.ST_UniversalMeasure) + } + return "" +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_Coordinate32.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_Coordinate32.go new file mode 100644 index 00000000..afd59448 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_Coordinate32.go @@ -0,0 +1,60 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +// ST_Coordinate32 is a union type +type ST_Coordinate32 struct { + ST_Coordinate32Unqualified *int32 + ST_UniversalMeasure *string +} + +func (m *ST_Coordinate32) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_Coordinate32) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.ST_Coordinate32Unqualified != nil { + e.EncodeToken(xml.CharData(fmt.Sprintf("%d", *m.ST_Coordinate32Unqualified))) + } + if m.ST_UniversalMeasure != nil { + e.EncodeToken(xml.CharData(*m.ST_UniversalMeasure)) + } + return e.EncodeToken(xml.EndElement{Name: start.Name}) +} + +func (m *ST_Coordinate32) ValidateWithPath(path string) error { + mems := []string{} + if m.ST_Coordinate32Unqualified != nil { + mems = append(mems, "ST_Coordinate32Unqualified") + } + if m.ST_UniversalMeasure != nil { + mems = append(mems, "ST_UniversalMeasure") + } + if len(mems) > 1 { + return fmt.Errorf("%s too many members set: %v", path, mems) + } + return nil +} + +func (m ST_Coordinate32) String() string { + if m.ST_Coordinate32Unqualified != nil { + return fmt.Sprintf("%v", *m.ST_Coordinate32Unqualified) + } + if m.ST_UniversalMeasure != nil { + return fmt.Sprintf("%v", *m.ST_UniversalMeasure) + } + return "" +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_FixedPercentage.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_FixedPercentage.go new file mode 100644 index 00000000..275d1301 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_FixedPercentage.go @@ -0,0 +1,63 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +// ST_FixedPercentage is a union type +type ST_FixedPercentage struct { + ST_FixedPercentageDecimal *int32 + ST_FixedPercentage *ST_Percentage +} + +func (m *ST_FixedPercentage) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_FixedPercentage) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.ST_FixedPercentageDecimal != nil { + e.EncodeToken(xml.CharData(fmt.Sprintf("%d", *m.ST_FixedPercentageDecimal))) + } + if m.ST_FixedPercentage != nil { + e.Encode(m.ST_FixedPercentage) + } + return e.EncodeToken(xml.EndElement{Name: start.Name}) +} + +func (m *ST_FixedPercentage) ValidateWithPath(path string) error { + mems := []string{} + if m.ST_FixedPercentageDecimal != nil { + mems = append(mems, "ST_FixedPercentageDecimal") + } + if m.ST_FixedPercentage != nil { + if err := m.ST_FixedPercentage.ValidateWithPath(path + "/ST_FixedPercentage"); err != nil { + return err + } + mems = append(mems, "ST_FixedPercentage") + } + if len(mems) > 1 { + return fmt.Errorf("%s too many members set: %v", path, mems) + } + return nil +} + +func (m ST_FixedPercentage) String() string { + if m.ST_FixedPercentageDecimal != nil { + return fmt.Sprintf("%v", *m.ST_FixedPercentageDecimal) + } + if m.ST_FixedPercentage != nil { + return m.ST_FixedPercentage.String() + } + return "" +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_Percentage.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_Percentage.go new file mode 100644 index 00000000..50301ed3 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_Percentage.go @@ -0,0 +1,60 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +// ST_Percentage is a union type +type ST_Percentage struct { + ST_PercentageDecimal *int32 + ST_Percentage *string +} + +func (m *ST_Percentage) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_Percentage) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.ST_PercentageDecimal != nil { + e.EncodeToken(xml.CharData(fmt.Sprintf("%d", *m.ST_PercentageDecimal))) + } + if m.ST_Percentage != nil { + e.EncodeToken(xml.CharData(*m.ST_Percentage)) + } + return e.EncodeToken(xml.EndElement{Name: start.Name}) +} + +func (m *ST_Percentage) ValidateWithPath(path string) error { + mems := []string{} + if m.ST_PercentageDecimal != nil { + mems = append(mems, "ST_PercentageDecimal") + } + if m.ST_Percentage != nil { + mems = append(mems, "ST_Percentage") + } + if len(mems) > 1 { + return fmt.Errorf("%s too many members set: %v", path, mems) + } + return nil +} + +func (m ST_Percentage) String() string { + if m.ST_PercentageDecimal != nil { + return fmt.Sprintf("%v", *m.ST_PercentageDecimal) + } + if m.ST_Percentage != nil { + return fmt.Sprintf("%v", *m.ST_Percentage) + } + return "" +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_PositiveFixedPercentage.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_PositiveFixedPercentage.go new file mode 100644 index 00000000..a5b03ba4 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_PositiveFixedPercentage.go @@ -0,0 +1,63 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +// ST_PositiveFixedPercentage is a union type +type ST_PositiveFixedPercentage struct { + ST_PositiveFixedPercentageDecimal *int32 + ST_PositiveFixedPercentage *ST_Percentage +} + +func (m *ST_PositiveFixedPercentage) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_PositiveFixedPercentage) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.ST_PositiveFixedPercentageDecimal != nil { + e.EncodeToken(xml.CharData(fmt.Sprintf("%d", *m.ST_PositiveFixedPercentageDecimal))) + } + if m.ST_PositiveFixedPercentage != nil { + e.Encode(m.ST_PositiveFixedPercentage) + } + return e.EncodeToken(xml.EndElement{Name: start.Name}) +} + +func (m *ST_PositiveFixedPercentage) ValidateWithPath(path string) error { + mems := []string{} + if m.ST_PositiveFixedPercentageDecimal != nil { + mems = append(mems, "ST_PositiveFixedPercentageDecimal") + } + if m.ST_PositiveFixedPercentage != nil { + if err := m.ST_PositiveFixedPercentage.ValidateWithPath(path + "/ST_PositiveFixedPercentage"); err != nil { + return err + } + mems = append(mems, "ST_PositiveFixedPercentage") + } + if len(mems) > 1 { + return fmt.Errorf("%s too many members set: %v", path, mems) + } + return nil +} + +func (m ST_PositiveFixedPercentage) String() string { + if m.ST_PositiveFixedPercentageDecimal != nil { + return fmt.Sprintf("%v", *m.ST_PositiveFixedPercentageDecimal) + } + if m.ST_PositiveFixedPercentage != nil { + return m.ST_PositiveFixedPercentage.String() + } + return "" +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_PositivePercentage.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_PositivePercentage.go new file mode 100644 index 00000000..f41f0b5b --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_PositivePercentage.go @@ -0,0 +1,63 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +// ST_PositivePercentage is a union type +type ST_PositivePercentage struct { + ST_PositivePercentageDecimal *int32 + ST_PositivePercentage *ST_Percentage +} + +func (m *ST_PositivePercentage) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_PositivePercentage) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.ST_PositivePercentageDecimal != nil { + e.EncodeToken(xml.CharData(fmt.Sprintf("%d", *m.ST_PositivePercentageDecimal))) + } + if m.ST_PositivePercentage != nil { + e.Encode(m.ST_PositivePercentage) + } + return e.EncodeToken(xml.EndElement{Name: start.Name}) +} + +func (m *ST_PositivePercentage) ValidateWithPath(path string) error { + mems := []string{} + if m.ST_PositivePercentageDecimal != nil { + mems = append(mems, "ST_PositivePercentageDecimal") + } + if m.ST_PositivePercentage != nil { + if err := m.ST_PositivePercentage.ValidateWithPath(path + "/ST_PositivePercentage"); err != nil { + return err + } + mems = append(mems, "ST_PositivePercentage") + } + if len(mems) > 1 { + return fmt.Errorf("%s too many members set: %v", path, mems) + } + return nil +} + +func (m ST_PositivePercentage) String() string { + if m.ST_PositivePercentageDecimal != nil { + return fmt.Sprintf("%v", *m.ST_PositivePercentageDecimal) + } + if m.ST_PositivePercentage != nil { + return m.ST_PositivePercentage.String() + } + return "" +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_TextBulletSize.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_TextBulletSize.go new file mode 100644 index 00000000..717c310d --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_TextBulletSize.go @@ -0,0 +1,60 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +// ST_TextBulletSize is a union type +type ST_TextBulletSize struct { + ST_TextBulletSizePercent *string + ST_TextBulletSizeDecimal *int32 +} + +func (m *ST_TextBulletSize) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_TextBulletSize) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.ST_TextBulletSizePercent != nil { + e.EncodeToken(xml.CharData(*m.ST_TextBulletSizePercent)) + } + if m.ST_TextBulletSizeDecimal != nil { + e.EncodeToken(xml.CharData(fmt.Sprintf("%d", *m.ST_TextBulletSizeDecimal))) + } + return e.EncodeToken(xml.EndElement{Name: start.Name}) +} + +func (m *ST_TextBulletSize) ValidateWithPath(path string) error { + mems := []string{} + if m.ST_TextBulletSizePercent != nil { + mems = append(mems, "ST_TextBulletSizePercent") + } + if m.ST_TextBulletSizeDecimal != nil { + mems = append(mems, "ST_TextBulletSizeDecimal") + } + if len(mems) > 1 { + return fmt.Errorf("%s too many members set: %v", path, mems) + } + return nil +} + +func (m ST_TextBulletSize) String() string { + if m.ST_TextBulletSizePercent != nil { + return fmt.Sprintf("%v", *m.ST_TextBulletSizePercent) + } + if m.ST_TextBulletSizeDecimal != nil { + return fmt.Sprintf("%v", *m.ST_TextBulletSizeDecimal) + } + return "" +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_TextFontScalePercentOrPercentString.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_TextFontScalePercentOrPercentString.go new file mode 100644 index 00000000..1e666f9d --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_TextFontScalePercentOrPercentString.go @@ -0,0 +1,60 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +// ST_TextFontScalePercentOrPercentString is a union type +type ST_TextFontScalePercentOrPercentString struct { + ST_TextFontScalePercent *int32 + ST_Percentage *string +} + +func (m *ST_TextFontScalePercentOrPercentString) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_TextFontScalePercentOrPercentString) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.ST_TextFontScalePercent != nil { + e.EncodeToken(xml.CharData(fmt.Sprintf("%d", *m.ST_TextFontScalePercent))) + } + if m.ST_Percentage != nil { + e.EncodeToken(xml.CharData(*m.ST_Percentage)) + } + return e.EncodeToken(xml.EndElement{Name: start.Name}) +} + +func (m *ST_TextFontScalePercentOrPercentString) ValidateWithPath(path string) error { + mems := []string{} + if m.ST_TextFontScalePercent != nil { + mems = append(mems, "ST_TextFontScalePercent") + } + if m.ST_Percentage != nil { + mems = append(mems, "ST_Percentage") + } + if len(mems) > 1 { + return fmt.Errorf("%s too many members set: %v", path, mems) + } + return nil +} + +func (m ST_TextFontScalePercentOrPercentString) String() string { + if m.ST_TextFontScalePercent != nil { + return fmt.Sprintf("%v", *m.ST_TextFontScalePercent) + } + if m.ST_Percentage != nil { + return fmt.Sprintf("%v", *m.ST_Percentage) + } + return "" +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_TextPoint.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_TextPoint.go new file mode 100644 index 00000000..6d31dfc1 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_TextPoint.go @@ -0,0 +1,60 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +// ST_TextPoint is a union type +type ST_TextPoint struct { + ST_TextPointUnqualified *int32 + ST_UniversalMeasure *string +} + +func (m *ST_TextPoint) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_TextPoint) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.ST_TextPointUnqualified != nil { + e.EncodeToken(xml.CharData(fmt.Sprintf("%d", *m.ST_TextPointUnqualified))) + } + if m.ST_UniversalMeasure != nil { + e.EncodeToken(xml.CharData(*m.ST_UniversalMeasure)) + } + return e.EncodeToken(xml.EndElement{Name: start.Name}) +} + +func (m *ST_TextPoint) ValidateWithPath(path string) error { + mems := []string{} + if m.ST_TextPointUnqualified != nil { + mems = append(mems, "ST_TextPointUnqualified") + } + if m.ST_UniversalMeasure != nil { + mems = append(mems, "ST_UniversalMeasure") + } + if len(mems) > 1 { + return fmt.Errorf("%s too many members set: %v", path, mems) + } + return nil +} + +func (m ST_TextPoint) String() string { + if m.ST_TextPointUnqualified != nil { + return fmt.Sprintf("%v", *m.ST_TextPointUnqualified) + } + if m.ST_UniversalMeasure != nil { + return fmt.Sprintf("%v", *m.ST_UniversalMeasure) + } + return "" +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_TextSpacingPercentOrPercentString.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_TextSpacingPercentOrPercentString.go new file mode 100644 index 00000000..befab5af --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/ST_TextSpacingPercentOrPercentString.go @@ -0,0 +1,60 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +// ST_TextSpacingPercentOrPercentString is a union type +type ST_TextSpacingPercentOrPercentString struct { + ST_TextSpacingPercent *int32 + ST_Percentage *string +} + +func (m *ST_TextSpacingPercentOrPercentString) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_TextSpacingPercentOrPercentString) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.ST_TextSpacingPercent != nil { + e.EncodeToken(xml.CharData(fmt.Sprintf("%d", *m.ST_TextSpacingPercent))) + } + if m.ST_Percentage != nil { + e.EncodeToken(xml.CharData(*m.ST_Percentage)) + } + return e.EncodeToken(xml.EndElement{Name: start.Name}) +} + +func (m *ST_TextSpacingPercentOrPercentString) ValidateWithPath(path string) error { + mems := []string{} + if m.ST_TextSpacingPercent != nil { + mems = append(mems, "ST_TextSpacingPercent") + } + if m.ST_Percentage != nil { + mems = append(mems, "ST_Percentage") + } + if len(mems) > 1 { + return fmt.Errorf("%s too many members set: %v", path, mems) + } + return nil +} + +func (m ST_TextSpacingPercentOrPercentString) String() string { + if m.ST_TextSpacingPercent != nil { + return fmt.Sprintf("%v", *m.ST_TextSpacingPercent) + } + if m.ST_Percentage != nil { + return fmt.Sprintf("%v", *m.ST_Percentage) + } + return "" +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/Tbl.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/Tbl.go new file mode 100644 index 00000000..0dccc0ee --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/Tbl.go @@ -0,0 +1,90 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type Tbl struct { + CT_Table +} + +func NewTbl() *Tbl { + ret := &Tbl{} + ret.CT_Table = *NewCT_Table() + return ret +} + +func (m *Tbl) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:a"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:r"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/relationships"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:sh"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/sharedTypes"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:xml"}, Value: "http://www.w3.org/XML/1998/namespace"}) + start.Name.Local = "a:tbl" + return m.CT_Table.MarshalXML(e, start) +} + +func (m *Tbl) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CT_Table = *NewCT_Table() +lTbl: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "tblPr"}: + m.TblPr = NewCT_TableProperties() + if err := d.DecodeElement(m.TblPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "tblGrid"}: + if err := d.DecodeElement(m.TblGrid, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "tr"}: + tmp := NewCT_TableRow() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Tr = append(m.Tr, tmp) + default: + gooxml.Log("skipping unsupported element on Tbl %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lTbl + case xml.CharData: + } + } + return nil +} + +// Validate validates the Tbl and its children +func (m *Tbl) Validate() error { + return m.ValidateWithPath("Tbl") +} + +// ValidateWithPath validates the Tbl and its children, prefixing error messages with path +func (m *Tbl) ValidateWithPath(path string) error { + if err := m.CT_Table.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/TblStyleLst.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/TblStyleLst.go new file mode 100644 index 00000000..7317f43c --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/TblStyleLst.go @@ -0,0 +1,91 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type TblStyleLst struct { + CT_TableStyleList +} + +func NewTblStyleLst() *TblStyleLst { + ret := &TblStyleLst{} + ret.CT_TableStyleList = *NewCT_TableStyleList() + return ret +} + +func (m *TblStyleLst) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:a"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:r"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/relationships"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:sh"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/sharedTypes"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:xml"}, Value: "http://www.w3.org/XML/1998/namespace"}) + start.Name.Local = "a:tblStyleLst" + return m.CT_TableStyleList.MarshalXML(e, start) +} + +func (m *TblStyleLst) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CT_TableStyleList = *NewCT_TableStyleList() + for _, attr := range start.Attr { + if attr.Name.Local == "def" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.DefAttr = parsed + continue + } + } +lTblStyleLst: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "tblStyle"}: + tmp := NewCT_TableStyle() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.TblStyle = append(m.TblStyle, tmp) + default: + gooxml.Log("skipping unsupported element on TblStyleLst %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lTblStyleLst + case xml.CharData: + } + } + return nil +} + +// Validate validates the TblStyleLst and its children +func (m *TblStyleLst) Validate() error { + return m.ValidateWithPath("TblStyleLst") +} + +// ValidateWithPath validates the TblStyleLst and its children, prefixing error messages with path +func (m *TblStyleLst) ValidateWithPath(path string) error { + if err := m.CT_TableStyleList.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/Theme.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/Theme.go new file mode 100644 index 00000000..d532460c --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/Theme.go @@ -0,0 +1,109 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type Theme struct { + CT_OfficeStyleSheet +} + +func NewTheme() *Theme { + ret := &Theme{} + ret.CT_OfficeStyleSheet = *NewCT_OfficeStyleSheet() + return ret +} + +func (m *Theme) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:a"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:r"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/relationships"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:sh"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/sharedTypes"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:xml"}, Value: "http://www.w3.org/XML/1998/namespace"}) + start.Name.Local = "a:theme" + return m.CT_OfficeStyleSheet.MarshalXML(e, start) +} + +func (m *Theme) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CT_OfficeStyleSheet = *NewCT_OfficeStyleSheet() + for _, attr := range start.Attr { + if attr.Name.Local == "name" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.NameAttr = &parsed + continue + } + } +lTheme: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "themeElements"}: + if err := d.DecodeElement(m.ThemeElements, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "objectDefaults"}: + m.ObjectDefaults = NewCT_ObjectStyleDefaults() + if err := d.DecodeElement(m.ObjectDefaults, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extraClrSchemeLst"}: + m.ExtraClrSchemeLst = NewCT_ColorSchemeList() + if err := d.DecodeElement(m.ExtraClrSchemeLst, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "custClrLst"}: + m.CustClrLst = NewCT_CustomColorList() + if err := d.DecodeElement(m.CustClrLst, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on Theme %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lTheme + case xml.CharData: + } + } + return nil +} + +// Validate validates the Theme and its children +func (m *Theme) Validate() error { + return m.ValidateWithPath("Theme") +} + +// ValidateWithPath validates the Theme and its children, prefixing error messages with path +func (m *Theme) ValidateWithPath(path string) error { + if err := m.CT_OfficeStyleSheet.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/ThemeManager.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/ThemeManager.go new file mode 100644 index 00000000..b410e1f1 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/ThemeManager.go @@ -0,0 +1,64 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" +) + +type ThemeManager struct { + CT_EmptyElement +} + +func NewThemeManager() *ThemeManager { + ret := &ThemeManager{} + ret.CT_EmptyElement = *NewCT_EmptyElement() + return ret +} + +func (m *ThemeManager) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:a"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:r"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/relationships"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:sh"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/sharedTypes"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:xml"}, Value: "http://www.w3.org/XML/1998/namespace"}) + start.Name.Local = "a:themeManager" + return m.CT_EmptyElement.MarshalXML(e, start) +} + +func (m *ThemeManager) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CT_EmptyElement = *NewCT_EmptyElement() + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing ThemeManager: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the ThemeManager and its children +func (m *ThemeManager) Validate() error { + return m.ValidateWithPath("ThemeManager") +} + +// ValidateWithPath validates the ThemeManager and its children, prefixing error messages with path +func (m *ThemeManager) ValidateWithPath(path string) error { + if err := m.CT_EmptyElement.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/ThemeOverride.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/ThemeOverride.go new file mode 100644 index 00000000..5b4163bf --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/ThemeOverride.go @@ -0,0 +1,90 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type ThemeOverride struct { + CT_BaseStylesOverride +} + +func NewThemeOverride() *ThemeOverride { + ret := &ThemeOverride{} + ret.CT_BaseStylesOverride = *NewCT_BaseStylesOverride() + return ret +} + +func (m *ThemeOverride) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:a"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:r"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/relationships"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:sh"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/sharedTypes"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:xml"}, Value: "http://www.w3.org/XML/1998/namespace"}) + start.Name.Local = "a:themeOverride" + return m.CT_BaseStylesOverride.MarshalXML(e, start) +} + +func (m *ThemeOverride) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CT_BaseStylesOverride = *NewCT_BaseStylesOverride() +lThemeOverride: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "clrScheme"}: + m.ClrScheme = NewCT_ColorScheme() + if err := d.DecodeElement(m.ClrScheme, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "fontScheme"}: + m.FontScheme = NewCT_FontScheme() + if err := d.DecodeElement(m.FontScheme, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "fmtScheme"}: + m.FmtScheme = NewCT_StyleMatrix() + if err := d.DecodeElement(m.FmtScheme, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on ThemeOverride %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lThemeOverride + case xml.CharData: + } + } + return nil +} + +// Validate validates the ThemeOverride and its children +func (m *ThemeOverride) Validate() error { + return m.ValidateWithPath("ThemeOverride") +} + +// ValidateWithPath validates the ThemeOverride and its children, prefixing error messages with path +func (m *ThemeOverride) ValidateWithPath(path string) error { + if err := m.CT_BaseStylesOverride.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/VideoFile.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/VideoFile.go new file mode 100644 index 00000000..3cf4cb16 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/VideoFile.go @@ -0,0 +1,98 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type VideoFile struct { + CT_VideoFile +} + +func NewVideoFile() *VideoFile { + ret := &VideoFile{} + ret.CT_VideoFile = *NewCT_VideoFile() + return ret +} + +func (m *VideoFile) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:a"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:r"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/relationships"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:sh"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/sharedTypes"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:xml"}, Value: "http://www.w3.org/XML/1998/namespace"}) + start.Name.Local = "a:videoFile" + return m.CT_VideoFile.MarshalXML(e, start) +} + +func (m *VideoFile) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CT_VideoFile = *NewCT_VideoFile() + for _, attr := range start.Attr { + if attr.Name.Space == "http://schemas.openxmlformats.org/officeDocument/2006/relationships" && attr.Name.Local == "link" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.LinkAttr = parsed + continue + } + if attr.Name.Local == "contentType" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ContentTypeAttr = &parsed + continue + } + } +lVideoFile: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "extLst"}: + m.ExtLst = NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on VideoFile %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lVideoFile + case xml.CharData: + } + } + return nil +} + +// Validate validates the VideoFile and its children +func (m *VideoFile) Validate() error { + return m.ValidateWithPath("VideoFile") +} + +// ValidateWithPath validates the VideoFile and its children, prefixing error messages with path +func (m *VideoFile) ValidateWithPath(path string) error { + if err := m.CT_VideoFile.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/common.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/common.go new file mode 100644 index 00000000..d0820abc --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/common.go @@ -0,0 +1,12200 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package dml + +import ( + "encoding/xml" + "fmt" + "regexp" + "strconv" + "time" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +const ST_TextBulletSizePercentPattern = `0*((2[5-9])|([3-9][0-9])|([1-3][0-9][0-9])|400)%` + +var ST_TextBulletSizePercentPatternRe = regexp.MustCompile(ST_TextBulletSizePercentPattern) + +func ParseUnionST_Percentage(s string) (ST_Percentage, error) { + r := ST_Percentage{} + if sharedTypes.ST_PercentagePatternRe.MatchString(s) { + r.ST_Percentage = &s + } else { + v, err := strconv.ParseInt(s, 10, 64) + if err != nil { + return r, fmt.Errorf("parsing %s as int", err) + } + v32 := int32(v) + r.ST_PercentageDecimal = &v32 + } + return r, nil +} + +func ParseUnionST_PositivePercentage(s string) (ST_PositivePercentage, error) { + r := ST_PositivePercentage{} + if sharedTypes.ST_PositivePercentagePatternRe.MatchString(s) { + r.ST_PositivePercentage = &ST_Percentage{} + r.ST_PositivePercentage.ST_Percentage = &s + } else { + v, err := strconv.ParseInt(s, 10, 32) + if err != nil { + return r, fmt.Errorf("parsing %s as int", err) + } + v32 := int32(v) + r.ST_PositivePercentageDecimal = &v32 + } + return r, nil +} + +func ParseUnionST_PositiveFixedPercentage(s string) (ST_PositiveFixedPercentage, error) { + r := ST_PositiveFixedPercentage{} + if sharedTypes.ST_PercentagePatternRe.MatchString(s) { + r.ST_PositiveFixedPercentage = &ST_Percentage{} + r.ST_PositiveFixedPercentage.ST_Percentage = &s + } else { + v, err := strconv.ParseInt(s, 10, 64) + if err != nil { + return r, fmt.Errorf("parsing %s as int", err) + } + v32 := int32(v) + r.ST_PositiveFixedPercentageDecimal = &v32 + } + return r, nil +} + +func ParseUnionST_FixedPercentage(s string) (ST_FixedPercentage, error) { + r := ST_FixedPercentage{} + if sharedTypes.ST_FixedPercentagePatternRe.MatchString(s) { + r.ST_FixedPercentage = &ST_Percentage{} + r.ST_FixedPercentage.ST_Percentage = &s + } else { + v, err := strconv.ParseInt(s, 10, 64) + if err != nil { + return r, fmt.Errorf("parsing %s as int", err) + } + v32 := int32(v) + r.ST_FixedPercentageDecimal = &v32 + } + return r, nil +} + +func ParseUnionST_Coordinate(s string) (ST_Coordinate, error) { + r := ST_Coordinate{} + if sharedTypes.ST_UniversalMeasurePatternRe.MatchString(s) { + r.ST_UniversalMeasure = &s + } else { + v, err := strconv.ParseInt(s, 10, 64) + if err != nil { + return r, fmt.Errorf("parsing %s as int", err) + } + r.ST_CoordinateUnqualified = &v + } + return r, nil +} +func ParseUnionST_Coordinate32(s string) (ST_Coordinate32, error) { + r := ST_Coordinate32{} + if sharedTypes.ST_UniversalMeasurePatternRe.MatchString(s) { + r.ST_UniversalMeasure = &s + } else { + v, err := strconv.ParseInt(s, 10, 32) + if err != nil { + return r, fmt.Errorf("parsing %s as int", err) + } + v32 := int32(v) + r.ST_Coordinate32Unqualified = &v32 + } + return r, nil +} +func ParseUnionST_AdjCoordinate(s string) (ST_AdjCoordinate, error) { + r := ST_AdjCoordinate{} + if sharedTypes.ST_UniversalMeasurePatternRe.MatchString(s) { + r.ST_Coordinate = &ST_Coordinate{} + r.ST_Coordinate.ST_UniversalMeasure = &s + } else { + v, err := strconv.ParseInt(s, 10, 64) + if err != nil { + // geom guide name can be anything + r.ST_GeomGuideName = &s + } else { + r.ST_Coordinate = &ST_Coordinate{} + r.ST_Coordinate.ST_CoordinateUnqualified = &v + } + } + return r, nil +} + +func ParseUnionST_AdjAngle(s string) (ST_AdjAngle, error) { + r := ST_AdjAngle{} + v, err := strconv.ParseInt(s, 10, 64) + if err != nil { + // geom guide name can be anything + r.ST_GeomGuideName = &s + } else { + v32 := int32(v) + r.ST_Angle = &v32 + } + return r, nil +} + +func ParseUnionST_OnOff(s string) (sharedTypes.ST_OnOff, error) { + return sharedTypes.ST_OnOff{}, nil +} + +func ParseUnionST_TextPoint(s string) (ST_TextPoint, error) { + r := ST_TextPoint{} + if sharedTypes.ST_UniversalMeasurePatternRe.MatchString(s) { + r.ST_UniversalMeasure = &s + } else { + v, err := strconv.ParseInt(s, 10, 32) + if err != nil { + return r, fmt.Errorf("parsing %s as int", err) + } + v32 := int32(v) + r.ST_TextPointUnqualified = &v32 + + } + return r, nil +} + +func ParseUnionST_AnimationDgmBuildType(s string) (ST_AnimationDgmBuildType, error) { + r := ST_AnimationDgmBuildType{} + switch s { + case "allAtOnce": + r.ST_AnimationBuildType = ST_AnimationBuildTypeAllAtOnce + case "one": + r.ST_AnimationDgmOnlyBuildType = ST_AnimationDgmOnlyBuildTypeOne + case "lvlOne": + r.ST_AnimationDgmOnlyBuildType = ST_AnimationDgmOnlyBuildTypeLvlOne + case "lvlAtOnce": + r.ST_AnimationDgmOnlyBuildType = ST_AnimationDgmOnlyBuildTypeLvlAtOnce + } + return r, nil +} + +func ParseUnionST_AnimationChartBuildType(s string) (ST_AnimationChartBuildType, error) { + r := ST_AnimationChartBuildType{} + switch s { + case "allAtOnce": + r.ST_AnimationBuildType = ST_AnimationBuildTypeAllAtOnce + case "series": + r.ST_AnimationChartOnlyBuildType = ST_AnimationChartOnlyBuildTypeSeries + case "category": + r.ST_AnimationChartOnlyBuildType = ST_AnimationChartOnlyBuildTypeCategory + case "seriesEl": + r.ST_AnimationChartOnlyBuildType = ST_AnimationChartOnlyBuildTypeSeriesEl + case "categoryEl": + r.ST_AnimationChartOnlyBuildType = ST_AnimationChartOnlyBuildTypeCategoryEl + } + return r, nil +} + +func ParseUnionST_TextSpacingPercentOrPercentString(s string) (ST_TextSpacingPercentOrPercentString, error) { + r := ST_TextSpacingPercentOrPercentString{} + if sharedTypes.ST_PercentagePatternRe.MatchString(s) { + r.ST_Percentage = &s + } else { + v, err := strconv.ParseInt(s, 10, 64) + if err != nil { + return r, fmt.Errorf("parsing %s as int", err) + } + v32 := int32(v) + r.ST_TextSpacingPercent = &v32 + } + return r, nil +} +func ParseUnionST_TextFontScalePercentOrPercentString(s string) (ST_TextFontScalePercentOrPercentString, error) { + r := ST_TextFontScalePercentOrPercentString{} + if sharedTypes.ST_PercentagePatternRe.MatchString(s) { + r.ST_Percentage = &s + } else { + v, err := strconv.ParseInt(s, 10, 64) + if err != nil { + return r, fmt.Errorf("parsing %s as int", err) + } + v32 := int32(v) + r.ST_TextFontScalePercent = &v32 + } + return r, nil +} + +func ParseStdlibTime(s string) (time.Time, error) { + // TODO: implement this + return time.Time{}, nil +} + +type Any interface { + MarshalXML(e *xml.Encoder, start xml.StartElement) error + UnmarshalXML(d *xml.Decoder, start xml.StartElement) error +} + +func b2i(b bool) uint8 { + if b { + return 1 + } + return 0 +} + +type ST_FontCollectionIndex byte + +const ( + ST_FontCollectionIndexUnset ST_FontCollectionIndex = 0 + ST_FontCollectionIndexMajor ST_FontCollectionIndex = 1 + ST_FontCollectionIndexMinor ST_FontCollectionIndex = 2 + ST_FontCollectionIndexNone ST_FontCollectionIndex = 3 +) + +func (e ST_FontCollectionIndex) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_FontCollectionIndexUnset: + attr.Value = "" + case ST_FontCollectionIndexMajor: + attr.Value = "major" + case ST_FontCollectionIndexMinor: + attr.Value = "minor" + case ST_FontCollectionIndexNone: + attr.Value = "none" + } + return attr, nil +} + +func (e *ST_FontCollectionIndex) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "major": + *e = 1 + case "minor": + *e = 2 + case "none": + *e = 3 + } + return nil +} + +func (m ST_FontCollectionIndex) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_FontCollectionIndex) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "major": + *m = 1 + case "minor": + *m = 2 + case "none": + *m = 3 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_FontCollectionIndex) String() string { + switch m { + case 0: + return "" + case 1: + return "major" + case 2: + return "minor" + case 3: + return "none" + } + return "" +} + +func (m ST_FontCollectionIndex) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_FontCollectionIndex) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_ColorSchemeIndex byte + +const ( + ST_ColorSchemeIndexUnset ST_ColorSchemeIndex = 0 + ST_ColorSchemeIndexDk1 ST_ColorSchemeIndex = 1 + ST_ColorSchemeIndexLt1 ST_ColorSchemeIndex = 2 + ST_ColorSchemeIndexDk2 ST_ColorSchemeIndex = 3 + ST_ColorSchemeIndexLt2 ST_ColorSchemeIndex = 4 + ST_ColorSchemeIndexAccent1 ST_ColorSchemeIndex = 5 + ST_ColorSchemeIndexAccent2 ST_ColorSchemeIndex = 6 + ST_ColorSchemeIndexAccent3 ST_ColorSchemeIndex = 7 + ST_ColorSchemeIndexAccent4 ST_ColorSchemeIndex = 8 + ST_ColorSchemeIndexAccent5 ST_ColorSchemeIndex = 9 + ST_ColorSchemeIndexAccent6 ST_ColorSchemeIndex = 10 + ST_ColorSchemeIndexHlink ST_ColorSchemeIndex = 11 + ST_ColorSchemeIndexFolHlink ST_ColorSchemeIndex = 12 +) + +func (e ST_ColorSchemeIndex) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_ColorSchemeIndexUnset: + attr.Value = "" + case ST_ColorSchemeIndexDk1: + attr.Value = "dk1" + case ST_ColorSchemeIndexLt1: + attr.Value = "lt1" + case ST_ColorSchemeIndexDk2: + attr.Value = "dk2" + case ST_ColorSchemeIndexLt2: + attr.Value = "lt2" + case ST_ColorSchemeIndexAccent1: + attr.Value = "accent1" + case ST_ColorSchemeIndexAccent2: + attr.Value = "accent2" + case ST_ColorSchemeIndexAccent3: + attr.Value = "accent3" + case ST_ColorSchemeIndexAccent4: + attr.Value = "accent4" + case ST_ColorSchemeIndexAccent5: + attr.Value = "accent5" + case ST_ColorSchemeIndexAccent6: + attr.Value = "accent6" + case ST_ColorSchemeIndexHlink: + attr.Value = "hlink" + case ST_ColorSchemeIndexFolHlink: + attr.Value = "folHlink" + } + return attr, nil +} + +func (e *ST_ColorSchemeIndex) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "dk1": + *e = 1 + case "lt1": + *e = 2 + case "dk2": + *e = 3 + case "lt2": + *e = 4 + case "accent1": + *e = 5 + case "accent2": + *e = 6 + case "accent3": + *e = 7 + case "accent4": + *e = 8 + case "accent5": + *e = 9 + case "accent6": + *e = 10 + case "hlink": + *e = 11 + case "folHlink": + *e = 12 + } + return nil +} + +func (m ST_ColorSchemeIndex) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_ColorSchemeIndex) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "dk1": + *m = 1 + case "lt1": + *m = 2 + case "dk2": + *m = 3 + case "lt2": + *m = 4 + case "accent1": + *m = 5 + case "accent2": + *m = 6 + case "accent3": + *m = 7 + case "accent4": + *m = 8 + case "accent5": + *m = 9 + case "accent6": + *m = 10 + case "hlink": + *m = 11 + case "folHlink": + *m = 12 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_ColorSchemeIndex) String() string { + switch m { + case 0: + return "" + case 1: + return "dk1" + case 2: + return "lt1" + case 3: + return "dk2" + case 4: + return "lt2" + case 5: + return "accent1" + case 6: + return "accent2" + case 7: + return "accent3" + case 8: + return "accent4" + case 9: + return "accent5" + case 10: + return "accent6" + case 11: + return "hlink" + case 12: + return "folHlink" + } + return "" +} + +func (m ST_ColorSchemeIndex) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_ColorSchemeIndex) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_SystemColorVal byte + +const ( + ST_SystemColorValUnset ST_SystemColorVal = 0 + ST_SystemColorValScrollBar ST_SystemColorVal = 1 + ST_SystemColorValBackground ST_SystemColorVal = 2 + ST_SystemColorValActiveCaption ST_SystemColorVal = 3 + ST_SystemColorValInactiveCaption ST_SystemColorVal = 4 + ST_SystemColorValMenu ST_SystemColorVal = 5 + ST_SystemColorValWindow ST_SystemColorVal = 6 + ST_SystemColorValWindowFrame ST_SystemColorVal = 7 + ST_SystemColorValMenuText ST_SystemColorVal = 8 + ST_SystemColorValWindowText ST_SystemColorVal = 9 + ST_SystemColorValCaptionText ST_SystemColorVal = 10 + ST_SystemColorValActiveBorder ST_SystemColorVal = 11 + ST_SystemColorValInactiveBorder ST_SystemColorVal = 12 + ST_SystemColorValAppWorkspace ST_SystemColorVal = 13 + ST_SystemColorValHighlight ST_SystemColorVal = 14 + ST_SystemColorValHighlightText ST_SystemColorVal = 15 + ST_SystemColorValBtnFace ST_SystemColorVal = 16 + ST_SystemColorValBtnShadow ST_SystemColorVal = 17 + ST_SystemColorValGrayText ST_SystemColorVal = 18 + ST_SystemColorValBtnText ST_SystemColorVal = 19 + ST_SystemColorValInactiveCaptionText ST_SystemColorVal = 20 + ST_SystemColorValBtnHighlight ST_SystemColorVal = 21 + ST_SystemColorVal3dDkShadow ST_SystemColorVal = 22 + ST_SystemColorVal3dLight ST_SystemColorVal = 23 + ST_SystemColorValInfoText ST_SystemColorVal = 24 + ST_SystemColorValInfoBk ST_SystemColorVal = 25 + ST_SystemColorValHotLight ST_SystemColorVal = 26 + ST_SystemColorValGradientActiveCaption ST_SystemColorVal = 27 + ST_SystemColorValGradientInactiveCaption ST_SystemColorVal = 28 + ST_SystemColorValMenuHighlight ST_SystemColorVal = 29 + ST_SystemColorValMenuBar ST_SystemColorVal = 30 +) + +func (e ST_SystemColorVal) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_SystemColorValUnset: + attr.Value = "" + case ST_SystemColorValScrollBar: + attr.Value = "scrollBar" + case ST_SystemColorValBackground: + attr.Value = "background" + case ST_SystemColorValActiveCaption: + attr.Value = "activeCaption" + case ST_SystemColorValInactiveCaption: + attr.Value = "inactiveCaption" + case ST_SystemColorValMenu: + attr.Value = "menu" + case ST_SystemColorValWindow: + attr.Value = "window" + case ST_SystemColorValWindowFrame: + attr.Value = "windowFrame" + case ST_SystemColorValMenuText: + attr.Value = "menuText" + case ST_SystemColorValWindowText: + attr.Value = "windowText" + case ST_SystemColorValCaptionText: + attr.Value = "captionText" + case ST_SystemColorValActiveBorder: + attr.Value = "activeBorder" + case ST_SystemColorValInactiveBorder: + attr.Value = "inactiveBorder" + case ST_SystemColorValAppWorkspace: + attr.Value = "appWorkspace" + case ST_SystemColorValHighlight: + attr.Value = "highlight" + case ST_SystemColorValHighlightText: + attr.Value = "highlightText" + case ST_SystemColorValBtnFace: + attr.Value = "btnFace" + case ST_SystemColorValBtnShadow: + attr.Value = "btnShadow" + case ST_SystemColorValGrayText: + attr.Value = "grayText" + case ST_SystemColorValBtnText: + attr.Value = "btnText" + case ST_SystemColorValInactiveCaptionText: + attr.Value = "inactiveCaptionText" + case ST_SystemColorValBtnHighlight: + attr.Value = "btnHighlight" + case ST_SystemColorVal3dDkShadow: + attr.Value = "3dDkShadow" + case ST_SystemColorVal3dLight: + attr.Value = "3dLight" + case ST_SystemColorValInfoText: + attr.Value = "infoText" + case ST_SystemColorValInfoBk: + attr.Value = "infoBk" + case ST_SystemColorValHotLight: + attr.Value = "hotLight" + case ST_SystemColorValGradientActiveCaption: + attr.Value = "gradientActiveCaption" + case ST_SystemColorValGradientInactiveCaption: + attr.Value = "gradientInactiveCaption" + case ST_SystemColorValMenuHighlight: + attr.Value = "menuHighlight" + case ST_SystemColorValMenuBar: + attr.Value = "menuBar" + } + return attr, nil +} + +func (e *ST_SystemColorVal) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "scrollBar": + *e = 1 + case "background": + *e = 2 + case "activeCaption": + *e = 3 + case "inactiveCaption": + *e = 4 + case "menu": + *e = 5 + case "window": + *e = 6 + case "windowFrame": + *e = 7 + case "menuText": + *e = 8 + case "windowText": + *e = 9 + case "captionText": + *e = 10 + case "activeBorder": + *e = 11 + case "inactiveBorder": + *e = 12 + case "appWorkspace": + *e = 13 + case "highlight": + *e = 14 + case "highlightText": + *e = 15 + case "btnFace": + *e = 16 + case "btnShadow": + *e = 17 + case "grayText": + *e = 18 + case "btnText": + *e = 19 + case "inactiveCaptionText": + *e = 20 + case "btnHighlight": + *e = 21 + case "3dDkShadow": + *e = 22 + case "3dLight": + *e = 23 + case "infoText": + *e = 24 + case "infoBk": + *e = 25 + case "hotLight": + *e = 26 + case "gradientActiveCaption": + *e = 27 + case "gradientInactiveCaption": + *e = 28 + case "menuHighlight": + *e = 29 + case "menuBar": + *e = 30 + } + return nil +} + +func (m ST_SystemColorVal) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_SystemColorVal) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "scrollBar": + *m = 1 + case "background": + *m = 2 + case "activeCaption": + *m = 3 + case "inactiveCaption": + *m = 4 + case "menu": + *m = 5 + case "window": + *m = 6 + case "windowFrame": + *m = 7 + case "menuText": + *m = 8 + case "windowText": + *m = 9 + case "captionText": + *m = 10 + case "activeBorder": + *m = 11 + case "inactiveBorder": + *m = 12 + case "appWorkspace": + *m = 13 + case "highlight": + *m = 14 + case "highlightText": + *m = 15 + case "btnFace": + *m = 16 + case "btnShadow": + *m = 17 + case "grayText": + *m = 18 + case "btnText": + *m = 19 + case "inactiveCaptionText": + *m = 20 + case "btnHighlight": + *m = 21 + case "3dDkShadow": + *m = 22 + case "3dLight": + *m = 23 + case "infoText": + *m = 24 + case "infoBk": + *m = 25 + case "hotLight": + *m = 26 + case "gradientActiveCaption": + *m = 27 + case "gradientInactiveCaption": + *m = 28 + case "menuHighlight": + *m = 29 + case "menuBar": + *m = 30 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_SystemColorVal) String() string { + switch m { + case 0: + return "" + case 1: + return "scrollBar" + case 2: + return "background" + case 3: + return "activeCaption" + case 4: + return "inactiveCaption" + case 5: + return "menu" + case 6: + return "window" + case 7: + return "windowFrame" + case 8: + return "menuText" + case 9: + return "windowText" + case 10: + return "captionText" + case 11: + return "activeBorder" + case 12: + return "inactiveBorder" + case 13: + return "appWorkspace" + case 14: + return "highlight" + case 15: + return "highlightText" + case 16: + return "btnFace" + case 17: + return "btnShadow" + case 18: + return "grayText" + case 19: + return "btnText" + case 20: + return "inactiveCaptionText" + case 21: + return "btnHighlight" + case 22: + return "3dDkShadow" + case 23: + return "3dLight" + case 24: + return "infoText" + case 25: + return "infoBk" + case 26: + return "hotLight" + case 27: + return "gradientActiveCaption" + case 28: + return "gradientInactiveCaption" + case 29: + return "menuHighlight" + case 30: + return "menuBar" + } + return "" +} + +func (m ST_SystemColorVal) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_SystemColorVal) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_SchemeColorVal byte + +const ( + ST_SchemeColorValUnset ST_SchemeColorVal = 0 + ST_SchemeColorValBg1 ST_SchemeColorVal = 1 + ST_SchemeColorValTx1 ST_SchemeColorVal = 2 + ST_SchemeColorValBg2 ST_SchemeColorVal = 3 + ST_SchemeColorValTx2 ST_SchemeColorVal = 4 + ST_SchemeColorValAccent1 ST_SchemeColorVal = 5 + ST_SchemeColorValAccent2 ST_SchemeColorVal = 6 + ST_SchemeColorValAccent3 ST_SchemeColorVal = 7 + ST_SchemeColorValAccent4 ST_SchemeColorVal = 8 + ST_SchemeColorValAccent5 ST_SchemeColorVal = 9 + ST_SchemeColorValAccent6 ST_SchemeColorVal = 10 + ST_SchemeColorValHlink ST_SchemeColorVal = 11 + ST_SchemeColorValFolHlink ST_SchemeColorVal = 12 + ST_SchemeColorValPhClr ST_SchemeColorVal = 13 + ST_SchemeColorValDk1 ST_SchemeColorVal = 14 + ST_SchemeColorValLt1 ST_SchemeColorVal = 15 + ST_SchemeColorValDk2 ST_SchemeColorVal = 16 + ST_SchemeColorValLt2 ST_SchemeColorVal = 17 +) + +func (e ST_SchemeColorVal) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_SchemeColorValUnset: + attr.Value = "" + case ST_SchemeColorValBg1: + attr.Value = "bg1" + case ST_SchemeColorValTx1: + attr.Value = "tx1" + case ST_SchemeColorValBg2: + attr.Value = "bg2" + case ST_SchemeColorValTx2: + attr.Value = "tx2" + case ST_SchemeColorValAccent1: + attr.Value = "accent1" + case ST_SchemeColorValAccent2: + attr.Value = "accent2" + case ST_SchemeColorValAccent3: + attr.Value = "accent3" + case ST_SchemeColorValAccent4: + attr.Value = "accent4" + case ST_SchemeColorValAccent5: + attr.Value = "accent5" + case ST_SchemeColorValAccent6: + attr.Value = "accent6" + case ST_SchemeColorValHlink: + attr.Value = "hlink" + case ST_SchemeColorValFolHlink: + attr.Value = "folHlink" + case ST_SchemeColorValPhClr: + attr.Value = "phClr" + case ST_SchemeColorValDk1: + attr.Value = "dk1" + case ST_SchemeColorValLt1: + attr.Value = "lt1" + case ST_SchemeColorValDk2: + attr.Value = "dk2" + case ST_SchemeColorValLt2: + attr.Value = "lt2" + } + return attr, nil +} + +func (e *ST_SchemeColorVal) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "bg1": + *e = 1 + case "tx1": + *e = 2 + case "bg2": + *e = 3 + case "tx2": + *e = 4 + case "accent1": + *e = 5 + case "accent2": + *e = 6 + case "accent3": + *e = 7 + case "accent4": + *e = 8 + case "accent5": + *e = 9 + case "accent6": + *e = 10 + case "hlink": + *e = 11 + case "folHlink": + *e = 12 + case "phClr": + *e = 13 + case "dk1": + *e = 14 + case "lt1": + *e = 15 + case "dk2": + *e = 16 + case "lt2": + *e = 17 + } + return nil +} + +func (m ST_SchemeColorVal) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_SchemeColorVal) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "bg1": + *m = 1 + case "tx1": + *m = 2 + case "bg2": + *m = 3 + case "tx2": + *m = 4 + case "accent1": + *m = 5 + case "accent2": + *m = 6 + case "accent3": + *m = 7 + case "accent4": + *m = 8 + case "accent5": + *m = 9 + case "accent6": + *m = 10 + case "hlink": + *m = 11 + case "folHlink": + *m = 12 + case "phClr": + *m = 13 + case "dk1": + *m = 14 + case "lt1": + *m = 15 + case "dk2": + *m = 16 + case "lt2": + *m = 17 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_SchemeColorVal) String() string { + switch m { + case 0: + return "" + case 1: + return "bg1" + case 2: + return "tx1" + case 3: + return "bg2" + case 4: + return "tx2" + case 5: + return "accent1" + case 6: + return "accent2" + case 7: + return "accent3" + case 8: + return "accent4" + case 9: + return "accent5" + case 10: + return "accent6" + case 11: + return "hlink" + case 12: + return "folHlink" + case 13: + return "phClr" + case 14: + return "dk1" + case 15: + return "lt1" + case 16: + return "dk2" + case 17: + return "lt2" + } + return "" +} + +func (m ST_SchemeColorVal) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_SchemeColorVal) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_PresetColorVal byte + +const ( + ST_PresetColorValUnset ST_PresetColorVal = 0 + ST_PresetColorValAliceBlue ST_PresetColorVal = 1 + ST_PresetColorValAntiqueWhite ST_PresetColorVal = 2 + ST_PresetColorValAqua ST_PresetColorVal = 3 + ST_PresetColorValAquamarine ST_PresetColorVal = 4 + ST_PresetColorValAzure ST_PresetColorVal = 5 + ST_PresetColorValBeige ST_PresetColorVal = 6 + ST_PresetColorValBisque ST_PresetColorVal = 7 + ST_PresetColorValBlack ST_PresetColorVal = 8 + ST_PresetColorValBlanchedAlmond ST_PresetColorVal = 9 + ST_PresetColorValBlue ST_PresetColorVal = 10 + ST_PresetColorValBlueViolet ST_PresetColorVal = 11 + ST_PresetColorValBrown ST_PresetColorVal = 12 + ST_PresetColorValBurlyWood ST_PresetColorVal = 13 + ST_PresetColorValCadetBlue ST_PresetColorVal = 14 + ST_PresetColorValChartreuse ST_PresetColorVal = 15 + ST_PresetColorValChocolate ST_PresetColorVal = 16 + ST_PresetColorValCoral ST_PresetColorVal = 17 + ST_PresetColorValCornflowerBlue ST_PresetColorVal = 18 + ST_PresetColorValCornsilk ST_PresetColorVal = 19 + ST_PresetColorValCrimson ST_PresetColorVal = 20 + ST_PresetColorValCyan ST_PresetColorVal = 21 + ST_PresetColorValDarkBlue ST_PresetColorVal = 22 + ST_PresetColorValDarkCyan ST_PresetColorVal = 23 + ST_PresetColorValDarkGoldenrod ST_PresetColorVal = 24 + ST_PresetColorValDarkGray ST_PresetColorVal = 25 + ST_PresetColorValDarkGrey ST_PresetColorVal = 26 + ST_PresetColorValDarkGreen ST_PresetColorVal = 27 + ST_PresetColorValDarkKhaki ST_PresetColorVal = 28 + ST_PresetColorValDarkMagenta ST_PresetColorVal = 29 + ST_PresetColorValDarkOliveGreen ST_PresetColorVal = 30 + ST_PresetColorValDarkOrange ST_PresetColorVal = 31 + ST_PresetColorValDarkOrchid ST_PresetColorVal = 32 + ST_PresetColorValDarkRed ST_PresetColorVal = 33 + ST_PresetColorValDarkSalmon ST_PresetColorVal = 34 + ST_PresetColorValDarkSeaGreen ST_PresetColorVal = 35 + ST_PresetColorValDarkSlateBlue ST_PresetColorVal = 36 + ST_PresetColorValDarkSlateGray ST_PresetColorVal = 37 + ST_PresetColorValDarkSlateGrey ST_PresetColorVal = 38 + ST_PresetColorValDarkTurquoise ST_PresetColorVal = 39 + ST_PresetColorValDarkViolet ST_PresetColorVal = 40 + ST_PresetColorValDkBlue ST_PresetColorVal = 41 + ST_PresetColorValDkCyan ST_PresetColorVal = 42 + ST_PresetColorValDkGoldenrod ST_PresetColorVal = 43 + ST_PresetColorValDkGray ST_PresetColorVal = 44 + ST_PresetColorValDkGrey ST_PresetColorVal = 45 + ST_PresetColorValDkGreen ST_PresetColorVal = 46 + ST_PresetColorValDkKhaki ST_PresetColorVal = 47 + ST_PresetColorValDkMagenta ST_PresetColorVal = 48 + ST_PresetColorValDkOliveGreen ST_PresetColorVal = 49 + ST_PresetColorValDkOrange ST_PresetColorVal = 50 + ST_PresetColorValDkOrchid ST_PresetColorVal = 51 + ST_PresetColorValDkRed ST_PresetColorVal = 52 + ST_PresetColorValDkSalmon ST_PresetColorVal = 53 + ST_PresetColorValDkSeaGreen ST_PresetColorVal = 54 + ST_PresetColorValDkSlateBlue ST_PresetColorVal = 55 + ST_PresetColorValDkSlateGray ST_PresetColorVal = 56 + ST_PresetColorValDkSlateGrey ST_PresetColorVal = 57 + ST_PresetColorValDkTurquoise ST_PresetColorVal = 58 + ST_PresetColorValDkViolet ST_PresetColorVal = 59 + ST_PresetColorValDeepPink ST_PresetColorVal = 60 + ST_PresetColorValDeepSkyBlue ST_PresetColorVal = 61 + ST_PresetColorValDimGray ST_PresetColorVal = 62 + ST_PresetColorValDimGrey ST_PresetColorVal = 63 + ST_PresetColorValDodgerBlue ST_PresetColorVal = 64 + ST_PresetColorValFirebrick ST_PresetColorVal = 65 + ST_PresetColorValFloralWhite ST_PresetColorVal = 66 + ST_PresetColorValForestGreen ST_PresetColorVal = 67 + ST_PresetColorValFuchsia ST_PresetColorVal = 68 + ST_PresetColorValGainsboro ST_PresetColorVal = 69 + ST_PresetColorValGhostWhite ST_PresetColorVal = 70 + ST_PresetColorValGold ST_PresetColorVal = 71 + ST_PresetColorValGoldenrod ST_PresetColorVal = 72 + ST_PresetColorValGray ST_PresetColorVal = 73 + ST_PresetColorValGrey ST_PresetColorVal = 74 + ST_PresetColorValGreen ST_PresetColorVal = 75 + ST_PresetColorValGreenYellow ST_PresetColorVal = 76 + ST_PresetColorValHoneydew ST_PresetColorVal = 77 + ST_PresetColorValHotPink ST_PresetColorVal = 78 + ST_PresetColorValIndianRed ST_PresetColorVal = 79 + ST_PresetColorValIndigo ST_PresetColorVal = 80 + ST_PresetColorValIvory ST_PresetColorVal = 81 + ST_PresetColorValKhaki ST_PresetColorVal = 82 + ST_PresetColorValLavender ST_PresetColorVal = 83 + ST_PresetColorValLavenderBlush ST_PresetColorVal = 84 + ST_PresetColorValLawnGreen ST_PresetColorVal = 85 + ST_PresetColorValLemonChiffon ST_PresetColorVal = 86 + ST_PresetColorValLightBlue ST_PresetColorVal = 87 + ST_PresetColorValLightCoral ST_PresetColorVal = 88 + ST_PresetColorValLightCyan ST_PresetColorVal = 89 + ST_PresetColorValLightGoldenrodYellow ST_PresetColorVal = 90 + ST_PresetColorValLightGray ST_PresetColorVal = 91 + ST_PresetColorValLightGrey ST_PresetColorVal = 92 + ST_PresetColorValLightGreen ST_PresetColorVal = 93 + ST_PresetColorValLightPink ST_PresetColorVal = 94 + ST_PresetColorValLightSalmon ST_PresetColorVal = 95 + ST_PresetColorValLightSeaGreen ST_PresetColorVal = 96 + ST_PresetColorValLightSkyBlue ST_PresetColorVal = 97 + ST_PresetColorValLightSlateGray ST_PresetColorVal = 98 + ST_PresetColorValLightSlateGrey ST_PresetColorVal = 99 + ST_PresetColorValLightSteelBlue ST_PresetColorVal = 100 + ST_PresetColorValLightYellow ST_PresetColorVal = 101 + ST_PresetColorValLtBlue ST_PresetColorVal = 102 + ST_PresetColorValLtCoral ST_PresetColorVal = 103 + ST_PresetColorValLtCyan ST_PresetColorVal = 104 + ST_PresetColorValLtGoldenrodYellow ST_PresetColorVal = 105 + ST_PresetColorValLtGray ST_PresetColorVal = 106 + ST_PresetColorValLtGrey ST_PresetColorVal = 107 + ST_PresetColorValLtGreen ST_PresetColorVal = 108 + ST_PresetColorValLtPink ST_PresetColorVal = 109 + ST_PresetColorValLtSalmon ST_PresetColorVal = 110 + ST_PresetColorValLtSeaGreen ST_PresetColorVal = 111 + ST_PresetColorValLtSkyBlue ST_PresetColorVal = 112 + ST_PresetColorValLtSlateGray ST_PresetColorVal = 113 + ST_PresetColorValLtSlateGrey ST_PresetColorVal = 114 + ST_PresetColorValLtSteelBlue ST_PresetColorVal = 115 + ST_PresetColorValLtYellow ST_PresetColorVal = 116 + ST_PresetColorValLime ST_PresetColorVal = 117 + ST_PresetColorValLimeGreen ST_PresetColorVal = 118 + ST_PresetColorValLinen ST_PresetColorVal = 119 + ST_PresetColorValMagenta ST_PresetColorVal = 120 + ST_PresetColorValMaroon ST_PresetColorVal = 121 + ST_PresetColorValMedAquamarine ST_PresetColorVal = 122 + ST_PresetColorValMedBlue ST_PresetColorVal = 123 + ST_PresetColorValMedOrchid ST_PresetColorVal = 124 + ST_PresetColorValMedPurple ST_PresetColorVal = 125 + ST_PresetColorValMedSeaGreen ST_PresetColorVal = 126 + ST_PresetColorValMedSlateBlue ST_PresetColorVal = 127 + ST_PresetColorValMedSpringGreen ST_PresetColorVal = 128 + ST_PresetColorValMedTurquoise ST_PresetColorVal = 129 + ST_PresetColorValMedVioletRed ST_PresetColorVal = 130 + ST_PresetColorValMediumAquamarine ST_PresetColorVal = 131 + ST_PresetColorValMediumBlue ST_PresetColorVal = 132 + ST_PresetColorValMediumOrchid ST_PresetColorVal = 133 + ST_PresetColorValMediumPurple ST_PresetColorVal = 134 + ST_PresetColorValMediumSeaGreen ST_PresetColorVal = 135 + ST_PresetColorValMediumSlateBlue ST_PresetColorVal = 136 + ST_PresetColorValMediumSpringGreen ST_PresetColorVal = 137 + ST_PresetColorValMediumTurquoise ST_PresetColorVal = 138 + ST_PresetColorValMediumVioletRed ST_PresetColorVal = 139 + ST_PresetColorValMidnightBlue ST_PresetColorVal = 140 + ST_PresetColorValMintCream ST_PresetColorVal = 141 + ST_PresetColorValMistyRose ST_PresetColorVal = 142 + ST_PresetColorValMoccasin ST_PresetColorVal = 143 + ST_PresetColorValNavajoWhite ST_PresetColorVal = 144 + ST_PresetColorValNavy ST_PresetColorVal = 145 + ST_PresetColorValOldLace ST_PresetColorVal = 146 + ST_PresetColorValOlive ST_PresetColorVal = 147 + ST_PresetColorValOliveDrab ST_PresetColorVal = 148 + ST_PresetColorValOrange ST_PresetColorVal = 149 + ST_PresetColorValOrangeRed ST_PresetColorVal = 150 + ST_PresetColorValOrchid ST_PresetColorVal = 151 + ST_PresetColorValPaleGoldenrod ST_PresetColorVal = 152 + ST_PresetColorValPaleGreen ST_PresetColorVal = 153 + ST_PresetColorValPaleTurquoise ST_PresetColorVal = 154 + ST_PresetColorValPaleVioletRed ST_PresetColorVal = 155 + ST_PresetColorValPapayaWhip ST_PresetColorVal = 156 + ST_PresetColorValPeachPuff ST_PresetColorVal = 157 + ST_PresetColorValPeru ST_PresetColorVal = 158 + ST_PresetColorValPink ST_PresetColorVal = 159 + ST_PresetColorValPlum ST_PresetColorVal = 160 + ST_PresetColorValPowderBlue ST_PresetColorVal = 161 + ST_PresetColorValPurple ST_PresetColorVal = 162 + ST_PresetColorValRed ST_PresetColorVal = 163 + ST_PresetColorValRosyBrown ST_PresetColorVal = 164 + ST_PresetColorValRoyalBlue ST_PresetColorVal = 165 + ST_PresetColorValSaddleBrown ST_PresetColorVal = 166 + ST_PresetColorValSalmon ST_PresetColorVal = 167 + ST_PresetColorValSandyBrown ST_PresetColorVal = 168 + ST_PresetColorValSeaGreen ST_PresetColorVal = 169 + ST_PresetColorValSeaShell ST_PresetColorVal = 170 + ST_PresetColorValSienna ST_PresetColorVal = 171 + ST_PresetColorValSilver ST_PresetColorVal = 172 + ST_PresetColorValSkyBlue ST_PresetColorVal = 173 + ST_PresetColorValSlateBlue ST_PresetColorVal = 174 + ST_PresetColorValSlateGray ST_PresetColorVal = 175 + ST_PresetColorValSlateGrey ST_PresetColorVal = 176 + ST_PresetColorValSnow ST_PresetColorVal = 177 + ST_PresetColorValSpringGreen ST_PresetColorVal = 178 + ST_PresetColorValSteelBlue ST_PresetColorVal = 179 + ST_PresetColorValTan ST_PresetColorVal = 180 + ST_PresetColorValTeal ST_PresetColorVal = 181 + ST_PresetColorValThistle ST_PresetColorVal = 182 + ST_PresetColorValTomato ST_PresetColorVal = 183 + ST_PresetColorValTurquoise ST_PresetColorVal = 184 + ST_PresetColorValViolet ST_PresetColorVal = 185 + ST_PresetColorValWheat ST_PresetColorVal = 186 + ST_PresetColorValWhite ST_PresetColorVal = 187 + ST_PresetColorValWhiteSmoke ST_PresetColorVal = 188 + ST_PresetColorValYellow ST_PresetColorVal = 189 + ST_PresetColorValYellowGreen ST_PresetColorVal = 190 +) + +func (e ST_PresetColorVal) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_PresetColorValUnset: + attr.Value = "" + case ST_PresetColorValAliceBlue: + attr.Value = "aliceBlue" + case ST_PresetColorValAntiqueWhite: + attr.Value = "antiqueWhite" + case ST_PresetColorValAqua: + attr.Value = "aqua" + case ST_PresetColorValAquamarine: + attr.Value = "aquamarine" + case ST_PresetColorValAzure: + attr.Value = "azure" + case ST_PresetColorValBeige: + attr.Value = "beige" + case ST_PresetColorValBisque: + attr.Value = "bisque" + case ST_PresetColorValBlack: + attr.Value = "black" + case ST_PresetColorValBlanchedAlmond: + attr.Value = "blanchedAlmond" + case ST_PresetColorValBlue: + attr.Value = "blue" + case ST_PresetColorValBlueViolet: + attr.Value = "blueViolet" + case ST_PresetColorValBrown: + attr.Value = "brown" + case ST_PresetColorValBurlyWood: + attr.Value = "burlyWood" + case ST_PresetColorValCadetBlue: + attr.Value = "cadetBlue" + case ST_PresetColorValChartreuse: + attr.Value = "chartreuse" + case ST_PresetColorValChocolate: + attr.Value = "chocolate" + case ST_PresetColorValCoral: + attr.Value = "coral" + case ST_PresetColorValCornflowerBlue: + attr.Value = "cornflowerBlue" + case ST_PresetColorValCornsilk: + attr.Value = "cornsilk" + case ST_PresetColorValCrimson: + attr.Value = "crimson" + case ST_PresetColorValCyan: + attr.Value = "cyan" + case ST_PresetColorValDarkBlue: + attr.Value = "darkBlue" + case ST_PresetColorValDarkCyan: + attr.Value = "darkCyan" + case ST_PresetColorValDarkGoldenrod: + attr.Value = "darkGoldenrod" + case ST_PresetColorValDarkGray: + attr.Value = "darkGray" + case ST_PresetColorValDarkGrey: + attr.Value = "darkGrey" + case ST_PresetColorValDarkGreen: + attr.Value = "darkGreen" + case ST_PresetColorValDarkKhaki: + attr.Value = "darkKhaki" + case ST_PresetColorValDarkMagenta: + attr.Value = "darkMagenta" + case ST_PresetColorValDarkOliveGreen: + attr.Value = "darkOliveGreen" + case ST_PresetColorValDarkOrange: + attr.Value = "darkOrange" + case ST_PresetColorValDarkOrchid: + attr.Value = "darkOrchid" + case ST_PresetColorValDarkRed: + attr.Value = "darkRed" + case ST_PresetColorValDarkSalmon: + attr.Value = "darkSalmon" + case ST_PresetColorValDarkSeaGreen: + attr.Value = "darkSeaGreen" + case ST_PresetColorValDarkSlateBlue: + attr.Value = "darkSlateBlue" + case ST_PresetColorValDarkSlateGray: + attr.Value = "darkSlateGray" + case ST_PresetColorValDarkSlateGrey: + attr.Value = "darkSlateGrey" + case ST_PresetColorValDarkTurquoise: + attr.Value = "darkTurquoise" + case ST_PresetColorValDarkViolet: + attr.Value = "darkViolet" + case ST_PresetColorValDkBlue: + attr.Value = "dkBlue" + case ST_PresetColorValDkCyan: + attr.Value = "dkCyan" + case ST_PresetColorValDkGoldenrod: + attr.Value = "dkGoldenrod" + case ST_PresetColorValDkGray: + attr.Value = "dkGray" + case ST_PresetColorValDkGrey: + attr.Value = "dkGrey" + case ST_PresetColorValDkGreen: + attr.Value = "dkGreen" + case ST_PresetColorValDkKhaki: + attr.Value = "dkKhaki" + case ST_PresetColorValDkMagenta: + attr.Value = "dkMagenta" + case ST_PresetColorValDkOliveGreen: + attr.Value = "dkOliveGreen" + case ST_PresetColorValDkOrange: + attr.Value = "dkOrange" + case ST_PresetColorValDkOrchid: + attr.Value = "dkOrchid" + case ST_PresetColorValDkRed: + attr.Value = "dkRed" + case ST_PresetColorValDkSalmon: + attr.Value = "dkSalmon" + case ST_PresetColorValDkSeaGreen: + attr.Value = "dkSeaGreen" + case ST_PresetColorValDkSlateBlue: + attr.Value = "dkSlateBlue" + case ST_PresetColorValDkSlateGray: + attr.Value = "dkSlateGray" + case ST_PresetColorValDkSlateGrey: + attr.Value = "dkSlateGrey" + case ST_PresetColorValDkTurquoise: + attr.Value = "dkTurquoise" + case ST_PresetColorValDkViolet: + attr.Value = "dkViolet" + case ST_PresetColorValDeepPink: + attr.Value = "deepPink" + case ST_PresetColorValDeepSkyBlue: + attr.Value = "deepSkyBlue" + case ST_PresetColorValDimGray: + attr.Value = "dimGray" + case ST_PresetColorValDimGrey: + attr.Value = "dimGrey" + case ST_PresetColorValDodgerBlue: + attr.Value = "dodgerBlue" + case ST_PresetColorValFirebrick: + attr.Value = "firebrick" + case ST_PresetColorValFloralWhite: + attr.Value = "floralWhite" + case ST_PresetColorValForestGreen: + attr.Value = "forestGreen" + case ST_PresetColorValFuchsia: + attr.Value = "fuchsia" + case ST_PresetColorValGainsboro: + attr.Value = "gainsboro" + case ST_PresetColorValGhostWhite: + attr.Value = "ghostWhite" + case ST_PresetColorValGold: + attr.Value = "gold" + case ST_PresetColorValGoldenrod: + attr.Value = "goldenrod" + case ST_PresetColorValGray: + attr.Value = "gray" + case ST_PresetColorValGrey: + attr.Value = "grey" + case ST_PresetColorValGreen: + attr.Value = "green" + case ST_PresetColorValGreenYellow: + attr.Value = "greenYellow" + case ST_PresetColorValHoneydew: + attr.Value = "honeydew" + case ST_PresetColorValHotPink: + attr.Value = "hotPink" + case ST_PresetColorValIndianRed: + attr.Value = "indianRed" + case ST_PresetColorValIndigo: + attr.Value = "indigo" + case ST_PresetColorValIvory: + attr.Value = "ivory" + case ST_PresetColorValKhaki: + attr.Value = "khaki" + case ST_PresetColorValLavender: + attr.Value = "lavender" + case ST_PresetColorValLavenderBlush: + attr.Value = "lavenderBlush" + case ST_PresetColorValLawnGreen: + attr.Value = "lawnGreen" + case ST_PresetColorValLemonChiffon: + attr.Value = "lemonChiffon" + case ST_PresetColorValLightBlue: + attr.Value = "lightBlue" + case ST_PresetColorValLightCoral: + attr.Value = "lightCoral" + case ST_PresetColorValLightCyan: + attr.Value = "lightCyan" + case ST_PresetColorValLightGoldenrodYellow: + attr.Value = "lightGoldenrodYellow" + case ST_PresetColorValLightGray: + attr.Value = "lightGray" + case ST_PresetColorValLightGrey: + attr.Value = "lightGrey" + case ST_PresetColorValLightGreen: + attr.Value = "lightGreen" + case ST_PresetColorValLightPink: + attr.Value = "lightPink" + case ST_PresetColorValLightSalmon: + attr.Value = "lightSalmon" + case ST_PresetColorValLightSeaGreen: + attr.Value = "lightSeaGreen" + case ST_PresetColorValLightSkyBlue: + attr.Value = "lightSkyBlue" + case ST_PresetColorValLightSlateGray: + attr.Value = "lightSlateGray" + case ST_PresetColorValLightSlateGrey: + attr.Value = "lightSlateGrey" + case ST_PresetColorValLightSteelBlue: + attr.Value = "lightSteelBlue" + case ST_PresetColorValLightYellow: + attr.Value = "lightYellow" + case ST_PresetColorValLtBlue: + attr.Value = "ltBlue" + case ST_PresetColorValLtCoral: + attr.Value = "ltCoral" + case ST_PresetColorValLtCyan: + attr.Value = "ltCyan" + case ST_PresetColorValLtGoldenrodYellow: + attr.Value = "ltGoldenrodYellow" + case ST_PresetColorValLtGray: + attr.Value = "ltGray" + case ST_PresetColorValLtGrey: + attr.Value = "ltGrey" + case ST_PresetColorValLtGreen: + attr.Value = "ltGreen" + case ST_PresetColorValLtPink: + attr.Value = "ltPink" + case ST_PresetColorValLtSalmon: + attr.Value = "ltSalmon" + case ST_PresetColorValLtSeaGreen: + attr.Value = "ltSeaGreen" + case ST_PresetColorValLtSkyBlue: + attr.Value = "ltSkyBlue" + case ST_PresetColorValLtSlateGray: + attr.Value = "ltSlateGray" + case ST_PresetColorValLtSlateGrey: + attr.Value = "ltSlateGrey" + case ST_PresetColorValLtSteelBlue: + attr.Value = "ltSteelBlue" + case ST_PresetColorValLtYellow: + attr.Value = "ltYellow" + case ST_PresetColorValLime: + attr.Value = "lime" + case ST_PresetColorValLimeGreen: + attr.Value = "limeGreen" + case ST_PresetColorValLinen: + attr.Value = "linen" + case ST_PresetColorValMagenta: + attr.Value = "magenta" + case ST_PresetColorValMaroon: + attr.Value = "maroon" + case ST_PresetColorValMedAquamarine: + attr.Value = "medAquamarine" + case ST_PresetColorValMedBlue: + attr.Value = "medBlue" + case ST_PresetColorValMedOrchid: + attr.Value = "medOrchid" + case ST_PresetColorValMedPurple: + attr.Value = "medPurple" + case ST_PresetColorValMedSeaGreen: + attr.Value = "medSeaGreen" + case ST_PresetColorValMedSlateBlue: + attr.Value = "medSlateBlue" + case ST_PresetColorValMedSpringGreen: + attr.Value = "medSpringGreen" + case ST_PresetColorValMedTurquoise: + attr.Value = "medTurquoise" + case ST_PresetColorValMedVioletRed: + attr.Value = "medVioletRed" + case ST_PresetColorValMediumAquamarine: + attr.Value = "mediumAquamarine" + case ST_PresetColorValMediumBlue: + attr.Value = "mediumBlue" + case ST_PresetColorValMediumOrchid: + attr.Value = "mediumOrchid" + case ST_PresetColorValMediumPurple: + attr.Value = "mediumPurple" + case ST_PresetColorValMediumSeaGreen: + attr.Value = "mediumSeaGreen" + case ST_PresetColorValMediumSlateBlue: + attr.Value = "mediumSlateBlue" + case ST_PresetColorValMediumSpringGreen: + attr.Value = "mediumSpringGreen" + case ST_PresetColorValMediumTurquoise: + attr.Value = "mediumTurquoise" + case ST_PresetColorValMediumVioletRed: + attr.Value = "mediumVioletRed" + case ST_PresetColorValMidnightBlue: + attr.Value = "midnightBlue" + case ST_PresetColorValMintCream: + attr.Value = "mintCream" + case ST_PresetColorValMistyRose: + attr.Value = "mistyRose" + case ST_PresetColorValMoccasin: + attr.Value = "moccasin" + case ST_PresetColorValNavajoWhite: + attr.Value = "navajoWhite" + case ST_PresetColorValNavy: + attr.Value = "navy" + case ST_PresetColorValOldLace: + attr.Value = "oldLace" + case ST_PresetColorValOlive: + attr.Value = "olive" + case ST_PresetColorValOliveDrab: + attr.Value = "oliveDrab" + case ST_PresetColorValOrange: + attr.Value = "orange" + case ST_PresetColorValOrangeRed: + attr.Value = "orangeRed" + case ST_PresetColorValOrchid: + attr.Value = "orchid" + case ST_PresetColorValPaleGoldenrod: + attr.Value = "paleGoldenrod" + case ST_PresetColorValPaleGreen: + attr.Value = "paleGreen" + case ST_PresetColorValPaleTurquoise: + attr.Value = "paleTurquoise" + case ST_PresetColorValPaleVioletRed: + attr.Value = "paleVioletRed" + case ST_PresetColorValPapayaWhip: + attr.Value = "papayaWhip" + case ST_PresetColorValPeachPuff: + attr.Value = "peachPuff" + case ST_PresetColorValPeru: + attr.Value = "peru" + case ST_PresetColorValPink: + attr.Value = "pink" + case ST_PresetColorValPlum: + attr.Value = "plum" + case ST_PresetColorValPowderBlue: + attr.Value = "powderBlue" + case ST_PresetColorValPurple: + attr.Value = "purple" + case ST_PresetColorValRed: + attr.Value = "red" + case ST_PresetColorValRosyBrown: + attr.Value = "rosyBrown" + case ST_PresetColorValRoyalBlue: + attr.Value = "royalBlue" + case ST_PresetColorValSaddleBrown: + attr.Value = "saddleBrown" + case ST_PresetColorValSalmon: + attr.Value = "salmon" + case ST_PresetColorValSandyBrown: + attr.Value = "sandyBrown" + case ST_PresetColorValSeaGreen: + attr.Value = "seaGreen" + case ST_PresetColorValSeaShell: + attr.Value = "seaShell" + case ST_PresetColorValSienna: + attr.Value = "sienna" + case ST_PresetColorValSilver: + attr.Value = "silver" + case ST_PresetColorValSkyBlue: + attr.Value = "skyBlue" + case ST_PresetColorValSlateBlue: + attr.Value = "slateBlue" + case ST_PresetColorValSlateGray: + attr.Value = "slateGray" + case ST_PresetColorValSlateGrey: + attr.Value = "slateGrey" + case ST_PresetColorValSnow: + attr.Value = "snow" + case ST_PresetColorValSpringGreen: + attr.Value = "springGreen" + case ST_PresetColorValSteelBlue: + attr.Value = "steelBlue" + case ST_PresetColorValTan: + attr.Value = "tan" + case ST_PresetColorValTeal: + attr.Value = "teal" + case ST_PresetColorValThistle: + attr.Value = "thistle" + case ST_PresetColorValTomato: + attr.Value = "tomato" + case ST_PresetColorValTurquoise: + attr.Value = "turquoise" + case ST_PresetColorValViolet: + attr.Value = "violet" + case ST_PresetColorValWheat: + attr.Value = "wheat" + case ST_PresetColorValWhite: + attr.Value = "white" + case ST_PresetColorValWhiteSmoke: + attr.Value = "whiteSmoke" + case ST_PresetColorValYellow: + attr.Value = "yellow" + case ST_PresetColorValYellowGreen: + attr.Value = "yellowGreen" + } + return attr, nil +} + +func (e *ST_PresetColorVal) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "aliceBlue": + *e = 1 + case "antiqueWhite": + *e = 2 + case "aqua": + *e = 3 + case "aquamarine": + *e = 4 + case "azure": + *e = 5 + case "beige": + *e = 6 + case "bisque": + *e = 7 + case "black": + *e = 8 + case "blanchedAlmond": + *e = 9 + case "blue": + *e = 10 + case "blueViolet": + *e = 11 + case "brown": + *e = 12 + case "burlyWood": + *e = 13 + case "cadetBlue": + *e = 14 + case "chartreuse": + *e = 15 + case "chocolate": + *e = 16 + case "coral": + *e = 17 + case "cornflowerBlue": + *e = 18 + case "cornsilk": + *e = 19 + case "crimson": + *e = 20 + case "cyan": + *e = 21 + case "darkBlue": + *e = 22 + case "darkCyan": + *e = 23 + case "darkGoldenrod": + *e = 24 + case "darkGray": + *e = 25 + case "darkGrey": + *e = 26 + case "darkGreen": + *e = 27 + case "darkKhaki": + *e = 28 + case "darkMagenta": + *e = 29 + case "darkOliveGreen": + *e = 30 + case "darkOrange": + *e = 31 + case "darkOrchid": + *e = 32 + case "darkRed": + *e = 33 + case "darkSalmon": + *e = 34 + case "darkSeaGreen": + *e = 35 + case "darkSlateBlue": + *e = 36 + case "darkSlateGray": + *e = 37 + case "darkSlateGrey": + *e = 38 + case "darkTurquoise": + *e = 39 + case "darkViolet": + *e = 40 + case "dkBlue": + *e = 41 + case "dkCyan": + *e = 42 + case "dkGoldenrod": + *e = 43 + case "dkGray": + *e = 44 + case "dkGrey": + *e = 45 + case "dkGreen": + *e = 46 + case "dkKhaki": + *e = 47 + case "dkMagenta": + *e = 48 + case "dkOliveGreen": + *e = 49 + case "dkOrange": + *e = 50 + case "dkOrchid": + *e = 51 + case "dkRed": + *e = 52 + case "dkSalmon": + *e = 53 + case "dkSeaGreen": + *e = 54 + case "dkSlateBlue": + *e = 55 + case "dkSlateGray": + *e = 56 + case "dkSlateGrey": + *e = 57 + case "dkTurquoise": + *e = 58 + case "dkViolet": + *e = 59 + case "deepPink": + *e = 60 + case "deepSkyBlue": + *e = 61 + case "dimGray": + *e = 62 + case "dimGrey": + *e = 63 + case "dodgerBlue": + *e = 64 + case "firebrick": + *e = 65 + case "floralWhite": + *e = 66 + case "forestGreen": + *e = 67 + case "fuchsia": + *e = 68 + case "gainsboro": + *e = 69 + case "ghostWhite": + *e = 70 + case "gold": + *e = 71 + case "goldenrod": + *e = 72 + case "gray": + *e = 73 + case "grey": + *e = 74 + case "green": + *e = 75 + case "greenYellow": + *e = 76 + case "honeydew": + *e = 77 + case "hotPink": + *e = 78 + case "indianRed": + *e = 79 + case "indigo": + *e = 80 + case "ivory": + *e = 81 + case "khaki": + *e = 82 + case "lavender": + *e = 83 + case "lavenderBlush": + *e = 84 + case "lawnGreen": + *e = 85 + case "lemonChiffon": + *e = 86 + case "lightBlue": + *e = 87 + case "lightCoral": + *e = 88 + case "lightCyan": + *e = 89 + case "lightGoldenrodYellow": + *e = 90 + case "lightGray": + *e = 91 + case "lightGrey": + *e = 92 + case "lightGreen": + *e = 93 + case "lightPink": + *e = 94 + case "lightSalmon": + *e = 95 + case "lightSeaGreen": + *e = 96 + case "lightSkyBlue": + *e = 97 + case "lightSlateGray": + *e = 98 + case "lightSlateGrey": + *e = 99 + case "lightSteelBlue": + *e = 100 + case "lightYellow": + *e = 101 + case "ltBlue": + *e = 102 + case "ltCoral": + *e = 103 + case "ltCyan": + *e = 104 + case "ltGoldenrodYellow": + *e = 105 + case "ltGray": + *e = 106 + case "ltGrey": + *e = 107 + case "ltGreen": + *e = 108 + case "ltPink": + *e = 109 + case "ltSalmon": + *e = 110 + case "ltSeaGreen": + *e = 111 + case "ltSkyBlue": + *e = 112 + case "ltSlateGray": + *e = 113 + case "ltSlateGrey": + *e = 114 + case "ltSteelBlue": + *e = 115 + case "ltYellow": + *e = 116 + case "lime": + *e = 117 + case "limeGreen": + *e = 118 + case "linen": + *e = 119 + case "magenta": + *e = 120 + case "maroon": + *e = 121 + case "medAquamarine": + *e = 122 + case "medBlue": + *e = 123 + case "medOrchid": + *e = 124 + case "medPurple": + *e = 125 + case "medSeaGreen": + *e = 126 + case "medSlateBlue": + *e = 127 + case "medSpringGreen": + *e = 128 + case "medTurquoise": + *e = 129 + case "medVioletRed": + *e = 130 + case "mediumAquamarine": + *e = 131 + case "mediumBlue": + *e = 132 + case "mediumOrchid": + *e = 133 + case "mediumPurple": + *e = 134 + case "mediumSeaGreen": + *e = 135 + case "mediumSlateBlue": + *e = 136 + case "mediumSpringGreen": + *e = 137 + case "mediumTurquoise": + *e = 138 + case "mediumVioletRed": + *e = 139 + case "midnightBlue": + *e = 140 + case "mintCream": + *e = 141 + case "mistyRose": + *e = 142 + case "moccasin": + *e = 143 + case "navajoWhite": + *e = 144 + case "navy": + *e = 145 + case "oldLace": + *e = 146 + case "olive": + *e = 147 + case "oliveDrab": + *e = 148 + case "orange": + *e = 149 + case "orangeRed": + *e = 150 + case "orchid": + *e = 151 + case "paleGoldenrod": + *e = 152 + case "paleGreen": + *e = 153 + case "paleTurquoise": + *e = 154 + case "paleVioletRed": + *e = 155 + case "papayaWhip": + *e = 156 + case "peachPuff": + *e = 157 + case "peru": + *e = 158 + case "pink": + *e = 159 + case "plum": + *e = 160 + case "powderBlue": + *e = 161 + case "purple": + *e = 162 + case "red": + *e = 163 + case "rosyBrown": + *e = 164 + case "royalBlue": + *e = 165 + case "saddleBrown": + *e = 166 + case "salmon": + *e = 167 + case "sandyBrown": + *e = 168 + case "seaGreen": + *e = 169 + case "seaShell": + *e = 170 + case "sienna": + *e = 171 + case "silver": + *e = 172 + case "skyBlue": + *e = 173 + case "slateBlue": + *e = 174 + case "slateGray": + *e = 175 + case "slateGrey": + *e = 176 + case "snow": + *e = 177 + case "springGreen": + *e = 178 + case "steelBlue": + *e = 179 + case "tan": + *e = 180 + case "teal": + *e = 181 + case "thistle": + *e = 182 + case "tomato": + *e = 183 + case "turquoise": + *e = 184 + case "violet": + *e = 185 + case "wheat": + *e = 186 + case "white": + *e = 187 + case "whiteSmoke": + *e = 188 + case "yellow": + *e = 189 + case "yellowGreen": + *e = 190 + } + return nil +} + +func (m ST_PresetColorVal) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_PresetColorVal) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "aliceBlue": + *m = 1 + case "antiqueWhite": + *m = 2 + case "aqua": + *m = 3 + case "aquamarine": + *m = 4 + case "azure": + *m = 5 + case "beige": + *m = 6 + case "bisque": + *m = 7 + case "black": + *m = 8 + case "blanchedAlmond": + *m = 9 + case "blue": + *m = 10 + case "blueViolet": + *m = 11 + case "brown": + *m = 12 + case "burlyWood": + *m = 13 + case "cadetBlue": + *m = 14 + case "chartreuse": + *m = 15 + case "chocolate": + *m = 16 + case "coral": + *m = 17 + case "cornflowerBlue": + *m = 18 + case "cornsilk": + *m = 19 + case "crimson": + *m = 20 + case "cyan": + *m = 21 + case "darkBlue": + *m = 22 + case "darkCyan": + *m = 23 + case "darkGoldenrod": + *m = 24 + case "darkGray": + *m = 25 + case "darkGrey": + *m = 26 + case "darkGreen": + *m = 27 + case "darkKhaki": + *m = 28 + case "darkMagenta": + *m = 29 + case "darkOliveGreen": + *m = 30 + case "darkOrange": + *m = 31 + case "darkOrchid": + *m = 32 + case "darkRed": + *m = 33 + case "darkSalmon": + *m = 34 + case "darkSeaGreen": + *m = 35 + case "darkSlateBlue": + *m = 36 + case "darkSlateGray": + *m = 37 + case "darkSlateGrey": + *m = 38 + case "darkTurquoise": + *m = 39 + case "darkViolet": + *m = 40 + case "dkBlue": + *m = 41 + case "dkCyan": + *m = 42 + case "dkGoldenrod": + *m = 43 + case "dkGray": + *m = 44 + case "dkGrey": + *m = 45 + case "dkGreen": + *m = 46 + case "dkKhaki": + *m = 47 + case "dkMagenta": + *m = 48 + case "dkOliveGreen": + *m = 49 + case "dkOrange": + *m = 50 + case "dkOrchid": + *m = 51 + case "dkRed": + *m = 52 + case "dkSalmon": + *m = 53 + case "dkSeaGreen": + *m = 54 + case "dkSlateBlue": + *m = 55 + case "dkSlateGray": + *m = 56 + case "dkSlateGrey": + *m = 57 + case "dkTurquoise": + *m = 58 + case "dkViolet": + *m = 59 + case "deepPink": + *m = 60 + case "deepSkyBlue": + *m = 61 + case "dimGray": + *m = 62 + case "dimGrey": + *m = 63 + case "dodgerBlue": + *m = 64 + case "firebrick": + *m = 65 + case "floralWhite": + *m = 66 + case "forestGreen": + *m = 67 + case "fuchsia": + *m = 68 + case "gainsboro": + *m = 69 + case "ghostWhite": + *m = 70 + case "gold": + *m = 71 + case "goldenrod": + *m = 72 + case "gray": + *m = 73 + case "grey": + *m = 74 + case "green": + *m = 75 + case "greenYellow": + *m = 76 + case "honeydew": + *m = 77 + case "hotPink": + *m = 78 + case "indianRed": + *m = 79 + case "indigo": + *m = 80 + case "ivory": + *m = 81 + case "khaki": + *m = 82 + case "lavender": + *m = 83 + case "lavenderBlush": + *m = 84 + case "lawnGreen": + *m = 85 + case "lemonChiffon": + *m = 86 + case "lightBlue": + *m = 87 + case "lightCoral": + *m = 88 + case "lightCyan": + *m = 89 + case "lightGoldenrodYellow": + *m = 90 + case "lightGray": + *m = 91 + case "lightGrey": + *m = 92 + case "lightGreen": + *m = 93 + case "lightPink": + *m = 94 + case "lightSalmon": + *m = 95 + case "lightSeaGreen": + *m = 96 + case "lightSkyBlue": + *m = 97 + case "lightSlateGray": + *m = 98 + case "lightSlateGrey": + *m = 99 + case "lightSteelBlue": + *m = 100 + case "lightYellow": + *m = 101 + case "ltBlue": + *m = 102 + case "ltCoral": + *m = 103 + case "ltCyan": + *m = 104 + case "ltGoldenrodYellow": + *m = 105 + case "ltGray": + *m = 106 + case "ltGrey": + *m = 107 + case "ltGreen": + *m = 108 + case "ltPink": + *m = 109 + case "ltSalmon": + *m = 110 + case "ltSeaGreen": + *m = 111 + case "ltSkyBlue": + *m = 112 + case "ltSlateGray": + *m = 113 + case "ltSlateGrey": + *m = 114 + case "ltSteelBlue": + *m = 115 + case "ltYellow": + *m = 116 + case "lime": + *m = 117 + case "limeGreen": + *m = 118 + case "linen": + *m = 119 + case "magenta": + *m = 120 + case "maroon": + *m = 121 + case "medAquamarine": + *m = 122 + case "medBlue": + *m = 123 + case "medOrchid": + *m = 124 + case "medPurple": + *m = 125 + case "medSeaGreen": + *m = 126 + case "medSlateBlue": + *m = 127 + case "medSpringGreen": + *m = 128 + case "medTurquoise": + *m = 129 + case "medVioletRed": + *m = 130 + case "mediumAquamarine": + *m = 131 + case "mediumBlue": + *m = 132 + case "mediumOrchid": + *m = 133 + case "mediumPurple": + *m = 134 + case "mediumSeaGreen": + *m = 135 + case "mediumSlateBlue": + *m = 136 + case "mediumSpringGreen": + *m = 137 + case "mediumTurquoise": + *m = 138 + case "mediumVioletRed": + *m = 139 + case "midnightBlue": + *m = 140 + case "mintCream": + *m = 141 + case "mistyRose": + *m = 142 + case "moccasin": + *m = 143 + case "navajoWhite": + *m = 144 + case "navy": + *m = 145 + case "oldLace": + *m = 146 + case "olive": + *m = 147 + case "oliveDrab": + *m = 148 + case "orange": + *m = 149 + case "orangeRed": + *m = 150 + case "orchid": + *m = 151 + case "paleGoldenrod": + *m = 152 + case "paleGreen": + *m = 153 + case "paleTurquoise": + *m = 154 + case "paleVioletRed": + *m = 155 + case "papayaWhip": + *m = 156 + case "peachPuff": + *m = 157 + case "peru": + *m = 158 + case "pink": + *m = 159 + case "plum": + *m = 160 + case "powderBlue": + *m = 161 + case "purple": + *m = 162 + case "red": + *m = 163 + case "rosyBrown": + *m = 164 + case "royalBlue": + *m = 165 + case "saddleBrown": + *m = 166 + case "salmon": + *m = 167 + case "sandyBrown": + *m = 168 + case "seaGreen": + *m = 169 + case "seaShell": + *m = 170 + case "sienna": + *m = 171 + case "silver": + *m = 172 + case "skyBlue": + *m = 173 + case "slateBlue": + *m = 174 + case "slateGray": + *m = 175 + case "slateGrey": + *m = 176 + case "snow": + *m = 177 + case "springGreen": + *m = 178 + case "steelBlue": + *m = 179 + case "tan": + *m = 180 + case "teal": + *m = 181 + case "thistle": + *m = 182 + case "tomato": + *m = 183 + case "turquoise": + *m = 184 + case "violet": + *m = 185 + case "wheat": + *m = 186 + case "white": + *m = 187 + case "whiteSmoke": + *m = 188 + case "yellow": + *m = 189 + case "yellowGreen": + *m = 190 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_PresetColorVal) String() string { + switch m { + case 0: + return "" + case 1: + return "aliceBlue" + case 2: + return "antiqueWhite" + case 3: + return "aqua" + case 4: + return "aquamarine" + case 5: + return "azure" + case 6: + return "beige" + case 7: + return "bisque" + case 8: + return "black" + case 9: + return "blanchedAlmond" + case 10: + return "blue" + case 11: + return "blueViolet" + case 12: + return "brown" + case 13: + return "burlyWood" + case 14: + return "cadetBlue" + case 15: + return "chartreuse" + case 16: + return "chocolate" + case 17: + return "coral" + case 18: + return "cornflowerBlue" + case 19: + return "cornsilk" + case 20: + return "crimson" + case 21: + return "cyan" + case 22: + return "darkBlue" + case 23: + return "darkCyan" + case 24: + return "darkGoldenrod" + case 25: + return "darkGray" + case 26: + return "darkGrey" + case 27: + return "darkGreen" + case 28: + return "darkKhaki" + case 29: + return "darkMagenta" + case 30: + return "darkOliveGreen" + case 31: + return "darkOrange" + case 32: + return "darkOrchid" + case 33: + return "darkRed" + case 34: + return "darkSalmon" + case 35: + return "darkSeaGreen" + case 36: + return "darkSlateBlue" + case 37: + return "darkSlateGray" + case 38: + return "darkSlateGrey" + case 39: + return "darkTurquoise" + case 40: + return "darkViolet" + case 41: + return "dkBlue" + case 42: + return "dkCyan" + case 43: + return "dkGoldenrod" + case 44: + return "dkGray" + case 45: + return "dkGrey" + case 46: + return "dkGreen" + case 47: + return "dkKhaki" + case 48: + return "dkMagenta" + case 49: + return "dkOliveGreen" + case 50: + return "dkOrange" + case 51: + return "dkOrchid" + case 52: + return "dkRed" + case 53: + return "dkSalmon" + case 54: + return "dkSeaGreen" + case 55: + return "dkSlateBlue" + case 56: + return "dkSlateGray" + case 57: + return "dkSlateGrey" + case 58: + return "dkTurquoise" + case 59: + return "dkViolet" + case 60: + return "deepPink" + case 61: + return "deepSkyBlue" + case 62: + return "dimGray" + case 63: + return "dimGrey" + case 64: + return "dodgerBlue" + case 65: + return "firebrick" + case 66: + return "floralWhite" + case 67: + return "forestGreen" + case 68: + return "fuchsia" + case 69: + return "gainsboro" + case 70: + return "ghostWhite" + case 71: + return "gold" + case 72: + return "goldenrod" + case 73: + return "gray" + case 74: + return "grey" + case 75: + return "green" + case 76: + return "greenYellow" + case 77: + return "honeydew" + case 78: + return "hotPink" + case 79: + return "indianRed" + case 80: + return "indigo" + case 81: + return "ivory" + case 82: + return "khaki" + case 83: + return "lavender" + case 84: + return "lavenderBlush" + case 85: + return "lawnGreen" + case 86: + return "lemonChiffon" + case 87: + return "lightBlue" + case 88: + return "lightCoral" + case 89: + return "lightCyan" + case 90: + return "lightGoldenrodYellow" + case 91: + return "lightGray" + case 92: + return "lightGrey" + case 93: + return "lightGreen" + case 94: + return "lightPink" + case 95: + return "lightSalmon" + case 96: + return "lightSeaGreen" + case 97: + return "lightSkyBlue" + case 98: + return "lightSlateGray" + case 99: + return "lightSlateGrey" + case 100: + return "lightSteelBlue" + case 101: + return "lightYellow" + case 102: + return "ltBlue" + case 103: + return "ltCoral" + case 104: + return "ltCyan" + case 105: + return "ltGoldenrodYellow" + case 106: + return "ltGray" + case 107: + return "ltGrey" + case 108: + return "ltGreen" + case 109: + return "ltPink" + case 110: + return "ltSalmon" + case 111: + return "ltSeaGreen" + case 112: + return "ltSkyBlue" + case 113: + return "ltSlateGray" + case 114: + return "ltSlateGrey" + case 115: + return "ltSteelBlue" + case 116: + return "ltYellow" + case 117: + return "lime" + case 118: + return "limeGreen" + case 119: + return "linen" + case 120: + return "magenta" + case 121: + return "maroon" + case 122: + return "medAquamarine" + case 123: + return "medBlue" + case 124: + return "medOrchid" + case 125: + return "medPurple" + case 126: + return "medSeaGreen" + case 127: + return "medSlateBlue" + case 128: + return "medSpringGreen" + case 129: + return "medTurquoise" + case 130: + return "medVioletRed" + case 131: + return "mediumAquamarine" + case 132: + return "mediumBlue" + case 133: + return "mediumOrchid" + case 134: + return "mediumPurple" + case 135: + return "mediumSeaGreen" + case 136: + return "mediumSlateBlue" + case 137: + return "mediumSpringGreen" + case 138: + return "mediumTurquoise" + case 139: + return "mediumVioletRed" + case 140: + return "midnightBlue" + case 141: + return "mintCream" + case 142: + return "mistyRose" + case 143: + return "moccasin" + case 144: + return "navajoWhite" + case 145: + return "navy" + case 146: + return "oldLace" + case 147: + return "olive" + case 148: + return "oliveDrab" + case 149: + return "orange" + case 150: + return "orangeRed" + case 151: + return "orchid" + case 152: + return "paleGoldenrod" + case 153: + return "paleGreen" + case 154: + return "paleTurquoise" + case 155: + return "paleVioletRed" + case 156: + return "papayaWhip" + case 157: + return "peachPuff" + case 158: + return "peru" + case 159: + return "pink" + case 160: + return "plum" + case 161: + return "powderBlue" + case 162: + return "purple" + case 163: + return "red" + case 164: + return "rosyBrown" + case 165: + return "royalBlue" + case 166: + return "saddleBrown" + case 167: + return "salmon" + case 168: + return "sandyBrown" + case 169: + return "seaGreen" + case 170: + return "seaShell" + case 171: + return "sienna" + case 172: + return "silver" + case 173: + return "skyBlue" + case 174: + return "slateBlue" + case 175: + return "slateGray" + case 176: + return "slateGrey" + case 177: + return "snow" + case 178: + return "springGreen" + case 179: + return "steelBlue" + case 180: + return "tan" + case 181: + return "teal" + case 182: + return "thistle" + case 183: + return "tomato" + case 184: + return "turquoise" + case 185: + return "violet" + case 186: + return "wheat" + case 187: + return "white" + case 188: + return "whiteSmoke" + case 189: + return "yellow" + case 190: + return "yellowGreen" + } + return "" +} + +func (m ST_PresetColorVal) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_PresetColorVal) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_RectAlignment byte + +const ( + ST_RectAlignmentUnset ST_RectAlignment = 0 + ST_RectAlignmentTl ST_RectAlignment = 1 + ST_RectAlignmentT ST_RectAlignment = 2 + ST_RectAlignmentTr ST_RectAlignment = 3 + ST_RectAlignmentL ST_RectAlignment = 4 + ST_RectAlignmentCtr ST_RectAlignment = 5 + ST_RectAlignmentR ST_RectAlignment = 6 + ST_RectAlignmentBl ST_RectAlignment = 7 + ST_RectAlignmentB ST_RectAlignment = 8 + ST_RectAlignmentBr ST_RectAlignment = 9 +) + +func (e ST_RectAlignment) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_RectAlignmentUnset: + attr.Value = "" + case ST_RectAlignmentTl: + attr.Value = "tl" + case ST_RectAlignmentT: + attr.Value = "t" + case ST_RectAlignmentTr: + attr.Value = "tr" + case ST_RectAlignmentL: + attr.Value = "l" + case ST_RectAlignmentCtr: + attr.Value = "ctr" + case ST_RectAlignmentR: + attr.Value = "r" + case ST_RectAlignmentBl: + attr.Value = "bl" + case ST_RectAlignmentB: + attr.Value = "b" + case ST_RectAlignmentBr: + attr.Value = "br" + } + return attr, nil +} + +func (e *ST_RectAlignment) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "tl": + *e = 1 + case "t": + *e = 2 + case "tr": + *e = 3 + case "l": + *e = 4 + case "ctr": + *e = 5 + case "r": + *e = 6 + case "bl": + *e = 7 + case "b": + *e = 8 + case "br": + *e = 9 + } + return nil +} + +func (m ST_RectAlignment) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_RectAlignment) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "tl": + *m = 1 + case "t": + *m = 2 + case "tr": + *m = 3 + case "l": + *m = 4 + case "ctr": + *m = 5 + case "r": + *m = 6 + case "bl": + *m = 7 + case "b": + *m = 8 + case "br": + *m = 9 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_RectAlignment) String() string { + switch m { + case 0: + return "" + case 1: + return "tl" + case 2: + return "t" + case 3: + return "tr" + case 4: + return "l" + case 5: + return "ctr" + case 6: + return "r" + case 7: + return "bl" + case 8: + return "b" + case 9: + return "br" + } + return "" +} + +func (m ST_RectAlignment) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_RectAlignment) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_BlackWhiteMode byte + +const ( + ST_BlackWhiteModeUnset ST_BlackWhiteMode = 0 + ST_BlackWhiteModeClr ST_BlackWhiteMode = 1 + ST_BlackWhiteModeAuto ST_BlackWhiteMode = 2 + ST_BlackWhiteModeGray ST_BlackWhiteMode = 3 + ST_BlackWhiteModeLtGray ST_BlackWhiteMode = 4 + ST_BlackWhiteModeInvGray ST_BlackWhiteMode = 5 + ST_BlackWhiteModeGrayWhite ST_BlackWhiteMode = 6 + ST_BlackWhiteModeBlackGray ST_BlackWhiteMode = 7 + ST_BlackWhiteModeBlackWhite ST_BlackWhiteMode = 8 + ST_BlackWhiteModeBlack ST_BlackWhiteMode = 9 + ST_BlackWhiteModeWhite ST_BlackWhiteMode = 10 + ST_BlackWhiteModeHidden ST_BlackWhiteMode = 11 +) + +func (e ST_BlackWhiteMode) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_BlackWhiteModeUnset: + attr.Value = "" + case ST_BlackWhiteModeClr: + attr.Value = "clr" + case ST_BlackWhiteModeAuto: + attr.Value = "auto" + case ST_BlackWhiteModeGray: + attr.Value = "gray" + case ST_BlackWhiteModeLtGray: + attr.Value = "ltGray" + case ST_BlackWhiteModeInvGray: + attr.Value = "invGray" + case ST_BlackWhiteModeGrayWhite: + attr.Value = "grayWhite" + case ST_BlackWhiteModeBlackGray: + attr.Value = "blackGray" + case ST_BlackWhiteModeBlackWhite: + attr.Value = "blackWhite" + case ST_BlackWhiteModeBlack: + attr.Value = "black" + case ST_BlackWhiteModeWhite: + attr.Value = "white" + case ST_BlackWhiteModeHidden: + attr.Value = "hidden" + } + return attr, nil +} + +func (e *ST_BlackWhiteMode) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "clr": + *e = 1 + case "auto": + *e = 2 + case "gray": + *e = 3 + case "ltGray": + *e = 4 + case "invGray": + *e = 5 + case "grayWhite": + *e = 6 + case "blackGray": + *e = 7 + case "blackWhite": + *e = 8 + case "black": + *e = 9 + case "white": + *e = 10 + case "hidden": + *e = 11 + } + return nil +} + +func (m ST_BlackWhiteMode) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_BlackWhiteMode) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "clr": + *m = 1 + case "auto": + *m = 2 + case "gray": + *m = 3 + case "ltGray": + *m = 4 + case "invGray": + *m = 5 + case "grayWhite": + *m = 6 + case "blackGray": + *m = 7 + case "blackWhite": + *m = 8 + case "black": + *m = 9 + case "white": + *m = 10 + case "hidden": + *m = 11 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_BlackWhiteMode) String() string { + switch m { + case 0: + return "" + case 1: + return "clr" + case 2: + return "auto" + case 3: + return "gray" + case 4: + return "ltGray" + case 5: + return "invGray" + case 6: + return "grayWhite" + case 7: + return "blackGray" + case 8: + return "blackWhite" + case 9: + return "black" + case 10: + return "white" + case 11: + return "hidden" + } + return "" +} + +func (m ST_BlackWhiteMode) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_BlackWhiteMode) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_ChartBuildStep byte + +const ( + ST_ChartBuildStepUnset ST_ChartBuildStep = 0 + ST_ChartBuildStepCategory ST_ChartBuildStep = 1 + ST_ChartBuildStepPtInCategory ST_ChartBuildStep = 2 + ST_ChartBuildStepSeries ST_ChartBuildStep = 3 + ST_ChartBuildStepPtInSeries ST_ChartBuildStep = 4 + ST_ChartBuildStepAllPts ST_ChartBuildStep = 5 + ST_ChartBuildStepGridLegend ST_ChartBuildStep = 6 +) + +func (e ST_ChartBuildStep) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_ChartBuildStepUnset: + attr.Value = "" + case ST_ChartBuildStepCategory: + attr.Value = "category" + case ST_ChartBuildStepPtInCategory: + attr.Value = "ptInCategory" + case ST_ChartBuildStepSeries: + attr.Value = "series" + case ST_ChartBuildStepPtInSeries: + attr.Value = "ptInSeries" + case ST_ChartBuildStepAllPts: + attr.Value = "allPts" + case ST_ChartBuildStepGridLegend: + attr.Value = "gridLegend" + } + return attr, nil +} + +func (e *ST_ChartBuildStep) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "category": + *e = 1 + case "ptInCategory": + *e = 2 + case "series": + *e = 3 + case "ptInSeries": + *e = 4 + case "allPts": + *e = 5 + case "gridLegend": + *e = 6 + } + return nil +} + +func (m ST_ChartBuildStep) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_ChartBuildStep) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "category": + *m = 1 + case "ptInCategory": + *m = 2 + case "series": + *m = 3 + case "ptInSeries": + *m = 4 + case "allPts": + *m = 5 + case "gridLegend": + *m = 6 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_ChartBuildStep) String() string { + switch m { + case 0: + return "" + case 1: + return "category" + case 2: + return "ptInCategory" + case 3: + return "series" + case 4: + return "ptInSeries" + case 5: + return "allPts" + case 6: + return "gridLegend" + } + return "" +} + +func (m ST_ChartBuildStep) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_ChartBuildStep) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_DgmBuildStep byte + +const ( + ST_DgmBuildStepUnset ST_DgmBuildStep = 0 + ST_DgmBuildStepSp ST_DgmBuildStep = 1 + ST_DgmBuildStepBg ST_DgmBuildStep = 2 +) + +func (e ST_DgmBuildStep) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_DgmBuildStepUnset: + attr.Value = "" + case ST_DgmBuildStepSp: + attr.Value = "sp" + case ST_DgmBuildStepBg: + attr.Value = "bg" + } + return attr, nil +} + +func (e *ST_DgmBuildStep) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "sp": + *e = 1 + case "bg": + *e = 2 + } + return nil +} + +func (m ST_DgmBuildStep) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_DgmBuildStep) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "sp": + *m = 1 + case "bg": + *m = 2 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_DgmBuildStep) String() string { + switch m { + case 0: + return "" + case 1: + return "sp" + case 2: + return "bg" + } + return "" +} + +func (m ST_DgmBuildStep) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_DgmBuildStep) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_AnimationBuildType byte + +const ( + ST_AnimationBuildTypeUnset ST_AnimationBuildType = 0 + ST_AnimationBuildTypeAllAtOnce ST_AnimationBuildType = 1 +) + +func (e ST_AnimationBuildType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_AnimationBuildTypeUnset: + attr.Value = "" + case ST_AnimationBuildTypeAllAtOnce: + attr.Value = "allAtOnce" + } + return attr, nil +} + +func (e *ST_AnimationBuildType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "allAtOnce": + *e = 1 + } + return nil +} + +func (m ST_AnimationBuildType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_AnimationBuildType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "allAtOnce": + *m = 1 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_AnimationBuildType) String() string { + switch m { + case 0: + return "" + case 1: + return "allAtOnce" + } + return "" +} + +func (m ST_AnimationBuildType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_AnimationBuildType) ValidateWithPath(path string) error { + switch m { + case 0, 1: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_AnimationDgmOnlyBuildType byte + +const ( + ST_AnimationDgmOnlyBuildTypeUnset ST_AnimationDgmOnlyBuildType = 0 + ST_AnimationDgmOnlyBuildTypeOne ST_AnimationDgmOnlyBuildType = 1 + ST_AnimationDgmOnlyBuildTypeLvlOne ST_AnimationDgmOnlyBuildType = 2 + ST_AnimationDgmOnlyBuildTypeLvlAtOnce ST_AnimationDgmOnlyBuildType = 3 +) + +func (e ST_AnimationDgmOnlyBuildType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_AnimationDgmOnlyBuildTypeUnset: + attr.Value = "" + case ST_AnimationDgmOnlyBuildTypeOne: + attr.Value = "one" + case ST_AnimationDgmOnlyBuildTypeLvlOne: + attr.Value = "lvlOne" + case ST_AnimationDgmOnlyBuildTypeLvlAtOnce: + attr.Value = "lvlAtOnce" + } + return attr, nil +} + +func (e *ST_AnimationDgmOnlyBuildType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "one": + *e = 1 + case "lvlOne": + *e = 2 + case "lvlAtOnce": + *e = 3 + } + return nil +} + +func (m ST_AnimationDgmOnlyBuildType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_AnimationDgmOnlyBuildType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "one": + *m = 1 + case "lvlOne": + *m = 2 + case "lvlAtOnce": + *m = 3 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_AnimationDgmOnlyBuildType) String() string { + switch m { + case 0: + return "" + case 1: + return "one" + case 2: + return "lvlOne" + case 3: + return "lvlAtOnce" + } + return "" +} + +func (m ST_AnimationDgmOnlyBuildType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_AnimationDgmOnlyBuildType) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_AnimationChartOnlyBuildType byte + +const ( + ST_AnimationChartOnlyBuildTypeUnset ST_AnimationChartOnlyBuildType = 0 + ST_AnimationChartOnlyBuildTypeSeries ST_AnimationChartOnlyBuildType = 1 + ST_AnimationChartOnlyBuildTypeCategory ST_AnimationChartOnlyBuildType = 2 + ST_AnimationChartOnlyBuildTypeSeriesEl ST_AnimationChartOnlyBuildType = 3 + ST_AnimationChartOnlyBuildTypeCategoryEl ST_AnimationChartOnlyBuildType = 4 +) + +func (e ST_AnimationChartOnlyBuildType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_AnimationChartOnlyBuildTypeUnset: + attr.Value = "" + case ST_AnimationChartOnlyBuildTypeSeries: + attr.Value = "series" + case ST_AnimationChartOnlyBuildTypeCategory: + attr.Value = "category" + case ST_AnimationChartOnlyBuildTypeSeriesEl: + attr.Value = "seriesEl" + case ST_AnimationChartOnlyBuildTypeCategoryEl: + attr.Value = "categoryEl" + } + return attr, nil +} + +func (e *ST_AnimationChartOnlyBuildType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "series": + *e = 1 + case "category": + *e = 2 + case "seriesEl": + *e = 3 + case "categoryEl": + *e = 4 + } + return nil +} + +func (m ST_AnimationChartOnlyBuildType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_AnimationChartOnlyBuildType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "series": + *m = 1 + case "category": + *m = 2 + case "seriesEl": + *m = 3 + case "categoryEl": + *m = 4 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_AnimationChartOnlyBuildType) String() string { + switch m { + case 0: + return "" + case 1: + return "series" + case 2: + return "category" + case 3: + return "seriesEl" + case 4: + return "categoryEl" + } + return "" +} + +func (m ST_AnimationChartOnlyBuildType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_AnimationChartOnlyBuildType) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_PresetCameraType byte + +const ( + ST_PresetCameraTypeUnset ST_PresetCameraType = 0 + ST_PresetCameraTypeLegacyObliqueTopLeft ST_PresetCameraType = 1 + ST_PresetCameraTypeLegacyObliqueTop ST_PresetCameraType = 2 + ST_PresetCameraTypeLegacyObliqueTopRight ST_PresetCameraType = 3 + ST_PresetCameraTypeLegacyObliqueLeft ST_PresetCameraType = 4 + ST_PresetCameraTypeLegacyObliqueFront ST_PresetCameraType = 5 + ST_PresetCameraTypeLegacyObliqueRight ST_PresetCameraType = 6 + ST_PresetCameraTypeLegacyObliqueBottomLeft ST_PresetCameraType = 7 + ST_PresetCameraTypeLegacyObliqueBottom ST_PresetCameraType = 8 + ST_PresetCameraTypeLegacyObliqueBottomRight ST_PresetCameraType = 9 + ST_PresetCameraTypeLegacyPerspectiveTopLeft ST_PresetCameraType = 10 + ST_PresetCameraTypeLegacyPerspectiveTop ST_PresetCameraType = 11 + ST_PresetCameraTypeLegacyPerspectiveTopRight ST_PresetCameraType = 12 + ST_PresetCameraTypeLegacyPerspectiveLeft ST_PresetCameraType = 13 + ST_PresetCameraTypeLegacyPerspectiveFront ST_PresetCameraType = 14 + ST_PresetCameraTypeLegacyPerspectiveRight ST_PresetCameraType = 15 + ST_PresetCameraTypeLegacyPerspectiveBottomLeft ST_PresetCameraType = 16 + ST_PresetCameraTypeLegacyPerspectiveBottom ST_PresetCameraType = 17 + ST_PresetCameraTypeLegacyPerspectiveBottomRight ST_PresetCameraType = 18 + ST_PresetCameraTypeOrthographicFront ST_PresetCameraType = 19 + ST_PresetCameraTypeIsometricTopUp ST_PresetCameraType = 20 + ST_PresetCameraTypeIsometricTopDown ST_PresetCameraType = 21 + ST_PresetCameraTypeIsometricBottomUp ST_PresetCameraType = 22 + ST_PresetCameraTypeIsometricBottomDown ST_PresetCameraType = 23 + ST_PresetCameraTypeIsometricLeftUp ST_PresetCameraType = 24 + ST_PresetCameraTypeIsometricLeftDown ST_PresetCameraType = 25 + ST_PresetCameraTypeIsometricRightUp ST_PresetCameraType = 26 + ST_PresetCameraTypeIsometricRightDown ST_PresetCameraType = 27 + ST_PresetCameraTypeIsometricOffAxis1Left ST_PresetCameraType = 28 + ST_PresetCameraTypeIsometricOffAxis1Right ST_PresetCameraType = 29 + ST_PresetCameraTypeIsometricOffAxis1Top ST_PresetCameraType = 30 + ST_PresetCameraTypeIsometricOffAxis2Left ST_PresetCameraType = 31 + ST_PresetCameraTypeIsometricOffAxis2Right ST_PresetCameraType = 32 + ST_PresetCameraTypeIsometricOffAxis2Top ST_PresetCameraType = 33 + ST_PresetCameraTypeIsometricOffAxis3Left ST_PresetCameraType = 34 + ST_PresetCameraTypeIsometricOffAxis3Right ST_PresetCameraType = 35 + ST_PresetCameraTypeIsometricOffAxis3Bottom ST_PresetCameraType = 36 + ST_PresetCameraTypeIsometricOffAxis4Left ST_PresetCameraType = 37 + ST_PresetCameraTypeIsometricOffAxis4Right ST_PresetCameraType = 38 + ST_PresetCameraTypeIsometricOffAxis4Bottom ST_PresetCameraType = 39 + ST_PresetCameraTypeObliqueTopLeft ST_PresetCameraType = 40 + ST_PresetCameraTypeObliqueTop ST_PresetCameraType = 41 + ST_PresetCameraTypeObliqueTopRight ST_PresetCameraType = 42 + ST_PresetCameraTypeObliqueLeft ST_PresetCameraType = 43 + ST_PresetCameraTypeObliqueRight ST_PresetCameraType = 44 + ST_PresetCameraTypeObliqueBottomLeft ST_PresetCameraType = 45 + ST_PresetCameraTypeObliqueBottom ST_PresetCameraType = 46 + ST_PresetCameraTypeObliqueBottomRight ST_PresetCameraType = 47 + ST_PresetCameraTypePerspectiveFront ST_PresetCameraType = 48 + ST_PresetCameraTypePerspectiveLeft ST_PresetCameraType = 49 + ST_PresetCameraTypePerspectiveRight ST_PresetCameraType = 50 + ST_PresetCameraTypePerspectiveAbove ST_PresetCameraType = 51 + ST_PresetCameraTypePerspectiveBelow ST_PresetCameraType = 52 + ST_PresetCameraTypePerspectiveAboveLeftFacing ST_PresetCameraType = 53 + ST_PresetCameraTypePerspectiveAboveRightFacing ST_PresetCameraType = 54 + ST_PresetCameraTypePerspectiveContrastingLeftFacing ST_PresetCameraType = 55 + ST_PresetCameraTypePerspectiveContrastingRightFacing ST_PresetCameraType = 56 + ST_PresetCameraTypePerspectiveHeroicLeftFacing ST_PresetCameraType = 57 + ST_PresetCameraTypePerspectiveHeroicRightFacing ST_PresetCameraType = 58 + ST_PresetCameraTypePerspectiveHeroicExtremeLeftFacing ST_PresetCameraType = 59 + ST_PresetCameraTypePerspectiveHeroicExtremeRightFacing ST_PresetCameraType = 60 + ST_PresetCameraTypePerspectiveRelaxed ST_PresetCameraType = 61 + ST_PresetCameraTypePerspectiveRelaxedModerately ST_PresetCameraType = 62 +) + +func (e ST_PresetCameraType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_PresetCameraTypeUnset: + attr.Value = "" + case ST_PresetCameraTypeLegacyObliqueTopLeft: + attr.Value = "legacyObliqueTopLeft" + case ST_PresetCameraTypeLegacyObliqueTop: + attr.Value = "legacyObliqueTop" + case ST_PresetCameraTypeLegacyObliqueTopRight: + attr.Value = "legacyObliqueTopRight" + case ST_PresetCameraTypeLegacyObliqueLeft: + attr.Value = "legacyObliqueLeft" + case ST_PresetCameraTypeLegacyObliqueFront: + attr.Value = "legacyObliqueFront" + case ST_PresetCameraTypeLegacyObliqueRight: + attr.Value = "legacyObliqueRight" + case ST_PresetCameraTypeLegacyObliqueBottomLeft: + attr.Value = "legacyObliqueBottomLeft" + case ST_PresetCameraTypeLegacyObliqueBottom: + attr.Value = "legacyObliqueBottom" + case ST_PresetCameraTypeLegacyObliqueBottomRight: + attr.Value = "legacyObliqueBottomRight" + case ST_PresetCameraTypeLegacyPerspectiveTopLeft: + attr.Value = "legacyPerspectiveTopLeft" + case ST_PresetCameraTypeLegacyPerspectiveTop: + attr.Value = "legacyPerspectiveTop" + case ST_PresetCameraTypeLegacyPerspectiveTopRight: + attr.Value = "legacyPerspectiveTopRight" + case ST_PresetCameraTypeLegacyPerspectiveLeft: + attr.Value = "legacyPerspectiveLeft" + case ST_PresetCameraTypeLegacyPerspectiveFront: + attr.Value = "legacyPerspectiveFront" + case ST_PresetCameraTypeLegacyPerspectiveRight: + attr.Value = "legacyPerspectiveRight" + case ST_PresetCameraTypeLegacyPerspectiveBottomLeft: + attr.Value = "legacyPerspectiveBottomLeft" + case ST_PresetCameraTypeLegacyPerspectiveBottom: + attr.Value = "legacyPerspectiveBottom" + case ST_PresetCameraTypeLegacyPerspectiveBottomRight: + attr.Value = "legacyPerspectiveBottomRight" + case ST_PresetCameraTypeOrthographicFront: + attr.Value = "orthographicFront" + case ST_PresetCameraTypeIsometricTopUp: + attr.Value = "isometricTopUp" + case ST_PresetCameraTypeIsometricTopDown: + attr.Value = "isometricTopDown" + case ST_PresetCameraTypeIsometricBottomUp: + attr.Value = "isometricBottomUp" + case ST_PresetCameraTypeIsometricBottomDown: + attr.Value = "isometricBottomDown" + case ST_PresetCameraTypeIsometricLeftUp: + attr.Value = "isometricLeftUp" + case ST_PresetCameraTypeIsometricLeftDown: + attr.Value = "isometricLeftDown" + case ST_PresetCameraTypeIsometricRightUp: + attr.Value = "isometricRightUp" + case ST_PresetCameraTypeIsometricRightDown: + attr.Value = "isometricRightDown" + case ST_PresetCameraTypeIsometricOffAxis1Left: + attr.Value = "isometricOffAxis1Left" + case ST_PresetCameraTypeIsometricOffAxis1Right: + attr.Value = "isometricOffAxis1Right" + case ST_PresetCameraTypeIsometricOffAxis1Top: + attr.Value = "isometricOffAxis1Top" + case ST_PresetCameraTypeIsometricOffAxis2Left: + attr.Value = "isometricOffAxis2Left" + case ST_PresetCameraTypeIsometricOffAxis2Right: + attr.Value = "isometricOffAxis2Right" + case ST_PresetCameraTypeIsometricOffAxis2Top: + attr.Value = "isometricOffAxis2Top" + case ST_PresetCameraTypeIsometricOffAxis3Left: + attr.Value = "isometricOffAxis3Left" + case ST_PresetCameraTypeIsometricOffAxis3Right: + attr.Value = "isometricOffAxis3Right" + case ST_PresetCameraTypeIsometricOffAxis3Bottom: + attr.Value = "isometricOffAxis3Bottom" + case ST_PresetCameraTypeIsometricOffAxis4Left: + attr.Value = "isometricOffAxis4Left" + case ST_PresetCameraTypeIsometricOffAxis4Right: + attr.Value = "isometricOffAxis4Right" + case ST_PresetCameraTypeIsometricOffAxis4Bottom: + attr.Value = "isometricOffAxis4Bottom" + case ST_PresetCameraTypeObliqueTopLeft: + attr.Value = "obliqueTopLeft" + case ST_PresetCameraTypeObliqueTop: + attr.Value = "obliqueTop" + case ST_PresetCameraTypeObliqueTopRight: + attr.Value = "obliqueTopRight" + case ST_PresetCameraTypeObliqueLeft: + attr.Value = "obliqueLeft" + case ST_PresetCameraTypeObliqueRight: + attr.Value = "obliqueRight" + case ST_PresetCameraTypeObliqueBottomLeft: + attr.Value = "obliqueBottomLeft" + case ST_PresetCameraTypeObliqueBottom: + attr.Value = "obliqueBottom" + case ST_PresetCameraTypeObliqueBottomRight: + attr.Value = "obliqueBottomRight" + case ST_PresetCameraTypePerspectiveFront: + attr.Value = "perspectiveFront" + case ST_PresetCameraTypePerspectiveLeft: + attr.Value = "perspectiveLeft" + case ST_PresetCameraTypePerspectiveRight: + attr.Value = "perspectiveRight" + case ST_PresetCameraTypePerspectiveAbove: + attr.Value = "perspectiveAbove" + case ST_PresetCameraTypePerspectiveBelow: + attr.Value = "perspectiveBelow" + case ST_PresetCameraTypePerspectiveAboveLeftFacing: + attr.Value = "perspectiveAboveLeftFacing" + case ST_PresetCameraTypePerspectiveAboveRightFacing: + attr.Value = "perspectiveAboveRightFacing" + case ST_PresetCameraTypePerspectiveContrastingLeftFacing: + attr.Value = "perspectiveContrastingLeftFacing" + case ST_PresetCameraTypePerspectiveContrastingRightFacing: + attr.Value = "perspectiveContrastingRightFacing" + case ST_PresetCameraTypePerspectiveHeroicLeftFacing: + attr.Value = "perspectiveHeroicLeftFacing" + case ST_PresetCameraTypePerspectiveHeroicRightFacing: + attr.Value = "perspectiveHeroicRightFacing" + case ST_PresetCameraTypePerspectiveHeroicExtremeLeftFacing: + attr.Value = "perspectiveHeroicExtremeLeftFacing" + case ST_PresetCameraTypePerspectiveHeroicExtremeRightFacing: + attr.Value = "perspectiveHeroicExtremeRightFacing" + case ST_PresetCameraTypePerspectiveRelaxed: + attr.Value = "perspectiveRelaxed" + case ST_PresetCameraTypePerspectiveRelaxedModerately: + attr.Value = "perspectiveRelaxedModerately" + } + return attr, nil +} + +func (e *ST_PresetCameraType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "legacyObliqueTopLeft": + *e = 1 + case "legacyObliqueTop": + *e = 2 + case "legacyObliqueTopRight": + *e = 3 + case "legacyObliqueLeft": + *e = 4 + case "legacyObliqueFront": + *e = 5 + case "legacyObliqueRight": + *e = 6 + case "legacyObliqueBottomLeft": + *e = 7 + case "legacyObliqueBottom": + *e = 8 + case "legacyObliqueBottomRight": + *e = 9 + case "legacyPerspectiveTopLeft": + *e = 10 + case "legacyPerspectiveTop": + *e = 11 + case "legacyPerspectiveTopRight": + *e = 12 + case "legacyPerspectiveLeft": + *e = 13 + case "legacyPerspectiveFront": + *e = 14 + case "legacyPerspectiveRight": + *e = 15 + case "legacyPerspectiveBottomLeft": + *e = 16 + case "legacyPerspectiveBottom": + *e = 17 + case "legacyPerspectiveBottomRight": + *e = 18 + case "orthographicFront": + *e = 19 + case "isometricTopUp": + *e = 20 + case "isometricTopDown": + *e = 21 + case "isometricBottomUp": + *e = 22 + case "isometricBottomDown": + *e = 23 + case "isometricLeftUp": + *e = 24 + case "isometricLeftDown": + *e = 25 + case "isometricRightUp": + *e = 26 + case "isometricRightDown": + *e = 27 + case "isometricOffAxis1Left": + *e = 28 + case "isometricOffAxis1Right": + *e = 29 + case "isometricOffAxis1Top": + *e = 30 + case "isometricOffAxis2Left": + *e = 31 + case "isometricOffAxis2Right": + *e = 32 + case "isometricOffAxis2Top": + *e = 33 + case "isometricOffAxis3Left": + *e = 34 + case "isometricOffAxis3Right": + *e = 35 + case "isometricOffAxis3Bottom": + *e = 36 + case "isometricOffAxis4Left": + *e = 37 + case "isometricOffAxis4Right": + *e = 38 + case "isometricOffAxis4Bottom": + *e = 39 + case "obliqueTopLeft": + *e = 40 + case "obliqueTop": + *e = 41 + case "obliqueTopRight": + *e = 42 + case "obliqueLeft": + *e = 43 + case "obliqueRight": + *e = 44 + case "obliqueBottomLeft": + *e = 45 + case "obliqueBottom": + *e = 46 + case "obliqueBottomRight": + *e = 47 + case "perspectiveFront": + *e = 48 + case "perspectiveLeft": + *e = 49 + case "perspectiveRight": + *e = 50 + case "perspectiveAbove": + *e = 51 + case "perspectiveBelow": + *e = 52 + case "perspectiveAboveLeftFacing": + *e = 53 + case "perspectiveAboveRightFacing": + *e = 54 + case "perspectiveContrastingLeftFacing": + *e = 55 + case "perspectiveContrastingRightFacing": + *e = 56 + case "perspectiveHeroicLeftFacing": + *e = 57 + case "perspectiveHeroicRightFacing": + *e = 58 + case "perspectiveHeroicExtremeLeftFacing": + *e = 59 + case "perspectiveHeroicExtremeRightFacing": + *e = 60 + case "perspectiveRelaxed": + *e = 61 + case "perspectiveRelaxedModerately": + *e = 62 + } + return nil +} + +func (m ST_PresetCameraType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_PresetCameraType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "legacyObliqueTopLeft": + *m = 1 + case "legacyObliqueTop": + *m = 2 + case "legacyObliqueTopRight": + *m = 3 + case "legacyObliqueLeft": + *m = 4 + case "legacyObliqueFront": + *m = 5 + case "legacyObliqueRight": + *m = 6 + case "legacyObliqueBottomLeft": + *m = 7 + case "legacyObliqueBottom": + *m = 8 + case "legacyObliqueBottomRight": + *m = 9 + case "legacyPerspectiveTopLeft": + *m = 10 + case "legacyPerspectiveTop": + *m = 11 + case "legacyPerspectiveTopRight": + *m = 12 + case "legacyPerspectiveLeft": + *m = 13 + case "legacyPerspectiveFront": + *m = 14 + case "legacyPerspectiveRight": + *m = 15 + case "legacyPerspectiveBottomLeft": + *m = 16 + case "legacyPerspectiveBottom": + *m = 17 + case "legacyPerspectiveBottomRight": + *m = 18 + case "orthographicFront": + *m = 19 + case "isometricTopUp": + *m = 20 + case "isometricTopDown": + *m = 21 + case "isometricBottomUp": + *m = 22 + case "isometricBottomDown": + *m = 23 + case "isometricLeftUp": + *m = 24 + case "isometricLeftDown": + *m = 25 + case "isometricRightUp": + *m = 26 + case "isometricRightDown": + *m = 27 + case "isometricOffAxis1Left": + *m = 28 + case "isometricOffAxis1Right": + *m = 29 + case "isometricOffAxis1Top": + *m = 30 + case "isometricOffAxis2Left": + *m = 31 + case "isometricOffAxis2Right": + *m = 32 + case "isometricOffAxis2Top": + *m = 33 + case "isometricOffAxis3Left": + *m = 34 + case "isometricOffAxis3Right": + *m = 35 + case "isometricOffAxis3Bottom": + *m = 36 + case "isometricOffAxis4Left": + *m = 37 + case "isometricOffAxis4Right": + *m = 38 + case "isometricOffAxis4Bottom": + *m = 39 + case "obliqueTopLeft": + *m = 40 + case "obliqueTop": + *m = 41 + case "obliqueTopRight": + *m = 42 + case "obliqueLeft": + *m = 43 + case "obliqueRight": + *m = 44 + case "obliqueBottomLeft": + *m = 45 + case "obliqueBottom": + *m = 46 + case "obliqueBottomRight": + *m = 47 + case "perspectiveFront": + *m = 48 + case "perspectiveLeft": + *m = 49 + case "perspectiveRight": + *m = 50 + case "perspectiveAbove": + *m = 51 + case "perspectiveBelow": + *m = 52 + case "perspectiveAboveLeftFacing": + *m = 53 + case "perspectiveAboveRightFacing": + *m = 54 + case "perspectiveContrastingLeftFacing": + *m = 55 + case "perspectiveContrastingRightFacing": + *m = 56 + case "perspectiveHeroicLeftFacing": + *m = 57 + case "perspectiveHeroicRightFacing": + *m = 58 + case "perspectiveHeroicExtremeLeftFacing": + *m = 59 + case "perspectiveHeroicExtremeRightFacing": + *m = 60 + case "perspectiveRelaxed": + *m = 61 + case "perspectiveRelaxedModerately": + *m = 62 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_PresetCameraType) String() string { + switch m { + case 0: + return "" + case 1: + return "legacyObliqueTopLeft" + case 2: + return "legacyObliqueTop" + case 3: + return "legacyObliqueTopRight" + case 4: + return "legacyObliqueLeft" + case 5: + return "legacyObliqueFront" + case 6: + return "legacyObliqueRight" + case 7: + return "legacyObliqueBottomLeft" + case 8: + return "legacyObliqueBottom" + case 9: + return "legacyObliqueBottomRight" + case 10: + return "legacyPerspectiveTopLeft" + case 11: + return "legacyPerspectiveTop" + case 12: + return "legacyPerspectiveTopRight" + case 13: + return "legacyPerspectiveLeft" + case 14: + return "legacyPerspectiveFront" + case 15: + return "legacyPerspectiveRight" + case 16: + return "legacyPerspectiveBottomLeft" + case 17: + return "legacyPerspectiveBottom" + case 18: + return "legacyPerspectiveBottomRight" + case 19: + return "orthographicFront" + case 20: + return "isometricTopUp" + case 21: + return "isometricTopDown" + case 22: + return "isometricBottomUp" + case 23: + return "isometricBottomDown" + case 24: + return "isometricLeftUp" + case 25: + return "isometricLeftDown" + case 26: + return "isometricRightUp" + case 27: + return "isometricRightDown" + case 28: + return "isometricOffAxis1Left" + case 29: + return "isometricOffAxis1Right" + case 30: + return "isometricOffAxis1Top" + case 31: + return "isometricOffAxis2Left" + case 32: + return "isometricOffAxis2Right" + case 33: + return "isometricOffAxis2Top" + case 34: + return "isometricOffAxis3Left" + case 35: + return "isometricOffAxis3Right" + case 36: + return "isometricOffAxis3Bottom" + case 37: + return "isometricOffAxis4Left" + case 38: + return "isometricOffAxis4Right" + case 39: + return "isometricOffAxis4Bottom" + case 40: + return "obliqueTopLeft" + case 41: + return "obliqueTop" + case 42: + return "obliqueTopRight" + case 43: + return "obliqueLeft" + case 44: + return "obliqueRight" + case 45: + return "obliqueBottomLeft" + case 46: + return "obliqueBottom" + case 47: + return "obliqueBottomRight" + case 48: + return "perspectiveFront" + case 49: + return "perspectiveLeft" + case 50: + return "perspectiveRight" + case 51: + return "perspectiveAbove" + case 52: + return "perspectiveBelow" + case 53: + return "perspectiveAboveLeftFacing" + case 54: + return "perspectiveAboveRightFacing" + case 55: + return "perspectiveContrastingLeftFacing" + case 56: + return "perspectiveContrastingRightFacing" + case 57: + return "perspectiveHeroicLeftFacing" + case 58: + return "perspectiveHeroicRightFacing" + case 59: + return "perspectiveHeroicExtremeLeftFacing" + case 60: + return "perspectiveHeroicExtremeRightFacing" + case 61: + return "perspectiveRelaxed" + case 62: + return "perspectiveRelaxedModerately" + } + return "" +} + +func (m ST_PresetCameraType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_PresetCameraType) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_LightRigDirection byte + +const ( + ST_LightRigDirectionUnset ST_LightRigDirection = 0 + ST_LightRigDirectionTl ST_LightRigDirection = 1 + ST_LightRigDirectionT ST_LightRigDirection = 2 + ST_LightRigDirectionTr ST_LightRigDirection = 3 + ST_LightRigDirectionL ST_LightRigDirection = 4 + ST_LightRigDirectionR ST_LightRigDirection = 5 + ST_LightRigDirectionBl ST_LightRigDirection = 6 + ST_LightRigDirectionB ST_LightRigDirection = 7 + ST_LightRigDirectionBr ST_LightRigDirection = 8 +) + +func (e ST_LightRigDirection) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_LightRigDirectionUnset: + attr.Value = "" + case ST_LightRigDirectionTl: + attr.Value = "tl" + case ST_LightRigDirectionT: + attr.Value = "t" + case ST_LightRigDirectionTr: + attr.Value = "tr" + case ST_LightRigDirectionL: + attr.Value = "l" + case ST_LightRigDirectionR: + attr.Value = "r" + case ST_LightRigDirectionBl: + attr.Value = "bl" + case ST_LightRigDirectionB: + attr.Value = "b" + case ST_LightRigDirectionBr: + attr.Value = "br" + } + return attr, nil +} + +func (e *ST_LightRigDirection) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "tl": + *e = 1 + case "t": + *e = 2 + case "tr": + *e = 3 + case "l": + *e = 4 + case "r": + *e = 5 + case "bl": + *e = 6 + case "b": + *e = 7 + case "br": + *e = 8 + } + return nil +} + +func (m ST_LightRigDirection) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_LightRigDirection) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "tl": + *m = 1 + case "t": + *m = 2 + case "tr": + *m = 3 + case "l": + *m = 4 + case "r": + *m = 5 + case "bl": + *m = 6 + case "b": + *m = 7 + case "br": + *m = 8 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_LightRigDirection) String() string { + switch m { + case 0: + return "" + case 1: + return "tl" + case 2: + return "t" + case 3: + return "tr" + case 4: + return "l" + case 5: + return "r" + case 6: + return "bl" + case 7: + return "b" + case 8: + return "br" + } + return "" +} + +func (m ST_LightRigDirection) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_LightRigDirection) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7, 8: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_LightRigType byte + +const ( + ST_LightRigTypeUnset ST_LightRigType = 0 + ST_LightRigTypeLegacyFlat1 ST_LightRigType = 1 + ST_LightRigTypeLegacyFlat2 ST_LightRigType = 2 + ST_LightRigTypeLegacyFlat3 ST_LightRigType = 3 + ST_LightRigTypeLegacyFlat4 ST_LightRigType = 4 + ST_LightRigTypeLegacyNormal1 ST_LightRigType = 5 + ST_LightRigTypeLegacyNormal2 ST_LightRigType = 6 + ST_LightRigTypeLegacyNormal3 ST_LightRigType = 7 + ST_LightRigTypeLegacyNormal4 ST_LightRigType = 8 + ST_LightRigTypeLegacyHarsh1 ST_LightRigType = 9 + ST_LightRigTypeLegacyHarsh2 ST_LightRigType = 10 + ST_LightRigTypeLegacyHarsh3 ST_LightRigType = 11 + ST_LightRigTypeLegacyHarsh4 ST_LightRigType = 12 + ST_LightRigTypeThreePt ST_LightRigType = 13 + ST_LightRigTypeBalanced ST_LightRigType = 14 + ST_LightRigTypeSoft ST_LightRigType = 15 + ST_LightRigTypeHarsh ST_LightRigType = 16 + ST_LightRigTypeFlood ST_LightRigType = 17 + ST_LightRigTypeContrasting ST_LightRigType = 18 + ST_LightRigTypeMorning ST_LightRigType = 19 + ST_LightRigTypeSunrise ST_LightRigType = 20 + ST_LightRigTypeSunset ST_LightRigType = 21 + ST_LightRigTypeChilly ST_LightRigType = 22 + ST_LightRigTypeFreezing ST_LightRigType = 23 + ST_LightRigTypeFlat ST_LightRigType = 24 + ST_LightRigTypeTwoPt ST_LightRigType = 25 + ST_LightRigTypeGlow ST_LightRigType = 26 + ST_LightRigTypeBrightRoom ST_LightRigType = 27 +) + +func (e ST_LightRigType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_LightRigTypeUnset: + attr.Value = "" + case ST_LightRigTypeLegacyFlat1: + attr.Value = "legacyFlat1" + case ST_LightRigTypeLegacyFlat2: + attr.Value = "legacyFlat2" + case ST_LightRigTypeLegacyFlat3: + attr.Value = "legacyFlat3" + case ST_LightRigTypeLegacyFlat4: + attr.Value = "legacyFlat4" + case ST_LightRigTypeLegacyNormal1: + attr.Value = "legacyNormal1" + case ST_LightRigTypeLegacyNormal2: + attr.Value = "legacyNormal2" + case ST_LightRigTypeLegacyNormal3: + attr.Value = "legacyNormal3" + case ST_LightRigTypeLegacyNormal4: + attr.Value = "legacyNormal4" + case ST_LightRigTypeLegacyHarsh1: + attr.Value = "legacyHarsh1" + case ST_LightRigTypeLegacyHarsh2: + attr.Value = "legacyHarsh2" + case ST_LightRigTypeLegacyHarsh3: + attr.Value = "legacyHarsh3" + case ST_LightRigTypeLegacyHarsh4: + attr.Value = "legacyHarsh4" + case ST_LightRigTypeThreePt: + attr.Value = "threePt" + case ST_LightRigTypeBalanced: + attr.Value = "balanced" + case ST_LightRigTypeSoft: + attr.Value = "soft" + case ST_LightRigTypeHarsh: + attr.Value = "harsh" + case ST_LightRigTypeFlood: + attr.Value = "flood" + case ST_LightRigTypeContrasting: + attr.Value = "contrasting" + case ST_LightRigTypeMorning: + attr.Value = "morning" + case ST_LightRigTypeSunrise: + attr.Value = "sunrise" + case ST_LightRigTypeSunset: + attr.Value = "sunset" + case ST_LightRigTypeChilly: + attr.Value = "chilly" + case ST_LightRigTypeFreezing: + attr.Value = "freezing" + case ST_LightRigTypeFlat: + attr.Value = "flat" + case ST_LightRigTypeTwoPt: + attr.Value = "twoPt" + case ST_LightRigTypeGlow: + attr.Value = "glow" + case ST_LightRigTypeBrightRoom: + attr.Value = "brightRoom" + } + return attr, nil +} + +func (e *ST_LightRigType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "legacyFlat1": + *e = 1 + case "legacyFlat2": + *e = 2 + case "legacyFlat3": + *e = 3 + case "legacyFlat4": + *e = 4 + case "legacyNormal1": + *e = 5 + case "legacyNormal2": + *e = 6 + case "legacyNormal3": + *e = 7 + case "legacyNormal4": + *e = 8 + case "legacyHarsh1": + *e = 9 + case "legacyHarsh2": + *e = 10 + case "legacyHarsh3": + *e = 11 + case "legacyHarsh4": + *e = 12 + case "threePt": + *e = 13 + case "balanced": + *e = 14 + case "soft": + *e = 15 + case "harsh": + *e = 16 + case "flood": + *e = 17 + case "contrasting": + *e = 18 + case "morning": + *e = 19 + case "sunrise": + *e = 20 + case "sunset": + *e = 21 + case "chilly": + *e = 22 + case "freezing": + *e = 23 + case "flat": + *e = 24 + case "twoPt": + *e = 25 + case "glow": + *e = 26 + case "brightRoom": + *e = 27 + } + return nil +} + +func (m ST_LightRigType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_LightRigType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "legacyFlat1": + *m = 1 + case "legacyFlat2": + *m = 2 + case "legacyFlat3": + *m = 3 + case "legacyFlat4": + *m = 4 + case "legacyNormal1": + *m = 5 + case "legacyNormal2": + *m = 6 + case "legacyNormal3": + *m = 7 + case "legacyNormal4": + *m = 8 + case "legacyHarsh1": + *m = 9 + case "legacyHarsh2": + *m = 10 + case "legacyHarsh3": + *m = 11 + case "legacyHarsh4": + *m = 12 + case "threePt": + *m = 13 + case "balanced": + *m = 14 + case "soft": + *m = 15 + case "harsh": + *m = 16 + case "flood": + *m = 17 + case "contrasting": + *m = 18 + case "morning": + *m = 19 + case "sunrise": + *m = 20 + case "sunset": + *m = 21 + case "chilly": + *m = 22 + case "freezing": + *m = 23 + case "flat": + *m = 24 + case "twoPt": + *m = 25 + case "glow": + *m = 26 + case "brightRoom": + *m = 27 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_LightRigType) String() string { + switch m { + case 0: + return "" + case 1: + return "legacyFlat1" + case 2: + return "legacyFlat2" + case 3: + return "legacyFlat3" + case 4: + return "legacyFlat4" + case 5: + return "legacyNormal1" + case 6: + return "legacyNormal2" + case 7: + return "legacyNormal3" + case 8: + return "legacyNormal4" + case 9: + return "legacyHarsh1" + case 10: + return "legacyHarsh2" + case 11: + return "legacyHarsh3" + case 12: + return "legacyHarsh4" + case 13: + return "threePt" + case 14: + return "balanced" + case 15: + return "soft" + case 16: + return "harsh" + case 17: + return "flood" + case 18: + return "contrasting" + case 19: + return "morning" + case 20: + return "sunrise" + case 21: + return "sunset" + case 22: + return "chilly" + case 23: + return "freezing" + case 24: + return "flat" + case 25: + return "twoPt" + case 26: + return "glow" + case 27: + return "brightRoom" + } + return "" +} + +func (m ST_LightRigType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_LightRigType) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_BevelPresetType byte + +const ( + ST_BevelPresetTypeUnset ST_BevelPresetType = 0 + ST_BevelPresetTypeRelaxedInset ST_BevelPresetType = 1 + ST_BevelPresetTypeCircle ST_BevelPresetType = 2 + ST_BevelPresetTypeSlope ST_BevelPresetType = 3 + ST_BevelPresetTypeCross ST_BevelPresetType = 4 + ST_BevelPresetTypeAngle ST_BevelPresetType = 5 + ST_BevelPresetTypeSoftRound ST_BevelPresetType = 6 + ST_BevelPresetTypeConvex ST_BevelPresetType = 7 + ST_BevelPresetTypeCoolSlant ST_BevelPresetType = 8 + ST_BevelPresetTypeDivot ST_BevelPresetType = 9 + ST_BevelPresetTypeRiblet ST_BevelPresetType = 10 + ST_BevelPresetTypeHardEdge ST_BevelPresetType = 11 + ST_BevelPresetTypeArtDeco ST_BevelPresetType = 12 +) + +func (e ST_BevelPresetType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_BevelPresetTypeUnset: + attr.Value = "" + case ST_BevelPresetTypeRelaxedInset: + attr.Value = "relaxedInset" + case ST_BevelPresetTypeCircle: + attr.Value = "circle" + case ST_BevelPresetTypeSlope: + attr.Value = "slope" + case ST_BevelPresetTypeCross: + attr.Value = "cross" + case ST_BevelPresetTypeAngle: + attr.Value = "angle" + case ST_BevelPresetTypeSoftRound: + attr.Value = "softRound" + case ST_BevelPresetTypeConvex: + attr.Value = "convex" + case ST_BevelPresetTypeCoolSlant: + attr.Value = "coolSlant" + case ST_BevelPresetTypeDivot: + attr.Value = "divot" + case ST_BevelPresetTypeRiblet: + attr.Value = "riblet" + case ST_BevelPresetTypeHardEdge: + attr.Value = "hardEdge" + case ST_BevelPresetTypeArtDeco: + attr.Value = "artDeco" + } + return attr, nil +} + +func (e *ST_BevelPresetType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "relaxedInset": + *e = 1 + case "circle": + *e = 2 + case "slope": + *e = 3 + case "cross": + *e = 4 + case "angle": + *e = 5 + case "softRound": + *e = 6 + case "convex": + *e = 7 + case "coolSlant": + *e = 8 + case "divot": + *e = 9 + case "riblet": + *e = 10 + case "hardEdge": + *e = 11 + case "artDeco": + *e = 12 + } + return nil +} + +func (m ST_BevelPresetType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_BevelPresetType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "relaxedInset": + *m = 1 + case "circle": + *m = 2 + case "slope": + *m = 3 + case "cross": + *m = 4 + case "angle": + *m = 5 + case "softRound": + *m = 6 + case "convex": + *m = 7 + case "coolSlant": + *m = 8 + case "divot": + *m = 9 + case "riblet": + *m = 10 + case "hardEdge": + *m = 11 + case "artDeco": + *m = 12 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_BevelPresetType) String() string { + switch m { + case 0: + return "" + case 1: + return "relaxedInset" + case 2: + return "circle" + case 3: + return "slope" + case 4: + return "cross" + case 5: + return "angle" + case 6: + return "softRound" + case 7: + return "convex" + case 8: + return "coolSlant" + case 9: + return "divot" + case 10: + return "riblet" + case 11: + return "hardEdge" + case 12: + return "artDeco" + } + return "" +} + +func (m ST_BevelPresetType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_BevelPresetType) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_PresetMaterialType byte + +const ( + ST_PresetMaterialTypeUnset ST_PresetMaterialType = 0 + ST_PresetMaterialTypeLegacyMatte ST_PresetMaterialType = 1 + ST_PresetMaterialTypeLegacyPlastic ST_PresetMaterialType = 2 + ST_PresetMaterialTypeLegacyMetal ST_PresetMaterialType = 3 + ST_PresetMaterialTypeLegacyWireframe ST_PresetMaterialType = 4 + ST_PresetMaterialTypeMatte ST_PresetMaterialType = 5 + ST_PresetMaterialTypePlastic ST_PresetMaterialType = 6 + ST_PresetMaterialTypeMetal ST_PresetMaterialType = 7 + ST_PresetMaterialTypeWarmMatte ST_PresetMaterialType = 8 + ST_PresetMaterialTypeTranslucentPowder ST_PresetMaterialType = 9 + ST_PresetMaterialTypePowder ST_PresetMaterialType = 10 + ST_PresetMaterialTypeDkEdge ST_PresetMaterialType = 11 + ST_PresetMaterialTypeSoftEdge ST_PresetMaterialType = 12 + ST_PresetMaterialTypeClear ST_PresetMaterialType = 13 + ST_PresetMaterialTypeFlat ST_PresetMaterialType = 14 + ST_PresetMaterialTypeSoftmetal ST_PresetMaterialType = 15 +) + +func (e ST_PresetMaterialType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_PresetMaterialTypeUnset: + attr.Value = "" + case ST_PresetMaterialTypeLegacyMatte: + attr.Value = "legacyMatte" + case ST_PresetMaterialTypeLegacyPlastic: + attr.Value = "legacyPlastic" + case ST_PresetMaterialTypeLegacyMetal: + attr.Value = "legacyMetal" + case ST_PresetMaterialTypeLegacyWireframe: + attr.Value = "legacyWireframe" + case ST_PresetMaterialTypeMatte: + attr.Value = "matte" + case ST_PresetMaterialTypePlastic: + attr.Value = "plastic" + case ST_PresetMaterialTypeMetal: + attr.Value = "metal" + case ST_PresetMaterialTypeWarmMatte: + attr.Value = "warmMatte" + case ST_PresetMaterialTypeTranslucentPowder: + attr.Value = "translucentPowder" + case ST_PresetMaterialTypePowder: + attr.Value = "powder" + case ST_PresetMaterialTypeDkEdge: + attr.Value = "dkEdge" + case ST_PresetMaterialTypeSoftEdge: + attr.Value = "softEdge" + case ST_PresetMaterialTypeClear: + attr.Value = "clear" + case ST_PresetMaterialTypeFlat: + attr.Value = "flat" + case ST_PresetMaterialTypeSoftmetal: + attr.Value = "softmetal" + } + return attr, nil +} + +func (e *ST_PresetMaterialType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "legacyMatte": + *e = 1 + case "legacyPlastic": + *e = 2 + case "legacyMetal": + *e = 3 + case "legacyWireframe": + *e = 4 + case "matte": + *e = 5 + case "plastic": + *e = 6 + case "metal": + *e = 7 + case "warmMatte": + *e = 8 + case "translucentPowder": + *e = 9 + case "powder": + *e = 10 + case "dkEdge": + *e = 11 + case "softEdge": + *e = 12 + case "clear": + *e = 13 + case "flat": + *e = 14 + case "softmetal": + *e = 15 + } + return nil +} + +func (m ST_PresetMaterialType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_PresetMaterialType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "legacyMatte": + *m = 1 + case "legacyPlastic": + *m = 2 + case "legacyMetal": + *m = 3 + case "legacyWireframe": + *m = 4 + case "matte": + *m = 5 + case "plastic": + *m = 6 + case "metal": + *m = 7 + case "warmMatte": + *m = 8 + case "translucentPowder": + *m = 9 + case "powder": + *m = 10 + case "dkEdge": + *m = 11 + case "softEdge": + *m = 12 + case "clear": + *m = 13 + case "flat": + *m = 14 + case "softmetal": + *m = 15 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_PresetMaterialType) String() string { + switch m { + case 0: + return "" + case 1: + return "legacyMatte" + case 2: + return "legacyPlastic" + case 3: + return "legacyMetal" + case 4: + return "legacyWireframe" + case 5: + return "matte" + case 6: + return "plastic" + case 7: + return "metal" + case 8: + return "warmMatte" + case 9: + return "translucentPowder" + case 10: + return "powder" + case 11: + return "dkEdge" + case 12: + return "softEdge" + case 13: + return "clear" + case 14: + return "flat" + case 15: + return "softmetal" + } + return "" +} + +func (m ST_PresetMaterialType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_PresetMaterialType) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_PresetShadowVal byte + +const ( + ST_PresetShadowValUnset ST_PresetShadowVal = 0 + ST_PresetShadowValShdw1 ST_PresetShadowVal = 1 + ST_PresetShadowValShdw2 ST_PresetShadowVal = 2 + ST_PresetShadowValShdw3 ST_PresetShadowVal = 3 + ST_PresetShadowValShdw4 ST_PresetShadowVal = 4 + ST_PresetShadowValShdw5 ST_PresetShadowVal = 5 + ST_PresetShadowValShdw6 ST_PresetShadowVal = 6 + ST_PresetShadowValShdw7 ST_PresetShadowVal = 7 + ST_PresetShadowValShdw8 ST_PresetShadowVal = 8 + ST_PresetShadowValShdw9 ST_PresetShadowVal = 9 + ST_PresetShadowValShdw10 ST_PresetShadowVal = 10 + ST_PresetShadowValShdw11 ST_PresetShadowVal = 11 + ST_PresetShadowValShdw12 ST_PresetShadowVal = 12 + ST_PresetShadowValShdw13 ST_PresetShadowVal = 13 + ST_PresetShadowValShdw14 ST_PresetShadowVal = 14 + ST_PresetShadowValShdw15 ST_PresetShadowVal = 15 + ST_PresetShadowValShdw16 ST_PresetShadowVal = 16 + ST_PresetShadowValShdw17 ST_PresetShadowVal = 17 + ST_PresetShadowValShdw18 ST_PresetShadowVal = 18 + ST_PresetShadowValShdw19 ST_PresetShadowVal = 19 + ST_PresetShadowValShdw20 ST_PresetShadowVal = 20 +) + +func (e ST_PresetShadowVal) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_PresetShadowValUnset: + attr.Value = "" + case ST_PresetShadowValShdw1: + attr.Value = "shdw1" + case ST_PresetShadowValShdw2: + attr.Value = "shdw2" + case ST_PresetShadowValShdw3: + attr.Value = "shdw3" + case ST_PresetShadowValShdw4: + attr.Value = "shdw4" + case ST_PresetShadowValShdw5: + attr.Value = "shdw5" + case ST_PresetShadowValShdw6: + attr.Value = "shdw6" + case ST_PresetShadowValShdw7: + attr.Value = "shdw7" + case ST_PresetShadowValShdw8: + attr.Value = "shdw8" + case ST_PresetShadowValShdw9: + attr.Value = "shdw9" + case ST_PresetShadowValShdw10: + attr.Value = "shdw10" + case ST_PresetShadowValShdw11: + attr.Value = "shdw11" + case ST_PresetShadowValShdw12: + attr.Value = "shdw12" + case ST_PresetShadowValShdw13: + attr.Value = "shdw13" + case ST_PresetShadowValShdw14: + attr.Value = "shdw14" + case ST_PresetShadowValShdw15: + attr.Value = "shdw15" + case ST_PresetShadowValShdw16: + attr.Value = "shdw16" + case ST_PresetShadowValShdw17: + attr.Value = "shdw17" + case ST_PresetShadowValShdw18: + attr.Value = "shdw18" + case ST_PresetShadowValShdw19: + attr.Value = "shdw19" + case ST_PresetShadowValShdw20: + attr.Value = "shdw20" + } + return attr, nil +} + +func (e *ST_PresetShadowVal) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "shdw1": + *e = 1 + case "shdw2": + *e = 2 + case "shdw3": + *e = 3 + case "shdw4": + *e = 4 + case "shdw5": + *e = 5 + case "shdw6": + *e = 6 + case "shdw7": + *e = 7 + case "shdw8": + *e = 8 + case "shdw9": + *e = 9 + case "shdw10": + *e = 10 + case "shdw11": + *e = 11 + case "shdw12": + *e = 12 + case "shdw13": + *e = 13 + case "shdw14": + *e = 14 + case "shdw15": + *e = 15 + case "shdw16": + *e = 16 + case "shdw17": + *e = 17 + case "shdw18": + *e = 18 + case "shdw19": + *e = 19 + case "shdw20": + *e = 20 + } + return nil +} + +func (m ST_PresetShadowVal) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_PresetShadowVal) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "shdw1": + *m = 1 + case "shdw2": + *m = 2 + case "shdw3": + *m = 3 + case "shdw4": + *m = 4 + case "shdw5": + *m = 5 + case "shdw6": + *m = 6 + case "shdw7": + *m = 7 + case "shdw8": + *m = 8 + case "shdw9": + *m = 9 + case "shdw10": + *m = 10 + case "shdw11": + *m = 11 + case "shdw12": + *m = 12 + case "shdw13": + *m = 13 + case "shdw14": + *m = 14 + case "shdw15": + *m = 15 + case "shdw16": + *m = 16 + case "shdw17": + *m = 17 + case "shdw18": + *m = 18 + case "shdw19": + *m = 19 + case "shdw20": + *m = 20 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_PresetShadowVal) String() string { + switch m { + case 0: + return "" + case 1: + return "shdw1" + case 2: + return "shdw2" + case 3: + return "shdw3" + case 4: + return "shdw4" + case 5: + return "shdw5" + case 6: + return "shdw6" + case 7: + return "shdw7" + case 8: + return "shdw8" + case 9: + return "shdw9" + case 10: + return "shdw10" + case 11: + return "shdw11" + case 12: + return "shdw12" + case 13: + return "shdw13" + case 14: + return "shdw14" + case 15: + return "shdw15" + case 16: + return "shdw16" + case 17: + return "shdw17" + case 18: + return "shdw18" + case 19: + return "shdw19" + case 20: + return "shdw20" + } + return "" +} + +func (m ST_PresetShadowVal) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_PresetShadowVal) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_PathShadeType byte + +const ( + ST_PathShadeTypeUnset ST_PathShadeType = 0 + ST_PathShadeTypeShape ST_PathShadeType = 1 + ST_PathShadeTypeCircle ST_PathShadeType = 2 + ST_PathShadeTypeRect ST_PathShadeType = 3 +) + +func (e ST_PathShadeType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_PathShadeTypeUnset: + attr.Value = "" + case ST_PathShadeTypeShape: + attr.Value = "shape" + case ST_PathShadeTypeCircle: + attr.Value = "circle" + case ST_PathShadeTypeRect: + attr.Value = "rect" + } + return attr, nil +} + +func (e *ST_PathShadeType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "shape": + *e = 1 + case "circle": + *e = 2 + case "rect": + *e = 3 + } + return nil +} + +func (m ST_PathShadeType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_PathShadeType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "shape": + *m = 1 + case "circle": + *m = 2 + case "rect": + *m = 3 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_PathShadeType) String() string { + switch m { + case 0: + return "" + case 1: + return "shape" + case 2: + return "circle" + case 3: + return "rect" + } + return "" +} + +func (m ST_PathShadeType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_PathShadeType) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_TileFlipMode byte + +const ( + ST_TileFlipModeUnset ST_TileFlipMode = 0 + ST_TileFlipModeNone ST_TileFlipMode = 1 + ST_TileFlipModeX ST_TileFlipMode = 2 + ST_TileFlipModeY ST_TileFlipMode = 3 + ST_TileFlipModeXy ST_TileFlipMode = 4 +) + +func (e ST_TileFlipMode) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_TileFlipModeUnset: + attr.Value = "" + case ST_TileFlipModeNone: + attr.Value = "none" + case ST_TileFlipModeX: + attr.Value = "x" + case ST_TileFlipModeY: + attr.Value = "y" + case ST_TileFlipModeXy: + attr.Value = "xy" + } + return attr, nil +} + +func (e *ST_TileFlipMode) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "none": + *e = 1 + case "x": + *e = 2 + case "y": + *e = 3 + case "xy": + *e = 4 + } + return nil +} + +func (m ST_TileFlipMode) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_TileFlipMode) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "none": + *m = 1 + case "x": + *m = 2 + case "y": + *m = 3 + case "xy": + *m = 4 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_TileFlipMode) String() string { + switch m { + case 0: + return "" + case 1: + return "none" + case 2: + return "x" + case 3: + return "y" + case 4: + return "xy" + } + return "" +} + +func (m ST_TileFlipMode) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_TileFlipMode) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_BlipCompression byte + +const ( + ST_BlipCompressionUnset ST_BlipCompression = 0 + ST_BlipCompressionEmail ST_BlipCompression = 1 + ST_BlipCompressionScreen ST_BlipCompression = 2 + ST_BlipCompressionPrint ST_BlipCompression = 3 + ST_BlipCompressionHqprint ST_BlipCompression = 4 + ST_BlipCompressionNone ST_BlipCompression = 5 +) + +func (e ST_BlipCompression) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_BlipCompressionUnset: + attr.Value = "" + case ST_BlipCompressionEmail: + attr.Value = "email" + case ST_BlipCompressionScreen: + attr.Value = "screen" + case ST_BlipCompressionPrint: + attr.Value = "print" + case ST_BlipCompressionHqprint: + attr.Value = "hqprint" + case ST_BlipCompressionNone: + attr.Value = "none" + } + return attr, nil +} + +func (e *ST_BlipCompression) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "email": + *e = 1 + case "screen": + *e = 2 + case "print": + *e = 3 + case "hqprint": + *e = 4 + case "none": + *e = 5 + } + return nil +} + +func (m ST_BlipCompression) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_BlipCompression) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "email": + *m = 1 + case "screen": + *m = 2 + case "print": + *m = 3 + case "hqprint": + *m = 4 + case "none": + *m = 5 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_BlipCompression) String() string { + switch m { + case 0: + return "" + case 1: + return "email" + case 2: + return "screen" + case 3: + return "print" + case 4: + return "hqprint" + case 5: + return "none" + } + return "" +} + +func (m ST_BlipCompression) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_BlipCompression) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_PresetPatternVal byte + +const ( + ST_PresetPatternValUnset ST_PresetPatternVal = 0 + ST_PresetPatternValPct5 ST_PresetPatternVal = 1 + ST_PresetPatternValPct10 ST_PresetPatternVal = 2 + ST_PresetPatternValPct20 ST_PresetPatternVal = 3 + ST_PresetPatternValPct25 ST_PresetPatternVal = 4 + ST_PresetPatternValPct30 ST_PresetPatternVal = 5 + ST_PresetPatternValPct40 ST_PresetPatternVal = 6 + ST_PresetPatternValPct50 ST_PresetPatternVal = 7 + ST_PresetPatternValPct60 ST_PresetPatternVal = 8 + ST_PresetPatternValPct70 ST_PresetPatternVal = 9 + ST_PresetPatternValPct75 ST_PresetPatternVal = 10 + ST_PresetPatternValPct80 ST_PresetPatternVal = 11 + ST_PresetPatternValPct90 ST_PresetPatternVal = 12 + ST_PresetPatternValHorz ST_PresetPatternVal = 13 + ST_PresetPatternValVert ST_PresetPatternVal = 14 + ST_PresetPatternValLtHorz ST_PresetPatternVal = 15 + ST_PresetPatternValLtVert ST_PresetPatternVal = 16 + ST_PresetPatternValDkHorz ST_PresetPatternVal = 17 + ST_PresetPatternValDkVert ST_PresetPatternVal = 18 + ST_PresetPatternValNarHorz ST_PresetPatternVal = 19 + ST_PresetPatternValNarVert ST_PresetPatternVal = 20 + ST_PresetPatternValDashHorz ST_PresetPatternVal = 21 + ST_PresetPatternValDashVert ST_PresetPatternVal = 22 + ST_PresetPatternValCross ST_PresetPatternVal = 23 + ST_PresetPatternValDnDiag ST_PresetPatternVal = 24 + ST_PresetPatternValUpDiag ST_PresetPatternVal = 25 + ST_PresetPatternValLtDnDiag ST_PresetPatternVal = 26 + ST_PresetPatternValLtUpDiag ST_PresetPatternVal = 27 + ST_PresetPatternValDkDnDiag ST_PresetPatternVal = 28 + ST_PresetPatternValDkUpDiag ST_PresetPatternVal = 29 + ST_PresetPatternValWdDnDiag ST_PresetPatternVal = 30 + ST_PresetPatternValWdUpDiag ST_PresetPatternVal = 31 + ST_PresetPatternValDashDnDiag ST_PresetPatternVal = 32 + ST_PresetPatternValDashUpDiag ST_PresetPatternVal = 33 + ST_PresetPatternValDiagCross ST_PresetPatternVal = 34 + ST_PresetPatternValSmCheck ST_PresetPatternVal = 35 + ST_PresetPatternValLgCheck ST_PresetPatternVal = 36 + ST_PresetPatternValSmGrid ST_PresetPatternVal = 37 + ST_PresetPatternValLgGrid ST_PresetPatternVal = 38 + ST_PresetPatternValDotGrid ST_PresetPatternVal = 39 + ST_PresetPatternValSmConfetti ST_PresetPatternVal = 40 + ST_PresetPatternValLgConfetti ST_PresetPatternVal = 41 + ST_PresetPatternValHorzBrick ST_PresetPatternVal = 42 + ST_PresetPatternValDiagBrick ST_PresetPatternVal = 43 + ST_PresetPatternValSolidDmnd ST_PresetPatternVal = 44 + ST_PresetPatternValOpenDmnd ST_PresetPatternVal = 45 + ST_PresetPatternValDotDmnd ST_PresetPatternVal = 46 + ST_PresetPatternValPlaid ST_PresetPatternVal = 47 + ST_PresetPatternValSphere ST_PresetPatternVal = 48 + ST_PresetPatternValWeave ST_PresetPatternVal = 49 + ST_PresetPatternValDivot ST_PresetPatternVal = 50 + ST_PresetPatternValShingle ST_PresetPatternVal = 51 + ST_PresetPatternValWave ST_PresetPatternVal = 52 + ST_PresetPatternValTrellis ST_PresetPatternVal = 53 + ST_PresetPatternValZigZag ST_PresetPatternVal = 54 +) + +func (e ST_PresetPatternVal) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_PresetPatternValUnset: + attr.Value = "" + case ST_PresetPatternValPct5: + attr.Value = "pct5" + case ST_PresetPatternValPct10: + attr.Value = "pct10" + case ST_PresetPatternValPct20: + attr.Value = "pct20" + case ST_PresetPatternValPct25: + attr.Value = "pct25" + case ST_PresetPatternValPct30: + attr.Value = "pct30" + case ST_PresetPatternValPct40: + attr.Value = "pct40" + case ST_PresetPatternValPct50: + attr.Value = "pct50" + case ST_PresetPatternValPct60: + attr.Value = "pct60" + case ST_PresetPatternValPct70: + attr.Value = "pct70" + case ST_PresetPatternValPct75: + attr.Value = "pct75" + case ST_PresetPatternValPct80: + attr.Value = "pct80" + case ST_PresetPatternValPct90: + attr.Value = "pct90" + case ST_PresetPatternValHorz: + attr.Value = "horz" + case ST_PresetPatternValVert: + attr.Value = "vert" + case ST_PresetPatternValLtHorz: + attr.Value = "ltHorz" + case ST_PresetPatternValLtVert: + attr.Value = "ltVert" + case ST_PresetPatternValDkHorz: + attr.Value = "dkHorz" + case ST_PresetPatternValDkVert: + attr.Value = "dkVert" + case ST_PresetPatternValNarHorz: + attr.Value = "narHorz" + case ST_PresetPatternValNarVert: + attr.Value = "narVert" + case ST_PresetPatternValDashHorz: + attr.Value = "dashHorz" + case ST_PresetPatternValDashVert: + attr.Value = "dashVert" + case ST_PresetPatternValCross: + attr.Value = "cross" + case ST_PresetPatternValDnDiag: + attr.Value = "dnDiag" + case ST_PresetPatternValUpDiag: + attr.Value = "upDiag" + case ST_PresetPatternValLtDnDiag: + attr.Value = "ltDnDiag" + case ST_PresetPatternValLtUpDiag: + attr.Value = "ltUpDiag" + case ST_PresetPatternValDkDnDiag: + attr.Value = "dkDnDiag" + case ST_PresetPatternValDkUpDiag: + attr.Value = "dkUpDiag" + case ST_PresetPatternValWdDnDiag: + attr.Value = "wdDnDiag" + case ST_PresetPatternValWdUpDiag: + attr.Value = "wdUpDiag" + case ST_PresetPatternValDashDnDiag: + attr.Value = "dashDnDiag" + case ST_PresetPatternValDashUpDiag: + attr.Value = "dashUpDiag" + case ST_PresetPatternValDiagCross: + attr.Value = "diagCross" + case ST_PresetPatternValSmCheck: + attr.Value = "smCheck" + case ST_PresetPatternValLgCheck: + attr.Value = "lgCheck" + case ST_PresetPatternValSmGrid: + attr.Value = "smGrid" + case ST_PresetPatternValLgGrid: + attr.Value = "lgGrid" + case ST_PresetPatternValDotGrid: + attr.Value = "dotGrid" + case ST_PresetPatternValSmConfetti: + attr.Value = "smConfetti" + case ST_PresetPatternValLgConfetti: + attr.Value = "lgConfetti" + case ST_PresetPatternValHorzBrick: + attr.Value = "horzBrick" + case ST_PresetPatternValDiagBrick: + attr.Value = "diagBrick" + case ST_PresetPatternValSolidDmnd: + attr.Value = "solidDmnd" + case ST_PresetPatternValOpenDmnd: + attr.Value = "openDmnd" + case ST_PresetPatternValDotDmnd: + attr.Value = "dotDmnd" + case ST_PresetPatternValPlaid: + attr.Value = "plaid" + case ST_PresetPatternValSphere: + attr.Value = "sphere" + case ST_PresetPatternValWeave: + attr.Value = "weave" + case ST_PresetPatternValDivot: + attr.Value = "divot" + case ST_PresetPatternValShingle: + attr.Value = "shingle" + case ST_PresetPatternValWave: + attr.Value = "wave" + case ST_PresetPatternValTrellis: + attr.Value = "trellis" + case ST_PresetPatternValZigZag: + attr.Value = "zigZag" + } + return attr, nil +} + +func (e *ST_PresetPatternVal) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "pct5": + *e = 1 + case "pct10": + *e = 2 + case "pct20": + *e = 3 + case "pct25": + *e = 4 + case "pct30": + *e = 5 + case "pct40": + *e = 6 + case "pct50": + *e = 7 + case "pct60": + *e = 8 + case "pct70": + *e = 9 + case "pct75": + *e = 10 + case "pct80": + *e = 11 + case "pct90": + *e = 12 + case "horz": + *e = 13 + case "vert": + *e = 14 + case "ltHorz": + *e = 15 + case "ltVert": + *e = 16 + case "dkHorz": + *e = 17 + case "dkVert": + *e = 18 + case "narHorz": + *e = 19 + case "narVert": + *e = 20 + case "dashHorz": + *e = 21 + case "dashVert": + *e = 22 + case "cross": + *e = 23 + case "dnDiag": + *e = 24 + case "upDiag": + *e = 25 + case "ltDnDiag": + *e = 26 + case "ltUpDiag": + *e = 27 + case "dkDnDiag": + *e = 28 + case "dkUpDiag": + *e = 29 + case "wdDnDiag": + *e = 30 + case "wdUpDiag": + *e = 31 + case "dashDnDiag": + *e = 32 + case "dashUpDiag": + *e = 33 + case "diagCross": + *e = 34 + case "smCheck": + *e = 35 + case "lgCheck": + *e = 36 + case "smGrid": + *e = 37 + case "lgGrid": + *e = 38 + case "dotGrid": + *e = 39 + case "smConfetti": + *e = 40 + case "lgConfetti": + *e = 41 + case "horzBrick": + *e = 42 + case "diagBrick": + *e = 43 + case "solidDmnd": + *e = 44 + case "openDmnd": + *e = 45 + case "dotDmnd": + *e = 46 + case "plaid": + *e = 47 + case "sphere": + *e = 48 + case "weave": + *e = 49 + case "divot": + *e = 50 + case "shingle": + *e = 51 + case "wave": + *e = 52 + case "trellis": + *e = 53 + case "zigZag": + *e = 54 + } + return nil +} + +func (m ST_PresetPatternVal) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_PresetPatternVal) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "pct5": + *m = 1 + case "pct10": + *m = 2 + case "pct20": + *m = 3 + case "pct25": + *m = 4 + case "pct30": + *m = 5 + case "pct40": + *m = 6 + case "pct50": + *m = 7 + case "pct60": + *m = 8 + case "pct70": + *m = 9 + case "pct75": + *m = 10 + case "pct80": + *m = 11 + case "pct90": + *m = 12 + case "horz": + *m = 13 + case "vert": + *m = 14 + case "ltHorz": + *m = 15 + case "ltVert": + *m = 16 + case "dkHorz": + *m = 17 + case "dkVert": + *m = 18 + case "narHorz": + *m = 19 + case "narVert": + *m = 20 + case "dashHorz": + *m = 21 + case "dashVert": + *m = 22 + case "cross": + *m = 23 + case "dnDiag": + *m = 24 + case "upDiag": + *m = 25 + case "ltDnDiag": + *m = 26 + case "ltUpDiag": + *m = 27 + case "dkDnDiag": + *m = 28 + case "dkUpDiag": + *m = 29 + case "wdDnDiag": + *m = 30 + case "wdUpDiag": + *m = 31 + case "dashDnDiag": + *m = 32 + case "dashUpDiag": + *m = 33 + case "diagCross": + *m = 34 + case "smCheck": + *m = 35 + case "lgCheck": + *m = 36 + case "smGrid": + *m = 37 + case "lgGrid": + *m = 38 + case "dotGrid": + *m = 39 + case "smConfetti": + *m = 40 + case "lgConfetti": + *m = 41 + case "horzBrick": + *m = 42 + case "diagBrick": + *m = 43 + case "solidDmnd": + *m = 44 + case "openDmnd": + *m = 45 + case "dotDmnd": + *m = 46 + case "plaid": + *m = 47 + case "sphere": + *m = 48 + case "weave": + *m = 49 + case "divot": + *m = 50 + case "shingle": + *m = 51 + case "wave": + *m = 52 + case "trellis": + *m = 53 + case "zigZag": + *m = 54 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_PresetPatternVal) String() string { + switch m { + case 0: + return "" + case 1: + return "pct5" + case 2: + return "pct10" + case 3: + return "pct20" + case 4: + return "pct25" + case 5: + return "pct30" + case 6: + return "pct40" + case 7: + return "pct50" + case 8: + return "pct60" + case 9: + return "pct70" + case 10: + return "pct75" + case 11: + return "pct80" + case 12: + return "pct90" + case 13: + return "horz" + case 14: + return "vert" + case 15: + return "ltHorz" + case 16: + return "ltVert" + case 17: + return "dkHorz" + case 18: + return "dkVert" + case 19: + return "narHorz" + case 20: + return "narVert" + case 21: + return "dashHorz" + case 22: + return "dashVert" + case 23: + return "cross" + case 24: + return "dnDiag" + case 25: + return "upDiag" + case 26: + return "ltDnDiag" + case 27: + return "ltUpDiag" + case 28: + return "dkDnDiag" + case 29: + return "dkUpDiag" + case 30: + return "wdDnDiag" + case 31: + return "wdUpDiag" + case 32: + return "dashDnDiag" + case 33: + return "dashUpDiag" + case 34: + return "diagCross" + case 35: + return "smCheck" + case 36: + return "lgCheck" + case 37: + return "smGrid" + case 38: + return "lgGrid" + case 39: + return "dotGrid" + case 40: + return "smConfetti" + case 41: + return "lgConfetti" + case 42: + return "horzBrick" + case 43: + return "diagBrick" + case 44: + return "solidDmnd" + case 45: + return "openDmnd" + case 46: + return "dotDmnd" + case 47: + return "plaid" + case 48: + return "sphere" + case 49: + return "weave" + case 50: + return "divot" + case 51: + return "shingle" + case 52: + return "wave" + case 53: + return "trellis" + case 54: + return "zigZag" + } + return "" +} + +func (m ST_PresetPatternVal) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_PresetPatternVal) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_BlendMode byte + +const ( + ST_BlendModeUnset ST_BlendMode = 0 + ST_BlendModeOver ST_BlendMode = 1 + ST_BlendModeMult ST_BlendMode = 2 + ST_BlendModeScreen ST_BlendMode = 3 + ST_BlendModeDarken ST_BlendMode = 4 + ST_BlendModeLighten ST_BlendMode = 5 +) + +func (e ST_BlendMode) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_BlendModeUnset: + attr.Value = "" + case ST_BlendModeOver: + attr.Value = "over" + case ST_BlendModeMult: + attr.Value = "mult" + case ST_BlendModeScreen: + attr.Value = "screen" + case ST_BlendModeDarken: + attr.Value = "darken" + case ST_BlendModeLighten: + attr.Value = "lighten" + } + return attr, nil +} + +func (e *ST_BlendMode) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "over": + *e = 1 + case "mult": + *e = 2 + case "screen": + *e = 3 + case "darken": + *e = 4 + case "lighten": + *e = 5 + } + return nil +} + +func (m ST_BlendMode) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_BlendMode) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "over": + *m = 1 + case "mult": + *m = 2 + case "screen": + *m = 3 + case "darken": + *m = 4 + case "lighten": + *m = 5 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_BlendMode) String() string { + switch m { + case 0: + return "" + case 1: + return "over" + case 2: + return "mult" + case 3: + return "screen" + case 4: + return "darken" + case 5: + return "lighten" + } + return "" +} + +func (m ST_BlendMode) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_BlendMode) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_EffectContainerType byte + +const ( + ST_EffectContainerTypeUnset ST_EffectContainerType = 0 + ST_EffectContainerTypeSib ST_EffectContainerType = 1 + ST_EffectContainerTypeTree ST_EffectContainerType = 2 +) + +func (e ST_EffectContainerType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_EffectContainerTypeUnset: + attr.Value = "" + case ST_EffectContainerTypeSib: + attr.Value = "sib" + case ST_EffectContainerTypeTree: + attr.Value = "tree" + } + return attr, nil +} + +func (e *ST_EffectContainerType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "sib": + *e = 1 + case "tree": + *e = 2 + } + return nil +} + +func (m ST_EffectContainerType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_EffectContainerType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "sib": + *m = 1 + case "tree": + *m = 2 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_EffectContainerType) String() string { + switch m { + case 0: + return "" + case 1: + return "sib" + case 2: + return "tree" + } + return "" +} + +func (m ST_EffectContainerType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_EffectContainerType) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_ShapeType byte + +const ( + ST_ShapeTypeUnset ST_ShapeType = 0 + ST_ShapeTypeLine ST_ShapeType = 1 + ST_ShapeTypeLineInv ST_ShapeType = 2 + ST_ShapeTypeTriangle ST_ShapeType = 3 + ST_ShapeTypeRtTriangle ST_ShapeType = 4 + ST_ShapeTypeRect ST_ShapeType = 5 + ST_ShapeTypeDiamond ST_ShapeType = 6 + ST_ShapeTypeParallelogram ST_ShapeType = 7 + ST_ShapeTypeTrapezoid ST_ShapeType = 8 + ST_ShapeTypeNonIsoscelesTrapezoid ST_ShapeType = 9 + ST_ShapeTypePentagon ST_ShapeType = 10 + ST_ShapeTypeHexagon ST_ShapeType = 11 + ST_ShapeTypeHeptagon ST_ShapeType = 12 + ST_ShapeTypeOctagon ST_ShapeType = 13 + ST_ShapeTypeDecagon ST_ShapeType = 14 + ST_ShapeTypeDodecagon ST_ShapeType = 15 + ST_ShapeTypeStar4 ST_ShapeType = 16 + ST_ShapeTypeStar5 ST_ShapeType = 17 + ST_ShapeTypeStar6 ST_ShapeType = 18 + ST_ShapeTypeStar7 ST_ShapeType = 19 + ST_ShapeTypeStar8 ST_ShapeType = 20 + ST_ShapeTypeStar10 ST_ShapeType = 21 + ST_ShapeTypeStar12 ST_ShapeType = 22 + ST_ShapeTypeStar16 ST_ShapeType = 23 + ST_ShapeTypeStar24 ST_ShapeType = 24 + ST_ShapeTypeStar32 ST_ShapeType = 25 + ST_ShapeTypeRoundRect ST_ShapeType = 26 + ST_ShapeTypeRound1Rect ST_ShapeType = 27 + ST_ShapeTypeRound2SameRect ST_ShapeType = 28 + ST_ShapeTypeRound2DiagRect ST_ShapeType = 29 + ST_ShapeTypeSnipRoundRect ST_ShapeType = 30 + ST_ShapeTypeSnip1Rect ST_ShapeType = 31 + ST_ShapeTypeSnip2SameRect ST_ShapeType = 32 + ST_ShapeTypeSnip2DiagRect ST_ShapeType = 33 + ST_ShapeTypePlaque ST_ShapeType = 34 + ST_ShapeTypeEllipse ST_ShapeType = 35 + ST_ShapeTypeTeardrop ST_ShapeType = 36 + ST_ShapeTypeHomePlate ST_ShapeType = 37 + ST_ShapeTypeChevron ST_ShapeType = 38 + ST_ShapeTypePieWedge ST_ShapeType = 39 + ST_ShapeTypePie ST_ShapeType = 40 + ST_ShapeTypeBlockArc ST_ShapeType = 41 + ST_ShapeTypeDonut ST_ShapeType = 42 + ST_ShapeTypeNoSmoking ST_ShapeType = 43 + ST_ShapeTypeRightArrow ST_ShapeType = 44 + ST_ShapeTypeLeftArrow ST_ShapeType = 45 + ST_ShapeTypeUpArrow ST_ShapeType = 46 + ST_ShapeTypeDownArrow ST_ShapeType = 47 + ST_ShapeTypeStripedRightArrow ST_ShapeType = 48 + ST_ShapeTypeNotchedRightArrow ST_ShapeType = 49 + ST_ShapeTypeBentUpArrow ST_ShapeType = 50 + ST_ShapeTypeLeftRightArrow ST_ShapeType = 51 + ST_ShapeTypeUpDownArrow ST_ShapeType = 52 + ST_ShapeTypeLeftUpArrow ST_ShapeType = 53 + ST_ShapeTypeLeftRightUpArrow ST_ShapeType = 54 + ST_ShapeTypeQuadArrow ST_ShapeType = 55 + ST_ShapeTypeLeftArrowCallout ST_ShapeType = 56 + ST_ShapeTypeRightArrowCallout ST_ShapeType = 57 + ST_ShapeTypeUpArrowCallout ST_ShapeType = 58 + ST_ShapeTypeDownArrowCallout ST_ShapeType = 59 + ST_ShapeTypeLeftRightArrowCallout ST_ShapeType = 60 + ST_ShapeTypeUpDownArrowCallout ST_ShapeType = 61 + ST_ShapeTypeQuadArrowCallout ST_ShapeType = 62 + ST_ShapeTypeBentArrow ST_ShapeType = 63 + ST_ShapeTypeUturnArrow ST_ShapeType = 64 + ST_ShapeTypeCircularArrow ST_ShapeType = 65 + ST_ShapeTypeLeftCircularArrow ST_ShapeType = 66 + ST_ShapeTypeLeftRightCircularArrow ST_ShapeType = 67 + ST_ShapeTypeCurvedRightArrow ST_ShapeType = 68 + ST_ShapeTypeCurvedLeftArrow ST_ShapeType = 69 + ST_ShapeTypeCurvedUpArrow ST_ShapeType = 70 + ST_ShapeTypeCurvedDownArrow ST_ShapeType = 71 + ST_ShapeTypeSwooshArrow ST_ShapeType = 72 + ST_ShapeTypeCube ST_ShapeType = 73 + ST_ShapeTypeCan ST_ShapeType = 74 + ST_ShapeTypeLightningBolt ST_ShapeType = 75 + ST_ShapeTypeHeart ST_ShapeType = 76 + ST_ShapeTypeSun ST_ShapeType = 77 + ST_ShapeTypeMoon ST_ShapeType = 78 + ST_ShapeTypeSmileyFace ST_ShapeType = 79 + ST_ShapeTypeIrregularSeal1 ST_ShapeType = 80 + ST_ShapeTypeIrregularSeal2 ST_ShapeType = 81 + ST_ShapeTypeFoldedCorner ST_ShapeType = 82 + ST_ShapeTypeBevel ST_ShapeType = 83 + ST_ShapeTypeFrame ST_ShapeType = 84 + ST_ShapeTypeHalfFrame ST_ShapeType = 85 + ST_ShapeTypeCorner ST_ShapeType = 86 + ST_ShapeTypeDiagStripe ST_ShapeType = 87 + ST_ShapeTypeChord ST_ShapeType = 88 + ST_ShapeTypeArc ST_ShapeType = 89 + ST_ShapeTypeLeftBracket ST_ShapeType = 90 + ST_ShapeTypeRightBracket ST_ShapeType = 91 + ST_ShapeTypeLeftBrace ST_ShapeType = 92 + ST_ShapeTypeRightBrace ST_ShapeType = 93 + ST_ShapeTypeBracketPair ST_ShapeType = 94 + ST_ShapeTypeBracePair ST_ShapeType = 95 + ST_ShapeTypeStraightConnector1 ST_ShapeType = 96 + ST_ShapeTypeBentConnector2 ST_ShapeType = 97 + ST_ShapeTypeBentConnector3 ST_ShapeType = 98 + ST_ShapeTypeBentConnector4 ST_ShapeType = 99 + ST_ShapeTypeBentConnector5 ST_ShapeType = 100 + ST_ShapeTypeCurvedConnector2 ST_ShapeType = 101 + ST_ShapeTypeCurvedConnector3 ST_ShapeType = 102 + ST_ShapeTypeCurvedConnector4 ST_ShapeType = 103 + ST_ShapeTypeCurvedConnector5 ST_ShapeType = 104 + ST_ShapeTypeCallout1 ST_ShapeType = 105 + ST_ShapeTypeCallout2 ST_ShapeType = 106 + ST_ShapeTypeCallout3 ST_ShapeType = 107 + ST_ShapeTypeAccentCallout1 ST_ShapeType = 108 + ST_ShapeTypeAccentCallout2 ST_ShapeType = 109 + ST_ShapeTypeAccentCallout3 ST_ShapeType = 110 + ST_ShapeTypeBorderCallout1 ST_ShapeType = 111 + ST_ShapeTypeBorderCallout2 ST_ShapeType = 112 + ST_ShapeTypeBorderCallout3 ST_ShapeType = 113 + ST_ShapeTypeAccentBorderCallout1 ST_ShapeType = 114 + ST_ShapeTypeAccentBorderCallout2 ST_ShapeType = 115 + ST_ShapeTypeAccentBorderCallout3 ST_ShapeType = 116 + ST_ShapeTypeWedgeRectCallout ST_ShapeType = 117 + ST_ShapeTypeWedgeRoundRectCallout ST_ShapeType = 118 + ST_ShapeTypeWedgeEllipseCallout ST_ShapeType = 119 + ST_ShapeTypeCloudCallout ST_ShapeType = 120 + ST_ShapeTypeCloud ST_ShapeType = 121 + ST_ShapeTypeRibbon ST_ShapeType = 122 + ST_ShapeTypeRibbon2 ST_ShapeType = 123 + ST_ShapeTypeEllipseRibbon ST_ShapeType = 124 + ST_ShapeTypeEllipseRibbon2 ST_ShapeType = 125 + ST_ShapeTypeLeftRightRibbon ST_ShapeType = 126 + ST_ShapeTypeVerticalScroll ST_ShapeType = 127 + ST_ShapeTypeHorizontalScroll ST_ShapeType = 128 + ST_ShapeTypeWave ST_ShapeType = 129 + ST_ShapeTypeDoubleWave ST_ShapeType = 130 + ST_ShapeTypePlus ST_ShapeType = 131 + ST_ShapeTypeFlowChartProcess ST_ShapeType = 132 + ST_ShapeTypeFlowChartDecision ST_ShapeType = 133 + ST_ShapeTypeFlowChartInputOutput ST_ShapeType = 134 + ST_ShapeTypeFlowChartPredefinedProcess ST_ShapeType = 135 + ST_ShapeTypeFlowChartInternalStorage ST_ShapeType = 136 + ST_ShapeTypeFlowChartDocument ST_ShapeType = 137 + ST_ShapeTypeFlowChartMultidocument ST_ShapeType = 138 + ST_ShapeTypeFlowChartTerminator ST_ShapeType = 139 + ST_ShapeTypeFlowChartPreparation ST_ShapeType = 140 + ST_ShapeTypeFlowChartManualInput ST_ShapeType = 141 + ST_ShapeTypeFlowChartManualOperation ST_ShapeType = 142 + ST_ShapeTypeFlowChartConnector ST_ShapeType = 143 + ST_ShapeTypeFlowChartPunchedCard ST_ShapeType = 144 + ST_ShapeTypeFlowChartPunchedTape ST_ShapeType = 145 + ST_ShapeTypeFlowChartSummingJunction ST_ShapeType = 146 + ST_ShapeTypeFlowChartOr ST_ShapeType = 147 + ST_ShapeTypeFlowChartCollate ST_ShapeType = 148 + ST_ShapeTypeFlowChartSort ST_ShapeType = 149 + ST_ShapeTypeFlowChartExtract ST_ShapeType = 150 + ST_ShapeTypeFlowChartMerge ST_ShapeType = 151 + ST_ShapeTypeFlowChartOfflineStorage ST_ShapeType = 152 + ST_ShapeTypeFlowChartOnlineStorage ST_ShapeType = 153 + ST_ShapeTypeFlowChartMagneticTape ST_ShapeType = 154 + ST_ShapeTypeFlowChartMagneticDisk ST_ShapeType = 155 + ST_ShapeTypeFlowChartMagneticDrum ST_ShapeType = 156 + ST_ShapeTypeFlowChartDisplay ST_ShapeType = 157 + ST_ShapeTypeFlowChartDelay ST_ShapeType = 158 + ST_ShapeTypeFlowChartAlternateProcess ST_ShapeType = 159 + ST_ShapeTypeFlowChartOffpageConnector ST_ShapeType = 160 + ST_ShapeTypeActionButtonBlank ST_ShapeType = 161 + ST_ShapeTypeActionButtonHome ST_ShapeType = 162 + ST_ShapeTypeActionButtonHelp ST_ShapeType = 163 + ST_ShapeTypeActionButtonInformation ST_ShapeType = 164 + ST_ShapeTypeActionButtonForwardNext ST_ShapeType = 165 + ST_ShapeTypeActionButtonBackPrevious ST_ShapeType = 166 + ST_ShapeTypeActionButtonEnd ST_ShapeType = 167 + ST_ShapeTypeActionButtonBeginning ST_ShapeType = 168 + ST_ShapeTypeActionButtonReturn ST_ShapeType = 169 + ST_ShapeTypeActionButtonDocument ST_ShapeType = 170 + ST_ShapeTypeActionButtonSound ST_ShapeType = 171 + ST_ShapeTypeActionButtonMovie ST_ShapeType = 172 + ST_ShapeTypeGear6 ST_ShapeType = 173 + ST_ShapeTypeGear9 ST_ShapeType = 174 + ST_ShapeTypeFunnel ST_ShapeType = 175 + ST_ShapeTypeMathPlus ST_ShapeType = 176 + ST_ShapeTypeMathMinus ST_ShapeType = 177 + ST_ShapeTypeMathMultiply ST_ShapeType = 178 + ST_ShapeTypeMathDivide ST_ShapeType = 179 + ST_ShapeTypeMathEqual ST_ShapeType = 180 + ST_ShapeTypeMathNotEqual ST_ShapeType = 181 + ST_ShapeTypeCornerTabs ST_ShapeType = 182 + ST_ShapeTypeSquareTabs ST_ShapeType = 183 + ST_ShapeTypePlaqueTabs ST_ShapeType = 184 + ST_ShapeTypeChartX ST_ShapeType = 185 + ST_ShapeTypeChartStar ST_ShapeType = 186 + ST_ShapeTypeChartPlus ST_ShapeType = 187 +) + +func (e ST_ShapeType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_ShapeTypeUnset: + attr.Value = "" + case ST_ShapeTypeLine: + attr.Value = "line" + case ST_ShapeTypeLineInv: + attr.Value = "lineInv" + case ST_ShapeTypeTriangle: + attr.Value = "triangle" + case ST_ShapeTypeRtTriangle: + attr.Value = "rtTriangle" + case ST_ShapeTypeRect: + attr.Value = "rect" + case ST_ShapeTypeDiamond: + attr.Value = "diamond" + case ST_ShapeTypeParallelogram: + attr.Value = "parallelogram" + case ST_ShapeTypeTrapezoid: + attr.Value = "trapezoid" + case ST_ShapeTypeNonIsoscelesTrapezoid: + attr.Value = "nonIsoscelesTrapezoid" + case ST_ShapeTypePentagon: + attr.Value = "pentagon" + case ST_ShapeTypeHexagon: + attr.Value = "hexagon" + case ST_ShapeTypeHeptagon: + attr.Value = "heptagon" + case ST_ShapeTypeOctagon: + attr.Value = "octagon" + case ST_ShapeTypeDecagon: + attr.Value = "decagon" + case ST_ShapeTypeDodecagon: + attr.Value = "dodecagon" + case ST_ShapeTypeStar4: + attr.Value = "star4" + case ST_ShapeTypeStar5: + attr.Value = "star5" + case ST_ShapeTypeStar6: + attr.Value = "star6" + case ST_ShapeTypeStar7: + attr.Value = "star7" + case ST_ShapeTypeStar8: + attr.Value = "star8" + case ST_ShapeTypeStar10: + attr.Value = "star10" + case ST_ShapeTypeStar12: + attr.Value = "star12" + case ST_ShapeTypeStar16: + attr.Value = "star16" + case ST_ShapeTypeStar24: + attr.Value = "star24" + case ST_ShapeTypeStar32: + attr.Value = "star32" + case ST_ShapeTypeRoundRect: + attr.Value = "roundRect" + case ST_ShapeTypeRound1Rect: + attr.Value = "round1Rect" + case ST_ShapeTypeRound2SameRect: + attr.Value = "round2SameRect" + case ST_ShapeTypeRound2DiagRect: + attr.Value = "round2DiagRect" + case ST_ShapeTypeSnipRoundRect: + attr.Value = "snipRoundRect" + case ST_ShapeTypeSnip1Rect: + attr.Value = "snip1Rect" + case ST_ShapeTypeSnip2SameRect: + attr.Value = "snip2SameRect" + case ST_ShapeTypeSnip2DiagRect: + attr.Value = "snip2DiagRect" + case ST_ShapeTypePlaque: + attr.Value = "plaque" + case ST_ShapeTypeEllipse: + attr.Value = "ellipse" + case ST_ShapeTypeTeardrop: + attr.Value = "teardrop" + case ST_ShapeTypeHomePlate: + attr.Value = "homePlate" + case ST_ShapeTypeChevron: + attr.Value = "chevron" + case ST_ShapeTypePieWedge: + attr.Value = "pieWedge" + case ST_ShapeTypePie: + attr.Value = "pie" + case ST_ShapeTypeBlockArc: + attr.Value = "blockArc" + case ST_ShapeTypeDonut: + attr.Value = "donut" + case ST_ShapeTypeNoSmoking: + attr.Value = "noSmoking" + case ST_ShapeTypeRightArrow: + attr.Value = "rightArrow" + case ST_ShapeTypeLeftArrow: + attr.Value = "leftArrow" + case ST_ShapeTypeUpArrow: + attr.Value = "upArrow" + case ST_ShapeTypeDownArrow: + attr.Value = "downArrow" + case ST_ShapeTypeStripedRightArrow: + attr.Value = "stripedRightArrow" + case ST_ShapeTypeNotchedRightArrow: + attr.Value = "notchedRightArrow" + case ST_ShapeTypeBentUpArrow: + attr.Value = "bentUpArrow" + case ST_ShapeTypeLeftRightArrow: + attr.Value = "leftRightArrow" + case ST_ShapeTypeUpDownArrow: + attr.Value = "upDownArrow" + case ST_ShapeTypeLeftUpArrow: + attr.Value = "leftUpArrow" + case ST_ShapeTypeLeftRightUpArrow: + attr.Value = "leftRightUpArrow" + case ST_ShapeTypeQuadArrow: + attr.Value = "quadArrow" + case ST_ShapeTypeLeftArrowCallout: + attr.Value = "leftArrowCallout" + case ST_ShapeTypeRightArrowCallout: + attr.Value = "rightArrowCallout" + case ST_ShapeTypeUpArrowCallout: + attr.Value = "upArrowCallout" + case ST_ShapeTypeDownArrowCallout: + attr.Value = "downArrowCallout" + case ST_ShapeTypeLeftRightArrowCallout: + attr.Value = "leftRightArrowCallout" + case ST_ShapeTypeUpDownArrowCallout: + attr.Value = "upDownArrowCallout" + case ST_ShapeTypeQuadArrowCallout: + attr.Value = "quadArrowCallout" + case ST_ShapeTypeBentArrow: + attr.Value = "bentArrow" + case ST_ShapeTypeUturnArrow: + attr.Value = "uturnArrow" + case ST_ShapeTypeCircularArrow: + attr.Value = "circularArrow" + case ST_ShapeTypeLeftCircularArrow: + attr.Value = "leftCircularArrow" + case ST_ShapeTypeLeftRightCircularArrow: + attr.Value = "leftRightCircularArrow" + case ST_ShapeTypeCurvedRightArrow: + attr.Value = "curvedRightArrow" + case ST_ShapeTypeCurvedLeftArrow: + attr.Value = "curvedLeftArrow" + case ST_ShapeTypeCurvedUpArrow: + attr.Value = "curvedUpArrow" + case ST_ShapeTypeCurvedDownArrow: + attr.Value = "curvedDownArrow" + case ST_ShapeTypeSwooshArrow: + attr.Value = "swooshArrow" + case ST_ShapeTypeCube: + attr.Value = "cube" + case ST_ShapeTypeCan: + attr.Value = "can" + case ST_ShapeTypeLightningBolt: + attr.Value = "lightningBolt" + case ST_ShapeTypeHeart: + attr.Value = "heart" + case ST_ShapeTypeSun: + attr.Value = "sun" + case ST_ShapeTypeMoon: + attr.Value = "moon" + case ST_ShapeTypeSmileyFace: + attr.Value = "smileyFace" + case ST_ShapeTypeIrregularSeal1: + attr.Value = "irregularSeal1" + case ST_ShapeTypeIrregularSeal2: + attr.Value = "irregularSeal2" + case ST_ShapeTypeFoldedCorner: + attr.Value = "foldedCorner" + case ST_ShapeTypeBevel: + attr.Value = "bevel" + case ST_ShapeTypeFrame: + attr.Value = "frame" + case ST_ShapeTypeHalfFrame: + attr.Value = "halfFrame" + case ST_ShapeTypeCorner: + attr.Value = "corner" + case ST_ShapeTypeDiagStripe: + attr.Value = "diagStripe" + case ST_ShapeTypeChord: + attr.Value = "chord" + case ST_ShapeTypeArc: + attr.Value = "arc" + case ST_ShapeTypeLeftBracket: + attr.Value = "leftBracket" + case ST_ShapeTypeRightBracket: + attr.Value = "rightBracket" + case ST_ShapeTypeLeftBrace: + attr.Value = "leftBrace" + case ST_ShapeTypeRightBrace: + attr.Value = "rightBrace" + case ST_ShapeTypeBracketPair: + attr.Value = "bracketPair" + case ST_ShapeTypeBracePair: + attr.Value = "bracePair" + case ST_ShapeTypeStraightConnector1: + attr.Value = "straightConnector1" + case ST_ShapeTypeBentConnector2: + attr.Value = "bentConnector2" + case ST_ShapeTypeBentConnector3: + attr.Value = "bentConnector3" + case ST_ShapeTypeBentConnector4: + attr.Value = "bentConnector4" + case ST_ShapeTypeBentConnector5: + attr.Value = "bentConnector5" + case ST_ShapeTypeCurvedConnector2: + attr.Value = "curvedConnector2" + case ST_ShapeTypeCurvedConnector3: + attr.Value = "curvedConnector3" + case ST_ShapeTypeCurvedConnector4: + attr.Value = "curvedConnector4" + case ST_ShapeTypeCurvedConnector5: + attr.Value = "curvedConnector5" + case ST_ShapeTypeCallout1: + attr.Value = "callout1" + case ST_ShapeTypeCallout2: + attr.Value = "callout2" + case ST_ShapeTypeCallout3: + attr.Value = "callout3" + case ST_ShapeTypeAccentCallout1: + attr.Value = "accentCallout1" + case ST_ShapeTypeAccentCallout2: + attr.Value = "accentCallout2" + case ST_ShapeTypeAccentCallout3: + attr.Value = "accentCallout3" + case ST_ShapeTypeBorderCallout1: + attr.Value = "borderCallout1" + case ST_ShapeTypeBorderCallout2: + attr.Value = "borderCallout2" + case ST_ShapeTypeBorderCallout3: + attr.Value = "borderCallout3" + case ST_ShapeTypeAccentBorderCallout1: + attr.Value = "accentBorderCallout1" + case ST_ShapeTypeAccentBorderCallout2: + attr.Value = "accentBorderCallout2" + case ST_ShapeTypeAccentBorderCallout3: + attr.Value = "accentBorderCallout3" + case ST_ShapeTypeWedgeRectCallout: + attr.Value = "wedgeRectCallout" + case ST_ShapeTypeWedgeRoundRectCallout: + attr.Value = "wedgeRoundRectCallout" + case ST_ShapeTypeWedgeEllipseCallout: + attr.Value = "wedgeEllipseCallout" + case ST_ShapeTypeCloudCallout: + attr.Value = "cloudCallout" + case ST_ShapeTypeCloud: + attr.Value = "cloud" + case ST_ShapeTypeRibbon: + attr.Value = "ribbon" + case ST_ShapeTypeRibbon2: + attr.Value = "ribbon2" + case ST_ShapeTypeEllipseRibbon: + attr.Value = "ellipseRibbon" + case ST_ShapeTypeEllipseRibbon2: + attr.Value = "ellipseRibbon2" + case ST_ShapeTypeLeftRightRibbon: + attr.Value = "leftRightRibbon" + case ST_ShapeTypeVerticalScroll: + attr.Value = "verticalScroll" + case ST_ShapeTypeHorizontalScroll: + attr.Value = "horizontalScroll" + case ST_ShapeTypeWave: + attr.Value = "wave" + case ST_ShapeTypeDoubleWave: + attr.Value = "doubleWave" + case ST_ShapeTypePlus: + attr.Value = "plus" + case ST_ShapeTypeFlowChartProcess: + attr.Value = "flowChartProcess" + case ST_ShapeTypeFlowChartDecision: + attr.Value = "flowChartDecision" + case ST_ShapeTypeFlowChartInputOutput: + attr.Value = "flowChartInputOutput" + case ST_ShapeTypeFlowChartPredefinedProcess: + attr.Value = "flowChartPredefinedProcess" + case ST_ShapeTypeFlowChartInternalStorage: + attr.Value = "flowChartInternalStorage" + case ST_ShapeTypeFlowChartDocument: + attr.Value = "flowChartDocument" + case ST_ShapeTypeFlowChartMultidocument: + attr.Value = "flowChartMultidocument" + case ST_ShapeTypeFlowChartTerminator: + attr.Value = "flowChartTerminator" + case ST_ShapeTypeFlowChartPreparation: + attr.Value = "flowChartPreparation" + case ST_ShapeTypeFlowChartManualInput: + attr.Value = "flowChartManualInput" + case ST_ShapeTypeFlowChartManualOperation: + attr.Value = "flowChartManualOperation" + case ST_ShapeTypeFlowChartConnector: + attr.Value = "flowChartConnector" + case ST_ShapeTypeFlowChartPunchedCard: + attr.Value = "flowChartPunchedCard" + case ST_ShapeTypeFlowChartPunchedTape: + attr.Value = "flowChartPunchedTape" + case ST_ShapeTypeFlowChartSummingJunction: + attr.Value = "flowChartSummingJunction" + case ST_ShapeTypeFlowChartOr: + attr.Value = "flowChartOr" + case ST_ShapeTypeFlowChartCollate: + attr.Value = "flowChartCollate" + case ST_ShapeTypeFlowChartSort: + attr.Value = "flowChartSort" + case ST_ShapeTypeFlowChartExtract: + attr.Value = "flowChartExtract" + case ST_ShapeTypeFlowChartMerge: + attr.Value = "flowChartMerge" + case ST_ShapeTypeFlowChartOfflineStorage: + attr.Value = "flowChartOfflineStorage" + case ST_ShapeTypeFlowChartOnlineStorage: + attr.Value = "flowChartOnlineStorage" + case ST_ShapeTypeFlowChartMagneticTape: + attr.Value = "flowChartMagneticTape" + case ST_ShapeTypeFlowChartMagneticDisk: + attr.Value = "flowChartMagneticDisk" + case ST_ShapeTypeFlowChartMagneticDrum: + attr.Value = "flowChartMagneticDrum" + case ST_ShapeTypeFlowChartDisplay: + attr.Value = "flowChartDisplay" + case ST_ShapeTypeFlowChartDelay: + attr.Value = "flowChartDelay" + case ST_ShapeTypeFlowChartAlternateProcess: + attr.Value = "flowChartAlternateProcess" + case ST_ShapeTypeFlowChartOffpageConnector: + attr.Value = "flowChartOffpageConnector" + case ST_ShapeTypeActionButtonBlank: + attr.Value = "actionButtonBlank" + case ST_ShapeTypeActionButtonHome: + attr.Value = "actionButtonHome" + case ST_ShapeTypeActionButtonHelp: + attr.Value = "actionButtonHelp" + case ST_ShapeTypeActionButtonInformation: + attr.Value = "actionButtonInformation" + case ST_ShapeTypeActionButtonForwardNext: + attr.Value = "actionButtonForwardNext" + case ST_ShapeTypeActionButtonBackPrevious: + attr.Value = "actionButtonBackPrevious" + case ST_ShapeTypeActionButtonEnd: + attr.Value = "actionButtonEnd" + case ST_ShapeTypeActionButtonBeginning: + attr.Value = "actionButtonBeginning" + case ST_ShapeTypeActionButtonReturn: + attr.Value = "actionButtonReturn" + case ST_ShapeTypeActionButtonDocument: + attr.Value = "actionButtonDocument" + case ST_ShapeTypeActionButtonSound: + attr.Value = "actionButtonSound" + case ST_ShapeTypeActionButtonMovie: + attr.Value = "actionButtonMovie" + case ST_ShapeTypeGear6: + attr.Value = "gear6" + case ST_ShapeTypeGear9: + attr.Value = "gear9" + case ST_ShapeTypeFunnel: + attr.Value = "funnel" + case ST_ShapeTypeMathPlus: + attr.Value = "mathPlus" + case ST_ShapeTypeMathMinus: + attr.Value = "mathMinus" + case ST_ShapeTypeMathMultiply: + attr.Value = "mathMultiply" + case ST_ShapeTypeMathDivide: + attr.Value = "mathDivide" + case ST_ShapeTypeMathEqual: + attr.Value = "mathEqual" + case ST_ShapeTypeMathNotEqual: + attr.Value = "mathNotEqual" + case ST_ShapeTypeCornerTabs: + attr.Value = "cornerTabs" + case ST_ShapeTypeSquareTabs: + attr.Value = "squareTabs" + case ST_ShapeTypePlaqueTabs: + attr.Value = "plaqueTabs" + case ST_ShapeTypeChartX: + attr.Value = "chartX" + case ST_ShapeTypeChartStar: + attr.Value = "chartStar" + case ST_ShapeTypeChartPlus: + attr.Value = "chartPlus" + } + return attr, nil +} + +func (e *ST_ShapeType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "line": + *e = 1 + case "lineInv": + *e = 2 + case "triangle": + *e = 3 + case "rtTriangle": + *e = 4 + case "rect": + *e = 5 + case "diamond": + *e = 6 + case "parallelogram": + *e = 7 + case "trapezoid": + *e = 8 + case "nonIsoscelesTrapezoid": + *e = 9 + case "pentagon": + *e = 10 + case "hexagon": + *e = 11 + case "heptagon": + *e = 12 + case "octagon": + *e = 13 + case "decagon": + *e = 14 + case "dodecagon": + *e = 15 + case "star4": + *e = 16 + case "star5": + *e = 17 + case "star6": + *e = 18 + case "star7": + *e = 19 + case "star8": + *e = 20 + case "star10": + *e = 21 + case "star12": + *e = 22 + case "star16": + *e = 23 + case "star24": + *e = 24 + case "star32": + *e = 25 + case "roundRect": + *e = 26 + case "round1Rect": + *e = 27 + case "round2SameRect": + *e = 28 + case "round2DiagRect": + *e = 29 + case "snipRoundRect": + *e = 30 + case "snip1Rect": + *e = 31 + case "snip2SameRect": + *e = 32 + case "snip2DiagRect": + *e = 33 + case "plaque": + *e = 34 + case "ellipse": + *e = 35 + case "teardrop": + *e = 36 + case "homePlate": + *e = 37 + case "chevron": + *e = 38 + case "pieWedge": + *e = 39 + case "pie": + *e = 40 + case "blockArc": + *e = 41 + case "donut": + *e = 42 + case "noSmoking": + *e = 43 + case "rightArrow": + *e = 44 + case "leftArrow": + *e = 45 + case "upArrow": + *e = 46 + case "downArrow": + *e = 47 + case "stripedRightArrow": + *e = 48 + case "notchedRightArrow": + *e = 49 + case "bentUpArrow": + *e = 50 + case "leftRightArrow": + *e = 51 + case "upDownArrow": + *e = 52 + case "leftUpArrow": + *e = 53 + case "leftRightUpArrow": + *e = 54 + case "quadArrow": + *e = 55 + case "leftArrowCallout": + *e = 56 + case "rightArrowCallout": + *e = 57 + case "upArrowCallout": + *e = 58 + case "downArrowCallout": + *e = 59 + case "leftRightArrowCallout": + *e = 60 + case "upDownArrowCallout": + *e = 61 + case "quadArrowCallout": + *e = 62 + case "bentArrow": + *e = 63 + case "uturnArrow": + *e = 64 + case "circularArrow": + *e = 65 + case "leftCircularArrow": + *e = 66 + case "leftRightCircularArrow": + *e = 67 + case "curvedRightArrow": + *e = 68 + case "curvedLeftArrow": + *e = 69 + case "curvedUpArrow": + *e = 70 + case "curvedDownArrow": + *e = 71 + case "swooshArrow": + *e = 72 + case "cube": + *e = 73 + case "can": + *e = 74 + case "lightningBolt": + *e = 75 + case "heart": + *e = 76 + case "sun": + *e = 77 + case "moon": + *e = 78 + case "smileyFace": + *e = 79 + case "irregularSeal1": + *e = 80 + case "irregularSeal2": + *e = 81 + case "foldedCorner": + *e = 82 + case "bevel": + *e = 83 + case "frame": + *e = 84 + case "halfFrame": + *e = 85 + case "corner": + *e = 86 + case "diagStripe": + *e = 87 + case "chord": + *e = 88 + case "arc": + *e = 89 + case "leftBracket": + *e = 90 + case "rightBracket": + *e = 91 + case "leftBrace": + *e = 92 + case "rightBrace": + *e = 93 + case "bracketPair": + *e = 94 + case "bracePair": + *e = 95 + case "straightConnector1": + *e = 96 + case "bentConnector2": + *e = 97 + case "bentConnector3": + *e = 98 + case "bentConnector4": + *e = 99 + case "bentConnector5": + *e = 100 + case "curvedConnector2": + *e = 101 + case "curvedConnector3": + *e = 102 + case "curvedConnector4": + *e = 103 + case "curvedConnector5": + *e = 104 + case "callout1": + *e = 105 + case "callout2": + *e = 106 + case "callout3": + *e = 107 + case "accentCallout1": + *e = 108 + case "accentCallout2": + *e = 109 + case "accentCallout3": + *e = 110 + case "borderCallout1": + *e = 111 + case "borderCallout2": + *e = 112 + case "borderCallout3": + *e = 113 + case "accentBorderCallout1": + *e = 114 + case "accentBorderCallout2": + *e = 115 + case "accentBorderCallout3": + *e = 116 + case "wedgeRectCallout": + *e = 117 + case "wedgeRoundRectCallout": + *e = 118 + case "wedgeEllipseCallout": + *e = 119 + case "cloudCallout": + *e = 120 + case "cloud": + *e = 121 + case "ribbon": + *e = 122 + case "ribbon2": + *e = 123 + case "ellipseRibbon": + *e = 124 + case "ellipseRibbon2": + *e = 125 + case "leftRightRibbon": + *e = 126 + case "verticalScroll": + *e = 127 + case "horizontalScroll": + *e = 128 + case "wave": + *e = 129 + case "doubleWave": + *e = 130 + case "plus": + *e = 131 + case "flowChartProcess": + *e = 132 + case "flowChartDecision": + *e = 133 + case "flowChartInputOutput": + *e = 134 + case "flowChartPredefinedProcess": + *e = 135 + case "flowChartInternalStorage": + *e = 136 + case "flowChartDocument": + *e = 137 + case "flowChartMultidocument": + *e = 138 + case "flowChartTerminator": + *e = 139 + case "flowChartPreparation": + *e = 140 + case "flowChartManualInput": + *e = 141 + case "flowChartManualOperation": + *e = 142 + case "flowChartConnector": + *e = 143 + case "flowChartPunchedCard": + *e = 144 + case "flowChartPunchedTape": + *e = 145 + case "flowChartSummingJunction": + *e = 146 + case "flowChartOr": + *e = 147 + case "flowChartCollate": + *e = 148 + case "flowChartSort": + *e = 149 + case "flowChartExtract": + *e = 150 + case "flowChartMerge": + *e = 151 + case "flowChartOfflineStorage": + *e = 152 + case "flowChartOnlineStorage": + *e = 153 + case "flowChartMagneticTape": + *e = 154 + case "flowChartMagneticDisk": + *e = 155 + case "flowChartMagneticDrum": + *e = 156 + case "flowChartDisplay": + *e = 157 + case "flowChartDelay": + *e = 158 + case "flowChartAlternateProcess": + *e = 159 + case "flowChartOffpageConnector": + *e = 160 + case "actionButtonBlank": + *e = 161 + case "actionButtonHome": + *e = 162 + case "actionButtonHelp": + *e = 163 + case "actionButtonInformation": + *e = 164 + case "actionButtonForwardNext": + *e = 165 + case "actionButtonBackPrevious": + *e = 166 + case "actionButtonEnd": + *e = 167 + case "actionButtonBeginning": + *e = 168 + case "actionButtonReturn": + *e = 169 + case "actionButtonDocument": + *e = 170 + case "actionButtonSound": + *e = 171 + case "actionButtonMovie": + *e = 172 + case "gear6": + *e = 173 + case "gear9": + *e = 174 + case "funnel": + *e = 175 + case "mathPlus": + *e = 176 + case "mathMinus": + *e = 177 + case "mathMultiply": + *e = 178 + case "mathDivide": + *e = 179 + case "mathEqual": + *e = 180 + case "mathNotEqual": + *e = 181 + case "cornerTabs": + *e = 182 + case "squareTabs": + *e = 183 + case "plaqueTabs": + *e = 184 + case "chartX": + *e = 185 + case "chartStar": + *e = 186 + case "chartPlus": + *e = 187 + } + return nil +} + +func (m ST_ShapeType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_ShapeType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "line": + *m = 1 + case "lineInv": + *m = 2 + case "triangle": + *m = 3 + case "rtTriangle": + *m = 4 + case "rect": + *m = 5 + case "diamond": + *m = 6 + case "parallelogram": + *m = 7 + case "trapezoid": + *m = 8 + case "nonIsoscelesTrapezoid": + *m = 9 + case "pentagon": + *m = 10 + case "hexagon": + *m = 11 + case "heptagon": + *m = 12 + case "octagon": + *m = 13 + case "decagon": + *m = 14 + case "dodecagon": + *m = 15 + case "star4": + *m = 16 + case "star5": + *m = 17 + case "star6": + *m = 18 + case "star7": + *m = 19 + case "star8": + *m = 20 + case "star10": + *m = 21 + case "star12": + *m = 22 + case "star16": + *m = 23 + case "star24": + *m = 24 + case "star32": + *m = 25 + case "roundRect": + *m = 26 + case "round1Rect": + *m = 27 + case "round2SameRect": + *m = 28 + case "round2DiagRect": + *m = 29 + case "snipRoundRect": + *m = 30 + case "snip1Rect": + *m = 31 + case "snip2SameRect": + *m = 32 + case "snip2DiagRect": + *m = 33 + case "plaque": + *m = 34 + case "ellipse": + *m = 35 + case "teardrop": + *m = 36 + case "homePlate": + *m = 37 + case "chevron": + *m = 38 + case "pieWedge": + *m = 39 + case "pie": + *m = 40 + case "blockArc": + *m = 41 + case "donut": + *m = 42 + case "noSmoking": + *m = 43 + case "rightArrow": + *m = 44 + case "leftArrow": + *m = 45 + case "upArrow": + *m = 46 + case "downArrow": + *m = 47 + case "stripedRightArrow": + *m = 48 + case "notchedRightArrow": + *m = 49 + case "bentUpArrow": + *m = 50 + case "leftRightArrow": + *m = 51 + case "upDownArrow": + *m = 52 + case "leftUpArrow": + *m = 53 + case "leftRightUpArrow": + *m = 54 + case "quadArrow": + *m = 55 + case "leftArrowCallout": + *m = 56 + case "rightArrowCallout": + *m = 57 + case "upArrowCallout": + *m = 58 + case "downArrowCallout": + *m = 59 + case "leftRightArrowCallout": + *m = 60 + case "upDownArrowCallout": + *m = 61 + case "quadArrowCallout": + *m = 62 + case "bentArrow": + *m = 63 + case "uturnArrow": + *m = 64 + case "circularArrow": + *m = 65 + case "leftCircularArrow": + *m = 66 + case "leftRightCircularArrow": + *m = 67 + case "curvedRightArrow": + *m = 68 + case "curvedLeftArrow": + *m = 69 + case "curvedUpArrow": + *m = 70 + case "curvedDownArrow": + *m = 71 + case "swooshArrow": + *m = 72 + case "cube": + *m = 73 + case "can": + *m = 74 + case "lightningBolt": + *m = 75 + case "heart": + *m = 76 + case "sun": + *m = 77 + case "moon": + *m = 78 + case "smileyFace": + *m = 79 + case "irregularSeal1": + *m = 80 + case "irregularSeal2": + *m = 81 + case "foldedCorner": + *m = 82 + case "bevel": + *m = 83 + case "frame": + *m = 84 + case "halfFrame": + *m = 85 + case "corner": + *m = 86 + case "diagStripe": + *m = 87 + case "chord": + *m = 88 + case "arc": + *m = 89 + case "leftBracket": + *m = 90 + case "rightBracket": + *m = 91 + case "leftBrace": + *m = 92 + case "rightBrace": + *m = 93 + case "bracketPair": + *m = 94 + case "bracePair": + *m = 95 + case "straightConnector1": + *m = 96 + case "bentConnector2": + *m = 97 + case "bentConnector3": + *m = 98 + case "bentConnector4": + *m = 99 + case "bentConnector5": + *m = 100 + case "curvedConnector2": + *m = 101 + case "curvedConnector3": + *m = 102 + case "curvedConnector4": + *m = 103 + case "curvedConnector5": + *m = 104 + case "callout1": + *m = 105 + case "callout2": + *m = 106 + case "callout3": + *m = 107 + case "accentCallout1": + *m = 108 + case "accentCallout2": + *m = 109 + case "accentCallout3": + *m = 110 + case "borderCallout1": + *m = 111 + case "borderCallout2": + *m = 112 + case "borderCallout3": + *m = 113 + case "accentBorderCallout1": + *m = 114 + case "accentBorderCallout2": + *m = 115 + case "accentBorderCallout3": + *m = 116 + case "wedgeRectCallout": + *m = 117 + case "wedgeRoundRectCallout": + *m = 118 + case "wedgeEllipseCallout": + *m = 119 + case "cloudCallout": + *m = 120 + case "cloud": + *m = 121 + case "ribbon": + *m = 122 + case "ribbon2": + *m = 123 + case "ellipseRibbon": + *m = 124 + case "ellipseRibbon2": + *m = 125 + case "leftRightRibbon": + *m = 126 + case "verticalScroll": + *m = 127 + case "horizontalScroll": + *m = 128 + case "wave": + *m = 129 + case "doubleWave": + *m = 130 + case "plus": + *m = 131 + case "flowChartProcess": + *m = 132 + case "flowChartDecision": + *m = 133 + case "flowChartInputOutput": + *m = 134 + case "flowChartPredefinedProcess": + *m = 135 + case "flowChartInternalStorage": + *m = 136 + case "flowChartDocument": + *m = 137 + case "flowChartMultidocument": + *m = 138 + case "flowChartTerminator": + *m = 139 + case "flowChartPreparation": + *m = 140 + case "flowChartManualInput": + *m = 141 + case "flowChartManualOperation": + *m = 142 + case "flowChartConnector": + *m = 143 + case "flowChartPunchedCard": + *m = 144 + case "flowChartPunchedTape": + *m = 145 + case "flowChartSummingJunction": + *m = 146 + case "flowChartOr": + *m = 147 + case "flowChartCollate": + *m = 148 + case "flowChartSort": + *m = 149 + case "flowChartExtract": + *m = 150 + case "flowChartMerge": + *m = 151 + case "flowChartOfflineStorage": + *m = 152 + case "flowChartOnlineStorage": + *m = 153 + case "flowChartMagneticTape": + *m = 154 + case "flowChartMagneticDisk": + *m = 155 + case "flowChartMagneticDrum": + *m = 156 + case "flowChartDisplay": + *m = 157 + case "flowChartDelay": + *m = 158 + case "flowChartAlternateProcess": + *m = 159 + case "flowChartOffpageConnector": + *m = 160 + case "actionButtonBlank": + *m = 161 + case "actionButtonHome": + *m = 162 + case "actionButtonHelp": + *m = 163 + case "actionButtonInformation": + *m = 164 + case "actionButtonForwardNext": + *m = 165 + case "actionButtonBackPrevious": + *m = 166 + case "actionButtonEnd": + *m = 167 + case "actionButtonBeginning": + *m = 168 + case "actionButtonReturn": + *m = 169 + case "actionButtonDocument": + *m = 170 + case "actionButtonSound": + *m = 171 + case "actionButtonMovie": + *m = 172 + case "gear6": + *m = 173 + case "gear9": + *m = 174 + case "funnel": + *m = 175 + case "mathPlus": + *m = 176 + case "mathMinus": + *m = 177 + case "mathMultiply": + *m = 178 + case "mathDivide": + *m = 179 + case "mathEqual": + *m = 180 + case "mathNotEqual": + *m = 181 + case "cornerTabs": + *m = 182 + case "squareTabs": + *m = 183 + case "plaqueTabs": + *m = 184 + case "chartX": + *m = 185 + case "chartStar": + *m = 186 + case "chartPlus": + *m = 187 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_ShapeType) String() string { + switch m { + case 0: + return "" + case 1: + return "line" + case 2: + return "lineInv" + case 3: + return "triangle" + case 4: + return "rtTriangle" + case 5: + return "rect" + case 6: + return "diamond" + case 7: + return "parallelogram" + case 8: + return "trapezoid" + case 9: + return "nonIsoscelesTrapezoid" + case 10: + return "pentagon" + case 11: + return "hexagon" + case 12: + return "heptagon" + case 13: + return "octagon" + case 14: + return "decagon" + case 15: + return "dodecagon" + case 16: + return "star4" + case 17: + return "star5" + case 18: + return "star6" + case 19: + return "star7" + case 20: + return "star8" + case 21: + return "star10" + case 22: + return "star12" + case 23: + return "star16" + case 24: + return "star24" + case 25: + return "star32" + case 26: + return "roundRect" + case 27: + return "round1Rect" + case 28: + return "round2SameRect" + case 29: + return "round2DiagRect" + case 30: + return "snipRoundRect" + case 31: + return "snip1Rect" + case 32: + return "snip2SameRect" + case 33: + return "snip2DiagRect" + case 34: + return "plaque" + case 35: + return "ellipse" + case 36: + return "teardrop" + case 37: + return "homePlate" + case 38: + return "chevron" + case 39: + return "pieWedge" + case 40: + return "pie" + case 41: + return "blockArc" + case 42: + return "donut" + case 43: + return "noSmoking" + case 44: + return "rightArrow" + case 45: + return "leftArrow" + case 46: + return "upArrow" + case 47: + return "downArrow" + case 48: + return "stripedRightArrow" + case 49: + return "notchedRightArrow" + case 50: + return "bentUpArrow" + case 51: + return "leftRightArrow" + case 52: + return "upDownArrow" + case 53: + return "leftUpArrow" + case 54: + return "leftRightUpArrow" + case 55: + return "quadArrow" + case 56: + return "leftArrowCallout" + case 57: + return "rightArrowCallout" + case 58: + return "upArrowCallout" + case 59: + return "downArrowCallout" + case 60: + return "leftRightArrowCallout" + case 61: + return "upDownArrowCallout" + case 62: + return "quadArrowCallout" + case 63: + return "bentArrow" + case 64: + return "uturnArrow" + case 65: + return "circularArrow" + case 66: + return "leftCircularArrow" + case 67: + return "leftRightCircularArrow" + case 68: + return "curvedRightArrow" + case 69: + return "curvedLeftArrow" + case 70: + return "curvedUpArrow" + case 71: + return "curvedDownArrow" + case 72: + return "swooshArrow" + case 73: + return "cube" + case 74: + return "can" + case 75: + return "lightningBolt" + case 76: + return "heart" + case 77: + return "sun" + case 78: + return "moon" + case 79: + return "smileyFace" + case 80: + return "irregularSeal1" + case 81: + return "irregularSeal2" + case 82: + return "foldedCorner" + case 83: + return "bevel" + case 84: + return "frame" + case 85: + return "halfFrame" + case 86: + return "corner" + case 87: + return "diagStripe" + case 88: + return "chord" + case 89: + return "arc" + case 90: + return "leftBracket" + case 91: + return "rightBracket" + case 92: + return "leftBrace" + case 93: + return "rightBrace" + case 94: + return "bracketPair" + case 95: + return "bracePair" + case 96: + return "straightConnector1" + case 97: + return "bentConnector2" + case 98: + return "bentConnector3" + case 99: + return "bentConnector4" + case 100: + return "bentConnector5" + case 101: + return "curvedConnector2" + case 102: + return "curvedConnector3" + case 103: + return "curvedConnector4" + case 104: + return "curvedConnector5" + case 105: + return "callout1" + case 106: + return "callout2" + case 107: + return "callout3" + case 108: + return "accentCallout1" + case 109: + return "accentCallout2" + case 110: + return "accentCallout3" + case 111: + return "borderCallout1" + case 112: + return "borderCallout2" + case 113: + return "borderCallout3" + case 114: + return "accentBorderCallout1" + case 115: + return "accentBorderCallout2" + case 116: + return "accentBorderCallout3" + case 117: + return "wedgeRectCallout" + case 118: + return "wedgeRoundRectCallout" + case 119: + return "wedgeEllipseCallout" + case 120: + return "cloudCallout" + case 121: + return "cloud" + case 122: + return "ribbon" + case 123: + return "ribbon2" + case 124: + return "ellipseRibbon" + case 125: + return "ellipseRibbon2" + case 126: + return "leftRightRibbon" + case 127: + return "verticalScroll" + case 128: + return "horizontalScroll" + case 129: + return "wave" + case 130: + return "doubleWave" + case 131: + return "plus" + case 132: + return "flowChartProcess" + case 133: + return "flowChartDecision" + case 134: + return "flowChartInputOutput" + case 135: + return "flowChartPredefinedProcess" + case 136: + return "flowChartInternalStorage" + case 137: + return "flowChartDocument" + case 138: + return "flowChartMultidocument" + case 139: + return "flowChartTerminator" + case 140: + return "flowChartPreparation" + case 141: + return "flowChartManualInput" + case 142: + return "flowChartManualOperation" + case 143: + return "flowChartConnector" + case 144: + return "flowChartPunchedCard" + case 145: + return "flowChartPunchedTape" + case 146: + return "flowChartSummingJunction" + case 147: + return "flowChartOr" + case 148: + return "flowChartCollate" + case 149: + return "flowChartSort" + case 150: + return "flowChartExtract" + case 151: + return "flowChartMerge" + case 152: + return "flowChartOfflineStorage" + case 153: + return "flowChartOnlineStorage" + case 154: + return "flowChartMagneticTape" + case 155: + return "flowChartMagneticDisk" + case 156: + return "flowChartMagneticDrum" + case 157: + return "flowChartDisplay" + case 158: + return "flowChartDelay" + case 159: + return "flowChartAlternateProcess" + case 160: + return "flowChartOffpageConnector" + case 161: + return "actionButtonBlank" + case 162: + return "actionButtonHome" + case 163: + return "actionButtonHelp" + case 164: + return "actionButtonInformation" + case 165: + return "actionButtonForwardNext" + case 166: + return "actionButtonBackPrevious" + case 167: + return "actionButtonEnd" + case 168: + return "actionButtonBeginning" + case 169: + return "actionButtonReturn" + case 170: + return "actionButtonDocument" + case 171: + return "actionButtonSound" + case 172: + return "actionButtonMovie" + case 173: + return "gear6" + case 174: + return "gear9" + case 175: + return "funnel" + case 176: + return "mathPlus" + case 177: + return "mathMinus" + case 178: + return "mathMultiply" + case 179: + return "mathDivide" + case 180: + return "mathEqual" + case 181: + return "mathNotEqual" + case 182: + return "cornerTabs" + case 183: + return "squareTabs" + case 184: + return "plaqueTabs" + case 185: + return "chartX" + case 186: + return "chartStar" + case 187: + return "chartPlus" + } + return "" +} + +func (m ST_ShapeType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_ShapeType) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_TextShapeType byte + +const ( + ST_TextShapeTypeUnset ST_TextShapeType = 0 + ST_TextShapeTypeTextNoShape ST_TextShapeType = 1 + ST_TextShapeTypeTextPlain ST_TextShapeType = 2 + ST_TextShapeTypeTextStop ST_TextShapeType = 3 + ST_TextShapeTypeTextTriangle ST_TextShapeType = 4 + ST_TextShapeTypeTextTriangleInverted ST_TextShapeType = 5 + ST_TextShapeTypeTextChevron ST_TextShapeType = 6 + ST_TextShapeTypeTextChevronInverted ST_TextShapeType = 7 + ST_TextShapeTypeTextRingInside ST_TextShapeType = 8 + ST_TextShapeTypeTextRingOutside ST_TextShapeType = 9 + ST_TextShapeTypeTextArchUp ST_TextShapeType = 10 + ST_TextShapeTypeTextArchDown ST_TextShapeType = 11 + ST_TextShapeTypeTextCircle ST_TextShapeType = 12 + ST_TextShapeTypeTextButton ST_TextShapeType = 13 + ST_TextShapeTypeTextArchUpPour ST_TextShapeType = 14 + ST_TextShapeTypeTextArchDownPour ST_TextShapeType = 15 + ST_TextShapeTypeTextCirclePour ST_TextShapeType = 16 + ST_TextShapeTypeTextButtonPour ST_TextShapeType = 17 + ST_TextShapeTypeTextCurveUp ST_TextShapeType = 18 + ST_TextShapeTypeTextCurveDown ST_TextShapeType = 19 + ST_TextShapeTypeTextCanUp ST_TextShapeType = 20 + ST_TextShapeTypeTextCanDown ST_TextShapeType = 21 + ST_TextShapeTypeTextWave1 ST_TextShapeType = 22 + ST_TextShapeTypeTextWave2 ST_TextShapeType = 23 + ST_TextShapeTypeTextDoubleWave1 ST_TextShapeType = 24 + ST_TextShapeTypeTextWave4 ST_TextShapeType = 25 + ST_TextShapeTypeTextInflate ST_TextShapeType = 26 + ST_TextShapeTypeTextDeflate ST_TextShapeType = 27 + ST_TextShapeTypeTextInflateBottom ST_TextShapeType = 28 + ST_TextShapeTypeTextDeflateBottom ST_TextShapeType = 29 + ST_TextShapeTypeTextInflateTop ST_TextShapeType = 30 + ST_TextShapeTypeTextDeflateTop ST_TextShapeType = 31 + ST_TextShapeTypeTextDeflateInflate ST_TextShapeType = 32 + ST_TextShapeTypeTextDeflateInflateDeflate ST_TextShapeType = 33 + ST_TextShapeTypeTextFadeRight ST_TextShapeType = 34 + ST_TextShapeTypeTextFadeLeft ST_TextShapeType = 35 + ST_TextShapeTypeTextFadeUp ST_TextShapeType = 36 + ST_TextShapeTypeTextFadeDown ST_TextShapeType = 37 + ST_TextShapeTypeTextSlantUp ST_TextShapeType = 38 + ST_TextShapeTypeTextSlantDown ST_TextShapeType = 39 + ST_TextShapeTypeTextCascadeUp ST_TextShapeType = 40 + ST_TextShapeTypeTextCascadeDown ST_TextShapeType = 41 +) + +func (e ST_TextShapeType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_TextShapeTypeUnset: + attr.Value = "" + case ST_TextShapeTypeTextNoShape: + attr.Value = "textNoShape" + case ST_TextShapeTypeTextPlain: + attr.Value = "textPlain" + case ST_TextShapeTypeTextStop: + attr.Value = "textStop" + case ST_TextShapeTypeTextTriangle: + attr.Value = "textTriangle" + case ST_TextShapeTypeTextTriangleInverted: + attr.Value = "textTriangleInverted" + case ST_TextShapeTypeTextChevron: + attr.Value = "textChevron" + case ST_TextShapeTypeTextChevronInverted: + attr.Value = "textChevronInverted" + case ST_TextShapeTypeTextRingInside: + attr.Value = "textRingInside" + case ST_TextShapeTypeTextRingOutside: + attr.Value = "textRingOutside" + case ST_TextShapeTypeTextArchUp: + attr.Value = "textArchUp" + case ST_TextShapeTypeTextArchDown: + attr.Value = "textArchDown" + case ST_TextShapeTypeTextCircle: + attr.Value = "textCircle" + case ST_TextShapeTypeTextButton: + attr.Value = "textButton" + case ST_TextShapeTypeTextArchUpPour: + attr.Value = "textArchUpPour" + case ST_TextShapeTypeTextArchDownPour: + attr.Value = "textArchDownPour" + case ST_TextShapeTypeTextCirclePour: + attr.Value = "textCirclePour" + case ST_TextShapeTypeTextButtonPour: + attr.Value = "textButtonPour" + case ST_TextShapeTypeTextCurveUp: + attr.Value = "textCurveUp" + case ST_TextShapeTypeTextCurveDown: + attr.Value = "textCurveDown" + case ST_TextShapeTypeTextCanUp: + attr.Value = "textCanUp" + case ST_TextShapeTypeTextCanDown: + attr.Value = "textCanDown" + case ST_TextShapeTypeTextWave1: + attr.Value = "textWave1" + case ST_TextShapeTypeTextWave2: + attr.Value = "textWave2" + case ST_TextShapeTypeTextDoubleWave1: + attr.Value = "textDoubleWave1" + case ST_TextShapeTypeTextWave4: + attr.Value = "textWave4" + case ST_TextShapeTypeTextInflate: + attr.Value = "textInflate" + case ST_TextShapeTypeTextDeflate: + attr.Value = "textDeflate" + case ST_TextShapeTypeTextInflateBottom: + attr.Value = "textInflateBottom" + case ST_TextShapeTypeTextDeflateBottom: + attr.Value = "textDeflateBottom" + case ST_TextShapeTypeTextInflateTop: + attr.Value = "textInflateTop" + case ST_TextShapeTypeTextDeflateTop: + attr.Value = "textDeflateTop" + case ST_TextShapeTypeTextDeflateInflate: + attr.Value = "textDeflateInflate" + case ST_TextShapeTypeTextDeflateInflateDeflate: + attr.Value = "textDeflateInflateDeflate" + case ST_TextShapeTypeTextFadeRight: + attr.Value = "textFadeRight" + case ST_TextShapeTypeTextFadeLeft: + attr.Value = "textFadeLeft" + case ST_TextShapeTypeTextFadeUp: + attr.Value = "textFadeUp" + case ST_TextShapeTypeTextFadeDown: + attr.Value = "textFadeDown" + case ST_TextShapeTypeTextSlantUp: + attr.Value = "textSlantUp" + case ST_TextShapeTypeTextSlantDown: + attr.Value = "textSlantDown" + case ST_TextShapeTypeTextCascadeUp: + attr.Value = "textCascadeUp" + case ST_TextShapeTypeTextCascadeDown: + attr.Value = "textCascadeDown" + } + return attr, nil +} + +func (e *ST_TextShapeType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "textNoShape": + *e = 1 + case "textPlain": + *e = 2 + case "textStop": + *e = 3 + case "textTriangle": + *e = 4 + case "textTriangleInverted": + *e = 5 + case "textChevron": + *e = 6 + case "textChevronInverted": + *e = 7 + case "textRingInside": + *e = 8 + case "textRingOutside": + *e = 9 + case "textArchUp": + *e = 10 + case "textArchDown": + *e = 11 + case "textCircle": + *e = 12 + case "textButton": + *e = 13 + case "textArchUpPour": + *e = 14 + case "textArchDownPour": + *e = 15 + case "textCirclePour": + *e = 16 + case "textButtonPour": + *e = 17 + case "textCurveUp": + *e = 18 + case "textCurveDown": + *e = 19 + case "textCanUp": + *e = 20 + case "textCanDown": + *e = 21 + case "textWave1": + *e = 22 + case "textWave2": + *e = 23 + case "textDoubleWave1": + *e = 24 + case "textWave4": + *e = 25 + case "textInflate": + *e = 26 + case "textDeflate": + *e = 27 + case "textInflateBottom": + *e = 28 + case "textDeflateBottom": + *e = 29 + case "textInflateTop": + *e = 30 + case "textDeflateTop": + *e = 31 + case "textDeflateInflate": + *e = 32 + case "textDeflateInflateDeflate": + *e = 33 + case "textFadeRight": + *e = 34 + case "textFadeLeft": + *e = 35 + case "textFadeUp": + *e = 36 + case "textFadeDown": + *e = 37 + case "textSlantUp": + *e = 38 + case "textSlantDown": + *e = 39 + case "textCascadeUp": + *e = 40 + case "textCascadeDown": + *e = 41 + } + return nil +} + +func (m ST_TextShapeType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_TextShapeType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "textNoShape": + *m = 1 + case "textPlain": + *m = 2 + case "textStop": + *m = 3 + case "textTriangle": + *m = 4 + case "textTriangleInverted": + *m = 5 + case "textChevron": + *m = 6 + case "textChevronInverted": + *m = 7 + case "textRingInside": + *m = 8 + case "textRingOutside": + *m = 9 + case "textArchUp": + *m = 10 + case "textArchDown": + *m = 11 + case "textCircle": + *m = 12 + case "textButton": + *m = 13 + case "textArchUpPour": + *m = 14 + case "textArchDownPour": + *m = 15 + case "textCirclePour": + *m = 16 + case "textButtonPour": + *m = 17 + case "textCurveUp": + *m = 18 + case "textCurveDown": + *m = 19 + case "textCanUp": + *m = 20 + case "textCanDown": + *m = 21 + case "textWave1": + *m = 22 + case "textWave2": + *m = 23 + case "textDoubleWave1": + *m = 24 + case "textWave4": + *m = 25 + case "textInflate": + *m = 26 + case "textDeflate": + *m = 27 + case "textInflateBottom": + *m = 28 + case "textDeflateBottom": + *m = 29 + case "textInflateTop": + *m = 30 + case "textDeflateTop": + *m = 31 + case "textDeflateInflate": + *m = 32 + case "textDeflateInflateDeflate": + *m = 33 + case "textFadeRight": + *m = 34 + case "textFadeLeft": + *m = 35 + case "textFadeUp": + *m = 36 + case "textFadeDown": + *m = 37 + case "textSlantUp": + *m = 38 + case "textSlantDown": + *m = 39 + case "textCascadeUp": + *m = 40 + case "textCascadeDown": + *m = 41 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_TextShapeType) String() string { + switch m { + case 0: + return "" + case 1: + return "textNoShape" + case 2: + return "textPlain" + case 3: + return "textStop" + case 4: + return "textTriangle" + case 5: + return "textTriangleInverted" + case 6: + return "textChevron" + case 7: + return "textChevronInverted" + case 8: + return "textRingInside" + case 9: + return "textRingOutside" + case 10: + return "textArchUp" + case 11: + return "textArchDown" + case 12: + return "textCircle" + case 13: + return "textButton" + case 14: + return "textArchUpPour" + case 15: + return "textArchDownPour" + case 16: + return "textCirclePour" + case 17: + return "textButtonPour" + case 18: + return "textCurveUp" + case 19: + return "textCurveDown" + case 20: + return "textCanUp" + case 21: + return "textCanDown" + case 22: + return "textWave1" + case 23: + return "textWave2" + case 24: + return "textDoubleWave1" + case 25: + return "textWave4" + case 26: + return "textInflate" + case 27: + return "textDeflate" + case 28: + return "textInflateBottom" + case 29: + return "textDeflateBottom" + case 30: + return "textInflateTop" + case 31: + return "textDeflateTop" + case 32: + return "textDeflateInflate" + case 33: + return "textDeflateInflateDeflate" + case 34: + return "textFadeRight" + case 35: + return "textFadeLeft" + case 36: + return "textFadeUp" + case 37: + return "textFadeDown" + case 38: + return "textSlantUp" + case 39: + return "textSlantDown" + case 40: + return "textCascadeUp" + case 41: + return "textCascadeDown" + } + return "" +} + +func (m ST_TextShapeType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_TextShapeType) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_PathFillMode byte + +const ( + ST_PathFillModeUnset ST_PathFillMode = 0 + ST_PathFillModeNone ST_PathFillMode = 1 + ST_PathFillModeNorm ST_PathFillMode = 2 + ST_PathFillModeLighten ST_PathFillMode = 3 + ST_PathFillModeLightenLess ST_PathFillMode = 4 + ST_PathFillModeDarken ST_PathFillMode = 5 + ST_PathFillModeDarkenLess ST_PathFillMode = 6 +) + +func (e ST_PathFillMode) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_PathFillModeUnset: + attr.Value = "" + case ST_PathFillModeNone: + attr.Value = "none" + case ST_PathFillModeNorm: + attr.Value = "norm" + case ST_PathFillModeLighten: + attr.Value = "lighten" + case ST_PathFillModeLightenLess: + attr.Value = "lightenLess" + case ST_PathFillModeDarken: + attr.Value = "darken" + case ST_PathFillModeDarkenLess: + attr.Value = "darkenLess" + } + return attr, nil +} + +func (e *ST_PathFillMode) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "none": + *e = 1 + case "norm": + *e = 2 + case "lighten": + *e = 3 + case "lightenLess": + *e = 4 + case "darken": + *e = 5 + case "darkenLess": + *e = 6 + } + return nil +} + +func (m ST_PathFillMode) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_PathFillMode) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "none": + *m = 1 + case "norm": + *m = 2 + case "lighten": + *m = 3 + case "lightenLess": + *m = 4 + case "darken": + *m = 5 + case "darkenLess": + *m = 6 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_PathFillMode) String() string { + switch m { + case 0: + return "" + case 1: + return "none" + case 2: + return "norm" + case 3: + return "lighten" + case 4: + return "lightenLess" + case 5: + return "darken" + case 6: + return "darkenLess" + } + return "" +} + +func (m ST_PathFillMode) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_PathFillMode) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_LineEndType byte + +const ( + ST_LineEndTypeUnset ST_LineEndType = 0 + ST_LineEndTypeNone ST_LineEndType = 1 + ST_LineEndTypeTriangle ST_LineEndType = 2 + ST_LineEndTypeStealth ST_LineEndType = 3 + ST_LineEndTypeDiamond ST_LineEndType = 4 + ST_LineEndTypeOval ST_LineEndType = 5 + ST_LineEndTypeArrow ST_LineEndType = 6 +) + +func (e ST_LineEndType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_LineEndTypeUnset: + attr.Value = "" + case ST_LineEndTypeNone: + attr.Value = "none" + case ST_LineEndTypeTriangle: + attr.Value = "triangle" + case ST_LineEndTypeStealth: + attr.Value = "stealth" + case ST_LineEndTypeDiamond: + attr.Value = "diamond" + case ST_LineEndTypeOval: + attr.Value = "oval" + case ST_LineEndTypeArrow: + attr.Value = "arrow" + } + return attr, nil +} + +func (e *ST_LineEndType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "none": + *e = 1 + case "triangle": + *e = 2 + case "stealth": + *e = 3 + case "diamond": + *e = 4 + case "oval": + *e = 5 + case "arrow": + *e = 6 + } + return nil +} + +func (m ST_LineEndType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_LineEndType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "none": + *m = 1 + case "triangle": + *m = 2 + case "stealth": + *m = 3 + case "diamond": + *m = 4 + case "oval": + *m = 5 + case "arrow": + *m = 6 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_LineEndType) String() string { + switch m { + case 0: + return "" + case 1: + return "none" + case 2: + return "triangle" + case 3: + return "stealth" + case 4: + return "diamond" + case 5: + return "oval" + case 6: + return "arrow" + } + return "" +} + +func (m ST_LineEndType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_LineEndType) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_LineEndWidth byte + +const ( + ST_LineEndWidthUnset ST_LineEndWidth = 0 + ST_LineEndWidthSm ST_LineEndWidth = 1 + ST_LineEndWidthMed ST_LineEndWidth = 2 + ST_LineEndWidthLg ST_LineEndWidth = 3 +) + +func (e ST_LineEndWidth) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_LineEndWidthUnset: + attr.Value = "" + case ST_LineEndWidthSm: + attr.Value = "sm" + case ST_LineEndWidthMed: + attr.Value = "med" + case ST_LineEndWidthLg: + attr.Value = "lg" + } + return attr, nil +} + +func (e *ST_LineEndWidth) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "sm": + *e = 1 + case "med": + *e = 2 + case "lg": + *e = 3 + } + return nil +} + +func (m ST_LineEndWidth) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_LineEndWidth) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "sm": + *m = 1 + case "med": + *m = 2 + case "lg": + *m = 3 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_LineEndWidth) String() string { + switch m { + case 0: + return "" + case 1: + return "sm" + case 2: + return "med" + case 3: + return "lg" + } + return "" +} + +func (m ST_LineEndWidth) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_LineEndWidth) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_LineEndLength byte + +const ( + ST_LineEndLengthUnset ST_LineEndLength = 0 + ST_LineEndLengthSm ST_LineEndLength = 1 + ST_LineEndLengthMed ST_LineEndLength = 2 + ST_LineEndLengthLg ST_LineEndLength = 3 +) + +func (e ST_LineEndLength) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_LineEndLengthUnset: + attr.Value = "" + case ST_LineEndLengthSm: + attr.Value = "sm" + case ST_LineEndLengthMed: + attr.Value = "med" + case ST_LineEndLengthLg: + attr.Value = "lg" + } + return attr, nil +} + +func (e *ST_LineEndLength) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "sm": + *e = 1 + case "med": + *e = 2 + case "lg": + *e = 3 + } + return nil +} + +func (m ST_LineEndLength) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_LineEndLength) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "sm": + *m = 1 + case "med": + *m = 2 + case "lg": + *m = 3 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_LineEndLength) String() string { + switch m { + case 0: + return "" + case 1: + return "sm" + case 2: + return "med" + case 3: + return "lg" + } + return "" +} + +func (m ST_LineEndLength) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_LineEndLength) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_PresetLineDashVal byte + +const ( + ST_PresetLineDashValUnset ST_PresetLineDashVal = 0 + ST_PresetLineDashValSolid ST_PresetLineDashVal = 1 + ST_PresetLineDashValDot ST_PresetLineDashVal = 2 + ST_PresetLineDashValDash ST_PresetLineDashVal = 3 + ST_PresetLineDashValLgDash ST_PresetLineDashVal = 4 + ST_PresetLineDashValDashDot ST_PresetLineDashVal = 5 + ST_PresetLineDashValLgDashDot ST_PresetLineDashVal = 6 + ST_PresetLineDashValLgDashDotDot ST_PresetLineDashVal = 7 + ST_PresetLineDashValSysDash ST_PresetLineDashVal = 8 + ST_PresetLineDashValSysDot ST_PresetLineDashVal = 9 + ST_PresetLineDashValSysDashDot ST_PresetLineDashVal = 10 + ST_PresetLineDashValSysDashDotDot ST_PresetLineDashVal = 11 +) + +func (e ST_PresetLineDashVal) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_PresetLineDashValUnset: + attr.Value = "" + case ST_PresetLineDashValSolid: + attr.Value = "solid" + case ST_PresetLineDashValDot: + attr.Value = "dot" + case ST_PresetLineDashValDash: + attr.Value = "dash" + case ST_PresetLineDashValLgDash: + attr.Value = "lgDash" + case ST_PresetLineDashValDashDot: + attr.Value = "dashDot" + case ST_PresetLineDashValLgDashDot: + attr.Value = "lgDashDot" + case ST_PresetLineDashValLgDashDotDot: + attr.Value = "lgDashDotDot" + case ST_PresetLineDashValSysDash: + attr.Value = "sysDash" + case ST_PresetLineDashValSysDot: + attr.Value = "sysDot" + case ST_PresetLineDashValSysDashDot: + attr.Value = "sysDashDot" + case ST_PresetLineDashValSysDashDotDot: + attr.Value = "sysDashDotDot" + } + return attr, nil +} + +func (e *ST_PresetLineDashVal) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "solid": + *e = 1 + case "dot": + *e = 2 + case "dash": + *e = 3 + case "lgDash": + *e = 4 + case "dashDot": + *e = 5 + case "lgDashDot": + *e = 6 + case "lgDashDotDot": + *e = 7 + case "sysDash": + *e = 8 + case "sysDot": + *e = 9 + case "sysDashDot": + *e = 10 + case "sysDashDotDot": + *e = 11 + } + return nil +} + +func (m ST_PresetLineDashVal) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_PresetLineDashVal) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "solid": + *m = 1 + case "dot": + *m = 2 + case "dash": + *m = 3 + case "lgDash": + *m = 4 + case "dashDot": + *m = 5 + case "lgDashDot": + *m = 6 + case "lgDashDotDot": + *m = 7 + case "sysDash": + *m = 8 + case "sysDot": + *m = 9 + case "sysDashDot": + *m = 10 + case "sysDashDotDot": + *m = 11 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_PresetLineDashVal) String() string { + switch m { + case 0: + return "" + case 1: + return "solid" + case 2: + return "dot" + case 3: + return "dash" + case 4: + return "lgDash" + case 5: + return "dashDot" + case 6: + return "lgDashDot" + case 7: + return "lgDashDotDot" + case 8: + return "sysDash" + case 9: + return "sysDot" + case 10: + return "sysDashDot" + case 11: + return "sysDashDotDot" + } + return "" +} + +func (m ST_PresetLineDashVal) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_PresetLineDashVal) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_LineCap byte + +const ( + ST_LineCapUnset ST_LineCap = 0 + ST_LineCapRnd ST_LineCap = 1 + ST_LineCapSq ST_LineCap = 2 + ST_LineCapFlat ST_LineCap = 3 +) + +func (e ST_LineCap) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_LineCapUnset: + attr.Value = "" + case ST_LineCapRnd: + attr.Value = "rnd" + case ST_LineCapSq: + attr.Value = "sq" + case ST_LineCapFlat: + attr.Value = "flat" + } + return attr, nil +} + +func (e *ST_LineCap) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "rnd": + *e = 1 + case "sq": + *e = 2 + case "flat": + *e = 3 + } + return nil +} + +func (m ST_LineCap) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_LineCap) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "rnd": + *m = 1 + case "sq": + *m = 2 + case "flat": + *m = 3 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_LineCap) String() string { + switch m { + case 0: + return "" + case 1: + return "rnd" + case 2: + return "sq" + case 3: + return "flat" + } + return "" +} + +func (m ST_LineCap) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_LineCap) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_PenAlignment byte + +const ( + ST_PenAlignmentUnset ST_PenAlignment = 0 + ST_PenAlignmentCtr ST_PenAlignment = 1 + ST_PenAlignmentIn ST_PenAlignment = 2 +) + +func (e ST_PenAlignment) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_PenAlignmentUnset: + attr.Value = "" + case ST_PenAlignmentCtr: + attr.Value = "ctr" + case ST_PenAlignmentIn: + attr.Value = "in" + } + return attr, nil +} + +func (e *ST_PenAlignment) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "ctr": + *e = 1 + case "in": + *e = 2 + } + return nil +} + +func (m ST_PenAlignment) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_PenAlignment) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "ctr": + *m = 1 + case "in": + *m = 2 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_PenAlignment) String() string { + switch m { + case 0: + return "" + case 1: + return "ctr" + case 2: + return "in" + } + return "" +} + +func (m ST_PenAlignment) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_PenAlignment) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_CompoundLine byte + +const ( + ST_CompoundLineUnset ST_CompoundLine = 0 + ST_CompoundLineSng ST_CompoundLine = 1 + ST_CompoundLineDbl ST_CompoundLine = 2 + ST_CompoundLineThickThin ST_CompoundLine = 3 + ST_CompoundLineThinThick ST_CompoundLine = 4 + ST_CompoundLineTri ST_CompoundLine = 5 +) + +func (e ST_CompoundLine) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_CompoundLineUnset: + attr.Value = "" + case ST_CompoundLineSng: + attr.Value = "sng" + case ST_CompoundLineDbl: + attr.Value = "dbl" + case ST_CompoundLineThickThin: + attr.Value = "thickThin" + case ST_CompoundLineThinThick: + attr.Value = "thinThick" + case ST_CompoundLineTri: + attr.Value = "tri" + } + return attr, nil +} + +func (e *ST_CompoundLine) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "sng": + *e = 1 + case "dbl": + *e = 2 + case "thickThin": + *e = 3 + case "thinThick": + *e = 4 + case "tri": + *e = 5 + } + return nil +} + +func (m ST_CompoundLine) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_CompoundLine) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "sng": + *m = 1 + case "dbl": + *m = 2 + case "thickThin": + *m = 3 + case "thinThick": + *m = 4 + case "tri": + *m = 5 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_CompoundLine) String() string { + switch m { + case 0: + return "" + case 1: + return "sng" + case 2: + return "dbl" + case 3: + return "thickThin" + case 4: + return "thinThick" + case 5: + return "tri" + } + return "" +} + +func (m ST_CompoundLine) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_CompoundLine) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_OnOffStyleType byte + +const ( + ST_OnOffStyleTypeUnset ST_OnOffStyleType = 0 + ST_OnOffStyleTypeOn ST_OnOffStyleType = 1 + ST_OnOffStyleTypeOff ST_OnOffStyleType = 2 + ST_OnOffStyleTypeDef ST_OnOffStyleType = 3 +) + +func (e ST_OnOffStyleType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_OnOffStyleTypeUnset: + attr.Value = "" + case ST_OnOffStyleTypeOn: + attr.Value = "on" + case ST_OnOffStyleTypeOff: + attr.Value = "off" + case ST_OnOffStyleTypeDef: + attr.Value = "def" + } + return attr, nil +} + +func (e *ST_OnOffStyleType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "on": + *e = 1 + case "off": + *e = 2 + case "def": + *e = 3 + } + return nil +} + +func (m ST_OnOffStyleType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_OnOffStyleType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "on": + *m = 1 + case "off": + *m = 2 + case "def": + *m = 3 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_OnOffStyleType) String() string { + switch m { + case 0: + return "" + case 1: + return "on" + case 2: + return "off" + case 3: + return "def" + } + return "" +} + +func (m ST_OnOffStyleType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_OnOffStyleType) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_TextAnchoringType byte + +const ( + ST_TextAnchoringTypeUnset ST_TextAnchoringType = 0 + ST_TextAnchoringTypeT ST_TextAnchoringType = 1 + ST_TextAnchoringTypeCtr ST_TextAnchoringType = 2 + ST_TextAnchoringTypeB ST_TextAnchoringType = 3 + ST_TextAnchoringTypeJust ST_TextAnchoringType = 4 + ST_TextAnchoringTypeDist ST_TextAnchoringType = 5 +) + +func (e ST_TextAnchoringType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_TextAnchoringTypeUnset: + attr.Value = "" + case ST_TextAnchoringTypeT: + attr.Value = "t" + case ST_TextAnchoringTypeCtr: + attr.Value = "ctr" + case ST_TextAnchoringTypeB: + attr.Value = "b" + case ST_TextAnchoringTypeJust: + attr.Value = "just" + case ST_TextAnchoringTypeDist: + attr.Value = "dist" + } + return attr, nil +} + +func (e *ST_TextAnchoringType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "t": + *e = 1 + case "ctr": + *e = 2 + case "b": + *e = 3 + case "just": + *e = 4 + case "dist": + *e = 5 + } + return nil +} + +func (m ST_TextAnchoringType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_TextAnchoringType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "t": + *m = 1 + case "ctr": + *m = 2 + case "b": + *m = 3 + case "just": + *m = 4 + case "dist": + *m = 5 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_TextAnchoringType) String() string { + switch m { + case 0: + return "" + case 1: + return "t" + case 2: + return "ctr" + case 3: + return "b" + case 4: + return "just" + case 5: + return "dist" + } + return "" +} + +func (m ST_TextAnchoringType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_TextAnchoringType) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_TextVertOverflowType byte + +const ( + ST_TextVertOverflowTypeUnset ST_TextVertOverflowType = 0 + ST_TextVertOverflowTypeOverflow ST_TextVertOverflowType = 1 + ST_TextVertOverflowTypeEllipsis ST_TextVertOverflowType = 2 + ST_TextVertOverflowTypeClip ST_TextVertOverflowType = 3 +) + +func (e ST_TextVertOverflowType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_TextVertOverflowTypeUnset: + attr.Value = "" + case ST_TextVertOverflowTypeOverflow: + attr.Value = "overflow" + case ST_TextVertOverflowTypeEllipsis: + attr.Value = "ellipsis" + case ST_TextVertOverflowTypeClip: + attr.Value = "clip" + } + return attr, nil +} + +func (e *ST_TextVertOverflowType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "overflow": + *e = 1 + case "ellipsis": + *e = 2 + case "clip": + *e = 3 + } + return nil +} + +func (m ST_TextVertOverflowType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_TextVertOverflowType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "overflow": + *m = 1 + case "ellipsis": + *m = 2 + case "clip": + *m = 3 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_TextVertOverflowType) String() string { + switch m { + case 0: + return "" + case 1: + return "overflow" + case 2: + return "ellipsis" + case 3: + return "clip" + } + return "" +} + +func (m ST_TextVertOverflowType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_TextVertOverflowType) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_TextHorzOverflowType byte + +const ( + ST_TextHorzOverflowTypeUnset ST_TextHorzOverflowType = 0 + ST_TextHorzOverflowTypeOverflow ST_TextHorzOverflowType = 1 + ST_TextHorzOverflowTypeClip ST_TextHorzOverflowType = 2 +) + +func (e ST_TextHorzOverflowType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_TextHorzOverflowTypeUnset: + attr.Value = "" + case ST_TextHorzOverflowTypeOverflow: + attr.Value = "overflow" + case ST_TextHorzOverflowTypeClip: + attr.Value = "clip" + } + return attr, nil +} + +func (e *ST_TextHorzOverflowType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "overflow": + *e = 1 + case "clip": + *e = 2 + } + return nil +} + +func (m ST_TextHorzOverflowType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_TextHorzOverflowType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "overflow": + *m = 1 + case "clip": + *m = 2 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_TextHorzOverflowType) String() string { + switch m { + case 0: + return "" + case 1: + return "overflow" + case 2: + return "clip" + } + return "" +} + +func (m ST_TextHorzOverflowType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_TextHorzOverflowType) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_TextVerticalType byte + +const ( + ST_TextVerticalTypeUnset ST_TextVerticalType = 0 + ST_TextVerticalTypeHorz ST_TextVerticalType = 1 + ST_TextVerticalTypeVert ST_TextVerticalType = 2 + ST_TextVerticalTypeVert270 ST_TextVerticalType = 3 + ST_TextVerticalTypeWordArtVert ST_TextVerticalType = 4 + ST_TextVerticalTypeEaVert ST_TextVerticalType = 5 + ST_TextVerticalTypeMongolianVert ST_TextVerticalType = 6 + ST_TextVerticalTypeWordArtVertRtl ST_TextVerticalType = 7 +) + +func (e ST_TextVerticalType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_TextVerticalTypeUnset: + attr.Value = "" + case ST_TextVerticalTypeHorz: + attr.Value = "horz" + case ST_TextVerticalTypeVert: + attr.Value = "vert" + case ST_TextVerticalTypeVert270: + attr.Value = "vert270" + case ST_TextVerticalTypeWordArtVert: + attr.Value = "wordArtVert" + case ST_TextVerticalTypeEaVert: + attr.Value = "eaVert" + case ST_TextVerticalTypeMongolianVert: + attr.Value = "mongolianVert" + case ST_TextVerticalTypeWordArtVertRtl: + attr.Value = "wordArtVertRtl" + } + return attr, nil +} + +func (e *ST_TextVerticalType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "horz": + *e = 1 + case "vert": + *e = 2 + case "vert270": + *e = 3 + case "wordArtVert": + *e = 4 + case "eaVert": + *e = 5 + case "mongolianVert": + *e = 6 + case "wordArtVertRtl": + *e = 7 + } + return nil +} + +func (m ST_TextVerticalType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_TextVerticalType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "horz": + *m = 1 + case "vert": + *m = 2 + case "vert270": + *m = 3 + case "wordArtVert": + *m = 4 + case "eaVert": + *m = 5 + case "mongolianVert": + *m = 6 + case "wordArtVertRtl": + *m = 7 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_TextVerticalType) String() string { + switch m { + case 0: + return "" + case 1: + return "horz" + case 2: + return "vert" + case 3: + return "vert270" + case 4: + return "wordArtVert" + case 5: + return "eaVert" + case 6: + return "mongolianVert" + case 7: + return "wordArtVertRtl" + } + return "" +} + +func (m ST_TextVerticalType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_TextVerticalType) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_TextWrappingType byte + +const ( + ST_TextWrappingTypeUnset ST_TextWrappingType = 0 + ST_TextWrappingTypeNone ST_TextWrappingType = 1 + ST_TextWrappingTypeSquare ST_TextWrappingType = 2 +) + +func (e ST_TextWrappingType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_TextWrappingTypeUnset: + attr.Value = "" + case ST_TextWrappingTypeNone: + attr.Value = "none" + case ST_TextWrappingTypeSquare: + attr.Value = "square" + } + return attr, nil +} + +func (e *ST_TextWrappingType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "none": + *e = 1 + case "square": + *e = 2 + } + return nil +} + +func (m ST_TextWrappingType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_TextWrappingType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "none": + *m = 1 + case "square": + *m = 2 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_TextWrappingType) String() string { + switch m { + case 0: + return "" + case 1: + return "none" + case 2: + return "square" + } + return "" +} + +func (m ST_TextWrappingType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_TextWrappingType) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_TextAutonumberScheme byte + +const ( + ST_TextAutonumberSchemeUnset ST_TextAutonumberScheme = 0 + ST_TextAutonumberSchemeAlphaLcParenBoth ST_TextAutonumberScheme = 1 + ST_TextAutonumberSchemeAlphaUcParenBoth ST_TextAutonumberScheme = 2 + ST_TextAutonumberSchemeAlphaLcParenR ST_TextAutonumberScheme = 3 + ST_TextAutonumberSchemeAlphaUcParenR ST_TextAutonumberScheme = 4 + ST_TextAutonumberSchemeAlphaLcPeriod ST_TextAutonumberScheme = 5 + ST_TextAutonumberSchemeAlphaUcPeriod ST_TextAutonumberScheme = 6 + ST_TextAutonumberSchemeArabicParenBoth ST_TextAutonumberScheme = 7 + ST_TextAutonumberSchemeArabicParenR ST_TextAutonumberScheme = 8 + ST_TextAutonumberSchemeArabicPeriod ST_TextAutonumberScheme = 9 + ST_TextAutonumberSchemeArabicPlain ST_TextAutonumberScheme = 10 + ST_TextAutonumberSchemeRomanLcParenBoth ST_TextAutonumberScheme = 11 + ST_TextAutonumberSchemeRomanUcParenBoth ST_TextAutonumberScheme = 12 + ST_TextAutonumberSchemeRomanLcParenR ST_TextAutonumberScheme = 13 + ST_TextAutonumberSchemeRomanUcParenR ST_TextAutonumberScheme = 14 + ST_TextAutonumberSchemeRomanLcPeriod ST_TextAutonumberScheme = 15 + ST_TextAutonumberSchemeRomanUcPeriod ST_TextAutonumberScheme = 16 + ST_TextAutonumberSchemeCircleNumDbPlain ST_TextAutonumberScheme = 17 + ST_TextAutonumberSchemeCircleNumWdBlackPlain ST_TextAutonumberScheme = 18 + ST_TextAutonumberSchemeCircleNumWdWhitePlain ST_TextAutonumberScheme = 19 + ST_TextAutonumberSchemeArabicDbPeriod ST_TextAutonumberScheme = 20 + ST_TextAutonumberSchemeArabicDbPlain ST_TextAutonumberScheme = 21 + ST_TextAutonumberSchemeEa1ChsPeriod ST_TextAutonumberScheme = 22 + ST_TextAutonumberSchemeEa1ChsPlain ST_TextAutonumberScheme = 23 + ST_TextAutonumberSchemeEa1ChtPeriod ST_TextAutonumberScheme = 24 + ST_TextAutonumberSchemeEa1ChtPlain ST_TextAutonumberScheme = 25 + ST_TextAutonumberSchemeEa1JpnChsDbPeriod ST_TextAutonumberScheme = 26 + ST_TextAutonumberSchemeEa1JpnKorPlain ST_TextAutonumberScheme = 27 + ST_TextAutonumberSchemeEa1JpnKorPeriod ST_TextAutonumberScheme = 28 + ST_TextAutonumberSchemeArabic1Minus ST_TextAutonumberScheme = 29 + ST_TextAutonumberSchemeArabic2Minus ST_TextAutonumberScheme = 30 + ST_TextAutonumberSchemeHebrew2Minus ST_TextAutonumberScheme = 31 + ST_TextAutonumberSchemeThaiAlphaPeriod ST_TextAutonumberScheme = 32 + ST_TextAutonumberSchemeThaiAlphaParenR ST_TextAutonumberScheme = 33 + ST_TextAutonumberSchemeThaiAlphaParenBoth ST_TextAutonumberScheme = 34 + ST_TextAutonumberSchemeThaiNumPeriod ST_TextAutonumberScheme = 35 + ST_TextAutonumberSchemeThaiNumParenR ST_TextAutonumberScheme = 36 + ST_TextAutonumberSchemeThaiNumParenBoth ST_TextAutonumberScheme = 37 + ST_TextAutonumberSchemeHindiAlphaPeriod ST_TextAutonumberScheme = 38 + ST_TextAutonumberSchemeHindiNumPeriod ST_TextAutonumberScheme = 39 + ST_TextAutonumberSchemeHindiNumParenR ST_TextAutonumberScheme = 40 + ST_TextAutonumberSchemeHindiAlpha1Period ST_TextAutonumberScheme = 41 +) + +func (e ST_TextAutonumberScheme) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_TextAutonumberSchemeUnset: + attr.Value = "" + case ST_TextAutonumberSchemeAlphaLcParenBoth: + attr.Value = "alphaLcParenBoth" + case ST_TextAutonumberSchemeAlphaUcParenBoth: + attr.Value = "alphaUcParenBoth" + case ST_TextAutonumberSchemeAlphaLcParenR: + attr.Value = "alphaLcParenR" + case ST_TextAutonumberSchemeAlphaUcParenR: + attr.Value = "alphaUcParenR" + case ST_TextAutonumberSchemeAlphaLcPeriod: + attr.Value = "alphaLcPeriod" + case ST_TextAutonumberSchemeAlphaUcPeriod: + attr.Value = "alphaUcPeriod" + case ST_TextAutonumberSchemeArabicParenBoth: + attr.Value = "arabicParenBoth" + case ST_TextAutonumberSchemeArabicParenR: + attr.Value = "arabicParenR" + case ST_TextAutonumberSchemeArabicPeriod: + attr.Value = "arabicPeriod" + case ST_TextAutonumberSchemeArabicPlain: + attr.Value = "arabicPlain" + case ST_TextAutonumberSchemeRomanLcParenBoth: + attr.Value = "romanLcParenBoth" + case ST_TextAutonumberSchemeRomanUcParenBoth: + attr.Value = "romanUcParenBoth" + case ST_TextAutonumberSchemeRomanLcParenR: + attr.Value = "romanLcParenR" + case ST_TextAutonumberSchemeRomanUcParenR: + attr.Value = "romanUcParenR" + case ST_TextAutonumberSchemeRomanLcPeriod: + attr.Value = "romanLcPeriod" + case ST_TextAutonumberSchemeRomanUcPeriod: + attr.Value = "romanUcPeriod" + case ST_TextAutonumberSchemeCircleNumDbPlain: + attr.Value = "circleNumDbPlain" + case ST_TextAutonumberSchemeCircleNumWdBlackPlain: + attr.Value = "circleNumWdBlackPlain" + case ST_TextAutonumberSchemeCircleNumWdWhitePlain: + attr.Value = "circleNumWdWhitePlain" + case ST_TextAutonumberSchemeArabicDbPeriod: + attr.Value = "arabicDbPeriod" + case ST_TextAutonumberSchemeArabicDbPlain: + attr.Value = "arabicDbPlain" + case ST_TextAutonumberSchemeEa1ChsPeriod: + attr.Value = "ea1ChsPeriod" + case ST_TextAutonumberSchemeEa1ChsPlain: + attr.Value = "ea1ChsPlain" + case ST_TextAutonumberSchemeEa1ChtPeriod: + attr.Value = "ea1ChtPeriod" + case ST_TextAutonumberSchemeEa1ChtPlain: + attr.Value = "ea1ChtPlain" + case ST_TextAutonumberSchemeEa1JpnChsDbPeriod: + attr.Value = "ea1JpnChsDbPeriod" + case ST_TextAutonumberSchemeEa1JpnKorPlain: + attr.Value = "ea1JpnKorPlain" + case ST_TextAutonumberSchemeEa1JpnKorPeriod: + attr.Value = "ea1JpnKorPeriod" + case ST_TextAutonumberSchemeArabic1Minus: + attr.Value = "arabic1Minus" + case ST_TextAutonumberSchemeArabic2Minus: + attr.Value = "arabic2Minus" + case ST_TextAutonumberSchemeHebrew2Minus: + attr.Value = "hebrew2Minus" + case ST_TextAutonumberSchemeThaiAlphaPeriod: + attr.Value = "thaiAlphaPeriod" + case ST_TextAutonumberSchemeThaiAlphaParenR: + attr.Value = "thaiAlphaParenR" + case ST_TextAutonumberSchemeThaiAlphaParenBoth: + attr.Value = "thaiAlphaParenBoth" + case ST_TextAutonumberSchemeThaiNumPeriod: + attr.Value = "thaiNumPeriod" + case ST_TextAutonumberSchemeThaiNumParenR: + attr.Value = "thaiNumParenR" + case ST_TextAutonumberSchemeThaiNumParenBoth: + attr.Value = "thaiNumParenBoth" + case ST_TextAutonumberSchemeHindiAlphaPeriod: + attr.Value = "hindiAlphaPeriod" + case ST_TextAutonumberSchemeHindiNumPeriod: + attr.Value = "hindiNumPeriod" + case ST_TextAutonumberSchemeHindiNumParenR: + attr.Value = "hindiNumParenR" + case ST_TextAutonumberSchemeHindiAlpha1Period: + attr.Value = "hindiAlpha1Period" + } + return attr, nil +} + +func (e *ST_TextAutonumberScheme) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "alphaLcParenBoth": + *e = 1 + case "alphaUcParenBoth": + *e = 2 + case "alphaLcParenR": + *e = 3 + case "alphaUcParenR": + *e = 4 + case "alphaLcPeriod": + *e = 5 + case "alphaUcPeriod": + *e = 6 + case "arabicParenBoth": + *e = 7 + case "arabicParenR": + *e = 8 + case "arabicPeriod": + *e = 9 + case "arabicPlain": + *e = 10 + case "romanLcParenBoth": + *e = 11 + case "romanUcParenBoth": + *e = 12 + case "romanLcParenR": + *e = 13 + case "romanUcParenR": + *e = 14 + case "romanLcPeriod": + *e = 15 + case "romanUcPeriod": + *e = 16 + case "circleNumDbPlain": + *e = 17 + case "circleNumWdBlackPlain": + *e = 18 + case "circleNumWdWhitePlain": + *e = 19 + case "arabicDbPeriod": + *e = 20 + case "arabicDbPlain": + *e = 21 + case "ea1ChsPeriod": + *e = 22 + case "ea1ChsPlain": + *e = 23 + case "ea1ChtPeriod": + *e = 24 + case "ea1ChtPlain": + *e = 25 + case "ea1JpnChsDbPeriod": + *e = 26 + case "ea1JpnKorPlain": + *e = 27 + case "ea1JpnKorPeriod": + *e = 28 + case "arabic1Minus": + *e = 29 + case "arabic2Minus": + *e = 30 + case "hebrew2Minus": + *e = 31 + case "thaiAlphaPeriod": + *e = 32 + case "thaiAlphaParenR": + *e = 33 + case "thaiAlphaParenBoth": + *e = 34 + case "thaiNumPeriod": + *e = 35 + case "thaiNumParenR": + *e = 36 + case "thaiNumParenBoth": + *e = 37 + case "hindiAlphaPeriod": + *e = 38 + case "hindiNumPeriod": + *e = 39 + case "hindiNumParenR": + *e = 40 + case "hindiAlpha1Period": + *e = 41 + } + return nil +} + +func (m ST_TextAutonumberScheme) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_TextAutonumberScheme) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "alphaLcParenBoth": + *m = 1 + case "alphaUcParenBoth": + *m = 2 + case "alphaLcParenR": + *m = 3 + case "alphaUcParenR": + *m = 4 + case "alphaLcPeriod": + *m = 5 + case "alphaUcPeriod": + *m = 6 + case "arabicParenBoth": + *m = 7 + case "arabicParenR": + *m = 8 + case "arabicPeriod": + *m = 9 + case "arabicPlain": + *m = 10 + case "romanLcParenBoth": + *m = 11 + case "romanUcParenBoth": + *m = 12 + case "romanLcParenR": + *m = 13 + case "romanUcParenR": + *m = 14 + case "romanLcPeriod": + *m = 15 + case "romanUcPeriod": + *m = 16 + case "circleNumDbPlain": + *m = 17 + case "circleNumWdBlackPlain": + *m = 18 + case "circleNumWdWhitePlain": + *m = 19 + case "arabicDbPeriod": + *m = 20 + case "arabicDbPlain": + *m = 21 + case "ea1ChsPeriod": + *m = 22 + case "ea1ChsPlain": + *m = 23 + case "ea1ChtPeriod": + *m = 24 + case "ea1ChtPlain": + *m = 25 + case "ea1JpnChsDbPeriod": + *m = 26 + case "ea1JpnKorPlain": + *m = 27 + case "ea1JpnKorPeriod": + *m = 28 + case "arabic1Minus": + *m = 29 + case "arabic2Minus": + *m = 30 + case "hebrew2Minus": + *m = 31 + case "thaiAlphaPeriod": + *m = 32 + case "thaiAlphaParenR": + *m = 33 + case "thaiAlphaParenBoth": + *m = 34 + case "thaiNumPeriod": + *m = 35 + case "thaiNumParenR": + *m = 36 + case "thaiNumParenBoth": + *m = 37 + case "hindiAlphaPeriod": + *m = 38 + case "hindiNumPeriod": + *m = 39 + case "hindiNumParenR": + *m = 40 + case "hindiAlpha1Period": + *m = 41 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_TextAutonumberScheme) String() string { + switch m { + case 0: + return "" + case 1: + return "alphaLcParenBoth" + case 2: + return "alphaUcParenBoth" + case 3: + return "alphaLcParenR" + case 4: + return "alphaUcParenR" + case 5: + return "alphaLcPeriod" + case 6: + return "alphaUcPeriod" + case 7: + return "arabicParenBoth" + case 8: + return "arabicParenR" + case 9: + return "arabicPeriod" + case 10: + return "arabicPlain" + case 11: + return "romanLcParenBoth" + case 12: + return "romanUcParenBoth" + case 13: + return "romanLcParenR" + case 14: + return "romanUcParenR" + case 15: + return "romanLcPeriod" + case 16: + return "romanUcPeriod" + case 17: + return "circleNumDbPlain" + case 18: + return "circleNumWdBlackPlain" + case 19: + return "circleNumWdWhitePlain" + case 20: + return "arabicDbPeriod" + case 21: + return "arabicDbPlain" + case 22: + return "ea1ChsPeriod" + case 23: + return "ea1ChsPlain" + case 24: + return "ea1ChtPeriod" + case 25: + return "ea1ChtPlain" + case 26: + return "ea1JpnChsDbPeriod" + case 27: + return "ea1JpnKorPlain" + case 28: + return "ea1JpnKorPeriod" + case 29: + return "arabic1Minus" + case 30: + return "arabic2Minus" + case 31: + return "hebrew2Minus" + case 32: + return "thaiAlphaPeriod" + case 33: + return "thaiAlphaParenR" + case 34: + return "thaiAlphaParenBoth" + case 35: + return "thaiNumPeriod" + case 36: + return "thaiNumParenR" + case 37: + return "thaiNumParenBoth" + case 38: + return "hindiAlphaPeriod" + case 39: + return "hindiNumPeriod" + case 40: + return "hindiNumParenR" + case 41: + return "hindiAlpha1Period" + } + return "" +} + +func (m ST_TextAutonumberScheme) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_TextAutonumberScheme) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_PitchFamily byte + +const ( + ST_PitchFamilyUnset ST_PitchFamily = 0 + ST_PitchFamily00 ST_PitchFamily = 1 + ST_PitchFamily01 ST_PitchFamily = 2 + ST_PitchFamily02 ST_PitchFamily = 3 + ST_PitchFamily16 ST_PitchFamily = 4 + ST_PitchFamily17 ST_PitchFamily = 5 + ST_PitchFamily18 ST_PitchFamily = 6 + ST_PitchFamily32 ST_PitchFamily = 7 + ST_PitchFamily33 ST_PitchFamily = 8 + ST_PitchFamily34 ST_PitchFamily = 9 + ST_PitchFamily48 ST_PitchFamily = 10 + ST_PitchFamily49 ST_PitchFamily = 11 + ST_PitchFamily50 ST_PitchFamily = 12 + ST_PitchFamily64 ST_PitchFamily = 13 + ST_PitchFamily65 ST_PitchFamily = 14 + ST_PitchFamily66 ST_PitchFamily = 15 + ST_PitchFamily80 ST_PitchFamily = 16 + ST_PitchFamily81 ST_PitchFamily = 17 + ST_PitchFamily82 ST_PitchFamily = 18 +) + +func (e ST_PitchFamily) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_PitchFamilyUnset: + attr.Value = "" + case ST_PitchFamily00: + attr.Value = "00" + case ST_PitchFamily01: + attr.Value = "01" + case ST_PitchFamily02: + attr.Value = "02" + case ST_PitchFamily16: + attr.Value = "16" + case ST_PitchFamily17: + attr.Value = "17" + case ST_PitchFamily18: + attr.Value = "18" + case ST_PitchFamily32: + attr.Value = "32" + case ST_PitchFamily33: + attr.Value = "33" + case ST_PitchFamily34: + attr.Value = "34" + case ST_PitchFamily48: + attr.Value = "48" + case ST_PitchFamily49: + attr.Value = "49" + case ST_PitchFamily50: + attr.Value = "50" + case ST_PitchFamily64: + attr.Value = "64" + case ST_PitchFamily65: + attr.Value = "65" + case ST_PitchFamily66: + attr.Value = "66" + case ST_PitchFamily80: + attr.Value = "80" + case ST_PitchFamily81: + attr.Value = "81" + case ST_PitchFamily82: + attr.Value = "82" + } + return attr, nil +} + +func (e *ST_PitchFamily) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "00": + *e = 1 + case "01": + *e = 2 + case "02": + *e = 3 + case "16": + *e = 4 + case "17": + *e = 5 + case "18": + *e = 6 + case "32": + *e = 7 + case "33": + *e = 8 + case "34": + *e = 9 + case "48": + *e = 10 + case "49": + *e = 11 + case "50": + *e = 12 + case "64": + *e = 13 + case "65": + *e = 14 + case "66": + *e = 15 + case "80": + *e = 16 + case "81": + *e = 17 + case "82": + *e = 18 + } + return nil +} + +func (m ST_PitchFamily) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_PitchFamily) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "00": + *m = 1 + case "01": + *m = 2 + case "02": + *m = 3 + case "16": + *m = 4 + case "17": + *m = 5 + case "18": + *m = 6 + case "32": + *m = 7 + case "33": + *m = 8 + case "34": + *m = 9 + case "48": + *m = 10 + case "49": + *m = 11 + case "50": + *m = 12 + case "64": + *m = 13 + case "65": + *m = 14 + case "66": + *m = 15 + case "80": + *m = 16 + case "81": + *m = 17 + case "82": + *m = 18 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_PitchFamily) String() string { + switch m { + case 0: + return "" + case 1: + return "00" + case 2: + return "01" + case 3: + return "02" + case 4: + return "16" + case 5: + return "17" + case 6: + return "18" + case 7: + return "32" + case 8: + return "33" + case 9: + return "34" + case 10: + return "48" + case 11: + return "49" + case 12: + return "50" + case 13: + return "64" + case 14: + return "65" + case 15: + return "66" + case 16: + return "80" + case 17: + return "81" + case 18: + return "82" + } + return "" +} + +func (m ST_PitchFamily) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_PitchFamily) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_TextUnderlineType byte + +const ( + ST_TextUnderlineTypeUnset ST_TextUnderlineType = 0 + ST_TextUnderlineTypeNone ST_TextUnderlineType = 1 + ST_TextUnderlineTypeWords ST_TextUnderlineType = 2 + ST_TextUnderlineTypeSng ST_TextUnderlineType = 3 + ST_TextUnderlineTypeDbl ST_TextUnderlineType = 4 + ST_TextUnderlineTypeHeavy ST_TextUnderlineType = 5 + ST_TextUnderlineTypeDotted ST_TextUnderlineType = 6 + ST_TextUnderlineTypeDottedHeavy ST_TextUnderlineType = 7 + ST_TextUnderlineTypeDash ST_TextUnderlineType = 8 + ST_TextUnderlineTypeDashHeavy ST_TextUnderlineType = 9 + ST_TextUnderlineTypeDashLong ST_TextUnderlineType = 10 + ST_TextUnderlineTypeDashLongHeavy ST_TextUnderlineType = 11 + ST_TextUnderlineTypeDotDash ST_TextUnderlineType = 12 + ST_TextUnderlineTypeDotDashHeavy ST_TextUnderlineType = 13 + ST_TextUnderlineTypeDotDotDash ST_TextUnderlineType = 14 + ST_TextUnderlineTypeDotDotDashHeavy ST_TextUnderlineType = 15 + ST_TextUnderlineTypeWavy ST_TextUnderlineType = 16 + ST_TextUnderlineTypeWavyHeavy ST_TextUnderlineType = 17 + ST_TextUnderlineTypeWavyDbl ST_TextUnderlineType = 18 +) + +func (e ST_TextUnderlineType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_TextUnderlineTypeUnset: + attr.Value = "" + case ST_TextUnderlineTypeNone: + attr.Value = "none" + case ST_TextUnderlineTypeWords: + attr.Value = "words" + case ST_TextUnderlineTypeSng: + attr.Value = "sng" + case ST_TextUnderlineTypeDbl: + attr.Value = "dbl" + case ST_TextUnderlineTypeHeavy: + attr.Value = "heavy" + case ST_TextUnderlineTypeDotted: + attr.Value = "dotted" + case ST_TextUnderlineTypeDottedHeavy: + attr.Value = "dottedHeavy" + case ST_TextUnderlineTypeDash: + attr.Value = "dash" + case ST_TextUnderlineTypeDashHeavy: + attr.Value = "dashHeavy" + case ST_TextUnderlineTypeDashLong: + attr.Value = "dashLong" + case ST_TextUnderlineTypeDashLongHeavy: + attr.Value = "dashLongHeavy" + case ST_TextUnderlineTypeDotDash: + attr.Value = "dotDash" + case ST_TextUnderlineTypeDotDashHeavy: + attr.Value = "dotDashHeavy" + case ST_TextUnderlineTypeDotDotDash: + attr.Value = "dotDotDash" + case ST_TextUnderlineTypeDotDotDashHeavy: + attr.Value = "dotDotDashHeavy" + case ST_TextUnderlineTypeWavy: + attr.Value = "wavy" + case ST_TextUnderlineTypeWavyHeavy: + attr.Value = "wavyHeavy" + case ST_TextUnderlineTypeWavyDbl: + attr.Value = "wavyDbl" + } + return attr, nil +} + +func (e *ST_TextUnderlineType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "none": + *e = 1 + case "words": + *e = 2 + case "sng": + *e = 3 + case "dbl": + *e = 4 + case "heavy": + *e = 5 + case "dotted": + *e = 6 + case "dottedHeavy": + *e = 7 + case "dash": + *e = 8 + case "dashHeavy": + *e = 9 + case "dashLong": + *e = 10 + case "dashLongHeavy": + *e = 11 + case "dotDash": + *e = 12 + case "dotDashHeavy": + *e = 13 + case "dotDotDash": + *e = 14 + case "dotDotDashHeavy": + *e = 15 + case "wavy": + *e = 16 + case "wavyHeavy": + *e = 17 + case "wavyDbl": + *e = 18 + } + return nil +} + +func (m ST_TextUnderlineType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_TextUnderlineType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "none": + *m = 1 + case "words": + *m = 2 + case "sng": + *m = 3 + case "dbl": + *m = 4 + case "heavy": + *m = 5 + case "dotted": + *m = 6 + case "dottedHeavy": + *m = 7 + case "dash": + *m = 8 + case "dashHeavy": + *m = 9 + case "dashLong": + *m = 10 + case "dashLongHeavy": + *m = 11 + case "dotDash": + *m = 12 + case "dotDashHeavy": + *m = 13 + case "dotDotDash": + *m = 14 + case "dotDotDashHeavy": + *m = 15 + case "wavy": + *m = 16 + case "wavyHeavy": + *m = 17 + case "wavyDbl": + *m = 18 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_TextUnderlineType) String() string { + switch m { + case 0: + return "" + case 1: + return "none" + case 2: + return "words" + case 3: + return "sng" + case 4: + return "dbl" + case 5: + return "heavy" + case 6: + return "dotted" + case 7: + return "dottedHeavy" + case 8: + return "dash" + case 9: + return "dashHeavy" + case 10: + return "dashLong" + case 11: + return "dashLongHeavy" + case 12: + return "dotDash" + case 13: + return "dotDashHeavy" + case 14: + return "dotDotDash" + case 15: + return "dotDotDashHeavy" + case 16: + return "wavy" + case 17: + return "wavyHeavy" + case 18: + return "wavyDbl" + } + return "" +} + +func (m ST_TextUnderlineType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_TextUnderlineType) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_TextStrikeType byte + +const ( + ST_TextStrikeTypeUnset ST_TextStrikeType = 0 + ST_TextStrikeTypeNoStrike ST_TextStrikeType = 1 + ST_TextStrikeTypeSngStrike ST_TextStrikeType = 2 + ST_TextStrikeTypeDblStrike ST_TextStrikeType = 3 +) + +func (e ST_TextStrikeType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_TextStrikeTypeUnset: + attr.Value = "" + case ST_TextStrikeTypeNoStrike: + attr.Value = "noStrike" + case ST_TextStrikeTypeSngStrike: + attr.Value = "sngStrike" + case ST_TextStrikeTypeDblStrike: + attr.Value = "dblStrike" + } + return attr, nil +} + +func (e *ST_TextStrikeType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "noStrike": + *e = 1 + case "sngStrike": + *e = 2 + case "dblStrike": + *e = 3 + } + return nil +} + +func (m ST_TextStrikeType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_TextStrikeType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "noStrike": + *m = 1 + case "sngStrike": + *m = 2 + case "dblStrike": + *m = 3 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_TextStrikeType) String() string { + switch m { + case 0: + return "" + case 1: + return "noStrike" + case 2: + return "sngStrike" + case 3: + return "dblStrike" + } + return "" +} + +func (m ST_TextStrikeType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_TextStrikeType) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_TextCapsType byte + +const ( + ST_TextCapsTypeUnset ST_TextCapsType = 0 + ST_TextCapsTypeNone ST_TextCapsType = 1 + ST_TextCapsTypeSmall ST_TextCapsType = 2 + ST_TextCapsTypeAll ST_TextCapsType = 3 +) + +func (e ST_TextCapsType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_TextCapsTypeUnset: + attr.Value = "" + case ST_TextCapsTypeNone: + attr.Value = "none" + case ST_TextCapsTypeSmall: + attr.Value = "small" + case ST_TextCapsTypeAll: + attr.Value = "all" + } + return attr, nil +} + +func (e *ST_TextCapsType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "none": + *e = 1 + case "small": + *e = 2 + case "all": + *e = 3 + } + return nil +} + +func (m ST_TextCapsType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_TextCapsType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "none": + *m = 1 + case "small": + *m = 2 + case "all": + *m = 3 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_TextCapsType) String() string { + switch m { + case 0: + return "" + case 1: + return "none" + case 2: + return "small" + case 3: + return "all" + } + return "" +} + +func (m ST_TextCapsType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_TextCapsType) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_TextTabAlignType byte + +const ( + ST_TextTabAlignTypeUnset ST_TextTabAlignType = 0 + ST_TextTabAlignTypeL ST_TextTabAlignType = 1 + ST_TextTabAlignTypeCtr ST_TextTabAlignType = 2 + ST_TextTabAlignTypeR ST_TextTabAlignType = 3 + ST_TextTabAlignTypeDec ST_TextTabAlignType = 4 +) + +func (e ST_TextTabAlignType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_TextTabAlignTypeUnset: + attr.Value = "" + case ST_TextTabAlignTypeL: + attr.Value = "l" + case ST_TextTabAlignTypeCtr: + attr.Value = "ctr" + case ST_TextTabAlignTypeR: + attr.Value = "r" + case ST_TextTabAlignTypeDec: + attr.Value = "dec" + } + return attr, nil +} + +func (e *ST_TextTabAlignType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "l": + *e = 1 + case "ctr": + *e = 2 + case "r": + *e = 3 + case "dec": + *e = 4 + } + return nil +} + +func (m ST_TextTabAlignType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_TextTabAlignType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "l": + *m = 1 + case "ctr": + *m = 2 + case "r": + *m = 3 + case "dec": + *m = 4 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_TextTabAlignType) String() string { + switch m { + case 0: + return "" + case 1: + return "l" + case 2: + return "ctr" + case 3: + return "r" + case 4: + return "dec" + } + return "" +} + +func (m ST_TextTabAlignType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_TextTabAlignType) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_TextAlignType byte + +const ( + ST_TextAlignTypeUnset ST_TextAlignType = 0 + ST_TextAlignTypeL ST_TextAlignType = 1 + ST_TextAlignTypeCtr ST_TextAlignType = 2 + ST_TextAlignTypeR ST_TextAlignType = 3 + ST_TextAlignTypeJust ST_TextAlignType = 4 + ST_TextAlignTypeJustLow ST_TextAlignType = 5 + ST_TextAlignTypeDist ST_TextAlignType = 6 + ST_TextAlignTypeThaiDist ST_TextAlignType = 7 +) + +func (e ST_TextAlignType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_TextAlignTypeUnset: + attr.Value = "" + case ST_TextAlignTypeL: + attr.Value = "l" + case ST_TextAlignTypeCtr: + attr.Value = "ctr" + case ST_TextAlignTypeR: + attr.Value = "r" + case ST_TextAlignTypeJust: + attr.Value = "just" + case ST_TextAlignTypeJustLow: + attr.Value = "justLow" + case ST_TextAlignTypeDist: + attr.Value = "dist" + case ST_TextAlignTypeThaiDist: + attr.Value = "thaiDist" + } + return attr, nil +} + +func (e *ST_TextAlignType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "l": + *e = 1 + case "ctr": + *e = 2 + case "r": + *e = 3 + case "just": + *e = 4 + case "justLow": + *e = 5 + case "dist": + *e = 6 + case "thaiDist": + *e = 7 + } + return nil +} + +func (m ST_TextAlignType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_TextAlignType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "l": + *m = 1 + case "ctr": + *m = 2 + case "r": + *m = 3 + case "just": + *m = 4 + case "justLow": + *m = 5 + case "dist": + *m = 6 + case "thaiDist": + *m = 7 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_TextAlignType) String() string { + switch m { + case 0: + return "" + case 1: + return "l" + case 2: + return "ctr" + case 3: + return "r" + case 4: + return "just" + case 5: + return "justLow" + case 6: + return "dist" + case 7: + return "thaiDist" + } + return "" +} + +func (m ST_TextAlignType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_TextAlignType) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_TextFontAlignType byte + +const ( + ST_TextFontAlignTypeUnset ST_TextFontAlignType = 0 + ST_TextFontAlignTypeAuto ST_TextFontAlignType = 1 + ST_TextFontAlignTypeT ST_TextFontAlignType = 2 + ST_TextFontAlignTypeCtr ST_TextFontAlignType = 3 + ST_TextFontAlignTypeBase ST_TextFontAlignType = 4 + ST_TextFontAlignTypeB ST_TextFontAlignType = 5 +) + +func (e ST_TextFontAlignType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_TextFontAlignTypeUnset: + attr.Value = "" + case ST_TextFontAlignTypeAuto: + attr.Value = "auto" + case ST_TextFontAlignTypeT: + attr.Value = "t" + case ST_TextFontAlignTypeCtr: + attr.Value = "ctr" + case ST_TextFontAlignTypeBase: + attr.Value = "base" + case ST_TextFontAlignTypeB: + attr.Value = "b" + } + return attr, nil +} + +func (e *ST_TextFontAlignType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "auto": + *e = 1 + case "t": + *e = 2 + case "ctr": + *e = 3 + case "base": + *e = 4 + case "b": + *e = 5 + } + return nil +} + +func (m ST_TextFontAlignType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_TextFontAlignType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "auto": + *m = 1 + case "t": + *m = 2 + case "ctr": + *m = 3 + case "base": + *m = 4 + case "b": + *m = 5 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_TextFontAlignType) String() string { + switch m { + case 0: + return "" + case 1: + return "auto" + case 2: + return "t" + case 3: + return "ctr" + case 4: + return "base" + case 5: + return "b" + } + return "" +} + +func (m ST_TextFontAlignType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_TextFontAlignType) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +// init registers constructor functions for dynamically creating elements based off the XML namespace and name +func init() { + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_AudioFile", NewCT_AudioFile) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_VideoFile", NewCT_VideoFile) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_QuickTimeFile", NewCT_QuickTimeFile) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_AudioCDTime", NewCT_AudioCDTime) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_AudioCD", NewCT_AudioCD) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_ColorScheme", NewCT_ColorScheme) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_CustomColor", NewCT_CustomColor) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_SupplementalFont", NewCT_SupplementalFont) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_CustomColorList", NewCT_CustomColorList) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_FontCollection", NewCT_FontCollection) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_EffectStyleItem", NewCT_EffectStyleItem) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_FontScheme", NewCT_FontScheme) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_FillStyleList", NewCT_FillStyleList) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_LineStyleList", NewCT_LineStyleList) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_EffectStyleList", NewCT_EffectStyleList) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_BackgroundFillStyleList", NewCT_BackgroundFillStyleList) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_StyleMatrix", NewCT_StyleMatrix) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_BaseStyles", NewCT_BaseStyles) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_OfficeArtExtension", NewCT_OfficeArtExtension) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_Angle", NewCT_Angle) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_PositiveFixedAngle", NewCT_PositiveFixedAngle) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_Percentage", NewCT_Percentage) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_PositivePercentage", NewCT_PositivePercentage) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_FixedPercentage", NewCT_FixedPercentage) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_PositiveFixedPercentage", NewCT_PositiveFixedPercentage) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_Ratio", NewCT_Ratio) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_Point2D", NewCT_Point2D) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_PositiveSize2D", NewCT_PositiveSize2D) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_ComplementTransform", NewCT_ComplementTransform) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_InverseTransform", NewCT_InverseTransform) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_GrayscaleTransform", NewCT_GrayscaleTransform) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_GammaTransform", NewCT_GammaTransform) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_InverseGammaTransform", NewCT_InverseGammaTransform) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_ScRgbColor", NewCT_ScRgbColor) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_SRgbColor", NewCT_SRgbColor) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_HslColor", NewCT_HslColor) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_SystemColor", NewCT_SystemColor) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_SchemeColor", NewCT_SchemeColor) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_PresetColor", NewCT_PresetColor) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_OfficeArtExtensionList", NewCT_OfficeArtExtensionList) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_Scale2D", NewCT_Scale2D) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_Transform2D", NewCT_Transform2D) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_GroupTransform2D", NewCT_GroupTransform2D) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_Point3D", NewCT_Point3D) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_Vector3D", NewCT_Vector3D) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_SphereCoords", NewCT_SphereCoords) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_RelativeRect", NewCT_RelativeRect) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_Color", NewCT_Color) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_ColorMRU", NewCT_ColorMRU) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_EmbeddedWAVAudioFile", NewCT_EmbeddedWAVAudioFile) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_Hyperlink", NewCT_Hyperlink) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_ConnectorLocking", NewCT_ConnectorLocking) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_ShapeLocking", NewCT_ShapeLocking) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_PictureLocking", NewCT_PictureLocking) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_GroupLocking", NewCT_GroupLocking) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_GraphicalObjectFrameLocking", NewCT_GraphicalObjectFrameLocking) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_ContentPartLocking", NewCT_ContentPartLocking) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_NonVisualDrawingProps", NewCT_NonVisualDrawingProps) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_NonVisualDrawingShapeProps", NewCT_NonVisualDrawingShapeProps) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_NonVisualConnectorProperties", NewCT_NonVisualConnectorProperties) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_NonVisualPictureProperties", NewCT_NonVisualPictureProperties) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_NonVisualGroupDrawingShapeProps", NewCT_NonVisualGroupDrawingShapeProps) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_NonVisualGraphicFrameProperties", NewCT_NonVisualGraphicFrameProperties) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_NonVisualContentPartProperties", NewCT_NonVisualContentPartProperties) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_GraphicalObjectData", NewCT_GraphicalObjectData) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_GraphicalObject", NewCT_GraphicalObject) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_AnimationDgmElement", NewCT_AnimationDgmElement) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_AnimationChartElement", NewCT_AnimationChartElement) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_AnimationElementChoice", NewCT_AnimationElementChoice) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_AnimationDgmBuildProperties", NewCT_AnimationDgmBuildProperties) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_AnimationChartBuildProperties", NewCT_AnimationChartBuildProperties) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_AnimationGraphicalObjectBuildProperties", NewCT_AnimationGraphicalObjectBuildProperties) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_BackgroundFormatting", NewCT_BackgroundFormatting) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_WholeE2oFormatting", NewCT_WholeE2oFormatting) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_GvmlUseShapeRectangle", NewCT_GvmlUseShapeRectangle) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_GvmlTextShape", NewCT_GvmlTextShape) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_GvmlShapeNonVisual", NewCT_GvmlShapeNonVisual) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_GvmlShape", NewCT_GvmlShape) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_GvmlConnectorNonVisual", NewCT_GvmlConnectorNonVisual) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_GvmlConnector", NewCT_GvmlConnector) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_GvmlPictureNonVisual", NewCT_GvmlPictureNonVisual) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_GvmlPicture", NewCT_GvmlPicture) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_GvmlGraphicFrameNonVisual", NewCT_GvmlGraphicFrameNonVisual) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_GvmlGraphicalObjectFrame", NewCT_GvmlGraphicalObjectFrame) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_GvmlGroupShapeNonVisual", NewCT_GvmlGroupShapeNonVisual) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_GvmlGroupShape", NewCT_GvmlGroupShape) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_Camera", NewCT_Camera) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_LightRig", NewCT_LightRig) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_Scene3D", NewCT_Scene3D) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_Backdrop", NewCT_Backdrop) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_Bevel", NewCT_Bevel) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_Shape3D", NewCT_Shape3D) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_FlatText", NewCT_FlatText) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_AlphaBiLevelEffect", NewCT_AlphaBiLevelEffect) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_AlphaCeilingEffect", NewCT_AlphaCeilingEffect) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_AlphaFloorEffect", NewCT_AlphaFloorEffect) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_AlphaInverseEffect", NewCT_AlphaInverseEffect) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_AlphaModulateFixedEffect", NewCT_AlphaModulateFixedEffect) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_AlphaOutsetEffect", NewCT_AlphaOutsetEffect) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_AlphaReplaceEffect", NewCT_AlphaReplaceEffect) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_BiLevelEffect", NewCT_BiLevelEffect) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_BlurEffect", NewCT_BlurEffect) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_ColorChangeEffect", NewCT_ColorChangeEffect) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_ColorReplaceEffect", NewCT_ColorReplaceEffect) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_DuotoneEffect", NewCT_DuotoneEffect) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_GlowEffect", NewCT_GlowEffect) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_GrayscaleEffect", NewCT_GrayscaleEffect) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_HSLEffect", NewCT_HSLEffect) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_InnerShadowEffect", NewCT_InnerShadowEffect) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_LuminanceEffect", NewCT_LuminanceEffect) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_OuterShadowEffect", NewCT_OuterShadowEffect) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_PresetShadowEffect", NewCT_PresetShadowEffect) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_ReflectionEffect", NewCT_ReflectionEffect) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_RelativeOffsetEffect", NewCT_RelativeOffsetEffect) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_SoftEdgesEffect", NewCT_SoftEdgesEffect) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TintEffect", NewCT_TintEffect) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TransformEffect", NewCT_TransformEffect) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_NoFillProperties", NewCT_NoFillProperties) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_SolidColorFillProperties", NewCT_SolidColorFillProperties) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_LinearShadeProperties", NewCT_LinearShadeProperties) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_PathShadeProperties", NewCT_PathShadeProperties) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_GradientStop", NewCT_GradientStop) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_GradientStopList", NewCT_GradientStopList) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_GradientFillProperties", NewCT_GradientFillProperties) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TileInfoProperties", NewCT_TileInfoProperties) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_StretchInfoProperties", NewCT_StretchInfoProperties) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_Blip", NewCT_Blip) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_BlipFillProperties", NewCT_BlipFillProperties) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_PatternFillProperties", NewCT_PatternFillProperties) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_GroupFillProperties", NewCT_GroupFillProperties) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_FillProperties", NewCT_FillProperties) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_FillEffect", NewCT_FillEffect) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_FillOverlayEffect", NewCT_FillOverlayEffect) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_EffectReference", NewCT_EffectReference) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_EffectContainer", NewCT_EffectContainer) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_AlphaModulateEffect", NewCT_AlphaModulateEffect) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_BlendEffect", NewCT_BlendEffect) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_EffectList", NewCT_EffectList) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_EffectProperties", NewCT_EffectProperties) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_GeomGuide", NewCT_GeomGuide) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_GeomGuideList", NewCT_GeomGuideList) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_AdjPoint2D", NewCT_AdjPoint2D) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_GeomRect", NewCT_GeomRect) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_XYAdjustHandle", NewCT_XYAdjustHandle) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_PolarAdjustHandle", NewCT_PolarAdjustHandle) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_ConnectionSite", NewCT_ConnectionSite) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_AdjustHandleList", NewCT_AdjustHandleList) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_ConnectionSiteList", NewCT_ConnectionSiteList) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_Connection", NewCT_Connection) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_Path2DMoveTo", NewCT_Path2DMoveTo) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_Path2DLineTo", NewCT_Path2DLineTo) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_Path2DArcTo", NewCT_Path2DArcTo) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_Path2DQuadBezierTo", NewCT_Path2DQuadBezierTo) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_Path2DCubicBezierTo", NewCT_Path2DCubicBezierTo) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_Path2DClose", NewCT_Path2DClose) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_Path2D", NewCT_Path2D) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_Path2DList", NewCT_Path2DList) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_PresetGeometry2D", NewCT_PresetGeometry2D) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_PresetTextShape", NewCT_PresetTextShape) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_CustomGeometry2D", NewCT_CustomGeometry2D) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_LineEndProperties", NewCT_LineEndProperties) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_LineJoinBevel", NewCT_LineJoinBevel) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_LineJoinRound", NewCT_LineJoinRound) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_LineJoinMiterProperties", NewCT_LineJoinMiterProperties) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_PresetLineDashProperties", NewCT_PresetLineDashProperties) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_DashStop", NewCT_DashStop) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_DashStopList", NewCT_DashStopList) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_LineProperties", NewCT_LineProperties) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_ShapeProperties", NewCT_ShapeProperties) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_GroupShapeProperties", NewCT_GroupShapeProperties) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_StyleMatrixReference", NewCT_StyleMatrixReference) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_FontReference", NewCT_FontReference) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_ShapeStyle", NewCT_ShapeStyle) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_DefaultShapeDefinition", NewCT_DefaultShapeDefinition) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_ObjectStyleDefaults", NewCT_ObjectStyleDefaults) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_EmptyElement", NewCT_EmptyElement) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_ColorMapping", NewCT_ColorMapping) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_ColorMappingOverride", NewCT_ColorMappingOverride) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_ColorSchemeAndMapping", NewCT_ColorSchemeAndMapping) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_ColorSchemeList", NewCT_ColorSchemeList) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_OfficeStyleSheet", NewCT_OfficeStyleSheet) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_BaseStylesOverride", NewCT_BaseStylesOverride) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_ClipboardStyleSheet", NewCT_ClipboardStyleSheet) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TableCellProperties", NewCT_TableCellProperties) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_Headers", NewCT_Headers) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TableCol", NewCT_TableCol) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TableGrid", NewCT_TableGrid) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TableCell", NewCT_TableCell) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TableRow", NewCT_TableRow) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TableProperties", NewCT_TableProperties) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_Table", NewCT_Table) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_Cell3D", NewCT_Cell3D) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_ThemeableLineStyle", NewCT_ThemeableLineStyle) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TableStyleTextStyle", NewCT_TableStyleTextStyle) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TableCellBorderStyle", NewCT_TableCellBorderStyle) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TableBackgroundStyle", NewCT_TableBackgroundStyle) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TableStyleCellStyle", NewCT_TableStyleCellStyle) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TablePartStyle", NewCT_TablePartStyle) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TableStyle", NewCT_TableStyle) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TableStyleList", NewCT_TableStyleList) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TextParagraph", NewCT_TextParagraph) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TextListStyle", NewCT_TextListStyle) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TextNormalAutofit", NewCT_TextNormalAutofit) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TextShapeAutofit", NewCT_TextShapeAutofit) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TextNoAutofit", NewCT_TextNoAutofit) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TextBodyProperties", NewCT_TextBodyProperties) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TextBody", NewCT_TextBody) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TextBulletColorFollowText", NewCT_TextBulletColorFollowText) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TextBulletSizeFollowText", NewCT_TextBulletSizeFollowText) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TextBulletSizePercent", NewCT_TextBulletSizePercent) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TextBulletSizePoint", NewCT_TextBulletSizePoint) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TextBulletTypefaceFollowText", NewCT_TextBulletTypefaceFollowText) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TextAutonumberBullet", NewCT_TextAutonumberBullet) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TextCharBullet", NewCT_TextCharBullet) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TextBlipBullet", NewCT_TextBlipBullet) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TextNoBullet", NewCT_TextNoBullet) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TextFont", NewCT_TextFont) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TextUnderlineLineFollowText", NewCT_TextUnderlineLineFollowText) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TextUnderlineFillFollowText", NewCT_TextUnderlineFillFollowText) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TextUnderlineFillGroupWrapper", NewCT_TextUnderlineFillGroupWrapper) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TextCharacterProperties", NewCT_TextCharacterProperties) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_Boolean", NewCT_Boolean) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TextSpacingPercent", NewCT_TextSpacingPercent) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TextSpacingPoint", NewCT_TextSpacingPoint) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TextTabStop", NewCT_TextTabStop) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TextTabStopList", NewCT_TextTabStopList) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TextLineBreak", NewCT_TextLineBreak) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TextSpacing", NewCT_TextSpacing) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TextParagraphProperties", NewCT_TextParagraphProperties) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_TextField", NewCT_TextField) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "CT_RegularTextRun", NewCT_RegularTextRun) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "videoFile", NewVideoFile) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "graphic", NewGraphic) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "blip", NewBlip) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "theme", NewTheme) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "themeOverride", NewThemeOverride) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "themeManager", NewThemeManager) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "tbl", NewTbl) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "tblStyleLst", NewTblStyleLst) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "EG_Media", NewEG_Media) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "EG_ColorTransform", NewEG_ColorTransform) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "EG_OfficeArtExtensionList", NewEG_OfficeArtExtensionList) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "EG_ColorChoice", NewEG_ColorChoice) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "EG_Text3D", NewEG_Text3D) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "EG_ShadeProperties", NewEG_ShadeProperties) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "EG_FillModeProperties", NewEG_FillModeProperties) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "EG_FillProperties", NewEG_FillProperties) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "EG_Effect", NewEG_Effect) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "EG_EffectProperties", NewEG_EffectProperties) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "EG_Geometry", NewEG_Geometry) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "EG_TextGeometry", NewEG_TextGeometry) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "EG_LineFillProperties", NewEG_LineFillProperties) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "EG_LineJoinProperties", NewEG_LineJoinProperties) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "EG_LineDashProperties", NewEG_LineDashProperties) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "EG_ThemeableFillStyle", NewEG_ThemeableFillStyle) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "EG_ThemeableEffectStyle", NewEG_ThemeableEffectStyle) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "EG_ThemeableFontStyles", NewEG_ThemeableFontStyles) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "EG_TextAutofit", NewEG_TextAutofit) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "EG_TextBulletColor", NewEG_TextBulletColor) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "EG_TextBulletSize", NewEG_TextBulletSize) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "EG_TextBulletTypeface", NewEG_TextBulletTypeface) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "EG_TextBullet", NewEG_TextBullet) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "EG_TextUnderlineLine", NewEG_TextUnderlineLine) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "EG_TextUnderlineFill", NewEG_TextUnderlineFill) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "EG_TextRun", NewEG_TextRun) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "AG_Blob", NewAG_Blob) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/main", "AG_Locking", NewAG_Locking) +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/picture/CT_Picture.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/picture/CT_Picture.go new file mode 100644 index 00000000..c1f2f42d --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/picture/CT_Picture.go @@ -0,0 +1,102 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package picture + +import ( + "encoding/xml" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/dml" +) + +type CT_Picture struct { + NvPicPr *CT_PictureNonVisual + BlipFill *dml.CT_BlipFillProperties + SpPr *dml.CT_ShapeProperties +} + +func NewCT_Picture() *CT_Picture { + ret := &CT_Picture{} + ret.NvPicPr = NewCT_PictureNonVisual() + ret.BlipFill = dml.NewCT_BlipFillProperties() + ret.SpPr = dml.NewCT_ShapeProperties() + return ret +} + +func (m *CT_Picture) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + senvPicPr := xml.StartElement{Name: xml.Name{Local: "pic:nvPicPr"}} + e.EncodeElement(m.NvPicPr, senvPicPr) + seblipFill := xml.StartElement{Name: xml.Name{Local: "pic:blipFill"}} + e.EncodeElement(m.BlipFill, seblipFill) + sespPr := xml.StartElement{Name: xml.Name{Local: "pic:spPr"}} + e.EncodeElement(m.SpPr, sespPr) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Picture) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.NvPicPr = NewCT_PictureNonVisual() + m.BlipFill = dml.NewCT_BlipFillProperties() + m.SpPr = dml.NewCT_ShapeProperties() +lCT_Picture: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/picture", Local: "nvPicPr"}: + if err := d.DecodeElement(m.NvPicPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/picture", Local: "blipFill"}: + if err := d.DecodeElement(m.BlipFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/picture", Local: "spPr"}: + if err := d.DecodeElement(m.SpPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_Picture %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Picture + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Picture and its children +func (m *CT_Picture) Validate() error { + return m.ValidateWithPath("CT_Picture") +} + +// ValidateWithPath validates the CT_Picture and its children, prefixing error messages with path +func (m *CT_Picture) ValidateWithPath(path string) error { + if err := m.NvPicPr.ValidateWithPath(path + "/NvPicPr"); err != nil { + return err + } + if err := m.BlipFill.ValidateWithPath(path + "/BlipFill"); err != nil { + return err + } + if err := m.SpPr.ValidateWithPath(path + "/SpPr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/picture/CT_PictureNonVisual.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/picture/CT_PictureNonVisual.go new file mode 100644 index 00000000..95784a6e --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/picture/CT_PictureNonVisual.go @@ -0,0 +1,90 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package picture + +import ( + "encoding/xml" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/dml" +) + +type CT_PictureNonVisual struct { + CNvPr *dml.CT_NonVisualDrawingProps + CNvPicPr *dml.CT_NonVisualPictureProperties +} + +func NewCT_PictureNonVisual() *CT_PictureNonVisual { + ret := &CT_PictureNonVisual{} + ret.CNvPr = dml.NewCT_NonVisualDrawingProps() + ret.CNvPicPr = dml.NewCT_NonVisualPictureProperties() + return ret +} + +func (m *CT_PictureNonVisual) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + secNvPr := xml.StartElement{Name: xml.Name{Local: "pic:cNvPr"}} + e.EncodeElement(m.CNvPr, secNvPr) + secNvPicPr := xml.StartElement{Name: xml.Name{Local: "pic:cNvPicPr"}} + e.EncodeElement(m.CNvPicPr, secNvPicPr) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_PictureNonVisual) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CNvPr = dml.NewCT_NonVisualDrawingProps() + m.CNvPicPr = dml.NewCT_NonVisualPictureProperties() +lCT_PictureNonVisual: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/picture", Local: "cNvPr"}: + if err := d.DecodeElement(m.CNvPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/picture", Local: "cNvPicPr"}: + if err := d.DecodeElement(m.CNvPicPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_PictureNonVisual %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_PictureNonVisual + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_PictureNonVisual and its children +func (m *CT_PictureNonVisual) Validate() error { + return m.ValidateWithPath("CT_PictureNonVisual") +} + +// ValidateWithPath validates the CT_PictureNonVisual and its children, prefixing error messages with path +func (m *CT_PictureNonVisual) ValidateWithPath(path string) error { + if err := m.CNvPr.ValidateWithPath(path + "/CNvPr"); err != nil { + return err + } + if err := m.CNvPicPr.ValidateWithPath(path + "/CNvPicPr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/picture/Pic.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/picture/Pic.go new file mode 100644 index 00000000..0c1f2d34 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/picture/Pic.go @@ -0,0 +1,85 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package picture + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type Pic struct { + CT_Picture +} + +func NewPic() *Pic { + ret := &Pic{} + ret.CT_Picture = *NewCT_Picture() + return ret +} + +func (m *Pic) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/picture"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:pic"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/picture"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:xml"}, Value: "http://www.w3.org/XML/1998/namespace"}) + start.Name.Local = "pic:pic" + return m.CT_Picture.MarshalXML(e, start) +} + +func (m *Pic) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CT_Picture = *NewCT_Picture() +lPic: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/picture", Local: "nvPicPr"}: + if err := d.DecodeElement(m.NvPicPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/picture", Local: "blipFill"}: + if err := d.DecodeElement(m.BlipFill, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/picture", Local: "spPr"}: + if err := d.DecodeElement(m.SpPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on Pic %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lPic + case xml.CharData: + } + } + return nil +} + +// Validate validates the Pic and its children +func (m *Pic) Validate() error { + return m.ValidateWithPath("Pic") +} + +// ValidateWithPath validates the Pic and its children, prefixing error messages with path +func (m *Pic) ValidateWithPath(path string) error { + if err := m.CT_Picture.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/dml/picture/common.go b/backend/vendor/baliance.com/gooxml/schema/soo/dml/picture/common.go new file mode 100644 index 00000000..7c2c0340 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/dml/picture/common.go @@ -0,0 +1,19 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package picture + +import "baliance.com/gooxml" + +// init registers constructor functions for dynamically creating elements based off the XML namespace and name +func init() { + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/picture", "CT_PictureNonVisual", NewCT_PictureNonVisual) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/picture", "CT_Picture", NewCT_Picture) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/picture", "pic", NewPic) +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/docPropsVTypes/Array.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/docPropsVTypes/Array.go new file mode 100644 index 00000000..c7cc43f5 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/docPropsVTypes/Array.go @@ -0,0 +1,195 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package docPropsVTypes + +import ( + "encoding/xml" + "strconv" + "time" + + "baliance.com/gooxml" +) + +type Array struct { + CT_Array +} + +func NewArray() *Array { + ret := &Array{} + ret.CT_Array = *NewCT_Array() + return ret +} + +func (m *Array) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return m.CT_Array.MarshalXML(e, start) +} + +func (m *Array) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CT_Array = *NewCT_Array() + for _, attr := range start.Attr { + if attr.Name.Local == "uBounds" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + m.UBoundsAttr = int32(parsed) + continue + } + if attr.Name.Local == "baseType" { + m.BaseTypeAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "lBounds" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + m.LBoundsAttr = int32(parsed) + continue + } + } +lArray: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "variant"}: + tmp := NewVariant() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Variant = append(m.Variant, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "i1"}: + var tmp int8 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.I1 = append(m.I1, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "i2"}: + var tmp int16 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.I2 = append(m.I2, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "i4"}: + var tmp int32 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.I4 = append(m.I4, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "int"}: + var tmp int32 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Int = append(m.Int, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "ui1"}: + var tmp uint8 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Ui1 = append(m.Ui1, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "ui2"}: + var tmp uint16 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Ui2 = append(m.Ui2, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "ui4"}: + var tmp uint32 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Ui4 = append(m.Ui4, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "uint"}: + var tmp uint32 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Uint = append(m.Uint, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "r4"}: + var tmp float32 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.R4 = append(m.R4, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "r8"}: + var tmp float64 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.R8 = append(m.R8, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "decimal"}: + var tmp float64 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Decimal = append(m.Decimal, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "bstr"}: + var tmp string + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Bstr = append(m.Bstr, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "date"}: + var tmp time.Time + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Date = append(m.Date, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "bool"}: + var tmp bool + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Bool = append(m.Bool, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "error"}: + var tmp string + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Error = append(m.Error, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "cy"}: + var tmp string + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Cy = append(m.Cy, tmp) + default: + gooxml.Log("skipping unsupported element on Array %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lArray + case xml.CharData: + } + } + return nil +} + +// Validate validates the Array and its children +func (m *Array) Validate() error { + return m.ValidateWithPath("Array") +} + +// ValidateWithPath validates the Array and its children, prefixing error messages with path +func (m *Array) ValidateWithPath(path string) error { + if err := m.CT_Array.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/docPropsVTypes/CT_Array.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/docPropsVTypes/CT_Array.go new file mode 100644 index 00000000..3d085b56 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/docPropsVTypes/CT_Array.go @@ -0,0 +1,346 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package docPropsVTypes + +import ( + "encoding/xml" + "fmt" + "strconv" + "time" + + "baliance.com/gooxml" +) + +type CT_Array struct { + LBoundsAttr int32 + UBoundsAttr int32 + BaseTypeAttr ST_ArrayBaseType + Variant []*Variant + I1 []int8 + I2 []int16 + I4 []int32 + Int []int32 + Ui1 []uint8 + Ui2 []uint16 + Ui4 []uint32 + Uint []uint32 + R4 []float32 + R8 []float64 + Decimal []float64 + Bstr []string + Date []time.Time + Bool []bool + Error []string + Cy []string +} + +func NewCT_Array() *CT_Array { + ret := &CT_Array{} + ret.BaseTypeAttr = ST_ArrayBaseType(1) + return ret +} + +func (m *CT_Array) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "lBounds"}, + Value: fmt.Sprintf("%v", m.LBoundsAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "uBounds"}, + Value: fmt.Sprintf("%v", m.UBoundsAttr)}) + attr, err := m.BaseTypeAttr.MarshalXMLAttr(xml.Name{Local: "baseType"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + if m.Variant != nil { + sevariant := xml.StartElement{Name: xml.Name{Local: "vt:variant"}} + for _, c := range m.Variant { + e.EncodeElement(c, sevariant) + } + } + if m.I1 != nil { + sei1 := xml.StartElement{Name: xml.Name{Local: "vt:i1"}} + for _, c := range m.I1 { + e.EncodeElement(c, sei1) + } + } + if m.I2 != nil { + sei2 := xml.StartElement{Name: xml.Name{Local: "vt:i2"}} + for _, c := range m.I2 { + e.EncodeElement(c, sei2) + } + } + if m.I4 != nil { + sei4 := xml.StartElement{Name: xml.Name{Local: "vt:i4"}} + for _, c := range m.I4 { + e.EncodeElement(c, sei4) + } + } + if m.Int != nil { + seint := xml.StartElement{Name: xml.Name{Local: "vt:int"}} + for _, c := range m.Int { + e.EncodeElement(c, seint) + } + } + if m.Ui1 != nil { + seui1 := xml.StartElement{Name: xml.Name{Local: "vt:ui1"}} + for _, c := range m.Ui1 { + e.EncodeElement(c, seui1) + } + } + if m.Ui2 != nil { + seui2 := xml.StartElement{Name: xml.Name{Local: "vt:ui2"}} + for _, c := range m.Ui2 { + e.EncodeElement(c, seui2) + } + } + if m.Ui4 != nil { + seui4 := xml.StartElement{Name: xml.Name{Local: "vt:ui4"}} + for _, c := range m.Ui4 { + e.EncodeElement(c, seui4) + } + } + if m.Uint != nil { + seuint := xml.StartElement{Name: xml.Name{Local: "vt:uint"}} + for _, c := range m.Uint { + e.EncodeElement(c, seuint) + } + } + if m.R4 != nil { + ser4 := xml.StartElement{Name: xml.Name{Local: "vt:r4"}} + for _, c := range m.R4 { + e.EncodeElement(c, ser4) + } + } + if m.R8 != nil { + ser8 := xml.StartElement{Name: xml.Name{Local: "vt:r8"}} + for _, c := range m.R8 { + e.EncodeElement(c, ser8) + } + } + if m.Decimal != nil { + sedecimal := xml.StartElement{Name: xml.Name{Local: "vt:decimal"}} + for _, c := range m.Decimal { + e.EncodeElement(c, sedecimal) + } + } + if m.Bstr != nil { + sebstr := xml.StartElement{Name: xml.Name{Local: "vt:bstr"}} + for _, c := range m.Bstr { + e.EncodeElement(c, sebstr) + } + } + if m.Date != nil { + sedate := xml.StartElement{Name: xml.Name{Local: "vt:date"}} + for _, c := range m.Date { + e.EncodeElement(c, sedate) + } + } + if m.Bool != nil { + sebool := xml.StartElement{Name: xml.Name{Local: "vt:bool"}} + for _, c := range m.Bool { + e.EncodeElement(c, sebool) + } + } + if m.Error != nil { + seerror := xml.StartElement{Name: xml.Name{Local: "vt:error"}} + for _, c := range m.Error { + e.EncodeElement(c, seerror) + } + } + if m.Cy != nil { + secy := xml.StartElement{Name: xml.Name{Local: "vt:cy"}} + for _, c := range m.Cy { + e.EncodeElement(c, secy) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Array) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.BaseTypeAttr = ST_ArrayBaseType(1) + for _, attr := range start.Attr { + if attr.Name.Local == "uBounds" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + m.UBoundsAttr = int32(parsed) + continue + } + if attr.Name.Local == "baseType" { + m.BaseTypeAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "lBounds" { + parsed, err := strconv.ParseInt(attr.Value, 10, 32) + if err != nil { + return err + } + m.LBoundsAttr = int32(parsed) + continue + } + } +lCT_Array: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "variant"}: + tmp := NewVariant() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Variant = append(m.Variant, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "i1"}: + var tmp int8 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.I1 = append(m.I1, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "i2"}: + var tmp int16 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.I2 = append(m.I2, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "i4"}: + var tmp int32 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.I4 = append(m.I4, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "int"}: + var tmp int32 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Int = append(m.Int, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "ui1"}: + var tmp uint8 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Ui1 = append(m.Ui1, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "ui2"}: + var tmp uint16 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Ui2 = append(m.Ui2, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "ui4"}: + var tmp uint32 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Ui4 = append(m.Ui4, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "uint"}: + var tmp uint32 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Uint = append(m.Uint, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "r4"}: + var tmp float32 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.R4 = append(m.R4, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "r8"}: + var tmp float64 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.R8 = append(m.R8, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "decimal"}: + var tmp float64 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Decimal = append(m.Decimal, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "bstr"}: + var tmp string + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Bstr = append(m.Bstr, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "date"}: + var tmp time.Time + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Date = append(m.Date, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "bool"}: + var tmp bool + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Bool = append(m.Bool, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "error"}: + var tmp string + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Error = append(m.Error, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "cy"}: + var tmp string + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Cy = append(m.Cy, tmp) + default: + gooxml.Log("skipping unsupported element on CT_Array %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Array + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Array and its children +func (m *CT_Array) Validate() error { + return m.ValidateWithPath("CT_Array") +} + +// ValidateWithPath validates the CT_Array and its children, prefixing error messages with path +func (m *CT_Array) ValidateWithPath(path string) error { + if m.BaseTypeAttr == ST_ArrayBaseTypeUnset { + return fmt.Errorf("%s/BaseTypeAttr is a mandatory field", path) + } + if err := m.BaseTypeAttr.ValidateWithPath(path + "/BaseTypeAttr"); err != nil { + return err + } + for i, v := range m.Variant { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Variant[%d]", path, i)); err != nil { + return err + } + } + for i, s := range m.Error { + if !ST_ErrorPatternRe.MatchString(s) { + return fmt.Errorf(`%s/m.Error[%d] must match '%s' (have %v)`, path, i, ST_ErrorPatternRe, s) + } + } + for i, s := range m.Cy { + if !ST_CyPatternRe.MatchString(s) { + return fmt.Errorf(`%s/m.Cy[%d] must match '%s' (have %v)`, path, i, ST_CyPatternRe, s) + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/docPropsVTypes/CT_Empty.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/docPropsVTypes/CT_Empty.go new file mode 100644 index 00000000..3d66f5c8 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/docPropsVTypes/CT_Empty.go @@ -0,0 +1,54 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package docPropsVTypes + +import ( + "encoding/xml" + "fmt" +) + +type CT_Empty struct { +} + +func NewCT_Empty() *CT_Empty { + ret := &CT_Empty{} + return ret +} + +func (m *CT_Empty) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Empty) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Empty: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Empty and its children +func (m *CT_Empty) Validate() error { + return m.ValidateWithPath("CT_Empty") +} + +// ValidateWithPath validates the CT_Empty and its children, prefixing error messages with path +func (m *CT_Empty) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/docPropsVTypes/CT_Null.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/docPropsVTypes/CT_Null.go new file mode 100644 index 00000000..3c080f95 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/docPropsVTypes/CT_Null.go @@ -0,0 +1,54 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package docPropsVTypes + +import ( + "encoding/xml" + "fmt" +) + +type CT_Null struct { +} + +func NewCT_Null() *CT_Null { + ret := &CT_Null{} + return ret +} + +func (m *CT_Null) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Null) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Null: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Null and its children +func (m *CT_Null) Validate() error { + return m.ValidateWithPath("CT_Null") +} + +// ValidateWithPath validates the CT_Null and its children, prefixing error messages with path +func (m *CT_Null) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/docPropsVTypes/CT_Variant.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/docPropsVTypes/CT_Variant.go new file mode 100644 index 00000000..528991e2 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/docPropsVTypes/CT_Variant.go @@ -0,0 +1,465 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package docPropsVTypes + +import ( + "encoding/xml" + "fmt" + "time" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_Variant struct { + Variant *Variant + Vector *Vector + Array *Array + Blob *string + Oblob *string + Empty *Empty + Null *Null + I1 *int8 + I2 *int16 + I4 *int32 + I8 *int64 + Int *int32 + Ui1 *uint8 + Ui2 *uint16 + Ui4 *uint32 + Ui8 *uint64 + Uint *uint32 + R4 *float32 + R8 *float64 + Decimal *float64 + Lpstr *string + Lpwstr *string + Bstr *string + Date *time.Time + Filetime *time.Time + Bool *bool + Cy *string + Error *string + Stream *string + Ostream *string + Storage *string + Ostorage *string + Vstream *Vstream + Clsid *string +} + +func NewCT_Variant() *CT_Variant { + ret := &CT_Variant{} + return ret +} + +func (m *CT_Variant) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Variant != nil { + sevariant := xml.StartElement{Name: xml.Name{Local: "vt:variant"}} + e.EncodeElement(m.Variant, sevariant) + } + if m.Vector != nil { + sevector := xml.StartElement{Name: xml.Name{Local: "vt:vector"}} + e.EncodeElement(m.Vector, sevector) + } + if m.Array != nil { + searray := xml.StartElement{Name: xml.Name{Local: "vt:array"}} + e.EncodeElement(m.Array, searray) + } + if m.Blob != nil { + seblob := xml.StartElement{Name: xml.Name{Local: "vt:blob"}} + gooxml.AddPreserveSpaceAttr(&seblob, *m.Blob) + e.EncodeElement(m.Blob, seblob) + } + if m.Oblob != nil { + seoblob := xml.StartElement{Name: xml.Name{Local: "vt:oblob"}} + gooxml.AddPreserveSpaceAttr(&seoblob, *m.Oblob) + e.EncodeElement(m.Oblob, seoblob) + } + if m.Empty != nil { + seempty := xml.StartElement{Name: xml.Name{Local: "vt:empty"}} + e.EncodeElement(m.Empty, seempty) + } + if m.Null != nil { + senull := xml.StartElement{Name: xml.Name{Local: "vt:null"}} + e.EncodeElement(m.Null, senull) + } + if m.I1 != nil { + sei1 := xml.StartElement{Name: xml.Name{Local: "vt:i1"}} + e.EncodeElement(m.I1, sei1) + } + if m.I2 != nil { + sei2 := xml.StartElement{Name: xml.Name{Local: "vt:i2"}} + e.EncodeElement(m.I2, sei2) + } + if m.I4 != nil { + sei4 := xml.StartElement{Name: xml.Name{Local: "vt:i4"}} + e.EncodeElement(m.I4, sei4) + } + if m.I8 != nil { + sei8 := xml.StartElement{Name: xml.Name{Local: "vt:i8"}} + e.EncodeElement(m.I8, sei8) + } + if m.Int != nil { + seint := xml.StartElement{Name: xml.Name{Local: "vt:int"}} + e.EncodeElement(m.Int, seint) + } + if m.Ui1 != nil { + seui1 := xml.StartElement{Name: xml.Name{Local: "vt:ui1"}} + e.EncodeElement(m.Ui1, seui1) + } + if m.Ui2 != nil { + seui2 := xml.StartElement{Name: xml.Name{Local: "vt:ui2"}} + e.EncodeElement(m.Ui2, seui2) + } + if m.Ui4 != nil { + seui4 := xml.StartElement{Name: xml.Name{Local: "vt:ui4"}} + e.EncodeElement(m.Ui4, seui4) + } + if m.Ui8 != nil { + seui8 := xml.StartElement{Name: xml.Name{Local: "vt:ui8"}} + e.EncodeElement(m.Ui8, seui8) + } + if m.Uint != nil { + seuint := xml.StartElement{Name: xml.Name{Local: "vt:uint"}} + e.EncodeElement(m.Uint, seuint) + } + if m.R4 != nil { + ser4 := xml.StartElement{Name: xml.Name{Local: "vt:r4"}} + e.EncodeElement(m.R4, ser4) + } + if m.R8 != nil { + ser8 := xml.StartElement{Name: xml.Name{Local: "vt:r8"}} + e.EncodeElement(m.R8, ser8) + } + if m.Decimal != nil { + sedecimal := xml.StartElement{Name: xml.Name{Local: "vt:decimal"}} + e.EncodeElement(m.Decimal, sedecimal) + } + if m.Lpstr != nil { + selpstr := xml.StartElement{Name: xml.Name{Local: "vt:lpstr"}} + gooxml.AddPreserveSpaceAttr(&selpstr, *m.Lpstr) + e.EncodeElement(m.Lpstr, selpstr) + } + if m.Lpwstr != nil { + selpwstr := xml.StartElement{Name: xml.Name{Local: "vt:lpwstr"}} + gooxml.AddPreserveSpaceAttr(&selpwstr, *m.Lpwstr) + e.EncodeElement(m.Lpwstr, selpwstr) + } + if m.Bstr != nil { + sebstr := xml.StartElement{Name: xml.Name{Local: "vt:bstr"}} + gooxml.AddPreserveSpaceAttr(&sebstr, *m.Bstr) + e.EncodeElement(m.Bstr, sebstr) + } + if m.Date != nil { + sedate := xml.StartElement{Name: xml.Name{Local: "vt:date"}} + e.EncodeElement(m.Date, sedate) + } + if m.Filetime != nil { + sefiletime := xml.StartElement{Name: xml.Name{Local: "vt:filetime"}} + e.EncodeElement(m.Filetime, sefiletime) + } + if m.Bool != nil { + sebool := xml.StartElement{Name: xml.Name{Local: "vt:bool"}} + e.EncodeElement(m.Bool, sebool) + } + if m.Cy != nil { + secy := xml.StartElement{Name: xml.Name{Local: "vt:cy"}} + gooxml.AddPreserveSpaceAttr(&secy, *m.Cy) + e.EncodeElement(m.Cy, secy) + } + if m.Error != nil { + seerror := xml.StartElement{Name: xml.Name{Local: "vt:error"}} + gooxml.AddPreserveSpaceAttr(&seerror, *m.Error) + e.EncodeElement(m.Error, seerror) + } + if m.Stream != nil { + sestream := xml.StartElement{Name: xml.Name{Local: "vt:stream"}} + gooxml.AddPreserveSpaceAttr(&sestream, *m.Stream) + e.EncodeElement(m.Stream, sestream) + } + if m.Ostream != nil { + seostream := xml.StartElement{Name: xml.Name{Local: "vt:ostream"}} + gooxml.AddPreserveSpaceAttr(&seostream, *m.Ostream) + e.EncodeElement(m.Ostream, seostream) + } + if m.Storage != nil { + sestorage := xml.StartElement{Name: xml.Name{Local: "vt:storage"}} + gooxml.AddPreserveSpaceAttr(&sestorage, *m.Storage) + e.EncodeElement(m.Storage, sestorage) + } + if m.Ostorage != nil { + seostorage := xml.StartElement{Name: xml.Name{Local: "vt:ostorage"}} + gooxml.AddPreserveSpaceAttr(&seostorage, *m.Ostorage) + e.EncodeElement(m.Ostorage, seostorage) + } + if m.Vstream != nil { + sevstream := xml.StartElement{Name: xml.Name{Local: "vt:vstream"}} + e.EncodeElement(m.Vstream, sevstream) + } + if m.Clsid != nil { + seclsid := xml.StartElement{Name: xml.Name{Local: "vt:clsid"}} + gooxml.AddPreserveSpaceAttr(&seclsid, *m.Clsid) + e.EncodeElement(m.Clsid, seclsid) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Variant) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_Variant: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "variant"}: + m.Variant = NewVariant() + if err := d.DecodeElement(m.Variant, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "vector"}: + m.Vector = NewVector() + if err := d.DecodeElement(m.Vector, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "array"}: + m.Array = NewArray() + if err := d.DecodeElement(m.Array, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "blob"}: + m.Blob = new(string) + if err := d.DecodeElement(m.Blob, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "oblob"}: + m.Oblob = new(string) + if err := d.DecodeElement(m.Oblob, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "empty"}: + m.Empty = NewEmpty() + if err := d.DecodeElement(m.Empty, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "null"}: + m.Null = NewNull() + if err := d.DecodeElement(m.Null, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "i1"}: + m.I1 = new(int8) + if err := d.DecodeElement(m.I1, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "i2"}: + m.I2 = new(int16) + if err := d.DecodeElement(m.I2, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "i4"}: + m.I4 = new(int32) + if err := d.DecodeElement(m.I4, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "i8"}: + m.I8 = new(int64) + if err := d.DecodeElement(m.I8, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "int"}: + m.Int = new(int32) + if err := d.DecodeElement(m.Int, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "ui1"}: + m.Ui1 = new(uint8) + if err := d.DecodeElement(m.Ui1, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "ui2"}: + m.Ui2 = new(uint16) + if err := d.DecodeElement(m.Ui2, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "ui4"}: + m.Ui4 = new(uint32) + if err := d.DecodeElement(m.Ui4, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "ui8"}: + m.Ui8 = new(uint64) + if err := d.DecodeElement(m.Ui8, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "uint"}: + m.Uint = new(uint32) + if err := d.DecodeElement(m.Uint, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "r4"}: + m.R4 = new(float32) + if err := d.DecodeElement(m.R4, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "r8"}: + m.R8 = new(float64) + if err := d.DecodeElement(m.R8, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "decimal"}: + m.Decimal = new(float64) + if err := d.DecodeElement(m.Decimal, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "lpstr"}: + m.Lpstr = new(string) + if err := d.DecodeElement(m.Lpstr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "lpwstr"}: + m.Lpwstr = new(string) + if err := d.DecodeElement(m.Lpwstr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "bstr"}: + m.Bstr = new(string) + if err := d.DecodeElement(m.Bstr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "date"}: + m.Date = new(time.Time) + if err := d.DecodeElement(m.Date, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "filetime"}: + m.Filetime = new(time.Time) + if err := d.DecodeElement(m.Filetime, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "bool"}: + m.Bool = new(bool) + if err := d.DecodeElement(m.Bool, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "cy"}: + m.Cy = new(string) + if err := d.DecodeElement(m.Cy, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "error"}: + m.Error = new(string) + if err := d.DecodeElement(m.Error, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "stream"}: + m.Stream = new(string) + if err := d.DecodeElement(m.Stream, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "ostream"}: + m.Ostream = new(string) + if err := d.DecodeElement(m.Ostream, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "storage"}: + m.Storage = new(string) + if err := d.DecodeElement(m.Storage, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "ostorage"}: + m.Ostorage = new(string) + if err := d.DecodeElement(m.Ostorage, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "vstream"}: + m.Vstream = NewVstream() + if err := d.DecodeElement(m.Vstream, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "clsid"}: + m.Clsid = new(string) + if err := d.DecodeElement(m.Clsid, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_Variant %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Variant + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Variant and its children +func (m *CT_Variant) Validate() error { + return m.ValidateWithPath("CT_Variant") +} + +// ValidateWithPath validates the CT_Variant and its children, prefixing error messages with path +func (m *CT_Variant) ValidateWithPath(path string) error { + if m.Variant != nil { + if err := m.Variant.ValidateWithPath(path + "/Variant"); err != nil { + return err + } + } + if m.Vector != nil { + if err := m.Vector.ValidateWithPath(path + "/Vector"); err != nil { + return err + } + } + if m.Array != nil { + if err := m.Array.ValidateWithPath(path + "/Array"); err != nil { + return err + } + } + if m.Empty != nil { + if err := m.Empty.ValidateWithPath(path + "/Empty"); err != nil { + return err + } + } + if m.Null != nil { + if err := m.Null.ValidateWithPath(path + "/Null"); err != nil { + return err + } + } + if m.Cy != nil { + if !ST_CyPatternRe.MatchString(*m.Cy) { + return fmt.Errorf(`%s/m.Cy must match '%s' (have %v)`, path, ST_CyPatternRe, *m.Cy) + } + } + if m.Error != nil { + if !ST_ErrorPatternRe.MatchString(*m.Error) { + return fmt.Errorf(`%s/m.Error must match '%s' (have %v)`, path, ST_ErrorPatternRe, *m.Error) + } + } + if m.Vstream != nil { + if err := m.Vstream.ValidateWithPath(path + "/Vstream"); err != nil { + return err + } + } + if m.Clsid != nil { + if !sharedTypes.ST_GuidPatternRe.MatchString(*m.Clsid) { + return fmt.Errorf(`%s/m.Clsid must match '%s' (have %v)`, path, sharedTypes.ST_GuidPatternRe, *m.Clsid) + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/docPropsVTypes/CT_Vector.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/docPropsVTypes/CT_Vector.go new file mode 100644 index 00000000..40adc999 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/docPropsVTypes/CT_Vector.go @@ -0,0 +1,380 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package docPropsVTypes + +import ( + "encoding/xml" + "fmt" + "strconv" + "time" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_Vector struct { + BaseTypeAttr ST_VectorBaseType + SizeAttr uint32 + Variant []*Variant + I1 []int8 + I2 []int16 + I4 []int32 + I8 []int64 + Ui1 []uint8 + Ui2 []uint16 + Ui4 []uint32 + Ui8 []uint64 + R4 []float32 + R8 []float64 + Lpstr []string + Lpwstr []string + Bstr []string + Date []time.Time + Filetime []time.Time + Bool []bool + Cy []string + Error []string + Clsid []string +} + +func NewCT_Vector() *CT_Vector { + ret := &CT_Vector{} + ret.BaseTypeAttr = ST_VectorBaseType(1) + return ret +} + +func (m *CT_Vector) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.BaseTypeAttr.MarshalXMLAttr(xml.Name{Local: "baseType"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "size"}, + Value: fmt.Sprintf("%v", m.SizeAttr)}) + e.EncodeToken(start) + if m.Variant != nil { + sevariant := xml.StartElement{Name: xml.Name{Local: "vt:variant"}} + for _, c := range m.Variant { + e.EncodeElement(c, sevariant) + } + } + if m.I1 != nil { + sei1 := xml.StartElement{Name: xml.Name{Local: "vt:i1"}} + for _, c := range m.I1 { + e.EncodeElement(c, sei1) + } + } + if m.I2 != nil { + sei2 := xml.StartElement{Name: xml.Name{Local: "vt:i2"}} + for _, c := range m.I2 { + e.EncodeElement(c, sei2) + } + } + if m.I4 != nil { + sei4 := xml.StartElement{Name: xml.Name{Local: "vt:i4"}} + for _, c := range m.I4 { + e.EncodeElement(c, sei4) + } + } + if m.I8 != nil { + sei8 := xml.StartElement{Name: xml.Name{Local: "vt:i8"}} + for _, c := range m.I8 { + e.EncodeElement(c, sei8) + } + } + if m.Ui1 != nil { + seui1 := xml.StartElement{Name: xml.Name{Local: "vt:ui1"}} + for _, c := range m.Ui1 { + e.EncodeElement(c, seui1) + } + } + if m.Ui2 != nil { + seui2 := xml.StartElement{Name: xml.Name{Local: "vt:ui2"}} + for _, c := range m.Ui2 { + e.EncodeElement(c, seui2) + } + } + if m.Ui4 != nil { + seui4 := xml.StartElement{Name: xml.Name{Local: "vt:ui4"}} + for _, c := range m.Ui4 { + e.EncodeElement(c, seui4) + } + } + if m.Ui8 != nil { + seui8 := xml.StartElement{Name: xml.Name{Local: "vt:ui8"}} + for _, c := range m.Ui8 { + e.EncodeElement(c, seui8) + } + } + if m.R4 != nil { + ser4 := xml.StartElement{Name: xml.Name{Local: "vt:r4"}} + for _, c := range m.R4 { + e.EncodeElement(c, ser4) + } + } + if m.R8 != nil { + ser8 := xml.StartElement{Name: xml.Name{Local: "vt:r8"}} + for _, c := range m.R8 { + e.EncodeElement(c, ser8) + } + } + if m.Lpstr != nil { + selpstr := xml.StartElement{Name: xml.Name{Local: "vt:lpstr"}} + for _, c := range m.Lpstr { + e.EncodeElement(c, selpstr) + } + } + if m.Lpwstr != nil { + selpwstr := xml.StartElement{Name: xml.Name{Local: "vt:lpwstr"}} + for _, c := range m.Lpwstr { + e.EncodeElement(c, selpwstr) + } + } + if m.Bstr != nil { + sebstr := xml.StartElement{Name: xml.Name{Local: "vt:bstr"}} + for _, c := range m.Bstr { + e.EncodeElement(c, sebstr) + } + } + if m.Date != nil { + sedate := xml.StartElement{Name: xml.Name{Local: "vt:date"}} + for _, c := range m.Date { + e.EncodeElement(c, sedate) + } + } + if m.Filetime != nil { + sefiletime := xml.StartElement{Name: xml.Name{Local: "vt:filetime"}} + for _, c := range m.Filetime { + e.EncodeElement(c, sefiletime) + } + } + if m.Bool != nil { + sebool := xml.StartElement{Name: xml.Name{Local: "vt:bool"}} + for _, c := range m.Bool { + e.EncodeElement(c, sebool) + } + } + if m.Cy != nil { + secy := xml.StartElement{Name: xml.Name{Local: "vt:cy"}} + for _, c := range m.Cy { + e.EncodeElement(c, secy) + } + } + if m.Error != nil { + seerror := xml.StartElement{Name: xml.Name{Local: "vt:error"}} + for _, c := range m.Error { + e.EncodeElement(c, seerror) + } + } + if m.Clsid != nil { + seclsid := xml.StartElement{Name: xml.Name{Local: "vt:clsid"}} + for _, c := range m.Clsid { + e.EncodeElement(c, seclsid) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Vector) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.BaseTypeAttr = ST_VectorBaseType(1) + for _, attr := range start.Attr { + if attr.Name.Local == "size" { + parsed, err := strconv.ParseUint(attr.Value, 10, 32) + if err != nil { + return err + } + m.SizeAttr = uint32(parsed) + continue + } + if attr.Name.Local == "baseType" { + m.BaseTypeAttr.UnmarshalXMLAttr(attr) + continue + } + } +lCT_Vector: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "variant"}: + tmp := NewVariant() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Variant = append(m.Variant, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "i1"}: + var tmp int8 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.I1 = append(m.I1, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "i2"}: + var tmp int16 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.I2 = append(m.I2, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "i4"}: + var tmp int32 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.I4 = append(m.I4, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "i8"}: + var tmp int64 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.I8 = append(m.I8, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "ui1"}: + var tmp uint8 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Ui1 = append(m.Ui1, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "ui2"}: + var tmp uint16 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Ui2 = append(m.Ui2, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "ui4"}: + var tmp uint32 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Ui4 = append(m.Ui4, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "ui8"}: + var tmp uint64 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Ui8 = append(m.Ui8, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "r4"}: + var tmp float32 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.R4 = append(m.R4, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "r8"}: + var tmp float64 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.R8 = append(m.R8, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "lpstr"}: + var tmp string + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Lpstr = append(m.Lpstr, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "lpwstr"}: + var tmp string + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Lpwstr = append(m.Lpwstr, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "bstr"}: + var tmp string + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Bstr = append(m.Bstr, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "date"}: + var tmp time.Time + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Date = append(m.Date, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "filetime"}: + var tmp time.Time + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Filetime = append(m.Filetime, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "bool"}: + var tmp bool + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Bool = append(m.Bool, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "cy"}: + var tmp string + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Cy = append(m.Cy, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "error"}: + var tmp string + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Error = append(m.Error, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "clsid"}: + var tmp string + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Clsid = append(m.Clsid, tmp) + default: + gooxml.Log("skipping unsupported element on CT_Vector %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Vector + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Vector and its children +func (m *CT_Vector) Validate() error { + return m.ValidateWithPath("CT_Vector") +} + +// ValidateWithPath validates the CT_Vector and its children, prefixing error messages with path +func (m *CT_Vector) ValidateWithPath(path string) error { + if m.BaseTypeAttr == ST_VectorBaseTypeUnset { + return fmt.Errorf("%s/BaseTypeAttr is a mandatory field", path) + } + if err := m.BaseTypeAttr.ValidateWithPath(path + "/BaseTypeAttr"); err != nil { + return err + } + for i, v := range m.Variant { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Variant[%d]", path, i)); err != nil { + return err + } + } + for i, s := range m.Cy { + if !ST_CyPatternRe.MatchString(s) { + return fmt.Errorf(`%s/m.Cy[%d] must match '%s' (have %v)`, path, i, ST_CyPatternRe, s) + } + } + for i, s := range m.Error { + if !ST_ErrorPatternRe.MatchString(s) { + return fmt.Errorf(`%s/m.Error[%d] must match '%s' (have %v)`, path, i, ST_ErrorPatternRe, s) + } + } + for i, s := range m.Clsid { + if !sharedTypes.ST_GuidPatternRe.MatchString(s) { + return fmt.Errorf(`%s/m.Clsid[%d] must match '%s' (have %v)`, path, i, sharedTypes.ST_GuidPatternRe, s) + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/docPropsVTypes/CT_Vstream.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/docPropsVTypes/CT_Vstream.go new file mode 100644 index 00000000..6fd98b28 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/docPropsVTypes/CT_Vstream.go @@ -0,0 +1,78 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package docPropsVTypes + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_Vstream struct { + VersionAttr string + Content string +} + +func NewCT_Vstream() *CT_Vstream { + ret := &CT_Vstream{} + ret.VersionAttr = "{00000000-0000-0000-0000-000000000000}" + return ret +} + +func (m *CT_Vstream) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "version"}, + Value: fmt.Sprintf("%v", m.VersionAttr)}) + e.EncodeElement(m.Content, start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Vstream) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.VersionAttr = "{00000000-0000-0000-0000-000000000000}" + for _, attr := range start.Attr { + if attr.Name.Local == "version" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.VersionAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Vstream: %s", err) + } + if cd, ok := tok.(xml.CharData); ok { + m.Content = string(cd) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Vstream and its children +func (m *CT_Vstream) Validate() error { + return m.ValidateWithPath("CT_Vstream") +} + +// ValidateWithPath validates the CT_Vstream and its children, prefixing error messages with path +func (m *CT_Vstream) ValidateWithPath(path string) error { + if !sharedTypes.ST_GuidPatternRe.MatchString(m.VersionAttr) { + return fmt.Errorf(`%s/m.VersionAttr must match '%s' (have %v)`, path, sharedTypes.ST_GuidPatternRe, m.VersionAttr) + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/docPropsVTypes/Empty.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/docPropsVTypes/Empty.go new file mode 100644 index 00000000..b01fefb2 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/docPropsVTypes/Empty.go @@ -0,0 +1,58 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package docPropsVTypes + +import ( + "encoding/xml" + "fmt" +) + +type Empty struct { + CT_Empty +} + +func NewEmpty() *Empty { + ret := &Empty{} + ret.CT_Empty = *NewCT_Empty() + return ret +} + +func (m *Empty) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return m.CT_Empty.MarshalXML(e, start) +} + +func (m *Empty) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CT_Empty = *NewCT_Empty() + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing Empty: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the Empty and its children +func (m *Empty) Validate() error { + return m.ValidateWithPath("Empty") +} + +// ValidateWithPath validates the Empty and its children, prefixing error messages with path +func (m *Empty) ValidateWithPath(path string) error { + if err := m.CT_Empty.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/docPropsVTypes/Null.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/docPropsVTypes/Null.go new file mode 100644 index 00000000..097e74cd --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/docPropsVTypes/Null.go @@ -0,0 +1,58 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package docPropsVTypes + +import ( + "encoding/xml" + "fmt" +) + +type Null struct { + CT_Null +} + +func NewNull() *Null { + ret := &Null{} + ret.CT_Null = *NewCT_Null() + return ret +} + +func (m *Null) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return m.CT_Null.MarshalXML(e, start) +} + +func (m *Null) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CT_Null = *NewCT_Null() + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing Null: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the Null and its children +func (m *Null) Validate() error { + return m.ValidateWithPath("Null") +} + +// ValidateWithPath validates the Null and its children, prefixing error messages with path +func (m *Null) ValidateWithPath(path string) error { + if err := m.CT_Null.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/docPropsVTypes/Variant.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/docPropsVTypes/Variant.go new file mode 100644 index 00000000..12380cf0 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/docPropsVTypes/Variant.go @@ -0,0 +1,240 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package docPropsVTypes + +import ( + "encoding/xml" + "time" + + "baliance.com/gooxml" +) + +type Variant struct { + CT_Variant +} + +func NewVariant() *Variant { + ret := &Variant{} + ret.CT_Variant = *NewCT_Variant() + return ret +} + +func (m *Variant) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return m.CT_Variant.MarshalXML(e, start) +} + +func (m *Variant) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CT_Variant = *NewCT_Variant() +lVariant: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "variant"}: + m.Variant = NewVariant() + if err := d.DecodeElement(m.Variant, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "vector"}: + m.Vector = NewVector() + if err := d.DecodeElement(m.Vector, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "array"}: + m.Array = NewArray() + if err := d.DecodeElement(m.Array, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "blob"}: + m.Blob = new(string) + if err := d.DecodeElement(m.Blob, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "oblob"}: + m.Oblob = new(string) + if err := d.DecodeElement(m.Oblob, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "empty"}: + m.Empty = NewEmpty() + if err := d.DecodeElement(m.Empty, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "null"}: + m.Null = NewNull() + if err := d.DecodeElement(m.Null, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "i1"}: + m.I1 = new(int8) + if err := d.DecodeElement(m.I1, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "i2"}: + m.I2 = new(int16) + if err := d.DecodeElement(m.I2, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "i4"}: + m.I4 = new(int32) + if err := d.DecodeElement(m.I4, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "i8"}: + m.I8 = new(int64) + if err := d.DecodeElement(m.I8, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "int"}: + m.Int = new(int32) + if err := d.DecodeElement(m.Int, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "ui1"}: + m.Ui1 = new(uint8) + if err := d.DecodeElement(m.Ui1, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "ui2"}: + m.Ui2 = new(uint16) + if err := d.DecodeElement(m.Ui2, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "ui4"}: + m.Ui4 = new(uint32) + if err := d.DecodeElement(m.Ui4, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "ui8"}: + m.Ui8 = new(uint64) + if err := d.DecodeElement(m.Ui8, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "uint"}: + m.Uint = new(uint32) + if err := d.DecodeElement(m.Uint, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "r4"}: + m.R4 = new(float32) + if err := d.DecodeElement(m.R4, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "r8"}: + m.R8 = new(float64) + if err := d.DecodeElement(m.R8, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "decimal"}: + m.Decimal = new(float64) + if err := d.DecodeElement(m.Decimal, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "lpstr"}: + m.Lpstr = new(string) + if err := d.DecodeElement(m.Lpstr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "lpwstr"}: + m.Lpwstr = new(string) + if err := d.DecodeElement(m.Lpwstr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "bstr"}: + m.Bstr = new(string) + if err := d.DecodeElement(m.Bstr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "date"}: + m.Date = new(time.Time) + if err := d.DecodeElement(m.Date, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "filetime"}: + m.Filetime = new(time.Time) + if err := d.DecodeElement(m.Filetime, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "bool"}: + m.Bool = new(bool) + if err := d.DecodeElement(m.Bool, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "cy"}: + m.Cy = new(string) + if err := d.DecodeElement(m.Cy, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "error"}: + m.Error = new(string) + if err := d.DecodeElement(m.Error, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "stream"}: + m.Stream = new(string) + if err := d.DecodeElement(m.Stream, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "ostream"}: + m.Ostream = new(string) + if err := d.DecodeElement(m.Ostream, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "storage"}: + m.Storage = new(string) + if err := d.DecodeElement(m.Storage, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "ostorage"}: + m.Ostorage = new(string) + if err := d.DecodeElement(m.Ostorage, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "vstream"}: + m.Vstream = NewVstream() + if err := d.DecodeElement(m.Vstream, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "clsid"}: + m.Clsid = new(string) + if err := d.DecodeElement(m.Clsid, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on Variant %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lVariant + case xml.CharData: + } + } + return nil +} + +// Validate validates the Variant and its children +func (m *Variant) Validate() error { + return m.ValidateWithPath("Variant") +} + +// ValidateWithPath validates the Variant and its children, prefixing error messages with path +func (m *Variant) ValidateWithPath(path string) error { + if err := m.CT_Variant.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/docPropsVTypes/Vector.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/docPropsVTypes/Vector.go new file mode 100644 index 00000000..c17454f8 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/docPropsVTypes/Vector.go @@ -0,0 +1,205 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package docPropsVTypes + +import ( + "encoding/xml" + "strconv" + "time" + + "baliance.com/gooxml" +) + +type Vector struct { + CT_Vector +} + +func NewVector() *Vector { + ret := &Vector{} + ret.CT_Vector = *NewCT_Vector() + return ret +} + +func (m *Vector) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return m.CT_Vector.MarshalXML(e, start) +} + +func (m *Vector) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CT_Vector = *NewCT_Vector() + for _, attr := range start.Attr { + if attr.Name.Local == "size" { + parsed, err := strconv.ParseUint(attr.Value, 10, 32) + if err != nil { + return err + } + m.SizeAttr = uint32(parsed) + continue + } + if attr.Name.Local == "baseType" { + m.BaseTypeAttr.UnmarshalXMLAttr(attr) + continue + } + } +lVector: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "variant"}: + tmp := NewVariant() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Variant = append(m.Variant, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "i1"}: + var tmp int8 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.I1 = append(m.I1, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "i2"}: + var tmp int16 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.I2 = append(m.I2, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "i4"}: + var tmp int32 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.I4 = append(m.I4, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "i8"}: + var tmp int64 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.I8 = append(m.I8, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "ui1"}: + var tmp uint8 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Ui1 = append(m.Ui1, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "ui2"}: + var tmp uint16 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Ui2 = append(m.Ui2, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "ui4"}: + var tmp uint32 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Ui4 = append(m.Ui4, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "ui8"}: + var tmp uint64 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Ui8 = append(m.Ui8, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "r4"}: + var tmp float32 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.R4 = append(m.R4, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "r8"}: + var tmp float64 + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.R8 = append(m.R8, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "lpstr"}: + var tmp string + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Lpstr = append(m.Lpstr, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "lpwstr"}: + var tmp string + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Lpwstr = append(m.Lpwstr, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "bstr"}: + var tmp string + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Bstr = append(m.Bstr, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "date"}: + var tmp time.Time + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Date = append(m.Date, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "filetime"}: + var tmp time.Time + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Filetime = append(m.Filetime, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "bool"}: + var tmp bool + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Bool = append(m.Bool, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "cy"}: + var tmp string + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Cy = append(m.Cy, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "error"}: + var tmp string + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Error = append(m.Error, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "clsid"}: + var tmp string + if err := d.DecodeElement(&tmp, &el); err != nil { + return err + } + m.Clsid = append(m.Clsid, tmp) + default: + gooxml.Log("skipping unsupported element on Vector %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lVector + case xml.CharData: + } + } + return nil +} + +// Validate validates the Vector and its children +func (m *Vector) Validate() error { + return m.ValidateWithPath("Vector") +} + +// ValidateWithPath validates the Vector and its children, prefixing error messages with path +func (m *Vector) ValidateWithPath(path string) error { + if err := m.CT_Vector.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/docPropsVTypes/Vstream.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/docPropsVTypes/Vstream.go new file mode 100644 index 00000000..a586b607 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/docPropsVTypes/Vstream.go @@ -0,0 +1,68 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package docPropsVTypes + +import ( + "encoding/xml" + "fmt" +) + +type Vstream struct { + CT_Vstream +} + +func NewVstream() *Vstream { + ret := &Vstream{} + ret.CT_Vstream = *NewCT_Vstream() + return ret +} + +func (m *Vstream) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return m.CT_Vstream.MarshalXML(e, start) +} + +func (m *Vstream) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CT_Vstream = *NewCT_Vstream() + for _, attr := range start.Attr { + if attr.Name.Local == "version" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.VersionAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing Vstream: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the Vstream and its children +func (m *Vstream) Validate() error { + return m.ValidateWithPath("Vstream") +} + +// ValidateWithPath validates the Vstream and its children, prefixing error messages with path +func (m *Vstream) ValidateWithPath(path string) error { + if err := m.CT_Vstream.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/docPropsVTypes/common.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/docPropsVTypes/common.go new file mode 100644 index 00000000..a77d3f86 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/docPropsVTypes/common.go @@ -0,0 +1,527 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package docPropsVTypes + +import ( + "encoding/xml" + "fmt" + "regexp" + + "baliance.com/gooxml" +) + +const ST_CyPattern = `\s*[0-9]*\.[0-9]{4}\s*` + +var ST_CyPatternRe = regexp.MustCompile(ST_CyPattern) + +const ST_ErrorPattern = `\s*0x[0-9A-Za-z]{8}\s*` + +var ST_ErrorPatternRe = regexp.MustCompile(ST_ErrorPattern) + +type ST_VectorBaseType byte + +const ( + ST_VectorBaseTypeUnset ST_VectorBaseType = 0 + ST_VectorBaseTypeVariant ST_VectorBaseType = 1 + ST_VectorBaseTypeI1 ST_VectorBaseType = 2 + ST_VectorBaseTypeI2 ST_VectorBaseType = 3 + ST_VectorBaseTypeI4 ST_VectorBaseType = 4 + ST_VectorBaseTypeI8 ST_VectorBaseType = 5 + ST_VectorBaseTypeUi1 ST_VectorBaseType = 6 + ST_VectorBaseTypeUi2 ST_VectorBaseType = 7 + ST_VectorBaseTypeUi4 ST_VectorBaseType = 8 + ST_VectorBaseTypeUi8 ST_VectorBaseType = 9 + ST_VectorBaseTypeR4 ST_VectorBaseType = 10 + ST_VectorBaseTypeR8 ST_VectorBaseType = 11 + ST_VectorBaseTypeLpstr ST_VectorBaseType = 12 + ST_VectorBaseTypeLpwstr ST_VectorBaseType = 13 + ST_VectorBaseTypeBstr ST_VectorBaseType = 14 + ST_VectorBaseTypeDate ST_VectorBaseType = 15 + ST_VectorBaseTypeFiletime ST_VectorBaseType = 16 + ST_VectorBaseTypeBool ST_VectorBaseType = 17 + ST_VectorBaseTypeCy ST_VectorBaseType = 18 + ST_VectorBaseTypeError ST_VectorBaseType = 19 + ST_VectorBaseTypeClsid ST_VectorBaseType = 20 +) + +func (e ST_VectorBaseType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_VectorBaseTypeUnset: + attr.Value = "" + case ST_VectorBaseTypeVariant: + attr.Value = "variant" + case ST_VectorBaseTypeI1: + attr.Value = "i1" + case ST_VectorBaseTypeI2: + attr.Value = "i2" + case ST_VectorBaseTypeI4: + attr.Value = "i4" + case ST_VectorBaseTypeI8: + attr.Value = "i8" + case ST_VectorBaseTypeUi1: + attr.Value = "ui1" + case ST_VectorBaseTypeUi2: + attr.Value = "ui2" + case ST_VectorBaseTypeUi4: + attr.Value = "ui4" + case ST_VectorBaseTypeUi8: + attr.Value = "ui8" + case ST_VectorBaseTypeR4: + attr.Value = "r4" + case ST_VectorBaseTypeR8: + attr.Value = "r8" + case ST_VectorBaseTypeLpstr: + attr.Value = "lpstr" + case ST_VectorBaseTypeLpwstr: + attr.Value = "lpwstr" + case ST_VectorBaseTypeBstr: + attr.Value = "bstr" + case ST_VectorBaseTypeDate: + attr.Value = "date" + case ST_VectorBaseTypeFiletime: + attr.Value = "filetime" + case ST_VectorBaseTypeBool: + attr.Value = "bool" + case ST_VectorBaseTypeCy: + attr.Value = "cy" + case ST_VectorBaseTypeError: + attr.Value = "error" + case ST_VectorBaseTypeClsid: + attr.Value = "clsid" + } + return attr, nil +} + +func (e *ST_VectorBaseType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "variant": + *e = 1 + case "i1": + *e = 2 + case "i2": + *e = 3 + case "i4": + *e = 4 + case "i8": + *e = 5 + case "ui1": + *e = 6 + case "ui2": + *e = 7 + case "ui4": + *e = 8 + case "ui8": + *e = 9 + case "r4": + *e = 10 + case "r8": + *e = 11 + case "lpstr": + *e = 12 + case "lpwstr": + *e = 13 + case "bstr": + *e = 14 + case "date": + *e = 15 + case "filetime": + *e = 16 + case "bool": + *e = 17 + case "cy": + *e = 18 + case "error": + *e = 19 + case "clsid": + *e = 20 + } + return nil +} + +func (m ST_VectorBaseType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_VectorBaseType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "variant": + *m = 1 + case "i1": + *m = 2 + case "i2": + *m = 3 + case "i4": + *m = 4 + case "i8": + *m = 5 + case "ui1": + *m = 6 + case "ui2": + *m = 7 + case "ui4": + *m = 8 + case "ui8": + *m = 9 + case "r4": + *m = 10 + case "r8": + *m = 11 + case "lpstr": + *m = 12 + case "lpwstr": + *m = 13 + case "bstr": + *m = 14 + case "date": + *m = 15 + case "filetime": + *m = 16 + case "bool": + *m = 17 + case "cy": + *m = 18 + case "error": + *m = 19 + case "clsid": + *m = 20 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_VectorBaseType) String() string { + switch m { + case 0: + return "" + case 1: + return "variant" + case 2: + return "i1" + case 3: + return "i2" + case 4: + return "i4" + case 5: + return "i8" + case 6: + return "ui1" + case 7: + return "ui2" + case 8: + return "ui4" + case 9: + return "ui8" + case 10: + return "r4" + case 11: + return "r8" + case 12: + return "lpstr" + case 13: + return "lpwstr" + case 14: + return "bstr" + case 15: + return "date" + case 16: + return "filetime" + case 17: + return "bool" + case 18: + return "cy" + case 19: + return "error" + case 20: + return "clsid" + } + return "" +} + +func (m ST_VectorBaseType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_VectorBaseType) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_ArrayBaseType byte + +const ( + ST_ArrayBaseTypeUnset ST_ArrayBaseType = 0 + ST_ArrayBaseTypeVariant ST_ArrayBaseType = 1 + ST_ArrayBaseTypeI1 ST_ArrayBaseType = 2 + ST_ArrayBaseTypeI2 ST_ArrayBaseType = 3 + ST_ArrayBaseTypeI4 ST_ArrayBaseType = 4 + ST_ArrayBaseTypeInt ST_ArrayBaseType = 5 + ST_ArrayBaseTypeUi1 ST_ArrayBaseType = 6 + ST_ArrayBaseTypeUi2 ST_ArrayBaseType = 7 + ST_ArrayBaseTypeUi4 ST_ArrayBaseType = 8 + ST_ArrayBaseTypeUint ST_ArrayBaseType = 9 + ST_ArrayBaseTypeR4 ST_ArrayBaseType = 10 + ST_ArrayBaseTypeR8 ST_ArrayBaseType = 11 + ST_ArrayBaseTypeDecimal ST_ArrayBaseType = 12 + ST_ArrayBaseTypeBstr ST_ArrayBaseType = 13 + ST_ArrayBaseTypeDate ST_ArrayBaseType = 14 + ST_ArrayBaseTypeBool ST_ArrayBaseType = 15 + ST_ArrayBaseTypeCy ST_ArrayBaseType = 16 + ST_ArrayBaseTypeError ST_ArrayBaseType = 17 +) + +func (e ST_ArrayBaseType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_ArrayBaseTypeUnset: + attr.Value = "" + case ST_ArrayBaseTypeVariant: + attr.Value = "variant" + case ST_ArrayBaseTypeI1: + attr.Value = "i1" + case ST_ArrayBaseTypeI2: + attr.Value = "i2" + case ST_ArrayBaseTypeI4: + attr.Value = "i4" + case ST_ArrayBaseTypeInt: + attr.Value = "int" + case ST_ArrayBaseTypeUi1: + attr.Value = "ui1" + case ST_ArrayBaseTypeUi2: + attr.Value = "ui2" + case ST_ArrayBaseTypeUi4: + attr.Value = "ui4" + case ST_ArrayBaseTypeUint: + attr.Value = "uint" + case ST_ArrayBaseTypeR4: + attr.Value = "r4" + case ST_ArrayBaseTypeR8: + attr.Value = "r8" + case ST_ArrayBaseTypeDecimal: + attr.Value = "decimal" + case ST_ArrayBaseTypeBstr: + attr.Value = "bstr" + case ST_ArrayBaseTypeDate: + attr.Value = "date" + case ST_ArrayBaseTypeBool: + attr.Value = "bool" + case ST_ArrayBaseTypeCy: + attr.Value = "cy" + case ST_ArrayBaseTypeError: + attr.Value = "error" + } + return attr, nil +} + +func (e *ST_ArrayBaseType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "variant": + *e = 1 + case "i1": + *e = 2 + case "i2": + *e = 3 + case "i4": + *e = 4 + case "int": + *e = 5 + case "ui1": + *e = 6 + case "ui2": + *e = 7 + case "ui4": + *e = 8 + case "uint": + *e = 9 + case "r4": + *e = 10 + case "r8": + *e = 11 + case "decimal": + *e = 12 + case "bstr": + *e = 13 + case "date": + *e = 14 + case "bool": + *e = 15 + case "cy": + *e = 16 + case "error": + *e = 17 + } + return nil +} + +func (m ST_ArrayBaseType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_ArrayBaseType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "variant": + *m = 1 + case "i1": + *m = 2 + case "i2": + *m = 3 + case "i4": + *m = 4 + case "int": + *m = 5 + case "ui1": + *m = 6 + case "ui2": + *m = 7 + case "ui4": + *m = 8 + case "uint": + *m = 9 + case "r4": + *m = 10 + case "r8": + *m = 11 + case "decimal": + *m = 12 + case "bstr": + *m = 13 + case "date": + *m = 14 + case "bool": + *m = 15 + case "cy": + *m = 16 + case "error": + *m = 17 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_ArrayBaseType) String() string { + switch m { + case 0: + return "" + case 1: + return "variant" + case 2: + return "i1" + case 3: + return "i2" + case 4: + return "i4" + case 5: + return "int" + case 6: + return "ui1" + case 7: + return "ui2" + case 8: + return "ui4" + case 9: + return "uint" + case 10: + return "r4" + case 11: + return "r8" + case 12: + return "decimal" + case 13: + return "bstr" + case 14: + return "date" + case 15: + return "bool" + case 16: + return "cy" + case 17: + return "error" + } + return "" +} + +func (m ST_ArrayBaseType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_ArrayBaseType) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +// init registers constructor functions for dynamically creating elements based off the XML namespace and name +func init() { + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", "CT_Empty", NewCT_Empty) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", "CT_Null", NewCT_Null) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", "CT_Vector", NewCT_Vector) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", "CT_Array", NewCT_Array) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", "CT_Variant", NewCT_Variant) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", "CT_Vstream", NewCT_Vstream) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", "variant", NewVariant) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", "vector", NewVector) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", "array", NewArray) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", "empty", NewEmpty) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", "null", NewNull) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", "vstream", NewVstream) +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/extended_properties/CT_DigSigBlob.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/extended_properties/CT_DigSigBlob.go new file mode 100644 index 00000000..716518e1 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/extended_properties/CT_DigSigBlob.go @@ -0,0 +1,73 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package extended_properties + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_DigSigBlob struct { + Blob string +} + +func NewCT_DigSigBlob() *CT_DigSigBlob { + ret := &CT_DigSigBlob{} + return ret +} + +func (m *CT_DigSigBlob) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + seblob := xml.StartElement{Name: xml.Name{Local: "vt:blob"}} + gooxml.AddPreserveSpaceAttr(&seblob, m.Blob) + e.EncodeElement(m.Blob, seblob) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_DigSigBlob) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_DigSigBlob: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "blob"}: + if err := d.DecodeElement(&m.Blob, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_DigSigBlob %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_DigSigBlob + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_DigSigBlob and its children +func (m *CT_DigSigBlob) Validate() error { + return m.ValidateWithPath("CT_DigSigBlob") +} + +// ValidateWithPath validates the CT_DigSigBlob and its children, prefixing error messages with path +func (m *CT_DigSigBlob) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/extended_properties/CT_Properties.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/extended_properties/CT_Properties.go new file mode 100644 index 00000000..6f8d99bb --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/extended_properties/CT_Properties.go @@ -0,0 +1,389 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package extended_properties + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_Properties struct { + // Name of Document Template + Template *string + // Name of Manager + Manager *string + // Name of Company + Company *string + // Total Number of Pages + Pages *int32 + // Word Count + Words *int32 + // Total Number of Characters + Characters *int32 + // Intended Format of Presentation + PresentationFormat *string + // Number of Lines + Lines *int32 + // Total Number of Paragraphs + Paragraphs *int32 + // Slides Metadata Element + Slides *int32 + // Number of Slides Containing Notes + Notes *int32 + // Total Edit Time Metadata Element + TotalTime *int32 + // Number of Hidden Slides + HiddenSlides *int32 + // Total Number of Multimedia Clips + MMClips *int32 + // Thumbnail Display Mode + ScaleCrop *bool + // Heading Pairs + HeadingPairs *CT_VectorVariant + // Part Titles + TitlesOfParts *CT_VectorLpstr + // Links Up-to-Date + LinksUpToDate *bool + // Number of Characters (With Spaces) + CharactersWithSpaces *int32 + // Shared Document + SharedDoc *bool + // Relative Hyperlink Base + HyperlinkBase *string + // Hyperlink List + HLinks *CT_VectorVariant + // Hyperlinks Changed + HyperlinksChanged *bool + // Digital Signature + DigSig *CT_DigSigBlob + // Application Name + Application *string + // Application Version + AppVersion *string + // Document Security + DocSecurity *int32 +} + +func NewCT_Properties() *CT_Properties { + ret := &CT_Properties{} + return ret +} + +func (m *CT_Properties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Template != nil { + seTemplate := xml.StartElement{Name: xml.Name{Local: "Template"}} + gooxml.AddPreserveSpaceAttr(&seTemplate, *m.Template) + e.EncodeElement(m.Template, seTemplate) + } + if m.Manager != nil { + seManager := xml.StartElement{Name: xml.Name{Local: "Manager"}} + gooxml.AddPreserveSpaceAttr(&seManager, *m.Manager) + e.EncodeElement(m.Manager, seManager) + } + if m.Company != nil { + seCompany := xml.StartElement{Name: xml.Name{Local: "Company"}} + gooxml.AddPreserveSpaceAttr(&seCompany, *m.Company) + e.EncodeElement(m.Company, seCompany) + } + if m.Pages != nil { + sePages := xml.StartElement{Name: xml.Name{Local: "Pages"}} + e.EncodeElement(m.Pages, sePages) + } + if m.Words != nil { + seWords := xml.StartElement{Name: xml.Name{Local: "Words"}} + e.EncodeElement(m.Words, seWords) + } + if m.Characters != nil { + seCharacters := xml.StartElement{Name: xml.Name{Local: "Characters"}} + e.EncodeElement(m.Characters, seCharacters) + } + if m.PresentationFormat != nil { + sePresentationFormat := xml.StartElement{Name: xml.Name{Local: "PresentationFormat"}} + gooxml.AddPreserveSpaceAttr(&sePresentationFormat, *m.PresentationFormat) + e.EncodeElement(m.PresentationFormat, sePresentationFormat) + } + if m.Lines != nil { + seLines := xml.StartElement{Name: xml.Name{Local: "Lines"}} + e.EncodeElement(m.Lines, seLines) + } + if m.Paragraphs != nil { + seParagraphs := xml.StartElement{Name: xml.Name{Local: "Paragraphs"}} + e.EncodeElement(m.Paragraphs, seParagraphs) + } + if m.Slides != nil { + seSlides := xml.StartElement{Name: xml.Name{Local: "Slides"}} + e.EncodeElement(m.Slides, seSlides) + } + if m.Notes != nil { + seNotes := xml.StartElement{Name: xml.Name{Local: "Notes"}} + e.EncodeElement(m.Notes, seNotes) + } + if m.TotalTime != nil { + seTotalTime := xml.StartElement{Name: xml.Name{Local: "TotalTime"}} + e.EncodeElement(m.TotalTime, seTotalTime) + } + if m.HiddenSlides != nil { + seHiddenSlides := xml.StartElement{Name: xml.Name{Local: "HiddenSlides"}} + e.EncodeElement(m.HiddenSlides, seHiddenSlides) + } + if m.MMClips != nil { + seMMClips := xml.StartElement{Name: xml.Name{Local: "MMClips"}} + e.EncodeElement(m.MMClips, seMMClips) + } + if m.ScaleCrop != nil { + seScaleCrop := xml.StartElement{Name: xml.Name{Local: "ScaleCrop"}} + e.EncodeElement(m.ScaleCrop, seScaleCrop) + } + if m.HeadingPairs != nil { + seHeadingPairs := xml.StartElement{Name: xml.Name{Local: "HeadingPairs"}} + e.EncodeElement(m.HeadingPairs, seHeadingPairs) + } + if m.TitlesOfParts != nil { + seTitlesOfParts := xml.StartElement{Name: xml.Name{Local: "TitlesOfParts"}} + e.EncodeElement(m.TitlesOfParts, seTitlesOfParts) + } + if m.LinksUpToDate != nil { + seLinksUpToDate := xml.StartElement{Name: xml.Name{Local: "LinksUpToDate"}} + e.EncodeElement(m.LinksUpToDate, seLinksUpToDate) + } + if m.CharactersWithSpaces != nil { + seCharactersWithSpaces := xml.StartElement{Name: xml.Name{Local: "CharactersWithSpaces"}} + e.EncodeElement(m.CharactersWithSpaces, seCharactersWithSpaces) + } + if m.SharedDoc != nil { + seSharedDoc := xml.StartElement{Name: xml.Name{Local: "SharedDoc"}} + e.EncodeElement(m.SharedDoc, seSharedDoc) + } + if m.HyperlinkBase != nil { + seHyperlinkBase := xml.StartElement{Name: xml.Name{Local: "HyperlinkBase"}} + gooxml.AddPreserveSpaceAttr(&seHyperlinkBase, *m.HyperlinkBase) + e.EncodeElement(m.HyperlinkBase, seHyperlinkBase) + } + if m.HLinks != nil { + seHLinks := xml.StartElement{Name: xml.Name{Local: "HLinks"}} + e.EncodeElement(m.HLinks, seHLinks) + } + if m.HyperlinksChanged != nil { + seHyperlinksChanged := xml.StartElement{Name: xml.Name{Local: "HyperlinksChanged"}} + e.EncodeElement(m.HyperlinksChanged, seHyperlinksChanged) + } + if m.DigSig != nil { + seDigSig := xml.StartElement{Name: xml.Name{Local: "DigSig"}} + e.EncodeElement(m.DigSig, seDigSig) + } + if m.Application != nil { + seApplication := xml.StartElement{Name: xml.Name{Local: "Application"}} + gooxml.AddPreserveSpaceAttr(&seApplication, *m.Application) + e.EncodeElement(m.Application, seApplication) + } + if m.AppVersion != nil { + seAppVersion := xml.StartElement{Name: xml.Name{Local: "AppVersion"}} + gooxml.AddPreserveSpaceAttr(&seAppVersion, *m.AppVersion) + e.EncodeElement(m.AppVersion, seAppVersion) + } + if m.DocSecurity != nil { + seDocSecurity := xml.StartElement{Name: xml.Name{Local: "DocSecurity"}} + e.EncodeElement(m.DocSecurity, seDocSecurity) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Properties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_Properties: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "Template"}: + m.Template = new(string) + if err := d.DecodeElement(m.Template, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "Manager"}: + m.Manager = new(string) + if err := d.DecodeElement(m.Manager, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "Company"}: + m.Company = new(string) + if err := d.DecodeElement(m.Company, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "Pages"}: + m.Pages = new(int32) + if err := d.DecodeElement(m.Pages, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "Words"}: + m.Words = new(int32) + if err := d.DecodeElement(m.Words, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "Characters"}: + m.Characters = new(int32) + if err := d.DecodeElement(m.Characters, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "PresentationFormat"}: + m.PresentationFormat = new(string) + if err := d.DecodeElement(m.PresentationFormat, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "Lines"}: + m.Lines = new(int32) + if err := d.DecodeElement(m.Lines, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "Paragraphs"}: + m.Paragraphs = new(int32) + if err := d.DecodeElement(m.Paragraphs, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "Slides"}: + m.Slides = new(int32) + if err := d.DecodeElement(m.Slides, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "Notes"}: + m.Notes = new(int32) + if err := d.DecodeElement(m.Notes, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "TotalTime"}: + m.TotalTime = new(int32) + if err := d.DecodeElement(m.TotalTime, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "HiddenSlides"}: + m.HiddenSlides = new(int32) + if err := d.DecodeElement(m.HiddenSlides, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "MMClips"}: + m.MMClips = new(int32) + if err := d.DecodeElement(m.MMClips, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "ScaleCrop"}: + m.ScaleCrop = new(bool) + if err := d.DecodeElement(m.ScaleCrop, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "HeadingPairs"}: + m.HeadingPairs = NewCT_VectorVariant() + if err := d.DecodeElement(m.HeadingPairs, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "TitlesOfParts"}: + m.TitlesOfParts = NewCT_VectorLpstr() + if err := d.DecodeElement(m.TitlesOfParts, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "LinksUpToDate"}: + m.LinksUpToDate = new(bool) + if err := d.DecodeElement(m.LinksUpToDate, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "CharactersWithSpaces"}: + m.CharactersWithSpaces = new(int32) + if err := d.DecodeElement(m.CharactersWithSpaces, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "SharedDoc"}: + m.SharedDoc = new(bool) + if err := d.DecodeElement(m.SharedDoc, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "HyperlinkBase"}: + m.HyperlinkBase = new(string) + if err := d.DecodeElement(m.HyperlinkBase, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "HLinks"}: + m.HLinks = NewCT_VectorVariant() + if err := d.DecodeElement(m.HLinks, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "HyperlinksChanged"}: + m.HyperlinksChanged = new(bool) + if err := d.DecodeElement(m.HyperlinksChanged, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "DigSig"}: + m.DigSig = NewCT_DigSigBlob() + if err := d.DecodeElement(m.DigSig, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "Application"}: + m.Application = new(string) + if err := d.DecodeElement(m.Application, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "AppVersion"}: + m.AppVersion = new(string) + if err := d.DecodeElement(m.AppVersion, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "DocSecurity"}: + m.DocSecurity = new(int32) + if err := d.DecodeElement(m.DocSecurity, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_Properties %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Properties + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Properties and its children +func (m *CT_Properties) Validate() error { + return m.ValidateWithPath("CT_Properties") +} + +// ValidateWithPath validates the CT_Properties and its children, prefixing error messages with path +func (m *CT_Properties) ValidateWithPath(path string) error { + if m.HeadingPairs != nil { + if err := m.HeadingPairs.ValidateWithPath(path + "/HeadingPairs"); err != nil { + return err + } + } + if m.TitlesOfParts != nil { + if err := m.TitlesOfParts.ValidateWithPath(path + "/TitlesOfParts"); err != nil { + return err + } + } + if m.HLinks != nil { + if err := m.HLinks.ValidateWithPath(path + "/HLinks"); err != nil { + return err + } + } + if m.DigSig != nil { + if err := m.DigSig.ValidateWithPath(path + "/DigSig"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/extended_properties/CT_VectorLpstr.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/extended_properties/CT_VectorLpstr.go new file mode 100644 index 00000000..09bb40b9 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/extended_properties/CT_VectorLpstr.go @@ -0,0 +1,78 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package extended_properties + +import ( + "encoding/xml" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/docPropsVTypes" +) + +type CT_VectorLpstr struct { + Vector *docPropsVTypes.Vector +} + +func NewCT_VectorLpstr() *CT_VectorLpstr { + ret := &CT_VectorLpstr{} + ret.Vector = docPropsVTypes.NewVector() + return ret +} + +func (m *CT_VectorLpstr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + sevector := xml.StartElement{Name: xml.Name{Local: "vt:vector"}} + e.EncodeElement(m.Vector, sevector) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_VectorLpstr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.Vector = docPropsVTypes.NewVector() +lCT_VectorLpstr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "vector"}: + if err := d.DecodeElement(m.Vector, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_VectorLpstr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_VectorLpstr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_VectorLpstr and its children +func (m *CT_VectorLpstr) Validate() error { + return m.ValidateWithPath("CT_VectorLpstr") +} + +// ValidateWithPath validates the CT_VectorLpstr and its children, prefixing error messages with path +func (m *CT_VectorLpstr) ValidateWithPath(path string) error { + if err := m.Vector.ValidateWithPath(path + "/Vector"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/extended_properties/CT_VectorVariant.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/extended_properties/CT_VectorVariant.go new file mode 100644 index 00000000..0d1d508f --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/extended_properties/CT_VectorVariant.go @@ -0,0 +1,78 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package extended_properties + +import ( + "encoding/xml" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/docPropsVTypes" +) + +type CT_VectorVariant struct { + Vector *docPropsVTypes.Vector +} + +func NewCT_VectorVariant() *CT_VectorVariant { + ret := &CT_VectorVariant{} + ret.Vector = docPropsVTypes.NewVector() + return ret +} + +func (m *CT_VectorVariant) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + sevector := xml.StartElement{Name: xml.Name{Local: "vt:vector"}} + e.EncodeElement(m.Vector, sevector) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_VectorVariant) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.Vector = docPropsVTypes.NewVector() +lCT_VectorVariant: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", Local: "vector"}: + if err := d.DecodeElement(m.Vector, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_VectorVariant %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_VectorVariant + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_VectorVariant and its children +func (m *CT_VectorVariant) Validate() error { + return m.ValidateWithPath("CT_VectorVariant") +} + +// ValidateWithPath validates the CT_VectorVariant and its children, prefixing error messages with path +func (m *CT_VectorVariant) ValidateWithPath(path string) error { + if err := m.Vector.ValidateWithPath(path + "/Vector"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/extended_properties/Properties.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/extended_properties/Properties.go new file mode 100644 index 00000000..4473d003 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/extended_properties/Properties.go @@ -0,0 +1,208 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package extended_properties + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type Properties struct { + CT_Properties +} + +func NewProperties() *Properties { + ret := &Properties{} + ret.CT_Properties = *NewCT_Properties() + return ret +} + +func (m *Properties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:vt"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:xml"}, Value: "http://www.w3.org/XML/1998/namespace"}) + start.Name.Local = "Properties" + return m.CT_Properties.MarshalXML(e, start) +} + +func (m *Properties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CT_Properties = *NewCT_Properties() +lProperties: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "Template"}: + m.Template = new(string) + if err := d.DecodeElement(m.Template, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "Manager"}: + m.Manager = new(string) + if err := d.DecodeElement(m.Manager, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "Company"}: + m.Company = new(string) + if err := d.DecodeElement(m.Company, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "Pages"}: + m.Pages = new(int32) + if err := d.DecodeElement(m.Pages, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "Words"}: + m.Words = new(int32) + if err := d.DecodeElement(m.Words, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "Characters"}: + m.Characters = new(int32) + if err := d.DecodeElement(m.Characters, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "PresentationFormat"}: + m.PresentationFormat = new(string) + if err := d.DecodeElement(m.PresentationFormat, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "Lines"}: + m.Lines = new(int32) + if err := d.DecodeElement(m.Lines, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "Paragraphs"}: + m.Paragraphs = new(int32) + if err := d.DecodeElement(m.Paragraphs, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "Slides"}: + m.Slides = new(int32) + if err := d.DecodeElement(m.Slides, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "Notes"}: + m.Notes = new(int32) + if err := d.DecodeElement(m.Notes, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "TotalTime"}: + m.TotalTime = new(int32) + if err := d.DecodeElement(m.TotalTime, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "HiddenSlides"}: + m.HiddenSlides = new(int32) + if err := d.DecodeElement(m.HiddenSlides, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "MMClips"}: + m.MMClips = new(int32) + if err := d.DecodeElement(m.MMClips, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "ScaleCrop"}: + m.ScaleCrop = new(bool) + if err := d.DecodeElement(m.ScaleCrop, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "HeadingPairs"}: + m.HeadingPairs = NewCT_VectorVariant() + if err := d.DecodeElement(m.HeadingPairs, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "TitlesOfParts"}: + m.TitlesOfParts = NewCT_VectorLpstr() + if err := d.DecodeElement(m.TitlesOfParts, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "LinksUpToDate"}: + m.LinksUpToDate = new(bool) + if err := d.DecodeElement(m.LinksUpToDate, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "CharactersWithSpaces"}: + m.CharactersWithSpaces = new(int32) + if err := d.DecodeElement(m.CharactersWithSpaces, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "SharedDoc"}: + m.SharedDoc = new(bool) + if err := d.DecodeElement(m.SharedDoc, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "HyperlinkBase"}: + m.HyperlinkBase = new(string) + if err := d.DecodeElement(m.HyperlinkBase, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "HLinks"}: + m.HLinks = NewCT_VectorVariant() + if err := d.DecodeElement(m.HLinks, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "HyperlinksChanged"}: + m.HyperlinksChanged = new(bool) + if err := d.DecodeElement(m.HyperlinksChanged, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "DigSig"}: + m.DigSig = NewCT_DigSigBlob() + if err := d.DecodeElement(m.DigSig, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "Application"}: + m.Application = new(string) + if err := d.DecodeElement(m.Application, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "AppVersion"}: + m.AppVersion = new(string) + if err := d.DecodeElement(m.AppVersion, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", Local: "DocSecurity"}: + m.DocSecurity = new(int32) + if err := d.DecodeElement(m.DocSecurity, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on Properties %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lProperties + case xml.CharData: + } + } + return nil +} + +// Validate validates the Properties and its children +func (m *Properties) Validate() error { + return m.ValidateWithPath("Properties") +} + +// ValidateWithPath validates the Properties and its children, prefixing error messages with path +func (m *Properties) ValidateWithPath(path string) error { + if err := m.CT_Properties.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/extended_properties/common.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/extended_properties/common.go new file mode 100644 index 00000000..36d41b9a --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/extended_properties/common.go @@ -0,0 +1,21 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package extended_properties + +import "baliance.com/gooxml" + +// init registers constructor functions for dynamically creating elements based off the XML namespace and name +func init() { + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", "CT_Properties", NewCT_Properties) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", "CT_VectorVariant", NewCT_VectorVariant) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", "CT_VectorLpstr", NewCT_VectorLpstr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", "CT_DigSigBlob", NewCT_DigSigBlob) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", "Properties", NewProperties) +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Acc.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Acc.go new file mode 100644 index 00000000..629c103b --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Acc.go @@ -0,0 +1,92 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_Acc struct { + AccPr *CT_AccPr + E *CT_OMathArg +} + +func NewCT_Acc() *CT_Acc { + ret := &CT_Acc{} + ret.E = NewCT_OMathArg() + return ret +} + +func (m *CT_Acc) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.AccPr != nil { + seaccPr := xml.StartElement{Name: xml.Name{Local: "m:accPr"}} + e.EncodeElement(m.AccPr, seaccPr) + } + see := xml.StartElement{Name: xml.Name{Local: "m:e"}} + e.EncodeElement(m.E, see) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Acc) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.E = NewCT_OMathArg() +lCT_Acc: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "accPr"}: + m.AccPr = NewCT_AccPr() + if err := d.DecodeElement(m.AccPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "e"}: + if err := d.DecodeElement(m.E, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_Acc %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Acc + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Acc and its children +func (m *CT_Acc) Validate() error { + return m.ValidateWithPath("CT_Acc") +} + +// ValidateWithPath validates the CT_Acc and its children, prefixing error messages with path +func (m *CT_Acc) ValidateWithPath(path string) error { + if m.AccPr != nil { + if err := m.AccPr.ValidateWithPath(path + "/AccPr"); err != nil { + return err + } + } + if err := m.E.ValidateWithPath(path + "/E"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_AccPr.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_AccPr.go new file mode 100644 index 00000000..dfeeee73 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_AccPr.go @@ -0,0 +1,95 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_AccPr struct { + Chr *CT_Char + CtrlPr *CT_CtrlPr +} + +func NewCT_AccPr() *CT_AccPr { + ret := &CT_AccPr{} + return ret +} + +func (m *CT_AccPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Chr != nil { + sechr := xml.StartElement{Name: xml.Name{Local: "m:chr"}} + e.EncodeElement(m.Chr, sechr) + } + if m.CtrlPr != nil { + sectrlPr := xml.StartElement{Name: xml.Name{Local: "m:ctrlPr"}} + e.EncodeElement(m.CtrlPr, sectrlPr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_AccPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_AccPr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "chr"}: + m.Chr = NewCT_Char() + if err := d.DecodeElement(m.Chr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "ctrlPr"}: + m.CtrlPr = NewCT_CtrlPr() + if err := d.DecodeElement(m.CtrlPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_AccPr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_AccPr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_AccPr and its children +func (m *CT_AccPr) Validate() error { + return m.ValidateWithPath("CT_AccPr") +} + +// ValidateWithPath validates the CT_AccPr and its children, prefixing error messages with path +func (m *CT_AccPr) ValidateWithPath(path string) error { + if m.Chr != nil { + if err := m.Chr.ValidateWithPath(path + "/Chr"); err != nil { + return err + } + } + if m.CtrlPr != nil { + if err := m.CtrlPr.ValidateWithPath(path + "/CtrlPr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Bar.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Bar.go new file mode 100644 index 00000000..bde19d41 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Bar.go @@ -0,0 +1,92 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_Bar struct { + BarPr *CT_BarPr + E *CT_OMathArg +} + +func NewCT_Bar() *CT_Bar { + ret := &CT_Bar{} + ret.E = NewCT_OMathArg() + return ret +} + +func (m *CT_Bar) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.BarPr != nil { + sebarPr := xml.StartElement{Name: xml.Name{Local: "m:barPr"}} + e.EncodeElement(m.BarPr, sebarPr) + } + see := xml.StartElement{Name: xml.Name{Local: "m:e"}} + e.EncodeElement(m.E, see) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Bar) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.E = NewCT_OMathArg() +lCT_Bar: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "barPr"}: + m.BarPr = NewCT_BarPr() + if err := d.DecodeElement(m.BarPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "e"}: + if err := d.DecodeElement(m.E, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_Bar %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Bar + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Bar and its children +func (m *CT_Bar) Validate() error { + return m.ValidateWithPath("CT_Bar") +} + +// ValidateWithPath validates the CT_Bar and its children, prefixing error messages with path +func (m *CT_Bar) ValidateWithPath(path string) error { + if m.BarPr != nil { + if err := m.BarPr.ValidateWithPath(path + "/BarPr"); err != nil { + return err + } + } + if err := m.E.ValidateWithPath(path + "/E"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_BarPr.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_BarPr.go new file mode 100644 index 00000000..5e1ae843 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_BarPr.go @@ -0,0 +1,95 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_BarPr struct { + Pos *CT_TopBot + CtrlPr *CT_CtrlPr +} + +func NewCT_BarPr() *CT_BarPr { + ret := &CT_BarPr{} + return ret +} + +func (m *CT_BarPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Pos != nil { + sepos := xml.StartElement{Name: xml.Name{Local: "m:pos"}} + e.EncodeElement(m.Pos, sepos) + } + if m.CtrlPr != nil { + sectrlPr := xml.StartElement{Name: xml.Name{Local: "m:ctrlPr"}} + e.EncodeElement(m.CtrlPr, sectrlPr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_BarPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_BarPr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "pos"}: + m.Pos = NewCT_TopBot() + if err := d.DecodeElement(m.Pos, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "ctrlPr"}: + m.CtrlPr = NewCT_CtrlPr() + if err := d.DecodeElement(m.CtrlPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_BarPr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_BarPr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_BarPr and its children +func (m *CT_BarPr) Validate() error { + return m.ValidateWithPath("CT_BarPr") +} + +// ValidateWithPath validates the CT_BarPr and its children, prefixing error messages with path +func (m *CT_BarPr) ValidateWithPath(path string) error { + if m.Pos != nil { + if err := m.Pos.ValidateWithPath(path + "/Pos"); err != nil { + return err + } + } + if m.CtrlPr != nil { + if err := m.CtrlPr.ValidateWithPath(path + "/CtrlPr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_BorderBox.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_BorderBox.go new file mode 100644 index 00000000..9dc44256 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_BorderBox.go @@ -0,0 +1,92 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_BorderBox struct { + BorderBoxPr *CT_BorderBoxPr + E *CT_OMathArg +} + +func NewCT_BorderBox() *CT_BorderBox { + ret := &CT_BorderBox{} + ret.E = NewCT_OMathArg() + return ret +} + +func (m *CT_BorderBox) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.BorderBoxPr != nil { + seborderBoxPr := xml.StartElement{Name: xml.Name{Local: "m:borderBoxPr"}} + e.EncodeElement(m.BorderBoxPr, seborderBoxPr) + } + see := xml.StartElement{Name: xml.Name{Local: "m:e"}} + e.EncodeElement(m.E, see) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_BorderBox) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.E = NewCT_OMathArg() +lCT_BorderBox: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "borderBoxPr"}: + m.BorderBoxPr = NewCT_BorderBoxPr() + if err := d.DecodeElement(m.BorderBoxPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "e"}: + if err := d.DecodeElement(m.E, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_BorderBox %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_BorderBox + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_BorderBox and its children +func (m *CT_BorderBox) Validate() error { + return m.ValidateWithPath("CT_BorderBox") +} + +// ValidateWithPath validates the CT_BorderBox and its children, prefixing error messages with path +func (m *CT_BorderBox) ValidateWithPath(path string) error { + if m.BorderBoxPr != nil { + if err := m.BorderBoxPr.ValidateWithPath(path + "/BorderBoxPr"); err != nil { + return err + } + } + if err := m.E.ValidateWithPath(path + "/E"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_BorderBoxPr.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_BorderBoxPr.go new file mode 100644 index 00000000..1ee197a1 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_BorderBoxPr.go @@ -0,0 +1,200 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_BorderBoxPr struct { + HideTop *CT_OnOff + HideBot *CT_OnOff + HideLeft *CT_OnOff + HideRight *CT_OnOff + StrikeH *CT_OnOff + StrikeV *CT_OnOff + StrikeBLTR *CT_OnOff + StrikeTLBR *CT_OnOff + CtrlPr *CT_CtrlPr +} + +func NewCT_BorderBoxPr() *CT_BorderBoxPr { + ret := &CT_BorderBoxPr{} + return ret +} + +func (m *CT_BorderBoxPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.HideTop != nil { + sehideTop := xml.StartElement{Name: xml.Name{Local: "m:hideTop"}} + e.EncodeElement(m.HideTop, sehideTop) + } + if m.HideBot != nil { + sehideBot := xml.StartElement{Name: xml.Name{Local: "m:hideBot"}} + e.EncodeElement(m.HideBot, sehideBot) + } + if m.HideLeft != nil { + sehideLeft := xml.StartElement{Name: xml.Name{Local: "m:hideLeft"}} + e.EncodeElement(m.HideLeft, sehideLeft) + } + if m.HideRight != nil { + sehideRight := xml.StartElement{Name: xml.Name{Local: "m:hideRight"}} + e.EncodeElement(m.HideRight, sehideRight) + } + if m.StrikeH != nil { + sestrikeH := xml.StartElement{Name: xml.Name{Local: "m:strikeH"}} + e.EncodeElement(m.StrikeH, sestrikeH) + } + if m.StrikeV != nil { + sestrikeV := xml.StartElement{Name: xml.Name{Local: "m:strikeV"}} + e.EncodeElement(m.StrikeV, sestrikeV) + } + if m.StrikeBLTR != nil { + sestrikeBLTR := xml.StartElement{Name: xml.Name{Local: "m:strikeBLTR"}} + e.EncodeElement(m.StrikeBLTR, sestrikeBLTR) + } + if m.StrikeTLBR != nil { + sestrikeTLBR := xml.StartElement{Name: xml.Name{Local: "m:strikeTLBR"}} + e.EncodeElement(m.StrikeTLBR, sestrikeTLBR) + } + if m.CtrlPr != nil { + sectrlPr := xml.StartElement{Name: xml.Name{Local: "m:ctrlPr"}} + e.EncodeElement(m.CtrlPr, sectrlPr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_BorderBoxPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_BorderBoxPr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "hideTop"}: + m.HideTop = NewCT_OnOff() + if err := d.DecodeElement(m.HideTop, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "hideBot"}: + m.HideBot = NewCT_OnOff() + if err := d.DecodeElement(m.HideBot, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "hideLeft"}: + m.HideLeft = NewCT_OnOff() + if err := d.DecodeElement(m.HideLeft, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "hideRight"}: + m.HideRight = NewCT_OnOff() + if err := d.DecodeElement(m.HideRight, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "strikeH"}: + m.StrikeH = NewCT_OnOff() + if err := d.DecodeElement(m.StrikeH, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "strikeV"}: + m.StrikeV = NewCT_OnOff() + if err := d.DecodeElement(m.StrikeV, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "strikeBLTR"}: + m.StrikeBLTR = NewCT_OnOff() + if err := d.DecodeElement(m.StrikeBLTR, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "strikeTLBR"}: + m.StrikeTLBR = NewCT_OnOff() + if err := d.DecodeElement(m.StrikeTLBR, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "ctrlPr"}: + m.CtrlPr = NewCT_CtrlPr() + if err := d.DecodeElement(m.CtrlPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_BorderBoxPr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_BorderBoxPr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_BorderBoxPr and its children +func (m *CT_BorderBoxPr) Validate() error { + return m.ValidateWithPath("CT_BorderBoxPr") +} + +// ValidateWithPath validates the CT_BorderBoxPr and its children, prefixing error messages with path +func (m *CT_BorderBoxPr) ValidateWithPath(path string) error { + if m.HideTop != nil { + if err := m.HideTop.ValidateWithPath(path + "/HideTop"); err != nil { + return err + } + } + if m.HideBot != nil { + if err := m.HideBot.ValidateWithPath(path + "/HideBot"); err != nil { + return err + } + } + if m.HideLeft != nil { + if err := m.HideLeft.ValidateWithPath(path + "/HideLeft"); err != nil { + return err + } + } + if m.HideRight != nil { + if err := m.HideRight.ValidateWithPath(path + "/HideRight"); err != nil { + return err + } + } + if m.StrikeH != nil { + if err := m.StrikeH.ValidateWithPath(path + "/StrikeH"); err != nil { + return err + } + } + if m.StrikeV != nil { + if err := m.StrikeV.ValidateWithPath(path + "/StrikeV"); err != nil { + return err + } + } + if m.StrikeBLTR != nil { + if err := m.StrikeBLTR.ValidateWithPath(path + "/StrikeBLTR"); err != nil { + return err + } + } + if m.StrikeTLBR != nil { + if err := m.StrikeTLBR.ValidateWithPath(path + "/StrikeTLBR"); err != nil { + return err + } + } + if m.CtrlPr != nil { + if err := m.CtrlPr.ValidateWithPath(path + "/CtrlPr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Box.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Box.go new file mode 100644 index 00000000..0958c4cf --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Box.go @@ -0,0 +1,92 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_Box struct { + BoxPr *CT_BoxPr + E *CT_OMathArg +} + +func NewCT_Box() *CT_Box { + ret := &CT_Box{} + ret.E = NewCT_OMathArg() + return ret +} + +func (m *CT_Box) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.BoxPr != nil { + seboxPr := xml.StartElement{Name: xml.Name{Local: "m:boxPr"}} + e.EncodeElement(m.BoxPr, seboxPr) + } + see := xml.StartElement{Name: xml.Name{Local: "m:e"}} + e.EncodeElement(m.E, see) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Box) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.E = NewCT_OMathArg() +lCT_Box: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "boxPr"}: + m.BoxPr = NewCT_BoxPr() + if err := d.DecodeElement(m.BoxPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "e"}: + if err := d.DecodeElement(m.E, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_Box %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Box + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Box and its children +func (m *CT_Box) Validate() error { + return m.ValidateWithPath("CT_Box") +} + +// ValidateWithPath validates the CT_Box and its children, prefixing error messages with path +func (m *CT_Box) ValidateWithPath(path string) error { + if m.BoxPr != nil { + if err := m.BoxPr.ValidateWithPath(path + "/BoxPr"); err != nil { + return err + } + } + if err := m.E.ValidateWithPath(path + "/E"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_BoxPr.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_BoxPr.go new file mode 100644 index 00000000..107d0656 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_BoxPr.go @@ -0,0 +1,155 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_BoxPr struct { + OpEmu *CT_OnOff + NoBreak *CT_OnOff + Diff *CT_OnOff + Brk *CT_ManualBreak + Aln *CT_OnOff + CtrlPr *CT_CtrlPr +} + +func NewCT_BoxPr() *CT_BoxPr { + ret := &CT_BoxPr{} + return ret +} + +func (m *CT_BoxPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.OpEmu != nil { + seopEmu := xml.StartElement{Name: xml.Name{Local: "m:opEmu"}} + e.EncodeElement(m.OpEmu, seopEmu) + } + if m.NoBreak != nil { + senoBreak := xml.StartElement{Name: xml.Name{Local: "m:noBreak"}} + e.EncodeElement(m.NoBreak, senoBreak) + } + if m.Diff != nil { + sediff := xml.StartElement{Name: xml.Name{Local: "m:diff"}} + e.EncodeElement(m.Diff, sediff) + } + if m.Brk != nil { + sebrk := xml.StartElement{Name: xml.Name{Local: "m:brk"}} + e.EncodeElement(m.Brk, sebrk) + } + if m.Aln != nil { + sealn := xml.StartElement{Name: xml.Name{Local: "m:aln"}} + e.EncodeElement(m.Aln, sealn) + } + if m.CtrlPr != nil { + sectrlPr := xml.StartElement{Name: xml.Name{Local: "m:ctrlPr"}} + e.EncodeElement(m.CtrlPr, sectrlPr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_BoxPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_BoxPr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "opEmu"}: + m.OpEmu = NewCT_OnOff() + if err := d.DecodeElement(m.OpEmu, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "noBreak"}: + m.NoBreak = NewCT_OnOff() + if err := d.DecodeElement(m.NoBreak, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "diff"}: + m.Diff = NewCT_OnOff() + if err := d.DecodeElement(m.Diff, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "brk"}: + m.Brk = NewCT_ManualBreak() + if err := d.DecodeElement(m.Brk, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "aln"}: + m.Aln = NewCT_OnOff() + if err := d.DecodeElement(m.Aln, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "ctrlPr"}: + m.CtrlPr = NewCT_CtrlPr() + if err := d.DecodeElement(m.CtrlPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_BoxPr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_BoxPr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_BoxPr and its children +func (m *CT_BoxPr) Validate() error { + return m.ValidateWithPath("CT_BoxPr") +} + +// ValidateWithPath validates the CT_BoxPr and its children, prefixing error messages with path +func (m *CT_BoxPr) ValidateWithPath(path string) error { + if m.OpEmu != nil { + if err := m.OpEmu.ValidateWithPath(path + "/OpEmu"); err != nil { + return err + } + } + if m.NoBreak != nil { + if err := m.NoBreak.ValidateWithPath(path + "/NoBreak"); err != nil { + return err + } + } + if m.Diff != nil { + if err := m.Diff.ValidateWithPath(path + "/Diff"); err != nil { + return err + } + } + if m.Brk != nil { + if err := m.Brk.ValidateWithPath(path + "/Brk"); err != nil { + return err + } + } + if m.Aln != nil { + if err := m.Aln.ValidateWithPath(path + "/Aln"); err != nil { + return err + } + } + if m.CtrlPr != nil { + if err := m.CtrlPr.ValidateWithPath(path + "/CtrlPr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_BreakBin.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_BreakBin.go new file mode 100644 index 00000000..d30175dc --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_BreakBin.go @@ -0,0 +1,71 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + "fmt" +) + +type CT_BreakBin struct { + ValAttr ST_BreakBin +} + +func NewCT_BreakBin() *CT_BreakBin { + ret := &CT_BreakBin{} + return ret +} + +func (m *CT_BreakBin) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.ValAttr != ST_BreakBinUnset { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "m:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_BreakBin) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_BreakBin: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_BreakBin and its children +func (m *CT_BreakBin) Validate() error { + return m.ValidateWithPath("CT_BreakBin") +} + +// ValidateWithPath validates the CT_BreakBin and its children, prefixing error messages with path +func (m *CT_BreakBin) ValidateWithPath(path string) error { + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_BreakBinSub.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_BreakBinSub.go new file mode 100644 index 00000000..dd72cfbe --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_BreakBinSub.go @@ -0,0 +1,71 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + "fmt" +) + +type CT_BreakBinSub struct { + ValAttr ST_BreakBinSub +} + +func NewCT_BreakBinSub() *CT_BreakBinSub { + ret := &CT_BreakBinSub{} + return ret +} + +func (m *CT_BreakBinSub) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.ValAttr != ST_BreakBinSubUnset { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "m:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_BreakBinSub) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_BreakBinSub: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_BreakBinSub and its children +func (m *CT_BreakBinSub) Validate() error { + return m.ValidateWithPath("CT_BreakBinSub") +} + +// ValidateWithPath validates the CT_BreakBinSub and its children, prefixing error messages with path +func (m *CT_BreakBinSub) ValidateWithPath(path string) error { + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Char.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Char.go new file mode 100644 index 00000000..85aa83f6 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Char.go @@ -0,0 +1,67 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + "fmt" +) + +type CT_Char struct { + ValAttr string +} + +func NewCT_Char() *CT_Char { + ret := &CT_Char{} + return ret +} + +func (m *CT_Char) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "m:val"}, + Value: fmt.Sprintf("%v", m.ValAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Char) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ValAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Char: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Char and its children +func (m *CT_Char) Validate() error { + return m.ValidateWithPath("CT_Char") +} + +// ValidateWithPath validates the CT_Char and its children, prefixing error messages with path +func (m *CT_Char) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_CtrlPr.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_CtrlPr.go new file mode 100644 index 00000000..e9e7578b --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_CtrlPr.go @@ -0,0 +1,54 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + "fmt" +) + +type CT_CtrlPr struct { +} + +func NewCT_CtrlPr() *CT_CtrlPr { + ret := &CT_CtrlPr{} + return ret +} + +func (m *CT_CtrlPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_CtrlPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_CtrlPr: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_CtrlPr and its children +func (m *CT_CtrlPr) Validate() error { + return m.ValidateWithPath("CT_CtrlPr") +} + +// ValidateWithPath validates the CT_CtrlPr and its children, prefixing error messages with path +func (m *CT_CtrlPr) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_D.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_D.go new file mode 100644 index 00000000..2d62bbc1 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_D.go @@ -0,0 +1,97 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_D struct { + DPr *CT_DPr + E []*CT_OMathArg +} + +func NewCT_D() *CT_D { + ret := &CT_D{} + return ret +} + +func (m *CT_D) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.DPr != nil { + sedPr := xml.StartElement{Name: xml.Name{Local: "m:dPr"}} + e.EncodeElement(m.DPr, sedPr) + } + see := xml.StartElement{Name: xml.Name{Local: "m:e"}} + for _, c := range m.E { + e.EncodeElement(c, see) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_D) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_D: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "dPr"}: + m.DPr = NewCT_DPr() + if err := d.DecodeElement(m.DPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "e"}: + tmp := NewCT_OMathArg() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.E = append(m.E, tmp) + default: + gooxml.Log("skipping unsupported element on CT_D %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_D + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_D and its children +func (m *CT_D) Validate() error { + return m.ValidateWithPath("CT_D") +} + +// ValidateWithPath validates the CT_D and its children, prefixing error messages with path +func (m *CT_D) ValidateWithPath(path string) error { + if m.DPr != nil { + if err := m.DPr.ValidateWithPath(path + "/DPr"); err != nil { + return err + } + } + for i, v := range m.E { + if err := v.ValidateWithPath(fmt.Sprintf("%s/E[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_DPr.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_DPr.go new file mode 100644 index 00000000..f95159a8 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_DPr.go @@ -0,0 +1,155 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_DPr struct { + BegChr *CT_Char + SepChr *CT_Char + EndChr *CT_Char + Grow *CT_OnOff + Shp *CT_Shp + CtrlPr *CT_CtrlPr +} + +func NewCT_DPr() *CT_DPr { + ret := &CT_DPr{} + return ret +} + +func (m *CT_DPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.BegChr != nil { + sebegChr := xml.StartElement{Name: xml.Name{Local: "m:begChr"}} + e.EncodeElement(m.BegChr, sebegChr) + } + if m.SepChr != nil { + sesepChr := xml.StartElement{Name: xml.Name{Local: "m:sepChr"}} + e.EncodeElement(m.SepChr, sesepChr) + } + if m.EndChr != nil { + seendChr := xml.StartElement{Name: xml.Name{Local: "m:endChr"}} + e.EncodeElement(m.EndChr, seendChr) + } + if m.Grow != nil { + segrow := xml.StartElement{Name: xml.Name{Local: "m:grow"}} + e.EncodeElement(m.Grow, segrow) + } + if m.Shp != nil { + seshp := xml.StartElement{Name: xml.Name{Local: "m:shp"}} + e.EncodeElement(m.Shp, seshp) + } + if m.CtrlPr != nil { + sectrlPr := xml.StartElement{Name: xml.Name{Local: "m:ctrlPr"}} + e.EncodeElement(m.CtrlPr, sectrlPr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_DPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_DPr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "begChr"}: + m.BegChr = NewCT_Char() + if err := d.DecodeElement(m.BegChr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "sepChr"}: + m.SepChr = NewCT_Char() + if err := d.DecodeElement(m.SepChr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "endChr"}: + m.EndChr = NewCT_Char() + if err := d.DecodeElement(m.EndChr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "grow"}: + m.Grow = NewCT_OnOff() + if err := d.DecodeElement(m.Grow, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "shp"}: + m.Shp = NewCT_Shp() + if err := d.DecodeElement(m.Shp, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "ctrlPr"}: + m.CtrlPr = NewCT_CtrlPr() + if err := d.DecodeElement(m.CtrlPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_DPr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_DPr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_DPr and its children +func (m *CT_DPr) Validate() error { + return m.ValidateWithPath("CT_DPr") +} + +// ValidateWithPath validates the CT_DPr and its children, prefixing error messages with path +func (m *CT_DPr) ValidateWithPath(path string) error { + if m.BegChr != nil { + if err := m.BegChr.ValidateWithPath(path + "/BegChr"); err != nil { + return err + } + } + if m.SepChr != nil { + if err := m.SepChr.ValidateWithPath(path + "/SepChr"); err != nil { + return err + } + } + if m.EndChr != nil { + if err := m.EndChr.ValidateWithPath(path + "/EndChr"); err != nil { + return err + } + } + if m.Grow != nil { + if err := m.Grow.ValidateWithPath(path + "/Grow"); err != nil { + return err + } + } + if m.Shp != nil { + if err := m.Shp.ValidateWithPath(path + "/Shp"); err != nil { + return err + } + } + if m.CtrlPr != nil { + if err := m.CtrlPr.ValidateWithPath(path + "/CtrlPr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_EqArr.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_EqArr.go new file mode 100644 index 00000000..c4726b2a --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_EqArr.go @@ -0,0 +1,97 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_EqArr struct { + EqArrPr *CT_EqArrPr + E []*CT_OMathArg +} + +func NewCT_EqArr() *CT_EqArr { + ret := &CT_EqArr{} + return ret +} + +func (m *CT_EqArr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.EqArrPr != nil { + seeqArrPr := xml.StartElement{Name: xml.Name{Local: "m:eqArrPr"}} + e.EncodeElement(m.EqArrPr, seeqArrPr) + } + see := xml.StartElement{Name: xml.Name{Local: "m:e"}} + for _, c := range m.E { + e.EncodeElement(c, see) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_EqArr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_EqArr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "eqArrPr"}: + m.EqArrPr = NewCT_EqArrPr() + if err := d.DecodeElement(m.EqArrPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "e"}: + tmp := NewCT_OMathArg() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.E = append(m.E, tmp) + default: + gooxml.Log("skipping unsupported element on CT_EqArr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_EqArr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_EqArr and its children +func (m *CT_EqArr) Validate() error { + return m.ValidateWithPath("CT_EqArr") +} + +// ValidateWithPath validates the CT_EqArr and its children, prefixing error messages with path +func (m *CT_EqArr) ValidateWithPath(path string) error { + if m.EqArrPr != nil { + if err := m.EqArrPr.ValidateWithPath(path + "/EqArrPr"); err != nil { + return err + } + } + for i, v := range m.E { + if err := v.ValidateWithPath(fmt.Sprintf("%s/E[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_EqArrPr.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_EqArrPr.go new file mode 100644 index 00000000..f800c469 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_EqArrPr.go @@ -0,0 +1,155 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_EqArrPr struct { + BaseJc *CT_YAlign + MaxDist *CT_OnOff + ObjDist *CT_OnOff + RSpRule *CT_SpacingRule + RSp *CT_UnSignedInteger + CtrlPr *CT_CtrlPr +} + +func NewCT_EqArrPr() *CT_EqArrPr { + ret := &CT_EqArrPr{} + return ret +} + +func (m *CT_EqArrPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.BaseJc != nil { + sebaseJc := xml.StartElement{Name: xml.Name{Local: "m:baseJc"}} + e.EncodeElement(m.BaseJc, sebaseJc) + } + if m.MaxDist != nil { + semaxDist := xml.StartElement{Name: xml.Name{Local: "m:maxDist"}} + e.EncodeElement(m.MaxDist, semaxDist) + } + if m.ObjDist != nil { + seobjDist := xml.StartElement{Name: xml.Name{Local: "m:objDist"}} + e.EncodeElement(m.ObjDist, seobjDist) + } + if m.RSpRule != nil { + serSpRule := xml.StartElement{Name: xml.Name{Local: "m:rSpRule"}} + e.EncodeElement(m.RSpRule, serSpRule) + } + if m.RSp != nil { + serSp := xml.StartElement{Name: xml.Name{Local: "m:rSp"}} + e.EncodeElement(m.RSp, serSp) + } + if m.CtrlPr != nil { + sectrlPr := xml.StartElement{Name: xml.Name{Local: "m:ctrlPr"}} + e.EncodeElement(m.CtrlPr, sectrlPr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_EqArrPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_EqArrPr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "baseJc"}: + m.BaseJc = NewCT_YAlign() + if err := d.DecodeElement(m.BaseJc, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "maxDist"}: + m.MaxDist = NewCT_OnOff() + if err := d.DecodeElement(m.MaxDist, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "objDist"}: + m.ObjDist = NewCT_OnOff() + if err := d.DecodeElement(m.ObjDist, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "rSpRule"}: + m.RSpRule = NewCT_SpacingRule() + if err := d.DecodeElement(m.RSpRule, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "rSp"}: + m.RSp = NewCT_UnSignedInteger() + if err := d.DecodeElement(m.RSp, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "ctrlPr"}: + m.CtrlPr = NewCT_CtrlPr() + if err := d.DecodeElement(m.CtrlPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_EqArrPr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_EqArrPr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_EqArrPr and its children +func (m *CT_EqArrPr) Validate() error { + return m.ValidateWithPath("CT_EqArrPr") +} + +// ValidateWithPath validates the CT_EqArrPr and its children, prefixing error messages with path +func (m *CT_EqArrPr) ValidateWithPath(path string) error { + if m.BaseJc != nil { + if err := m.BaseJc.ValidateWithPath(path + "/BaseJc"); err != nil { + return err + } + } + if m.MaxDist != nil { + if err := m.MaxDist.ValidateWithPath(path + "/MaxDist"); err != nil { + return err + } + } + if m.ObjDist != nil { + if err := m.ObjDist.ValidateWithPath(path + "/ObjDist"); err != nil { + return err + } + } + if m.RSpRule != nil { + if err := m.RSpRule.ValidateWithPath(path + "/RSpRule"); err != nil { + return err + } + } + if m.RSp != nil { + if err := m.RSp.ValidateWithPath(path + "/RSp"); err != nil { + return err + } + } + if m.CtrlPr != nil { + if err := m.CtrlPr.ValidateWithPath(path + "/CtrlPr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_F.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_F.go new file mode 100644 index 00000000..63b8cdc8 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_F.go @@ -0,0 +1,104 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_F struct { + FPr *CT_FPr + Num *CT_OMathArg + Den *CT_OMathArg +} + +func NewCT_F() *CT_F { + ret := &CT_F{} + ret.Num = NewCT_OMathArg() + ret.Den = NewCT_OMathArg() + return ret +} + +func (m *CT_F) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.FPr != nil { + sefPr := xml.StartElement{Name: xml.Name{Local: "m:fPr"}} + e.EncodeElement(m.FPr, sefPr) + } + senum := xml.StartElement{Name: xml.Name{Local: "m:num"}} + e.EncodeElement(m.Num, senum) + seden := xml.StartElement{Name: xml.Name{Local: "m:den"}} + e.EncodeElement(m.Den, seden) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_F) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.Num = NewCT_OMathArg() + m.Den = NewCT_OMathArg() +lCT_F: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "fPr"}: + m.FPr = NewCT_FPr() + if err := d.DecodeElement(m.FPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "num"}: + if err := d.DecodeElement(m.Num, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "den"}: + if err := d.DecodeElement(m.Den, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_F %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_F + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_F and its children +func (m *CT_F) Validate() error { + return m.ValidateWithPath("CT_F") +} + +// ValidateWithPath validates the CT_F and its children, prefixing error messages with path +func (m *CT_F) ValidateWithPath(path string) error { + if m.FPr != nil { + if err := m.FPr.ValidateWithPath(path + "/FPr"); err != nil { + return err + } + } + if err := m.Num.ValidateWithPath(path + "/Num"); err != nil { + return err + } + if err := m.Den.ValidateWithPath(path + "/Den"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_FPr.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_FPr.go new file mode 100644 index 00000000..79ca2d55 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_FPr.go @@ -0,0 +1,95 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_FPr struct { + Type *CT_FType + CtrlPr *CT_CtrlPr +} + +func NewCT_FPr() *CT_FPr { + ret := &CT_FPr{} + return ret +} + +func (m *CT_FPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Type != nil { + setype := xml.StartElement{Name: xml.Name{Local: "m:type"}} + e.EncodeElement(m.Type, setype) + } + if m.CtrlPr != nil { + sectrlPr := xml.StartElement{Name: xml.Name{Local: "m:ctrlPr"}} + e.EncodeElement(m.CtrlPr, sectrlPr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_FPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_FPr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "type"}: + m.Type = NewCT_FType() + if err := d.DecodeElement(m.Type, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "ctrlPr"}: + m.CtrlPr = NewCT_CtrlPr() + if err := d.DecodeElement(m.CtrlPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_FPr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_FPr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_FPr and its children +func (m *CT_FPr) Validate() error { + return m.ValidateWithPath("CT_FPr") +} + +// ValidateWithPath validates the CT_FPr and its children, prefixing error messages with path +func (m *CT_FPr) ValidateWithPath(path string) error { + if m.Type != nil { + if err := m.Type.ValidateWithPath(path + "/Type"); err != nil { + return err + } + } + if m.CtrlPr != nil { + if err := m.CtrlPr.ValidateWithPath(path + "/CtrlPr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_FType.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_FType.go new file mode 100644 index 00000000..d0db9ca3 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_FType.go @@ -0,0 +1,74 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + "fmt" +) + +type CT_FType struct { + ValAttr ST_FType +} + +func NewCT_FType() *CT_FType { + ret := &CT_FType{} + ret.ValAttr = ST_FType(1) + return ret +} + +func (m *CT_FType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "m:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_FType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_FType(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_FType: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_FType and its children +func (m *CT_FType) Validate() error { + return m.ValidateWithPath("CT_FType") +} + +// ValidateWithPath validates the CT_FType and its children, prefixing error messages with path +func (m *CT_FType) ValidateWithPath(path string) error { + if m.ValAttr == ST_FTypeUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Func.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Func.go new file mode 100644 index 00000000..f176409a --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Func.go @@ -0,0 +1,104 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_Func struct { + FuncPr *CT_FuncPr + FName *CT_OMathArg + E *CT_OMathArg +} + +func NewCT_Func() *CT_Func { + ret := &CT_Func{} + ret.FName = NewCT_OMathArg() + ret.E = NewCT_OMathArg() + return ret +} + +func (m *CT_Func) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.FuncPr != nil { + sefuncPr := xml.StartElement{Name: xml.Name{Local: "m:funcPr"}} + e.EncodeElement(m.FuncPr, sefuncPr) + } + sefName := xml.StartElement{Name: xml.Name{Local: "m:fName"}} + e.EncodeElement(m.FName, sefName) + see := xml.StartElement{Name: xml.Name{Local: "m:e"}} + e.EncodeElement(m.E, see) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Func) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.FName = NewCT_OMathArg() + m.E = NewCT_OMathArg() +lCT_Func: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "funcPr"}: + m.FuncPr = NewCT_FuncPr() + if err := d.DecodeElement(m.FuncPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "fName"}: + if err := d.DecodeElement(m.FName, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "e"}: + if err := d.DecodeElement(m.E, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_Func %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Func + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Func and its children +func (m *CT_Func) Validate() error { + return m.ValidateWithPath("CT_Func") +} + +// ValidateWithPath validates the CT_Func and its children, prefixing error messages with path +func (m *CT_Func) ValidateWithPath(path string) error { + if m.FuncPr != nil { + if err := m.FuncPr.ValidateWithPath(path + "/FuncPr"); err != nil { + return err + } + } + if err := m.FName.ValidateWithPath(path + "/FName"); err != nil { + return err + } + if err := m.E.ValidateWithPath(path + "/E"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_FuncPr.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_FuncPr.go new file mode 100644 index 00000000..4eba3c2a --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_FuncPr.go @@ -0,0 +1,80 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_FuncPr struct { + CtrlPr *CT_CtrlPr +} + +func NewCT_FuncPr() *CT_FuncPr { + ret := &CT_FuncPr{} + return ret +} + +func (m *CT_FuncPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.CtrlPr != nil { + sectrlPr := xml.StartElement{Name: xml.Name{Local: "m:ctrlPr"}} + e.EncodeElement(m.CtrlPr, sectrlPr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_FuncPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_FuncPr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "ctrlPr"}: + m.CtrlPr = NewCT_CtrlPr() + if err := d.DecodeElement(m.CtrlPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_FuncPr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_FuncPr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_FuncPr and its children +func (m *CT_FuncPr) Validate() error { + return m.ValidateWithPath("CT_FuncPr") +} + +// ValidateWithPath validates the CT_FuncPr and its children, prefixing error messages with path +func (m *CT_FuncPr) ValidateWithPath(path string) error { + if m.CtrlPr != nil { + if err := m.CtrlPr.ValidateWithPath(path + "/CtrlPr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_GroupChr.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_GroupChr.go new file mode 100644 index 00000000..1a0d8b6f --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_GroupChr.go @@ -0,0 +1,92 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_GroupChr struct { + GroupChrPr *CT_GroupChrPr + E *CT_OMathArg +} + +func NewCT_GroupChr() *CT_GroupChr { + ret := &CT_GroupChr{} + ret.E = NewCT_OMathArg() + return ret +} + +func (m *CT_GroupChr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.GroupChrPr != nil { + segroupChrPr := xml.StartElement{Name: xml.Name{Local: "m:groupChrPr"}} + e.EncodeElement(m.GroupChrPr, segroupChrPr) + } + see := xml.StartElement{Name: xml.Name{Local: "m:e"}} + e.EncodeElement(m.E, see) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_GroupChr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.E = NewCT_OMathArg() +lCT_GroupChr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "groupChrPr"}: + m.GroupChrPr = NewCT_GroupChrPr() + if err := d.DecodeElement(m.GroupChrPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "e"}: + if err := d.DecodeElement(m.E, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_GroupChr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_GroupChr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_GroupChr and its children +func (m *CT_GroupChr) Validate() error { + return m.ValidateWithPath("CT_GroupChr") +} + +// ValidateWithPath validates the CT_GroupChr and its children, prefixing error messages with path +func (m *CT_GroupChr) ValidateWithPath(path string) error { + if m.GroupChrPr != nil { + if err := m.GroupChrPr.ValidateWithPath(path + "/GroupChrPr"); err != nil { + return err + } + } + if err := m.E.ValidateWithPath(path + "/E"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_GroupChrPr.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_GroupChrPr.go new file mode 100644 index 00000000..77c12e1b --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_GroupChrPr.go @@ -0,0 +1,125 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_GroupChrPr struct { + Chr *CT_Char + Pos *CT_TopBot + VertJc *CT_TopBot + CtrlPr *CT_CtrlPr +} + +func NewCT_GroupChrPr() *CT_GroupChrPr { + ret := &CT_GroupChrPr{} + return ret +} + +func (m *CT_GroupChrPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Chr != nil { + sechr := xml.StartElement{Name: xml.Name{Local: "m:chr"}} + e.EncodeElement(m.Chr, sechr) + } + if m.Pos != nil { + sepos := xml.StartElement{Name: xml.Name{Local: "m:pos"}} + e.EncodeElement(m.Pos, sepos) + } + if m.VertJc != nil { + severtJc := xml.StartElement{Name: xml.Name{Local: "m:vertJc"}} + e.EncodeElement(m.VertJc, severtJc) + } + if m.CtrlPr != nil { + sectrlPr := xml.StartElement{Name: xml.Name{Local: "m:ctrlPr"}} + e.EncodeElement(m.CtrlPr, sectrlPr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_GroupChrPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_GroupChrPr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "chr"}: + m.Chr = NewCT_Char() + if err := d.DecodeElement(m.Chr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "pos"}: + m.Pos = NewCT_TopBot() + if err := d.DecodeElement(m.Pos, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "vertJc"}: + m.VertJc = NewCT_TopBot() + if err := d.DecodeElement(m.VertJc, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "ctrlPr"}: + m.CtrlPr = NewCT_CtrlPr() + if err := d.DecodeElement(m.CtrlPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_GroupChrPr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_GroupChrPr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_GroupChrPr and its children +func (m *CT_GroupChrPr) Validate() error { + return m.ValidateWithPath("CT_GroupChrPr") +} + +// ValidateWithPath validates the CT_GroupChrPr and its children, prefixing error messages with path +func (m *CT_GroupChrPr) ValidateWithPath(path string) error { + if m.Chr != nil { + if err := m.Chr.ValidateWithPath(path + "/Chr"); err != nil { + return err + } + } + if m.Pos != nil { + if err := m.Pos.ValidateWithPath(path + "/Pos"); err != nil { + return err + } + } + if m.VertJc != nil { + if err := m.VertJc.ValidateWithPath(path + "/VertJc"); err != nil { + return err + } + } + if m.CtrlPr != nil { + if err := m.CtrlPr.ValidateWithPath(path + "/CtrlPr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Integer2.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Integer2.go new file mode 100644 index 00000000..bc6bd122 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Integer2.go @@ -0,0 +1,76 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + "fmt" + "strconv" +) + +type CT_Integer2 struct { + ValAttr int64 +} + +func NewCT_Integer2() *CT_Integer2 { + ret := &CT_Integer2{} + ret.ValAttr = -2 + return ret +} + +func (m *CT_Integer2) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "m:val"}, + Value: fmt.Sprintf("%v", m.ValAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Integer2) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = -2 + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.ValAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Integer2: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Integer2 and its children +func (m *CT_Integer2) Validate() error { + return m.ValidateWithPath("CT_Integer2") +} + +// ValidateWithPath validates the CT_Integer2 and its children, prefixing error messages with path +func (m *CT_Integer2) ValidateWithPath(path string) error { + if m.ValAttr < -2 { + return fmt.Errorf("%s/m.ValAttr must be >= -2 (have %v)", path, m.ValAttr) + } + if m.ValAttr > 2 { + return fmt.Errorf("%s/m.ValAttr must be <= 2 (have %v)", path, m.ValAttr) + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Integer255.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Integer255.go new file mode 100644 index 00000000..bcabcf40 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Integer255.go @@ -0,0 +1,76 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + "fmt" + "strconv" +) + +type CT_Integer255 struct { + ValAttr int64 +} + +func NewCT_Integer255() *CT_Integer255 { + ret := &CT_Integer255{} + ret.ValAttr = 1 + return ret +} + +func (m *CT_Integer255) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "m:val"}, + Value: fmt.Sprintf("%v", m.ValAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Integer255) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = 1 + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.ValAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Integer255: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Integer255 and its children +func (m *CT_Integer255) Validate() error { + return m.ValidateWithPath("CT_Integer255") +} + +// ValidateWithPath validates the CT_Integer255 and its children, prefixing error messages with path +func (m *CT_Integer255) ValidateWithPath(path string) error { + if m.ValAttr < 1 { + return fmt.Errorf("%s/m.ValAttr must be >= 1 (have %v)", path, m.ValAttr) + } + if m.ValAttr > 255 { + return fmt.Errorf("%s/m.ValAttr must be <= 255 (have %v)", path, m.ValAttr) + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_LimLoc.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_LimLoc.go new file mode 100644 index 00000000..7ec26b06 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_LimLoc.go @@ -0,0 +1,74 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + "fmt" +) + +type CT_LimLoc struct { + ValAttr ST_LimLoc +} + +func NewCT_LimLoc() *CT_LimLoc { + ret := &CT_LimLoc{} + ret.ValAttr = ST_LimLoc(1) + return ret +} + +func (m *CT_LimLoc) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "m:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_LimLoc) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_LimLoc(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_LimLoc: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_LimLoc and its children +func (m *CT_LimLoc) Validate() error { + return m.ValidateWithPath("CT_LimLoc") +} + +// ValidateWithPath validates the CT_LimLoc and its children, prefixing error messages with path +func (m *CT_LimLoc) ValidateWithPath(path string) error { + if m.ValAttr == ST_LimLocUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_LimLow.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_LimLow.go new file mode 100644 index 00000000..39d1cb7a --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_LimLow.go @@ -0,0 +1,104 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_LimLow struct { + LimLowPr *CT_LimLowPr + E *CT_OMathArg + Lim *CT_OMathArg +} + +func NewCT_LimLow() *CT_LimLow { + ret := &CT_LimLow{} + ret.E = NewCT_OMathArg() + ret.Lim = NewCT_OMathArg() + return ret +} + +func (m *CT_LimLow) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.LimLowPr != nil { + selimLowPr := xml.StartElement{Name: xml.Name{Local: "m:limLowPr"}} + e.EncodeElement(m.LimLowPr, selimLowPr) + } + see := xml.StartElement{Name: xml.Name{Local: "m:e"}} + e.EncodeElement(m.E, see) + selim := xml.StartElement{Name: xml.Name{Local: "m:lim"}} + e.EncodeElement(m.Lim, selim) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_LimLow) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.E = NewCT_OMathArg() + m.Lim = NewCT_OMathArg() +lCT_LimLow: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "limLowPr"}: + m.LimLowPr = NewCT_LimLowPr() + if err := d.DecodeElement(m.LimLowPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "e"}: + if err := d.DecodeElement(m.E, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "lim"}: + if err := d.DecodeElement(m.Lim, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_LimLow %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_LimLow + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_LimLow and its children +func (m *CT_LimLow) Validate() error { + return m.ValidateWithPath("CT_LimLow") +} + +// ValidateWithPath validates the CT_LimLow and its children, prefixing error messages with path +func (m *CT_LimLow) ValidateWithPath(path string) error { + if m.LimLowPr != nil { + if err := m.LimLowPr.ValidateWithPath(path + "/LimLowPr"); err != nil { + return err + } + } + if err := m.E.ValidateWithPath(path + "/E"); err != nil { + return err + } + if err := m.Lim.ValidateWithPath(path + "/Lim"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_LimLowPr.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_LimLowPr.go new file mode 100644 index 00000000..bdf8f255 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_LimLowPr.go @@ -0,0 +1,80 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_LimLowPr struct { + CtrlPr *CT_CtrlPr +} + +func NewCT_LimLowPr() *CT_LimLowPr { + ret := &CT_LimLowPr{} + return ret +} + +func (m *CT_LimLowPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.CtrlPr != nil { + sectrlPr := xml.StartElement{Name: xml.Name{Local: "m:ctrlPr"}} + e.EncodeElement(m.CtrlPr, sectrlPr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_LimLowPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_LimLowPr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "ctrlPr"}: + m.CtrlPr = NewCT_CtrlPr() + if err := d.DecodeElement(m.CtrlPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_LimLowPr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_LimLowPr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_LimLowPr and its children +func (m *CT_LimLowPr) Validate() error { + return m.ValidateWithPath("CT_LimLowPr") +} + +// ValidateWithPath validates the CT_LimLowPr and its children, prefixing error messages with path +func (m *CT_LimLowPr) ValidateWithPath(path string) error { + if m.CtrlPr != nil { + if err := m.CtrlPr.ValidateWithPath(path + "/CtrlPr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_LimUpp.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_LimUpp.go new file mode 100644 index 00000000..ac450724 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_LimUpp.go @@ -0,0 +1,104 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_LimUpp struct { + LimUppPr *CT_LimUppPr + E *CT_OMathArg + Lim *CT_OMathArg +} + +func NewCT_LimUpp() *CT_LimUpp { + ret := &CT_LimUpp{} + ret.E = NewCT_OMathArg() + ret.Lim = NewCT_OMathArg() + return ret +} + +func (m *CT_LimUpp) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.LimUppPr != nil { + selimUppPr := xml.StartElement{Name: xml.Name{Local: "m:limUppPr"}} + e.EncodeElement(m.LimUppPr, selimUppPr) + } + see := xml.StartElement{Name: xml.Name{Local: "m:e"}} + e.EncodeElement(m.E, see) + selim := xml.StartElement{Name: xml.Name{Local: "m:lim"}} + e.EncodeElement(m.Lim, selim) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_LimUpp) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.E = NewCT_OMathArg() + m.Lim = NewCT_OMathArg() +lCT_LimUpp: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "limUppPr"}: + m.LimUppPr = NewCT_LimUppPr() + if err := d.DecodeElement(m.LimUppPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "e"}: + if err := d.DecodeElement(m.E, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "lim"}: + if err := d.DecodeElement(m.Lim, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_LimUpp %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_LimUpp + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_LimUpp and its children +func (m *CT_LimUpp) Validate() error { + return m.ValidateWithPath("CT_LimUpp") +} + +// ValidateWithPath validates the CT_LimUpp and its children, prefixing error messages with path +func (m *CT_LimUpp) ValidateWithPath(path string) error { + if m.LimUppPr != nil { + if err := m.LimUppPr.ValidateWithPath(path + "/LimUppPr"); err != nil { + return err + } + } + if err := m.E.ValidateWithPath(path + "/E"); err != nil { + return err + } + if err := m.Lim.ValidateWithPath(path + "/Lim"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_LimUppPr.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_LimUppPr.go new file mode 100644 index 00000000..fa09c982 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_LimUppPr.go @@ -0,0 +1,80 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_LimUppPr struct { + CtrlPr *CT_CtrlPr +} + +func NewCT_LimUppPr() *CT_LimUppPr { + ret := &CT_LimUppPr{} + return ret +} + +func (m *CT_LimUppPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.CtrlPr != nil { + sectrlPr := xml.StartElement{Name: xml.Name{Local: "m:ctrlPr"}} + e.EncodeElement(m.CtrlPr, sectrlPr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_LimUppPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_LimUppPr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "ctrlPr"}: + m.CtrlPr = NewCT_CtrlPr() + if err := d.DecodeElement(m.CtrlPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_LimUppPr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_LimUppPr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_LimUppPr and its children +func (m *CT_LimUppPr) Validate() error { + return m.ValidateWithPath("CT_LimUppPr") +} + +// ValidateWithPath validates the CT_LimUppPr and its children, prefixing error messages with path +func (m *CT_LimUppPr) ValidateWithPath(path string) error { + if m.CtrlPr != nil { + if err := m.CtrlPr.ValidateWithPath(path + "/CtrlPr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_M.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_M.go new file mode 100644 index 00000000..f6d719c2 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_M.go @@ -0,0 +1,97 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_M struct { + MPr *CT_MPr + Mr []*CT_MR +} + +func NewCT_M() *CT_M { + ret := &CT_M{} + return ret +} + +func (m *CT_M) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.MPr != nil { + semPr := xml.StartElement{Name: xml.Name{Local: "m:mPr"}} + e.EncodeElement(m.MPr, semPr) + } + semr := xml.StartElement{Name: xml.Name{Local: "m:mr"}} + for _, c := range m.Mr { + e.EncodeElement(c, semr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_M) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_M: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "mPr"}: + m.MPr = NewCT_MPr() + if err := d.DecodeElement(m.MPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "mr"}: + tmp := NewCT_MR() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Mr = append(m.Mr, tmp) + default: + gooxml.Log("skipping unsupported element on CT_M %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_M + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_M and its children +func (m *CT_M) Validate() error { + return m.ValidateWithPath("CT_M") +} + +// ValidateWithPath validates the CT_M and its children, prefixing error messages with path +func (m *CT_M) ValidateWithPath(path string) error { + if m.MPr != nil { + if err := m.MPr.ValidateWithPath(path + "/MPr"); err != nil { + return err + } + } + for i, v := range m.Mr { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Mr[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_MC.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_MC.go new file mode 100644 index 00000000..2764bdb4 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_MC.go @@ -0,0 +1,80 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_MC struct { + McPr *CT_MCPr +} + +func NewCT_MC() *CT_MC { + ret := &CT_MC{} + return ret +} + +func (m *CT_MC) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.McPr != nil { + semcPr := xml.StartElement{Name: xml.Name{Local: "m:mcPr"}} + e.EncodeElement(m.McPr, semcPr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_MC) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_MC: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "mcPr"}: + m.McPr = NewCT_MCPr() + if err := d.DecodeElement(m.McPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_MC %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_MC + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_MC and its children +func (m *CT_MC) Validate() error { + return m.ValidateWithPath("CT_MC") +} + +// ValidateWithPath validates the CT_MC and its children, prefixing error messages with path +func (m *CT_MC) ValidateWithPath(path string) error { + if m.McPr != nil { + if err := m.McPr.ValidateWithPath(path + "/McPr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_MCPr.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_MCPr.go new file mode 100644 index 00000000..31bc5c2c --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_MCPr.go @@ -0,0 +1,95 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_MCPr struct { + Count *CT_Integer255 + McJc *CT_XAlign +} + +func NewCT_MCPr() *CT_MCPr { + ret := &CT_MCPr{} + return ret +} + +func (m *CT_MCPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Count != nil { + secount := xml.StartElement{Name: xml.Name{Local: "m:count"}} + e.EncodeElement(m.Count, secount) + } + if m.McJc != nil { + semcJc := xml.StartElement{Name: xml.Name{Local: "m:mcJc"}} + e.EncodeElement(m.McJc, semcJc) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_MCPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_MCPr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "count"}: + m.Count = NewCT_Integer255() + if err := d.DecodeElement(m.Count, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "mcJc"}: + m.McJc = NewCT_XAlign() + if err := d.DecodeElement(m.McJc, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_MCPr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_MCPr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_MCPr and its children +func (m *CT_MCPr) Validate() error { + return m.ValidateWithPath("CT_MCPr") +} + +// ValidateWithPath validates the CT_MCPr and its children, prefixing error messages with path +func (m *CT_MCPr) ValidateWithPath(path string) error { + if m.Count != nil { + if err := m.Count.ValidateWithPath(path + "/Count"); err != nil { + return err + } + } + if m.McJc != nil { + if err := m.McJc.ValidateWithPath(path + "/McJc"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_MCS.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_MCS.go new file mode 100644 index 00000000..d1144ef6 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_MCS.go @@ -0,0 +1,82 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_MCS struct { + Mc []*CT_MC +} + +func NewCT_MCS() *CT_MCS { + ret := &CT_MCS{} + return ret +} + +func (m *CT_MCS) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + semc := xml.StartElement{Name: xml.Name{Local: "m:mc"}} + for _, c := range m.Mc { + e.EncodeElement(c, semc) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_MCS) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_MCS: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "mc"}: + tmp := NewCT_MC() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Mc = append(m.Mc, tmp) + default: + gooxml.Log("skipping unsupported element on CT_MCS %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_MCS + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_MCS and its children +func (m *CT_MCS) Validate() error { + return m.ValidateWithPath("CT_MCS") +} + +// ValidateWithPath validates the CT_MCS and its children, prefixing error messages with path +func (m *CT_MCS) ValidateWithPath(path string) error { + for i, v := range m.Mc { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Mc[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_MPr.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_MPr.go new file mode 100644 index 00000000..f7e30f27 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_MPr.go @@ -0,0 +1,200 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_MPr struct { + BaseJc *CT_YAlign + PlcHide *CT_OnOff + RSpRule *CT_SpacingRule + CGpRule *CT_SpacingRule + RSp *CT_UnSignedInteger + CSp *CT_UnSignedInteger + CGp *CT_UnSignedInteger + Mcs *CT_MCS + CtrlPr *CT_CtrlPr +} + +func NewCT_MPr() *CT_MPr { + ret := &CT_MPr{} + return ret +} + +func (m *CT_MPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.BaseJc != nil { + sebaseJc := xml.StartElement{Name: xml.Name{Local: "m:baseJc"}} + e.EncodeElement(m.BaseJc, sebaseJc) + } + if m.PlcHide != nil { + seplcHide := xml.StartElement{Name: xml.Name{Local: "m:plcHide"}} + e.EncodeElement(m.PlcHide, seplcHide) + } + if m.RSpRule != nil { + serSpRule := xml.StartElement{Name: xml.Name{Local: "m:rSpRule"}} + e.EncodeElement(m.RSpRule, serSpRule) + } + if m.CGpRule != nil { + secGpRule := xml.StartElement{Name: xml.Name{Local: "m:cGpRule"}} + e.EncodeElement(m.CGpRule, secGpRule) + } + if m.RSp != nil { + serSp := xml.StartElement{Name: xml.Name{Local: "m:rSp"}} + e.EncodeElement(m.RSp, serSp) + } + if m.CSp != nil { + secSp := xml.StartElement{Name: xml.Name{Local: "m:cSp"}} + e.EncodeElement(m.CSp, secSp) + } + if m.CGp != nil { + secGp := xml.StartElement{Name: xml.Name{Local: "m:cGp"}} + e.EncodeElement(m.CGp, secGp) + } + if m.Mcs != nil { + semcs := xml.StartElement{Name: xml.Name{Local: "m:mcs"}} + e.EncodeElement(m.Mcs, semcs) + } + if m.CtrlPr != nil { + sectrlPr := xml.StartElement{Name: xml.Name{Local: "m:ctrlPr"}} + e.EncodeElement(m.CtrlPr, sectrlPr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_MPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_MPr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "baseJc"}: + m.BaseJc = NewCT_YAlign() + if err := d.DecodeElement(m.BaseJc, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "plcHide"}: + m.PlcHide = NewCT_OnOff() + if err := d.DecodeElement(m.PlcHide, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "rSpRule"}: + m.RSpRule = NewCT_SpacingRule() + if err := d.DecodeElement(m.RSpRule, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "cGpRule"}: + m.CGpRule = NewCT_SpacingRule() + if err := d.DecodeElement(m.CGpRule, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "rSp"}: + m.RSp = NewCT_UnSignedInteger() + if err := d.DecodeElement(m.RSp, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "cSp"}: + m.CSp = NewCT_UnSignedInteger() + if err := d.DecodeElement(m.CSp, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "cGp"}: + m.CGp = NewCT_UnSignedInteger() + if err := d.DecodeElement(m.CGp, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "mcs"}: + m.Mcs = NewCT_MCS() + if err := d.DecodeElement(m.Mcs, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "ctrlPr"}: + m.CtrlPr = NewCT_CtrlPr() + if err := d.DecodeElement(m.CtrlPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_MPr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_MPr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_MPr and its children +func (m *CT_MPr) Validate() error { + return m.ValidateWithPath("CT_MPr") +} + +// ValidateWithPath validates the CT_MPr and its children, prefixing error messages with path +func (m *CT_MPr) ValidateWithPath(path string) error { + if m.BaseJc != nil { + if err := m.BaseJc.ValidateWithPath(path + "/BaseJc"); err != nil { + return err + } + } + if m.PlcHide != nil { + if err := m.PlcHide.ValidateWithPath(path + "/PlcHide"); err != nil { + return err + } + } + if m.RSpRule != nil { + if err := m.RSpRule.ValidateWithPath(path + "/RSpRule"); err != nil { + return err + } + } + if m.CGpRule != nil { + if err := m.CGpRule.ValidateWithPath(path + "/CGpRule"); err != nil { + return err + } + } + if m.RSp != nil { + if err := m.RSp.ValidateWithPath(path + "/RSp"); err != nil { + return err + } + } + if m.CSp != nil { + if err := m.CSp.ValidateWithPath(path + "/CSp"); err != nil { + return err + } + } + if m.CGp != nil { + if err := m.CGp.ValidateWithPath(path + "/CGp"); err != nil { + return err + } + } + if m.Mcs != nil { + if err := m.Mcs.ValidateWithPath(path + "/Mcs"); err != nil { + return err + } + } + if m.CtrlPr != nil { + if err := m.CtrlPr.ValidateWithPath(path + "/CtrlPr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_MR.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_MR.go new file mode 100644 index 00000000..2cdbc755 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_MR.go @@ -0,0 +1,82 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_MR struct { + E []*CT_OMathArg +} + +func NewCT_MR() *CT_MR { + ret := &CT_MR{} + return ret +} + +func (m *CT_MR) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + see := xml.StartElement{Name: xml.Name{Local: "m:e"}} + for _, c := range m.E { + e.EncodeElement(c, see) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_MR) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_MR: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "e"}: + tmp := NewCT_OMathArg() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.E = append(m.E, tmp) + default: + gooxml.Log("skipping unsupported element on CT_MR %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_MR + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_MR and its children +func (m *CT_MR) Validate() error { + return m.ValidateWithPath("CT_MR") +} + +// ValidateWithPath validates the CT_MR and its children, prefixing error messages with path +func (m *CT_MR) ValidateWithPath(path string) error { + for i, v := range m.E { + if err := v.ValidateWithPath(fmt.Sprintf("%s/E[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_ManualBreak.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_ManualBreak.go new file mode 100644 index 00000000..cc8aea73 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_ManualBreak.go @@ -0,0 +1,78 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + "fmt" + "strconv" +) + +type CT_ManualBreak struct { + AlnAtAttr *int64 +} + +func NewCT_ManualBreak() *CT_ManualBreak { + ret := &CT_ManualBreak{} + return ret +} + +func (m *CT_ManualBreak) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.AlnAtAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "m:alnAt"}, + Value: fmt.Sprintf("%v", *m.AlnAtAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_ManualBreak) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "alnAt" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.AlnAtAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_ManualBreak: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_ManualBreak and its children +func (m *CT_ManualBreak) Validate() error { + return m.ValidateWithPath("CT_ManualBreak") +} + +// ValidateWithPath validates the CT_ManualBreak and its children, prefixing error messages with path +func (m *CT_ManualBreak) ValidateWithPath(path string) error { + if m.AlnAtAttr != nil { + if *m.AlnAtAttr < 1 { + return fmt.Errorf("%s/m.AlnAtAttr must be >= 1 (have %v)", path, *m.AlnAtAttr) + } + if *m.AlnAtAttr > 255 { + return fmt.Errorf("%s/m.AlnAtAttr must be <= 255 (have %v)", path, *m.AlnAtAttr) + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_MathPr.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_MathPr.go new file mode 100644 index 00000000..d270442d --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_MathPr.go @@ -0,0 +1,294 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_MathPr struct { + MathFont *CT_String + BrkBin *CT_BreakBin + BrkBinSub *CT_BreakBinSub + SmallFrac *CT_OnOff + DispDef *CT_OnOff + LMargin *CT_TwipsMeasure + RMargin *CT_TwipsMeasure + DefJc *CT_OMathJc + PreSp *CT_TwipsMeasure + PostSp *CT_TwipsMeasure + InterSp *CT_TwipsMeasure + IntraSp *CT_TwipsMeasure + Choice *CT_MathPrChoice + IntLim *CT_LimLoc + NaryLim *CT_LimLoc +} + +func NewCT_MathPr() *CT_MathPr { + ret := &CT_MathPr{} + return ret +} + +func (m *CT_MathPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.MathFont != nil { + semathFont := xml.StartElement{Name: xml.Name{Local: "m:mathFont"}} + e.EncodeElement(m.MathFont, semathFont) + } + if m.BrkBin != nil { + sebrkBin := xml.StartElement{Name: xml.Name{Local: "m:brkBin"}} + e.EncodeElement(m.BrkBin, sebrkBin) + } + if m.BrkBinSub != nil { + sebrkBinSub := xml.StartElement{Name: xml.Name{Local: "m:brkBinSub"}} + e.EncodeElement(m.BrkBinSub, sebrkBinSub) + } + if m.SmallFrac != nil { + sesmallFrac := xml.StartElement{Name: xml.Name{Local: "m:smallFrac"}} + e.EncodeElement(m.SmallFrac, sesmallFrac) + } + if m.DispDef != nil { + sedispDef := xml.StartElement{Name: xml.Name{Local: "m:dispDef"}} + e.EncodeElement(m.DispDef, sedispDef) + } + if m.LMargin != nil { + selMargin := xml.StartElement{Name: xml.Name{Local: "m:lMargin"}} + e.EncodeElement(m.LMargin, selMargin) + } + if m.RMargin != nil { + serMargin := xml.StartElement{Name: xml.Name{Local: "m:rMargin"}} + e.EncodeElement(m.RMargin, serMargin) + } + if m.DefJc != nil { + sedefJc := xml.StartElement{Name: xml.Name{Local: "m:defJc"}} + e.EncodeElement(m.DefJc, sedefJc) + } + if m.PreSp != nil { + sepreSp := xml.StartElement{Name: xml.Name{Local: "m:preSp"}} + e.EncodeElement(m.PreSp, sepreSp) + } + if m.PostSp != nil { + sepostSp := xml.StartElement{Name: xml.Name{Local: "m:postSp"}} + e.EncodeElement(m.PostSp, sepostSp) + } + if m.InterSp != nil { + seinterSp := xml.StartElement{Name: xml.Name{Local: "m:interSp"}} + e.EncodeElement(m.InterSp, seinterSp) + } + if m.IntraSp != nil { + seintraSp := xml.StartElement{Name: xml.Name{Local: "m:intraSp"}} + e.EncodeElement(m.IntraSp, seintraSp) + } + if m.Choice != nil { + m.Choice.MarshalXML(e, xml.StartElement{}) + } + if m.IntLim != nil { + seintLim := xml.StartElement{Name: xml.Name{Local: "m:intLim"}} + e.EncodeElement(m.IntLim, seintLim) + } + if m.NaryLim != nil { + senaryLim := xml.StartElement{Name: xml.Name{Local: "m:naryLim"}} + e.EncodeElement(m.NaryLim, senaryLim) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_MathPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_MathPr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "mathFont"}: + m.MathFont = NewCT_String() + if err := d.DecodeElement(m.MathFont, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "brkBin"}: + m.BrkBin = NewCT_BreakBin() + if err := d.DecodeElement(m.BrkBin, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "brkBinSub"}: + m.BrkBinSub = NewCT_BreakBinSub() + if err := d.DecodeElement(m.BrkBinSub, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "smallFrac"}: + m.SmallFrac = NewCT_OnOff() + if err := d.DecodeElement(m.SmallFrac, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "dispDef"}: + m.DispDef = NewCT_OnOff() + if err := d.DecodeElement(m.DispDef, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "lMargin"}: + m.LMargin = NewCT_TwipsMeasure() + if err := d.DecodeElement(m.LMargin, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "rMargin"}: + m.RMargin = NewCT_TwipsMeasure() + if err := d.DecodeElement(m.RMargin, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "defJc"}: + m.DefJc = NewCT_OMathJc() + if err := d.DecodeElement(m.DefJc, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "preSp"}: + m.PreSp = NewCT_TwipsMeasure() + if err := d.DecodeElement(m.PreSp, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "postSp"}: + m.PostSp = NewCT_TwipsMeasure() + if err := d.DecodeElement(m.PostSp, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "interSp"}: + m.InterSp = NewCT_TwipsMeasure() + if err := d.DecodeElement(m.InterSp, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "intraSp"}: + m.IntraSp = NewCT_TwipsMeasure() + if err := d.DecodeElement(m.IntraSp, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "wrapIndent"}: + m.Choice = NewCT_MathPrChoice() + if err := d.DecodeElement(&m.Choice.WrapIndent, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "wrapRight"}: + m.Choice = NewCT_MathPrChoice() + if err := d.DecodeElement(&m.Choice.WrapRight, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "intLim"}: + m.IntLim = NewCT_LimLoc() + if err := d.DecodeElement(m.IntLim, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "naryLim"}: + m.NaryLim = NewCT_LimLoc() + if err := d.DecodeElement(m.NaryLim, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_MathPr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_MathPr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_MathPr and its children +func (m *CT_MathPr) Validate() error { + return m.ValidateWithPath("CT_MathPr") +} + +// ValidateWithPath validates the CT_MathPr and its children, prefixing error messages with path +func (m *CT_MathPr) ValidateWithPath(path string) error { + if m.MathFont != nil { + if err := m.MathFont.ValidateWithPath(path + "/MathFont"); err != nil { + return err + } + } + if m.BrkBin != nil { + if err := m.BrkBin.ValidateWithPath(path + "/BrkBin"); err != nil { + return err + } + } + if m.BrkBinSub != nil { + if err := m.BrkBinSub.ValidateWithPath(path + "/BrkBinSub"); err != nil { + return err + } + } + if m.SmallFrac != nil { + if err := m.SmallFrac.ValidateWithPath(path + "/SmallFrac"); err != nil { + return err + } + } + if m.DispDef != nil { + if err := m.DispDef.ValidateWithPath(path + "/DispDef"); err != nil { + return err + } + } + if m.LMargin != nil { + if err := m.LMargin.ValidateWithPath(path + "/LMargin"); err != nil { + return err + } + } + if m.RMargin != nil { + if err := m.RMargin.ValidateWithPath(path + "/RMargin"); err != nil { + return err + } + } + if m.DefJc != nil { + if err := m.DefJc.ValidateWithPath(path + "/DefJc"); err != nil { + return err + } + } + if m.PreSp != nil { + if err := m.PreSp.ValidateWithPath(path + "/PreSp"); err != nil { + return err + } + } + if m.PostSp != nil { + if err := m.PostSp.ValidateWithPath(path + "/PostSp"); err != nil { + return err + } + } + if m.InterSp != nil { + if err := m.InterSp.ValidateWithPath(path + "/InterSp"); err != nil { + return err + } + } + if m.IntraSp != nil { + if err := m.IntraSp.ValidateWithPath(path + "/IntraSp"); err != nil { + return err + } + } + if m.Choice != nil { + if err := m.Choice.ValidateWithPath(path + "/Choice"); err != nil { + return err + } + } + if m.IntLim != nil { + if err := m.IntLim.ValidateWithPath(path + "/IntLim"); err != nil { + return err + } + } + if m.NaryLim != nil { + if err := m.NaryLim.ValidateWithPath(path + "/NaryLim"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_MathPrChoice.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_MathPrChoice.go new file mode 100644 index 00000000..99f49c2c --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_MathPrChoice.go @@ -0,0 +1,93 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_MathPrChoice struct { + WrapIndent *CT_TwipsMeasure + WrapRight *CT_OnOff +} + +func NewCT_MathPrChoice() *CT_MathPrChoice { + ret := &CT_MathPrChoice{} + return ret +} + +func (m *CT_MathPrChoice) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.WrapIndent != nil { + sewrapIndent := xml.StartElement{Name: xml.Name{Local: "m:wrapIndent"}} + e.EncodeElement(m.WrapIndent, sewrapIndent) + } + if m.WrapRight != nil { + sewrapRight := xml.StartElement{Name: xml.Name{Local: "m:wrapRight"}} + e.EncodeElement(m.WrapRight, sewrapRight) + } + return nil +} + +func (m *CT_MathPrChoice) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_MathPrChoice: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "wrapIndent"}: + m.WrapIndent = NewCT_TwipsMeasure() + if err := d.DecodeElement(m.WrapIndent, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "wrapRight"}: + m.WrapRight = NewCT_OnOff() + if err := d.DecodeElement(m.WrapRight, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_MathPrChoice %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_MathPrChoice + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_MathPrChoice and its children +func (m *CT_MathPrChoice) Validate() error { + return m.ValidateWithPath("CT_MathPrChoice") +} + +// ValidateWithPath validates the CT_MathPrChoice and its children, prefixing error messages with path +func (m *CT_MathPrChoice) ValidateWithPath(path string) error { + if m.WrapIndent != nil { + if err := m.WrapIndent.ValidateWithPath(path + "/WrapIndent"); err != nil { + return err + } + } + if m.WrapRight != nil { + if err := m.WrapRight.ValidateWithPath(path + "/WrapRight"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Nary.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Nary.go new file mode 100644 index 00000000..5fa704ca --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Nary.go @@ -0,0 +1,116 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_Nary struct { + NaryPr *CT_NaryPr + Sub *CT_OMathArg + Sup *CT_OMathArg + E *CT_OMathArg +} + +func NewCT_Nary() *CT_Nary { + ret := &CT_Nary{} + ret.Sub = NewCT_OMathArg() + ret.Sup = NewCT_OMathArg() + ret.E = NewCT_OMathArg() + return ret +} + +func (m *CT_Nary) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.NaryPr != nil { + senaryPr := xml.StartElement{Name: xml.Name{Local: "m:naryPr"}} + e.EncodeElement(m.NaryPr, senaryPr) + } + sesub := xml.StartElement{Name: xml.Name{Local: "m:sub"}} + e.EncodeElement(m.Sub, sesub) + sesup := xml.StartElement{Name: xml.Name{Local: "m:sup"}} + e.EncodeElement(m.Sup, sesup) + see := xml.StartElement{Name: xml.Name{Local: "m:e"}} + e.EncodeElement(m.E, see) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Nary) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.Sub = NewCT_OMathArg() + m.Sup = NewCT_OMathArg() + m.E = NewCT_OMathArg() +lCT_Nary: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "naryPr"}: + m.NaryPr = NewCT_NaryPr() + if err := d.DecodeElement(m.NaryPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "sub"}: + if err := d.DecodeElement(m.Sub, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "sup"}: + if err := d.DecodeElement(m.Sup, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "e"}: + if err := d.DecodeElement(m.E, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_Nary %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Nary + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Nary and its children +func (m *CT_Nary) Validate() error { + return m.ValidateWithPath("CT_Nary") +} + +// ValidateWithPath validates the CT_Nary and its children, prefixing error messages with path +func (m *CT_Nary) ValidateWithPath(path string) error { + if m.NaryPr != nil { + if err := m.NaryPr.ValidateWithPath(path + "/NaryPr"); err != nil { + return err + } + } + if err := m.Sub.ValidateWithPath(path + "/Sub"); err != nil { + return err + } + if err := m.Sup.ValidateWithPath(path + "/Sup"); err != nil { + return err + } + if err := m.E.ValidateWithPath(path + "/E"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_NaryPr.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_NaryPr.go new file mode 100644 index 00000000..9714bde0 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_NaryPr.go @@ -0,0 +1,155 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_NaryPr struct { + Chr *CT_Char + LimLoc *CT_LimLoc + Grow *CT_OnOff + SubHide *CT_OnOff + SupHide *CT_OnOff + CtrlPr *CT_CtrlPr +} + +func NewCT_NaryPr() *CT_NaryPr { + ret := &CT_NaryPr{} + return ret +} + +func (m *CT_NaryPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Chr != nil { + sechr := xml.StartElement{Name: xml.Name{Local: "m:chr"}} + e.EncodeElement(m.Chr, sechr) + } + if m.LimLoc != nil { + selimLoc := xml.StartElement{Name: xml.Name{Local: "m:limLoc"}} + e.EncodeElement(m.LimLoc, selimLoc) + } + if m.Grow != nil { + segrow := xml.StartElement{Name: xml.Name{Local: "m:grow"}} + e.EncodeElement(m.Grow, segrow) + } + if m.SubHide != nil { + sesubHide := xml.StartElement{Name: xml.Name{Local: "m:subHide"}} + e.EncodeElement(m.SubHide, sesubHide) + } + if m.SupHide != nil { + sesupHide := xml.StartElement{Name: xml.Name{Local: "m:supHide"}} + e.EncodeElement(m.SupHide, sesupHide) + } + if m.CtrlPr != nil { + sectrlPr := xml.StartElement{Name: xml.Name{Local: "m:ctrlPr"}} + e.EncodeElement(m.CtrlPr, sectrlPr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_NaryPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_NaryPr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "chr"}: + m.Chr = NewCT_Char() + if err := d.DecodeElement(m.Chr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "limLoc"}: + m.LimLoc = NewCT_LimLoc() + if err := d.DecodeElement(m.LimLoc, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "grow"}: + m.Grow = NewCT_OnOff() + if err := d.DecodeElement(m.Grow, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "subHide"}: + m.SubHide = NewCT_OnOff() + if err := d.DecodeElement(m.SubHide, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "supHide"}: + m.SupHide = NewCT_OnOff() + if err := d.DecodeElement(m.SupHide, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "ctrlPr"}: + m.CtrlPr = NewCT_CtrlPr() + if err := d.DecodeElement(m.CtrlPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_NaryPr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_NaryPr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_NaryPr and its children +func (m *CT_NaryPr) Validate() error { + return m.ValidateWithPath("CT_NaryPr") +} + +// ValidateWithPath validates the CT_NaryPr and its children, prefixing error messages with path +func (m *CT_NaryPr) ValidateWithPath(path string) error { + if m.Chr != nil { + if err := m.Chr.ValidateWithPath(path + "/Chr"); err != nil { + return err + } + } + if m.LimLoc != nil { + if err := m.LimLoc.ValidateWithPath(path + "/LimLoc"); err != nil { + return err + } + } + if m.Grow != nil { + if err := m.Grow.ValidateWithPath(path + "/Grow"); err != nil { + return err + } + } + if m.SubHide != nil { + if err := m.SubHide.ValidateWithPath(path + "/SubHide"); err != nil { + return err + } + } + if m.SupHide != nil { + if err := m.SupHide.ValidateWithPath(path + "/SupHide"); err != nil { + return err + } + } + if m.CtrlPr != nil { + if err := m.CtrlPr.ValidateWithPath(path + "/CtrlPr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_OMath.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_OMath.go new file mode 100644 index 00000000..fd6a0691 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_OMath.go @@ -0,0 +1,217 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_OMath struct { + EG_OMathMathElements []*EG_OMathMathElements +} + +func NewCT_OMath() *CT_OMath { + ret := &CT_OMath{} + return ret +} + +func (m *CT_OMath) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.EG_OMathMathElements != nil { + for _, c := range m.EG_OMathMathElements { + c.MarshalXML(e, xml.StartElement{}) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_OMath) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_OMath: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "acc"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.Acc = NewCT_Acc() + if err := d.DecodeElement(tmpomathmathelements.Acc, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "bar"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.Bar = NewCT_Bar() + if err := d.DecodeElement(tmpomathmathelements.Bar, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "box"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.Box = NewCT_Box() + if err := d.DecodeElement(tmpomathmathelements.Box, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "borderBox"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.BorderBox = NewCT_BorderBox() + if err := d.DecodeElement(tmpomathmathelements.BorderBox, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "d"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.D = NewCT_D() + if err := d.DecodeElement(tmpomathmathelements.D, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "eqArr"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.EqArr = NewCT_EqArr() + if err := d.DecodeElement(tmpomathmathelements.EqArr, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "f"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.F = NewCT_F() + if err := d.DecodeElement(tmpomathmathelements.F, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "func"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.Func = NewCT_Func() + if err := d.DecodeElement(tmpomathmathelements.Func, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "groupChr"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.GroupChr = NewCT_GroupChr() + if err := d.DecodeElement(tmpomathmathelements.GroupChr, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "limLow"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.LimLow = NewCT_LimLow() + if err := d.DecodeElement(tmpomathmathelements.LimLow, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "limUpp"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.LimUpp = NewCT_LimUpp() + if err := d.DecodeElement(tmpomathmathelements.LimUpp, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "m"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.M = NewCT_M() + if err := d.DecodeElement(tmpomathmathelements.M, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "nary"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.Nary = NewCT_Nary() + if err := d.DecodeElement(tmpomathmathelements.Nary, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "phant"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.Phant = NewCT_Phant() + if err := d.DecodeElement(tmpomathmathelements.Phant, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "rad"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.Rad = NewCT_Rad() + if err := d.DecodeElement(tmpomathmathelements.Rad, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "sPre"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.SPre = NewCT_SPre() + if err := d.DecodeElement(tmpomathmathelements.SPre, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "sSub"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.SSub = NewCT_SSub() + if err := d.DecodeElement(tmpomathmathelements.SSub, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "sSubSup"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.SSubSup = NewCT_SSubSup() + if err := d.DecodeElement(tmpomathmathelements.SSubSup, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "sSup"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.SSup = NewCT_SSup() + if err := d.DecodeElement(tmpomathmathelements.SSup, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "r"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.R = NewCT_R() + if err := d.DecodeElement(tmpomathmathelements.R, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + default: + gooxml.Log("skipping unsupported element on CT_OMath %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_OMath + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_OMath and its children +func (m *CT_OMath) Validate() error { + return m.ValidateWithPath("CT_OMath") +} + +// ValidateWithPath validates the CT_OMath and its children, prefixing error messages with path +func (m *CT_OMath) ValidateWithPath(path string) error { + for i, v := range m.EG_OMathMathElements { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_OMathMathElements[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_OMathArg.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_OMathArg.go new file mode 100644 index 00000000..49cf982c --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_OMathArg.go @@ -0,0 +1,247 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_OMathArg struct { + ArgPr *CT_OMathArgPr + EG_OMathMathElements []*EG_OMathMathElements + CtrlPr *CT_CtrlPr +} + +func NewCT_OMathArg() *CT_OMathArg { + ret := &CT_OMathArg{} + return ret +} + +func (m *CT_OMathArg) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.ArgPr != nil { + seargPr := xml.StartElement{Name: xml.Name{Local: "m:argPr"}} + e.EncodeElement(m.ArgPr, seargPr) + } + if m.EG_OMathMathElements != nil { + for _, c := range m.EG_OMathMathElements { + c.MarshalXML(e, xml.StartElement{}) + } + } + if m.CtrlPr != nil { + sectrlPr := xml.StartElement{Name: xml.Name{Local: "m:ctrlPr"}} + e.EncodeElement(m.CtrlPr, sectrlPr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_OMathArg) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_OMathArg: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "argPr"}: + m.ArgPr = NewCT_OMathArgPr() + if err := d.DecodeElement(m.ArgPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "acc"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.Acc = NewCT_Acc() + if err := d.DecodeElement(tmpomathmathelements.Acc, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "bar"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.Bar = NewCT_Bar() + if err := d.DecodeElement(tmpomathmathelements.Bar, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "box"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.Box = NewCT_Box() + if err := d.DecodeElement(tmpomathmathelements.Box, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "borderBox"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.BorderBox = NewCT_BorderBox() + if err := d.DecodeElement(tmpomathmathelements.BorderBox, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "d"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.D = NewCT_D() + if err := d.DecodeElement(tmpomathmathelements.D, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "eqArr"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.EqArr = NewCT_EqArr() + if err := d.DecodeElement(tmpomathmathelements.EqArr, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "f"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.F = NewCT_F() + if err := d.DecodeElement(tmpomathmathelements.F, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "func"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.Func = NewCT_Func() + if err := d.DecodeElement(tmpomathmathelements.Func, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "groupChr"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.GroupChr = NewCT_GroupChr() + if err := d.DecodeElement(tmpomathmathelements.GroupChr, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "limLow"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.LimLow = NewCT_LimLow() + if err := d.DecodeElement(tmpomathmathelements.LimLow, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "limUpp"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.LimUpp = NewCT_LimUpp() + if err := d.DecodeElement(tmpomathmathelements.LimUpp, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "m"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.M = NewCT_M() + if err := d.DecodeElement(tmpomathmathelements.M, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "nary"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.Nary = NewCT_Nary() + if err := d.DecodeElement(tmpomathmathelements.Nary, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "phant"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.Phant = NewCT_Phant() + if err := d.DecodeElement(tmpomathmathelements.Phant, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "rad"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.Rad = NewCT_Rad() + if err := d.DecodeElement(tmpomathmathelements.Rad, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "sPre"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.SPre = NewCT_SPre() + if err := d.DecodeElement(tmpomathmathelements.SPre, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "sSub"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.SSub = NewCT_SSub() + if err := d.DecodeElement(tmpomathmathelements.SSub, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "sSubSup"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.SSubSup = NewCT_SSubSup() + if err := d.DecodeElement(tmpomathmathelements.SSubSup, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "sSup"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.SSup = NewCT_SSup() + if err := d.DecodeElement(tmpomathmathelements.SSup, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "r"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.R = NewCT_R() + if err := d.DecodeElement(tmpomathmathelements.R, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "ctrlPr"}: + m.CtrlPr = NewCT_CtrlPr() + if err := d.DecodeElement(m.CtrlPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_OMathArg %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_OMathArg + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_OMathArg and its children +func (m *CT_OMathArg) Validate() error { + return m.ValidateWithPath("CT_OMathArg") +} + +// ValidateWithPath validates the CT_OMathArg and its children, prefixing error messages with path +func (m *CT_OMathArg) ValidateWithPath(path string) error { + if m.ArgPr != nil { + if err := m.ArgPr.ValidateWithPath(path + "/ArgPr"); err != nil { + return err + } + } + for i, v := range m.EG_OMathMathElements { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_OMathMathElements[%d]", path, i)); err != nil { + return err + } + } + if m.CtrlPr != nil { + if err := m.CtrlPr.ValidateWithPath(path + "/CtrlPr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_OMathArgPr.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_OMathArgPr.go new file mode 100644 index 00000000..2271e245 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_OMathArgPr.go @@ -0,0 +1,80 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_OMathArgPr struct { + ArgSz *CT_Integer2 +} + +func NewCT_OMathArgPr() *CT_OMathArgPr { + ret := &CT_OMathArgPr{} + return ret +} + +func (m *CT_OMathArgPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.ArgSz != nil { + seargSz := xml.StartElement{Name: xml.Name{Local: "m:argSz"}} + e.EncodeElement(m.ArgSz, seargSz) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_OMathArgPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_OMathArgPr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "argSz"}: + m.ArgSz = NewCT_Integer2() + if err := d.DecodeElement(m.ArgSz, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_OMathArgPr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_OMathArgPr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_OMathArgPr and its children +func (m *CT_OMathArgPr) Validate() error { + return m.ValidateWithPath("CT_OMathArgPr") +} + +// ValidateWithPath validates the CT_OMathArgPr and its children, prefixing error messages with path +func (m *CT_OMathArgPr) ValidateWithPath(path string) error { + if m.ArgSz != nil { + if err := m.ArgSz.ValidateWithPath(path + "/ArgSz"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_OMathJc.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_OMathJc.go new file mode 100644 index 00000000..8ecff94d --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_OMathJc.go @@ -0,0 +1,71 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + "fmt" +) + +type CT_OMathJc struct { + ValAttr ST_Jc +} + +func NewCT_OMathJc() *CT_OMathJc { + ret := &CT_OMathJc{} + return ret +} + +func (m *CT_OMathJc) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.ValAttr != ST_JcUnset { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "m:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_OMathJc) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_OMathJc: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_OMathJc and its children +func (m *CT_OMathJc) Validate() error { + return m.ValidateWithPath("CT_OMathJc") +} + +// ValidateWithPath validates the CT_OMathJc and its children, prefixing error messages with path +func (m *CT_OMathJc) ValidateWithPath(path string) error { + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_OMathPara.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_OMathPara.go new file mode 100644 index 00000000..b15a60dc --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_OMathPara.go @@ -0,0 +1,97 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_OMathPara struct { + OMathParaPr *CT_OMathParaPr + OMath []*CT_OMath +} + +func NewCT_OMathPara() *CT_OMathPara { + ret := &CT_OMathPara{} + return ret +} + +func (m *CT_OMathPara) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.OMathParaPr != nil { + seoMathParaPr := xml.StartElement{Name: xml.Name{Local: "m:oMathParaPr"}} + e.EncodeElement(m.OMathParaPr, seoMathParaPr) + } + seoMath := xml.StartElement{Name: xml.Name{Local: "m:oMath"}} + for _, c := range m.OMath { + e.EncodeElement(c, seoMath) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_OMathPara) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_OMathPara: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMathParaPr"}: + m.OMathParaPr = NewCT_OMathParaPr() + if err := d.DecodeElement(m.OMathParaPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMath"}: + tmp := NewCT_OMath() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.OMath = append(m.OMath, tmp) + default: + gooxml.Log("skipping unsupported element on CT_OMathPara %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_OMathPara + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_OMathPara and its children +func (m *CT_OMathPara) Validate() error { + return m.ValidateWithPath("CT_OMathPara") +} + +// ValidateWithPath validates the CT_OMathPara and its children, prefixing error messages with path +func (m *CT_OMathPara) ValidateWithPath(path string) error { + if m.OMathParaPr != nil { + if err := m.OMathParaPr.ValidateWithPath(path + "/OMathParaPr"); err != nil { + return err + } + } + for i, v := range m.OMath { + if err := v.ValidateWithPath(fmt.Sprintf("%s/OMath[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_OMathParaPr.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_OMathParaPr.go new file mode 100644 index 00000000..9701a7c3 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_OMathParaPr.go @@ -0,0 +1,80 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_OMathParaPr struct { + Jc *CT_OMathJc +} + +func NewCT_OMathParaPr() *CT_OMathParaPr { + ret := &CT_OMathParaPr{} + return ret +} + +func (m *CT_OMathParaPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Jc != nil { + sejc := xml.StartElement{Name: xml.Name{Local: "m:jc"}} + e.EncodeElement(m.Jc, sejc) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_OMathParaPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_OMathParaPr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "jc"}: + m.Jc = NewCT_OMathJc() + if err := d.DecodeElement(m.Jc, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_OMathParaPr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_OMathParaPr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_OMathParaPr and its children +func (m *CT_OMathParaPr) Validate() error { + return m.ValidateWithPath("CT_OMathParaPr") +} + +// ValidateWithPath validates the CT_OMathParaPr and its children, prefixing error messages with path +func (m *CT_OMathParaPr) ValidateWithPath(path string) error { + if m.Jc != nil { + if err := m.Jc.ValidateWithPath(path + "/Jc"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_OnOff.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_OnOff.go new file mode 100644 index 00000000..e2e9fb1b --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_OnOff.go @@ -0,0 +1,76 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_OnOff struct { + ValAttr *sharedTypes.ST_OnOff +} + +func NewCT_OnOff() *CT_OnOff { + ret := &CT_OnOff{} + return ret +} + +func (m *CT_OnOff) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.ValAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "m:val"}, + Value: fmt.Sprintf("%v", *m.ValAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_OnOff) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.ValAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_OnOff: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_OnOff and its children +func (m *CT_OnOff) Validate() error { + return m.ValidateWithPath("CT_OnOff") +} + +// ValidateWithPath validates the CT_OnOff and its children, prefixing error messages with path +func (m *CT_OnOff) ValidateWithPath(path string) error { + if m.ValAttr != nil { + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Phant.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Phant.go new file mode 100644 index 00000000..282fee82 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Phant.go @@ -0,0 +1,92 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_Phant struct { + PhantPr *CT_PhantPr + E *CT_OMathArg +} + +func NewCT_Phant() *CT_Phant { + ret := &CT_Phant{} + ret.E = NewCT_OMathArg() + return ret +} + +func (m *CT_Phant) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.PhantPr != nil { + sephantPr := xml.StartElement{Name: xml.Name{Local: "m:phantPr"}} + e.EncodeElement(m.PhantPr, sephantPr) + } + see := xml.StartElement{Name: xml.Name{Local: "m:e"}} + e.EncodeElement(m.E, see) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Phant) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.E = NewCT_OMathArg() +lCT_Phant: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "phantPr"}: + m.PhantPr = NewCT_PhantPr() + if err := d.DecodeElement(m.PhantPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "e"}: + if err := d.DecodeElement(m.E, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_Phant %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Phant + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Phant and its children +func (m *CT_Phant) Validate() error { + return m.ValidateWithPath("CT_Phant") +} + +// ValidateWithPath validates the CT_Phant and its children, prefixing error messages with path +func (m *CT_Phant) ValidateWithPath(path string) error { + if m.PhantPr != nil { + if err := m.PhantPr.ValidateWithPath(path + "/PhantPr"); err != nil { + return err + } + } + if err := m.E.ValidateWithPath(path + "/E"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_PhantPr.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_PhantPr.go new file mode 100644 index 00000000..51738097 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_PhantPr.go @@ -0,0 +1,155 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_PhantPr struct { + Show *CT_OnOff + ZeroWid *CT_OnOff + ZeroAsc *CT_OnOff + ZeroDesc *CT_OnOff + Transp *CT_OnOff + CtrlPr *CT_CtrlPr +} + +func NewCT_PhantPr() *CT_PhantPr { + ret := &CT_PhantPr{} + return ret +} + +func (m *CT_PhantPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Show != nil { + seshow := xml.StartElement{Name: xml.Name{Local: "m:show"}} + e.EncodeElement(m.Show, seshow) + } + if m.ZeroWid != nil { + sezeroWid := xml.StartElement{Name: xml.Name{Local: "m:zeroWid"}} + e.EncodeElement(m.ZeroWid, sezeroWid) + } + if m.ZeroAsc != nil { + sezeroAsc := xml.StartElement{Name: xml.Name{Local: "m:zeroAsc"}} + e.EncodeElement(m.ZeroAsc, sezeroAsc) + } + if m.ZeroDesc != nil { + sezeroDesc := xml.StartElement{Name: xml.Name{Local: "m:zeroDesc"}} + e.EncodeElement(m.ZeroDesc, sezeroDesc) + } + if m.Transp != nil { + setransp := xml.StartElement{Name: xml.Name{Local: "m:transp"}} + e.EncodeElement(m.Transp, setransp) + } + if m.CtrlPr != nil { + sectrlPr := xml.StartElement{Name: xml.Name{Local: "m:ctrlPr"}} + e.EncodeElement(m.CtrlPr, sectrlPr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_PhantPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_PhantPr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "show"}: + m.Show = NewCT_OnOff() + if err := d.DecodeElement(m.Show, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "zeroWid"}: + m.ZeroWid = NewCT_OnOff() + if err := d.DecodeElement(m.ZeroWid, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "zeroAsc"}: + m.ZeroAsc = NewCT_OnOff() + if err := d.DecodeElement(m.ZeroAsc, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "zeroDesc"}: + m.ZeroDesc = NewCT_OnOff() + if err := d.DecodeElement(m.ZeroDesc, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "transp"}: + m.Transp = NewCT_OnOff() + if err := d.DecodeElement(m.Transp, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "ctrlPr"}: + m.CtrlPr = NewCT_CtrlPr() + if err := d.DecodeElement(m.CtrlPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_PhantPr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_PhantPr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_PhantPr and its children +func (m *CT_PhantPr) Validate() error { + return m.ValidateWithPath("CT_PhantPr") +} + +// ValidateWithPath validates the CT_PhantPr and its children, prefixing error messages with path +func (m *CT_PhantPr) ValidateWithPath(path string) error { + if m.Show != nil { + if err := m.Show.ValidateWithPath(path + "/Show"); err != nil { + return err + } + } + if m.ZeroWid != nil { + if err := m.ZeroWid.ValidateWithPath(path + "/ZeroWid"); err != nil { + return err + } + } + if m.ZeroAsc != nil { + if err := m.ZeroAsc.ValidateWithPath(path + "/ZeroAsc"); err != nil { + return err + } + } + if m.ZeroDesc != nil { + if err := m.ZeroDesc.ValidateWithPath(path + "/ZeroDesc"); err != nil { + return err + } + } + if m.Transp != nil { + if err := m.Transp.ValidateWithPath(path + "/Transp"); err != nil { + return err + } + } + if m.CtrlPr != nil { + if err := m.CtrlPr.ValidateWithPath(path + "/CtrlPr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_R.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_R.go new file mode 100644 index 00000000..9ead0c62 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_R.go @@ -0,0 +1,98 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_R struct { + RPr *CT_RPR + Choice []*CT_RChoice +} + +func NewCT_R() *CT_R { + ret := &CT_R{} + return ret +} + +func (m *CT_R) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.RPr != nil { + serPr := xml.StartElement{Name: xml.Name{Local: "m:rPr"}} + e.EncodeElement(m.RPr, serPr) + } + if m.Choice != nil { + for _, c := range m.Choice { + c.MarshalXML(e, xml.StartElement{}) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_R) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_R: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "rPr"}: + m.RPr = NewCT_RPR() + if err := d.DecodeElement(m.RPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "t"}: + tmp := NewCT_RChoice() + if err := d.DecodeElement(&tmp.T, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + default: + gooxml.Log("skipping unsupported element on CT_R %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_R + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_R and its children +func (m *CT_R) Validate() error { + return m.ValidateWithPath("CT_R") +} + +// ValidateWithPath validates the CT_R and its children, prefixing error messages with path +func (m *CT_R) ValidateWithPath(path string) error { + if m.RPr != nil { + if err := m.RPr.ValidateWithPath(path + "/RPr"); err != nil { + return err + } + } + for i, v := range m.Choice { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Choice[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_RChoice.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_RChoice.go new file mode 100644 index 00000000..8f6f0209 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_RChoice.go @@ -0,0 +1,82 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_RChoice struct { + T []*CT_Text +} + +func NewCT_RChoice() *CT_RChoice { + ret := &CT_RChoice{} + return ret +} + +func (m *CT_RChoice) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.T != nil { + set := xml.StartElement{Name: xml.Name{Local: "m:t"}} + for _, c := range m.T { + e.EncodeElement(c, set) + } + } + return nil +} + +func (m *CT_RChoice) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_RChoice: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "t"}: + tmp := NewCT_Text() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.T = append(m.T, tmp) + default: + gooxml.Log("skipping unsupported element on CT_RChoice %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_RChoice + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_RChoice and its children +func (m *CT_RChoice) Validate() error { + return m.ValidateWithPath("CT_RChoice") +} + +// ValidateWithPath validates the CT_RChoice and its children, prefixing error messages with path +func (m *CT_RChoice) ValidateWithPath(path string) error { + for i, v := range m.T { + if err := v.ValidateWithPath(fmt.Sprintf("%s/T[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_RPR.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_RPR.go new file mode 100644 index 00000000..7cf2b754 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_RPR.go @@ -0,0 +1,124 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_RPR struct { + Lit *CT_OnOff + Choice *CT_RPRChoice + Brk *CT_ManualBreak + Aln *CT_OnOff +} + +func NewCT_RPR() *CT_RPR { + ret := &CT_RPR{} + return ret +} + +func (m *CT_RPR) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Lit != nil { + selit := xml.StartElement{Name: xml.Name{Local: "m:lit"}} + e.EncodeElement(m.Lit, selit) + } + if m.Choice != nil { + m.Choice.MarshalXML(e, xml.StartElement{}) + } + if m.Brk != nil { + sebrk := xml.StartElement{Name: xml.Name{Local: "m:brk"}} + e.EncodeElement(m.Brk, sebrk) + } + if m.Aln != nil { + sealn := xml.StartElement{Name: xml.Name{Local: "m:aln"}} + e.EncodeElement(m.Aln, sealn) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_RPR) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_RPR: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "lit"}: + m.Lit = NewCT_OnOff() + if err := d.DecodeElement(m.Lit, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "nor"}: + m.Choice = NewCT_RPRChoice() + if err := d.DecodeElement(&m.Choice.Nor, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "brk"}: + m.Brk = NewCT_ManualBreak() + if err := d.DecodeElement(m.Brk, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "aln"}: + m.Aln = NewCT_OnOff() + if err := d.DecodeElement(m.Aln, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_RPR %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_RPR + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_RPR and its children +func (m *CT_RPR) Validate() error { + return m.ValidateWithPath("CT_RPR") +} + +// ValidateWithPath validates the CT_RPR and its children, prefixing error messages with path +func (m *CT_RPR) ValidateWithPath(path string) error { + if m.Lit != nil { + if err := m.Lit.ValidateWithPath(path + "/Lit"); err != nil { + return err + } + } + if m.Choice != nil { + if err := m.Choice.ValidateWithPath(path + "/Choice"); err != nil { + return err + } + } + if m.Brk != nil { + if err := m.Brk.ValidateWithPath(path + "/Brk"); err != nil { + return err + } + } + if m.Aln != nil { + if err := m.Aln.ValidateWithPath(path + "/Aln"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_RPRChoice.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_RPRChoice.go new file mode 100644 index 00000000..baaeb4ec --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_RPRChoice.go @@ -0,0 +1,78 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_RPRChoice struct { + Nor *CT_OnOff +} + +func NewCT_RPRChoice() *CT_RPRChoice { + ret := &CT_RPRChoice{} + return ret +} + +func (m *CT_RPRChoice) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.Nor != nil { + senor := xml.StartElement{Name: xml.Name{Local: "m:nor"}} + e.EncodeElement(m.Nor, senor) + } + return nil +} + +func (m *CT_RPRChoice) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_RPRChoice: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "nor"}: + m.Nor = NewCT_OnOff() + if err := d.DecodeElement(m.Nor, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_RPRChoice %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_RPRChoice + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_RPRChoice and its children +func (m *CT_RPRChoice) Validate() error { + return m.ValidateWithPath("CT_RPRChoice") +} + +// ValidateWithPath validates the CT_RPRChoice and its children, prefixing error messages with path +func (m *CT_RPRChoice) ValidateWithPath(path string) error { + if m.Nor != nil { + if err := m.Nor.ValidateWithPath(path + "/Nor"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Rad.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Rad.go new file mode 100644 index 00000000..ba62ba78 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Rad.go @@ -0,0 +1,104 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_Rad struct { + RadPr *CT_RadPr + Deg *CT_OMathArg + E *CT_OMathArg +} + +func NewCT_Rad() *CT_Rad { + ret := &CT_Rad{} + ret.Deg = NewCT_OMathArg() + ret.E = NewCT_OMathArg() + return ret +} + +func (m *CT_Rad) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.RadPr != nil { + seradPr := xml.StartElement{Name: xml.Name{Local: "m:radPr"}} + e.EncodeElement(m.RadPr, seradPr) + } + sedeg := xml.StartElement{Name: xml.Name{Local: "m:deg"}} + e.EncodeElement(m.Deg, sedeg) + see := xml.StartElement{Name: xml.Name{Local: "m:e"}} + e.EncodeElement(m.E, see) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Rad) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.Deg = NewCT_OMathArg() + m.E = NewCT_OMathArg() +lCT_Rad: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "radPr"}: + m.RadPr = NewCT_RadPr() + if err := d.DecodeElement(m.RadPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "deg"}: + if err := d.DecodeElement(m.Deg, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "e"}: + if err := d.DecodeElement(m.E, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_Rad %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Rad + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Rad and its children +func (m *CT_Rad) Validate() error { + return m.ValidateWithPath("CT_Rad") +} + +// ValidateWithPath validates the CT_Rad and its children, prefixing error messages with path +func (m *CT_Rad) ValidateWithPath(path string) error { + if m.RadPr != nil { + if err := m.RadPr.ValidateWithPath(path + "/RadPr"); err != nil { + return err + } + } + if err := m.Deg.ValidateWithPath(path + "/Deg"); err != nil { + return err + } + if err := m.E.ValidateWithPath(path + "/E"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_RadPr.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_RadPr.go new file mode 100644 index 00000000..eb80e27c --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_RadPr.go @@ -0,0 +1,95 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_RadPr struct { + DegHide *CT_OnOff + CtrlPr *CT_CtrlPr +} + +func NewCT_RadPr() *CT_RadPr { + ret := &CT_RadPr{} + return ret +} + +func (m *CT_RadPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.DegHide != nil { + sedegHide := xml.StartElement{Name: xml.Name{Local: "m:degHide"}} + e.EncodeElement(m.DegHide, sedegHide) + } + if m.CtrlPr != nil { + sectrlPr := xml.StartElement{Name: xml.Name{Local: "m:ctrlPr"}} + e.EncodeElement(m.CtrlPr, sectrlPr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_RadPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_RadPr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "degHide"}: + m.DegHide = NewCT_OnOff() + if err := d.DecodeElement(m.DegHide, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "ctrlPr"}: + m.CtrlPr = NewCT_CtrlPr() + if err := d.DecodeElement(m.CtrlPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_RadPr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_RadPr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_RadPr and its children +func (m *CT_RadPr) Validate() error { + return m.ValidateWithPath("CT_RadPr") +} + +// ValidateWithPath validates the CT_RadPr and its children, prefixing error messages with path +func (m *CT_RadPr) ValidateWithPath(path string) error { + if m.DegHide != nil { + if err := m.DegHide.ValidateWithPath(path + "/DegHide"); err != nil { + return err + } + } + if m.CtrlPr != nil { + if err := m.CtrlPr.ValidateWithPath(path + "/CtrlPr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_SPre.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_SPre.go new file mode 100644 index 00000000..32526dc9 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_SPre.go @@ -0,0 +1,116 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_SPre struct { + SPrePr *CT_SPrePr + Sub *CT_OMathArg + Sup *CT_OMathArg + E *CT_OMathArg +} + +func NewCT_SPre() *CT_SPre { + ret := &CT_SPre{} + ret.Sub = NewCT_OMathArg() + ret.Sup = NewCT_OMathArg() + ret.E = NewCT_OMathArg() + return ret +} + +func (m *CT_SPre) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.SPrePr != nil { + sesPrePr := xml.StartElement{Name: xml.Name{Local: "m:sPrePr"}} + e.EncodeElement(m.SPrePr, sesPrePr) + } + sesub := xml.StartElement{Name: xml.Name{Local: "m:sub"}} + e.EncodeElement(m.Sub, sesub) + sesup := xml.StartElement{Name: xml.Name{Local: "m:sup"}} + e.EncodeElement(m.Sup, sesup) + see := xml.StartElement{Name: xml.Name{Local: "m:e"}} + e.EncodeElement(m.E, see) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SPre) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.Sub = NewCT_OMathArg() + m.Sup = NewCT_OMathArg() + m.E = NewCT_OMathArg() +lCT_SPre: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "sPrePr"}: + m.SPrePr = NewCT_SPrePr() + if err := d.DecodeElement(m.SPrePr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "sub"}: + if err := d.DecodeElement(m.Sub, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "sup"}: + if err := d.DecodeElement(m.Sup, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "e"}: + if err := d.DecodeElement(m.E, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_SPre %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_SPre + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_SPre and its children +func (m *CT_SPre) Validate() error { + return m.ValidateWithPath("CT_SPre") +} + +// ValidateWithPath validates the CT_SPre and its children, prefixing error messages with path +func (m *CT_SPre) ValidateWithPath(path string) error { + if m.SPrePr != nil { + if err := m.SPrePr.ValidateWithPath(path + "/SPrePr"); err != nil { + return err + } + } + if err := m.Sub.ValidateWithPath(path + "/Sub"); err != nil { + return err + } + if err := m.Sup.ValidateWithPath(path + "/Sup"); err != nil { + return err + } + if err := m.E.ValidateWithPath(path + "/E"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_SPrePr.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_SPrePr.go new file mode 100644 index 00000000..a11f56d7 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_SPrePr.go @@ -0,0 +1,80 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_SPrePr struct { + CtrlPr *CT_CtrlPr +} + +func NewCT_SPrePr() *CT_SPrePr { + ret := &CT_SPrePr{} + return ret +} + +func (m *CT_SPrePr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.CtrlPr != nil { + sectrlPr := xml.StartElement{Name: xml.Name{Local: "m:ctrlPr"}} + e.EncodeElement(m.CtrlPr, sectrlPr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SPrePr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_SPrePr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "ctrlPr"}: + m.CtrlPr = NewCT_CtrlPr() + if err := d.DecodeElement(m.CtrlPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_SPrePr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_SPrePr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_SPrePr and its children +func (m *CT_SPrePr) Validate() error { + return m.ValidateWithPath("CT_SPrePr") +} + +// ValidateWithPath validates the CT_SPrePr and its children, prefixing error messages with path +func (m *CT_SPrePr) ValidateWithPath(path string) error { + if m.CtrlPr != nil { + if err := m.CtrlPr.ValidateWithPath(path + "/CtrlPr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_SSub.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_SSub.go new file mode 100644 index 00000000..ede17e32 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_SSub.go @@ -0,0 +1,104 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_SSub struct { + SSubPr *CT_SSubPr + E *CT_OMathArg + Sub *CT_OMathArg +} + +func NewCT_SSub() *CT_SSub { + ret := &CT_SSub{} + ret.E = NewCT_OMathArg() + ret.Sub = NewCT_OMathArg() + return ret +} + +func (m *CT_SSub) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.SSubPr != nil { + sesSubPr := xml.StartElement{Name: xml.Name{Local: "m:sSubPr"}} + e.EncodeElement(m.SSubPr, sesSubPr) + } + see := xml.StartElement{Name: xml.Name{Local: "m:e"}} + e.EncodeElement(m.E, see) + sesub := xml.StartElement{Name: xml.Name{Local: "m:sub"}} + e.EncodeElement(m.Sub, sesub) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SSub) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.E = NewCT_OMathArg() + m.Sub = NewCT_OMathArg() +lCT_SSub: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "sSubPr"}: + m.SSubPr = NewCT_SSubPr() + if err := d.DecodeElement(m.SSubPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "e"}: + if err := d.DecodeElement(m.E, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "sub"}: + if err := d.DecodeElement(m.Sub, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_SSub %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_SSub + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_SSub and its children +func (m *CT_SSub) Validate() error { + return m.ValidateWithPath("CT_SSub") +} + +// ValidateWithPath validates the CT_SSub and its children, prefixing error messages with path +func (m *CT_SSub) ValidateWithPath(path string) error { + if m.SSubPr != nil { + if err := m.SSubPr.ValidateWithPath(path + "/SSubPr"); err != nil { + return err + } + } + if err := m.E.ValidateWithPath(path + "/E"); err != nil { + return err + } + if err := m.Sub.ValidateWithPath(path + "/Sub"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_SSubPr.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_SSubPr.go new file mode 100644 index 00000000..d495f51e --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_SSubPr.go @@ -0,0 +1,80 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_SSubPr struct { + CtrlPr *CT_CtrlPr +} + +func NewCT_SSubPr() *CT_SSubPr { + ret := &CT_SSubPr{} + return ret +} + +func (m *CT_SSubPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.CtrlPr != nil { + sectrlPr := xml.StartElement{Name: xml.Name{Local: "m:ctrlPr"}} + e.EncodeElement(m.CtrlPr, sectrlPr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SSubPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_SSubPr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "ctrlPr"}: + m.CtrlPr = NewCT_CtrlPr() + if err := d.DecodeElement(m.CtrlPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_SSubPr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_SSubPr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_SSubPr and its children +func (m *CT_SSubPr) Validate() error { + return m.ValidateWithPath("CT_SSubPr") +} + +// ValidateWithPath validates the CT_SSubPr and its children, prefixing error messages with path +func (m *CT_SSubPr) ValidateWithPath(path string) error { + if m.CtrlPr != nil { + if err := m.CtrlPr.ValidateWithPath(path + "/CtrlPr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_SSubSup.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_SSubSup.go new file mode 100644 index 00000000..31b88d9a --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_SSubSup.go @@ -0,0 +1,116 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_SSubSup struct { + SSubSupPr *CT_SSubSupPr + E *CT_OMathArg + Sub *CT_OMathArg + Sup *CT_OMathArg +} + +func NewCT_SSubSup() *CT_SSubSup { + ret := &CT_SSubSup{} + ret.E = NewCT_OMathArg() + ret.Sub = NewCT_OMathArg() + ret.Sup = NewCT_OMathArg() + return ret +} + +func (m *CT_SSubSup) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.SSubSupPr != nil { + sesSubSupPr := xml.StartElement{Name: xml.Name{Local: "m:sSubSupPr"}} + e.EncodeElement(m.SSubSupPr, sesSubSupPr) + } + see := xml.StartElement{Name: xml.Name{Local: "m:e"}} + e.EncodeElement(m.E, see) + sesub := xml.StartElement{Name: xml.Name{Local: "m:sub"}} + e.EncodeElement(m.Sub, sesub) + sesup := xml.StartElement{Name: xml.Name{Local: "m:sup"}} + e.EncodeElement(m.Sup, sesup) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SSubSup) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.E = NewCT_OMathArg() + m.Sub = NewCT_OMathArg() + m.Sup = NewCT_OMathArg() +lCT_SSubSup: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "sSubSupPr"}: + m.SSubSupPr = NewCT_SSubSupPr() + if err := d.DecodeElement(m.SSubSupPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "e"}: + if err := d.DecodeElement(m.E, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "sub"}: + if err := d.DecodeElement(m.Sub, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "sup"}: + if err := d.DecodeElement(m.Sup, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_SSubSup %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_SSubSup + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_SSubSup and its children +func (m *CT_SSubSup) Validate() error { + return m.ValidateWithPath("CT_SSubSup") +} + +// ValidateWithPath validates the CT_SSubSup and its children, prefixing error messages with path +func (m *CT_SSubSup) ValidateWithPath(path string) error { + if m.SSubSupPr != nil { + if err := m.SSubSupPr.ValidateWithPath(path + "/SSubSupPr"); err != nil { + return err + } + } + if err := m.E.ValidateWithPath(path + "/E"); err != nil { + return err + } + if err := m.Sub.ValidateWithPath(path + "/Sub"); err != nil { + return err + } + if err := m.Sup.ValidateWithPath(path + "/Sup"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_SSubSupPr.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_SSubSupPr.go new file mode 100644 index 00000000..9fc56ad0 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_SSubSupPr.go @@ -0,0 +1,95 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_SSubSupPr struct { + AlnScr *CT_OnOff + CtrlPr *CT_CtrlPr +} + +func NewCT_SSubSupPr() *CT_SSubSupPr { + ret := &CT_SSubSupPr{} + return ret +} + +func (m *CT_SSubSupPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.AlnScr != nil { + sealnScr := xml.StartElement{Name: xml.Name{Local: "m:alnScr"}} + e.EncodeElement(m.AlnScr, sealnScr) + } + if m.CtrlPr != nil { + sectrlPr := xml.StartElement{Name: xml.Name{Local: "m:ctrlPr"}} + e.EncodeElement(m.CtrlPr, sectrlPr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SSubSupPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_SSubSupPr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "alnScr"}: + m.AlnScr = NewCT_OnOff() + if err := d.DecodeElement(m.AlnScr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "ctrlPr"}: + m.CtrlPr = NewCT_CtrlPr() + if err := d.DecodeElement(m.CtrlPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_SSubSupPr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_SSubSupPr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_SSubSupPr and its children +func (m *CT_SSubSupPr) Validate() error { + return m.ValidateWithPath("CT_SSubSupPr") +} + +// ValidateWithPath validates the CT_SSubSupPr and its children, prefixing error messages with path +func (m *CT_SSubSupPr) ValidateWithPath(path string) error { + if m.AlnScr != nil { + if err := m.AlnScr.ValidateWithPath(path + "/AlnScr"); err != nil { + return err + } + } + if m.CtrlPr != nil { + if err := m.CtrlPr.ValidateWithPath(path + "/CtrlPr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_SSup.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_SSup.go new file mode 100644 index 00000000..67ce86f0 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_SSup.go @@ -0,0 +1,104 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_SSup struct { + SSupPr *CT_SSupPr + E *CT_OMathArg + Sup *CT_OMathArg +} + +func NewCT_SSup() *CT_SSup { + ret := &CT_SSup{} + ret.E = NewCT_OMathArg() + ret.Sup = NewCT_OMathArg() + return ret +} + +func (m *CT_SSup) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.SSupPr != nil { + sesSupPr := xml.StartElement{Name: xml.Name{Local: "m:sSupPr"}} + e.EncodeElement(m.SSupPr, sesSupPr) + } + see := xml.StartElement{Name: xml.Name{Local: "m:e"}} + e.EncodeElement(m.E, see) + sesup := xml.StartElement{Name: xml.Name{Local: "m:sup"}} + e.EncodeElement(m.Sup, sesup) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SSup) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.E = NewCT_OMathArg() + m.Sup = NewCT_OMathArg() +lCT_SSup: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "sSupPr"}: + m.SSupPr = NewCT_SSupPr() + if err := d.DecodeElement(m.SSupPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "e"}: + if err := d.DecodeElement(m.E, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "sup"}: + if err := d.DecodeElement(m.Sup, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_SSup %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_SSup + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_SSup and its children +func (m *CT_SSup) Validate() error { + return m.ValidateWithPath("CT_SSup") +} + +// ValidateWithPath validates the CT_SSup and its children, prefixing error messages with path +func (m *CT_SSup) ValidateWithPath(path string) error { + if m.SSupPr != nil { + if err := m.SSupPr.ValidateWithPath(path + "/SSupPr"); err != nil { + return err + } + } + if err := m.E.ValidateWithPath(path + "/E"); err != nil { + return err + } + if err := m.Sup.ValidateWithPath(path + "/Sup"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_SSupPr.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_SSupPr.go new file mode 100644 index 00000000..f536a99e --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_SSupPr.go @@ -0,0 +1,80 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_SSupPr struct { + CtrlPr *CT_CtrlPr +} + +func NewCT_SSupPr() *CT_SSupPr { + ret := &CT_SSupPr{} + return ret +} + +func (m *CT_SSupPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.CtrlPr != nil { + sectrlPr := xml.StartElement{Name: xml.Name{Local: "m:ctrlPr"}} + e.EncodeElement(m.CtrlPr, sectrlPr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SSupPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_SSupPr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "ctrlPr"}: + m.CtrlPr = NewCT_CtrlPr() + if err := d.DecodeElement(m.CtrlPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_SSupPr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_SSupPr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_SSupPr and its children +func (m *CT_SSupPr) Validate() error { + return m.ValidateWithPath("CT_SSupPr") +} + +// ValidateWithPath validates the CT_SSupPr and its children, prefixing error messages with path +func (m *CT_SSupPr) ValidateWithPath(path string) error { + if m.CtrlPr != nil { + if err := m.CtrlPr.ValidateWithPath(path + "/CtrlPr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Script.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Script.go new file mode 100644 index 00000000..96e457ef --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Script.go @@ -0,0 +1,71 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + "fmt" +) + +type CT_Script struct { + ValAttr ST_Script +} + +func NewCT_Script() *CT_Script { + ret := &CT_Script{} + return ret +} + +func (m *CT_Script) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.ValAttr != ST_ScriptUnset { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "m:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Script) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Script: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Script and its children +func (m *CT_Script) Validate() error { + return m.ValidateWithPath("CT_Script") +} + +// ValidateWithPath validates the CT_Script and its children, prefixing error messages with path +func (m *CT_Script) ValidateWithPath(path string) error { + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Shp.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Shp.go new file mode 100644 index 00000000..6ffd7fe2 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Shp.go @@ -0,0 +1,74 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + "fmt" +) + +type CT_Shp struct { + ValAttr ST_Shp +} + +func NewCT_Shp() *CT_Shp { + ret := &CT_Shp{} + ret.ValAttr = ST_Shp(1) + return ret +} + +func (m *CT_Shp) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "m:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Shp) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_Shp(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Shp: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Shp and its children +func (m *CT_Shp) Validate() error { + return m.ValidateWithPath("CT_Shp") +} + +// ValidateWithPath validates the CT_Shp and its children, prefixing error messages with path +func (m *CT_Shp) ValidateWithPath(path string) error { + if m.ValAttr == ST_ShpUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_SpacingRule.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_SpacingRule.go new file mode 100644 index 00000000..8928be03 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_SpacingRule.go @@ -0,0 +1,76 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + "fmt" + "strconv" +) + +type CT_SpacingRule struct { + ValAttr int64 +} + +func NewCT_SpacingRule() *CT_SpacingRule { + ret := &CT_SpacingRule{} + ret.ValAttr = 0 + return ret +} + +func (m *CT_SpacingRule) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "m:val"}, + Value: fmt.Sprintf("%v", m.ValAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SpacingRule) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = 0 + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.ValAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_SpacingRule: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_SpacingRule and its children +func (m *CT_SpacingRule) Validate() error { + return m.ValidateWithPath("CT_SpacingRule") +} + +// ValidateWithPath validates the CT_SpacingRule and its children, prefixing error messages with path +func (m *CT_SpacingRule) ValidateWithPath(path string) error { + if m.ValAttr < 0 { + return fmt.Errorf("%s/m.ValAttr must be >= 0 (have %v)", path, m.ValAttr) + } + if m.ValAttr > 4 { + return fmt.Errorf("%s/m.ValAttr must be <= 4 (have %v)", path, m.ValAttr) + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_String.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_String.go new file mode 100644 index 00000000..81c99bc9 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_String.go @@ -0,0 +1,69 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + "fmt" +) + +type CT_String struct { + ValAttr *string +} + +func NewCT_String() *CT_String { + ret := &CT_String{} + return ret +} + +func (m *CT_String) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.ValAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "m:val"}, + Value: fmt.Sprintf("%v", *m.ValAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_String) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ValAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_String: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_String and its children +func (m *CT_String) Validate() error { + return m.ValidateWithPath("CT_String") +} + +// ValidateWithPath validates the CT_String and its children, prefixing error messages with path +func (m *CT_String) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Style.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Style.go new file mode 100644 index 00000000..cc7f52b9 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Style.go @@ -0,0 +1,71 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + "fmt" +) + +type CT_Style struct { + ValAttr ST_Style +} + +func NewCT_Style() *CT_Style { + ret := &CT_Style{} + return ret +} + +func (m *CT_Style) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.ValAttr != ST_StyleUnset { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "m:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Style) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Style: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Style and its children +func (m *CT_Style) Validate() error { + return m.ValidateWithPath("CT_Style") +} + +// ValidateWithPath validates the CT_Style and its children, prefixing error messages with path +func (m *CT_Style) ValidateWithPath(path string) error { + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Text.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Text.go new file mode 100644 index 00000000..425128cc --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_Text.go @@ -0,0 +1,73 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + "fmt" +) + +type CT_Text struct { + SpaceAttr *string + Content string +} + +func NewCT_Text() *CT_Text { + ret := &CT_Text{} + return ret +} + +func (m *CT_Text) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.SpaceAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xml:space"}, + Value: fmt.Sprintf("%v", *m.SpaceAttr)}) + } + e.EncodeElement(m.Content, start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Text) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Space == "http://www.w3.org/XML/1998/namespace" && attr.Name.Local == "space" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.SpaceAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Text: %s", err) + } + if cd, ok := tok.(xml.CharData); ok { + m.Content = string(cd) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Text and its children +func (m *CT_Text) Validate() error { + return m.ValidateWithPath("CT_Text") +} + +// ValidateWithPath validates the CT_Text and its children, prefixing error messages with path +func (m *CT_Text) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_TopBot.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_TopBot.go new file mode 100644 index 00000000..96165259 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_TopBot.go @@ -0,0 +1,74 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + "fmt" +) + +type CT_TopBot struct { + ValAttr ST_TopBot +} + +func NewCT_TopBot() *CT_TopBot { + ret := &CT_TopBot{} + ret.ValAttr = ST_TopBot(1) + return ret +} + +func (m *CT_TopBot) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "m:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TopBot) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_TopBot(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_TopBot: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_TopBot and its children +func (m *CT_TopBot) Validate() error { + return m.ValidateWithPath("CT_TopBot") +} + +// ValidateWithPath validates the CT_TopBot and its children, prefixing error messages with path +func (m *CT_TopBot) ValidateWithPath(path string) error { + if m.ValAttr == ST_TopBotUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_TwipsMeasure.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_TwipsMeasure.go new file mode 100644 index 00000000..ebea1d16 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_TwipsMeasure.go @@ -0,0 +1,72 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_TwipsMeasure struct { + ValAttr sharedTypes.ST_TwipsMeasure +} + +func NewCT_TwipsMeasure() *CT_TwipsMeasure { + ret := &CT_TwipsMeasure{} + return ret +} + +func (m *CT_TwipsMeasure) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "m:val"}, + Value: fmt.Sprintf("%v", m.ValAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TwipsMeasure) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := ParseUnionST_TwipsMeasure(attr.Value) + if err != nil { + return err + } + m.ValAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_TwipsMeasure: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_TwipsMeasure and its children +func (m *CT_TwipsMeasure) Validate() error { + return m.ValidateWithPath("CT_TwipsMeasure") +} + +// ValidateWithPath validates the CT_TwipsMeasure and its children, prefixing error messages with path +func (m *CT_TwipsMeasure) ValidateWithPath(path string) error { + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_UnSignedInteger.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_UnSignedInteger.go new file mode 100644 index 00000000..81df2225 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_UnSignedInteger.go @@ -0,0 +1,68 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + "fmt" + "strconv" +) + +type CT_UnSignedInteger struct { + ValAttr uint32 +} + +func NewCT_UnSignedInteger() *CT_UnSignedInteger { + ret := &CT_UnSignedInteger{} + return ret +} + +func (m *CT_UnSignedInteger) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "m:val"}, + Value: fmt.Sprintf("%v", m.ValAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_UnSignedInteger) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := strconv.ParseUint(attr.Value, 10, 32) + if err != nil { + return err + } + m.ValAttr = uint32(parsed) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_UnSignedInteger: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_UnSignedInteger and its children +func (m *CT_UnSignedInteger) Validate() error { + return m.ValidateWithPath("CT_UnSignedInteger") +} + +// ValidateWithPath validates the CT_UnSignedInteger and its children, prefixing error messages with path +func (m *CT_UnSignedInteger) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_XAlign.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_XAlign.go new file mode 100644 index 00000000..c0084419 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_XAlign.go @@ -0,0 +1,76 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_XAlign struct { + ValAttr sharedTypes.ST_XAlign +} + +func NewCT_XAlign() *CT_XAlign { + ret := &CT_XAlign{} + ret.ValAttr = sharedTypes.ST_XAlign(1) + return ret +} + +func (m *CT_XAlign) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "m:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_XAlign) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = sharedTypes.ST_XAlign(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_XAlign: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_XAlign and its children +func (m *CT_XAlign) Validate() error { + return m.ValidateWithPath("CT_XAlign") +} + +// ValidateWithPath validates the CT_XAlign and its children, prefixing error messages with path +func (m *CT_XAlign) ValidateWithPath(path string) error { + if m.ValAttr == sharedTypes.ST_XAlignUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_YAlign.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_YAlign.go new file mode 100644 index 00000000..4d3a8136 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/CT_YAlign.go @@ -0,0 +1,76 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_YAlign struct { + ValAttr sharedTypes.ST_YAlign +} + +func NewCT_YAlign() *CT_YAlign { + ret := &CT_YAlign{} + ret.ValAttr = sharedTypes.ST_YAlign(1) + return ret +} + +func (m *CT_YAlign) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "m:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_YAlign) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = sharedTypes.ST_YAlign(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_YAlign: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_YAlign and its children +func (m *CT_YAlign) Validate() error { + return m.ValidateWithPath("CT_YAlign") +} + +// ValidateWithPath validates the CT_YAlign and its children, prefixing error messages with path +func (m *CT_YAlign) ValidateWithPath(path string) error { + if m.ValAttr == sharedTypes.ST_YAlignUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/EG_OMathElements.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/EG_OMathElements.go new file mode 100644 index 00000000..72a25e67 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/EG_OMathElements.go @@ -0,0 +1,215 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type EG_OMathElements struct { + EG_OMathMathElements []*EG_OMathMathElements +} + +func NewEG_OMathElements() *EG_OMathElements { + ret := &EG_OMathElements{} + return ret +} + +func (m *EG_OMathElements) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.EG_OMathMathElements != nil { + for _, c := range m.EG_OMathMathElements { + c.MarshalXML(e, xml.StartElement{}) + } + } + return nil +} + +func (m *EG_OMathElements) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_OMathElements: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "acc"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.Acc = NewCT_Acc() + if err := d.DecodeElement(tmpomathmathelements.Acc, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "bar"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.Bar = NewCT_Bar() + if err := d.DecodeElement(tmpomathmathelements.Bar, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "box"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.Box = NewCT_Box() + if err := d.DecodeElement(tmpomathmathelements.Box, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "borderBox"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.BorderBox = NewCT_BorderBox() + if err := d.DecodeElement(tmpomathmathelements.BorderBox, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "d"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.D = NewCT_D() + if err := d.DecodeElement(tmpomathmathelements.D, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "eqArr"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.EqArr = NewCT_EqArr() + if err := d.DecodeElement(tmpomathmathelements.EqArr, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "f"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.F = NewCT_F() + if err := d.DecodeElement(tmpomathmathelements.F, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "func"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.Func = NewCT_Func() + if err := d.DecodeElement(tmpomathmathelements.Func, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "groupChr"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.GroupChr = NewCT_GroupChr() + if err := d.DecodeElement(tmpomathmathelements.GroupChr, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "limLow"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.LimLow = NewCT_LimLow() + if err := d.DecodeElement(tmpomathmathelements.LimLow, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "limUpp"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.LimUpp = NewCT_LimUpp() + if err := d.DecodeElement(tmpomathmathelements.LimUpp, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "m"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.M = NewCT_M() + if err := d.DecodeElement(tmpomathmathelements.M, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "nary"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.Nary = NewCT_Nary() + if err := d.DecodeElement(tmpomathmathelements.Nary, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "phant"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.Phant = NewCT_Phant() + if err := d.DecodeElement(tmpomathmathelements.Phant, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "rad"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.Rad = NewCT_Rad() + if err := d.DecodeElement(tmpomathmathelements.Rad, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "sPre"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.SPre = NewCT_SPre() + if err := d.DecodeElement(tmpomathmathelements.SPre, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "sSub"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.SSub = NewCT_SSub() + if err := d.DecodeElement(tmpomathmathelements.SSub, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "sSubSup"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.SSubSup = NewCT_SSubSup() + if err := d.DecodeElement(tmpomathmathelements.SSubSup, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "sSup"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.SSup = NewCT_SSup() + if err := d.DecodeElement(tmpomathmathelements.SSup, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "r"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.R = NewCT_R() + if err := d.DecodeElement(tmpomathmathelements.R, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + default: + gooxml.Log("skipping unsupported element on EG_OMathElements %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_OMathElements + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_OMathElements and its children +func (m *EG_OMathElements) Validate() error { + return m.ValidateWithPath("EG_OMathElements") +} + +// ValidateWithPath validates the EG_OMathElements and its children, prefixing error messages with path +func (m *EG_OMathElements) ValidateWithPath(path string) error { + for i, v := range m.EG_OMathMathElements { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_OMathMathElements[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/EG_OMathMathElements.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/EG_OMathMathElements.go new file mode 100644 index 00000000..37bd59d5 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/EG_OMathMathElements.go @@ -0,0 +1,363 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type EG_OMathMathElements struct { + Acc *CT_Acc + Bar *CT_Bar + Box *CT_Box + BorderBox *CT_BorderBox + D *CT_D + EqArr *CT_EqArr + F *CT_F + Func *CT_Func + GroupChr *CT_GroupChr + LimLow *CT_LimLow + LimUpp *CT_LimUpp + M *CT_M + Nary *CT_Nary + Phant *CT_Phant + Rad *CT_Rad + SPre *CT_SPre + SSub *CT_SSub + SSubSup *CT_SSubSup + SSup *CT_SSup + R *CT_R +} + +func NewEG_OMathMathElements() *EG_OMathMathElements { + ret := &EG_OMathMathElements{} + return ret +} + +func (m *EG_OMathMathElements) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.Acc != nil { + seacc := xml.StartElement{Name: xml.Name{Local: "m:acc"}} + e.EncodeElement(m.Acc, seacc) + } + if m.Bar != nil { + sebar := xml.StartElement{Name: xml.Name{Local: "m:bar"}} + e.EncodeElement(m.Bar, sebar) + } + if m.Box != nil { + sebox := xml.StartElement{Name: xml.Name{Local: "m:box"}} + e.EncodeElement(m.Box, sebox) + } + if m.BorderBox != nil { + seborderBox := xml.StartElement{Name: xml.Name{Local: "m:borderBox"}} + e.EncodeElement(m.BorderBox, seborderBox) + } + if m.D != nil { + sed := xml.StartElement{Name: xml.Name{Local: "m:d"}} + e.EncodeElement(m.D, sed) + } + if m.EqArr != nil { + seeqArr := xml.StartElement{Name: xml.Name{Local: "m:eqArr"}} + e.EncodeElement(m.EqArr, seeqArr) + } + if m.F != nil { + sef := xml.StartElement{Name: xml.Name{Local: "m:f"}} + e.EncodeElement(m.F, sef) + } + if m.Func != nil { + sefunc := xml.StartElement{Name: xml.Name{Local: "m:func"}} + e.EncodeElement(m.Func, sefunc) + } + if m.GroupChr != nil { + segroupChr := xml.StartElement{Name: xml.Name{Local: "m:groupChr"}} + e.EncodeElement(m.GroupChr, segroupChr) + } + if m.LimLow != nil { + selimLow := xml.StartElement{Name: xml.Name{Local: "m:limLow"}} + e.EncodeElement(m.LimLow, selimLow) + } + if m.LimUpp != nil { + selimUpp := xml.StartElement{Name: xml.Name{Local: "m:limUpp"}} + e.EncodeElement(m.LimUpp, selimUpp) + } + if m.M != nil { + sem := xml.StartElement{Name: xml.Name{Local: "m:m"}} + e.EncodeElement(m.M, sem) + } + if m.Nary != nil { + senary := xml.StartElement{Name: xml.Name{Local: "m:nary"}} + e.EncodeElement(m.Nary, senary) + } + if m.Phant != nil { + sephant := xml.StartElement{Name: xml.Name{Local: "m:phant"}} + e.EncodeElement(m.Phant, sephant) + } + if m.Rad != nil { + serad := xml.StartElement{Name: xml.Name{Local: "m:rad"}} + e.EncodeElement(m.Rad, serad) + } + if m.SPre != nil { + sesPre := xml.StartElement{Name: xml.Name{Local: "m:sPre"}} + e.EncodeElement(m.SPre, sesPre) + } + if m.SSub != nil { + sesSub := xml.StartElement{Name: xml.Name{Local: "m:sSub"}} + e.EncodeElement(m.SSub, sesSub) + } + if m.SSubSup != nil { + sesSubSup := xml.StartElement{Name: xml.Name{Local: "m:sSubSup"}} + e.EncodeElement(m.SSubSup, sesSubSup) + } + if m.SSup != nil { + sesSup := xml.StartElement{Name: xml.Name{Local: "m:sSup"}} + e.EncodeElement(m.SSup, sesSup) + } + if m.R != nil { + ser := xml.StartElement{Name: xml.Name{Local: "m:r"}} + e.EncodeElement(m.R, ser) + } + return nil +} + +func (m *EG_OMathMathElements) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_OMathMathElements: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "acc"}: + m.Acc = NewCT_Acc() + if err := d.DecodeElement(m.Acc, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "bar"}: + m.Bar = NewCT_Bar() + if err := d.DecodeElement(m.Bar, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "box"}: + m.Box = NewCT_Box() + if err := d.DecodeElement(m.Box, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "borderBox"}: + m.BorderBox = NewCT_BorderBox() + if err := d.DecodeElement(m.BorderBox, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "d"}: + m.D = NewCT_D() + if err := d.DecodeElement(m.D, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "eqArr"}: + m.EqArr = NewCT_EqArr() + if err := d.DecodeElement(m.EqArr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "f"}: + m.F = NewCT_F() + if err := d.DecodeElement(m.F, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "func"}: + m.Func = NewCT_Func() + if err := d.DecodeElement(m.Func, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "groupChr"}: + m.GroupChr = NewCT_GroupChr() + if err := d.DecodeElement(m.GroupChr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "limLow"}: + m.LimLow = NewCT_LimLow() + if err := d.DecodeElement(m.LimLow, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "limUpp"}: + m.LimUpp = NewCT_LimUpp() + if err := d.DecodeElement(m.LimUpp, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "m"}: + m.M = NewCT_M() + if err := d.DecodeElement(m.M, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "nary"}: + m.Nary = NewCT_Nary() + if err := d.DecodeElement(m.Nary, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "phant"}: + m.Phant = NewCT_Phant() + if err := d.DecodeElement(m.Phant, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "rad"}: + m.Rad = NewCT_Rad() + if err := d.DecodeElement(m.Rad, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "sPre"}: + m.SPre = NewCT_SPre() + if err := d.DecodeElement(m.SPre, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "sSub"}: + m.SSub = NewCT_SSub() + if err := d.DecodeElement(m.SSub, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "sSubSup"}: + m.SSubSup = NewCT_SSubSup() + if err := d.DecodeElement(m.SSubSup, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "sSup"}: + m.SSup = NewCT_SSup() + if err := d.DecodeElement(m.SSup, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "r"}: + m.R = NewCT_R() + if err := d.DecodeElement(m.R, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on EG_OMathMathElements %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_OMathMathElements + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_OMathMathElements and its children +func (m *EG_OMathMathElements) Validate() error { + return m.ValidateWithPath("EG_OMathMathElements") +} + +// ValidateWithPath validates the EG_OMathMathElements and its children, prefixing error messages with path +func (m *EG_OMathMathElements) ValidateWithPath(path string) error { + if m.Acc != nil { + if err := m.Acc.ValidateWithPath(path + "/Acc"); err != nil { + return err + } + } + if m.Bar != nil { + if err := m.Bar.ValidateWithPath(path + "/Bar"); err != nil { + return err + } + } + if m.Box != nil { + if err := m.Box.ValidateWithPath(path + "/Box"); err != nil { + return err + } + } + if m.BorderBox != nil { + if err := m.BorderBox.ValidateWithPath(path + "/BorderBox"); err != nil { + return err + } + } + if m.D != nil { + if err := m.D.ValidateWithPath(path + "/D"); err != nil { + return err + } + } + if m.EqArr != nil { + if err := m.EqArr.ValidateWithPath(path + "/EqArr"); err != nil { + return err + } + } + if m.F != nil { + if err := m.F.ValidateWithPath(path + "/F"); err != nil { + return err + } + } + if m.Func != nil { + if err := m.Func.ValidateWithPath(path + "/Func"); err != nil { + return err + } + } + if m.GroupChr != nil { + if err := m.GroupChr.ValidateWithPath(path + "/GroupChr"); err != nil { + return err + } + } + if m.LimLow != nil { + if err := m.LimLow.ValidateWithPath(path + "/LimLow"); err != nil { + return err + } + } + if m.LimUpp != nil { + if err := m.LimUpp.ValidateWithPath(path + "/LimUpp"); err != nil { + return err + } + } + if m.M != nil { + if err := m.M.ValidateWithPath(path + "/M"); err != nil { + return err + } + } + if m.Nary != nil { + if err := m.Nary.ValidateWithPath(path + "/Nary"); err != nil { + return err + } + } + if m.Phant != nil { + if err := m.Phant.ValidateWithPath(path + "/Phant"); err != nil { + return err + } + } + if m.Rad != nil { + if err := m.Rad.ValidateWithPath(path + "/Rad"); err != nil { + return err + } + } + if m.SPre != nil { + if err := m.SPre.ValidateWithPath(path + "/SPre"); err != nil { + return err + } + } + if m.SSub != nil { + if err := m.SSub.ValidateWithPath(path + "/SSub"); err != nil { + return err + } + } + if m.SSubSup != nil { + if err := m.SSubSup.ValidateWithPath(path + "/SSubSup"); err != nil { + return err + } + } + if m.SSup != nil { + if err := m.SSup.ValidateWithPath(path + "/SSup"); err != nil { + return err + } + } + if m.R != nil { + if err := m.R.ValidateWithPath(path + "/R"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/EG_ScriptStyle.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/EG_ScriptStyle.go new file mode 100644 index 00000000..2b2c88a2 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/EG_ScriptStyle.go @@ -0,0 +1,94 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type EG_ScriptStyle struct { + Scr *CT_Script + Sty *CT_Style +} + +func NewEG_ScriptStyle() *EG_ScriptStyle { + ret := &EG_ScriptStyle{} + return ret +} + +func (m *EG_ScriptStyle) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Name.Local = "m:EG_ScriptStyle" + if m.Scr != nil { + sescr := xml.StartElement{Name: xml.Name{Local: "m:scr"}} + e.EncodeElement(m.Scr, sescr) + } + if m.Sty != nil { + sesty := xml.StartElement{Name: xml.Name{Local: "m:sty"}} + e.EncodeElement(m.Sty, sesty) + } + return nil +} + +func (m *EG_ScriptStyle) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_ScriptStyle: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "scr"}: + m.Scr = NewCT_Script() + if err := d.DecodeElement(m.Scr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "sty"}: + m.Sty = NewCT_Style() + if err := d.DecodeElement(m.Sty, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on EG_ScriptStyle %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_ScriptStyle + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_ScriptStyle and its children +func (m *EG_ScriptStyle) Validate() error { + return m.ValidateWithPath("EG_ScriptStyle") +} + +// ValidateWithPath validates the EG_ScriptStyle and its children, prefixing error messages with path +func (m *EG_ScriptStyle) ValidateWithPath(path string) error { + if m.Scr != nil { + if err := m.Scr.ValidateWithPath(path + "/Scr"); err != nil { + return err + } + } + if m.Sty != nil { + if err := m.Sty.ValidateWithPath(path + "/Sty"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/MathPr.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/MathPr.go new file mode 100644 index 00000000..88745721 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/MathPr.go @@ -0,0 +1,155 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type MathPr struct { + CT_MathPr +} + +func NewMathPr() *MathPr { + ret := &MathPr{} + ret.CT_MathPr = *NewCT_MathPr() + return ret +} + +func (m *MathPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/math"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:m"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/math"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:s"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/sharedTypes"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:w"}, Value: "http://schemas.openxmlformats.org/wordprocessingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:xml"}, Value: "http://www.w3.org/XML/1998/namespace"}) + start.Name.Local = "m:mathPr" + return m.CT_MathPr.MarshalXML(e, start) +} + +func (m *MathPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CT_MathPr = *NewCT_MathPr() +lMathPr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "mathFont"}: + m.MathFont = NewCT_String() + if err := d.DecodeElement(m.MathFont, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "brkBin"}: + m.BrkBin = NewCT_BreakBin() + if err := d.DecodeElement(m.BrkBin, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "brkBinSub"}: + m.BrkBinSub = NewCT_BreakBinSub() + if err := d.DecodeElement(m.BrkBinSub, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "smallFrac"}: + m.SmallFrac = NewCT_OnOff() + if err := d.DecodeElement(m.SmallFrac, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "dispDef"}: + m.DispDef = NewCT_OnOff() + if err := d.DecodeElement(m.DispDef, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "lMargin"}: + m.LMargin = NewCT_TwipsMeasure() + if err := d.DecodeElement(m.LMargin, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "rMargin"}: + m.RMargin = NewCT_TwipsMeasure() + if err := d.DecodeElement(m.RMargin, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "defJc"}: + m.DefJc = NewCT_OMathJc() + if err := d.DecodeElement(m.DefJc, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "preSp"}: + m.PreSp = NewCT_TwipsMeasure() + if err := d.DecodeElement(m.PreSp, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "postSp"}: + m.PostSp = NewCT_TwipsMeasure() + if err := d.DecodeElement(m.PostSp, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "interSp"}: + m.InterSp = NewCT_TwipsMeasure() + if err := d.DecodeElement(m.InterSp, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "intraSp"}: + m.IntraSp = NewCT_TwipsMeasure() + if err := d.DecodeElement(m.IntraSp, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "wrapIndent"}: + m.Choice = NewCT_MathPrChoice() + if err := d.DecodeElement(&m.Choice.WrapIndent, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "wrapRight"}: + m.Choice = NewCT_MathPrChoice() + if err := d.DecodeElement(&m.Choice.WrapRight, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "intLim"}: + m.IntLim = NewCT_LimLoc() + if err := d.DecodeElement(m.IntLim, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "naryLim"}: + m.NaryLim = NewCT_LimLoc() + if err := d.DecodeElement(m.NaryLim, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on MathPr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lMathPr + case xml.CharData: + } + } + return nil +} + +// Validate validates the MathPr and its children +func (m *MathPr) Validate() error { + return m.ValidateWithPath("MathPr") +} + +// ValidateWithPath validates the MathPr and its children, prefixing error messages with path +func (m *MathPr) ValidateWithPath(path string) error { + if err := m.CT_MathPr.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/OMath.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/OMath.go new file mode 100644 index 00000000..f094cd47 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/OMath.go @@ -0,0 +1,215 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type OMath struct { + CT_OMath +} + +func NewOMath() *OMath { + ret := &OMath{} + ret.CT_OMath = *NewCT_OMath() + return ret +} + +func (m *OMath) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/math"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:m"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/math"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:s"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/sharedTypes"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:w"}, Value: "http://schemas.openxmlformats.org/wordprocessingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:xml"}, Value: "http://www.w3.org/XML/1998/namespace"}) + start.Name.Local = "m:oMath" + return m.CT_OMath.MarshalXML(e, start) +} + +func (m *OMath) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CT_OMath = *NewCT_OMath() +lOMath: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "acc"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.Acc = NewCT_Acc() + if err := d.DecodeElement(tmpomathmathelements.Acc, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "bar"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.Bar = NewCT_Bar() + if err := d.DecodeElement(tmpomathmathelements.Bar, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "box"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.Box = NewCT_Box() + if err := d.DecodeElement(tmpomathmathelements.Box, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "borderBox"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.BorderBox = NewCT_BorderBox() + if err := d.DecodeElement(tmpomathmathelements.BorderBox, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "d"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.D = NewCT_D() + if err := d.DecodeElement(tmpomathmathelements.D, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "eqArr"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.EqArr = NewCT_EqArr() + if err := d.DecodeElement(tmpomathmathelements.EqArr, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "f"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.F = NewCT_F() + if err := d.DecodeElement(tmpomathmathelements.F, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "func"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.Func = NewCT_Func() + if err := d.DecodeElement(tmpomathmathelements.Func, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "groupChr"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.GroupChr = NewCT_GroupChr() + if err := d.DecodeElement(tmpomathmathelements.GroupChr, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "limLow"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.LimLow = NewCT_LimLow() + if err := d.DecodeElement(tmpomathmathelements.LimLow, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "limUpp"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.LimUpp = NewCT_LimUpp() + if err := d.DecodeElement(tmpomathmathelements.LimUpp, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "m"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.M = NewCT_M() + if err := d.DecodeElement(tmpomathmathelements.M, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "nary"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.Nary = NewCT_Nary() + if err := d.DecodeElement(tmpomathmathelements.Nary, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "phant"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.Phant = NewCT_Phant() + if err := d.DecodeElement(tmpomathmathelements.Phant, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "rad"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.Rad = NewCT_Rad() + if err := d.DecodeElement(tmpomathmathelements.Rad, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "sPre"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.SPre = NewCT_SPre() + if err := d.DecodeElement(tmpomathmathelements.SPre, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "sSub"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.SSub = NewCT_SSub() + if err := d.DecodeElement(tmpomathmathelements.SSub, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "sSubSup"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.SSubSup = NewCT_SSubSup() + if err := d.DecodeElement(tmpomathmathelements.SSubSup, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "sSup"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.SSup = NewCT_SSup() + if err := d.DecodeElement(tmpomathmathelements.SSup, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "r"}: + tmpomathmathelements := NewEG_OMathMathElements() + tmpomathmathelements.R = NewCT_R() + if err := d.DecodeElement(tmpomathmathelements.R, &el); err != nil { + return err + } + m.EG_OMathMathElements = append(m.EG_OMathMathElements, tmpomathmathelements) + default: + gooxml.Log("skipping unsupported element on OMath %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lOMath + case xml.CharData: + } + } + return nil +} + +// Validate validates the OMath and its children +func (m *OMath) Validate() error { + return m.ValidateWithPath("OMath") +} + +// ValidateWithPath validates the OMath and its children, prefixing error messages with path +func (m *OMath) ValidateWithPath(path string) error { + if err := m.CT_OMath.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/OMathPara.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/OMathPara.go new file mode 100644 index 00000000..aed1a1f4 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/OMathPara.go @@ -0,0 +1,86 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type OMathPara struct { + CT_OMathPara +} + +func NewOMathPara() *OMathPara { + ret := &OMathPara{} + ret.CT_OMathPara = *NewCT_OMathPara() + return ret +} + +func (m *OMathPara) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/math"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:m"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/math"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:s"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/sharedTypes"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:w"}, Value: "http://schemas.openxmlformats.org/wordprocessingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:xml"}, Value: "http://www.w3.org/XML/1998/namespace"}) + start.Name.Local = "m:oMathPara" + return m.CT_OMathPara.MarshalXML(e, start) +} + +func (m *OMathPara) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CT_OMathPara = *NewCT_OMathPara() +lOMathPara: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMathParaPr"}: + m.OMathParaPr = NewCT_OMathParaPr() + if err := d.DecodeElement(m.OMathParaPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMath"}: + tmp := NewCT_OMath() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.OMath = append(m.OMath, tmp) + default: + gooxml.Log("skipping unsupported element on OMathPara %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lOMathPara + case xml.CharData: + } + } + return nil +} + +// Validate validates the OMathPara and its children +func (m *OMathPara) Validate() error { + return m.ValidateWithPath("OMathPara") +} + +// ValidateWithPath validates the OMathPara and its children, prefixing error messages with path +func (m *OMathPara) ValidateWithPath(path string) error { + if err := m.CT_OMathPara.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/common.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/common.go new file mode 100644 index 00000000..c3a115c4 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/math/common.go @@ -0,0 +1,1072 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package math + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +func ParseUnionST_OnOff(s string) (sharedTypes.ST_OnOff, error) { + return sharedTypes.ParseUnionST_OnOff(s) +} +func ParseUnionST_TwipsMeasure(s string) (sharedTypes.ST_TwipsMeasure, error) { + ret := sharedTypes.ST_TwipsMeasure{} + if sharedTypes.ST_PositiveUniversalMeasurePatternRe.MatchString(s) { + ret.ST_PositiveUniversalMeasure = &s + } else { + v, err := strconv.ParseFloat(s, 64) + if err != nil { + return ret, fmt.Errorf("parsing %s as uint: %s", s, err) + } + ret.ST_UnsignedDecimalNumber = gooxml.Uint64(uint64(v)) + } + return ret, nil +} + +type ST_Shp byte + +const ( + ST_ShpUnset ST_Shp = 0 + ST_ShpCentered ST_Shp = 1 + ST_ShpMatch ST_Shp = 2 +) + +func (e ST_Shp) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_ShpUnset: + attr.Value = "" + case ST_ShpCentered: + attr.Value = "centered" + case ST_ShpMatch: + attr.Value = "match" + } + return attr, nil +} + +func (e *ST_Shp) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "centered": + *e = 1 + case "match": + *e = 2 + } + return nil +} + +func (m ST_Shp) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_Shp) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "centered": + *m = 1 + case "match": + *m = 2 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_Shp) String() string { + switch m { + case 0: + return "" + case 1: + return "centered" + case 2: + return "match" + } + return "" +} + +func (m ST_Shp) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_Shp) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_FType byte + +const ( + ST_FTypeUnset ST_FType = 0 + ST_FTypeBar ST_FType = 1 + ST_FTypeSkw ST_FType = 2 + ST_FTypeLin ST_FType = 3 + ST_FTypeNoBar ST_FType = 4 +) + +func (e ST_FType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_FTypeUnset: + attr.Value = "" + case ST_FTypeBar: + attr.Value = "bar" + case ST_FTypeSkw: + attr.Value = "skw" + case ST_FTypeLin: + attr.Value = "lin" + case ST_FTypeNoBar: + attr.Value = "noBar" + } + return attr, nil +} + +func (e *ST_FType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "bar": + *e = 1 + case "skw": + *e = 2 + case "lin": + *e = 3 + case "noBar": + *e = 4 + } + return nil +} + +func (m ST_FType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_FType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "bar": + *m = 1 + case "skw": + *m = 2 + case "lin": + *m = 3 + case "noBar": + *m = 4 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_FType) String() string { + switch m { + case 0: + return "" + case 1: + return "bar" + case 2: + return "skw" + case 3: + return "lin" + case 4: + return "noBar" + } + return "" +} + +func (m ST_FType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_FType) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_LimLoc byte + +const ( + ST_LimLocUnset ST_LimLoc = 0 + ST_LimLocUndOvr ST_LimLoc = 1 + ST_LimLocSubSup ST_LimLoc = 2 +) + +func (e ST_LimLoc) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_LimLocUnset: + attr.Value = "" + case ST_LimLocUndOvr: + attr.Value = "undOvr" + case ST_LimLocSubSup: + attr.Value = "subSup" + } + return attr, nil +} + +func (e *ST_LimLoc) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "undOvr": + *e = 1 + case "subSup": + *e = 2 + } + return nil +} + +func (m ST_LimLoc) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_LimLoc) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "undOvr": + *m = 1 + case "subSup": + *m = 2 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_LimLoc) String() string { + switch m { + case 0: + return "" + case 1: + return "undOvr" + case 2: + return "subSup" + } + return "" +} + +func (m ST_LimLoc) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_LimLoc) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_TopBot byte + +const ( + ST_TopBotUnset ST_TopBot = 0 + ST_TopBotTop ST_TopBot = 1 + ST_TopBotBot ST_TopBot = 2 +) + +func (e ST_TopBot) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_TopBotUnset: + attr.Value = "" + case ST_TopBotTop: + attr.Value = "top" + case ST_TopBotBot: + attr.Value = "bot" + } + return attr, nil +} + +func (e *ST_TopBot) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "top": + *e = 1 + case "bot": + *e = 2 + } + return nil +} + +func (m ST_TopBot) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_TopBot) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "top": + *m = 1 + case "bot": + *m = 2 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_TopBot) String() string { + switch m { + case 0: + return "" + case 1: + return "top" + case 2: + return "bot" + } + return "" +} + +func (m ST_TopBot) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_TopBot) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_Script byte + +const ( + ST_ScriptUnset ST_Script = 0 + ST_ScriptRoman ST_Script = 1 + ST_ScriptScript ST_Script = 2 + ST_ScriptFraktur ST_Script = 3 + ST_ScriptDouble_struck ST_Script = 4 + ST_ScriptSans_serif ST_Script = 5 + ST_ScriptMonospace ST_Script = 6 +) + +func (e ST_Script) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_ScriptUnset: + attr.Value = "" + case ST_ScriptRoman: + attr.Value = "roman" + case ST_ScriptScript: + attr.Value = "script" + case ST_ScriptFraktur: + attr.Value = "fraktur" + case ST_ScriptDouble_struck: + attr.Value = "double-struck" + case ST_ScriptSans_serif: + attr.Value = "sans-serif" + case ST_ScriptMonospace: + attr.Value = "monospace" + } + return attr, nil +} + +func (e *ST_Script) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "roman": + *e = 1 + case "script": + *e = 2 + case "fraktur": + *e = 3 + case "double-struck": + *e = 4 + case "sans-serif": + *e = 5 + case "monospace": + *e = 6 + } + return nil +} + +func (m ST_Script) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_Script) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "roman": + *m = 1 + case "script": + *m = 2 + case "fraktur": + *m = 3 + case "double-struck": + *m = 4 + case "sans-serif": + *m = 5 + case "monospace": + *m = 6 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_Script) String() string { + switch m { + case 0: + return "" + case 1: + return "roman" + case 2: + return "script" + case 3: + return "fraktur" + case 4: + return "double-struck" + case 5: + return "sans-serif" + case 6: + return "monospace" + } + return "" +} + +func (m ST_Script) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_Script) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_Style byte + +const ( + ST_StyleUnset ST_Style = 0 + ST_StyleP ST_Style = 1 + ST_StyleB ST_Style = 2 + ST_StyleI ST_Style = 3 + ST_StyleBi ST_Style = 4 +) + +func (e ST_Style) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_StyleUnset: + attr.Value = "" + case ST_StyleP: + attr.Value = "p" + case ST_StyleB: + attr.Value = "b" + case ST_StyleI: + attr.Value = "i" + case ST_StyleBi: + attr.Value = "bi" + } + return attr, nil +} + +func (e *ST_Style) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "p": + *e = 1 + case "b": + *e = 2 + case "i": + *e = 3 + case "bi": + *e = 4 + } + return nil +} + +func (m ST_Style) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_Style) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "p": + *m = 1 + case "b": + *m = 2 + case "i": + *m = 3 + case "bi": + *m = 4 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_Style) String() string { + switch m { + case 0: + return "" + case 1: + return "p" + case 2: + return "b" + case 3: + return "i" + case 4: + return "bi" + } + return "" +} + +func (m ST_Style) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_Style) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_Jc byte + +const ( + ST_JcUnset ST_Jc = 0 + ST_JcLeft ST_Jc = 1 + ST_JcRight ST_Jc = 2 + ST_JcCenter ST_Jc = 3 + ST_JcCenterGroup ST_Jc = 4 +) + +func (e ST_Jc) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_JcUnset: + attr.Value = "" + case ST_JcLeft: + attr.Value = "left" + case ST_JcRight: + attr.Value = "right" + case ST_JcCenter: + attr.Value = "center" + case ST_JcCenterGroup: + attr.Value = "centerGroup" + } + return attr, nil +} + +func (e *ST_Jc) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "left": + *e = 1 + case "right": + *e = 2 + case "center": + *e = 3 + case "centerGroup": + *e = 4 + } + return nil +} + +func (m ST_Jc) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_Jc) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "left": + *m = 1 + case "right": + *m = 2 + case "center": + *m = 3 + case "centerGroup": + *m = 4 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_Jc) String() string { + switch m { + case 0: + return "" + case 1: + return "left" + case 2: + return "right" + case 3: + return "center" + case 4: + return "centerGroup" + } + return "" +} + +func (m ST_Jc) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_Jc) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_BreakBin byte + +const ( + ST_BreakBinUnset ST_BreakBin = 0 + ST_BreakBinBefore ST_BreakBin = 1 + ST_BreakBinAfter ST_BreakBin = 2 + ST_BreakBinRepeat ST_BreakBin = 3 +) + +func (e ST_BreakBin) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_BreakBinUnset: + attr.Value = "" + case ST_BreakBinBefore: + attr.Value = "before" + case ST_BreakBinAfter: + attr.Value = "after" + case ST_BreakBinRepeat: + attr.Value = "repeat" + } + return attr, nil +} + +func (e *ST_BreakBin) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "before": + *e = 1 + case "after": + *e = 2 + case "repeat": + *e = 3 + } + return nil +} + +func (m ST_BreakBin) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_BreakBin) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "before": + *m = 1 + case "after": + *m = 2 + case "repeat": + *m = 3 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_BreakBin) String() string { + switch m { + case 0: + return "" + case 1: + return "before" + case 2: + return "after" + case 3: + return "repeat" + } + return "" +} + +func (m ST_BreakBin) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_BreakBin) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_BreakBinSub byte + +const ( + ST_BreakBinSubUnset ST_BreakBinSub = 0 + ST_BreakBinSub__ ST_BreakBinSub = 1 + ST_BreakBinSub___ ST_BreakBinSub = 2 + ST_BreakBinSub____ ST_BreakBinSub = 3 +) + +func (e ST_BreakBinSub) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_BreakBinSubUnset: + attr.Value = "" + case ST_BreakBinSub__: + attr.Value = "--" + case ST_BreakBinSub___: + attr.Value = "-+" + case ST_BreakBinSub____: + attr.Value = "+-" + } + return attr, nil +} + +func (e *ST_BreakBinSub) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "--": + *e = 1 + case "-+": + *e = 2 + case "+-": + *e = 3 + } + return nil +} + +func (m ST_BreakBinSub) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_BreakBinSub) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "--": + *m = 1 + case "-+": + *m = 2 + case "+-": + *m = 3 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_BreakBinSub) String() string { + switch m { + case 0: + return "" + case 1: + return "--" + case 2: + return "-+" + case 3: + return "+-" + } + return "" +} + +func (m ST_BreakBinSub) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_BreakBinSub) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +// init registers constructor functions for dynamically creating elements based off the XML namespace and name +func init() { + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_Integer255", NewCT_Integer255) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_Integer2", NewCT_Integer2) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_SpacingRule", NewCT_SpacingRule) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_UnSignedInteger", NewCT_UnSignedInteger) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_Char", NewCT_Char) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_OnOff", NewCT_OnOff) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_String", NewCT_String) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_XAlign", NewCT_XAlign) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_YAlign", NewCT_YAlign) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_Shp", NewCT_Shp) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_FType", NewCT_FType) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_LimLoc", NewCT_LimLoc) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_TopBot", NewCT_TopBot) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_Script", NewCT_Script) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_Style", NewCT_Style) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_ManualBreak", NewCT_ManualBreak) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_RPR", NewCT_RPR) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_Text", NewCT_Text) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_R", NewCT_R) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_CtrlPr", NewCT_CtrlPr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_AccPr", NewCT_AccPr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_Acc", NewCT_Acc) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_BarPr", NewCT_BarPr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_Bar", NewCT_Bar) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_BoxPr", NewCT_BoxPr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_Box", NewCT_Box) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_BorderBoxPr", NewCT_BorderBoxPr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_BorderBox", NewCT_BorderBox) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_DPr", NewCT_DPr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_D", NewCT_D) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_EqArrPr", NewCT_EqArrPr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_EqArr", NewCT_EqArr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_FPr", NewCT_FPr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_F", NewCT_F) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_FuncPr", NewCT_FuncPr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_Func", NewCT_Func) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_GroupChrPr", NewCT_GroupChrPr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_GroupChr", NewCT_GroupChr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_LimLowPr", NewCT_LimLowPr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_LimLow", NewCT_LimLow) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_LimUppPr", NewCT_LimUppPr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_LimUpp", NewCT_LimUpp) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_MCPr", NewCT_MCPr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_MC", NewCT_MC) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_MCS", NewCT_MCS) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_MPr", NewCT_MPr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_MR", NewCT_MR) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_M", NewCT_M) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_NaryPr", NewCT_NaryPr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_Nary", NewCT_Nary) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_PhantPr", NewCT_PhantPr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_Phant", NewCT_Phant) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_RadPr", NewCT_RadPr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_Rad", NewCT_Rad) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_SPrePr", NewCT_SPrePr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_SPre", NewCT_SPre) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_SSubPr", NewCT_SSubPr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_SSub", NewCT_SSub) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_SSubSupPr", NewCT_SSubSupPr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_SSubSup", NewCT_SSubSup) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_SSupPr", NewCT_SSupPr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_SSup", NewCT_SSup) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_OMathArgPr", NewCT_OMathArgPr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_OMathArg", NewCT_OMathArg) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_OMathJc", NewCT_OMathJc) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_OMathParaPr", NewCT_OMathParaPr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_TwipsMeasure", NewCT_TwipsMeasure) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_BreakBin", NewCT_BreakBin) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_BreakBinSub", NewCT_BreakBinSub) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_MathPr", NewCT_MathPr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_OMathPara", NewCT_OMathPara) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "CT_OMath", NewCT_OMath) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "mathPr", NewMathPr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "oMathPara", NewOMathPara) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "oMath", NewOMath) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "EG_ScriptStyle", NewEG_ScriptStyle) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "EG_OMathMathElements", NewEG_OMathMathElements) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/officeDocument/2006/math", "EG_OMathElements", NewEG_OMathElements) +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/sharedTypes/ST_OnOff.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/sharedTypes/ST_OnOff.go new file mode 100644 index 00000000..a0ab6ded --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/sharedTypes/ST_OnOff.go @@ -0,0 +1,60 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package sharedTypes + +import ( + "encoding/xml" + "fmt" +) + +// ST_OnOff is a union type +type ST_OnOff struct { + Bool *bool + ST_OnOff1 ST_OnOff1 +} + +func (m *ST_OnOff) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_OnOff) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Bool != nil { + e.EncodeToken(xml.CharData(fmt.Sprintf("%d", b2i(*m.Bool)))) + } + if m.ST_OnOff1 != ST_OnOff1Unset { + e.EncodeToken(xml.CharData(m.ST_OnOff1.String())) + } + return e.EncodeToken(xml.EndElement{Name: start.Name}) +} + +func (m *ST_OnOff) ValidateWithPath(path string) error { + mems := []string{} + if m.Bool != nil { + mems = append(mems, "Bool") + } + if m.ST_OnOff1 != ST_OnOff1Unset { + mems = append(mems, "ST_OnOff1") + } + if len(mems) > 1 { + return fmt.Errorf("%s too many members set: %v", path, mems) + } + return nil +} + +func (m ST_OnOff) String() string { + if m.Bool != nil { + return fmt.Sprintf("%v", *m.Bool) + } + if m.ST_OnOff1 != ST_OnOff1Unset { + return m.ST_OnOff1.String() + } + return "" +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/sharedTypes/ST_TwipsMeasure.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/sharedTypes/ST_TwipsMeasure.go new file mode 100644 index 00000000..1b072988 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/sharedTypes/ST_TwipsMeasure.go @@ -0,0 +1,60 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package sharedTypes + +import ( + "encoding/xml" + "fmt" +) + +// ST_TwipsMeasure is a union type +type ST_TwipsMeasure struct { + ST_UnsignedDecimalNumber *uint64 + ST_PositiveUniversalMeasure *string +} + +func (m *ST_TwipsMeasure) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_TwipsMeasure) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.ST_UnsignedDecimalNumber != nil { + e.EncodeToken(xml.CharData(fmt.Sprintf("%d", *m.ST_UnsignedDecimalNumber))) + } + if m.ST_PositiveUniversalMeasure != nil { + e.EncodeToken(xml.CharData(*m.ST_PositiveUniversalMeasure)) + } + return e.EncodeToken(xml.EndElement{Name: start.Name}) +} + +func (m *ST_TwipsMeasure) ValidateWithPath(path string) error { + mems := []string{} + if m.ST_UnsignedDecimalNumber != nil { + mems = append(mems, "ST_UnsignedDecimalNumber") + } + if m.ST_PositiveUniversalMeasure != nil { + mems = append(mems, "ST_PositiveUniversalMeasure") + } + if len(mems) > 1 { + return fmt.Errorf("%s too many members set: %v", path, mems) + } + return nil +} + +func (m ST_TwipsMeasure) String() string { + if m.ST_UnsignedDecimalNumber != nil { + return fmt.Sprintf("%v", *m.ST_UnsignedDecimalNumber) + } + if m.ST_PositiveUniversalMeasure != nil { + return fmt.Sprintf("%v", *m.ST_PositiveUniversalMeasure) + } + return "" +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/ofc/sharedTypes/common.go b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/sharedTypes/common.go new file mode 100644 index 00000000..53ec7344 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/ofc/sharedTypes/common.go @@ -0,0 +1,1341 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package sharedTypes + +import ( + "encoding/xml" + "fmt" + "regexp" +) + +const ST_GuidPattern = `\{[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}\}` + +var ST_GuidPatternRe = regexp.MustCompile(ST_GuidPattern) + +const ST_UniversalMeasurePattern = `-?[0-9]+(\.[0-9]+)?(mm|cm|in|pt|pc|pi)` + +var ST_UniversalMeasurePatternRe = regexp.MustCompile(ST_UniversalMeasurePattern) + +const ST_PositiveUniversalMeasurePattern = `[0-9]+(\.[0-9]+)?(mm|cm|in|pt|pc|pi)` + +var ST_PositiveUniversalMeasurePatternRe = regexp.MustCompile(ST_PositiveUniversalMeasurePattern) + +const ST_PercentagePattern = `-?[0-9]+(\.[0-9]+)?%` + +var ST_PercentagePatternRe = regexp.MustCompile(ST_PercentagePattern) + +const ST_FixedPercentagePattern = `-?((100)|([0-9][0-9]?))(\.[0-9][0-9]?)?%` + +var ST_FixedPercentagePatternRe = regexp.MustCompile(ST_FixedPercentagePattern) + +const ST_PositivePercentagePattern = `[0-9]+(\.[0-9]+)?%` + +var ST_PositivePercentagePatternRe = regexp.MustCompile(ST_PositivePercentagePattern) + +const ST_PositiveFixedPercentagePattern = `((100)|([0-9][0-9]?))(\.[0-9][0-9]?)?%` + +var ST_PositiveFixedPercentagePatternRe = regexp.MustCompile(ST_PositiveFixedPercentagePattern) + +func ParseUnionST_OnOff(s string) (ST_OnOff, error) { + r := ST_OnOff{} + switch s { + case "true", "1", "on": + tru := true + r.Bool = &tru + default: + fals := false + r.Bool = &fals + } + return r, nil +} + +func b2i(b bool) uint8 { + if b { + return 1 + } + return 0 +} + +type ST_CalendarType byte + +const ( + ST_CalendarTypeUnset ST_CalendarType = 0 + ST_CalendarTypeGregorian ST_CalendarType = 1 + ST_CalendarTypeGregorianUs ST_CalendarType = 2 + ST_CalendarTypeGregorianMeFrench ST_CalendarType = 3 + ST_CalendarTypeGregorianArabic ST_CalendarType = 4 + ST_CalendarTypeHijri ST_CalendarType = 5 + ST_CalendarTypeHebrew ST_CalendarType = 6 + ST_CalendarTypeTaiwan ST_CalendarType = 7 + ST_CalendarTypeJapan ST_CalendarType = 8 + ST_CalendarTypeThai ST_CalendarType = 9 + ST_CalendarTypeKorea ST_CalendarType = 10 + ST_CalendarTypeSaka ST_CalendarType = 11 + ST_CalendarTypeGregorianXlitEnglish ST_CalendarType = 12 + ST_CalendarTypeGregorianXlitFrench ST_CalendarType = 13 + ST_CalendarTypeNone ST_CalendarType = 14 +) + +func (e ST_CalendarType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_CalendarTypeUnset: + attr.Value = "" + case ST_CalendarTypeGregorian: + attr.Value = "gregorian" + case ST_CalendarTypeGregorianUs: + attr.Value = "gregorianUs" + case ST_CalendarTypeGregorianMeFrench: + attr.Value = "gregorianMeFrench" + case ST_CalendarTypeGregorianArabic: + attr.Value = "gregorianArabic" + case ST_CalendarTypeHijri: + attr.Value = "hijri" + case ST_CalendarTypeHebrew: + attr.Value = "hebrew" + case ST_CalendarTypeTaiwan: + attr.Value = "taiwan" + case ST_CalendarTypeJapan: + attr.Value = "japan" + case ST_CalendarTypeThai: + attr.Value = "thai" + case ST_CalendarTypeKorea: + attr.Value = "korea" + case ST_CalendarTypeSaka: + attr.Value = "saka" + case ST_CalendarTypeGregorianXlitEnglish: + attr.Value = "gregorianXlitEnglish" + case ST_CalendarTypeGregorianXlitFrench: + attr.Value = "gregorianXlitFrench" + case ST_CalendarTypeNone: + attr.Value = "none" + } + return attr, nil +} + +func (e *ST_CalendarType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "gregorian": + *e = 1 + case "gregorianUs": + *e = 2 + case "gregorianMeFrench": + *e = 3 + case "gregorianArabic": + *e = 4 + case "hijri": + *e = 5 + case "hebrew": + *e = 6 + case "taiwan": + *e = 7 + case "japan": + *e = 8 + case "thai": + *e = 9 + case "korea": + *e = 10 + case "saka": + *e = 11 + case "gregorianXlitEnglish": + *e = 12 + case "gregorianXlitFrench": + *e = 13 + case "none": + *e = 14 + } + return nil +} + +func (m ST_CalendarType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_CalendarType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "gregorian": + *m = 1 + case "gregorianUs": + *m = 2 + case "gregorianMeFrench": + *m = 3 + case "gregorianArabic": + *m = 4 + case "hijri": + *m = 5 + case "hebrew": + *m = 6 + case "taiwan": + *m = 7 + case "japan": + *m = 8 + case "thai": + *m = 9 + case "korea": + *m = 10 + case "saka": + *m = 11 + case "gregorianXlitEnglish": + *m = 12 + case "gregorianXlitFrench": + *m = 13 + case "none": + *m = 14 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_CalendarType) String() string { + switch m { + case 0: + return "" + case 1: + return "gregorian" + case 2: + return "gregorianUs" + case 3: + return "gregorianMeFrench" + case 4: + return "gregorianArabic" + case 5: + return "hijri" + case 6: + return "hebrew" + case 7: + return "taiwan" + case 8: + return "japan" + case 9: + return "thai" + case 10: + return "korea" + case 11: + return "saka" + case 12: + return "gregorianXlitEnglish" + case 13: + return "gregorianXlitFrench" + case 14: + return "none" + } + return "" +} + +func (m ST_CalendarType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_CalendarType) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_AlgClass byte + +const ( + ST_AlgClassUnset ST_AlgClass = 0 + ST_AlgClassHash ST_AlgClass = 1 + ST_AlgClassCustom ST_AlgClass = 2 +) + +func (e ST_AlgClass) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_AlgClassUnset: + attr.Value = "" + case ST_AlgClassHash: + attr.Value = "hash" + case ST_AlgClassCustom: + attr.Value = "custom" + } + return attr, nil +} + +func (e *ST_AlgClass) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "hash": + *e = 1 + case "custom": + *e = 2 + } + return nil +} + +func (m ST_AlgClass) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_AlgClass) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "hash": + *m = 1 + case "custom": + *m = 2 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_AlgClass) String() string { + switch m { + case 0: + return "" + case 1: + return "hash" + case 2: + return "custom" + } + return "" +} + +func (m ST_AlgClass) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_AlgClass) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_CryptProv byte + +const ( + ST_CryptProvUnset ST_CryptProv = 0 + ST_CryptProvRsaAES ST_CryptProv = 1 + ST_CryptProvRsaFull ST_CryptProv = 2 + ST_CryptProvCustom ST_CryptProv = 3 +) + +func (e ST_CryptProv) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_CryptProvUnset: + attr.Value = "" + case ST_CryptProvRsaAES: + attr.Value = "rsaAES" + case ST_CryptProvRsaFull: + attr.Value = "rsaFull" + case ST_CryptProvCustom: + attr.Value = "custom" + } + return attr, nil +} + +func (e *ST_CryptProv) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "rsaAES": + *e = 1 + case "rsaFull": + *e = 2 + case "custom": + *e = 3 + } + return nil +} + +func (m ST_CryptProv) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_CryptProv) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "rsaAES": + *m = 1 + case "rsaFull": + *m = 2 + case "custom": + *m = 3 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_CryptProv) String() string { + switch m { + case 0: + return "" + case 1: + return "rsaAES" + case 2: + return "rsaFull" + case 3: + return "custom" + } + return "" +} + +func (m ST_CryptProv) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_CryptProv) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_AlgType byte + +const ( + ST_AlgTypeUnset ST_AlgType = 0 + ST_AlgTypeTypeAny ST_AlgType = 1 + ST_AlgTypeCustom ST_AlgType = 2 +) + +func (e ST_AlgType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_AlgTypeUnset: + attr.Value = "" + case ST_AlgTypeTypeAny: + attr.Value = "typeAny" + case ST_AlgTypeCustom: + attr.Value = "custom" + } + return attr, nil +} + +func (e *ST_AlgType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "typeAny": + *e = 1 + case "custom": + *e = 2 + } + return nil +} + +func (m ST_AlgType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_AlgType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "typeAny": + *m = 1 + case "custom": + *m = 2 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_AlgType) String() string { + switch m { + case 0: + return "" + case 1: + return "typeAny" + case 2: + return "custom" + } + return "" +} + +func (m ST_AlgType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_AlgType) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_OnOff1 byte + +const ( + ST_OnOff1Unset ST_OnOff1 = 0 + ST_OnOff1On ST_OnOff1 = 1 + ST_OnOff1Off ST_OnOff1 = 2 +) + +func (e ST_OnOff1) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_OnOff1Unset: + attr.Value = "" + case ST_OnOff1On: + attr.Value = "on" + case ST_OnOff1Off: + attr.Value = "off" + } + return attr, nil +} + +func (e *ST_OnOff1) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "on": + *e = 1 + case "off": + *e = 2 + } + return nil +} + +func (m ST_OnOff1) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_OnOff1) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "on": + *m = 1 + case "off": + *m = 2 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_OnOff1) String() string { + switch m { + case 0: + return "" + case 1: + return "on" + case 2: + return "off" + } + return "" +} + +func (m ST_OnOff1) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_OnOff1) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_TrueFalse byte + +const ( + ST_TrueFalseUnset ST_TrueFalse = 0 + ST_TrueFalseT ST_TrueFalse = 1 + ST_TrueFalseF ST_TrueFalse = 2 + ST_TrueFalseTrue ST_TrueFalse = 3 + ST_TrueFalseFalse ST_TrueFalse = 4 +) + +func (e ST_TrueFalse) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_TrueFalseUnset: + attr.Value = "" + case ST_TrueFalseT: + attr.Value = "t" + case ST_TrueFalseF: + attr.Value = "f" + case ST_TrueFalseTrue: + attr.Value = "true" + case ST_TrueFalseFalse: + attr.Value = "false" + } + return attr, nil +} + +func (e *ST_TrueFalse) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "t": + *e = 1 + case "f": + *e = 2 + case "true": + *e = 3 + case "false": + *e = 4 + } + return nil +} + +func (m ST_TrueFalse) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_TrueFalse) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "t": + *m = 1 + case "f": + *m = 2 + case "true": + *m = 3 + case "false": + *m = 4 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_TrueFalse) String() string { + switch m { + case 0: + return "" + case 1: + return "t" + case 2: + return "f" + case 3: + return "true" + case 4: + return "false" + } + return "" +} + +func (m ST_TrueFalse) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_TrueFalse) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_TrueFalseBlank byte + +const ( + ST_TrueFalseBlankUnset ST_TrueFalseBlank = 0 + ST_TrueFalseBlankT ST_TrueFalseBlank = 1 + ST_TrueFalseBlankF ST_TrueFalseBlank = 2 + ST_TrueFalseBlankTrue ST_TrueFalseBlank = 3 + ST_TrueFalseBlankFalse ST_TrueFalseBlank = 4 + ST_TrueFalseBlankTrue_ ST_TrueFalseBlank = 6 + ST_TrueFalseBlankFalse_ ST_TrueFalseBlank = 7 +) + +func (e ST_TrueFalseBlank) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_TrueFalseBlankUnset: + attr.Value = "" + case ST_TrueFalseBlankT: + attr.Value = "t" + case ST_TrueFalseBlankF: + attr.Value = "f" + case ST_TrueFalseBlankTrue: + attr.Value = "true" + case ST_TrueFalseBlankFalse: + attr.Value = "false" + case ST_TrueFalseBlankTrue_: + attr.Value = "True" + case ST_TrueFalseBlankFalse_: + attr.Value = "False" + } + return attr, nil +} + +func (e *ST_TrueFalseBlank) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "t": + *e = 1 + case "f": + *e = 2 + case "true": + *e = 3 + case "false": + *e = 4 + case "True": + *e = 6 + case "False": + *e = 7 + } + return nil +} + +func (m ST_TrueFalseBlank) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_TrueFalseBlank) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "t": + *m = 1 + case "f": + *m = 2 + case "true": + *m = 3 + case "false": + *m = 4 + case "True": + *m = 6 + case "False": + *m = 7 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_TrueFalseBlank) String() string { + switch m { + case 0: + return "" + case 1: + return "t" + case 2: + return "f" + case 3: + return "true" + case 4: + return "false" + case 6: + return "True" + case 7: + return "False" + } + return "" +} + +func (m ST_TrueFalseBlank) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_TrueFalseBlank) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 6, 7: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_VerticalAlignRun byte + +const ( + ST_VerticalAlignRunUnset ST_VerticalAlignRun = 0 + ST_VerticalAlignRunBaseline ST_VerticalAlignRun = 1 + ST_VerticalAlignRunSuperscript ST_VerticalAlignRun = 2 + ST_VerticalAlignRunSubscript ST_VerticalAlignRun = 3 +) + +func (e ST_VerticalAlignRun) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_VerticalAlignRunUnset: + attr.Value = "" + case ST_VerticalAlignRunBaseline: + attr.Value = "baseline" + case ST_VerticalAlignRunSuperscript: + attr.Value = "superscript" + case ST_VerticalAlignRunSubscript: + attr.Value = "subscript" + } + return attr, nil +} + +func (e *ST_VerticalAlignRun) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "baseline": + *e = 1 + case "superscript": + *e = 2 + case "subscript": + *e = 3 + } + return nil +} + +func (m ST_VerticalAlignRun) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_VerticalAlignRun) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "baseline": + *m = 1 + case "superscript": + *m = 2 + case "subscript": + *m = 3 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_VerticalAlignRun) String() string { + switch m { + case 0: + return "" + case 1: + return "baseline" + case 2: + return "superscript" + case 3: + return "subscript" + } + return "" +} + +func (m ST_VerticalAlignRun) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_VerticalAlignRun) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_XAlign byte + +const ( + ST_XAlignUnset ST_XAlign = 0 + ST_XAlignLeft ST_XAlign = 1 + ST_XAlignCenter ST_XAlign = 2 + ST_XAlignRight ST_XAlign = 3 + ST_XAlignInside ST_XAlign = 4 + ST_XAlignOutside ST_XAlign = 5 +) + +func (e ST_XAlign) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_XAlignUnset: + attr.Value = "" + case ST_XAlignLeft: + attr.Value = "left" + case ST_XAlignCenter: + attr.Value = "center" + case ST_XAlignRight: + attr.Value = "right" + case ST_XAlignInside: + attr.Value = "inside" + case ST_XAlignOutside: + attr.Value = "outside" + } + return attr, nil +} + +func (e *ST_XAlign) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "left": + *e = 1 + case "center": + *e = 2 + case "right": + *e = 3 + case "inside": + *e = 4 + case "outside": + *e = 5 + } + return nil +} + +func (m ST_XAlign) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_XAlign) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "left": + *m = 1 + case "center": + *m = 2 + case "right": + *m = 3 + case "inside": + *m = 4 + case "outside": + *m = 5 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_XAlign) String() string { + switch m { + case 0: + return "" + case 1: + return "left" + case 2: + return "center" + case 3: + return "right" + case 4: + return "inside" + case 5: + return "outside" + } + return "" +} + +func (m ST_XAlign) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_XAlign) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_YAlign byte + +const ( + ST_YAlignUnset ST_YAlign = 0 + ST_YAlignInline ST_YAlign = 1 + ST_YAlignTop ST_YAlign = 2 + ST_YAlignCenter ST_YAlign = 3 + ST_YAlignBottom ST_YAlign = 4 + ST_YAlignInside ST_YAlign = 5 + ST_YAlignOutside ST_YAlign = 6 +) + +func (e ST_YAlign) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_YAlignUnset: + attr.Value = "" + case ST_YAlignInline: + attr.Value = "inline" + case ST_YAlignTop: + attr.Value = "top" + case ST_YAlignCenter: + attr.Value = "center" + case ST_YAlignBottom: + attr.Value = "bottom" + case ST_YAlignInside: + attr.Value = "inside" + case ST_YAlignOutside: + attr.Value = "outside" + } + return attr, nil +} + +func (e *ST_YAlign) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "inline": + *e = 1 + case "top": + *e = 2 + case "center": + *e = 3 + case "bottom": + *e = 4 + case "inside": + *e = 5 + case "outside": + *e = 6 + } + return nil +} + +func (m ST_YAlign) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_YAlign) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "inline": + *m = 1 + case "top": + *m = 2 + case "center": + *m = 3 + case "bottom": + *m = 4 + case "inside": + *m = 5 + case "outside": + *m = 6 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_YAlign) String() string { + switch m { + case 0: + return "" + case 1: + return "inline" + case 2: + return "top" + case 3: + return "center" + case 4: + return "bottom" + case 5: + return "inside" + case 6: + return "outside" + } + return "" +} + +func (m ST_YAlign) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_YAlign) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_ConformanceClass byte + +const ( + ST_ConformanceClassUnset ST_ConformanceClass = 0 + ST_ConformanceClassStrict ST_ConformanceClass = 1 + ST_ConformanceClassTransitional ST_ConformanceClass = 2 +) + +func (e ST_ConformanceClass) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_ConformanceClassUnset: + attr.Value = "" + case ST_ConformanceClassStrict: + attr.Value = "strict" + case ST_ConformanceClassTransitional: + attr.Value = "transitional" + } + return attr, nil +} + +func (e *ST_ConformanceClass) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "strict": + *e = 1 + case "transitional": + *e = 2 + } + return nil +} + +func (m ST_ConformanceClass) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_ConformanceClass) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "strict": + *m = 1 + case "transitional": + *m = 2 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_ConformanceClass) String() string { + switch m { + case 0: + return "" + case 1: + return "strict" + case 2: + return "transitional" + } + return "" +} + +func (m ST_ConformanceClass) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_ConformanceClass) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/pkg/content_types/CT_Default.go b/backend/vendor/baliance.com/gooxml/schema/soo/pkg/content_types/CT_Default.go new file mode 100644 index 00000000..64ccccfd --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/pkg/content_types/CT_Default.go @@ -0,0 +1,88 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package content_types + +import ( + "encoding/xml" + "fmt" +) + +type CT_Default struct { + ExtensionAttr string + ContentTypeAttr string +} + +func NewCT_Default() *CT_Default { + ret := &CT_Default{} + ret.ExtensionAttr = "xml" + ret.ContentTypeAttr = "application/xml" + return ret +} + +func (m *CT_Default) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "Extension"}, + Value: fmt.Sprintf("%v", m.ExtensionAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "ContentType"}, + Value: fmt.Sprintf("%v", m.ContentTypeAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Default) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ExtensionAttr = "xml" + m.ContentTypeAttr = "application/xml" + for _, attr := range start.Attr { + if attr.Name.Local == "Extension" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ExtensionAttr = parsed + continue + } + if attr.Name.Local == "ContentType" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ContentTypeAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Default: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Default and its children +func (m *CT_Default) Validate() error { + return m.ValidateWithPath("CT_Default") +} + +// ValidateWithPath validates the CT_Default and its children, prefixing error messages with path +func (m *CT_Default) ValidateWithPath(path string) error { + if !ST_ExtensionPatternRe.MatchString(m.ExtensionAttr) { + return fmt.Errorf(`%s/m.ExtensionAttr must match '%s' (have %v)`, path, ST_ExtensionPatternRe, m.ExtensionAttr) + } + if !ST_ContentTypePatternRe.MatchString(m.ContentTypeAttr) { + return fmt.Errorf(`%s/m.ContentTypeAttr must match '%s' (have %v)`, path, ST_ContentTypePatternRe, m.ContentTypeAttr) + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/pkg/content_types/CT_Override.go b/backend/vendor/baliance.com/gooxml/schema/soo/pkg/content_types/CT_Override.go new file mode 100644 index 00000000..eba6ef02 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/pkg/content_types/CT_Override.go @@ -0,0 +1,83 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package content_types + +import ( + "encoding/xml" + "fmt" +) + +type CT_Override struct { + ContentTypeAttr string + PartNameAttr string +} + +func NewCT_Override() *CT_Override { + ret := &CT_Override{} + ret.ContentTypeAttr = "application/xml" + return ret +} + +func (m *CT_Override) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "ContentType"}, + Value: fmt.Sprintf("%v", m.ContentTypeAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "PartName"}, + Value: fmt.Sprintf("%v", m.PartNameAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Override) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ContentTypeAttr = "application/xml" + for _, attr := range start.Attr { + if attr.Name.Local == "ContentType" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ContentTypeAttr = parsed + continue + } + if attr.Name.Local == "PartName" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.PartNameAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Override: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Override and its children +func (m *CT_Override) Validate() error { + return m.ValidateWithPath("CT_Override") +} + +// ValidateWithPath validates the CT_Override and its children, prefixing error messages with path +func (m *CT_Override) ValidateWithPath(path string) error { + if !ST_ContentTypePatternRe.MatchString(m.ContentTypeAttr) { + return fmt.Errorf(`%s/m.ContentTypeAttr must match '%s' (have %v)`, path, ST_ContentTypePatternRe, m.ContentTypeAttr) + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/pkg/content_types/CT_Types.go b/backend/vendor/baliance.com/gooxml/schema/soo/pkg/content_types/CT_Types.go new file mode 100644 index 00000000..892c1439 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/pkg/content_types/CT_Types.go @@ -0,0 +1,102 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package content_types + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_Types struct { + Default []*Default + Override []*Override +} + +func NewCT_Types() *CT_Types { + ret := &CT_Types{} + return ret +} + +func (m *CT_Types) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Default != nil { + seDefault := xml.StartElement{Name: xml.Name{Local: "Default"}} + for _, c := range m.Default { + e.EncodeElement(c, seDefault) + } + } + if m.Override != nil { + seOverride := xml.StartElement{Name: xml.Name{Local: "Override"}} + for _, c := range m.Override { + e.EncodeElement(c, seOverride) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Types) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_Types: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/package/2006/content-types", Local: "Default"}: + tmp := NewDefault() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Default = append(m.Default, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/package/2006/content-types", Local: "Override"}: + tmp := NewOverride() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Override = append(m.Override, tmp) + default: + gooxml.Log("skipping unsupported element on CT_Types %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Types + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Types and its children +func (m *CT_Types) Validate() error { + return m.ValidateWithPath("CT_Types") +} + +// ValidateWithPath validates the CT_Types and its children, prefixing error messages with path +func (m *CT_Types) ValidateWithPath(path string) error { + for i, v := range m.Default { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Default[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.Override { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Override[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/pkg/content_types/Default.go b/backend/vendor/baliance.com/gooxml/schema/soo/pkg/content_types/Default.go new file mode 100644 index 00000000..377b5d6c --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/pkg/content_types/Default.go @@ -0,0 +1,76 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package content_types + +import ( + "encoding/xml" + "fmt" +) + +type Default struct { + CT_Default +} + +func NewDefault() *Default { + ret := &Default{} + ret.CT_Default = *NewCT_Default() + return ret +} + +func (m *Default) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return m.CT_Default.MarshalXML(e, start) +} + +func (m *Default) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CT_Default = *NewCT_Default() + for _, attr := range start.Attr { + if attr.Name.Local == "Extension" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ExtensionAttr = parsed + continue + } + if attr.Name.Local == "ContentType" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ContentTypeAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing Default: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the Default and its children +func (m *Default) Validate() error { + return m.ValidateWithPath("Default") +} + +// ValidateWithPath validates the Default and its children, prefixing error messages with path +func (m *Default) ValidateWithPath(path string) error { + if err := m.CT_Default.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/pkg/content_types/Override.go b/backend/vendor/baliance.com/gooxml/schema/soo/pkg/content_types/Override.go new file mode 100644 index 00000000..8767b55c --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/pkg/content_types/Override.go @@ -0,0 +1,76 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package content_types + +import ( + "encoding/xml" + "fmt" +) + +type Override struct { + CT_Override +} + +func NewOverride() *Override { + ret := &Override{} + ret.CT_Override = *NewCT_Override() + return ret +} + +func (m *Override) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return m.CT_Override.MarshalXML(e, start) +} + +func (m *Override) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CT_Override = *NewCT_Override() + for _, attr := range start.Attr { + if attr.Name.Local == "ContentType" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ContentTypeAttr = parsed + continue + } + if attr.Name.Local == "PartName" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.PartNameAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing Override: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the Override and its children +func (m *Override) Validate() error { + return m.ValidateWithPath("Override") +} + +// ValidateWithPath validates the Override and its children, prefixing error messages with path +func (m *Override) ValidateWithPath(path string) error { + if err := m.CT_Override.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/pkg/content_types/Types.go b/backend/vendor/baliance.com/gooxml/schema/soo/pkg/content_types/Types.go new file mode 100644 index 00000000..a68ac182 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/pkg/content_types/Types.go @@ -0,0 +1,84 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package content_types + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type Types struct { + CT_Types +} + +func NewTypes() *Types { + ret := &Types{} + ret.CT_Types = *NewCT_Types() + return ret +} + +func (m *Types) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns"}, Value: "http://schemas.openxmlformats.org/package/2006/content-types"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:xml"}, Value: "http://www.w3.org/XML/1998/namespace"}) + start.Name.Local = "Types" + return m.CT_Types.MarshalXML(e, start) +} + +func (m *Types) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CT_Types = *NewCT_Types() +lTypes: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/package/2006/content-types", Local: "Default"}: + tmp := NewDefault() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Default = append(m.Default, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/package/2006/content-types", Local: "Override"}: + tmp := NewOverride() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Override = append(m.Override, tmp) + default: + gooxml.Log("skipping unsupported element on Types %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lTypes + case xml.CharData: + } + } + return nil +} + +// Validate validates the Types and its children +func (m *Types) Validate() error { + return m.ValidateWithPath("Types") +} + +// ValidateWithPath validates the Types and its children, prefixing error messages with path +func (m *Types) ValidateWithPath(path string) error { + if err := m.CT_Types.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/pkg/content_types/common.go b/backend/vendor/baliance.com/gooxml/schema/soo/pkg/content_types/common.go new file mode 100644 index 00000000..dcbc92a0 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/pkg/content_types/common.go @@ -0,0 +1,34 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package content_types + +import ( + "regexp" + + "baliance.com/gooxml" +) + +const ST_ContentTypePattern = `^\p{Latin}+/.*$` + +var ST_ContentTypePatternRe = regexp.MustCompile(ST_ContentTypePattern) + +const ST_ExtensionPattern = `([!$&'\(\)\*\+,:=]|(%[0-9a-fA-F][0-9a-fA-F])|[:@]|[a-zA-Z0-9\-_~])+` + +var ST_ExtensionPatternRe = regexp.MustCompile(ST_ExtensionPattern) + +// init registers constructor functions for dynamically creating elements based off the XML namespace and name +func init() { + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/package/2006/content-types", "CT_Types", NewCT_Types) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/package/2006/content-types", "CT_Default", NewCT_Default) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/package/2006/content-types", "CT_Override", NewCT_Override) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/package/2006/content-types", "Types", NewTypes) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/package/2006/content-types", "Default", NewDefault) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/package/2006/content-types", "Override", NewOverride) +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/pkg/metadata/core_properties/CT_CoreProperties.go b/backend/vendor/baliance.com/gooxml/schema/soo/pkg/metadata/core_properties/CT_CoreProperties.go new file mode 100644 index 00000000..083691a4 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/pkg/metadata/core_properties/CT_CoreProperties.go @@ -0,0 +1,226 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package core_properties + +import ( + "encoding/xml" + "time" + + "baliance.com/gooxml" +) + +type CT_CoreProperties struct { + Category *string + ContentStatus *string + Created *gooxml.XSDAny + Creator *gooxml.XSDAny + Description *gooxml.XSDAny + Identifier *gooxml.XSDAny + Keywords *CT_Keywords + Language *gooxml.XSDAny + LastModifiedBy *string + LastPrinted *time.Time + Modified *gooxml.XSDAny + Revision *string + Subject *gooxml.XSDAny + Title *gooxml.XSDAny + Version *string +} + +func NewCT_CoreProperties() *CT_CoreProperties { + ret := &CT_CoreProperties{} + return ret +} + +func (m *CT_CoreProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Category != nil { + secategory := xml.StartElement{Name: xml.Name{Local: "cp:category"}} + gooxml.AddPreserveSpaceAttr(&secategory, *m.Category) + e.EncodeElement(m.Category, secategory) + } + if m.ContentStatus != nil { + secontentStatus := xml.StartElement{Name: xml.Name{Local: "cp:contentStatus"}} + gooxml.AddPreserveSpaceAttr(&secontentStatus, *m.ContentStatus) + e.EncodeElement(m.ContentStatus, secontentStatus) + } + if m.Created != nil { + secreated := xml.StartElement{Name: xml.Name{Local: "dcterms:created"}} + e.EncodeElement(m.Created, secreated) + } + if m.Creator != nil { + secreator := xml.StartElement{Name: xml.Name{Local: "dc:creator"}} + e.EncodeElement(m.Creator, secreator) + } + if m.Description != nil { + sedescription := xml.StartElement{Name: xml.Name{Local: "dc:description"}} + e.EncodeElement(m.Description, sedescription) + } + if m.Identifier != nil { + seidentifier := xml.StartElement{Name: xml.Name{Local: "dc:identifier"}} + e.EncodeElement(m.Identifier, seidentifier) + } + if m.Keywords != nil { + sekeywords := xml.StartElement{Name: xml.Name{Local: "cp:keywords"}} + e.EncodeElement(m.Keywords, sekeywords) + } + if m.Language != nil { + selanguage := xml.StartElement{Name: xml.Name{Local: "dc:language"}} + e.EncodeElement(m.Language, selanguage) + } + if m.LastModifiedBy != nil { + selastModifiedBy := xml.StartElement{Name: xml.Name{Local: "cp:lastModifiedBy"}} + gooxml.AddPreserveSpaceAttr(&selastModifiedBy, *m.LastModifiedBy) + e.EncodeElement(m.LastModifiedBy, selastModifiedBy) + } + if m.LastPrinted != nil { + selastPrinted := xml.StartElement{Name: xml.Name{Local: "cp:lastPrinted"}} + e.EncodeElement(m.LastPrinted, selastPrinted) + } + if m.Modified != nil { + semodified := xml.StartElement{Name: xml.Name{Local: "dcterms:modified"}} + e.EncodeElement(m.Modified, semodified) + } + if m.Revision != nil { + serevision := xml.StartElement{Name: xml.Name{Local: "cp:revision"}} + gooxml.AddPreserveSpaceAttr(&serevision, *m.Revision) + e.EncodeElement(m.Revision, serevision) + } + if m.Subject != nil { + sesubject := xml.StartElement{Name: xml.Name{Local: "dc:subject"}} + e.EncodeElement(m.Subject, sesubject) + } + if m.Title != nil { + setitle := xml.StartElement{Name: xml.Name{Local: "dc:title"}} + e.EncodeElement(m.Title, setitle) + } + if m.Version != nil { + seversion := xml.StartElement{Name: xml.Name{Local: "cp:version"}} + gooxml.AddPreserveSpaceAttr(&seversion, *m.Version) + e.EncodeElement(m.Version, seversion) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_CoreProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_CoreProperties: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/package/2006/metadata/core-properties", Local: "category"}: + m.Category = new(string) + if err := d.DecodeElement(m.Category, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/package/2006/metadata/core-properties", Local: "contentStatus"}: + m.ContentStatus = new(string) + if err := d.DecodeElement(m.ContentStatus, &el); err != nil { + return err + } + case xml.Name{Space: "http://purl.org/dc/terms/", Local: "created"}: + m.Created = new(gooxml.XSDAny) + if err := d.DecodeElement(m.Created, &el); err != nil { + return err + } + case xml.Name{Space: "http://purl.org/dc/elements/1.1/", Local: "creator"}: + m.Creator = new(gooxml.XSDAny) + if err := d.DecodeElement(m.Creator, &el); err != nil { + return err + } + case xml.Name{Space: "http://purl.org/dc/elements/1.1/", Local: "description"}: + m.Description = new(gooxml.XSDAny) + if err := d.DecodeElement(m.Description, &el); err != nil { + return err + } + case xml.Name{Space: "http://purl.org/dc/elements/1.1/", Local: "identifier"}: + m.Identifier = new(gooxml.XSDAny) + if err := d.DecodeElement(m.Identifier, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/package/2006/metadata/core-properties", Local: "keywords"}: + m.Keywords = NewCT_Keywords() + if err := d.DecodeElement(m.Keywords, &el); err != nil { + return err + } + case xml.Name{Space: "http://purl.org/dc/elements/1.1/", Local: "language"}: + m.Language = new(gooxml.XSDAny) + if err := d.DecodeElement(m.Language, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/package/2006/metadata/core-properties", Local: "lastModifiedBy"}: + m.LastModifiedBy = new(string) + if err := d.DecodeElement(m.LastModifiedBy, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/package/2006/metadata/core-properties", Local: "lastPrinted"}: + m.LastPrinted = new(time.Time) + if err := d.DecodeElement(m.LastPrinted, &el); err != nil { + return err + } + case xml.Name{Space: "http://purl.org/dc/terms/", Local: "modified"}: + m.Modified = new(gooxml.XSDAny) + if err := d.DecodeElement(m.Modified, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/package/2006/metadata/core-properties", Local: "revision"}: + m.Revision = new(string) + if err := d.DecodeElement(m.Revision, &el); err != nil { + return err + } + case xml.Name{Space: "http://purl.org/dc/elements/1.1/", Local: "subject"}: + m.Subject = new(gooxml.XSDAny) + if err := d.DecodeElement(m.Subject, &el); err != nil { + return err + } + case xml.Name{Space: "http://purl.org/dc/elements/1.1/", Local: "title"}: + m.Title = new(gooxml.XSDAny) + if err := d.DecodeElement(m.Title, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/package/2006/metadata/core-properties", Local: "version"}: + m.Version = new(string) + if err := d.DecodeElement(m.Version, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_CoreProperties %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_CoreProperties + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_CoreProperties and its children +func (m *CT_CoreProperties) Validate() error { + return m.ValidateWithPath("CT_CoreProperties") +} + +// ValidateWithPath validates the CT_CoreProperties and its children, prefixing error messages with path +func (m *CT_CoreProperties) ValidateWithPath(path string) error { + if m.Keywords != nil { + if err := m.Keywords.ValidateWithPath(path + "/Keywords"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/pkg/metadata/core_properties/CT_Keyword.go b/backend/vendor/baliance.com/gooxml/schema/soo/pkg/metadata/core_properties/CT_Keyword.go new file mode 100644 index 00000000..f0014bf7 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/pkg/metadata/core_properties/CT_Keyword.go @@ -0,0 +1,73 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package core_properties + +import ( + "encoding/xml" + "fmt" +) + +type CT_Keyword struct { + LangAttr *string + Content string +} + +func NewCT_Keyword() *CT_Keyword { + ret := &CT_Keyword{} + return ret +} + +func (m *CT_Keyword) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.LangAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xml:lang"}, + Value: fmt.Sprintf("%v", *m.LangAttr)}) + } + e.EncodeElement(m.Content, start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Keyword) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Space == "http://www.w3.org/XML/1998/namespace" && attr.Name.Local == "lang" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.LangAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Keyword: %s", err) + } + if cd, ok := tok.(xml.CharData); ok { + m.Content = string(cd) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Keyword and its children +func (m *CT_Keyword) Validate() error { + return m.ValidateWithPath("CT_Keyword") +} + +// ValidateWithPath validates the CT_Keyword and its children, prefixing error messages with path +func (m *CT_Keyword) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/pkg/metadata/core_properties/CT_Keywords.go b/backend/vendor/baliance.com/gooxml/schema/soo/pkg/metadata/core_properties/CT_Keywords.go new file mode 100644 index 00000000..d017ae44 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/pkg/metadata/core_properties/CT_Keywords.go @@ -0,0 +1,99 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package core_properties + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_Keywords struct { + LangAttr *string + Value []*CT_Keyword +} + +func NewCT_Keywords() *CT_Keywords { + ret := &CT_Keywords{} + return ret +} + +func (m *CT_Keywords) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.LangAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xml:lang"}, + Value: fmt.Sprintf("%v", *m.LangAttr)}) + } + e.EncodeToken(start) + if m.Value != nil { + sevalue := xml.StartElement{Name: xml.Name{Local: "cp:value"}} + for _, c := range m.Value { + e.EncodeElement(c, sevalue) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Keywords) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Space == "http://www.w3.org/XML/1998/namespace" && attr.Name.Local == "lang" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.LangAttr = &parsed + continue + } + } +lCT_Keywords: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/package/2006/metadata/core-properties", Local: "value"}: + tmp := NewCT_Keyword() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Value = append(m.Value, tmp) + default: + gooxml.Log("skipping unsupported element on CT_Keywords %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Keywords + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Keywords and its children +func (m *CT_Keywords) Validate() error { + return m.ValidateWithPath("CT_Keywords") +} + +// ValidateWithPath validates the CT_Keywords and its children, prefixing error messages with path +func (m *CT_Keywords) ValidateWithPath(path string) error { + for i, v := range m.Value { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Value[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/pkg/metadata/core_properties/CoreProperties.go b/backend/vendor/baliance.com/gooxml/schema/soo/pkg/metadata/core_properties/CoreProperties.go new file mode 100644 index 00000000..0d13af1a --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/pkg/metadata/core_properties/CoreProperties.go @@ -0,0 +1,151 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package core_properties + +import ( + "encoding/xml" + "time" + + "baliance.com/gooxml" +) + +type CoreProperties struct { + CT_CoreProperties +} + +func NewCoreProperties() *CoreProperties { + ret := &CoreProperties{} + ret.CT_CoreProperties = *NewCT_CoreProperties() + return ret +} + +func (m *CoreProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns"}, Value: "http://schemas.openxmlformats.org/package/2006/metadata/core-properties"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:cp"}, Value: "http://schemas.openxmlformats.org/package/2006/metadata/core-properties"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:dc"}, Value: "http://purl.org/dc/elements/1.1/"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:dcterms"}, Value: "http://purl.org/dc/terms/"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:xml"}, Value: "http://www.w3.org/XML/1998/namespace"}) + start.Name.Local = "cp:coreProperties" + return m.CT_CoreProperties.MarshalXML(e, start) +} + +func (m *CoreProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CT_CoreProperties = *NewCT_CoreProperties() +lCoreProperties: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/package/2006/metadata/core-properties", Local: "category"}: + m.Category = new(string) + if err := d.DecodeElement(m.Category, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/package/2006/metadata/core-properties", Local: "contentStatus"}: + m.ContentStatus = new(string) + if err := d.DecodeElement(m.ContentStatus, &el); err != nil { + return err + } + case xml.Name{Space: "http://purl.org/dc/terms/", Local: "created"}: + m.Created = new(gooxml.XSDAny) + if err := d.DecodeElement(m.Created, &el); err != nil { + return err + } + case xml.Name{Space: "http://purl.org/dc/elements/1.1/", Local: "creator"}: + m.Creator = new(gooxml.XSDAny) + if err := d.DecodeElement(m.Creator, &el); err != nil { + return err + } + case xml.Name{Space: "http://purl.org/dc/elements/1.1/", Local: "description"}: + m.Description = new(gooxml.XSDAny) + if err := d.DecodeElement(m.Description, &el); err != nil { + return err + } + case xml.Name{Space: "http://purl.org/dc/elements/1.1/", Local: "identifier"}: + m.Identifier = new(gooxml.XSDAny) + if err := d.DecodeElement(m.Identifier, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/package/2006/metadata/core-properties", Local: "keywords"}: + m.Keywords = NewCT_Keywords() + if err := d.DecodeElement(m.Keywords, &el); err != nil { + return err + } + case xml.Name{Space: "http://purl.org/dc/elements/1.1/", Local: "language"}: + m.Language = new(gooxml.XSDAny) + if err := d.DecodeElement(m.Language, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/package/2006/metadata/core-properties", Local: "lastModifiedBy"}: + m.LastModifiedBy = new(string) + if err := d.DecodeElement(m.LastModifiedBy, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/package/2006/metadata/core-properties", Local: "lastPrinted"}: + m.LastPrinted = new(time.Time) + if err := d.DecodeElement(m.LastPrinted, &el); err != nil { + return err + } + case xml.Name{Space: "http://purl.org/dc/terms/", Local: "modified"}: + m.Modified = new(gooxml.XSDAny) + if err := d.DecodeElement(m.Modified, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/package/2006/metadata/core-properties", Local: "revision"}: + m.Revision = new(string) + if err := d.DecodeElement(m.Revision, &el); err != nil { + return err + } + case xml.Name{Space: "http://purl.org/dc/elements/1.1/", Local: "subject"}: + m.Subject = new(gooxml.XSDAny) + if err := d.DecodeElement(m.Subject, &el); err != nil { + return err + } + case xml.Name{Space: "http://purl.org/dc/elements/1.1/", Local: "title"}: + m.Title = new(gooxml.XSDAny) + if err := d.DecodeElement(m.Title, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/package/2006/metadata/core-properties", Local: "version"}: + m.Version = new(string) + if err := d.DecodeElement(m.Version, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CoreProperties %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCoreProperties + case xml.CharData: + } + } + return nil +} + +// Validate validates the CoreProperties and its children +func (m *CoreProperties) Validate() error { + return m.ValidateWithPath("CoreProperties") +} + +// ValidateWithPath validates the CoreProperties and its children, prefixing error messages with path +func (m *CoreProperties) ValidateWithPath(path string) error { + if err := m.CT_CoreProperties.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/pkg/metadata/core_properties/common.go b/backend/vendor/baliance.com/gooxml/schema/soo/pkg/metadata/core_properties/common.go new file mode 100644 index 00000000..2a9599de --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/pkg/metadata/core_properties/common.go @@ -0,0 +1,20 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package core_properties + +import "baliance.com/gooxml" + +// init registers constructor functions for dynamically creating elements based off the XML namespace and name +func init() { + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/package/2006/metadata/core-properties", "CT_CoreProperties", NewCT_CoreProperties) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/package/2006/metadata/core-properties", "CT_Keywords", NewCT_Keywords) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/package/2006/metadata/core-properties", "CT_Keyword", NewCT_Keyword) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/package/2006/metadata/core-properties", "coreProperties", NewCoreProperties) +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/pkg/relationships/CT_Relationship.go b/backend/vendor/baliance.com/gooxml/schema/soo/pkg/relationships/CT_Relationship.go new file mode 100644 index 00000000..499b7373 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/pkg/relationships/CT_Relationship.go @@ -0,0 +1,108 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package relationships + +import ( + "encoding/xml" + "fmt" +) + +type CT_Relationship struct { + TargetModeAttr ST_TargetMode + TargetAttr string + TypeAttr string + IdAttr string + Content string +} + +func NewCT_Relationship() *CT_Relationship { + ret := &CT_Relationship{} + return ret +} + +func (m *CT_Relationship) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.TargetModeAttr != ST_TargetModeUnset { + attr, err := m.TargetModeAttr.MarshalXMLAttr(xml.Name{Local: "TargetMode"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "Target"}, + Value: fmt.Sprintf("%v", m.TargetAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "Type"}, + Value: fmt.Sprintf("%v", m.TypeAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "Id"}, + Value: fmt.Sprintf("%v", m.IdAttr)}) + e.EncodeElement(m.Content, start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Relationship) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "TargetMode" { + m.TargetModeAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "Target" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.TargetAttr = parsed + continue + } + if attr.Name.Local == "Type" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.TypeAttr = parsed + continue + } + if attr.Name.Local == "Id" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.IdAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Relationship: %s", err) + } + if cd, ok := tok.(xml.CharData); ok { + m.Content = string(cd) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Relationship and its children +func (m *CT_Relationship) Validate() error { + return m.ValidateWithPath("CT_Relationship") +} + +// ValidateWithPath validates the CT_Relationship and its children, prefixing error messages with path +func (m *CT_Relationship) ValidateWithPath(path string) error { + if err := m.TargetModeAttr.ValidateWithPath(path + "/TargetModeAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/pkg/relationships/CT_Relationships.go b/backend/vendor/baliance.com/gooxml/schema/soo/pkg/relationships/CT_Relationships.go new file mode 100644 index 00000000..5c81492e --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/pkg/relationships/CT_Relationships.go @@ -0,0 +1,84 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package relationships + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_Relationships struct { + Relationship []*Relationship +} + +func NewCT_Relationships() *CT_Relationships { + ret := &CT_Relationships{} + return ret +} + +func (m *CT_Relationships) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Relationship != nil { + seRelationship := xml.StartElement{Name: xml.Name{Local: "Relationship"}} + for _, c := range m.Relationship { + e.EncodeElement(c, seRelationship) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Relationships) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_Relationships: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/package/2006/relationships", Local: "Relationship"}: + tmp := NewRelationship() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Relationship = append(m.Relationship, tmp) + default: + gooxml.Log("skipping unsupported element on CT_Relationships %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Relationships + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Relationships and its children +func (m *CT_Relationships) Validate() error { + return m.ValidateWithPath("CT_Relationships") +} + +// ValidateWithPath validates the CT_Relationships and its children, prefixing error messages with path +func (m *CT_Relationships) ValidateWithPath(path string) error { + for i, v := range m.Relationship { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Relationship[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/pkg/relationships/Relationship.go b/backend/vendor/baliance.com/gooxml/schema/soo/pkg/relationships/Relationship.go new file mode 100644 index 00000000..c0d658ae --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/pkg/relationships/Relationship.go @@ -0,0 +1,88 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package relationships + +import ( + "encoding/xml" + "fmt" +) + +type Relationship struct { + CT_Relationship +} + +func NewRelationship() *Relationship { + ret := &Relationship{} + ret.CT_Relationship = *NewCT_Relationship() + return ret +} + +func (m *Relationship) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return m.CT_Relationship.MarshalXML(e, start) +} + +func (m *Relationship) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CT_Relationship = *NewCT_Relationship() + for _, attr := range start.Attr { + if attr.Name.Local == "TargetMode" { + m.TargetModeAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "Target" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.TargetAttr = parsed + continue + } + if attr.Name.Local == "Type" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.TypeAttr = parsed + continue + } + if attr.Name.Local == "Id" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.IdAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing Relationship: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the Relationship and its children +func (m *Relationship) Validate() error { + return m.ValidateWithPath("Relationship") +} + +// ValidateWithPath validates the Relationship and its children, prefixing error messages with path +func (m *Relationship) ValidateWithPath(path string) error { + if err := m.CT_Relationship.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/pkg/relationships/Relationships.go b/backend/vendor/baliance.com/gooxml/schema/soo/pkg/relationships/Relationships.go new file mode 100644 index 00000000..1b0daed4 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/pkg/relationships/Relationships.go @@ -0,0 +1,78 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package relationships + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type Relationships struct { + CT_Relationships +} + +func NewRelationships() *Relationships { + ret := &Relationships{} + ret.CT_Relationships = *NewCT_Relationships() + return ret +} + +func (m *Relationships) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns"}, Value: "http://schemas.openxmlformats.org/package/2006/relationships"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:xml"}, Value: "http://www.w3.org/XML/1998/namespace"}) + start.Name.Local = "Relationships" + return m.CT_Relationships.MarshalXML(e, start) +} + +func (m *Relationships) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CT_Relationships = *NewCT_Relationships() +lRelationships: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/package/2006/relationships", Local: "Relationship"}: + tmp := NewRelationship() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Relationship = append(m.Relationship, tmp) + default: + gooxml.Log("skipping unsupported element on Relationships %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lRelationships + case xml.CharData: + } + } + return nil +} + +// Validate validates the Relationships and its children +func (m *Relationships) Validate() error { + return m.ValidateWithPath("Relationships") +} + +// ValidateWithPath validates the Relationships and its children, prefixing error messages with path +func (m *Relationships) ValidateWithPath(path string) error { + if err := m.CT_Relationships.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/pkg/relationships/common.go b/backend/vendor/baliance.com/gooxml/schema/soo/pkg/relationships/common.go new file mode 100644 index 00000000..fd2aed77 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/pkg/relationships/common.go @@ -0,0 +1,119 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package relationships + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type ST_TargetMode byte + +const ( + ST_TargetModeUnset ST_TargetMode = 0 + ST_TargetModeExternal ST_TargetMode = 1 + ST_TargetModeInternal ST_TargetMode = 2 +) + +func (e ST_TargetMode) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_TargetModeUnset: + attr.Value = "" + case ST_TargetModeExternal: + attr.Value = "External" + case ST_TargetModeInternal: + attr.Value = "Internal" + } + return attr, nil +} + +func (e *ST_TargetMode) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "External": + *e = 1 + case "Internal": + *e = 2 + } + return nil +} + +func (m ST_TargetMode) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_TargetMode) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "External": + *m = 1 + case "Internal": + *m = 2 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_TargetMode) String() string { + switch m { + case 0: + return "" + case 1: + return "External" + case 2: + return "Internal" + } + return "" +} + +func (m ST_TargetMode) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_TargetMode) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +// init registers constructor functions for dynamically creating elements based off the XML namespace and name +func init() { + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/package/2006/relationships", "CT_Relationships", NewCT_Relationships) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/package/2006/relationships", "CT_Relationship", NewCT_Relationship) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/package/2006/relationships", "Relationships", NewRelationships) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/package/2006/relationships", "Relationship", NewRelationship) +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/schemaLibrary/CT_Schema.go b/backend/vendor/baliance.com/gooxml/schema/soo/schemaLibrary/CT_Schema.go new file mode 100644 index 00000000..29a634fe --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/schemaLibrary/CT_Schema.go @@ -0,0 +1,108 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package schemaLibrary + +import ( + "encoding/xml" + "fmt" +) + +type CT_Schema struct { + UriAttr *string + ManifestLocationAttr *string + SchemaLocationAttr *string + SchemaLanguageAttr *string +} + +func NewCT_Schema() *CT_Schema { + ret := &CT_Schema{} + return ret +} + +func (m *CT_Schema) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.UriAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "ma:uri"}, + Value: fmt.Sprintf("%v", *m.UriAttr)}) + } + if m.ManifestLocationAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "ma:manifestLocation"}, + Value: fmt.Sprintf("%v", *m.ManifestLocationAttr)}) + } + if m.SchemaLocationAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "ma:schemaLocation"}, + Value: fmt.Sprintf("%v", *m.SchemaLocationAttr)}) + } + if m.SchemaLanguageAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "ma:schemaLanguage"}, + Value: fmt.Sprintf("%v", *m.SchemaLanguageAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Schema) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "uri" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.UriAttr = &parsed + continue + } + if attr.Name.Local == "manifestLocation" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ManifestLocationAttr = &parsed + continue + } + if attr.Name.Local == "schemaLocation" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.SchemaLocationAttr = &parsed + continue + } + if attr.Name.Local == "schemaLanguage" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.SchemaLanguageAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Schema: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Schema and its children +func (m *CT_Schema) Validate() error { + return m.ValidateWithPath("CT_Schema") +} + +// ValidateWithPath validates the CT_Schema and its children, prefixing error messages with path +func (m *CT_Schema) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/schemaLibrary/CT_SchemaLibrary.go b/backend/vendor/baliance.com/gooxml/schema/soo/schemaLibrary/CT_SchemaLibrary.go new file mode 100644 index 00000000..0b61d59a --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/schemaLibrary/CT_SchemaLibrary.go @@ -0,0 +1,84 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package schemaLibrary + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_SchemaLibrary struct { + Schema []*CT_Schema +} + +func NewCT_SchemaLibrary() *CT_SchemaLibrary { + ret := &CT_SchemaLibrary{} + return ret +} + +func (m *CT_SchemaLibrary) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Schema != nil { + seschema := xml.StartElement{Name: xml.Name{Local: "ma:schema"}} + for _, c := range m.Schema { + e.EncodeElement(c, seschema) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SchemaLibrary) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_SchemaLibrary: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/schemaLibrary/2006/main", Local: "schema"}: + tmp := NewCT_Schema() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Schema = append(m.Schema, tmp) + default: + gooxml.Log("skipping unsupported element on CT_SchemaLibrary %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_SchemaLibrary + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_SchemaLibrary and its children +func (m *CT_SchemaLibrary) Validate() error { + return m.ValidateWithPath("CT_SchemaLibrary") +} + +// ValidateWithPath validates the CT_SchemaLibrary and its children, prefixing error messages with path +func (m *CT_SchemaLibrary) ValidateWithPath(path string) error { + for i, v := range m.Schema { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Schema[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/schemaLibrary/SchemaLibrary.go b/backend/vendor/baliance.com/gooxml/schema/soo/schemaLibrary/SchemaLibrary.go new file mode 100644 index 00000000..954fd986 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/schemaLibrary/SchemaLibrary.go @@ -0,0 +1,79 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package schemaLibrary + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type SchemaLibrary struct { + CT_SchemaLibrary +} + +func NewSchemaLibrary() *SchemaLibrary { + ret := &SchemaLibrary{} + ret.CT_SchemaLibrary = *NewCT_SchemaLibrary() + return ret +} + +func (m *SchemaLibrary) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns"}, Value: "http://schemas.openxmlformats.org/schemaLibrary/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:ma"}, Value: "http://schemas.openxmlformats.org/schemaLibrary/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:xml"}, Value: "http://www.w3.org/XML/1998/namespace"}) + start.Name.Local = "ma:schemaLibrary" + return m.CT_SchemaLibrary.MarshalXML(e, start) +} + +func (m *SchemaLibrary) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CT_SchemaLibrary = *NewCT_SchemaLibrary() +lSchemaLibrary: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/schemaLibrary/2006/main", Local: "schema"}: + tmp := NewCT_Schema() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Schema = append(m.Schema, tmp) + default: + gooxml.Log("skipping unsupported element on SchemaLibrary %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lSchemaLibrary + case xml.CharData: + } + } + return nil +} + +// Validate validates the SchemaLibrary and its children +func (m *SchemaLibrary) Validate() error { + return m.ValidateWithPath("SchemaLibrary") +} + +// ValidateWithPath validates the SchemaLibrary and its children, prefixing error messages with path +func (m *SchemaLibrary) ValidateWithPath(path string) error { + if err := m.CT_SchemaLibrary.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/schemaLibrary/common.go b/backend/vendor/baliance.com/gooxml/schema/soo/schemaLibrary/common.go new file mode 100644 index 00000000..ad401fbd --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/schemaLibrary/common.go @@ -0,0 +1,19 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package schemaLibrary + +import "baliance.com/gooxml" + +// init registers constructor functions for dynamically creating elements based off the XML namespace and name +func init() { + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/schemaLibrary/2006/main", "CT_Schema", NewCT_Schema) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/schemaLibrary/2006/main", "CT_SchemaLibrary", NewCT_SchemaLibrary) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/schemaLibrary/2006/main", "schemaLibrary", NewSchemaLibrary) +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/AG_Password.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/AG_Password.go new file mode 100644 index 00000000..11dd91d9 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/AG_Password.go @@ -0,0 +1,107 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" +) + +type AG_Password struct { + AlgorithmNameAttr *string + HashValueAttr *string + SaltValueAttr *string + SpinCountAttr *int64 +} + +func NewAG_Password() *AG_Password { + ret := &AG_Password{} + return ret +} + +func (m *AG_Password) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.AlgorithmNameAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:algorithmName"}, + Value: fmt.Sprintf("%v", *m.AlgorithmNameAttr)}) + } + if m.HashValueAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:hashValue"}, + Value: fmt.Sprintf("%v", *m.HashValueAttr)}) + } + if m.SaltValueAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:saltValue"}, + Value: fmt.Sprintf("%v", *m.SaltValueAttr)}) + } + if m.SpinCountAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:spinCount"}, + Value: fmt.Sprintf("%v", *m.SpinCountAttr)}) + } + return nil +} + +func (m *AG_Password) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "algorithmName" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.AlgorithmNameAttr = &parsed + continue + } + if attr.Name.Local == "hashValue" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.HashValueAttr = &parsed + continue + } + if attr.Name.Local == "saltValue" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.SaltValueAttr = &parsed + continue + } + if attr.Name.Local == "spinCount" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.SpinCountAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing AG_Password: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the AG_Password and its children +func (m *AG_Password) Validate() error { + return m.ValidateWithPath("AG_Password") +} + +// ValidateWithPath validates the AG_Password and its children, prefixing error messages with path +func (m *AG_Password) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/AG_SectPrAttributes.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/AG_SectPrAttributes.go new file mode 100644 index 00000000..a4b36fa4 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/AG_SectPrAttributes.go @@ -0,0 +1,106 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type AG_SectPrAttributes struct { + RsidRPrAttr *string + RsidDelAttr *string + RsidRAttr *string + RsidSectAttr *string +} + +func NewAG_SectPrAttributes() *AG_SectPrAttributes { + ret := &AG_SectPrAttributes{} + return ret +} + +func (m *AG_SectPrAttributes) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.RsidRPrAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:rsidRPr"}, + Value: fmt.Sprintf("%v", *m.RsidRPrAttr)}) + } + if m.RsidDelAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:rsidDel"}, + Value: fmt.Sprintf("%v", *m.RsidDelAttr)}) + } + if m.RsidRAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:rsidR"}, + Value: fmt.Sprintf("%v", *m.RsidRAttr)}) + } + if m.RsidSectAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:rsidSect"}, + Value: fmt.Sprintf("%v", *m.RsidSectAttr)}) + } + return nil +} + +func (m *AG_SectPrAttributes) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "rsidRPr" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.RsidRPrAttr = &parsed + continue + } + if attr.Name.Local == "rsidDel" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.RsidDelAttr = &parsed + continue + } + if attr.Name.Local == "rsidR" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.RsidRAttr = &parsed + continue + } + if attr.Name.Local == "rsidSect" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.RsidSectAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing AG_SectPrAttributes: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the AG_SectPrAttributes and its children +func (m *AG_SectPrAttributes) Validate() error { + return m.ValidateWithPath("AG_SectPrAttributes") +} + +// ValidateWithPath validates the AG_SectPrAttributes and its children, prefixing error messages with path +func (m *AG_SectPrAttributes) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/AG_TransitionalPassword.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/AG_TransitionalPassword.go new file mode 100644 index 00000000..383a5575 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/AG_TransitionalPassword.go @@ -0,0 +1,219 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type AG_TransitionalPassword struct { + CryptProviderTypeAttr sharedTypes.ST_CryptProv + CryptAlgorithmClassAttr sharedTypes.ST_AlgClass + CryptAlgorithmTypeAttr sharedTypes.ST_AlgType + CryptAlgorithmSidAttr *int64 + CryptSpinCountAttr *int64 + CryptProviderAttr *string + AlgIdExtAttr *string + AlgIdExtSourceAttr *string + CryptProviderTypeExtAttr *string + CryptProviderTypeExtSourceAttr *string + HashAttr *string + SaltAttr *string +} + +func NewAG_TransitionalPassword() *AG_TransitionalPassword { + ret := &AG_TransitionalPassword{} + return ret +} + +func (m *AG_TransitionalPassword) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.CryptProviderTypeAttr != sharedTypes.ST_CryptProvUnset { + attr, err := m.CryptProviderTypeAttr.MarshalXMLAttr(xml.Name{Local: "w:cryptProviderType"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.CryptAlgorithmClassAttr != sharedTypes.ST_AlgClassUnset { + attr, err := m.CryptAlgorithmClassAttr.MarshalXMLAttr(xml.Name{Local: "w:cryptAlgorithmClass"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.CryptAlgorithmTypeAttr != sharedTypes.ST_AlgTypeUnset { + attr, err := m.CryptAlgorithmTypeAttr.MarshalXMLAttr(xml.Name{Local: "w:cryptAlgorithmType"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.CryptAlgorithmSidAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:cryptAlgorithmSid"}, + Value: fmt.Sprintf("%v", *m.CryptAlgorithmSidAttr)}) + } + if m.CryptSpinCountAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:cryptSpinCount"}, + Value: fmt.Sprintf("%v", *m.CryptSpinCountAttr)}) + } + if m.CryptProviderAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:cryptProvider"}, + Value: fmt.Sprintf("%v", *m.CryptProviderAttr)}) + } + if m.AlgIdExtAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:algIdExt"}, + Value: fmt.Sprintf("%v", *m.AlgIdExtAttr)}) + } + if m.AlgIdExtSourceAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:algIdExtSource"}, + Value: fmt.Sprintf("%v", *m.AlgIdExtSourceAttr)}) + } + if m.CryptProviderTypeExtAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:cryptProviderTypeExt"}, + Value: fmt.Sprintf("%v", *m.CryptProviderTypeExtAttr)}) + } + if m.CryptProviderTypeExtSourceAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:cryptProviderTypeExtSource"}, + Value: fmt.Sprintf("%v", *m.CryptProviderTypeExtSourceAttr)}) + } + if m.HashAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:hash"}, + Value: fmt.Sprintf("%v", *m.HashAttr)}) + } + if m.SaltAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:salt"}, + Value: fmt.Sprintf("%v", *m.SaltAttr)}) + } + return nil +} + +func (m *AG_TransitionalPassword) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "cryptProviderType" { + m.CryptProviderTypeAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "cryptAlgorithmClass" { + m.CryptAlgorithmClassAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "cryptAlgorithmType" { + m.CryptAlgorithmTypeAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "cryptAlgorithmSid" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.CryptAlgorithmSidAttr = &parsed + continue + } + if attr.Name.Local == "cryptSpinCount" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.CryptSpinCountAttr = &parsed + continue + } + if attr.Name.Local == "cryptProvider" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.CryptProviderAttr = &parsed + continue + } + if attr.Name.Local == "algIdExt" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.AlgIdExtAttr = &parsed + continue + } + if attr.Name.Local == "algIdExtSource" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.AlgIdExtSourceAttr = &parsed + continue + } + if attr.Name.Local == "cryptProviderTypeExt" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.CryptProviderTypeExtAttr = &parsed + continue + } + if attr.Name.Local == "cryptProviderTypeExtSource" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.CryptProviderTypeExtSourceAttr = &parsed + continue + } + if attr.Name.Local == "hash" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.HashAttr = &parsed + continue + } + if attr.Name.Local == "salt" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.SaltAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing AG_TransitionalPassword: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the AG_TransitionalPassword and its children +func (m *AG_TransitionalPassword) Validate() error { + return m.ValidateWithPath("AG_TransitionalPassword") +} + +// ValidateWithPath validates the AG_TransitionalPassword and its children, prefixing error messages with path +func (m *AG_TransitionalPassword) ValidateWithPath(path string) error { + if err := m.CryptProviderTypeAttr.ValidateWithPath(path + "/CryptProviderTypeAttr"); err != nil { + return err + } + if err := m.CryptAlgorithmClassAttr.ValidateWithPath(path + "/CryptAlgorithmClassAttr"); err != nil { + return err + } + if err := m.CryptAlgorithmTypeAttr.ValidateWithPath(path + "/CryptAlgorithmTypeAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_AbstractNum.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_AbstractNum.go new file mode 100644 index 00000000..1b02d1a6 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_AbstractNum.go @@ -0,0 +1,196 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type CT_AbstractNum struct { + // Abstract Numbering Definition ID + AbstractNumIdAttr int64 + // Abstract Numbering Definition Identifier + Nsid *CT_LongHexNumber + // Abstract Numbering Definition Type + MultiLevelType *CT_MultiLevelType + // Numbering Template Code + Tmpl *CT_LongHexNumber + // Abstract Numbering Definition Name + Name *CT_String + // Numbering Style Definition + StyleLink *CT_String + // Numbering Style Reference + NumStyleLink *CT_String + // Numbering Level Definition + Lvl []*CT_Lvl +} + +func NewCT_AbstractNum() *CT_AbstractNum { + ret := &CT_AbstractNum{} + return ret +} + +func (m *CT_AbstractNum) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:abstractNumId"}, + Value: fmt.Sprintf("%v", m.AbstractNumIdAttr)}) + e.EncodeToken(start) + if m.Nsid != nil { + sensid := xml.StartElement{Name: xml.Name{Local: "w:nsid"}} + e.EncodeElement(m.Nsid, sensid) + } + if m.MultiLevelType != nil { + semultiLevelType := xml.StartElement{Name: xml.Name{Local: "w:multiLevelType"}} + e.EncodeElement(m.MultiLevelType, semultiLevelType) + } + if m.Tmpl != nil { + setmpl := xml.StartElement{Name: xml.Name{Local: "w:tmpl"}} + e.EncodeElement(m.Tmpl, setmpl) + } + if m.Name != nil { + sename := xml.StartElement{Name: xml.Name{Local: "w:name"}} + e.EncodeElement(m.Name, sename) + } + if m.StyleLink != nil { + sestyleLink := xml.StartElement{Name: xml.Name{Local: "w:styleLink"}} + e.EncodeElement(m.StyleLink, sestyleLink) + } + if m.NumStyleLink != nil { + senumStyleLink := xml.StartElement{Name: xml.Name{Local: "w:numStyleLink"}} + e.EncodeElement(m.NumStyleLink, senumStyleLink) + } + if m.Lvl != nil { + selvl := xml.StartElement{Name: xml.Name{Local: "w:lvl"}} + for _, c := range m.Lvl { + e.EncodeElement(c, selvl) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_AbstractNum) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "abstractNumId" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.AbstractNumIdAttr = parsed + continue + } + } +lCT_AbstractNum: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "nsid"}: + m.Nsid = NewCT_LongHexNumber() + if err := d.DecodeElement(m.Nsid, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "multiLevelType"}: + m.MultiLevelType = NewCT_MultiLevelType() + if err := d.DecodeElement(m.MultiLevelType, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tmpl"}: + m.Tmpl = NewCT_LongHexNumber() + if err := d.DecodeElement(m.Tmpl, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "name"}: + m.Name = NewCT_String() + if err := d.DecodeElement(m.Name, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "styleLink"}: + m.StyleLink = NewCT_String() + if err := d.DecodeElement(m.StyleLink, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "numStyleLink"}: + m.NumStyleLink = NewCT_String() + if err := d.DecodeElement(m.NumStyleLink, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "lvl"}: + tmp := NewCT_Lvl() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Lvl = append(m.Lvl, tmp) + default: + gooxml.Log("skipping unsupported element on CT_AbstractNum %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_AbstractNum + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_AbstractNum and its children +func (m *CT_AbstractNum) Validate() error { + return m.ValidateWithPath("CT_AbstractNum") +} + +// ValidateWithPath validates the CT_AbstractNum and its children, prefixing error messages with path +func (m *CT_AbstractNum) ValidateWithPath(path string) error { + if m.Nsid != nil { + if err := m.Nsid.ValidateWithPath(path + "/Nsid"); err != nil { + return err + } + } + if m.MultiLevelType != nil { + if err := m.MultiLevelType.ValidateWithPath(path + "/MultiLevelType"); err != nil { + return err + } + } + if m.Tmpl != nil { + if err := m.Tmpl.ValidateWithPath(path + "/Tmpl"); err != nil { + return err + } + } + if m.Name != nil { + if err := m.Name.ValidateWithPath(path + "/Name"); err != nil { + return err + } + } + if m.StyleLink != nil { + if err := m.StyleLink.ValidateWithPath(path + "/StyleLink"); err != nil { + return err + } + } + if m.NumStyleLink != nil { + if err := m.NumStyleLink.ValidateWithPath(path + "/NumStyleLink"); err != nil { + return err + } + } + for i, v := range m.Lvl { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Lvl[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_AltChunk.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_AltChunk.go new file mode 100644 index 00000000..a57f21b6 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_AltChunk.go @@ -0,0 +1,97 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_AltChunk struct { + IdAttr *string + // External Content Import Properties + AltChunkPr *CT_AltChunkPr +} + +func NewCT_AltChunk() *CT_AltChunk { + ret := &CT_AltChunk{} + return ret +} + +func (m *CT_AltChunk) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.IdAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "r:id"}, + Value: fmt.Sprintf("%v", *m.IdAttr)}) + } + e.EncodeToken(start) + if m.AltChunkPr != nil { + sealtChunkPr := xml.StartElement{Name: xml.Name{Local: "w:altChunkPr"}} + e.EncodeElement(m.AltChunkPr, sealtChunkPr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_AltChunk) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Space == "http://schemas.openxmlformats.org/officeDocument/2006/relationships" && attr.Name.Local == "id" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.IdAttr = &parsed + continue + } + } +lCT_AltChunk: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "altChunkPr"}: + m.AltChunkPr = NewCT_AltChunkPr() + if err := d.DecodeElement(m.AltChunkPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_AltChunk %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_AltChunk + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_AltChunk and its children +func (m *CT_AltChunk) Validate() error { + return m.ValidateWithPath("CT_AltChunk") +} + +// ValidateWithPath validates the CT_AltChunk and its children, prefixing error messages with path +func (m *CT_AltChunk) ValidateWithPath(path string) error { + if m.AltChunkPr != nil { + if err := m.AltChunkPr.ValidateWithPath(path + "/AltChunkPr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_AltChunkPr.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_AltChunkPr.go new file mode 100644 index 00000000..178ea439 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_AltChunkPr.go @@ -0,0 +1,81 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_AltChunkPr struct { + // Keep Source Formatting on Import + MatchSrc *CT_OnOff +} + +func NewCT_AltChunkPr() *CT_AltChunkPr { + ret := &CT_AltChunkPr{} + return ret +} + +func (m *CT_AltChunkPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.MatchSrc != nil { + sematchSrc := xml.StartElement{Name: xml.Name{Local: "w:matchSrc"}} + e.EncodeElement(m.MatchSrc, sematchSrc) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_AltChunkPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_AltChunkPr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "matchSrc"}: + m.MatchSrc = NewCT_OnOff() + if err := d.DecodeElement(m.MatchSrc, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_AltChunkPr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_AltChunkPr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_AltChunkPr and its children +func (m *CT_AltChunkPr) Validate() error { + return m.ValidateWithPath("CT_AltChunkPr") +} + +// ValidateWithPath validates the CT_AltChunkPr and its children, prefixing error messages with path +func (m *CT_AltChunkPr) ValidateWithPath(path string) error { + if m.MatchSrc != nil { + if err := m.MatchSrc.ValidateWithPath(path + "/MatchSrc"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Attr.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Attr.go new file mode 100644 index 00000000..eca95387 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Attr.go @@ -0,0 +1,94 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_Attr struct { + // Namespace + UriAttr *string + // Name + NameAttr string + // Value + ValAttr string +} + +func NewCT_Attr() *CT_Attr { + ret := &CT_Attr{} + return ret +} + +func (m *CT_Attr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.UriAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:uri"}, + Value: fmt.Sprintf("%v", *m.UriAttr)}) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:name"}, + Value: fmt.Sprintf("%v", m.NameAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:val"}, + Value: fmt.Sprintf("%v", m.ValAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Attr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "uri" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.UriAttr = &parsed + continue + } + if attr.Name.Local == "name" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.NameAttr = parsed + continue + } + if attr.Name.Local == "val" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ValAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Attr: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Attr and its children +func (m *CT_Attr) Validate() error { + return m.ValidateWithPath("CT_Attr") +} + +// ValidateWithPath validates the CT_Attr and its children, prefixing error messages with path +func (m *CT_Attr) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_AutoCaption.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_AutoCaption.go new file mode 100644 index 00000000..43859c40 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_AutoCaption.go @@ -0,0 +1,80 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_AutoCaption struct { + // Identifier of Object to be Automatically Captioned + NameAttr string + // Caption Used for Automatic Captioning + CaptionAttr string +} + +func NewCT_AutoCaption() *CT_AutoCaption { + ret := &CT_AutoCaption{} + return ret +} + +func (m *CT_AutoCaption) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:name"}, + Value: fmt.Sprintf("%v", m.NameAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:caption"}, + Value: fmt.Sprintf("%v", m.CaptionAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_AutoCaption) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "name" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.NameAttr = parsed + continue + } + if attr.Name.Local == "caption" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.CaptionAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_AutoCaption: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_AutoCaption and its children +func (m *CT_AutoCaption) Validate() error { + return m.ValidateWithPath("CT_AutoCaption") +} + +// ValidateWithPath validates the CT_AutoCaption and its children, prefixing error messages with path +func (m *CT_AutoCaption) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_AutoCaptions.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_AutoCaptions.go new file mode 100644 index 00000000..02d99c2e --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_AutoCaptions.go @@ -0,0 +1,83 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_AutoCaptions struct { + // Single Automatic Captioning Setting + AutoCaption []*CT_AutoCaption +} + +func NewCT_AutoCaptions() *CT_AutoCaptions { + ret := &CT_AutoCaptions{} + return ret +} + +func (m *CT_AutoCaptions) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + seautoCaption := xml.StartElement{Name: xml.Name{Local: "w:autoCaption"}} + for _, c := range m.AutoCaption { + e.EncodeElement(c, seautoCaption) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_AutoCaptions) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_AutoCaptions: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "autoCaption"}: + tmp := NewCT_AutoCaption() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.AutoCaption = append(m.AutoCaption, tmp) + default: + gooxml.Log("skipping unsupported element on CT_AutoCaptions %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_AutoCaptions + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_AutoCaptions and its children +func (m *CT_AutoCaptions) Validate() error { + return m.ValidateWithPath("CT_AutoCaptions") +} + +// ValidateWithPath validates the CT_AutoCaptions and its children, prefixing error messages with path +func (m *CT_AutoCaptions) ValidateWithPath(path string) error { + for i, v := range m.AutoCaption { + if err := v.ValidateWithPath(fmt.Sprintf("%s/AutoCaption[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Background.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Background.go new file mode 100644 index 00000000..4cf8e2b8 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Background.go @@ -0,0 +1,146 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_Background struct { + // Background Color + ColorAttr *ST_HexColor + // Background Theme Color + ThemeColorAttr ST_ThemeColor + // Background Theme Color Tint + ThemeTintAttr *string + // Background Theme Color Shade + ThemeShadeAttr *string + Drawing *CT_Drawing +} + +func NewCT_Background() *CT_Background { + ret := &CT_Background{} + return ret +} + +func (m *CT_Background) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.ColorAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:color"}, + Value: fmt.Sprintf("%v", *m.ColorAttr)}) + } + if m.ThemeColorAttr != ST_ThemeColorUnset { + attr, err := m.ThemeColorAttr.MarshalXMLAttr(xml.Name{Local: "w:themeColor"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.ThemeTintAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:themeTint"}, + Value: fmt.Sprintf("%v", *m.ThemeTintAttr)}) + } + if m.ThemeShadeAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:themeShade"}, + Value: fmt.Sprintf("%v", *m.ThemeShadeAttr)}) + } + e.EncodeToken(start) + if m.Drawing != nil { + sedrawing := xml.StartElement{Name: xml.Name{Local: "w:drawing"}} + e.EncodeElement(m.Drawing, sedrawing) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Background) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "color" { + parsed, err := ParseUnionST_HexColor(attr.Value) + if err != nil { + return err + } + m.ColorAttr = &parsed + continue + } + if attr.Name.Local == "themeColor" { + m.ThemeColorAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "themeTint" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ThemeTintAttr = &parsed + continue + } + if attr.Name.Local == "themeShade" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ThemeShadeAttr = &parsed + continue + } + } +lCT_Background: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "drawing"}: + m.Drawing = NewCT_Drawing() + if err := d.DecodeElement(m.Drawing, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_Background %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Background + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Background and its children +func (m *CT_Background) Validate() error { + return m.ValidateWithPath("CT_Background") +} + +// ValidateWithPath validates the CT_Background and its children, prefixing error messages with path +func (m *CT_Background) ValidateWithPath(path string) error { + if m.ColorAttr != nil { + if err := m.ColorAttr.ValidateWithPath(path + "/ColorAttr"); err != nil { + return err + } + } + if err := m.ThemeColorAttr.ValidateWithPath(path + "/ThemeColorAttr"); err != nil { + return err + } + if m.Drawing != nil { + if err := m.Drawing.ValidateWithPath(path + "/Drawing"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Base64Binary.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Base64Binary.go new file mode 100644 index 00000000..61a4e238 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Base64Binary.go @@ -0,0 +1,67 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_Base64Binary struct { + ValAttr string +} + +func NewCT_Base64Binary() *CT_Base64Binary { + ret := &CT_Base64Binary{} + return ret +} + +func (m *CT_Base64Binary) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:val"}, + Value: fmt.Sprintf("%v", m.ValAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Base64Binary) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ValAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Base64Binary: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Base64Binary and its children +func (m *CT_Base64Binary) Validate() error { + return m.ValidateWithPath("CT_Base64Binary") +} + +// ValidateWithPath validates the CT_Base64Binary and its children, prefixing error messages with path +func (m *CT_Base64Binary) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_BdoContentRun.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_BdoContentRun.go new file mode 100644 index 00000000..77d32281 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_BdoContentRun.go @@ -0,0 +1,450 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/math" +) + +type CT_BdoContentRun struct { + // Direction of Override + ValAttr ST_Direction + // Simple Field + FldSimple []*CT_SimpleField + // Hyperlink + Hyperlink *CT_Hyperlink + // Anchor for Subdocument Location + SubDoc *CT_Rel + EG_ContentRunContent []*EG_ContentRunContent +} + +func NewCT_BdoContentRun() *CT_BdoContentRun { + ret := &CT_BdoContentRun{} + return ret +} + +func (m *CT_BdoContentRun) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.ValAttr != ST_DirectionUnset { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + if m.FldSimple != nil { + sefldSimple := xml.StartElement{Name: xml.Name{Local: "w:fldSimple"}} + for _, c := range m.FldSimple { + e.EncodeElement(c, sefldSimple) + } + } + if m.Hyperlink != nil { + sehyperlink := xml.StartElement{Name: xml.Name{Local: "w:hyperlink"}} + e.EncodeElement(m.Hyperlink, sehyperlink) + } + if m.SubDoc != nil { + sesubDoc := xml.StartElement{Name: xml.Name{Local: "w:subDoc"}} + e.EncodeElement(m.SubDoc, sesubDoc) + } + if m.EG_ContentRunContent != nil { + for _, c := range m.EG_ContentRunContent { + c.MarshalXML(e, xml.StartElement{}) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_BdoContentRun) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } +lCT_BdoContentRun: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "fldSimple"}: + tmp := NewCT_SimpleField() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.FldSimple = append(m.FldSimple, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "hyperlink"}: + m.Hyperlink = NewCT_Hyperlink() + if err := d.DecodeElement(m.Hyperlink, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "subDoc"}: + m.SubDoc = NewCT_Rel() + if err := d.DecodeElement(m.SubDoc, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXml"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.CustomXml = NewCT_CustomXmlRun() + if err := d.DecodeElement(tmpcontentruncontent.CustomXml, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "smartTag"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.SmartTag = NewCT_SmartTagRun() + if err := d.DecodeElement(tmpcontentruncontent.SmartTag, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdt"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.Sdt = NewCT_SdtRun() + if err := d.DecodeElement(tmpcontentruncontent.Sdt, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "dir"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.Dir = NewCT_DirContentRun() + if err := d.DecodeElement(tmpcontentruncontent.Dir, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bdo"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.Bdo = NewCT_BdoContentRun() + if err := d.DecodeElement(tmpcontentruncontent.Bdo, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "r"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.R = NewCT_R() + if err := d.DecodeElement(tmpcontentruncontent.R, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "proofErr"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.ProofErr = NewCT_ProofErr() + if err := d.DecodeElement(tmprunlevelelts.ProofErr, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermStart = NewCT_PermStart() + if err := d.DecodeElement(tmprunlevelelts.PermStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermEnd = NewCT_Perm() + if err := d.DecodeElement(tmprunlevelelts.PermEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Ins = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Ins, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Del = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Del, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFrom"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveFrom = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveFrom, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveTo"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveTo = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveTo, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkStart = NewCT_Bookmark() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeStart = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMathPara"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMathPara = math.NewOMathPara() + if err := d.DecodeElement(tmpmathcontent.OMathPara, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMath"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMath = math.NewOMath() + if err := d.DecodeElement(tmpmathcontent.OMath, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + default: + gooxml.Log("skipping unsupported element on CT_BdoContentRun %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_BdoContentRun + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_BdoContentRun and its children +func (m *CT_BdoContentRun) Validate() error { + return m.ValidateWithPath("CT_BdoContentRun") +} + +// ValidateWithPath validates the CT_BdoContentRun and its children, prefixing error messages with path +func (m *CT_BdoContentRun) ValidateWithPath(path string) error { + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + for i, v := range m.FldSimple { + if err := v.ValidateWithPath(fmt.Sprintf("%s/FldSimple[%d]", path, i)); err != nil { + return err + } + } + if m.Hyperlink != nil { + if err := m.Hyperlink.ValidateWithPath(path + "/Hyperlink"); err != nil { + return err + } + } + if m.SubDoc != nil { + if err := m.SubDoc.ValidateWithPath(path + "/SubDoc"); err != nil { + return err + } + } + for i, v := range m.EG_ContentRunContent { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_ContentRunContent[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Body.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Body.go new file mode 100644 index 00000000..f5763e59 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Body.go @@ -0,0 +1,451 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/math" +) + +type CT_Body struct { + EG_BlockLevelElts []*EG_BlockLevelElts + // Document Final Section Properties + SectPr *CT_SectPr +} + +func NewCT_Body() *CT_Body { + ret := &CT_Body{} + return ret +} + +func (m *CT_Body) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.EG_BlockLevelElts != nil { + for _, c := range m.EG_BlockLevelElts { + c.MarshalXML(e, xml.StartElement{}) + } + } + if m.SectPr != nil { + sesectPr := xml.StartElement{Name: xml.Name{Local: "w:sectPr"}} + e.EncodeElement(m.SectPr, sesectPr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Body) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_Body: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "altChunk"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmp := NewCT_AltChunk() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + tmpblocklevelelts.AltChunk = append(tmpblocklevelelts.AltChunk, tmp) + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXml"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmpcontentblockcontent.CustomXml = NewCT_CustomXmlBlock() + if err := d.DecodeElement(tmpcontentblockcontent.CustomXml, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdt"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmpcontentblockcontent.Sdt = NewCT_SdtBlock() + if err := d.DecodeElement(tmpcontentblockcontent.Sdt, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "p"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmp := NewCT_P() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + tmpcontentblockcontent.P = append(tmpcontentblockcontent.P, tmp) + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tbl"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmp := NewCT_Tbl() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + tmpcontentblockcontent.Tbl = append(tmpcontentblockcontent.Tbl, tmp) + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "proofErr"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.ProofErr = NewCT_ProofErr() + if err := d.DecodeElement(tmprunlevelelts.ProofErr, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permStart"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermStart = NewCT_PermStart() + if err := d.DecodeElement(tmprunlevelelts.PermStart, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permEnd"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermEnd = NewCT_Perm() + if err := d.DecodeElement(tmprunlevelelts.PermEnd, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Ins = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Ins, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Del = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Del, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFrom"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveFrom = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveFrom, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveTo"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveTo = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveTo, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkStart"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkStart = NewCT_Bookmark() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkStart, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkEnd"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkEnd, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeStart"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeStart, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeEnd"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeStart"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeStart, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeEnd"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeEnd, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeStart"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeStart = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeStart, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeEnd"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeEnd, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeStart"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeStart, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeEnd"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeEnd, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeStart"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeStart, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeEnd"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeEnd, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeStart"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeStart, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeEnd"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeStart"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeStart, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeEnd"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeEnd, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMathPara"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMathPara = math.NewOMathPara() + if err := d.DecodeElement(tmpmathcontent.OMathPara, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMath"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMath = math.NewOMath() + if err := d.DecodeElement(tmpmathcontent.OMath, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sectPr"}: + m.SectPr = NewCT_SectPr() + if err := d.DecodeElement(m.SectPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_Body %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Body + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Body and its children +func (m *CT_Body) Validate() error { + return m.ValidateWithPath("CT_Body") +} + +// ValidateWithPath validates the CT_Body and its children, prefixing error messages with path +func (m *CT_Body) ValidateWithPath(path string) error { + for i, v := range m.EG_BlockLevelElts { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_BlockLevelElts[%d]", path, i)); err != nil { + return err + } + } + if m.SectPr != nil { + if err := m.SectPr.ValidateWithPath(path + "/SectPr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Bookmark.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Bookmark.go new file mode 100644 index 00000000..524b342a --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Bookmark.go @@ -0,0 +1,121 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" +) + +type CT_Bookmark struct { + NameAttr string + ColFirstAttr *int64 + ColLastAttr *int64 + DisplacedByCustomXmlAttr ST_DisplacedByCustomXml + // Annotation Identifier + IdAttr int64 +} + +func NewCT_Bookmark() *CT_Bookmark { + ret := &CT_Bookmark{} + return ret +} + +func (m *CT_Bookmark) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:name"}, + Value: fmt.Sprintf("%v", m.NameAttr)}) + if m.ColFirstAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:colFirst"}, + Value: fmt.Sprintf("%v", *m.ColFirstAttr)}) + } + if m.ColLastAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:colLast"}, + Value: fmt.Sprintf("%v", *m.ColLastAttr)}) + } + if m.DisplacedByCustomXmlAttr != ST_DisplacedByCustomXmlUnset { + attr, err := m.DisplacedByCustomXmlAttr.MarshalXMLAttr(xml.Name{Local: "w:displacedByCustomXml"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:id"}, + Value: fmt.Sprintf("%v", m.IdAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Bookmark) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "name" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.NameAttr = parsed + continue + } + if attr.Name.Local == "colFirst" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.ColFirstAttr = &parsed + continue + } + if attr.Name.Local == "colLast" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.ColLastAttr = &parsed + continue + } + if attr.Name.Local == "displacedByCustomXml" { + m.DisplacedByCustomXmlAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "id" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.IdAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Bookmark: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Bookmark and its children +func (m *CT_Bookmark) Validate() error { + return m.ValidateWithPath("CT_Bookmark") +} + +// ValidateWithPath validates the CT_Bookmark and its children, prefixing error messages with path +func (m *CT_Bookmark) ValidateWithPath(path string) error { + if err := m.DisplacedByCustomXmlAttr.ValidateWithPath(path + "/DisplacedByCustomXmlAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_BookmarkRange.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_BookmarkRange.go new file mode 100644 index 00000000..07797737 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_BookmarkRange.go @@ -0,0 +1,110 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" +) + +type CT_BookmarkRange struct { + ColFirstAttr *int64 + ColLastAttr *int64 + DisplacedByCustomXmlAttr ST_DisplacedByCustomXml + // Annotation Identifier + IdAttr int64 +} + +func NewCT_BookmarkRange() *CT_BookmarkRange { + ret := &CT_BookmarkRange{} + return ret +} + +func (m *CT_BookmarkRange) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.ColFirstAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:colFirst"}, + Value: fmt.Sprintf("%v", *m.ColFirstAttr)}) + } + if m.ColLastAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:colLast"}, + Value: fmt.Sprintf("%v", *m.ColLastAttr)}) + } + if m.DisplacedByCustomXmlAttr != ST_DisplacedByCustomXmlUnset { + attr, err := m.DisplacedByCustomXmlAttr.MarshalXMLAttr(xml.Name{Local: "w:displacedByCustomXml"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:id"}, + Value: fmt.Sprintf("%v", m.IdAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_BookmarkRange) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "colFirst" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.ColFirstAttr = &parsed + continue + } + if attr.Name.Local == "colLast" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.ColLastAttr = &parsed + continue + } + if attr.Name.Local == "displacedByCustomXml" { + m.DisplacedByCustomXmlAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "id" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.IdAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_BookmarkRange: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_BookmarkRange and its children +func (m *CT_BookmarkRange) Validate() error { + return m.ValidateWithPath("CT_BookmarkRange") +} + +// ValidateWithPath validates the CT_BookmarkRange and its children, prefixing error messages with path +func (m *CT_BookmarkRange) ValidateWithPath(path string) error { + if err := m.DisplacedByCustomXmlAttr.ValidateWithPath(path + "/DisplacedByCustomXmlAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Border.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Border.go new file mode 100644 index 00000000..d6611d8c --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Border.go @@ -0,0 +1,207 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_Border struct { + // Border Style + ValAttr ST_Border + // Border Color + ColorAttr *ST_HexColor + // Border Theme Color + ThemeColorAttr ST_ThemeColor + // Border Theme Color Tint + ThemeTintAttr *string + // Border Theme Color Shade + ThemeShadeAttr *string + // Border Width + SzAttr *uint64 + // Border Spacing Measurement + SpaceAttr *uint64 + // Border Shadow + ShadowAttr *sharedTypes.ST_OnOff + // Create Frame Effect + FrameAttr *sharedTypes.ST_OnOff +} + +func NewCT_Border() *CT_Border { + ret := &CT_Border{} + ret.ValAttr = ST_Border(1) + return ret +} + +func (m *CT_Border) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + if m.ColorAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:color"}, + Value: fmt.Sprintf("%v", *m.ColorAttr)}) + } + if m.ThemeColorAttr != ST_ThemeColorUnset { + attr, err := m.ThemeColorAttr.MarshalXMLAttr(xml.Name{Local: "w:themeColor"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.ThemeTintAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:themeTint"}, + Value: fmt.Sprintf("%v", *m.ThemeTintAttr)}) + } + if m.ThemeShadeAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:themeShade"}, + Value: fmt.Sprintf("%v", *m.ThemeShadeAttr)}) + } + if m.SzAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:sz"}, + Value: fmt.Sprintf("%v", *m.SzAttr)}) + } + if m.SpaceAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:space"}, + Value: fmt.Sprintf("%v", *m.SpaceAttr)}) + } + if m.ShadowAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:shadow"}, + Value: fmt.Sprintf("%v", *m.ShadowAttr)}) + } + if m.FrameAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:frame"}, + Value: fmt.Sprintf("%v", *m.FrameAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Border) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_Border(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "color" { + parsed, err := ParseUnionST_HexColor(attr.Value) + if err != nil { + return err + } + m.ColorAttr = &parsed + continue + } + if attr.Name.Local == "themeColor" { + m.ThemeColorAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "themeTint" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ThemeTintAttr = &parsed + continue + } + if attr.Name.Local == "themeShade" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ThemeShadeAttr = &parsed + continue + } + if attr.Name.Local == "sz" { + parsed, err := strconv.ParseUint(attr.Value, 10, 64) + if err != nil { + return err + } + m.SzAttr = &parsed + continue + } + if attr.Name.Local == "space" { + parsed, err := strconv.ParseUint(attr.Value, 10, 64) + if err != nil { + return err + } + m.SpaceAttr = &parsed + continue + } + if attr.Name.Local == "shadow" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.ShadowAttr = &parsed + continue + } + if attr.Name.Local == "frame" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.FrameAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Border: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Border and its children +func (m *CT_Border) Validate() error { + return m.ValidateWithPath("CT_Border") +} + +// ValidateWithPath validates the CT_Border and its children, prefixing error messages with path +func (m *CT_Border) ValidateWithPath(path string) error { + if m.ValAttr == ST_BorderUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + if m.ColorAttr != nil { + if err := m.ColorAttr.ValidateWithPath(path + "/ColorAttr"); err != nil { + return err + } + } + if err := m.ThemeColorAttr.ValidateWithPath(path + "/ThemeColorAttr"); err != nil { + return err + } + if m.ShadowAttr != nil { + if err := m.ShadowAttr.ValidateWithPath(path + "/ShadowAttr"); err != nil { + return err + } + } + if m.FrameAttr != nil { + if err := m.FrameAttr.ValidateWithPath(path + "/FrameAttr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_BottomPageBorder.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_BottomPageBorder.go new file mode 100644 index 00000000..36058b24 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_BottomPageBorder.go @@ -0,0 +1,246 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_BottomPageBorder struct { + BottomLeftAttr *string + BottomRightAttr *string + IdAttr *string + // Border Style + ValAttr ST_Border + // Border Color + ColorAttr *ST_HexColor + // Border Theme Color + ThemeColorAttr ST_ThemeColor + // Border Theme Color Tint + ThemeTintAttr *string + // Border Theme Color Shade + ThemeShadeAttr *string + // Border Width + SzAttr *uint64 + // Border Spacing Measurement + SpaceAttr *uint64 + // Border Shadow + ShadowAttr *sharedTypes.ST_OnOff + // Create Frame Effect + FrameAttr *sharedTypes.ST_OnOff +} + +func NewCT_BottomPageBorder() *CT_BottomPageBorder { + ret := &CT_BottomPageBorder{} + ret.ValAttr = ST_Border(1) + return ret +} + +func (m *CT_BottomPageBorder) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.BottomLeftAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "r:bottomLeft"}, + Value: fmt.Sprintf("%v", *m.BottomLeftAttr)}) + } + if m.BottomRightAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "r:bottomRight"}, + Value: fmt.Sprintf("%v", *m.BottomRightAttr)}) + } + if m.IdAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "r:id"}, + Value: fmt.Sprintf("%v", *m.IdAttr)}) + } + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + if m.ColorAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:color"}, + Value: fmt.Sprintf("%v", *m.ColorAttr)}) + } + if m.ThemeColorAttr != ST_ThemeColorUnset { + attr, err := m.ThemeColorAttr.MarshalXMLAttr(xml.Name{Local: "w:themeColor"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.ThemeTintAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:themeTint"}, + Value: fmt.Sprintf("%v", *m.ThemeTintAttr)}) + } + if m.ThemeShadeAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:themeShade"}, + Value: fmt.Sprintf("%v", *m.ThemeShadeAttr)}) + } + if m.SzAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:sz"}, + Value: fmt.Sprintf("%v", *m.SzAttr)}) + } + if m.SpaceAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:space"}, + Value: fmt.Sprintf("%v", *m.SpaceAttr)}) + } + if m.ShadowAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:shadow"}, + Value: fmt.Sprintf("%v", *m.ShadowAttr)}) + } + if m.FrameAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:frame"}, + Value: fmt.Sprintf("%v", *m.FrameAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_BottomPageBorder) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_Border(1) + for _, attr := range start.Attr { + if attr.Name.Space == "http://schemas.openxmlformats.org/officeDocument/2006/relationships" && attr.Name.Local == "bottomLeft" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.BottomLeftAttr = &parsed + continue + } + if attr.Name.Space == "http://schemas.openxmlformats.org/officeDocument/2006/relationships" && attr.Name.Local == "bottomRight" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.BottomRightAttr = &parsed + continue + } + if attr.Name.Space == "http://schemas.openxmlformats.org/officeDocument/2006/relationships" && attr.Name.Local == "id" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.IdAttr = &parsed + continue + } + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "color" { + parsed, err := ParseUnionST_HexColor(attr.Value) + if err != nil { + return err + } + m.ColorAttr = &parsed + continue + } + if attr.Name.Local == "themeColor" { + m.ThemeColorAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "themeTint" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ThemeTintAttr = &parsed + continue + } + if attr.Name.Local == "themeShade" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ThemeShadeAttr = &parsed + continue + } + if attr.Name.Local == "sz" { + parsed, err := strconv.ParseUint(attr.Value, 10, 64) + if err != nil { + return err + } + m.SzAttr = &parsed + continue + } + if attr.Name.Local == "space" { + parsed, err := strconv.ParseUint(attr.Value, 10, 64) + if err != nil { + return err + } + m.SpaceAttr = &parsed + continue + } + if attr.Name.Local == "shadow" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.ShadowAttr = &parsed + continue + } + if attr.Name.Local == "frame" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.FrameAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_BottomPageBorder: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_BottomPageBorder and its children +func (m *CT_BottomPageBorder) Validate() error { + return m.ValidateWithPath("CT_BottomPageBorder") +} + +// ValidateWithPath validates the CT_BottomPageBorder and its children, prefixing error messages with path +func (m *CT_BottomPageBorder) ValidateWithPath(path string) error { + if m.ValAttr == ST_BorderUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + if m.ColorAttr != nil { + if err := m.ColorAttr.ValidateWithPath(path + "/ColorAttr"); err != nil { + return err + } + } + if err := m.ThemeColorAttr.ValidateWithPath(path + "/ThemeColorAttr"); err != nil { + return err + } + if m.ShadowAttr != nil { + if err := m.ShadowAttr.ValidateWithPath(path + "/ShadowAttr"); err != nil { + return err + } + } + if m.FrameAttr != nil { + if err := m.FrameAttr.ValidateWithPath(path + "/FrameAttr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Br.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Br.go new file mode 100644 index 00000000..0977c133 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Br.go @@ -0,0 +1,88 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_Br struct { + // Break Type + TypeAttr ST_BrType + // Restart Location For Text Wrapping Break + ClearAttr ST_BrClear +} + +func NewCT_Br() *CT_Br { + ret := &CT_Br{} + return ret +} + +func (m *CT_Br) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.TypeAttr != ST_BrTypeUnset { + attr, err := m.TypeAttr.MarshalXMLAttr(xml.Name{Local: "w:type"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.ClearAttr != ST_BrClearUnset { + attr, err := m.ClearAttr.MarshalXMLAttr(xml.Name{Local: "w:clear"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Br) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "type" { + m.TypeAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "clear" { + m.ClearAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Br: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Br and its children +func (m *CT_Br) Validate() error { + return m.ValidateWithPath("CT_Br") +} + +// ValidateWithPath validates the CT_Br and its children, prefixing error messages with path +func (m *CT_Br) ValidateWithPath(path string) error { + if err := m.TypeAttr.ValidateWithPath(path + "/TypeAttr"); err != nil { + return err + } + if err := m.ClearAttr.ValidateWithPath(path + "/ClearAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_CalendarType.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_CalendarType.go new file mode 100644 index 00000000..d8eb4b2c --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_CalendarType.go @@ -0,0 +1,74 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_CalendarType struct { + // Calendar Type Value + ValAttr sharedTypes.ST_CalendarType +} + +func NewCT_CalendarType() *CT_CalendarType { + ret := &CT_CalendarType{} + return ret +} + +func (m *CT_CalendarType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.ValAttr != sharedTypes.ST_CalendarTypeUnset { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_CalendarType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_CalendarType: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_CalendarType and its children +func (m *CT_CalendarType) Validate() error { + return m.ValidateWithPath("CT_CalendarType") +} + +// ValidateWithPath validates the CT_CalendarType and its children, prefixing error messages with path +func (m *CT_CalendarType) ValidateWithPath(path string) error { + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Caption.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Caption.go new file mode 100644 index 00000000..5afaf1ed --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Caption.go @@ -0,0 +1,171 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_Caption struct { + // Caption Type Name + NameAttr string + // Automatic Caption Placement + PosAttr ST_CaptionPos + // Include Chapter Number in Field for Caption + ChapNumAttr *sharedTypes.ST_OnOff + // Style for Chapter Headings + HeadingAttr *int64 + // Do Not Include Name In Caption + NoLabelAttr *sharedTypes.ST_OnOff + // Caption Numbering Format + NumFmtAttr ST_NumberFormat + // Chapter Number/Item Index Separator + SepAttr ST_ChapterSep +} + +func NewCT_Caption() *CT_Caption { + ret := &CT_Caption{} + return ret +} + +func (m *CT_Caption) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:name"}, + Value: fmt.Sprintf("%v", m.NameAttr)}) + if m.PosAttr != ST_CaptionPosUnset { + attr, err := m.PosAttr.MarshalXMLAttr(xml.Name{Local: "w:pos"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.ChapNumAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:chapNum"}, + Value: fmt.Sprintf("%v", *m.ChapNumAttr)}) + } + if m.HeadingAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:heading"}, + Value: fmt.Sprintf("%v", *m.HeadingAttr)}) + } + if m.NoLabelAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:noLabel"}, + Value: fmt.Sprintf("%v", *m.NoLabelAttr)}) + } + if m.NumFmtAttr != ST_NumberFormatUnset { + attr, err := m.NumFmtAttr.MarshalXMLAttr(xml.Name{Local: "w:numFmt"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.SepAttr != ST_ChapterSepUnset { + attr, err := m.SepAttr.MarshalXMLAttr(xml.Name{Local: "w:sep"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Caption) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "name" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.NameAttr = parsed + continue + } + if attr.Name.Local == "pos" { + m.PosAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "chapNum" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.ChapNumAttr = &parsed + continue + } + if attr.Name.Local == "heading" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.HeadingAttr = &parsed + continue + } + if attr.Name.Local == "noLabel" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.NoLabelAttr = &parsed + continue + } + if attr.Name.Local == "numFmt" { + m.NumFmtAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "sep" { + m.SepAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Caption: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Caption and its children +func (m *CT_Caption) Validate() error { + return m.ValidateWithPath("CT_Caption") +} + +// ValidateWithPath validates the CT_Caption and its children, prefixing error messages with path +func (m *CT_Caption) ValidateWithPath(path string) error { + if err := m.PosAttr.ValidateWithPath(path + "/PosAttr"); err != nil { + return err + } + if m.ChapNumAttr != nil { + if err := m.ChapNumAttr.ValidateWithPath(path + "/ChapNumAttr"); err != nil { + return err + } + } + if m.NoLabelAttr != nil { + if err := m.NoLabelAttr.ValidateWithPath(path + "/NoLabelAttr"); err != nil { + return err + } + } + if err := m.NumFmtAttr.ValidateWithPath(path + "/NumFmtAttr"); err != nil { + return err + } + if err := m.SepAttr.ValidateWithPath(path + "/SepAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Captions.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Captions.go new file mode 100644 index 00000000..e83535b2 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Captions.go @@ -0,0 +1,99 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_Captions struct { + // Single Caption Type Definition + Caption []*CT_Caption + // Automatic Captioning Settings + AutoCaptions *CT_AutoCaptions +} + +func NewCT_Captions() *CT_Captions { + ret := &CT_Captions{} + return ret +} + +func (m *CT_Captions) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + secaption := xml.StartElement{Name: xml.Name{Local: "w:caption"}} + for _, c := range m.Caption { + e.EncodeElement(c, secaption) + } + if m.AutoCaptions != nil { + seautoCaptions := xml.StartElement{Name: xml.Name{Local: "w:autoCaptions"}} + e.EncodeElement(m.AutoCaptions, seautoCaptions) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Captions) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_Captions: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "caption"}: + tmp := NewCT_Caption() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Caption = append(m.Caption, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "autoCaptions"}: + m.AutoCaptions = NewCT_AutoCaptions() + if err := d.DecodeElement(m.AutoCaptions, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_Captions %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Captions + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Captions and its children +func (m *CT_Captions) Validate() error { + return m.ValidateWithPath("CT_Captions") +} + +// ValidateWithPath validates the CT_Captions and its children, prefixing error messages with path +func (m *CT_Captions) ValidateWithPath(path string) error { + for i, v := range m.Caption { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Caption[%d]", path, i)); err != nil { + return err + } + } + if m.AutoCaptions != nil { + if err := m.AutoCaptions.ValidateWithPath(path + "/AutoCaptions"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_CellMergeTrackChange.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_CellMergeTrackChange.go new file mode 100644 index 00000000..851b806b --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_CellMergeTrackChange.go @@ -0,0 +1,124 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + "time" +) + +type CT_CellMergeTrackChange struct { + VMergeAttr ST_AnnotationVMerge + VMergeOrigAttr ST_AnnotationVMerge + AuthorAttr string + DateAttr *time.Time + // Annotation Identifier + IdAttr int64 +} + +func NewCT_CellMergeTrackChange() *CT_CellMergeTrackChange { + ret := &CT_CellMergeTrackChange{} + return ret +} + +func (m *CT_CellMergeTrackChange) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.VMergeAttr != ST_AnnotationVMergeUnset { + attr, err := m.VMergeAttr.MarshalXMLAttr(xml.Name{Local: "w:vMerge"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.VMergeOrigAttr != ST_AnnotationVMergeUnset { + attr, err := m.VMergeOrigAttr.MarshalXMLAttr(xml.Name{Local: "w:vMergeOrig"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:author"}, + Value: fmt.Sprintf("%v", m.AuthorAttr)}) + if m.DateAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:date"}, + Value: fmt.Sprintf("%v", *m.DateAttr)}) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:id"}, + Value: fmt.Sprintf("%v", m.IdAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_CellMergeTrackChange) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "vMerge" { + m.VMergeAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "vMergeOrig" { + m.VMergeOrigAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "author" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.AuthorAttr = parsed + continue + } + if attr.Name.Local == "date" { + parsed, err := ParseStdlibTime(attr.Value) + if err != nil { + return err + } + m.DateAttr = &parsed + continue + } + if attr.Name.Local == "id" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.IdAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_CellMergeTrackChange: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_CellMergeTrackChange and its children +func (m *CT_CellMergeTrackChange) Validate() error { + return m.ValidateWithPath("CT_CellMergeTrackChange") +} + +// ValidateWithPath validates the CT_CellMergeTrackChange and its children, prefixing error messages with path +func (m *CT_CellMergeTrackChange) ValidateWithPath(path string) error { + if err := m.VMergeAttr.ValidateWithPath(path + "/VMergeAttr"); err != nil { + return err + } + if err := m.VMergeOrigAttr.ValidateWithPath(path + "/VMergeOrigAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_CharacterSpacing.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_CharacterSpacing.go new file mode 100644 index 00000000..7063852d --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_CharacterSpacing.go @@ -0,0 +1,75 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_CharacterSpacing struct { + // Value + ValAttr ST_CharacterSpacing +} + +func NewCT_CharacterSpacing() *CT_CharacterSpacing { + ret := &CT_CharacterSpacing{} + ret.ValAttr = ST_CharacterSpacing(1) + return ret +} + +func (m *CT_CharacterSpacing) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_CharacterSpacing) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_CharacterSpacing(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_CharacterSpacing: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_CharacterSpacing and its children +func (m *CT_CharacterSpacing) Validate() error { + return m.ValidateWithPath("CT_CharacterSpacing") +} + +// ValidateWithPath validates the CT_CharacterSpacing and its children, prefixing error messages with path +func (m *CT_CharacterSpacing) ValidateWithPath(path string) error { + if m.ValAttr == ST_CharacterSpacingUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Charset.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Charset.go new file mode 100644 index 00000000..67a4b5ab --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Charset.go @@ -0,0 +1,84 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_Charset struct { + // Value + ValAttr *string + // IANA Name of Character Set + CharacterSetAttr *string +} + +func NewCT_Charset() *CT_Charset { + ret := &CT_Charset{} + return ret +} + +func (m *CT_Charset) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.ValAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:val"}, + Value: fmt.Sprintf("%v", *m.ValAttr)}) + } + if m.CharacterSetAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:characterSet"}, + Value: fmt.Sprintf("%v", *m.CharacterSetAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Charset) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ValAttr = &parsed + continue + } + if attr.Name.Local == "characterSet" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.CharacterSetAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Charset: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Charset and its children +func (m *CT_Charset) Validate() error { + return m.ValidateWithPath("CT_Charset") +} + +// ValidateWithPath validates the CT_Charset and its children, prefixing error messages with path +func (m *CT_Charset) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Cnf.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Cnf.go new file mode 100644 index 00000000..576255d4 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Cnf.go @@ -0,0 +1,305 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_Cnf struct { + // Conditional Formatting Bit Mask + ValAttr *string + // First Row + FirstRowAttr *sharedTypes.ST_OnOff + // Last Row + LastRowAttr *sharedTypes.ST_OnOff + // First Column + FirstColumnAttr *sharedTypes.ST_OnOff + // Last Column + LastColumnAttr *sharedTypes.ST_OnOff + // Odd Numbered Vertical Band + OddVBandAttr *sharedTypes.ST_OnOff + // Even Numbered Vertical Band + EvenVBandAttr *sharedTypes.ST_OnOff + // Odd Numbered Horizontal Band + OddHBandAttr *sharedTypes.ST_OnOff + // Even Numbered Horizontal Band + EvenHBandAttr *sharedTypes.ST_OnOff + // First Row and First Column + FirstRowFirstColumnAttr *sharedTypes.ST_OnOff + // First Row and Last Column + FirstRowLastColumnAttr *sharedTypes.ST_OnOff + // Last Row and First Column + LastRowFirstColumnAttr *sharedTypes.ST_OnOff + // Last Row and Last Column + LastRowLastColumnAttr *sharedTypes.ST_OnOff +} + +func NewCT_Cnf() *CT_Cnf { + ret := &CT_Cnf{} + return ret +} + +func (m *CT_Cnf) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.ValAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:val"}, + Value: fmt.Sprintf("%v", *m.ValAttr)}) + } + if m.FirstRowAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:firstRow"}, + Value: fmt.Sprintf("%v", *m.FirstRowAttr)}) + } + if m.LastRowAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:lastRow"}, + Value: fmt.Sprintf("%v", *m.LastRowAttr)}) + } + if m.FirstColumnAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:firstColumn"}, + Value: fmt.Sprintf("%v", *m.FirstColumnAttr)}) + } + if m.LastColumnAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:lastColumn"}, + Value: fmt.Sprintf("%v", *m.LastColumnAttr)}) + } + if m.OddVBandAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:oddVBand"}, + Value: fmt.Sprintf("%v", *m.OddVBandAttr)}) + } + if m.EvenVBandAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:evenVBand"}, + Value: fmt.Sprintf("%v", *m.EvenVBandAttr)}) + } + if m.OddHBandAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:oddHBand"}, + Value: fmt.Sprintf("%v", *m.OddHBandAttr)}) + } + if m.EvenHBandAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:evenHBand"}, + Value: fmt.Sprintf("%v", *m.EvenHBandAttr)}) + } + if m.FirstRowFirstColumnAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:firstRowFirstColumn"}, + Value: fmt.Sprintf("%v", *m.FirstRowFirstColumnAttr)}) + } + if m.FirstRowLastColumnAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:firstRowLastColumn"}, + Value: fmt.Sprintf("%v", *m.FirstRowLastColumnAttr)}) + } + if m.LastRowFirstColumnAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:lastRowFirstColumn"}, + Value: fmt.Sprintf("%v", *m.LastRowFirstColumnAttr)}) + } + if m.LastRowLastColumnAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:lastRowLastColumn"}, + Value: fmt.Sprintf("%v", *m.LastRowLastColumnAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Cnf) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "evenVBand" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.EvenVBandAttr = &parsed + continue + } + if attr.Name.Local == "firstRow" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.FirstRowAttr = &parsed + continue + } + if attr.Name.Local == "lastRow" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.LastRowAttr = &parsed + continue + } + if attr.Name.Local == "firstColumn" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.FirstColumnAttr = &parsed + continue + } + if attr.Name.Local == "lastColumn" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.LastColumnAttr = &parsed + continue + } + if attr.Name.Local == "oddVBand" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.OddVBandAttr = &parsed + continue + } + if attr.Name.Local == "val" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ValAttr = &parsed + continue + } + if attr.Name.Local == "oddHBand" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.OddHBandAttr = &parsed + continue + } + if attr.Name.Local == "evenHBand" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.EvenHBandAttr = &parsed + continue + } + if attr.Name.Local == "firstRowFirstColumn" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.FirstRowFirstColumnAttr = &parsed + continue + } + if attr.Name.Local == "firstRowLastColumn" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.FirstRowLastColumnAttr = &parsed + continue + } + if attr.Name.Local == "lastRowFirstColumn" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.LastRowFirstColumnAttr = &parsed + continue + } + if attr.Name.Local == "lastRowLastColumn" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.LastRowLastColumnAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Cnf: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Cnf and its children +func (m *CT_Cnf) Validate() error { + return m.ValidateWithPath("CT_Cnf") +} + +// ValidateWithPath validates the CT_Cnf and its children, prefixing error messages with path +func (m *CT_Cnf) ValidateWithPath(path string) error { + if m.ValAttr != nil { + if !ST_CnfPatternRe.MatchString(*m.ValAttr) { + return fmt.Errorf(`%s/m.ValAttr must match '%s' (have %v)`, path, ST_CnfPatternRe, *m.ValAttr) + } + } + if m.FirstRowAttr != nil { + if err := m.FirstRowAttr.ValidateWithPath(path + "/FirstRowAttr"); err != nil { + return err + } + } + if m.LastRowAttr != nil { + if err := m.LastRowAttr.ValidateWithPath(path + "/LastRowAttr"); err != nil { + return err + } + } + if m.FirstColumnAttr != nil { + if err := m.FirstColumnAttr.ValidateWithPath(path + "/FirstColumnAttr"); err != nil { + return err + } + } + if m.LastColumnAttr != nil { + if err := m.LastColumnAttr.ValidateWithPath(path + "/LastColumnAttr"); err != nil { + return err + } + } + if m.OddVBandAttr != nil { + if err := m.OddVBandAttr.ValidateWithPath(path + "/OddVBandAttr"); err != nil { + return err + } + } + if m.EvenVBandAttr != nil { + if err := m.EvenVBandAttr.ValidateWithPath(path + "/EvenVBandAttr"); err != nil { + return err + } + } + if m.OddHBandAttr != nil { + if err := m.OddHBandAttr.ValidateWithPath(path + "/OddHBandAttr"); err != nil { + return err + } + } + if m.EvenHBandAttr != nil { + if err := m.EvenHBandAttr.ValidateWithPath(path + "/EvenHBandAttr"); err != nil { + return err + } + } + if m.FirstRowFirstColumnAttr != nil { + if err := m.FirstRowFirstColumnAttr.ValidateWithPath(path + "/FirstRowFirstColumnAttr"); err != nil { + return err + } + } + if m.FirstRowLastColumnAttr != nil { + if err := m.FirstRowLastColumnAttr.ValidateWithPath(path + "/FirstRowLastColumnAttr"); err != nil { + return err + } + } + if m.LastRowFirstColumnAttr != nil { + if err := m.LastRowFirstColumnAttr.ValidateWithPath(path + "/LastRowFirstColumnAttr"); err != nil { + return err + } + } + if m.LastRowLastColumnAttr != nil { + if err := m.LastRowLastColumnAttr.ValidateWithPath(path + "/LastRowLastColumnAttr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Color.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Color.go new file mode 100644 index 00000000..655e853d --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Color.go @@ -0,0 +1,115 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_Color struct { + // Run Content Color + ValAttr ST_HexColor + // Run Content Theme Color + ThemeColorAttr ST_ThemeColor + // Run Content Theme Color Tint + ThemeTintAttr *string + // Run Content Theme Color Shade + ThemeShadeAttr *string +} + +func NewCT_Color() *CT_Color { + ret := &CT_Color{} + return ret +} + +func (m *CT_Color) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:val"}, + Value: fmt.Sprintf("%v", m.ValAttr)}) + if m.ThemeColorAttr != ST_ThemeColorUnset { + attr, err := m.ThemeColorAttr.MarshalXMLAttr(xml.Name{Local: "w:themeColor"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.ThemeTintAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:themeTint"}, + Value: fmt.Sprintf("%v", *m.ThemeTintAttr)}) + } + if m.ThemeShadeAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:themeShade"}, + Value: fmt.Sprintf("%v", *m.ThemeShadeAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Color) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := ParseUnionST_HexColor(attr.Value) + if err != nil { + return err + } + m.ValAttr = parsed + continue + } + if attr.Name.Local == "themeColor" { + m.ThemeColorAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "themeTint" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ThemeTintAttr = &parsed + continue + } + if attr.Name.Local == "themeShade" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ThemeShadeAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Color: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Color and its children +func (m *CT_Color) Validate() error { + return m.ValidateWithPath("CT_Color") +} + +// ValidateWithPath validates the CT_Color and its children, prefixing error messages with path +func (m *CT_Color) ValidateWithPath(path string) error { + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + if err := m.ThemeColorAttr.ValidateWithPath(path + "/ThemeColorAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_ColorSchemeMapping.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_ColorSchemeMapping.go new file mode 100644 index 00000000..54533a91 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_ColorSchemeMapping.go @@ -0,0 +1,248 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_ColorSchemeMapping struct { + // Background 1 Theme Color Mapping + Bg1Attr ST_WmlColorSchemeIndex + // Text 1 Theme Color Mapping + T1Attr ST_WmlColorSchemeIndex + // Background 2 Theme Color Mapping + Bg2Attr ST_WmlColorSchemeIndex + // Text 2 Theme Color Mapping + T2Attr ST_WmlColorSchemeIndex + // Accent 1 Theme Color Mapping + Accent1Attr ST_WmlColorSchemeIndex + // Accent 2 Theme Color Mapping + Accent2Attr ST_WmlColorSchemeIndex + // Accent3 Theme Color Mapping + Accent3Attr ST_WmlColorSchemeIndex + // Accent4 Theme Color Mapping + Accent4Attr ST_WmlColorSchemeIndex + // Accent5 Theme Color Mapping + Accent5Attr ST_WmlColorSchemeIndex + // Accent6 Theme Color Mapping + Accent6Attr ST_WmlColorSchemeIndex + // Hyperlink Theme Color Mapping + HyperlinkAttr ST_WmlColorSchemeIndex + // Followed Hyperlink Theme Color Mapping + FollowedHyperlinkAttr ST_WmlColorSchemeIndex +} + +func NewCT_ColorSchemeMapping() *CT_ColorSchemeMapping { + ret := &CT_ColorSchemeMapping{} + return ret +} + +func (m *CT_ColorSchemeMapping) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.Bg1Attr != ST_WmlColorSchemeIndexUnset { + attr, err := m.Bg1Attr.MarshalXMLAttr(xml.Name{Local: "w:bg1"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.T1Attr != ST_WmlColorSchemeIndexUnset { + attr, err := m.T1Attr.MarshalXMLAttr(xml.Name{Local: "w:t1"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.Bg2Attr != ST_WmlColorSchemeIndexUnset { + attr, err := m.Bg2Attr.MarshalXMLAttr(xml.Name{Local: "w:bg2"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.T2Attr != ST_WmlColorSchemeIndexUnset { + attr, err := m.T2Attr.MarshalXMLAttr(xml.Name{Local: "w:t2"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.Accent1Attr != ST_WmlColorSchemeIndexUnset { + attr, err := m.Accent1Attr.MarshalXMLAttr(xml.Name{Local: "w:accent1"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.Accent2Attr != ST_WmlColorSchemeIndexUnset { + attr, err := m.Accent2Attr.MarshalXMLAttr(xml.Name{Local: "w:accent2"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.Accent3Attr != ST_WmlColorSchemeIndexUnset { + attr, err := m.Accent3Attr.MarshalXMLAttr(xml.Name{Local: "w:accent3"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.Accent4Attr != ST_WmlColorSchemeIndexUnset { + attr, err := m.Accent4Attr.MarshalXMLAttr(xml.Name{Local: "w:accent4"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.Accent5Attr != ST_WmlColorSchemeIndexUnset { + attr, err := m.Accent5Attr.MarshalXMLAttr(xml.Name{Local: "w:accent5"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.Accent6Attr != ST_WmlColorSchemeIndexUnset { + attr, err := m.Accent6Attr.MarshalXMLAttr(xml.Name{Local: "w:accent6"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.HyperlinkAttr != ST_WmlColorSchemeIndexUnset { + attr, err := m.HyperlinkAttr.MarshalXMLAttr(xml.Name{Local: "w:hyperlink"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.FollowedHyperlinkAttr != ST_WmlColorSchemeIndexUnset { + attr, err := m.FollowedHyperlinkAttr.MarshalXMLAttr(xml.Name{Local: "w:followedHyperlink"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_ColorSchemeMapping) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "bg1" { + m.Bg1Attr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "t1" { + m.T1Attr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "bg2" { + m.Bg2Attr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "t2" { + m.T2Attr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "accent1" { + m.Accent1Attr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "accent2" { + m.Accent2Attr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "accent3" { + m.Accent3Attr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "accent4" { + m.Accent4Attr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "accent5" { + m.Accent5Attr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "accent6" { + m.Accent6Attr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "hyperlink" { + m.HyperlinkAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "followedHyperlink" { + m.FollowedHyperlinkAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_ColorSchemeMapping: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_ColorSchemeMapping and its children +func (m *CT_ColorSchemeMapping) Validate() error { + return m.ValidateWithPath("CT_ColorSchemeMapping") +} + +// ValidateWithPath validates the CT_ColorSchemeMapping and its children, prefixing error messages with path +func (m *CT_ColorSchemeMapping) ValidateWithPath(path string) error { + if err := m.Bg1Attr.ValidateWithPath(path + "/Bg1Attr"); err != nil { + return err + } + if err := m.T1Attr.ValidateWithPath(path + "/T1Attr"); err != nil { + return err + } + if err := m.Bg2Attr.ValidateWithPath(path + "/Bg2Attr"); err != nil { + return err + } + if err := m.T2Attr.ValidateWithPath(path + "/T2Attr"); err != nil { + return err + } + if err := m.Accent1Attr.ValidateWithPath(path + "/Accent1Attr"); err != nil { + return err + } + if err := m.Accent2Attr.ValidateWithPath(path + "/Accent2Attr"); err != nil { + return err + } + if err := m.Accent3Attr.ValidateWithPath(path + "/Accent3Attr"); err != nil { + return err + } + if err := m.Accent4Attr.ValidateWithPath(path + "/Accent4Attr"); err != nil { + return err + } + if err := m.Accent5Attr.ValidateWithPath(path + "/Accent5Attr"); err != nil { + return err + } + if err := m.Accent6Attr.ValidateWithPath(path + "/Accent6Attr"); err != nil { + return err + } + if err := m.HyperlinkAttr.ValidateWithPath(path + "/HyperlinkAttr"); err != nil { + return err + } + if err := m.FollowedHyperlinkAttr.ValidateWithPath(path + "/FollowedHyperlinkAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Column.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Column.go new file mode 100644 index 00000000..ccb9aced --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Column.go @@ -0,0 +1,96 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_Column struct { + // Column Width + WAttr *sharedTypes.ST_TwipsMeasure + // Space Before Following Column + SpaceAttr *sharedTypes.ST_TwipsMeasure +} + +func NewCT_Column() *CT_Column { + ret := &CT_Column{} + return ret +} + +func (m *CT_Column) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.WAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:w"}, + Value: fmt.Sprintf("%v", *m.WAttr)}) + } + if m.SpaceAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:space"}, + Value: fmt.Sprintf("%v", *m.SpaceAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Column) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "w" { + parsed, err := ParseUnionST_TwipsMeasure(attr.Value) + if err != nil { + return err + } + m.WAttr = &parsed + continue + } + if attr.Name.Local == "space" { + parsed, err := ParseUnionST_TwipsMeasure(attr.Value) + if err != nil { + return err + } + m.SpaceAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Column: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Column and its children +func (m *CT_Column) Validate() error { + return m.ValidateWithPath("CT_Column") +} + +// ValidateWithPath validates the CT_Column and its children, prefixing error messages with path +func (m *CT_Column) ValidateWithPath(path string) error { + if m.WAttr != nil { + if err := m.WAttr.ValidateWithPath(path + "/WAttr"); err != nil { + return err + } + } + if m.SpaceAttr != nil { + if err := m.SpaceAttr.ValidateWithPath(path + "/SpaceAttr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Columns.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Columns.go new file mode 100644 index 00000000..96f721ba --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Columns.go @@ -0,0 +1,158 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_Columns struct { + // Equal Column Widths + EqualWidthAttr *sharedTypes.ST_OnOff + // Spacing Between Equal Width Columns + SpaceAttr *sharedTypes.ST_TwipsMeasure + // Number of Equal Width Columns + NumAttr *int64 + // Draw Line Between Columns + SepAttr *sharedTypes.ST_OnOff + // Single Column Definition + Col []*CT_Column +} + +func NewCT_Columns() *CT_Columns { + ret := &CT_Columns{} + return ret +} + +func (m *CT_Columns) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.EqualWidthAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:equalWidth"}, + Value: fmt.Sprintf("%v", *m.EqualWidthAttr)}) + } + if m.SpaceAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:space"}, + Value: fmt.Sprintf("%v", *m.SpaceAttr)}) + } + if m.NumAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:num"}, + Value: fmt.Sprintf("%v", *m.NumAttr)}) + } + if m.SepAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:sep"}, + Value: fmt.Sprintf("%v", *m.SepAttr)}) + } + e.EncodeToken(start) + secol := xml.StartElement{Name: xml.Name{Local: "w:col"}} + for _, c := range m.Col { + e.EncodeElement(c, secol) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Columns) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "equalWidth" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.EqualWidthAttr = &parsed + continue + } + if attr.Name.Local == "space" { + parsed, err := ParseUnionST_TwipsMeasure(attr.Value) + if err != nil { + return err + } + m.SpaceAttr = &parsed + continue + } + if attr.Name.Local == "num" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.NumAttr = &parsed + continue + } + if attr.Name.Local == "sep" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.SepAttr = &parsed + continue + } + } +lCT_Columns: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "col"}: + tmp := NewCT_Column() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Col = append(m.Col, tmp) + default: + gooxml.Log("skipping unsupported element on CT_Columns %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Columns + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Columns and its children +func (m *CT_Columns) Validate() error { + return m.ValidateWithPath("CT_Columns") +} + +// ValidateWithPath validates the CT_Columns and its children, prefixing error messages with path +func (m *CT_Columns) ValidateWithPath(path string) error { + if m.EqualWidthAttr != nil { + if err := m.EqualWidthAttr.ValidateWithPath(path + "/EqualWidthAttr"); err != nil { + return err + } + } + if m.SpaceAttr != nil { + if err := m.SpaceAttr.ValidateWithPath(path + "/SpaceAttr"); err != nil { + return err + } + } + if m.SepAttr != nil { + if err := m.SepAttr.ValidateWithPath(path + "/SepAttr"); err != nil { + return err + } + } + for i, v := range m.Col { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Col[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Comment.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Comment.go new file mode 100644 index 00000000..62b268f5 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Comment.go @@ -0,0 +1,488 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + "time" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/math" +) + +type CT_Comment struct { + InitialsAttr *string + AuthorAttr string + DateAttr *time.Time + // Annotation Identifier + IdAttr int64 + EG_BlockLevelElts []*EG_BlockLevelElts +} + +func NewCT_Comment() *CT_Comment { + ret := &CT_Comment{} + return ret +} + +func (m *CT_Comment) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.InitialsAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:initials"}, + Value: fmt.Sprintf("%v", *m.InitialsAttr)}) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:author"}, + Value: fmt.Sprintf("%v", m.AuthorAttr)}) + if m.DateAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:date"}, + Value: fmt.Sprintf("%v", *m.DateAttr)}) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:id"}, + Value: fmt.Sprintf("%v", m.IdAttr)}) + e.EncodeToken(start) + if m.EG_BlockLevelElts != nil { + for _, c := range m.EG_BlockLevelElts { + c.MarshalXML(e, xml.StartElement{}) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Comment) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "initials" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.InitialsAttr = &parsed + continue + } + if attr.Name.Local == "author" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.AuthorAttr = parsed + continue + } + if attr.Name.Local == "date" { + parsed, err := ParseStdlibTime(attr.Value) + if err != nil { + return err + } + m.DateAttr = &parsed + continue + } + if attr.Name.Local == "id" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.IdAttr = parsed + continue + } + } +lCT_Comment: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "altChunk"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmp := NewCT_AltChunk() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + tmpblocklevelelts.AltChunk = append(tmpblocklevelelts.AltChunk, tmp) + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXml"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmpcontentblockcontent.CustomXml = NewCT_CustomXmlBlock() + if err := d.DecodeElement(tmpcontentblockcontent.CustomXml, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdt"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmpcontentblockcontent.Sdt = NewCT_SdtBlock() + if err := d.DecodeElement(tmpcontentblockcontent.Sdt, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "p"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmp := NewCT_P() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + tmpcontentblockcontent.P = append(tmpcontentblockcontent.P, tmp) + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tbl"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmp := NewCT_Tbl() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + tmpcontentblockcontent.Tbl = append(tmpcontentblockcontent.Tbl, tmp) + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "proofErr"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.ProofErr = NewCT_ProofErr() + if err := d.DecodeElement(tmprunlevelelts.ProofErr, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permStart"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermStart = NewCT_PermStart() + if err := d.DecodeElement(tmprunlevelelts.PermStart, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permEnd"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermEnd = NewCT_Perm() + if err := d.DecodeElement(tmprunlevelelts.PermEnd, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Ins = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Ins, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Del = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Del, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFrom"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveFrom = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveFrom, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveTo"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveTo = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveTo, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkStart"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkStart = NewCT_Bookmark() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkStart, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkEnd"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkEnd, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeStart"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeStart, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeEnd"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeStart"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeStart, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeEnd"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeEnd, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeStart"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeStart = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeStart, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeEnd"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeEnd, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeStart"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeStart, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeEnd"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeEnd, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeStart"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeStart, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeEnd"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeEnd, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeStart"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeStart, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeEnd"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeStart"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeStart, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeEnd"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeEnd, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMathPara"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMathPara = math.NewOMathPara() + if err := d.DecodeElement(tmpmathcontent.OMathPara, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMath"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMath = math.NewOMath() + if err := d.DecodeElement(tmpmathcontent.OMath, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + default: + gooxml.Log("skipping unsupported element on CT_Comment %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Comment + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Comment and its children +func (m *CT_Comment) Validate() error { + return m.ValidateWithPath("CT_Comment") +} + +// ValidateWithPath validates the CT_Comment and its children, prefixing error messages with path +func (m *CT_Comment) ValidateWithPath(path string) error { + for i, v := range m.EG_BlockLevelElts { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_BlockLevelElts[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Comments.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Comments.go new file mode 100644 index 00000000..fe7aafcf --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Comments.go @@ -0,0 +1,85 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_Comments struct { + // Comment Content + Comment []*CT_Comment +} + +func NewCT_Comments() *CT_Comments { + ret := &CT_Comments{} + return ret +} + +func (m *CT_Comments) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Comment != nil { + secomment := xml.StartElement{Name: xml.Name{Local: "w:comment"}} + for _, c := range m.Comment { + e.EncodeElement(c, secomment) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Comments) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_Comments: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "comment"}: + tmp := NewCT_Comment() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Comment = append(m.Comment, tmp) + default: + gooxml.Log("skipping unsupported element on CT_Comments %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Comments + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Comments and its children +func (m *CT_Comments) Validate() error { + return m.ValidateWithPath("CT_Comments") +} + +// ValidateWithPath validates the CT_Comments and its children, prefixing error messages with path +func (m *CT_Comments) ValidateWithPath(path string) error { + for i, v := range m.Comment { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Comment[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Compat.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Compat.go new file mode 100644 index 00000000..5089f367 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Compat.go @@ -0,0 +1,1125 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_Compat struct { + // Use Simplified Rules For Table Border Conflicts + UseSingleBorderforContiguousCells *CT_OnOff + // Fit To Expanded Width When Performing Full Justification + WpJustification *CT_OnOff + // Do Not Create Custom Tab Stop for Hanging Indent + NoTabHangInd *CT_OnOff + // Do Not Add Leading Between Lines of Text + NoLeading *CT_OnOff + // Add Additional Space Below Baseline For Underlined East Asian Text + SpaceForUL *CT_OnOff + // Do Not Balance Text Columns within a Section + NoColumnBalance *CT_OnOff + // Balance Single Byte and Double Byte Characters + BalanceSingleByteDoubleByteWidth *CT_OnOff + // Do Not Center Content on Lines With Exact Line Height + NoExtraLineSpacing *CT_OnOff + // Display Backslash As Yen Sign + DoNotLeaveBackslashAlone *CT_OnOff + // Underline All Trailing Spaces + UlTrailSpace *CT_OnOff + // Don't Justify Lines Ending in Soft Line Break + DoNotExpandShiftReturn *CT_OnOff + // Only Expand/Condense Text By Whole Points + SpacingInWholePoints *CT_OnOff + // Ignore Compression of Full-Width Punctuation Ending a Line + LineWrapLikeWord6 *CT_OnOff + // Print Body Text before Header/Footer Contents + PrintBodyTextBeforeHeader *CT_OnOff + // Print Colors as Black And White without Dithering + PrintColBlack *CT_OnOff + // Use Specific Space Width + WpSpaceWidth *CT_OnOff + // Display Page/Column Breaks Present in Frames + ShowBreaksInFrames *CT_OnOff + // Require Exact Size During Font Substitution + SubFontBySize *CT_OnOff + // Ignore Exact Line Height for Last Line on Page + SuppressBottomSpacing *CT_OnOff + // Ignore Minimum and Exact Line Height for First Line on Page + SuppressTopSpacing *CT_OnOff + // Ignore Minimum Line Height for First Line on Page + SuppressSpacingAtTopOfPage *CT_OnOff + // Use Static Text Leading + SuppressTopSpacingWP *CT_OnOff + // Do Not Use Space Before On First Line After a Page Break + SuppressSpBfAfterPgBrk *CT_OnOff + // Swap Paragraph Borders on Odd Numbered Pages + SwapBordersFacingPages *CT_OnOff + // Treat Backslash Quotation Delimiter as Two Quotation Marks + ConvMailMergeEsc *CT_OnOff + // Use Truncated Integer Division For Font Calculation + TruncateFontHeightsLikeWP6 *CT_OnOff + // Use Specific Small Caps Algorithm + MwSmallCaps *CT_OnOff + // Use Printer Metrics To Display Documents + UsePrinterMetrics *CT_OnOff + // Do Not Suppress Paragraph Borders Next To Frames + DoNotSuppressParagraphBorders *CT_OnOff + // Line Wrap Trailing Spaces + WrapTrailSpaces *CT_OnOff + // Ignore Page Break from Continuous Section Break + FootnoteLayoutLikeWW8 *CT_OnOff + // Ignore Text Wrapping around Objects at Bottom of Page + ShapeLayoutLikeWW8 *CT_OnOff + // Align Table Rows Independently + AlignTablesRowByRow *CT_OnOff + // Ignore Width of Last Tab Stop When Aligning Paragraph If It Is Not Left Aligned + ForgetLastTabAlignment *CT_OnOff + // Add Document Grid Line Pitch To Lines in Table Cells + AdjustLineHeightInTable *CT_OnOff + // Incorrectly Adjust Text Spacing for Specific Unicode Ranges + AutoSpaceLikeWord95 *CT_OnOff + // Do Not Increase Line Height for Raised/Lowered Text + NoSpaceRaiseLower *CT_OnOff + // Use Fixed Paragraph Spacing for HTML Auto Setting + DoNotUseHTMLParagraphAutoSpacing *CT_OnOff + // Ignore Space Before Table When Deciding If Table Should Wrap Floating Object + LayoutRawTableWidth *CT_OnOff + // Allow Table Rows to Wrap Inline Objects Independently + LayoutTableRowsApart *CT_OnOff + // Use Incorrect Inter-Character Spacing Rules + UseWord97LineBreakRules *CT_OnOff + // Do Not Allow Floating Tables To Break Across Pages + DoNotBreakWrappedTables *CT_OnOff + // Do Not Snap to Document Grid in Table Cells with Objects + DoNotSnapToGridInCell *CT_OnOff + // Select Field When First or Last Character Is Selected + SelectFldWithFirstOrLastChar *CT_OnOff + // Use Legacy Ethiopic and Amharic Line Breaking Rules + ApplyBreakingRules *CT_OnOff + // Do Not Allow Hanging Punctuation With Character Grid + DoNotWrapTextWithPunct *CT_OnOff + // Do Not Compress Compressible Characters When Using Document Grid + DoNotUseEastAsianBreakRules *CT_OnOff + // Incorrectly Display Top Border of Conditional Columns + UseWord2002TableStyleRules *CT_OnOff + // Allow Tables to AutoFit Into Page Margins + GrowAutofit *CT_OnOff + // Do Not Bypass East Asian/Complex Script Layout Code + UseFELayout *CT_OnOff + // Do Not Automatically Apply List Paragraph Style To Bulleted/Numbered Text + UseNormalStyleForList *CT_OnOff + // Ignore Hanging Indent When Creating Tab Stop After Numbering + DoNotUseIndentAsNumberingTabStop *CT_OnOff + // Use Alternate Set of East Asian Line Breaking Rules + UseAltKinsokuLineBreakRules *CT_OnOff + // Allow Contextual Spacing of Paragraphs in Tables + AllowSpaceOfSameStyleInTable *CT_OnOff + // Do Not Ignore Floating Objects When Calculating Paragraph Indentation + DoNotSuppressIndentation *CT_OnOff + // Do Not AutoFit Tables To Fit Next To Wrapped Objects + DoNotAutofitConstrainedTables *CT_OnOff + // Allow Table Columns To Exceed Preferred Widths of Constituent Cells + AutofitToFirstFixedWidthCell *CT_OnOff + // Underline Following Character Following Numbering + UnderlineTabInNumList *CT_OnOff + // Always Use Fixed Width for Hangul Characters + DisplayHangulFixedWidth *CT_OnOff + // Always Move Paragraph Mark to Page after a Page Break + SplitPgBreakAndParaMark *CT_OnOff + // Don't Vertically Align Cells Containing Floating Objects + DoNotVertAlignCellWithSp *CT_OnOff + // Don't Break Table Rows Around Floating Tables + DoNotBreakConstrainedForcedTable *CT_OnOff + // Ignore Vertical Alignment in Textboxes + DoNotVertAlignInTxbx *CT_OnOff + // Use ANSI Kerning Pairs from Fonts + UseAnsiKerningPairs *CT_OnOff + // Use Cached Paragraph Information for Column Balancing + CachedColBalance *CT_OnOff + // Custom Compatibility Setting + CompatSetting []*CT_CompatSetting +} + +func NewCT_Compat() *CT_Compat { + ret := &CT_Compat{} + return ret +} + +func (m *CT_Compat) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.UseSingleBorderforContiguousCells != nil { + seuseSingleBorderforContiguousCells := xml.StartElement{Name: xml.Name{Local: "w:useSingleBorderforContiguousCells"}} + e.EncodeElement(m.UseSingleBorderforContiguousCells, seuseSingleBorderforContiguousCells) + } + if m.WpJustification != nil { + sewpJustification := xml.StartElement{Name: xml.Name{Local: "w:wpJustification"}} + e.EncodeElement(m.WpJustification, sewpJustification) + } + if m.NoTabHangInd != nil { + senoTabHangInd := xml.StartElement{Name: xml.Name{Local: "w:noTabHangInd"}} + e.EncodeElement(m.NoTabHangInd, senoTabHangInd) + } + if m.NoLeading != nil { + senoLeading := xml.StartElement{Name: xml.Name{Local: "w:noLeading"}} + e.EncodeElement(m.NoLeading, senoLeading) + } + if m.SpaceForUL != nil { + sespaceForUL := xml.StartElement{Name: xml.Name{Local: "w:spaceForUL"}} + e.EncodeElement(m.SpaceForUL, sespaceForUL) + } + if m.NoColumnBalance != nil { + senoColumnBalance := xml.StartElement{Name: xml.Name{Local: "w:noColumnBalance"}} + e.EncodeElement(m.NoColumnBalance, senoColumnBalance) + } + if m.BalanceSingleByteDoubleByteWidth != nil { + sebalanceSingleByteDoubleByteWidth := xml.StartElement{Name: xml.Name{Local: "w:balanceSingleByteDoubleByteWidth"}} + e.EncodeElement(m.BalanceSingleByteDoubleByteWidth, sebalanceSingleByteDoubleByteWidth) + } + if m.NoExtraLineSpacing != nil { + senoExtraLineSpacing := xml.StartElement{Name: xml.Name{Local: "w:noExtraLineSpacing"}} + e.EncodeElement(m.NoExtraLineSpacing, senoExtraLineSpacing) + } + if m.DoNotLeaveBackslashAlone != nil { + sedoNotLeaveBackslashAlone := xml.StartElement{Name: xml.Name{Local: "w:doNotLeaveBackslashAlone"}} + e.EncodeElement(m.DoNotLeaveBackslashAlone, sedoNotLeaveBackslashAlone) + } + if m.UlTrailSpace != nil { + seulTrailSpace := xml.StartElement{Name: xml.Name{Local: "w:ulTrailSpace"}} + e.EncodeElement(m.UlTrailSpace, seulTrailSpace) + } + if m.DoNotExpandShiftReturn != nil { + sedoNotExpandShiftReturn := xml.StartElement{Name: xml.Name{Local: "w:doNotExpandShiftReturn"}} + e.EncodeElement(m.DoNotExpandShiftReturn, sedoNotExpandShiftReturn) + } + if m.SpacingInWholePoints != nil { + sespacingInWholePoints := xml.StartElement{Name: xml.Name{Local: "w:spacingInWholePoints"}} + e.EncodeElement(m.SpacingInWholePoints, sespacingInWholePoints) + } + if m.LineWrapLikeWord6 != nil { + selineWrapLikeWord6 := xml.StartElement{Name: xml.Name{Local: "w:lineWrapLikeWord6"}} + e.EncodeElement(m.LineWrapLikeWord6, selineWrapLikeWord6) + } + if m.PrintBodyTextBeforeHeader != nil { + seprintBodyTextBeforeHeader := xml.StartElement{Name: xml.Name{Local: "w:printBodyTextBeforeHeader"}} + e.EncodeElement(m.PrintBodyTextBeforeHeader, seprintBodyTextBeforeHeader) + } + if m.PrintColBlack != nil { + seprintColBlack := xml.StartElement{Name: xml.Name{Local: "w:printColBlack"}} + e.EncodeElement(m.PrintColBlack, seprintColBlack) + } + if m.WpSpaceWidth != nil { + sewpSpaceWidth := xml.StartElement{Name: xml.Name{Local: "w:wpSpaceWidth"}} + e.EncodeElement(m.WpSpaceWidth, sewpSpaceWidth) + } + if m.ShowBreaksInFrames != nil { + seshowBreaksInFrames := xml.StartElement{Name: xml.Name{Local: "w:showBreaksInFrames"}} + e.EncodeElement(m.ShowBreaksInFrames, seshowBreaksInFrames) + } + if m.SubFontBySize != nil { + sesubFontBySize := xml.StartElement{Name: xml.Name{Local: "w:subFontBySize"}} + e.EncodeElement(m.SubFontBySize, sesubFontBySize) + } + if m.SuppressBottomSpacing != nil { + sesuppressBottomSpacing := xml.StartElement{Name: xml.Name{Local: "w:suppressBottomSpacing"}} + e.EncodeElement(m.SuppressBottomSpacing, sesuppressBottomSpacing) + } + if m.SuppressTopSpacing != nil { + sesuppressTopSpacing := xml.StartElement{Name: xml.Name{Local: "w:suppressTopSpacing"}} + e.EncodeElement(m.SuppressTopSpacing, sesuppressTopSpacing) + } + if m.SuppressSpacingAtTopOfPage != nil { + sesuppressSpacingAtTopOfPage := xml.StartElement{Name: xml.Name{Local: "w:suppressSpacingAtTopOfPage"}} + e.EncodeElement(m.SuppressSpacingAtTopOfPage, sesuppressSpacingAtTopOfPage) + } + if m.SuppressTopSpacingWP != nil { + sesuppressTopSpacingWP := xml.StartElement{Name: xml.Name{Local: "w:suppressTopSpacingWP"}} + e.EncodeElement(m.SuppressTopSpacingWP, sesuppressTopSpacingWP) + } + if m.SuppressSpBfAfterPgBrk != nil { + sesuppressSpBfAfterPgBrk := xml.StartElement{Name: xml.Name{Local: "w:suppressSpBfAfterPgBrk"}} + e.EncodeElement(m.SuppressSpBfAfterPgBrk, sesuppressSpBfAfterPgBrk) + } + if m.SwapBordersFacingPages != nil { + seswapBordersFacingPages := xml.StartElement{Name: xml.Name{Local: "w:swapBordersFacingPages"}} + e.EncodeElement(m.SwapBordersFacingPages, seswapBordersFacingPages) + } + if m.ConvMailMergeEsc != nil { + seconvMailMergeEsc := xml.StartElement{Name: xml.Name{Local: "w:convMailMergeEsc"}} + e.EncodeElement(m.ConvMailMergeEsc, seconvMailMergeEsc) + } + if m.TruncateFontHeightsLikeWP6 != nil { + setruncateFontHeightsLikeWP6 := xml.StartElement{Name: xml.Name{Local: "w:truncateFontHeightsLikeWP6"}} + e.EncodeElement(m.TruncateFontHeightsLikeWP6, setruncateFontHeightsLikeWP6) + } + if m.MwSmallCaps != nil { + semwSmallCaps := xml.StartElement{Name: xml.Name{Local: "w:mwSmallCaps"}} + e.EncodeElement(m.MwSmallCaps, semwSmallCaps) + } + if m.UsePrinterMetrics != nil { + seusePrinterMetrics := xml.StartElement{Name: xml.Name{Local: "w:usePrinterMetrics"}} + e.EncodeElement(m.UsePrinterMetrics, seusePrinterMetrics) + } + if m.DoNotSuppressParagraphBorders != nil { + sedoNotSuppressParagraphBorders := xml.StartElement{Name: xml.Name{Local: "w:doNotSuppressParagraphBorders"}} + e.EncodeElement(m.DoNotSuppressParagraphBorders, sedoNotSuppressParagraphBorders) + } + if m.WrapTrailSpaces != nil { + sewrapTrailSpaces := xml.StartElement{Name: xml.Name{Local: "w:wrapTrailSpaces"}} + e.EncodeElement(m.WrapTrailSpaces, sewrapTrailSpaces) + } + if m.FootnoteLayoutLikeWW8 != nil { + sefootnoteLayoutLikeWW8 := xml.StartElement{Name: xml.Name{Local: "w:footnoteLayoutLikeWW8"}} + e.EncodeElement(m.FootnoteLayoutLikeWW8, sefootnoteLayoutLikeWW8) + } + if m.ShapeLayoutLikeWW8 != nil { + seshapeLayoutLikeWW8 := xml.StartElement{Name: xml.Name{Local: "w:shapeLayoutLikeWW8"}} + e.EncodeElement(m.ShapeLayoutLikeWW8, seshapeLayoutLikeWW8) + } + if m.AlignTablesRowByRow != nil { + sealignTablesRowByRow := xml.StartElement{Name: xml.Name{Local: "w:alignTablesRowByRow"}} + e.EncodeElement(m.AlignTablesRowByRow, sealignTablesRowByRow) + } + if m.ForgetLastTabAlignment != nil { + seforgetLastTabAlignment := xml.StartElement{Name: xml.Name{Local: "w:forgetLastTabAlignment"}} + e.EncodeElement(m.ForgetLastTabAlignment, seforgetLastTabAlignment) + } + if m.AdjustLineHeightInTable != nil { + seadjustLineHeightInTable := xml.StartElement{Name: xml.Name{Local: "w:adjustLineHeightInTable"}} + e.EncodeElement(m.AdjustLineHeightInTable, seadjustLineHeightInTable) + } + if m.AutoSpaceLikeWord95 != nil { + seautoSpaceLikeWord95 := xml.StartElement{Name: xml.Name{Local: "w:autoSpaceLikeWord95"}} + e.EncodeElement(m.AutoSpaceLikeWord95, seautoSpaceLikeWord95) + } + if m.NoSpaceRaiseLower != nil { + senoSpaceRaiseLower := xml.StartElement{Name: xml.Name{Local: "w:noSpaceRaiseLower"}} + e.EncodeElement(m.NoSpaceRaiseLower, senoSpaceRaiseLower) + } + if m.DoNotUseHTMLParagraphAutoSpacing != nil { + sedoNotUseHTMLParagraphAutoSpacing := xml.StartElement{Name: xml.Name{Local: "w:doNotUseHTMLParagraphAutoSpacing"}} + e.EncodeElement(m.DoNotUseHTMLParagraphAutoSpacing, sedoNotUseHTMLParagraphAutoSpacing) + } + if m.LayoutRawTableWidth != nil { + selayoutRawTableWidth := xml.StartElement{Name: xml.Name{Local: "w:layoutRawTableWidth"}} + e.EncodeElement(m.LayoutRawTableWidth, selayoutRawTableWidth) + } + if m.LayoutTableRowsApart != nil { + selayoutTableRowsApart := xml.StartElement{Name: xml.Name{Local: "w:layoutTableRowsApart"}} + e.EncodeElement(m.LayoutTableRowsApart, selayoutTableRowsApart) + } + if m.UseWord97LineBreakRules != nil { + seuseWord97LineBreakRules := xml.StartElement{Name: xml.Name{Local: "w:useWord97LineBreakRules"}} + e.EncodeElement(m.UseWord97LineBreakRules, seuseWord97LineBreakRules) + } + if m.DoNotBreakWrappedTables != nil { + sedoNotBreakWrappedTables := xml.StartElement{Name: xml.Name{Local: "w:doNotBreakWrappedTables"}} + e.EncodeElement(m.DoNotBreakWrappedTables, sedoNotBreakWrappedTables) + } + if m.DoNotSnapToGridInCell != nil { + sedoNotSnapToGridInCell := xml.StartElement{Name: xml.Name{Local: "w:doNotSnapToGridInCell"}} + e.EncodeElement(m.DoNotSnapToGridInCell, sedoNotSnapToGridInCell) + } + if m.SelectFldWithFirstOrLastChar != nil { + seselectFldWithFirstOrLastChar := xml.StartElement{Name: xml.Name{Local: "w:selectFldWithFirstOrLastChar"}} + e.EncodeElement(m.SelectFldWithFirstOrLastChar, seselectFldWithFirstOrLastChar) + } + if m.ApplyBreakingRules != nil { + seapplyBreakingRules := xml.StartElement{Name: xml.Name{Local: "w:applyBreakingRules"}} + e.EncodeElement(m.ApplyBreakingRules, seapplyBreakingRules) + } + if m.DoNotWrapTextWithPunct != nil { + sedoNotWrapTextWithPunct := xml.StartElement{Name: xml.Name{Local: "w:doNotWrapTextWithPunct"}} + e.EncodeElement(m.DoNotWrapTextWithPunct, sedoNotWrapTextWithPunct) + } + if m.DoNotUseEastAsianBreakRules != nil { + sedoNotUseEastAsianBreakRules := xml.StartElement{Name: xml.Name{Local: "w:doNotUseEastAsianBreakRules"}} + e.EncodeElement(m.DoNotUseEastAsianBreakRules, sedoNotUseEastAsianBreakRules) + } + if m.UseWord2002TableStyleRules != nil { + seuseWord2002TableStyleRules := xml.StartElement{Name: xml.Name{Local: "w:useWord2002TableStyleRules"}} + e.EncodeElement(m.UseWord2002TableStyleRules, seuseWord2002TableStyleRules) + } + if m.GrowAutofit != nil { + segrowAutofit := xml.StartElement{Name: xml.Name{Local: "w:growAutofit"}} + e.EncodeElement(m.GrowAutofit, segrowAutofit) + } + if m.UseFELayout != nil { + seuseFELayout := xml.StartElement{Name: xml.Name{Local: "w:useFELayout"}} + e.EncodeElement(m.UseFELayout, seuseFELayout) + } + if m.UseNormalStyleForList != nil { + seuseNormalStyleForList := xml.StartElement{Name: xml.Name{Local: "w:useNormalStyleForList"}} + e.EncodeElement(m.UseNormalStyleForList, seuseNormalStyleForList) + } + if m.DoNotUseIndentAsNumberingTabStop != nil { + sedoNotUseIndentAsNumberingTabStop := xml.StartElement{Name: xml.Name{Local: "w:doNotUseIndentAsNumberingTabStop"}} + e.EncodeElement(m.DoNotUseIndentAsNumberingTabStop, sedoNotUseIndentAsNumberingTabStop) + } + if m.UseAltKinsokuLineBreakRules != nil { + seuseAltKinsokuLineBreakRules := xml.StartElement{Name: xml.Name{Local: "w:useAltKinsokuLineBreakRules"}} + e.EncodeElement(m.UseAltKinsokuLineBreakRules, seuseAltKinsokuLineBreakRules) + } + if m.AllowSpaceOfSameStyleInTable != nil { + seallowSpaceOfSameStyleInTable := xml.StartElement{Name: xml.Name{Local: "w:allowSpaceOfSameStyleInTable"}} + e.EncodeElement(m.AllowSpaceOfSameStyleInTable, seallowSpaceOfSameStyleInTable) + } + if m.DoNotSuppressIndentation != nil { + sedoNotSuppressIndentation := xml.StartElement{Name: xml.Name{Local: "w:doNotSuppressIndentation"}} + e.EncodeElement(m.DoNotSuppressIndentation, sedoNotSuppressIndentation) + } + if m.DoNotAutofitConstrainedTables != nil { + sedoNotAutofitConstrainedTables := xml.StartElement{Name: xml.Name{Local: "w:doNotAutofitConstrainedTables"}} + e.EncodeElement(m.DoNotAutofitConstrainedTables, sedoNotAutofitConstrainedTables) + } + if m.AutofitToFirstFixedWidthCell != nil { + seautofitToFirstFixedWidthCell := xml.StartElement{Name: xml.Name{Local: "w:autofitToFirstFixedWidthCell"}} + e.EncodeElement(m.AutofitToFirstFixedWidthCell, seautofitToFirstFixedWidthCell) + } + if m.UnderlineTabInNumList != nil { + seunderlineTabInNumList := xml.StartElement{Name: xml.Name{Local: "w:underlineTabInNumList"}} + e.EncodeElement(m.UnderlineTabInNumList, seunderlineTabInNumList) + } + if m.DisplayHangulFixedWidth != nil { + sedisplayHangulFixedWidth := xml.StartElement{Name: xml.Name{Local: "w:displayHangulFixedWidth"}} + e.EncodeElement(m.DisplayHangulFixedWidth, sedisplayHangulFixedWidth) + } + if m.SplitPgBreakAndParaMark != nil { + sesplitPgBreakAndParaMark := xml.StartElement{Name: xml.Name{Local: "w:splitPgBreakAndParaMark"}} + e.EncodeElement(m.SplitPgBreakAndParaMark, sesplitPgBreakAndParaMark) + } + if m.DoNotVertAlignCellWithSp != nil { + sedoNotVertAlignCellWithSp := xml.StartElement{Name: xml.Name{Local: "w:doNotVertAlignCellWithSp"}} + e.EncodeElement(m.DoNotVertAlignCellWithSp, sedoNotVertAlignCellWithSp) + } + if m.DoNotBreakConstrainedForcedTable != nil { + sedoNotBreakConstrainedForcedTable := xml.StartElement{Name: xml.Name{Local: "w:doNotBreakConstrainedForcedTable"}} + e.EncodeElement(m.DoNotBreakConstrainedForcedTable, sedoNotBreakConstrainedForcedTable) + } + if m.DoNotVertAlignInTxbx != nil { + sedoNotVertAlignInTxbx := xml.StartElement{Name: xml.Name{Local: "w:doNotVertAlignInTxbx"}} + e.EncodeElement(m.DoNotVertAlignInTxbx, sedoNotVertAlignInTxbx) + } + if m.UseAnsiKerningPairs != nil { + seuseAnsiKerningPairs := xml.StartElement{Name: xml.Name{Local: "w:useAnsiKerningPairs"}} + e.EncodeElement(m.UseAnsiKerningPairs, seuseAnsiKerningPairs) + } + if m.CachedColBalance != nil { + secachedColBalance := xml.StartElement{Name: xml.Name{Local: "w:cachedColBalance"}} + e.EncodeElement(m.CachedColBalance, secachedColBalance) + } + if m.CompatSetting != nil { + secompatSetting := xml.StartElement{Name: xml.Name{Local: "w:compatSetting"}} + for _, c := range m.CompatSetting { + e.EncodeElement(c, secompatSetting) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Compat) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_Compat: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "useSingleBorderforContiguousCells"}: + m.UseSingleBorderforContiguousCells = NewCT_OnOff() + if err := d.DecodeElement(m.UseSingleBorderforContiguousCells, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "wpJustification"}: + m.WpJustification = NewCT_OnOff() + if err := d.DecodeElement(m.WpJustification, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "noTabHangInd"}: + m.NoTabHangInd = NewCT_OnOff() + if err := d.DecodeElement(m.NoTabHangInd, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "noLeading"}: + m.NoLeading = NewCT_OnOff() + if err := d.DecodeElement(m.NoLeading, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "spaceForUL"}: + m.SpaceForUL = NewCT_OnOff() + if err := d.DecodeElement(m.SpaceForUL, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "noColumnBalance"}: + m.NoColumnBalance = NewCT_OnOff() + if err := d.DecodeElement(m.NoColumnBalance, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "balanceSingleByteDoubleByteWidth"}: + m.BalanceSingleByteDoubleByteWidth = NewCT_OnOff() + if err := d.DecodeElement(m.BalanceSingleByteDoubleByteWidth, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "noExtraLineSpacing"}: + m.NoExtraLineSpacing = NewCT_OnOff() + if err := d.DecodeElement(m.NoExtraLineSpacing, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotLeaveBackslashAlone"}: + m.DoNotLeaveBackslashAlone = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotLeaveBackslashAlone, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ulTrailSpace"}: + m.UlTrailSpace = NewCT_OnOff() + if err := d.DecodeElement(m.UlTrailSpace, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotExpandShiftReturn"}: + m.DoNotExpandShiftReturn = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotExpandShiftReturn, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "spacingInWholePoints"}: + m.SpacingInWholePoints = NewCT_OnOff() + if err := d.DecodeElement(m.SpacingInWholePoints, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "lineWrapLikeWord6"}: + m.LineWrapLikeWord6 = NewCT_OnOff() + if err := d.DecodeElement(m.LineWrapLikeWord6, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "printBodyTextBeforeHeader"}: + m.PrintBodyTextBeforeHeader = NewCT_OnOff() + if err := d.DecodeElement(m.PrintBodyTextBeforeHeader, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "printColBlack"}: + m.PrintColBlack = NewCT_OnOff() + if err := d.DecodeElement(m.PrintColBlack, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "wpSpaceWidth"}: + m.WpSpaceWidth = NewCT_OnOff() + if err := d.DecodeElement(m.WpSpaceWidth, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "showBreaksInFrames"}: + m.ShowBreaksInFrames = NewCT_OnOff() + if err := d.DecodeElement(m.ShowBreaksInFrames, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "subFontBySize"}: + m.SubFontBySize = NewCT_OnOff() + if err := d.DecodeElement(m.SubFontBySize, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "suppressBottomSpacing"}: + m.SuppressBottomSpacing = NewCT_OnOff() + if err := d.DecodeElement(m.SuppressBottomSpacing, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "suppressTopSpacing"}: + m.SuppressTopSpacing = NewCT_OnOff() + if err := d.DecodeElement(m.SuppressTopSpacing, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "suppressSpacingAtTopOfPage"}: + m.SuppressSpacingAtTopOfPage = NewCT_OnOff() + if err := d.DecodeElement(m.SuppressSpacingAtTopOfPage, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "suppressTopSpacingWP"}: + m.SuppressTopSpacingWP = NewCT_OnOff() + if err := d.DecodeElement(m.SuppressTopSpacingWP, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "suppressSpBfAfterPgBrk"}: + m.SuppressSpBfAfterPgBrk = NewCT_OnOff() + if err := d.DecodeElement(m.SuppressSpBfAfterPgBrk, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "swapBordersFacingPages"}: + m.SwapBordersFacingPages = NewCT_OnOff() + if err := d.DecodeElement(m.SwapBordersFacingPages, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "convMailMergeEsc"}: + m.ConvMailMergeEsc = NewCT_OnOff() + if err := d.DecodeElement(m.ConvMailMergeEsc, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "truncateFontHeightsLikeWP6"}: + m.TruncateFontHeightsLikeWP6 = NewCT_OnOff() + if err := d.DecodeElement(m.TruncateFontHeightsLikeWP6, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "mwSmallCaps"}: + m.MwSmallCaps = NewCT_OnOff() + if err := d.DecodeElement(m.MwSmallCaps, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "usePrinterMetrics"}: + m.UsePrinterMetrics = NewCT_OnOff() + if err := d.DecodeElement(m.UsePrinterMetrics, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotSuppressParagraphBorders"}: + m.DoNotSuppressParagraphBorders = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotSuppressParagraphBorders, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "wrapTrailSpaces"}: + m.WrapTrailSpaces = NewCT_OnOff() + if err := d.DecodeElement(m.WrapTrailSpaces, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "footnoteLayoutLikeWW8"}: + m.FootnoteLayoutLikeWW8 = NewCT_OnOff() + if err := d.DecodeElement(m.FootnoteLayoutLikeWW8, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "shapeLayoutLikeWW8"}: + m.ShapeLayoutLikeWW8 = NewCT_OnOff() + if err := d.DecodeElement(m.ShapeLayoutLikeWW8, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "alignTablesRowByRow"}: + m.AlignTablesRowByRow = NewCT_OnOff() + if err := d.DecodeElement(m.AlignTablesRowByRow, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "forgetLastTabAlignment"}: + m.ForgetLastTabAlignment = NewCT_OnOff() + if err := d.DecodeElement(m.ForgetLastTabAlignment, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "adjustLineHeightInTable"}: + m.AdjustLineHeightInTable = NewCT_OnOff() + if err := d.DecodeElement(m.AdjustLineHeightInTable, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "autoSpaceLikeWord95"}: + m.AutoSpaceLikeWord95 = NewCT_OnOff() + if err := d.DecodeElement(m.AutoSpaceLikeWord95, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "noSpaceRaiseLower"}: + m.NoSpaceRaiseLower = NewCT_OnOff() + if err := d.DecodeElement(m.NoSpaceRaiseLower, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotUseHTMLParagraphAutoSpacing"}: + m.DoNotUseHTMLParagraphAutoSpacing = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotUseHTMLParagraphAutoSpacing, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "layoutRawTableWidth"}: + m.LayoutRawTableWidth = NewCT_OnOff() + if err := d.DecodeElement(m.LayoutRawTableWidth, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "layoutTableRowsApart"}: + m.LayoutTableRowsApart = NewCT_OnOff() + if err := d.DecodeElement(m.LayoutTableRowsApart, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "useWord97LineBreakRules"}: + m.UseWord97LineBreakRules = NewCT_OnOff() + if err := d.DecodeElement(m.UseWord97LineBreakRules, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotBreakWrappedTables"}: + m.DoNotBreakWrappedTables = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotBreakWrappedTables, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotSnapToGridInCell"}: + m.DoNotSnapToGridInCell = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotSnapToGridInCell, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "selectFldWithFirstOrLastChar"}: + m.SelectFldWithFirstOrLastChar = NewCT_OnOff() + if err := d.DecodeElement(m.SelectFldWithFirstOrLastChar, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "applyBreakingRules"}: + m.ApplyBreakingRules = NewCT_OnOff() + if err := d.DecodeElement(m.ApplyBreakingRules, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotWrapTextWithPunct"}: + m.DoNotWrapTextWithPunct = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotWrapTextWithPunct, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotUseEastAsianBreakRules"}: + m.DoNotUseEastAsianBreakRules = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotUseEastAsianBreakRules, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "useWord2002TableStyleRules"}: + m.UseWord2002TableStyleRules = NewCT_OnOff() + if err := d.DecodeElement(m.UseWord2002TableStyleRules, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "growAutofit"}: + m.GrowAutofit = NewCT_OnOff() + if err := d.DecodeElement(m.GrowAutofit, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "useFELayout"}: + m.UseFELayout = NewCT_OnOff() + if err := d.DecodeElement(m.UseFELayout, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "useNormalStyleForList"}: + m.UseNormalStyleForList = NewCT_OnOff() + if err := d.DecodeElement(m.UseNormalStyleForList, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotUseIndentAsNumberingTabStop"}: + m.DoNotUseIndentAsNumberingTabStop = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotUseIndentAsNumberingTabStop, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "useAltKinsokuLineBreakRules"}: + m.UseAltKinsokuLineBreakRules = NewCT_OnOff() + if err := d.DecodeElement(m.UseAltKinsokuLineBreakRules, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "allowSpaceOfSameStyleInTable"}: + m.AllowSpaceOfSameStyleInTable = NewCT_OnOff() + if err := d.DecodeElement(m.AllowSpaceOfSameStyleInTable, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotSuppressIndentation"}: + m.DoNotSuppressIndentation = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotSuppressIndentation, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotAutofitConstrainedTables"}: + m.DoNotAutofitConstrainedTables = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotAutofitConstrainedTables, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "autofitToFirstFixedWidthCell"}: + m.AutofitToFirstFixedWidthCell = NewCT_OnOff() + if err := d.DecodeElement(m.AutofitToFirstFixedWidthCell, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "underlineTabInNumList"}: + m.UnderlineTabInNumList = NewCT_OnOff() + if err := d.DecodeElement(m.UnderlineTabInNumList, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "displayHangulFixedWidth"}: + m.DisplayHangulFixedWidth = NewCT_OnOff() + if err := d.DecodeElement(m.DisplayHangulFixedWidth, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "splitPgBreakAndParaMark"}: + m.SplitPgBreakAndParaMark = NewCT_OnOff() + if err := d.DecodeElement(m.SplitPgBreakAndParaMark, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotVertAlignCellWithSp"}: + m.DoNotVertAlignCellWithSp = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotVertAlignCellWithSp, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotBreakConstrainedForcedTable"}: + m.DoNotBreakConstrainedForcedTable = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotBreakConstrainedForcedTable, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotVertAlignInTxbx"}: + m.DoNotVertAlignInTxbx = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotVertAlignInTxbx, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "useAnsiKerningPairs"}: + m.UseAnsiKerningPairs = NewCT_OnOff() + if err := d.DecodeElement(m.UseAnsiKerningPairs, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "cachedColBalance"}: + m.CachedColBalance = NewCT_OnOff() + if err := d.DecodeElement(m.CachedColBalance, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "compatSetting"}: + tmp := NewCT_CompatSetting() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.CompatSetting = append(m.CompatSetting, tmp) + default: + gooxml.Log("skipping unsupported element on CT_Compat %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Compat + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Compat and its children +func (m *CT_Compat) Validate() error { + return m.ValidateWithPath("CT_Compat") +} + +// ValidateWithPath validates the CT_Compat and its children, prefixing error messages with path +func (m *CT_Compat) ValidateWithPath(path string) error { + if m.UseSingleBorderforContiguousCells != nil { + if err := m.UseSingleBorderforContiguousCells.ValidateWithPath(path + "/UseSingleBorderforContiguousCells"); err != nil { + return err + } + } + if m.WpJustification != nil { + if err := m.WpJustification.ValidateWithPath(path + "/WpJustification"); err != nil { + return err + } + } + if m.NoTabHangInd != nil { + if err := m.NoTabHangInd.ValidateWithPath(path + "/NoTabHangInd"); err != nil { + return err + } + } + if m.NoLeading != nil { + if err := m.NoLeading.ValidateWithPath(path + "/NoLeading"); err != nil { + return err + } + } + if m.SpaceForUL != nil { + if err := m.SpaceForUL.ValidateWithPath(path + "/SpaceForUL"); err != nil { + return err + } + } + if m.NoColumnBalance != nil { + if err := m.NoColumnBalance.ValidateWithPath(path + "/NoColumnBalance"); err != nil { + return err + } + } + if m.BalanceSingleByteDoubleByteWidth != nil { + if err := m.BalanceSingleByteDoubleByteWidth.ValidateWithPath(path + "/BalanceSingleByteDoubleByteWidth"); err != nil { + return err + } + } + if m.NoExtraLineSpacing != nil { + if err := m.NoExtraLineSpacing.ValidateWithPath(path + "/NoExtraLineSpacing"); err != nil { + return err + } + } + if m.DoNotLeaveBackslashAlone != nil { + if err := m.DoNotLeaveBackslashAlone.ValidateWithPath(path + "/DoNotLeaveBackslashAlone"); err != nil { + return err + } + } + if m.UlTrailSpace != nil { + if err := m.UlTrailSpace.ValidateWithPath(path + "/UlTrailSpace"); err != nil { + return err + } + } + if m.DoNotExpandShiftReturn != nil { + if err := m.DoNotExpandShiftReturn.ValidateWithPath(path + "/DoNotExpandShiftReturn"); err != nil { + return err + } + } + if m.SpacingInWholePoints != nil { + if err := m.SpacingInWholePoints.ValidateWithPath(path + "/SpacingInWholePoints"); err != nil { + return err + } + } + if m.LineWrapLikeWord6 != nil { + if err := m.LineWrapLikeWord6.ValidateWithPath(path + "/LineWrapLikeWord6"); err != nil { + return err + } + } + if m.PrintBodyTextBeforeHeader != nil { + if err := m.PrintBodyTextBeforeHeader.ValidateWithPath(path + "/PrintBodyTextBeforeHeader"); err != nil { + return err + } + } + if m.PrintColBlack != nil { + if err := m.PrintColBlack.ValidateWithPath(path + "/PrintColBlack"); err != nil { + return err + } + } + if m.WpSpaceWidth != nil { + if err := m.WpSpaceWidth.ValidateWithPath(path + "/WpSpaceWidth"); err != nil { + return err + } + } + if m.ShowBreaksInFrames != nil { + if err := m.ShowBreaksInFrames.ValidateWithPath(path + "/ShowBreaksInFrames"); err != nil { + return err + } + } + if m.SubFontBySize != nil { + if err := m.SubFontBySize.ValidateWithPath(path + "/SubFontBySize"); err != nil { + return err + } + } + if m.SuppressBottomSpacing != nil { + if err := m.SuppressBottomSpacing.ValidateWithPath(path + "/SuppressBottomSpacing"); err != nil { + return err + } + } + if m.SuppressTopSpacing != nil { + if err := m.SuppressTopSpacing.ValidateWithPath(path + "/SuppressTopSpacing"); err != nil { + return err + } + } + if m.SuppressSpacingAtTopOfPage != nil { + if err := m.SuppressSpacingAtTopOfPage.ValidateWithPath(path + "/SuppressSpacingAtTopOfPage"); err != nil { + return err + } + } + if m.SuppressTopSpacingWP != nil { + if err := m.SuppressTopSpacingWP.ValidateWithPath(path + "/SuppressTopSpacingWP"); err != nil { + return err + } + } + if m.SuppressSpBfAfterPgBrk != nil { + if err := m.SuppressSpBfAfterPgBrk.ValidateWithPath(path + "/SuppressSpBfAfterPgBrk"); err != nil { + return err + } + } + if m.SwapBordersFacingPages != nil { + if err := m.SwapBordersFacingPages.ValidateWithPath(path + "/SwapBordersFacingPages"); err != nil { + return err + } + } + if m.ConvMailMergeEsc != nil { + if err := m.ConvMailMergeEsc.ValidateWithPath(path + "/ConvMailMergeEsc"); err != nil { + return err + } + } + if m.TruncateFontHeightsLikeWP6 != nil { + if err := m.TruncateFontHeightsLikeWP6.ValidateWithPath(path + "/TruncateFontHeightsLikeWP6"); err != nil { + return err + } + } + if m.MwSmallCaps != nil { + if err := m.MwSmallCaps.ValidateWithPath(path + "/MwSmallCaps"); err != nil { + return err + } + } + if m.UsePrinterMetrics != nil { + if err := m.UsePrinterMetrics.ValidateWithPath(path + "/UsePrinterMetrics"); err != nil { + return err + } + } + if m.DoNotSuppressParagraphBorders != nil { + if err := m.DoNotSuppressParagraphBorders.ValidateWithPath(path + "/DoNotSuppressParagraphBorders"); err != nil { + return err + } + } + if m.WrapTrailSpaces != nil { + if err := m.WrapTrailSpaces.ValidateWithPath(path + "/WrapTrailSpaces"); err != nil { + return err + } + } + if m.FootnoteLayoutLikeWW8 != nil { + if err := m.FootnoteLayoutLikeWW8.ValidateWithPath(path + "/FootnoteLayoutLikeWW8"); err != nil { + return err + } + } + if m.ShapeLayoutLikeWW8 != nil { + if err := m.ShapeLayoutLikeWW8.ValidateWithPath(path + "/ShapeLayoutLikeWW8"); err != nil { + return err + } + } + if m.AlignTablesRowByRow != nil { + if err := m.AlignTablesRowByRow.ValidateWithPath(path + "/AlignTablesRowByRow"); err != nil { + return err + } + } + if m.ForgetLastTabAlignment != nil { + if err := m.ForgetLastTabAlignment.ValidateWithPath(path + "/ForgetLastTabAlignment"); err != nil { + return err + } + } + if m.AdjustLineHeightInTable != nil { + if err := m.AdjustLineHeightInTable.ValidateWithPath(path + "/AdjustLineHeightInTable"); err != nil { + return err + } + } + if m.AutoSpaceLikeWord95 != nil { + if err := m.AutoSpaceLikeWord95.ValidateWithPath(path + "/AutoSpaceLikeWord95"); err != nil { + return err + } + } + if m.NoSpaceRaiseLower != nil { + if err := m.NoSpaceRaiseLower.ValidateWithPath(path + "/NoSpaceRaiseLower"); err != nil { + return err + } + } + if m.DoNotUseHTMLParagraphAutoSpacing != nil { + if err := m.DoNotUseHTMLParagraphAutoSpacing.ValidateWithPath(path + "/DoNotUseHTMLParagraphAutoSpacing"); err != nil { + return err + } + } + if m.LayoutRawTableWidth != nil { + if err := m.LayoutRawTableWidth.ValidateWithPath(path + "/LayoutRawTableWidth"); err != nil { + return err + } + } + if m.LayoutTableRowsApart != nil { + if err := m.LayoutTableRowsApart.ValidateWithPath(path + "/LayoutTableRowsApart"); err != nil { + return err + } + } + if m.UseWord97LineBreakRules != nil { + if err := m.UseWord97LineBreakRules.ValidateWithPath(path + "/UseWord97LineBreakRules"); err != nil { + return err + } + } + if m.DoNotBreakWrappedTables != nil { + if err := m.DoNotBreakWrappedTables.ValidateWithPath(path + "/DoNotBreakWrappedTables"); err != nil { + return err + } + } + if m.DoNotSnapToGridInCell != nil { + if err := m.DoNotSnapToGridInCell.ValidateWithPath(path + "/DoNotSnapToGridInCell"); err != nil { + return err + } + } + if m.SelectFldWithFirstOrLastChar != nil { + if err := m.SelectFldWithFirstOrLastChar.ValidateWithPath(path + "/SelectFldWithFirstOrLastChar"); err != nil { + return err + } + } + if m.ApplyBreakingRules != nil { + if err := m.ApplyBreakingRules.ValidateWithPath(path + "/ApplyBreakingRules"); err != nil { + return err + } + } + if m.DoNotWrapTextWithPunct != nil { + if err := m.DoNotWrapTextWithPunct.ValidateWithPath(path + "/DoNotWrapTextWithPunct"); err != nil { + return err + } + } + if m.DoNotUseEastAsianBreakRules != nil { + if err := m.DoNotUseEastAsianBreakRules.ValidateWithPath(path + "/DoNotUseEastAsianBreakRules"); err != nil { + return err + } + } + if m.UseWord2002TableStyleRules != nil { + if err := m.UseWord2002TableStyleRules.ValidateWithPath(path + "/UseWord2002TableStyleRules"); err != nil { + return err + } + } + if m.GrowAutofit != nil { + if err := m.GrowAutofit.ValidateWithPath(path + "/GrowAutofit"); err != nil { + return err + } + } + if m.UseFELayout != nil { + if err := m.UseFELayout.ValidateWithPath(path + "/UseFELayout"); err != nil { + return err + } + } + if m.UseNormalStyleForList != nil { + if err := m.UseNormalStyleForList.ValidateWithPath(path + "/UseNormalStyleForList"); err != nil { + return err + } + } + if m.DoNotUseIndentAsNumberingTabStop != nil { + if err := m.DoNotUseIndentAsNumberingTabStop.ValidateWithPath(path + "/DoNotUseIndentAsNumberingTabStop"); err != nil { + return err + } + } + if m.UseAltKinsokuLineBreakRules != nil { + if err := m.UseAltKinsokuLineBreakRules.ValidateWithPath(path + "/UseAltKinsokuLineBreakRules"); err != nil { + return err + } + } + if m.AllowSpaceOfSameStyleInTable != nil { + if err := m.AllowSpaceOfSameStyleInTable.ValidateWithPath(path + "/AllowSpaceOfSameStyleInTable"); err != nil { + return err + } + } + if m.DoNotSuppressIndentation != nil { + if err := m.DoNotSuppressIndentation.ValidateWithPath(path + "/DoNotSuppressIndentation"); err != nil { + return err + } + } + if m.DoNotAutofitConstrainedTables != nil { + if err := m.DoNotAutofitConstrainedTables.ValidateWithPath(path + "/DoNotAutofitConstrainedTables"); err != nil { + return err + } + } + if m.AutofitToFirstFixedWidthCell != nil { + if err := m.AutofitToFirstFixedWidthCell.ValidateWithPath(path + "/AutofitToFirstFixedWidthCell"); err != nil { + return err + } + } + if m.UnderlineTabInNumList != nil { + if err := m.UnderlineTabInNumList.ValidateWithPath(path + "/UnderlineTabInNumList"); err != nil { + return err + } + } + if m.DisplayHangulFixedWidth != nil { + if err := m.DisplayHangulFixedWidth.ValidateWithPath(path + "/DisplayHangulFixedWidth"); err != nil { + return err + } + } + if m.SplitPgBreakAndParaMark != nil { + if err := m.SplitPgBreakAndParaMark.ValidateWithPath(path + "/SplitPgBreakAndParaMark"); err != nil { + return err + } + } + if m.DoNotVertAlignCellWithSp != nil { + if err := m.DoNotVertAlignCellWithSp.ValidateWithPath(path + "/DoNotVertAlignCellWithSp"); err != nil { + return err + } + } + if m.DoNotBreakConstrainedForcedTable != nil { + if err := m.DoNotBreakConstrainedForcedTable.ValidateWithPath(path + "/DoNotBreakConstrainedForcedTable"); err != nil { + return err + } + } + if m.DoNotVertAlignInTxbx != nil { + if err := m.DoNotVertAlignInTxbx.ValidateWithPath(path + "/DoNotVertAlignInTxbx"); err != nil { + return err + } + } + if m.UseAnsiKerningPairs != nil { + if err := m.UseAnsiKerningPairs.ValidateWithPath(path + "/UseAnsiKerningPairs"); err != nil { + return err + } + } + if m.CachedColBalance != nil { + if err := m.CachedColBalance.ValidateWithPath(path + "/CachedColBalance"); err != nil { + return err + } + } + for i, v := range m.CompatSetting { + if err := v.ValidateWithPath(fmt.Sprintf("%s/CompatSetting[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_CompatSetting.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_CompatSetting.go new file mode 100644 index 00000000..f4780323 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_CompatSetting.go @@ -0,0 +1,98 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_CompatSetting struct { + // Name of Setting + NameAttr *string + // Namespace of Setting + UriAttr *string + // Value of Setting + ValAttr *string +} + +func NewCT_CompatSetting() *CT_CompatSetting { + ret := &CT_CompatSetting{} + return ret +} + +func (m *CT_CompatSetting) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.NameAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:name"}, + Value: fmt.Sprintf("%v", *m.NameAttr)}) + } + if m.UriAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:uri"}, + Value: fmt.Sprintf("%v", *m.UriAttr)}) + } + if m.ValAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:val"}, + Value: fmt.Sprintf("%v", *m.ValAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_CompatSetting) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "name" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.NameAttr = &parsed + continue + } + if attr.Name.Local == "uri" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.UriAttr = &parsed + continue + } + if attr.Name.Local == "val" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ValAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_CompatSetting: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_CompatSetting and its children +func (m *CT_CompatSetting) Validate() error { + return m.ValidateWithPath("CT_CompatSetting") +} + +// ValidateWithPath validates the CT_CompatSetting and its children, prefixing error messages with path +func (m *CT_CompatSetting) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Control.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Control.go new file mode 100644 index 00000000..c2e8dec7 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Control.go @@ -0,0 +1,97 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_Control struct { + // Unique Name for Embedded Control + NameAttr *string + // Shape Reference + ShapeidAttr *string + IdAttr *string +} + +func NewCT_Control() *CT_Control { + ret := &CT_Control{} + return ret +} + +func (m *CT_Control) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.NameAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:name"}, + Value: fmt.Sprintf("%v", *m.NameAttr)}) + } + if m.ShapeidAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:shapeid"}, + Value: fmt.Sprintf("%v", *m.ShapeidAttr)}) + } + if m.IdAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "r:id"}, + Value: fmt.Sprintf("%v", *m.IdAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Control) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Space == "http://schemas.openxmlformats.org/officeDocument/2006/relationships" && attr.Name.Local == "id" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.IdAttr = &parsed + continue + } + if attr.Name.Local == "name" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.NameAttr = &parsed + continue + } + if attr.Name.Local == "shapeid" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ShapeidAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Control: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Control and its children +func (m *CT_Control) Validate() error { + return m.ValidateWithPath("CT_Control") +} + +// ValidateWithPath validates the CT_Control and its children, prefixing error messages with path +func (m *CT_Control) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_CustomXmlBlock.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_CustomXmlBlock.go new file mode 100644 index 00000000..291b6383 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_CustomXmlBlock.go @@ -0,0 +1,413 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/math" +) + +type CT_CustomXmlBlock struct { + // Custom XML Element Namespace + UriAttr *string + // Custom XML Element Name + ElementAttr string + // Custom XML Element Properties + CustomXmlPr *CT_CustomXmlPr + EG_ContentBlockContent []*EG_ContentBlockContent +} + +func NewCT_CustomXmlBlock() *CT_CustomXmlBlock { + ret := &CT_CustomXmlBlock{} + return ret +} + +func (m *CT_CustomXmlBlock) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.UriAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:uri"}, + Value: fmt.Sprintf("%v", *m.UriAttr)}) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:element"}, + Value: fmt.Sprintf("%v", m.ElementAttr)}) + e.EncodeToken(start) + if m.CustomXmlPr != nil { + secustomXmlPr := xml.StartElement{Name: xml.Name{Local: "w:customXmlPr"}} + e.EncodeElement(m.CustomXmlPr, secustomXmlPr) + } + if m.EG_ContentBlockContent != nil { + for _, c := range m.EG_ContentBlockContent { + c.MarshalXML(e, xml.StartElement{}) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_CustomXmlBlock) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "uri" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.UriAttr = &parsed + continue + } + if attr.Name.Local == "element" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ElementAttr = parsed + continue + } + } +lCT_CustomXmlBlock: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlPr"}: + m.CustomXmlPr = NewCT_CustomXmlPr() + if err := d.DecodeElement(m.CustomXmlPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXml"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmpcontentblockcontent.CustomXml = NewCT_CustomXmlBlock() + if err := d.DecodeElement(tmpcontentblockcontent.CustomXml, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdt"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmpcontentblockcontent.Sdt = NewCT_SdtBlock() + if err := d.DecodeElement(tmpcontentblockcontent.Sdt, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "p"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmp := NewCT_P() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + tmpcontentblockcontent.P = append(tmpcontentblockcontent.P, tmp) + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tbl"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmp := NewCT_Tbl() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + tmpcontentblockcontent.Tbl = append(tmpcontentblockcontent.Tbl, tmp) + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "proofErr"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.ProofErr = NewCT_ProofErr() + if err := d.DecodeElement(tmprunlevelelts.ProofErr, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermStart = NewCT_PermStart() + if err := d.DecodeElement(tmprunlevelelts.PermStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermEnd = NewCT_Perm() + if err := d.DecodeElement(tmprunlevelelts.PermEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Ins = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Ins, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Del = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Del, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFrom"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveFrom = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveFrom, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveTo"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveTo = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveTo, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkStart = NewCT_Bookmark() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeStart = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMathPara"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMathPara = math.NewOMathPara() + if err := d.DecodeElement(tmpmathcontent.OMathPara, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMath"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMath = math.NewOMath() + if err := d.DecodeElement(tmpmathcontent.OMath, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + default: + gooxml.Log("skipping unsupported element on CT_CustomXmlBlock %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_CustomXmlBlock + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_CustomXmlBlock and its children +func (m *CT_CustomXmlBlock) Validate() error { + return m.ValidateWithPath("CT_CustomXmlBlock") +} + +// ValidateWithPath validates the CT_CustomXmlBlock and its children, prefixing error messages with path +func (m *CT_CustomXmlBlock) ValidateWithPath(path string) error { + if m.CustomXmlPr != nil { + if err := m.CustomXmlPr.ValidateWithPath(path + "/CustomXmlPr"); err != nil { + return err + } + } + for i, v := range m.EG_ContentBlockContent { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_ContentBlockContent[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_CustomXmlCell.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_CustomXmlCell.go new file mode 100644 index 00000000..d2e2e4af --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_CustomXmlCell.go @@ -0,0 +1,405 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/math" +) + +type CT_CustomXmlCell struct { + // Custom XML Element Namespace + UriAttr *string + // Custom XML Element Name + ElementAttr string + // Custom XML Element Properties + CustomXmlPr *CT_CustomXmlPr + EG_ContentCellContent []*EG_ContentCellContent +} + +func NewCT_CustomXmlCell() *CT_CustomXmlCell { + ret := &CT_CustomXmlCell{} + return ret +} + +func (m *CT_CustomXmlCell) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.UriAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:uri"}, + Value: fmt.Sprintf("%v", *m.UriAttr)}) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:element"}, + Value: fmt.Sprintf("%v", m.ElementAttr)}) + e.EncodeToken(start) + if m.CustomXmlPr != nil { + secustomXmlPr := xml.StartElement{Name: xml.Name{Local: "w:customXmlPr"}} + e.EncodeElement(m.CustomXmlPr, secustomXmlPr) + } + if m.EG_ContentCellContent != nil { + for _, c := range m.EG_ContentCellContent { + c.MarshalXML(e, xml.StartElement{}) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_CustomXmlCell) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "uri" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.UriAttr = &parsed + continue + } + if attr.Name.Local == "element" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ElementAttr = parsed + continue + } + } +lCT_CustomXmlCell: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlPr"}: + m.CustomXmlPr = NewCT_CustomXmlPr() + if err := d.DecodeElement(m.CustomXmlPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tc"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmp := NewCT_Tc() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + tmpcontentcellcontent.Tc = append(tmpcontentcellcontent.Tc, tmp) + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXml"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmpcontentcellcontent.CustomXml = NewCT_CustomXmlCell() + if err := d.DecodeElement(tmpcontentcellcontent.CustomXml, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdt"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmpcontentcellcontent.Sdt = NewCT_SdtCell() + if err := d.DecodeElement(tmpcontentcellcontent.Sdt, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "proofErr"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.ProofErr = NewCT_ProofErr() + if err := d.DecodeElement(tmprunlevelelts.ProofErr, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permStart"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermStart = NewCT_PermStart() + if err := d.DecodeElement(tmprunlevelelts.PermStart, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permEnd"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermEnd = NewCT_Perm() + if err := d.DecodeElement(tmprunlevelelts.PermEnd, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Ins = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Ins, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Del = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Del, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFrom"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveFrom = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveFrom, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveTo"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveTo = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveTo, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkStart"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkStart = NewCT_Bookmark() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkStart, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkEnd"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkEnd, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeStart"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeStart, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeEnd"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeStart"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeStart, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeEnd"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeEnd, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeStart"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeStart = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeStart, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeEnd"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeEnd, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeStart"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeStart, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeEnd"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeEnd, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeStart"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeStart, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeEnd"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeEnd, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeStart"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeStart, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeEnd"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeStart"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeStart, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeEnd"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeEnd, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMathPara"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMathPara = math.NewOMathPara() + if err := d.DecodeElement(tmpmathcontent.OMathPara, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMath"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMath = math.NewOMath() + if err := d.DecodeElement(tmpmathcontent.OMath, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + default: + gooxml.Log("skipping unsupported element on CT_CustomXmlCell %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_CustomXmlCell + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_CustomXmlCell and its children +func (m *CT_CustomXmlCell) Validate() error { + return m.ValidateWithPath("CT_CustomXmlCell") +} + +// ValidateWithPath validates the CT_CustomXmlCell and its children, prefixing error messages with path +func (m *CT_CustomXmlCell) ValidateWithPath(path string) error { + if m.CustomXmlPr != nil { + if err := m.CustomXmlPr.ValidateWithPath(path + "/CustomXmlPr"); err != nil { + return err + } + } + for i, v := range m.EG_ContentCellContent { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_ContentCellContent[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_CustomXmlPr.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_CustomXmlPr.go new file mode 100644 index 00000000..6e906afd --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_CustomXmlPr.go @@ -0,0 +1,101 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_CustomXmlPr struct { + // Custom XML Element Placeholder Text + Placeholder *CT_String + // Custom XML Attribute + Attr []*CT_Attr +} + +func NewCT_CustomXmlPr() *CT_CustomXmlPr { + ret := &CT_CustomXmlPr{} + return ret +} + +func (m *CT_CustomXmlPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Placeholder != nil { + seplaceholder := xml.StartElement{Name: xml.Name{Local: "w:placeholder"}} + e.EncodeElement(m.Placeholder, seplaceholder) + } + if m.Attr != nil { + seattr := xml.StartElement{Name: xml.Name{Local: "w:attr"}} + for _, c := range m.Attr { + e.EncodeElement(c, seattr) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_CustomXmlPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_CustomXmlPr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "placeholder"}: + m.Placeholder = NewCT_String() + if err := d.DecodeElement(m.Placeholder, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "attr"}: + tmp := NewCT_Attr() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Attr = append(m.Attr, tmp) + default: + gooxml.Log("skipping unsupported element on CT_CustomXmlPr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_CustomXmlPr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_CustomXmlPr and its children +func (m *CT_CustomXmlPr) Validate() error { + return m.ValidateWithPath("CT_CustomXmlPr") +} + +// ValidateWithPath validates the CT_CustomXmlPr and its children, prefixing error messages with path +func (m *CT_CustomXmlPr) ValidateWithPath(path string) error { + if m.Placeholder != nil { + if err := m.Placeholder.ValidateWithPath(path + "/Placeholder"); err != nil { + return err + } + } + for i, v := range m.Attr { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Attr[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_CustomXmlRow.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_CustomXmlRow.go new file mode 100644 index 00000000..a3fe8657 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_CustomXmlRow.go @@ -0,0 +1,405 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/math" +) + +type CT_CustomXmlRow struct { + // Custom XML Element Namespace + UriAttr *string + // Custom XML Element Name + ElementAttr string + // Custom XML Element Properties + CustomXmlPr *CT_CustomXmlPr + EG_ContentRowContent []*EG_ContentRowContent +} + +func NewCT_CustomXmlRow() *CT_CustomXmlRow { + ret := &CT_CustomXmlRow{} + return ret +} + +func (m *CT_CustomXmlRow) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.UriAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:uri"}, + Value: fmt.Sprintf("%v", *m.UriAttr)}) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:element"}, + Value: fmt.Sprintf("%v", m.ElementAttr)}) + e.EncodeToken(start) + if m.CustomXmlPr != nil { + secustomXmlPr := xml.StartElement{Name: xml.Name{Local: "w:customXmlPr"}} + e.EncodeElement(m.CustomXmlPr, secustomXmlPr) + } + if m.EG_ContentRowContent != nil { + for _, c := range m.EG_ContentRowContent { + c.MarshalXML(e, xml.StartElement{}) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_CustomXmlRow) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "uri" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.UriAttr = &parsed + continue + } + if attr.Name.Local == "element" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ElementAttr = parsed + continue + } + } +lCT_CustomXmlRow: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlPr"}: + m.CustomXmlPr = NewCT_CustomXmlPr() + if err := d.DecodeElement(m.CustomXmlPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tr"}: + tmpcontentrowcontent := NewEG_ContentRowContent() + tmp := NewCT_Row() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + tmpcontentrowcontent.Tr = append(tmpcontentrowcontent.Tr, tmp) + m.EG_ContentRowContent = append(m.EG_ContentRowContent, tmpcontentrowcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXml"}: + tmpcontentrowcontent := NewEG_ContentRowContent() + tmpcontentrowcontent.CustomXml = NewCT_CustomXmlRow() + if err := d.DecodeElement(tmpcontentrowcontent.CustomXml, &el); err != nil { + return err + } + m.EG_ContentRowContent = append(m.EG_ContentRowContent, tmpcontentrowcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdt"}: + tmpcontentrowcontent := NewEG_ContentRowContent() + tmpcontentrowcontent.Sdt = NewCT_SdtRow() + if err := d.DecodeElement(tmpcontentrowcontent.Sdt, &el); err != nil { + return err + } + m.EG_ContentRowContent = append(m.EG_ContentRowContent, tmpcontentrowcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "proofErr"}: + tmpcontentrowcontent := NewEG_ContentRowContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.ProofErr = NewCT_ProofErr() + if err := d.DecodeElement(tmprunlevelelts.ProofErr, &el); err != nil { + return err + } + m.EG_ContentRowContent = append(m.EG_ContentRowContent, tmpcontentrowcontent) + tmpcontentrowcontent.EG_RunLevelElts = append(tmpcontentrowcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permStart"}: + tmpcontentrowcontent := NewEG_ContentRowContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermStart = NewCT_PermStart() + if err := d.DecodeElement(tmprunlevelelts.PermStart, &el); err != nil { + return err + } + m.EG_ContentRowContent = append(m.EG_ContentRowContent, tmpcontentrowcontent) + tmpcontentrowcontent.EG_RunLevelElts = append(tmpcontentrowcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permEnd"}: + tmpcontentrowcontent := NewEG_ContentRowContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermEnd = NewCT_Perm() + if err := d.DecodeElement(tmprunlevelelts.PermEnd, &el); err != nil { + return err + } + m.EG_ContentRowContent = append(m.EG_ContentRowContent, tmpcontentrowcontent) + tmpcontentrowcontent.EG_RunLevelElts = append(tmpcontentrowcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + tmpcontentrowcontent := NewEG_ContentRowContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Ins = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Ins, &el); err != nil { + return err + } + m.EG_ContentRowContent = append(m.EG_ContentRowContent, tmpcontentrowcontent) + tmpcontentrowcontent.EG_RunLevelElts = append(tmpcontentrowcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + tmpcontentrowcontent := NewEG_ContentRowContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Del = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Del, &el); err != nil { + return err + } + m.EG_ContentRowContent = append(m.EG_ContentRowContent, tmpcontentrowcontent) + tmpcontentrowcontent.EG_RunLevelElts = append(tmpcontentrowcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFrom"}: + tmpcontentrowcontent := NewEG_ContentRowContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveFrom = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveFrom, &el); err != nil { + return err + } + m.EG_ContentRowContent = append(m.EG_ContentRowContent, tmpcontentrowcontent) + tmpcontentrowcontent.EG_RunLevelElts = append(tmpcontentrowcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveTo"}: + tmpcontentrowcontent := NewEG_ContentRowContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveTo = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveTo, &el); err != nil { + return err + } + m.EG_ContentRowContent = append(m.EG_ContentRowContent, tmpcontentrowcontent) + tmpcontentrowcontent.EG_RunLevelElts = append(tmpcontentrowcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkStart"}: + tmpcontentrowcontent := NewEG_ContentRowContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkStart = NewCT_Bookmark() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkStart, &el); err != nil { + return err + } + m.EG_ContentRowContent = append(m.EG_ContentRowContent, tmpcontentrowcontent) + tmpcontentrowcontent.EG_RunLevelElts = append(tmpcontentrowcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkEnd"}: + tmpcontentrowcontent := NewEG_ContentRowContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkEnd, &el); err != nil { + return err + } + m.EG_ContentRowContent = append(m.EG_ContentRowContent, tmpcontentrowcontent) + tmpcontentrowcontent.EG_RunLevelElts = append(tmpcontentrowcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeStart"}: + tmpcontentrowcontent := NewEG_ContentRowContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeStart, &el); err != nil { + return err + } + m.EG_ContentRowContent = append(m.EG_ContentRowContent, tmpcontentrowcontent) + tmpcontentrowcontent.EG_RunLevelElts = append(tmpcontentrowcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeEnd"}: + tmpcontentrowcontent := NewEG_ContentRowContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRowContent = append(m.EG_ContentRowContent, tmpcontentrowcontent) + tmpcontentrowcontent.EG_RunLevelElts = append(tmpcontentrowcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeStart"}: + tmpcontentrowcontent := NewEG_ContentRowContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeStart, &el); err != nil { + return err + } + m.EG_ContentRowContent = append(m.EG_ContentRowContent, tmpcontentrowcontent) + tmpcontentrowcontent.EG_RunLevelElts = append(tmpcontentrowcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeEnd"}: + tmpcontentrowcontent := NewEG_ContentRowContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRowContent = append(m.EG_ContentRowContent, tmpcontentrowcontent) + tmpcontentrowcontent.EG_RunLevelElts = append(tmpcontentrowcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeStart"}: + tmpcontentrowcontent := NewEG_ContentRowContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeStart = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeStart, &el); err != nil { + return err + } + m.EG_ContentRowContent = append(m.EG_ContentRowContent, tmpcontentrowcontent) + tmpcontentrowcontent.EG_RunLevelElts = append(tmpcontentrowcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeEnd"}: + tmpcontentrowcontent := NewEG_ContentRowContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRowContent = append(m.EG_ContentRowContent, tmpcontentrowcontent) + tmpcontentrowcontent.EG_RunLevelElts = append(tmpcontentrowcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeStart"}: + tmpcontentrowcontent := NewEG_ContentRowContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeStart, &el); err != nil { + return err + } + m.EG_ContentRowContent = append(m.EG_ContentRowContent, tmpcontentrowcontent) + tmpcontentrowcontent.EG_RunLevelElts = append(tmpcontentrowcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeEnd"}: + tmpcontentrowcontent := NewEG_ContentRowContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRowContent = append(m.EG_ContentRowContent, tmpcontentrowcontent) + tmpcontentrowcontent.EG_RunLevelElts = append(tmpcontentrowcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeStart"}: + tmpcontentrowcontent := NewEG_ContentRowContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeStart, &el); err != nil { + return err + } + m.EG_ContentRowContent = append(m.EG_ContentRowContent, tmpcontentrowcontent) + tmpcontentrowcontent.EG_RunLevelElts = append(tmpcontentrowcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeEnd"}: + tmpcontentrowcontent := NewEG_ContentRowContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRowContent = append(m.EG_ContentRowContent, tmpcontentrowcontent) + tmpcontentrowcontent.EG_RunLevelElts = append(tmpcontentrowcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeStart"}: + tmpcontentrowcontent := NewEG_ContentRowContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeStart, &el); err != nil { + return err + } + m.EG_ContentRowContent = append(m.EG_ContentRowContent, tmpcontentrowcontent) + tmpcontentrowcontent.EG_RunLevelElts = append(tmpcontentrowcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeEnd"}: + tmpcontentrowcontent := NewEG_ContentRowContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRowContent = append(m.EG_ContentRowContent, tmpcontentrowcontent) + tmpcontentrowcontent.EG_RunLevelElts = append(tmpcontentrowcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeStart"}: + tmpcontentrowcontent := NewEG_ContentRowContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeStart, &el); err != nil { + return err + } + m.EG_ContentRowContent = append(m.EG_ContentRowContent, tmpcontentrowcontent) + tmpcontentrowcontent.EG_RunLevelElts = append(tmpcontentrowcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeEnd"}: + tmpcontentrowcontent := NewEG_ContentRowContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRowContent = append(m.EG_ContentRowContent, tmpcontentrowcontent) + tmpcontentrowcontent.EG_RunLevelElts = append(tmpcontentrowcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMathPara"}: + tmpcontentrowcontent := NewEG_ContentRowContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMathPara = math.NewOMathPara() + if err := d.DecodeElement(tmpmathcontent.OMathPara, &el); err != nil { + return err + } + m.EG_ContentRowContent = append(m.EG_ContentRowContent, tmpcontentrowcontent) + tmpcontentrowcontent.EG_RunLevelElts = append(tmpcontentrowcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMath"}: + tmpcontentrowcontent := NewEG_ContentRowContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMath = math.NewOMath() + if err := d.DecodeElement(tmpmathcontent.OMath, &el); err != nil { + return err + } + m.EG_ContentRowContent = append(m.EG_ContentRowContent, tmpcontentrowcontent) + tmpcontentrowcontent.EG_RunLevelElts = append(tmpcontentrowcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + default: + gooxml.Log("skipping unsupported element on CT_CustomXmlRow %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_CustomXmlRow + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_CustomXmlRow and its children +func (m *CT_CustomXmlRow) Validate() error { + return m.ValidateWithPath("CT_CustomXmlRow") +} + +// ValidateWithPath validates the CT_CustomXmlRow and its children, prefixing error messages with path +func (m *CT_CustomXmlRow) ValidateWithPath(path string) error { + if m.CustomXmlPr != nil { + if err := m.CustomXmlPr.ValidateWithPath(path + "/CustomXmlPr"); err != nil { + return err + } + } + for i, v := range m.EG_ContentRowContent { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_ContentRowContent[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_CustomXmlRun.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_CustomXmlRun.go new file mode 100644 index 00000000..9734826f --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_CustomXmlRun.go @@ -0,0 +1,509 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/math" +) + +type CT_CustomXmlRun struct { + // Custom XML Markup Namespace + UriAttr *string + // Element name + ElementAttr string + // Custom XML Element Properties + CustomXmlPr *CT_CustomXmlPr + EG_PContent []*EG_PContent +} + +func NewCT_CustomXmlRun() *CT_CustomXmlRun { + ret := &CT_CustomXmlRun{} + return ret +} + +func (m *CT_CustomXmlRun) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.UriAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:uri"}, + Value: fmt.Sprintf("%v", *m.UriAttr)}) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:element"}, + Value: fmt.Sprintf("%v", m.ElementAttr)}) + e.EncodeToken(start) + if m.CustomXmlPr != nil { + secustomXmlPr := xml.StartElement{Name: xml.Name{Local: "w:customXmlPr"}} + e.EncodeElement(m.CustomXmlPr, secustomXmlPr) + } + if m.EG_PContent != nil { + for _, c := range m.EG_PContent { + c.MarshalXML(e, xml.StartElement{}) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_CustomXmlRun) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "uri" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.UriAttr = &parsed + continue + } + if attr.Name.Local == "element" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ElementAttr = parsed + continue + } + } +lCT_CustomXmlRun: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlPr"}: + m.CustomXmlPr = NewCT_CustomXmlPr() + if err := d.DecodeElement(m.CustomXmlPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "fldSimple"}: + tmppcontent := NewEG_PContent() + tmp := NewCT_SimpleField() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + tmppcontent.FldSimple = append(tmppcontent.FldSimple, tmp) + m.EG_PContent = append(m.EG_PContent, tmppcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "hyperlink"}: + tmppcontent := NewEG_PContent() + tmppcontent.Hyperlink = NewCT_Hyperlink() + if err := d.DecodeElement(tmppcontent.Hyperlink, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "subDoc"}: + tmppcontent := NewEG_PContent() + tmppcontent.SubDoc = NewCT_Rel() + if err := d.DecodeElement(tmppcontent.SubDoc, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXml"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.CustomXml = NewCT_CustomXmlRun() + if err := d.DecodeElement(tmpcontentruncontent.CustomXml, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "smartTag"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.SmartTag = NewCT_SmartTagRun() + if err := d.DecodeElement(tmpcontentruncontent.SmartTag, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdt"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.Sdt = NewCT_SdtRun() + if err := d.DecodeElement(tmpcontentruncontent.Sdt, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "dir"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.Dir = NewCT_DirContentRun() + if err := d.DecodeElement(tmpcontentruncontent.Dir, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bdo"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.Bdo = NewCT_BdoContentRun() + if err := d.DecodeElement(tmpcontentruncontent.Bdo, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "r"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.R = NewCT_R() + if err := d.DecodeElement(tmpcontentruncontent.R, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "proofErr"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.ProofErr = NewCT_ProofErr() + if err := d.DecodeElement(tmprunlevelelts.ProofErr, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permStart"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermStart = NewCT_PermStart() + if err := d.DecodeElement(tmprunlevelelts.PermStart, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permEnd"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermEnd = NewCT_Perm() + if err := d.DecodeElement(tmprunlevelelts.PermEnd, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Ins = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Ins, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Del = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Del, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFrom"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveFrom = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveFrom, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveTo"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveTo = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveTo, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkStart"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkStart = NewCT_Bookmark() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkStart, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkEnd"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkEnd, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeStart"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeStart, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeEnd"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeStart"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeStart, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeEnd"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeEnd, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeStart"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeStart = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeStart, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeEnd"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeEnd, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeStart"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeStart, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeEnd"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeEnd, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeStart"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeStart, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeEnd"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeEnd, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeStart"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeStart, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeEnd"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeStart"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeStart, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeEnd"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeEnd, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMathPara"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMathPara = math.NewOMathPara() + if err := d.DecodeElement(tmpmathcontent.OMathPara, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMath"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMath = math.NewOMath() + if err := d.DecodeElement(tmpmathcontent.OMath, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + default: + gooxml.Log("skipping unsupported element on CT_CustomXmlRun %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_CustomXmlRun + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_CustomXmlRun and its children +func (m *CT_CustomXmlRun) Validate() error { + return m.ValidateWithPath("CT_CustomXmlRun") +} + +// ValidateWithPath validates the CT_CustomXmlRun and its children, prefixing error messages with path +func (m *CT_CustomXmlRun) ValidateWithPath(path string) error { + if m.CustomXmlPr != nil { + if err := m.CustomXmlPr.ValidateWithPath(path + "/CustomXmlPr"); err != nil { + return err + } + } + for i, v := range m.EG_PContent { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_PContent[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DataBinding.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DataBinding.go new file mode 100644 index 00000000..325abc27 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DataBinding.go @@ -0,0 +1,94 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_DataBinding struct { + // XML Namespace Prefix Mappings + PrefixMappingsAttr *string + // XPath + XpathAttr string + // Custom XML Data Storage ID + StoreItemIDAttr string +} + +func NewCT_DataBinding() *CT_DataBinding { + ret := &CT_DataBinding{} + return ret +} + +func (m *CT_DataBinding) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.PrefixMappingsAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:prefixMappings"}, + Value: fmt.Sprintf("%v", *m.PrefixMappingsAttr)}) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:xpath"}, + Value: fmt.Sprintf("%v", m.XpathAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:storeItemID"}, + Value: fmt.Sprintf("%v", m.StoreItemIDAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_DataBinding) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "prefixMappings" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.PrefixMappingsAttr = &parsed + continue + } + if attr.Name.Local == "xpath" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.XpathAttr = parsed + continue + } + if attr.Name.Local == "storeItemID" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.StoreItemIDAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_DataBinding: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_DataBinding and its children +func (m *CT_DataBinding) Validate() error { + return m.ValidateWithPath("CT_DataBinding") +} + +// ValidateWithPath validates the CT_DataBinding and its children, prefixing error messages with path +func (m *CT_DataBinding) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DecimalNumber.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DecimalNumber.go new file mode 100644 index 00000000..e97d61fe --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DecimalNumber.go @@ -0,0 +1,69 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" +) + +type CT_DecimalNumber struct { + // Decimal Number Value + ValAttr int64 +} + +func NewCT_DecimalNumber() *CT_DecimalNumber { + ret := &CT_DecimalNumber{} + return ret +} + +func (m *CT_DecimalNumber) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:val"}, + Value: fmt.Sprintf("%v", m.ValAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_DecimalNumber) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.ValAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_DecimalNumber: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_DecimalNumber and its children +func (m *CT_DecimalNumber) Validate() error { + return m.ValidateWithPath("CT_DecimalNumber") +} + +// ValidateWithPath validates the CT_DecimalNumber and its children, prefixing error messages with path +func (m *CT_DecimalNumber) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DecimalNumberOrPrecent.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DecimalNumberOrPrecent.go new file mode 100644 index 00000000..7ebace28 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DecimalNumberOrPrecent.go @@ -0,0 +1,71 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_DecimalNumberOrPrecent struct { + // Value in Percent + ValAttr ST_DecimalNumberOrPercent +} + +func NewCT_DecimalNumberOrPrecent() *CT_DecimalNumberOrPrecent { + ret := &CT_DecimalNumberOrPrecent{} + return ret +} + +func (m *CT_DecimalNumberOrPrecent) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:val"}, + Value: fmt.Sprintf("%v", m.ValAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_DecimalNumberOrPrecent) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := ParseUnionST_DecimalNumberOrPercent(attr.Value) + if err != nil { + return err + } + m.ValAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_DecimalNumberOrPrecent: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_DecimalNumberOrPrecent and its children +func (m *CT_DecimalNumberOrPrecent) Validate() error { + return m.ValidateWithPath("CT_DecimalNumberOrPrecent") +} + +// ValidateWithPath validates the CT_DecimalNumberOrPrecent and its children, prefixing error messages with path +func (m *CT_DecimalNumberOrPrecent) ValidateWithPath(path string) error { + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DirContentRun.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DirContentRun.go new file mode 100644 index 00000000..365897ff --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DirContentRun.go @@ -0,0 +1,450 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/math" +) + +type CT_DirContentRun struct { + // Direction of Embedding + ValAttr ST_Direction + // Simple Field + FldSimple []*CT_SimpleField + // Hyperlink + Hyperlink *CT_Hyperlink + // Anchor for Subdocument Location + SubDoc *CT_Rel + EG_ContentRunContent []*EG_ContentRunContent +} + +func NewCT_DirContentRun() *CT_DirContentRun { + ret := &CT_DirContentRun{} + return ret +} + +func (m *CT_DirContentRun) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.ValAttr != ST_DirectionUnset { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + if m.FldSimple != nil { + sefldSimple := xml.StartElement{Name: xml.Name{Local: "w:fldSimple"}} + for _, c := range m.FldSimple { + e.EncodeElement(c, sefldSimple) + } + } + if m.Hyperlink != nil { + sehyperlink := xml.StartElement{Name: xml.Name{Local: "w:hyperlink"}} + e.EncodeElement(m.Hyperlink, sehyperlink) + } + if m.SubDoc != nil { + sesubDoc := xml.StartElement{Name: xml.Name{Local: "w:subDoc"}} + e.EncodeElement(m.SubDoc, sesubDoc) + } + if m.EG_ContentRunContent != nil { + for _, c := range m.EG_ContentRunContent { + c.MarshalXML(e, xml.StartElement{}) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_DirContentRun) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } +lCT_DirContentRun: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "fldSimple"}: + tmp := NewCT_SimpleField() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.FldSimple = append(m.FldSimple, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "hyperlink"}: + m.Hyperlink = NewCT_Hyperlink() + if err := d.DecodeElement(m.Hyperlink, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "subDoc"}: + m.SubDoc = NewCT_Rel() + if err := d.DecodeElement(m.SubDoc, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXml"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.CustomXml = NewCT_CustomXmlRun() + if err := d.DecodeElement(tmpcontentruncontent.CustomXml, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "smartTag"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.SmartTag = NewCT_SmartTagRun() + if err := d.DecodeElement(tmpcontentruncontent.SmartTag, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdt"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.Sdt = NewCT_SdtRun() + if err := d.DecodeElement(tmpcontentruncontent.Sdt, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "dir"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.Dir = NewCT_DirContentRun() + if err := d.DecodeElement(tmpcontentruncontent.Dir, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bdo"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.Bdo = NewCT_BdoContentRun() + if err := d.DecodeElement(tmpcontentruncontent.Bdo, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "r"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.R = NewCT_R() + if err := d.DecodeElement(tmpcontentruncontent.R, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "proofErr"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.ProofErr = NewCT_ProofErr() + if err := d.DecodeElement(tmprunlevelelts.ProofErr, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermStart = NewCT_PermStart() + if err := d.DecodeElement(tmprunlevelelts.PermStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermEnd = NewCT_Perm() + if err := d.DecodeElement(tmprunlevelelts.PermEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Ins = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Ins, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Del = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Del, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFrom"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveFrom = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveFrom, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveTo"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveTo = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveTo, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkStart = NewCT_Bookmark() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeStart = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMathPara"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMathPara = math.NewOMathPara() + if err := d.DecodeElement(tmpmathcontent.OMathPara, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMath"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMath = math.NewOMath() + if err := d.DecodeElement(tmpmathcontent.OMath, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + default: + gooxml.Log("skipping unsupported element on CT_DirContentRun %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_DirContentRun + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_DirContentRun and its children +func (m *CT_DirContentRun) Validate() error { + return m.ValidateWithPath("CT_DirContentRun") +} + +// ValidateWithPath validates the CT_DirContentRun and its children, prefixing error messages with path +func (m *CT_DirContentRun) ValidateWithPath(path string) error { + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + for i, v := range m.FldSimple { + if err := v.ValidateWithPath(fmt.Sprintf("%s/FldSimple[%d]", path, i)); err != nil { + return err + } + } + if m.Hyperlink != nil { + if err := m.Hyperlink.ValidateWithPath(path + "/Hyperlink"); err != nil { + return err + } + } + if m.SubDoc != nil { + if err := m.SubDoc.ValidateWithPath(path + "/SubDoc"); err != nil { + return err + } + } + for i, v := range m.EG_ContentRunContent { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_ContentRunContent[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Div.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Div.go new file mode 100644 index 00000000..16d22a27 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Div.go @@ -0,0 +1,200 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type CT_Div struct { + // div Data ID + IdAttr int64 + // Data for HTML blockquote Element + BlockQuote *CT_OnOff + // Data for HTML body Element + BodyDiv *CT_OnOff + // Left Margin for HTML div + MarLeft *CT_SignedTwipsMeasure + // Right Margin for HTML div + MarRight *CT_SignedTwipsMeasure + // Top Margin for HTML div + MarTop *CT_SignedTwipsMeasure + // Bottom Margin for HTML div + MarBottom *CT_SignedTwipsMeasure + // Set of Borders for HTML div + DivBdr *CT_DivBdr + // Child div Elements Contained within Current div + DivsChild []*CT_Divs +} + +func NewCT_Div() *CT_Div { + ret := &CT_Div{} + ret.MarLeft = NewCT_SignedTwipsMeasure() + ret.MarRight = NewCT_SignedTwipsMeasure() + ret.MarTop = NewCT_SignedTwipsMeasure() + ret.MarBottom = NewCT_SignedTwipsMeasure() + return ret +} + +func (m *CT_Div) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:id"}, + Value: fmt.Sprintf("%v", m.IdAttr)}) + e.EncodeToken(start) + if m.BlockQuote != nil { + seblockQuote := xml.StartElement{Name: xml.Name{Local: "w:blockQuote"}} + e.EncodeElement(m.BlockQuote, seblockQuote) + } + if m.BodyDiv != nil { + sebodyDiv := xml.StartElement{Name: xml.Name{Local: "w:bodyDiv"}} + e.EncodeElement(m.BodyDiv, sebodyDiv) + } + semarLeft := xml.StartElement{Name: xml.Name{Local: "w:marLeft"}} + e.EncodeElement(m.MarLeft, semarLeft) + semarRight := xml.StartElement{Name: xml.Name{Local: "w:marRight"}} + e.EncodeElement(m.MarRight, semarRight) + semarTop := xml.StartElement{Name: xml.Name{Local: "w:marTop"}} + e.EncodeElement(m.MarTop, semarTop) + semarBottom := xml.StartElement{Name: xml.Name{Local: "w:marBottom"}} + e.EncodeElement(m.MarBottom, semarBottom) + if m.DivBdr != nil { + sedivBdr := xml.StartElement{Name: xml.Name{Local: "w:divBdr"}} + e.EncodeElement(m.DivBdr, sedivBdr) + } + if m.DivsChild != nil { + sedivsChild := xml.StartElement{Name: xml.Name{Local: "w:divsChild"}} + for _, c := range m.DivsChild { + e.EncodeElement(c, sedivsChild) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Div) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.MarLeft = NewCT_SignedTwipsMeasure() + m.MarRight = NewCT_SignedTwipsMeasure() + m.MarTop = NewCT_SignedTwipsMeasure() + m.MarBottom = NewCT_SignedTwipsMeasure() + for _, attr := range start.Attr { + if attr.Name.Local == "id" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.IdAttr = parsed + continue + } + } +lCT_Div: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "blockQuote"}: + m.BlockQuote = NewCT_OnOff() + if err := d.DecodeElement(m.BlockQuote, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bodyDiv"}: + m.BodyDiv = NewCT_OnOff() + if err := d.DecodeElement(m.BodyDiv, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "marLeft"}: + if err := d.DecodeElement(m.MarLeft, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "marRight"}: + if err := d.DecodeElement(m.MarRight, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "marTop"}: + if err := d.DecodeElement(m.MarTop, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "marBottom"}: + if err := d.DecodeElement(m.MarBottom, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "divBdr"}: + m.DivBdr = NewCT_DivBdr() + if err := d.DecodeElement(m.DivBdr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "divsChild"}: + tmp := NewCT_Divs() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.DivsChild = append(m.DivsChild, tmp) + default: + gooxml.Log("skipping unsupported element on CT_Div %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Div + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Div and its children +func (m *CT_Div) Validate() error { + return m.ValidateWithPath("CT_Div") +} + +// ValidateWithPath validates the CT_Div and its children, prefixing error messages with path +func (m *CT_Div) ValidateWithPath(path string) error { + if m.BlockQuote != nil { + if err := m.BlockQuote.ValidateWithPath(path + "/BlockQuote"); err != nil { + return err + } + } + if m.BodyDiv != nil { + if err := m.BodyDiv.ValidateWithPath(path + "/BodyDiv"); err != nil { + return err + } + } + if err := m.MarLeft.ValidateWithPath(path + "/MarLeft"); err != nil { + return err + } + if err := m.MarRight.ValidateWithPath(path + "/MarRight"); err != nil { + return err + } + if err := m.MarTop.ValidateWithPath(path + "/MarTop"); err != nil { + return err + } + if err := m.MarBottom.ValidateWithPath(path + "/MarBottom"); err != nil { + return err + } + if m.DivBdr != nil { + if err := m.DivBdr.ValidateWithPath(path + "/DivBdr"); err != nil { + return err + } + } + for i, v := range m.DivsChild { + if err := v.ValidateWithPath(fmt.Sprintf("%s/DivsChild[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DivBdr.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DivBdr.go new file mode 100644 index 00000000..3e5d8a64 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DivBdr.go @@ -0,0 +1,129 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_DivBdr struct { + // Top Border for HTML div + Top *CT_Border + // Left Border for HTML div + Left *CT_Border + // Bottom Border for HTML div + Bottom *CT_Border + // Right Border for HTML div + Right *CT_Border +} + +func NewCT_DivBdr() *CT_DivBdr { + ret := &CT_DivBdr{} + return ret +} + +func (m *CT_DivBdr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Top != nil { + setop := xml.StartElement{Name: xml.Name{Local: "w:top"}} + e.EncodeElement(m.Top, setop) + } + if m.Left != nil { + seleft := xml.StartElement{Name: xml.Name{Local: "w:left"}} + e.EncodeElement(m.Left, seleft) + } + if m.Bottom != nil { + sebottom := xml.StartElement{Name: xml.Name{Local: "w:bottom"}} + e.EncodeElement(m.Bottom, sebottom) + } + if m.Right != nil { + seright := xml.StartElement{Name: xml.Name{Local: "w:right"}} + e.EncodeElement(m.Right, seright) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_DivBdr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_DivBdr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "top"}: + m.Top = NewCT_Border() + if err := d.DecodeElement(m.Top, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "left"}: + m.Left = NewCT_Border() + if err := d.DecodeElement(m.Left, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bottom"}: + m.Bottom = NewCT_Border() + if err := d.DecodeElement(m.Bottom, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "right"}: + m.Right = NewCT_Border() + if err := d.DecodeElement(m.Right, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_DivBdr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_DivBdr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_DivBdr and its children +func (m *CT_DivBdr) Validate() error { + return m.ValidateWithPath("CT_DivBdr") +} + +// ValidateWithPath validates the CT_DivBdr and its children, prefixing error messages with path +func (m *CT_DivBdr) ValidateWithPath(path string) error { + if m.Top != nil { + if err := m.Top.ValidateWithPath(path + "/Top"); err != nil { + return err + } + } + if m.Left != nil { + if err := m.Left.ValidateWithPath(path + "/Left"); err != nil { + return err + } + } + if m.Bottom != nil { + if err := m.Bottom.ValidateWithPath(path + "/Bottom"); err != nil { + return err + } + } + if m.Right != nil { + if err := m.Right.ValidateWithPath(path + "/Right"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Divs.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Divs.go new file mode 100644 index 00000000..f59e457e --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Divs.go @@ -0,0 +1,83 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_Divs struct { + // Information About Single HTML div Element + Div []*CT_Div +} + +func NewCT_Divs() *CT_Divs { + ret := &CT_Divs{} + return ret +} + +func (m *CT_Divs) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + sediv := xml.StartElement{Name: xml.Name{Local: "w:div"}} + for _, c := range m.Div { + e.EncodeElement(c, sediv) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Divs) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_Divs: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "div"}: + tmp := NewCT_Div() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Div = append(m.Div, tmp) + default: + gooxml.Log("skipping unsupported element on CT_Divs %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Divs + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Divs and its children +func (m *CT_Divs) Validate() error { + return m.ValidateWithPath("CT_Divs") +} + +// ValidateWithPath validates the CT_Divs and its children, prefixing error messages with path +func (m *CT_Divs) ValidateWithPath(path string) error { + for i, v := range m.Div { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Div[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocDefaults.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocDefaults.go new file mode 100644 index 00000000..8d73653e --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocDefaults.go @@ -0,0 +1,97 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_DocDefaults struct { + // Default Run Properties + RPrDefault *CT_RPrDefault + // Default Paragraph Properties + PPrDefault *CT_PPrDefault +} + +func NewCT_DocDefaults() *CT_DocDefaults { + ret := &CT_DocDefaults{} + return ret +} + +func (m *CT_DocDefaults) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.RPrDefault != nil { + serPrDefault := xml.StartElement{Name: xml.Name{Local: "w:rPrDefault"}} + e.EncodeElement(m.RPrDefault, serPrDefault) + } + if m.PPrDefault != nil { + sepPrDefault := xml.StartElement{Name: xml.Name{Local: "w:pPrDefault"}} + e.EncodeElement(m.PPrDefault, sepPrDefault) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_DocDefaults) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_DocDefaults: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rPrDefault"}: + m.RPrDefault = NewCT_RPrDefault() + if err := d.DecodeElement(m.RPrDefault, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pPrDefault"}: + m.PPrDefault = NewCT_PPrDefault() + if err := d.DecodeElement(m.PPrDefault, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_DocDefaults %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_DocDefaults + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_DocDefaults and its children +func (m *CT_DocDefaults) Validate() error { + return m.ValidateWithPath("CT_DocDefaults") +} + +// ValidateWithPath validates the CT_DocDefaults and its children, prefixing error messages with path +func (m *CT_DocDefaults) ValidateWithPath(path string) error { + if m.RPrDefault != nil { + if err := m.RPrDefault.ValidateWithPath(path + "/RPrDefault"); err != nil { + return err + } + } + if m.PPrDefault != nil { + if err := m.PPrDefault.ValidateWithPath(path + "/PPrDefault"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocGrid.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocGrid.go new file mode 100644 index 00000000..bb0b58a1 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocGrid.go @@ -0,0 +1,101 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" +) + +type CT_DocGrid struct { + // Document Grid Type + TypeAttr ST_DocGrid + // Document Grid Line Pitch + LinePitchAttr *int64 + // Document Grid Character Pitch + CharSpaceAttr *int64 +} + +func NewCT_DocGrid() *CT_DocGrid { + ret := &CT_DocGrid{} + return ret +} + +func (m *CT_DocGrid) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.TypeAttr != ST_DocGridUnset { + attr, err := m.TypeAttr.MarshalXMLAttr(xml.Name{Local: "w:type"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.LinePitchAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:linePitch"}, + Value: fmt.Sprintf("%v", *m.LinePitchAttr)}) + } + if m.CharSpaceAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:charSpace"}, + Value: fmt.Sprintf("%v", *m.CharSpaceAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_DocGrid) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "type" { + m.TypeAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "linePitch" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.LinePitchAttr = &parsed + continue + } + if attr.Name.Local == "charSpace" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.CharSpaceAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_DocGrid: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_DocGrid and its children +func (m *CT_DocGrid) Validate() error { + return m.ValidateWithPath("CT_DocGrid") +} + +// ValidateWithPath validates the CT_DocGrid and its children, prefixing error messages with path +func (m *CT_DocGrid) ValidateWithPath(path string) error { + if err := m.TypeAttr.ValidateWithPath(path + "/TypeAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocPart.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocPart.go new file mode 100644 index 00000000..69193db9 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocPart.go @@ -0,0 +1,97 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_DocPart struct { + // Glossary Document Entry Properties + DocPartPr *CT_DocPartPr + // Contents of Glossary Document Entry + DocPartBody *CT_Body +} + +func NewCT_DocPart() *CT_DocPart { + ret := &CT_DocPart{} + return ret +} + +func (m *CT_DocPart) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.DocPartPr != nil { + sedocPartPr := xml.StartElement{Name: xml.Name{Local: "w:docPartPr"}} + e.EncodeElement(m.DocPartPr, sedocPartPr) + } + if m.DocPartBody != nil { + sedocPartBody := xml.StartElement{Name: xml.Name{Local: "w:docPartBody"}} + e.EncodeElement(m.DocPartBody, sedocPartBody) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_DocPart) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_DocPart: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "docPartPr"}: + m.DocPartPr = NewCT_DocPartPr() + if err := d.DecodeElement(m.DocPartPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "docPartBody"}: + m.DocPartBody = NewCT_Body() + if err := d.DecodeElement(m.DocPartBody, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_DocPart %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_DocPart + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_DocPart and its children +func (m *CT_DocPart) Validate() error { + return m.ValidateWithPath("CT_DocPart") +} + +// ValidateWithPath validates the CT_DocPart and its children, prefixing error messages with path +func (m *CT_DocPart) ValidateWithPath(path string) error { + if m.DocPartPr != nil { + if err := m.DocPartPr.ValidateWithPath(path + "/DocPartPr"); err != nil { + return err + } + } + if m.DocPartBody != nil { + if err := m.DocPartBody.ValidateWithPath(path + "/DocPartBody"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocPartBehavior.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocPartBehavior.go new file mode 100644 index 00000000..5514ef62 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocPartBehavior.go @@ -0,0 +1,75 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_DocPartBehavior struct { + // Insertion Behavior Value + ValAttr ST_DocPartBehavior +} + +func NewCT_DocPartBehavior() *CT_DocPartBehavior { + ret := &CT_DocPartBehavior{} + ret.ValAttr = ST_DocPartBehavior(1) + return ret +} + +func (m *CT_DocPartBehavior) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_DocPartBehavior) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_DocPartBehavior(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_DocPartBehavior: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_DocPartBehavior and its children +func (m *CT_DocPartBehavior) Validate() error { + return m.ValidateWithPath("CT_DocPartBehavior") +} + +// ValidateWithPath validates the CT_DocPartBehavior and its children, prefixing error messages with path +func (m *CT_DocPartBehavior) ValidateWithPath(path string) error { + if m.ValAttr == ST_DocPartBehaviorUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocPartBehaviors.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocPartBehaviors.go new file mode 100644 index 00000000..9e27c037 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocPartBehaviors.go @@ -0,0 +1,85 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_DocPartBehaviors struct { + // Entry Insertion Behavior + Behavior []*CT_DocPartBehavior +} + +func NewCT_DocPartBehaviors() *CT_DocPartBehaviors { + ret := &CT_DocPartBehaviors{} + return ret +} + +func (m *CT_DocPartBehaviors) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Behavior != nil { + sebehavior := xml.StartElement{Name: xml.Name{Local: "w:behavior"}} + for _, c := range m.Behavior { + e.EncodeElement(c, sebehavior) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_DocPartBehaviors) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_DocPartBehaviors: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "behavior"}: + tmp := NewCT_DocPartBehavior() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Behavior = append(m.Behavior, tmp) + default: + gooxml.Log("skipping unsupported element on CT_DocPartBehaviors %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_DocPartBehaviors + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_DocPartBehaviors and its children +func (m *CT_DocPartBehaviors) Validate() error { + return m.ValidateWithPath("CT_DocPartBehaviors") +} + +// ValidateWithPath validates the CT_DocPartBehaviors and its children, prefixing error messages with path +func (m *CT_DocPartBehaviors) ValidateWithPath(path string) error { + for i, v := range m.Behavior { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Behavior[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocPartCategory.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocPartCategory.go new file mode 100644 index 00000000..ff2f8023 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocPartCategory.go @@ -0,0 +1,91 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_DocPartCategory struct { + // Category Associated With Entry + Name *CT_String + // Gallery Associated With Entry + Gallery *CT_DocPartGallery +} + +func NewCT_DocPartCategory() *CT_DocPartCategory { + ret := &CT_DocPartCategory{} + ret.Name = NewCT_String() + ret.Gallery = NewCT_DocPartGallery() + return ret +} + +func (m *CT_DocPartCategory) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + sename := xml.StartElement{Name: xml.Name{Local: "w:name"}} + e.EncodeElement(m.Name, sename) + segallery := xml.StartElement{Name: xml.Name{Local: "w:gallery"}} + e.EncodeElement(m.Gallery, segallery) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_DocPartCategory) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.Name = NewCT_String() + m.Gallery = NewCT_DocPartGallery() +lCT_DocPartCategory: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "name"}: + if err := d.DecodeElement(m.Name, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "gallery"}: + if err := d.DecodeElement(m.Gallery, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_DocPartCategory %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_DocPartCategory + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_DocPartCategory and its children +func (m *CT_DocPartCategory) Validate() error { + return m.ValidateWithPath("CT_DocPartCategory") +} + +// ValidateWithPath validates the CT_DocPartCategory and its children, prefixing error messages with path +func (m *CT_DocPartCategory) ValidateWithPath(path string) error { + if err := m.Name.ValidateWithPath(path + "/Name"); err != nil { + return err + } + if err := m.Gallery.ValidateWithPath(path + "/Gallery"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocPartGallery.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocPartGallery.go new file mode 100644 index 00000000..c5fbed57 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocPartGallery.go @@ -0,0 +1,75 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_DocPartGallery struct { + // Gallery Value + ValAttr ST_DocPartGallery +} + +func NewCT_DocPartGallery() *CT_DocPartGallery { + ret := &CT_DocPartGallery{} + ret.ValAttr = ST_DocPartGallery(1) + return ret +} + +func (m *CT_DocPartGallery) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_DocPartGallery) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_DocPartGallery(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_DocPartGallery: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_DocPartGallery and its children +func (m *CT_DocPartGallery) Validate() error { + return m.ValidateWithPath("CT_DocPartGallery") +} + +// ValidateWithPath validates the CT_DocPartGallery and its children, prefixing error messages with path +func (m *CT_DocPartGallery) ValidateWithPath(path string) error { + if m.ValAttr == ST_DocPartGalleryUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocPartName.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocPartName.go new file mode 100644 index 00000000..172d4ff9 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocPartName.go @@ -0,0 +1,89 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_DocPartName struct { + // Name Value + ValAttr string + // Built-In Entry + DecoratedAttr *sharedTypes.ST_OnOff +} + +func NewCT_DocPartName() *CT_DocPartName { + ret := &CT_DocPartName{} + return ret +} + +func (m *CT_DocPartName) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:val"}, + Value: fmt.Sprintf("%v", m.ValAttr)}) + if m.DecoratedAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:decorated"}, + Value: fmt.Sprintf("%v", *m.DecoratedAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_DocPartName) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ValAttr = parsed + continue + } + if attr.Name.Local == "decorated" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.DecoratedAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_DocPartName: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_DocPartName and its children +func (m *CT_DocPartName) Validate() error { + return m.ValidateWithPath("CT_DocPartName") +} + +// ValidateWithPath validates the CT_DocPartName and its children, prefixing error messages with path +func (m *CT_DocPartName) ValidateWithPath(path string) error { + if m.DecoratedAttr != nil { + if err := m.DecoratedAttr.ValidateWithPath(path + "/DecoratedAttr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocPartPr.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocPartPr.go new file mode 100644 index 00000000..3a55a187 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocPartPr.go @@ -0,0 +1,174 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_DocPartPr struct { + // Entry Name + Name *CT_DocPartName + // Associated Paragraph Style Name + Style *CT_String + // Entry Categorization + Category *CT_DocPartCategory + // Entry Types + Types *CT_DocPartTypes + // Entry Insertion Behaviors + Behaviors *CT_DocPartBehaviors + // Description for Entry + Description *CT_String + // Entry ID + Guid *CT_Guid +} + +func NewCT_DocPartPr() *CT_DocPartPr { + ret := &CT_DocPartPr{} + ret.Name = NewCT_DocPartName() + return ret +} + +func (m *CT_DocPartPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + sename := xml.StartElement{Name: xml.Name{Local: "w:name"}} + e.EncodeElement(m.Name, sename) + if m.Style != nil { + sestyle := xml.StartElement{Name: xml.Name{Local: "w:style"}} + e.EncodeElement(m.Style, sestyle) + } + if m.Category != nil { + secategory := xml.StartElement{Name: xml.Name{Local: "w:category"}} + e.EncodeElement(m.Category, secategory) + } + if m.Types != nil { + setypes := xml.StartElement{Name: xml.Name{Local: "w:types"}} + e.EncodeElement(m.Types, setypes) + } + if m.Behaviors != nil { + sebehaviors := xml.StartElement{Name: xml.Name{Local: "w:behaviors"}} + e.EncodeElement(m.Behaviors, sebehaviors) + } + if m.Description != nil { + sedescription := xml.StartElement{Name: xml.Name{Local: "w:description"}} + e.EncodeElement(m.Description, sedescription) + } + if m.Guid != nil { + seguid := xml.StartElement{Name: xml.Name{Local: "w:guid"}} + e.EncodeElement(m.Guid, seguid) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_DocPartPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.Name = NewCT_DocPartName() +lCT_DocPartPr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "name"}: + if err := d.DecodeElement(m.Name, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "style"}: + m.Style = NewCT_String() + if err := d.DecodeElement(m.Style, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "category"}: + m.Category = NewCT_DocPartCategory() + if err := d.DecodeElement(m.Category, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "types"}: + m.Types = NewCT_DocPartTypes() + if err := d.DecodeElement(m.Types, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "behaviors"}: + m.Behaviors = NewCT_DocPartBehaviors() + if err := d.DecodeElement(m.Behaviors, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "description"}: + m.Description = NewCT_String() + if err := d.DecodeElement(m.Description, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "guid"}: + m.Guid = NewCT_Guid() + if err := d.DecodeElement(m.Guid, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_DocPartPr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_DocPartPr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_DocPartPr and its children +func (m *CT_DocPartPr) Validate() error { + return m.ValidateWithPath("CT_DocPartPr") +} + +// ValidateWithPath validates the CT_DocPartPr and its children, prefixing error messages with path +func (m *CT_DocPartPr) ValidateWithPath(path string) error { + if err := m.Name.ValidateWithPath(path + "/Name"); err != nil { + return err + } + if m.Style != nil { + if err := m.Style.ValidateWithPath(path + "/Style"); err != nil { + return err + } + } + if m.Category != nil { + if err := m.Category.ValidateWithPath(path + "/Category"); err != nil { + return err + } + } + if m.Types != nil { + if err := m.Types.ValidateWithPath(path + "/Types"); err != nil { + return err + } + } + if m.Behaviors != nil { + if err := m.Behaviors.ValidateWithPath(path + "/Behaviors"); err != nil { + return err + } + } + if m.Description != nil { + if err := m.Description.ValidateWithPath(path + "/Description"); err != nil { + return err + } + } + if m.Guid != nil { + if err := m.Guid.ValidateWithPath(path + "/Guid"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocPartType.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocPartType.go new file mode 100644 index 00000000..38f82a7f --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocPartType.go @@ -0,0 +1,75 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_DocPartType struct { + // Type Value + ValAttr ST_DocPartType +} + +func NewCT_DocPartType() *CT_DocPartType { + ret := &CT_DocPartType{} + ret.ValAttr = ST_DocPartType(1) + return ret +} + +func (m *CT_DocPartType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_DocPartType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_DocPartType(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_DocPartType: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_DocPartType and its children +func (m *CT_DocPartType) Validate() error { + return m.ValidateWithPath("CT_DocPartType") +} + +// ValidateWithPath validates the CT_DocPartType and its children, prefixing error messages with path +func (m *CT_DocPartType) ValidateWithPath(path string) error { + if m.ValAttr == ST_DocPartTypeUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocPartTypes.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocPartTypes.go new file mode 100644 index 00000000..42cf1e82 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocPartTypes.go @@ -0,0 +1,107 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_DocPartTypes struct { + // Entry Is Of All Types + AllAttr *sharedTypes.ST_OnOff + // Entry Type + Type []*CT_DocPartType +} + +func NewCT_DocPartTypes() *CT_DocPartTypes { + ret := &CT_DocPartTypes{} + return ret +} + +func (m *CT_DocPartTypes) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.AllAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:all"}, + Value: fmt.Sprintf("%v", *m.AllAttr)}) + } + e.EncodeToken(start) + if m.Type != nil { + setype := xml.StartElement{Name: xml.Name{Local: "w:type"}} + for _, c := range m.Type { + e.EncodeElement(c, setype) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_DocPartTypes) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "all" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.AllAttr = &parsed + continue + } + } +lCT_DocPartTypes: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "type"}: + tmp := NewCT_DocPartType() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Type = append(m.Type, tmp) + default: + gooxml.Log("skipping unsupported element on CT_DocPartTypes %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_DocPartTypes + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_DocPartTypes and its children +func (m *CT_DocPartTypes) Validate() error { + return m.ValidateWithPath("CT_DocPartTypes") +} + +// ValidateWithPath validates the CT_DocPartTypes and its children, prefixing error messages with path +func (m *CT_DocPartTypes) ValidateWithPath(path string) error { + if m.AllAttr != nil { + if err := m.AllAttr.ValidateWithPath(path + "/AllAttr"); err != nil { + return err + } + } + for i, v := range m.Type { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Type[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocParts.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocParts.go new file mode 100644 index 00000000..8e2c8e38 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocParts.go @@ -0,0 +1,85 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_DocParts struct { + // Glossary Document Entry + DocPart []*CT_DocPart +} + +func NewCT_DocParts() *CT_DocParts { + ret := &CT_DocParts{} + return ret +} + +func (m *CT_DocParts) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.DocPart != nil { + sedocPart := xml.StartElement{Name: xml.Name{Local: "w:docPart"}} + for _, c := range m.DocPart { + e.EncodeElement(c, sedocPart) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_DocParts) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_DocParts: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "docPart"}: + tmp := NewCT_DocPart() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.DocPart = append(m.DocPart, tmp) + default: + gooxml.Log("skipping unsupported element on CT_DocParts %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_DocParts + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_DocParts and its children +func (m *CT_DocParts) Validate() error { + return m.ValidateWithPath("CT_DocParts") +} + +// ValidateWithPath validates the CT_DocParts and its children, prefixing error messages with path +func (m *CT_DocParts) ValidateWithPath(path string) error { + for i, v := range m.DocPart { + if err := v.ValidateWithPath(fmt.Sprintf("%s/DocPart[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocProtect.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocProtect.go new file mode 100644 index 00000000..77367c78 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocProtect.go @@ -0,0 +1,327 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_DocProtect struct { + // Document Editing Restrictions + EditAttr ST_DocProtect + // Only Allow Formatting With Unlocked Styles + FormattingAttr *sharedTypes.ST_OnOff + // Enforce Document Protection Settings + EnforcementAttr *sharedTypes.ST_OnOff + AlgorithmNameAttr *string + HashValueAttr *string + SaltValueAttr *string + SpinCountAttr *int64 + CryptProviderTypeAttr sharedTypes.ST_CryptProv + CryptAlgorithmClassAttr sharedTypes.ST_AlgClass + CryptAlgorithmTypeAttr sharedTypes.ST_AlgType + CryptAlgorithmSidAttr *int64 + CryptSpinCountAttr *int64 + CryptProviderAttr *string + AlgIdExtAttr *string + AlgIdExtSourceAttr *string + CryptProviderTypeExtAttr *string + CryptProviderTypeExtSourceAttr *string + HashAttr *string + SaltAttr *string +} + +func NewCT_DocProtect() *CT_DocProtect { + ret := &CT_DocProtect{} + return ret +} + +func (m *CT_DocProtect) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.EditAttr != ST_DocProtectUnset { + attr, err := m.EditAttr.MarshalXMLAttr(xml.Name{Local: "w:edit"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.FormattingAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:formatting"}, + Value: fmt.Sprintf("%v", *m.FormattingAttr)}) + } + if m.EnforcementAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:enforcement"}, + Value: fmt.Sprintf("%v", *m.EnforcementAttr)}) + } + if m.AlgorithmNameAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:algorithmName"}, + Value: fmt.Sprintf("%v", *m.AlgorithmNameAttr)}) + } + if m.HashValueAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:hashValue"}, + Value: fmt.Sprintf("%v", *m.HashValueAttr)}) + } + if m.SaltValueAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:saltValue"}, + Value: fmt.Sprintf("%v", *m.SaltValueAttr)}) + } + if m.SpinCountAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:spinCount"}, + Value: fmt.Sprintf("%v", *m.SpinCountAttr)}) + } + if m.CryptProviderTypeAttr != sharedTypes.ST_CryptProvUnset { + attr, err := m.CryptProviderTypeAttr.MarshalXMLAttr(xml.Name{Local: "w:cryptProviderType"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.CryptAlgorithmClassAttr != sharedTypes.ST_AlgClassUnset { + attr, err := m.CryptAlgorithmClassAttr.MarshalXMLAttr(xml.Name{Local: "w:cryptAlgorithmClass"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.CryptAlgorithmTypeAttr != sharedTypes.ST_AlgTypeUnset { + attr, err := m.CryptAlgorithmTypeAttr.MarshalXMLAttr(xml.Name{Local: "w:cryptAlgorithmType"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.CryptAlgorithmSidAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:cryptAlgorithmSid"}, + Value: fmt.Sprintf("%v", *m.CryptAlgorithmSidAttr)}) + } + if m.CryptSpinCountAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:cryptSpinCount"}, + Value: fmt.Sprintf("%v", *m.CryptSpinCountAttr)}) + } + if m.CryptProviderAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:cryptProvider"}, + Value: fmt.Sprintf("%v", *m.CryptProviderAttr)}) + } + if m.AlgIdExtAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:algIdExt"}, + Value: fmt.Sprintf("%v", *m.AlgIdExtAttr)}) + } + if m.AlgIdExtSourceAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:algIdExtSource"}, + Value: fmt.Sprintf("%v", *m.AlgIdExtSourceAttr)}) + } + if m.CryptProviderTypeExtAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:cryptProviderTypeExt"}, + Value: fmt.Sprintf("%v", *m.CryptProviderTypeExtAttr)}) + } + if m.CryptProviderTypeExtSourceAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:cryptProviderTypeExtSource"}, + Value: fmt.Sprintf("%v", *m.CryptProviderTypeExtSourceAttr)}) + } + if m.HashAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:hash"}, + Value: fmt.Sprintf("%v", *m.HashAttr)}) + } + if m.SaltAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:salt"}, + Value: fmt.Sprintf("%v", *m.SaltAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_DocProtect) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "cryptAlgorithmType" { + m.CryptAlgorithmTypeAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "cryptAlgorithmSid" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.CryptAlgorithmSidAttr = &parsed + continue + } + if attr.Name.Local == "formatting" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.FormattingAttr = &parsed + continue + } + if attr.Name.Local == "cryptSpinCount" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.CryptSpinCountAttr = &parsed + continue + } + if attr.Name.Local == "algorithmName" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.AlgorithmNameAttr = &parsed + continue + } + if attr.Name.Local == "cryptProvider" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.CryptProviderAttr = &parsed + continue + } + if attr.Name.Local == "saltValue" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.SaltValueAttr = &parsed + continue + } + if attr.Name.Local == "cryptProviderType" { + m.CryptProviderTypeAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "cryptAlgorithmClass" { + m.CryptAlgorithmClassAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "edit" { + m.EditAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "enforcement" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.EnforcementAttr = &parsed + continue + } + if attr.Name.Local == "hashValue" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.HashValueAttr = &parsed + continue + } + if attr.Name.Local == "spinCount" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.SpinCountAttr = &parsed + continue + } + if attr.Name.Local == "algIdExt" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.AlgIdExtAttr = &parsed + continue + } + if attr.Name.Local == "algIdExtSource" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.AlgIdExtSourceAttr = &parsed + continue + } + if attr.Name.Local == "cryptProviderTypeExt" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.CryptProviderTypeExtAttr = &parsed + continue + } + if attr.Name.Local == "cryptProviderTypeExtSource" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.CryptProviderTypeExtSourceAttr = &parsed + continue + } + if attr.Name.Local == "hash" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.HashAttr = &parsed + continue + } + if attr.Name.Local == "salt" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.SaltAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_DocProtect: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_DocProtect and its children +func (m *CT_DocProtect) Validate() error { + return m.ValidateWithPath("CT_DocProtect") +} + +// ValidateWithPath validates the CT_DocProtect and its children, prefixing error messages with path +func (m *CT_DocProtect) ValidateWithPath(path string) error { + if err := m.EditAttr.ValidateWithPath(path + "/EditAttr"); err != nil { + return err + } + if m.FormattingAttr != nil { + if err := m.FormattingAttr.ValidateWithPath(path + "/FormattingAttr"); err != nil { + return err + } + } + if m.EnforcementAttr != nil { + if err := m.EnforcementAttr.ValidateWithPath(path + "/EnforcementAttr"); err != nil { + return err + } + } + if err := m.CryptProviderTypeAttr.ValidateWithPath(path + "/CryptProviderTypeAttr"); err != nil { + return err + } + if err := m.CryptAlgorithmClassAttr.ValidateWithPath(path + "/CryptAlgorithmClassAttr"); err != nil { + return err + } + if err := m.CryptAlgorithmTypeAttr.ValidateWithPath(path + "/CryptAlgorithmTypeAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocRsids.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocRsids.go new file mode 100644 index 00000000..a05d02c0 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocRsids.go @@ -0,0 +1,101 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_DocRsids struct { + // Original Document Revision Save ID + RsidRoot *CT_LongHexNumber + // Single Session Revision Save ID + Rsid []*CT_LongHexNumber +} + +func NewCT_DocRsids() *CT_DocRsids { + ret := &CT_DocRsids{} + return ret +} + +func (m *CT_DocRsids) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.RsidRoot != nil { + sersidRoot := xml.StartElement{Name: xml.Name{Local: "w:rsidRoot"}} + e.EncodeElement(m.RsidRoot, sersidRoot) + } + if m.Rsid != nil { + sersid := xml.StartElement{Name: xml.Name{Local: "w:rsid"}} + for _, c := range m.Rsid { + e.EncodeElement(c, sersid) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_DocRsids) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_DocRsids: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rsidRoot"}: + m.RsidRoot = NewCT_LongHexNumber() + if err := d.DecodeElement(m.RsidRoot, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rsid"}: + tmp := NewCT_LongHexNumber() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Rsid = append(m.Rsid, tmp) + default: + gooxml.Log("skipping unsupported element on CT_DocRsids %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_DocRsids + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_DocRsids and its children +func (m *CT_DocRsids) Validate() error { + return m.ValidateWithPath("CT_DocRsids") +} + +// ValidateWithPath validates the CT_DocRsids and its children, prefixing error messages with path +func (m *CT_DocRsids) ValidateWithPath(path string) error { + if m.RsidRoot != nil { + if err := m.RsidRoot.ValidateWithPath(path + "/RsidRoot"); err != nil { + return err + } + } + for i, v := range m.Rsid { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Rsid[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocType.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocType.go new file mode 100644 index 00000000..ac16da60 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocType.go @@ -0,0 +1,68 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_DocType struct { + // Document Classification Value + ValAttr string +} + +func NewCT_DocType() *CT_DocType { + ret := &CT_DocType{} + return ret +} + +func (m *CT_DocType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:val"}, + Value: fmt.Sprintf("%v", m.ValAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_DocType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ValAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_DocType: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_DocType and its children +func (m *CT_DocType) Validate() error { + return m.ValidateWithPath("CT_DocType") +} + +// ValidateWithPath validates the CT_DocType and its children, prefixing error messages with path +func (m *CT_DocType) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocVar.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocVar.go new file mode 100644 index 00000000..9fcb9a56 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocVar.go @@ -0,0 +1,80 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_DocVar struct { + // Document Variable Name + NameAttr string + // Document Variable Value + ValAttr string +} + +func NewCT_DocVar() *CT_DocVar { + ret := &CT_DocVar{} + return ret +} + +func (m *CT_DocVar) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:name"}, + Value: fmt.Sprintf("%v", m.NameAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:val"}, + Value: fmt.Sprintf("%v", m.ValAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_DocVar) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "name" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.NameAttr = parsed + continue + } + if attr.Name.Local == "val" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ValAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_DocVar: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_DocVar and its children +func (m *CT_DocVar) Validate() error { + return m.ValidateWithPath("CT_DocVar") +} + +// ValidateWithPath validates the CT_DocVar and its children, prefixing error messages with path +func (m *CT_DocVar) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocVars.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocVars.go new file mode 100644 index 00000000..af1a8c90 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocVars.go @@ -0,0 +1,85 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_DocVars struct { + // Single Document Variable + DocVar []*CT_DocVar +} + +func NewCT_DocVars() *CT_DocVars { + ret := &CT_DocVars{} + return ret +} + +func (m *CT_DocVars) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.DocVar != nil { + sedocVar := xml.StartElement{Name: xml.Name{Local: "w:docVar"}} + for _, c := range m.DocVar { + e.EncodeElement(c, sedocVar) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_DocVars) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_DocVars: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "docVar"}: + tmp := NewCT_DocVar() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.DocVar = append(m.DocVar, tmp) + default: + gooxml.Log("skipping unsupported element on CT_DocVars %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_DocVars + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_DocVars and its children +func (m *CT_DocVars) Validate() error { + return m.ValidateWithPath("CT_DocVars") +} + +// ValidateWithPath validates the CT_DocVars and its children, prefixing error messages with path +func (m *CT_DocVars) ValidateWithPath(path string) error { + for i, v := range m.DocVar { + if err := v.ValidateWithPath(fmt.Sprintf("%s/DocVar[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Document.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Document.go new file mode 100644 index 00000000..0230b625 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Document.go @@ -0,0 +1,118 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_Document struct { + ConformanceAttr sharedTypes.ST_ConformanceClass + // Document Background + Background *CT_Background + Body *CT_Body +} + +func NewCT_Document() *CT_Document { + ret := &CT_Document{} + ret.ConformanceAttr = sharedTypes.ST_ConformanceClass(1) + return ret +} + +func (m *CT_Document) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ConformanceAttr.MarshalXMLAttr(xml.Name{Local: "w:conformance"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + if m.Background != nil { + sebackground := xml.StartElement{Name: xml.Name{Local: "w:background"}} + e.EncodeElement(m.Background, sebackground) + } + if m.Body != nil { + sebody := xml.StartElement{Name: xml.Name{Local: "w:body"}} + e.EncodeElement(m.Body, sebody) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Document) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ConformanceAttr = sharedTypes.ST_ConformanceClass(1) + for _, attr := range start.Attr { + if attr.Name.Local == "conformance" { + m.ConformanceAttr.UnmarshalXMLAttr(attr) + continue + } + } +lCT_Document: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "background"}: + m.Background = NewCT_Background() + if err := d.DecodeElement(m.Background, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "body"}: + m.Body = NewCT_Body() + if err := d.DecodeElement(m.Body, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_Document %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Document + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Document and its children +func (m *CT_Document) Validate() error { + return m.ValidateWithPath("CT_Document") +} + +// ValidateWithPath validates the CT_Document and its children, prefixing error messages with path +func (m *CT_Document) ValidateWithPath(path string) error { + if m.ConformanceAttr == sharedTypes.ST_ConformanceClassUnset { + return fmt.Errorf("%s/ConformanceAttr is a mandatory field", path) + } + if err := m.ConformanceAttr.ValidateWithPath(path + "/ConformanceAttr"); err != nil { + return err + } + if m.Background != nil { + if err := m.Background.ValidateWithPath(path + "/Background"); err != nil { + return err + } + } + if m.Body != nil { + if err := m.Body.ValidateWithPath(path + "/Body"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocumentBase.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocumentBase.go new file mode 100644 index 00000000..2fc39b2c --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_DocumentBase.go @@ -0,0 +1,81 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_DocumentBase struct { + // Document Background + Background *CT_Background +} + +func NewCT_DocumentBase() *CT_DocumentBase { + ret := &CT_DocumentBase{} + return ret +} + +func (m *CT_DocumentBase) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Background != nil { + sebackground := xml.StartElement{Name: xml.Name{Local: "w:background"}} + e.EncodeElement(m.Background, sebackground) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_DocumentBase) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_DocumentBase: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "background"}: + m.Background = NewCT_Background() + if err := d.DecodeElement(m.Background, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_DocumentBase %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_DocumentBase + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_DocumentBase and its children +func (m *CT_DocumentBase) Validate() error { + return m.ValidateWithPath("CT_DocumentBase") +} + +// ValidateWithPath validates the CT_DocumentBase and its children, prefixing error messages with path +func (m *CT_DocumentBase) ValidateWithPath(path string) error { + if m.Background != nil { + if err := m.Background.ValidateWithPath(path + "/Background"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Drawing.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Drawing.go new file mode 100644 index 00000000..4aad7edf --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Drawing.go @@ -0,0 +1,102 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_Drawing struct { + Anchor []*WdAnchor + Inline []*WdInline +} + +func NewCT_Drawing() *CT_Drawing { + ret := &CT_Drawing{} + return ret +} + +func (m *CT_Drawing) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Anchor != nil { + seanchor := xml.StartElement{Name: xml.Name{Local: "wp:anchor"}} + for _, c := range m.Anchor { + e.EncodeElement(c, seanchor) + } + } + if m.Inline != nil { + seinline := xml.StartElement{Name: xml.Name{Local: "wp:inline"}} + for _, c := range m.Inline { + e.EncodeElement(c, seinline) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Drawing) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_Drawing: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "anchor"}: + tmp := NewWdAnchor() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Anchor = append(m.Anchor, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "inline"}: + tmp := NewWdInline() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Inline = append(m.Inline, tmp) + default: + gooxml.Log("skipping unsupported element on CT_Drawing %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Drawing + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Drawing and its children +func (m *CT_Drawing) Validate() error { + return m.ValidateWithPath("CT_Drawing") +} + +// ValidateWithPath validates the CT_Drawing and its children, prefixing error messages with path +func (m *CT_Drawing) ValidateWithPath(path string) error { + for i, v := range m.Anchor { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Anchor[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.Inline { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Inline[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_EastAsianLayout.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_EastAsianLayout.go new file mode 100644 index 00000000..bbbc36dc --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_EastAsianLayout.go @@ -0,0 +1,146 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_EastAsianLayout struct { + // East Asian Typography Run ID + IdAttr *int64 + // Two Lines in One + CombineAttr *sharedTypes.ST_OnOff + // Display Brackets Around Two Lines in One + CombineBracketsAttr ST_CombineBrackets + // Horizontal in Vertical (Rotate Text) + VertAttr *sharedTypes.ST_OnOff + // Compress Rotated Text to Line Height + VertCompressAttr *sharedTypes.ST_OnOff +} + +func NewCT_EastAsianLayout() *CT_EastAsianLayout { + ret := &CT_EastAsianLayout{} + return ret +} + +func (m *CT_EastAsianLayout) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.IdAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:id"}, + Value: fmt.Sprintf("%v", *m.IdAttr)}) + } + if m.CombineAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:combine"}, + Value: fmt.Sprintf("%v", *m.CombineAttr)}) + } + if m.CombineBracketsAttr != ST_CombineBracketsUnset { + attr, err := m.CombineBracketsAttr.MarshalXMLAttr(xml.Name{Local: "w:combineBrackets"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.VertAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:vert"}, + Value: fmt.Sprintf("%v", *m.VertAttr)}) + } + if m.VertCompressAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:vertCompress"}, + Value: fmt.Sprintf("%v", *m.VertCompressAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_EastAsianLayout) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "id" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.IdAttr = &parsed + continue + } + if attr.Name.Local == "combine" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.CombineAttr = &parsed + continue + } + if attr.Name.Local == "combineBrackets" { + m.CombineBracketsAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "vert" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.VertAttr = &parsed + continue + } + if attr.Name.Local == "vertCompress" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.VertCompressAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_EastAsianLayout: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_EastAsianLayout and its children +func (m *CT_EastAsianLayout) Validate() error { + return m.ValidateWithPath("CT_EastAsianLayout") +} + +// ValidateWithPath validates the CT_EastAsianLayout and its children, prefixing error messages with path +func (m *CT_EastAsianLayout) ValidateWithPath(path string) error { + if m.CombineAttr != nil { + if err := m.CombineAttr.ValidateWithPath(path + "/CombineAttr"); err != nil { + return err + } + } + if err := m.CombineBracketsAttr.ValidateWithPath(path + "/CombineBracketsAttr"); err != nil { + return err + } + if m.VertAttr != nil { + if err := m.VertAttr.ValidateWithPath(path + "/VertAttr"); err != nil { + return err + } + } + if m.VertCompressAttr != nil { + if err := m.VertCompressAttr.ValidateWithPath(path + "/VertCompressAttr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_EdnDocProps.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_EdnDocProps.go new file mode 100644 index 00000000..4e5bb4c5 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_EdnDocProps.go @@ -0,0 +1,148 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_EdnDocProps struct { + // Endnote Placement + Pos *CT_EdnPos + // Endnote Numbering Format + NumFmt *CT_NumFmt + // Footnote and Endnote Numbering Starting Value + NumStart *CT_DecimalNumber + // Footnote and Endnote Numbering Restart Location + NumRestart *CT_NumRestart + Endnote []*CT_FtnEdnSepRef +} + +func NewCT_EdnDocProps() *CT_EdnDocProps { + ret := &CT_EdnDocProps{} + return ret +} + +func (m *CT_EdnDocProps) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Pos != nil { + sepos := xml.StartElement{Name: xml.Name{Local: "w:pos"}} + e.EncodeElement(m.Pos, sepos) + } + if m.NumFmt != nil { + senumFmt := xml.StartElement{Name: xml.Name{Local: "w:numFmt"}} + e.EncodeElement(m.NumFmt, senumFmt) + } + if m.NumStart != nil { + senumStart := xml.StartElement{Name: xml.Name{Local: "w:numStart"}} + e.EncodeElement(m.NumStart, senumStart) + } + if m.NumRestart != nil { + senumRestart := xml.StartElement{Name: xml.Name{Local: "w:numRestart"}} + e.EncodeElement(m.NumRestart, senumRestart) + } + if m.Endnote != nil { + seendnote := xml.StartElement{Name: xml.Name{Local: "w:endnote"}} + for _, c := range m.Endnote { + e.EncodeElement(c, seendnote) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_EdnDocProps) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_EdnDocProps: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pos"}: + m.Pos = NewCT_EdnPos() + if err := d.DecodeElement(m.Pos, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "numFmt"}: + m.NumFmt = NewCT_NumFmt() + if err := d.DecodeElement(m.NumFmt, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "numStart"}: + m.NumStart = NewCT_DecimalNumber() + if err := d.DecodeElement(m.NumStart, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "numRestart"}: + m.NumRestart = NewCT_NumRestart() + if err := d.DecodeElement(m.NumRestart, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "endnote"}: + tmp := NewCT_FtnEdnSepRef() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Endnote = append(m.Endnote, tmp) + default: + gooxml.Log("skipping unsupported element on CT_EdnDocProps %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_EdnDocProps + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_EdnDocProps and its children +func (m *CT_EdnDocProps) Validate() error { + return m.ValidateWithPath("CT_EdnDocProps") +} + +// ValidateWithPath validates the CT_EdnDocProps and its children, prefixing error messages with path +func (m *CT_EdnDocProps) ValidateWithPath(path string) error { + if m.Pos != nil { + if err := m.Pos.ValidateWithPath(path + "/Pos"); err != nil { + return err + } + } + if m.NumFmt != nil { + if err := m.NumFmt.ValidateWithPath(path + "/NumFmt"); err != nil { + return err + } + } + if m.NumStart != nil { + if err := m.NumStart.ValidateWithPath(path + "/NumStart"); err != nil { + return err + } + } + if m.NumRestart != nil { + if err := m.NumRestart.ValidateWithPath(path + "/NumRestart"); err != nil { + return err + } + } + for i, v := range m.Endnote { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Endnote[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_EdnPos.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_EdnPos.go new file mode 100644 index 00000000..d9e94713 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_EdnPos.go @@ -0,0 +1,75 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_EdnPos struct { + // Endnote Position Type + ValAttr ST_EdnPos +} + +func NewCT_EdnPos() *CT_EdnPos { + ret := &CT_EdnPos{} + ret.ValAttr = ST_EdnPos(1) + return ret +} + +func (m *CT_EdnPos) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_EdnPos) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_EdnPos(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_EdnPos: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_EdnPos and its children +func (m *CT_EdnPos) Validate() error { + return m.ValidateWithPath("CT_EdnPos") +} + +// ValidateWithPath validates the CT_EdnPos and its children, prefixing error messages with path +func (m *CT_EdnPos) ValidateWithPath(path string) error { + if m.ValAttr == ST_EdnPosUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_EdnProps.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_EdnProps.go new file mode 100644 index 00000000..723620c5 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_EdnProps.go @@ -0,0 +1,129 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_EdnProps struct { + // Endnote Placement + Pos *CT_EdnPos + // Endnote Numbering Format + NumFmt *CT_NumFmt + // Footnote and Endnote Numbering Starting Value + NumStart *CT_DecimalNumber + // Footnote and Endnote Numbering Restart Location + NumRestart *CT_NumRestart +} + +func NewCT_EdnProps() *CT_EdnProps { + ret := &CT_EdnProps{} + return ret +} + +func (m *CT_EdnProps) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Pos != nil { + sepos := xml.StartElement{Name: xml.Name{Local: "w:pos"}} + e.EncodeElement(m.Pos, sepos) + } + if m.NumFmt != nil { + senumFmt := xml.StartElement{Name: xml.Name{Local: "w:numFmt"}} + e.EncodeElement(m.NumFmt, senumFmt) + } + if m.NumStart != nil { + senumStart := xml.StartElement{Name: xml.Name{Local: "w:numStart"}} + e.EncodeElement(m.NumStart, senumStart) + } + if m.NumRestart != nil { + senumRestart := xml.StartElement{Name: xml.Name{Local: "w:numRestart"}} + e.EncodeElement(m.NumRestart, senumRestart) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_EdnProps) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_EdnProps: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pos"}: + m.Pos = NewCT_EdnPos() + if err := d.DecodeElement(m.Pos, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "numFmt"}: + m.NumFmt = NewCT_NumFmt() + if err := d.DecodeElement(m.NumFmt, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "numStart"}: + m.NumStart = NewCT_DecimalNumber() + if err := d.DecodeElement(m.NumStart, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "numRestart"}: + m.NumRestart = NewCT_NumRestart() + if err := d.DecodeElement(m.NumRestart, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_EdnProps %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_EdnProps + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_EdnProps and its children +func (m *CT_EdnProps) Validate() error { + return m.ValidateWithPath("CT_EdnProps") +} + +// ValidateWithPath validates the CT_EdnProps and its children, prefixing error messages with path +func (m *CT_EdnProps) ValidateWithPath(path string) error { + if m.Pos != nil { + if err := m.Pos.ValidateWithPath(path + "/Pos"); err != nil { + return err + } + } + if m.NumFmt != nil { + if err := m.NumFmt.ValidateWithPath(path + "/NumFmt"); err != nil { + return err + } + } + if m.NumStart != nil { + if err := m.NumStart.ValidateWithPath(path + "/NumStart"); err != nil { + return err + } + } + if m.NumRestart != nil { + if err := m.NumRestart.ValidateWithPath(path + "/NumRestart"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Em.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Em.go new file mode 100644 index 00000000..476e112c --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Em.go @@ -0,0 +1,75 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_Em struct { + // Emphasis Mark Type + ValAttr ST_Em +} + +func NewCT_Em() *CT_Em { + ret := &CT_Em{} + ret.ValAttr = ST_Em(1) + return ret +} + +func (m *CT_Em) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Em) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_Em(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Em: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Em and its children +func (m *CT_Em) Validate() error { + return m.ValidateWithPath("CT_Em") +} + +// ValidateWithPath validates the CT_Em and its children, prefixing error messages with path +func (m *CT_Em) ValidateWithPath(path string) error { + if m.ValAttr == ST_EmUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Empty.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Empty.go new file mode 100644 index 00000000..91db2076 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Empty.go @@ -0,0 +1,54 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_Empty struct { +} + +func NewCT_Empty() *CT_Empty { + ret := &CT_Empty{} + return ret +} + +func (m *CT_Empty) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Empty) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Empty: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Empty and its children +func (m *CT_Empty) Validate() error { + return m.ValidateWithPath("CT_Empty") +} + +// ValidateWithPath validates the CT_Empty and its children, prefixing error messages with path +func (m *CT_Empty) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Endnotes.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Endnotes.go new file mode 100644 index 00000000..d1325ebc --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Endnotes.go @@ -0,0 +1,85 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_Endnotes struct { + // Endnote Content + Endnote []*CT_FtnEdn +} + +func NewCT_Endnotes() *CT_Endnotes { + ret := &CT_Endnotes{} + return ret +} + +func (m *CT_Endnotes) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Endnote != nil { + seendnote := xml.StartElement{Name: xml.Name{Local: "w:endnote"}} + for _, c := range m.Endnote { + e.EncodeElement(c, seendnote) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Endnotes) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_Endnotes: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "endnote"}: + tmp := NewCT_FtnEdn() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Endnote = append(m.Endnote, tmp) + default: + gooxml.Log("skipping unsupported element on CT_Endnotes %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Endnotes + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Endnotes and its children +func (m *CT_Endnotes) Validate() error { + return m.ValidateWithPath("CT_Endnotes") +} + +// ValidateWithPath validates the CT_Endnotes and its children, prefixing error messages with path +func (m *CT_Endnotes) ValidateWithPath(path string) error { + for i, v := range m.Endnote { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Endnote[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FFCheckBox.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FFCheckBox.go new file mode 100644 index 00000000..dd033549 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FFCheckBox.go @@ -0,0 +1,116 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_FFCheckBox struct { + Choice *CT_FFCheckBoxChoice + // Default Checkbox Form Field State + Default *CT_OnOff + // Checkbox Form Field State + Checked *CT_OnOff +} + +func NewCT_FFCheckBox() *CT_FFCheckBox { + ret := &CT_FFCheckBox{} + return ret +} + +func (m *CT_FFCheckBox) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Choice != nil { + m.Choice.MarshalXML(e, xml.StartElement{}) + } + if m.Default != nil { + sedefault := xml.StartElement{Name: xml.Name{Local: "w:default"}} + e.EncodeElement(m.Default, sedefault) + } + if m.Checked != nil { + sechecked := xml.StartElement{Name: xml.Name{Local: "w:checked"}} + e.EncodeElement(m.Checked, sechecked) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_FFCheckBox) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_FFCheckBox: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "size"}: + m.Choice = NewCT_FFCheckBoxChoice() + if err := d.DecodeElement(&m.Choice.Size, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sizeAuto"}: + m.Choice = NewCT_FFCheckBoxChoice() + if err := d.DecodeElement(&m.Choice.SizeAuto, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "default"}: + m.Default = NewCT_OnOff() + if err := d.DecodeElement(m.Default, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "checked"}: + m.Checked = NewCT_OnOff() + if err := d.DecodeElement(m.Checked, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_FFCheckBox %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_FFCheckBox + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_FFCheckBox and its children +func (m *CT_FFCheckBox) Validate() error { + return m.ValidateWithPath("CT_FFCheckBox") +} + +// ValidateWithPath validates the CT_FFCheckBox and its children, prefixing error messages with path +func (m *CT_FFCheckBox) ValidateWithPath(path string) error { + if m.Choice != nil { + if err := m.Choice.ValidateWithPath(path + "/Choice"); err != nil { + return err + } + } + if m.Default != nil { + if err := m.Default.ValidateWithPath(path + "/Default"); err != nil { + return err + } + } + if m.Checked != nil { + if err := m.Checked.ValidateWithPath(path + "/Checked"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FFCheckBoxChoice.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FFCheckBoxChoice.go new file mode 100644 index 00000000..520aa4be --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FFCheckBoxChoice.go @@ -0,0 +1,93 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_FFCheckBoxChoice struct { + Size *CT_HpsMeasure + SizeAuto *CT_OnOff +} + +func NewCT_FFCheckBoxChoice() *CT_FFCheckBoxChoice { + ret := &CT_FFCheckBoxChoice{} + return ret +} + +func (m *CT_FFCheckBoxChoice) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.Size != nil { + sesize := xml.StartElement{Name: xml.Name{Local: "w:size"}} + e.EncodeElement(m.Size, sesize) + } + if m.SizeAuto != nil { + sesizeAuto := xml.StartElement{Name: xml.Name{Local: "w:sizeAuto"}} + e.EncodeElement(m.SizeAuto, sesizeAuto) + } + return nil +} + +func (m *CT_FFCheckBoxChoice) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_FFCheckBoxChoice: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "size"}: + m.Size = NewCT_HpsMeasure() + if err := d.DecodeElement(m.Size, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sizeAuto"}: + m.SizeAuto = NewCT_OnOff() + if err := d.DecodeElement(m.SizeAuto, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_FFCheckBoxChoice %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_FFCheckBoxChoice + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_FFCheckBoxChoice and its children +func (m *CT_FFCheckBoxChoice) Validate() error { + return m.ValidateWithPath("CT_FFCheckBoxChoice") +} + +// ValidateWithPath validates the CT_FFCheckBoxChoice and its children, prefixing error messages with path +func (m *CT_FFCheckBoxChoice) ValidateWithPath(path string) error { + if m.Size != nil { + if err := m.Size.ValidateWithPath(path + "/Size"); err != nil { + return err + } + } + if m.SizeAuto != nil { + if err := m.SizeAuto.ValidateWithPath(path + "/SizeAuto"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FFDDList.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FFDDList.go new file mode 100644 index 00000000..691a7808 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FFDDList.go @@ -0,0 +1,117 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_FFDDList struct { + // Drop-Down List Selection + Result *CT_DecimalNumber + // Default Drop-Down List Item Index + Default *CT_DecimalNumber + // Drop-Down List Entry + ListEntry []*CT_String +} + +func NewCT_FFDDList() *CT_FFDDList { + ret := &CT_FFDDList{} + return ret +} + +func (m *CT_FFDDList) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Result != nil { + seresult := xml.StartElement{Name: xml.Name{Local: "w:result"}} + e.EncodeElement(m.Result, seresult) + } + if m.Default != nil { + sedefault := xml.StartElement{Name: xml.Name{Local: "w:default"}} + e.EncodeElement(m.Default, sedefault) + } + if m.ListEntry != nil { + selistEntry := xml.StartElement{Name: xml.Name{Local: "w:listEntry"}} + for _, c := range m.ListEntry { + e.EncodeElement(c, selistEntry) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_FFDDList) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_FFDDList: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "result"}: + m.Result = NewCT_DecimalNumber() + if err := d.DecodeElement(m.Result, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "default"}: + m.Default = NewCT_DecimalNumber() + if err := d.DecodeElement(m.Default, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "listEntry"}: + tmp := NewCT_String() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.ListEntry = append(m.ListEntry, tmp) + default: + gooxml.Log("skipping unsupported element on CT_FFDDList %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_FFDDList + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_FFDDList and its children +func (m *CT_FFDDList) Validate() error { + return m.ValidateWithPath("CT_FFDDList") +} + +// ValidateWithPath validates the CT_FFDDList and its children, prefixing error messages with path +func (m *CT_FFDDList) ValidateWithPath(path string) error { + if m.Result != nil { + if err := m.Result.ValidateWithPath(path + "/Result"); err != nil { + return err + } + } + if m.Default != nil { + if err := m.Default.ValidateWithPath(path + "/Default"); err != nil { + return err + } + } + for i, v := range m.ListEntry { + if err := v.ValidateWithPath(fmt.Sprintf("%s/ListEntry[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FFData.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FFData.go new file mode 100644 index 00000000..a0b91a9c --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FFData.go @@ -0,0 +1,282 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_FFData struct { + // Form Field Name + Name []*CT_FFName + // Form Field Label + Label []*CT_DecimalNumber + // Form Field Navigation Order Index + TabIndex []*CT_UnsignedDecimalNumber + // Form Field Enabled + Enabled []*CT_OnOff + // Recalculate Fields When Current Field Is Modified + CalcOnExit []*CT_OnOff + // Script Function to Execute on Form Field Entry + EntryMacro []*CT_MacroName + // Script Function to Execute on Form Field Exit + ExitMacro []*CT_MacroName + // Associated Help Text + HelpText []*CT_FFHelpText + // Associated Status Text + StatusText []*CT_FFStatusText + CheckBox *CT_FFCheckBox + DdList *CT_FFDDList + TextInput *CT_FFTextInput +} + +func NewCT_FFData() *CT_FFData { + ret := &CT_FFData{} + return ret +} + +func (m *CT_FFData) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Name != nil { + sename := xml.StartElement{Name: xml.Name{Local: "w:name"}} + for _, c := range m.Name { + e.EncodeElement(c, sename) + } + } + if m.Label != nil { + selabel := xml.StartElement{Name: xml.Name{Local: "w:label"}} + for _, c := range m.Label { + e.EncodeElement(c, selabel) + } + } + if m.TabIndex != nil { + setabIndex := xml.StartElement{Name: xml.Name{Local: "w:tabIndex"}} + for _, c := range m.TabIndex { + e.EncodeElement(c, setabIndex) + } + } + if m.Enabled != nil { + seenabled := xml.StartElement{Name: xml.Name{Local: "w:enabled"}} + for _, c := range m.Enabled { + e.EncodeElement(c, seenabled) + } + } + if m.CalcOnExit != nil { + secalcOnExit := xml.StartElement{Name: xml.Name{Local: "w:calcOnExit"}} + for _, c := range m.CalcOnExit { + e.EncodeElement(c, secalcOnExit) + } + } + if m.EntryMacro != nil { + seentryMacro := xml.StartElement{Name: xml.Name{Local: "w:entryMacro"}} + for _, c := range m.EntryMacro { + e.EncodeElement(c, seentryMacro) + } + } + if m.ExitMacro != nil { + seexitMacro := xml.StartElement{Name: xml.Name{Local: "w:exitMacro"}} + for _, c := range m.ExitMacro { + e.EncodeElement(c, seexitMacro) + } + } + if m.HelpText != nil { + sehelpText := xml.StartElement{Name: xml.Name{Local: "w:helpText"}} + for _, c := range m.HelpText { + e.EncodeElement(c, sehelpText) + } + } + if m.StatusText != nil { + sestatusText := xml.StartElement{Name: xml.Name{Local: "w:statusText"}} + for _, c := range m.StatusText { + e.EncodeElement(c, sestatusText) + } + } + if m.CheckBox != nil { + secheckBox := xml.StartElement{Name: xml.Name{Local: "w:checkBox"}} + e.EncodeElement(m.CheckBox, secheckBox) + } + if m.DdList != nil { + seddList := xml.StartElement{Name: xml.Name{Local: "w:ddList"}} + e.EncodeElement(m.DdList, seddList) + } + if m.TextInput != nil { + setextInput := xml.StartElement{Name: xml.Name{Local: "w:textInput"}} + e.EncodeElement(m.TextInput, setextInput) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_FFData) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_FFData: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "name"}: + tmp := NewCT_FFName() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Name = append(m.Name, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "label"}: + tmp := NewCT_DecimalNumber() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Label = append(m.Label, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tabIndex"}: + tmp := NewCT_UnsignedDecimalNumber() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.TabIndex = append(m.TabIndex, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "enabled"}: + tmp := NewCT_OnOff() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Enabled = append(m.Enabled, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "calcOnExit"}: + tmp := NewCT_OnOff() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.CalcOnExit = append(m.CalcOnExit, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "entryMacro"}: + tmp := NewCT_MacroName() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.EntryMacro = append(m.EntryMacro, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "exitMacro"}: + tmp := NewCT_MacroName() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.ExitMacro = append(m.ExitMacro, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "helpText"}: + tmp := NewCT_FFHelpText() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.HelpText = append(m.HelpText, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "statusText"}: + tmp := NewCT_FFStatusText() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.StatusText = append(m.StatusText, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "checkBox"}: + m.CheckBox = NewCT_FFCheckBox() + if err := d.DecodeElement(m.CheckBox, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ddList"}: + m.DdList = NewCT_FFDDList() + if err := d.DecodeElement(m.DdList, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "textInput"}: + m.TextInput = NewCT_FFTextInput() + if err := d.DecodeElement(m.TextInput, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_FFData %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_FFData + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_FFData and its children +func (m *CT_FFData) Validate() error { + return m.ValidateWithPath("CT_FFData") +} + +// ValidateWithPath validates the CT_FFData and its children, prefixing error messages with path +func (m *CT_FFData) ValidateWithPath(path string) error { + for i, v := range m.Name { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Name[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.Label { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Label[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.TabIndex { + if err := v.ValidateWithPath(fmt.Sprintf("%s/TabIndex[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.Enabled { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Enabled[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.CalcOnExit { + if err := v.ValidateWithPath(fmt.Sprintf("%s/CalcOnExit[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.EntryMacro { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EntryMacro[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.ExitMacro { + if err := v.ValidateWithPath(fmt.Sprintf("%s/ExitMacro[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.HelpText { + if err := v.ValidateWithPath(fmt.Sprintf("%s/HelpText[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.StatusText { + if err := v.ValidateWithPath(fmt.Sprintf("%s/StatusText[%d]", path, i)); err != nil { + return err + } + } + if m.CheckBox != nil { + if err := m.CheckBox.ValidateWithPath(path + "/CheckBox"); err != nil { + return err + } + } + if m.DdList != nil { + if err := m.DdList.ValidateWithPath(path + "/DdList"); err != nil { + return err + } + } + if m.TextInput != nil { + if err := m.TextInput.ValidateWithPath(path + "/TextInput"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FFHelpText.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FFHelpText.go new file mode 100644 index 00000000..7ce30960 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FFHelpText.go @@ -0,0 +1,86 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_FFHelpText struct { + // Help Text Type + TypeAttr ST_InfoTextType + // Help Text Value + ValAttr *string +} + +func NewCT_FFHelpText() *CT_FFHelpText { + ret := &CT_FFHelpText{} + return ret +} + +func (m *CT_FFHelpText) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.TypeAttr != ST_InfoTextTypeUnset { + attr, err := m.TypeAttr.MarshalXMLAttr(xml.Name{Local: "w:type"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.ValAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:val"}, + Value: fmt.Sprintf("%v", *m.ValAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_FFHelpText) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "type" { + m.TypeAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "val" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ValAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_FFHelpText: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_FFHelpText and its children +func (m *CT_FFHelpText) Validate() error { + return m.ValidateWithPath("CT_FFHelpText") +} + +// ValidateWithPath validates the CT_FFHelpText and its children, prefixing error messages with path +func (m *CT_FFHelpText) ValidateWithPath(path string) error { + if err := m.TypeAttr.ValidateWithPath(path + "/TypeAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FFName.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FFName.go new file mode 100644 index 00000000..709089b5 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FFName.go @@ -0,0 +1,70 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_FFName struct { + // Form Field Name Value + ValAttr *string +} + +func NewCT_FFName() *CT_FFName { + ret := &CT_FFName{} + return ret +} + +func (m *CT_FFName) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.ValAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:val"}, + Value: fmt.Sprintf("%v", *m.ValAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_FFName) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ValAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_FFName: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_FFName and its children +func (m *CT_FFName) Validate() error { + return m.ValidateWithPath("CT_FFName") +} + +// ValidateWithPath validates the CT_FFName and its children, prefixing error messages with path +func (m *CT_FFName) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FFStatusText.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FFStatusText.go new file mode 100644 index 00000000..9bc4b017 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FFStatusText.go @@ -0,0 +1,86 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_FFStatusText struct { + // Status Text Type + TypeAttr ST_InfoTextType + // Status Text Value + ValAttr *string +} + +func NewCT_FFStatusText() *CT_FFStatusText { + ret := &CT_FFStatusText{} + return ret +} + +func (m *CT_FFStatusText) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.TypeAttr != ST_InfoTextTypeUnset { + attr, err := m.TypeAttr.MarshalXMLAttr(xml.Name{Local: "w:type"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.ValAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:val"}, + Value: fmt.Sprintf("%v", *m.ValAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_FFStatusText) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "type" { + m.TypeAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "val" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ValAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_FFStatusText: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_FFStatusText and its children +func (m *CT_FFStatusText) Validate() error { + return m.ValidateWithPath("CT_FFStatusText") +} + +// ValidateWithPath validates the CT_FFStatusText and its children, prefixing error messages with path +func (m *CT_FFStatusText) ValidateWithPath(path string) error { + if err := m.TypeAttr.ValidateWithPath(path + "/TypeAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FFTextInput.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FFTextInput.go new file mode 100644 index 00000000..f0d4dbf7 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FFTextInput.go @@ -0,0 +1,129 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_FFTextInput struct { + // Text Box Form Field Type + Type *CT_FFTextType + // Default Text Box Form Field String + Default *CT_String + // Text Box Form Field Maximum Length + MaxLength *CT_DecimalNumber + // Text Box Form Field Formatting + Format *CT_String +} + +func NewCT_FFTextInput() *CT_FFTextInput { + ret := &CT_FFTextInput{} + return ret +} + +func (m *CT_FFTextInput) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Type != nil { + setype := xml.StartElement{Name: xml.Name{Local: "w:type"}} + e.EncodeElement(m.Type, setype) + } + if m.Default != nil { + sedefault := xml.StartElement{Name: xml.Name{Local: "w:default"}} + e.EncodeElement(m.Default, sedefault) + } + if m.MaxLength != nil { + semaxLength := xml.StartElement{Name: xml.Name{Local: "w:maxLength"}} + e.EncodeElement(m.MaxLength, semaxLength) + } + if m.Format != nil { + seformat := xml.StartElement{Name: xml.Name{Local: "w:format"}} + e.EncodeElement(m.Format, seformat) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_FFTextInput) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_FFTextInput: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "type"}: + m.Type = NewCT_FFTextType() + if err := d.DecodeElement(m.Type, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "default"}: + m.Default = NewCT_String() + if err := d.DecodeElement(m.Default, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "maxLength"}: + m.MaxLength = NewCT_DecimalNumber() + if err := d.DecodeElement(m.MaxLength, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "format"}: + m.Format = NewCT_String() + if err := d.DecodeElement(m.Format, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_FFTextInput %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_FFTextInput + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_FFTextInput and its children +func (m *CT_FFTextInput) Validate() error { + return m.ValidateWithPath("CT_FFTextInput") +} + +// ValidateWithPath validates the CT_FFTextInput and its children, prefixing error messages with path +func (m *CT_FFTextInput) ValidateWithPath(path string) error { + if m.Type != nil { + if err := m.Type.ValidateWithPath(path + "/Type"); err != nil { + return err + } + } + if m.Default != nil { + if err := m.Default.ValidateWithPath(path + "/Default"); err != nil { + return err + } + } + if m.MaxLength != nil { + if err := m.MaxLength.ValidateWithPath(path + "/MaxLength"); err != nil { + return err + } + } + if m.Format != nil { + if err := m.Format.ValidateWithPath(path + "/Format"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FFTextType.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FFTextType.go new file mode 100644 index 00000000..9855c005 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FFTextType.go @@ -0,0 +1,75 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_FFTextType struct { + // Text Box Form Field Type Values + ValAttr ST_FFTextType +} + +func NewCT_FFTextType() *CT_FFTextType { + ret := &CT_FFTextType{} + ret.ValAttr = ST_FFTextType(1) + return ret +} + +func (m *CT_FFTextType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_FFTextType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_FFTextType(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_FFTextType: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_FFTextType and its children +func (m *CT_FFTextType) Validate() error { + return m.ValidateWithPath("CT_FFTextType") +} + +// ValidateWithPath validates the CT_FFTextType and its children, prefixing error messages with path +func (m *CT_FFTextType) ValidateWithPath(path string) error { + if m.ValAttr == ST_FFTextTypeUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FitText.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FitText.go new file mode 100644 index 00000000..cdb93198 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FitText.go @@ -0,0 +1,88 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_FitText struct { + // Value + ValAttr sharedTypes.ST_TwipsMeasure + // Fit Text Run ID + IdAttr *int64 +} + +func NewCT_FitText() *CT_FitText { + ret := &CT_FitText{} + return ret +} + +func (m *CT_FitText) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:val"}, + Value: fmt.Sprintf("%v", m.ValAttr)}) + if m.IdAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:id"}, + Value: fmt.Sprintf("%v", *m.IdAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_FitText) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := ParseUnionST_TwipsMeasure(attr.Value) + if err != nil { + return err + } + m.ValAttr = parsed + continue + } + if attr.Name.Local == "id" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.IdAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_FitText: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_FitText and its children +func (m *CT_FitText) Validate() error { + return m.ValidateWithPath("CT_FitText") +} + +// ValidateWithPath validates the CT_FitText and its children, prefixing error messages with path +func (m *CT_FitText) ValidateWithPath(path string) error { + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FldChar.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FldChar.go new file mode 100644 index 00000000..0234d902 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FldChar.go @@ -0,0 +1,174 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_FldChar struct { + // Field Character Type + FldCharTypeAttr ST_FldCharType + // Field Should Not Be Recalculated + FldLockAttr *sharedTypes.ST_OnOff + // Field Result Invalidated + DirtyAttr *sharedTypes.ST_OnOff + // Custom Field Data + FldData *CT_Text + // Form Field Properties + FfData *CT_FFData + // Previous Numbering Field Properties + NumberingChange *CT_TrackChangeNumbering +} + +func NewCT_FldChar() *CT_FldChar { + ret := &CT_FldChar{} + ret.FldCharTypeAttr = ST_FldCharType(1) + return ret +} + +func (m *CT_FldChar) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.FldCharTypeAttr.MarshalXMLAttr(xml.Name{Local: "w:fldCharType"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + if m.FldLockAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:fldLock"}, + Value: fmt.Sprintf("%v", *m.FldLockAttr)}) + } + if m.DirtyAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:dirty"}, + Value: fmt.Sprintf("%v", *m.DirtyAttr)}) + } + e.EncodeToken(start) + if m.FldData != nil { + sefldData := xml.StartElement{Name: xml.Name{Local: "w:fldData"}} + e.EncodeElement(m.FldData, sefldData) + } + if m.FfData != nil { + seffData := xml.StartElement{Name: xml.Name{Local: "w:ffData"}} + e.EncodeElement(m.FfData, seffData) + } + if m.NumberingChange != nil { + senumberingChange := xml.StartElement{Name: xml.Name{Local: "w:numberingChange"}} + e.EncodeElement(m.NumberingChange, senumberingChange) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_FldChar) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.FldCharTypeAttr = ST_FldCharType(1) + for _, attr := range start.Attr { + if attr.Name.Local == "fldCharType" { + m.FldCharTypeAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "fldLock" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.FldLockAttr = &parsed + continue + } + if attr.Name.Local == "dirty" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.DirtyAttr = &parsed + continue + } + } +lCT_FldChar: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "fldData"}: + m.FldData = NewCT_Text() + if err := d.DecodeElement(m.FldData, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ffData"}: + m.FfData = NewCT_FFData() + if err := d.DecodeElement(m.FfData, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "numberingChange"}: + m.NumberingChange = NewCT_TrackChangeNumbering() + if err := d.DecodeElement(m.NumberingChange, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_FldChar %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_FldChar + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_FldChar and its children +func (m *CT_FldChar) Validate() error { + return m.ValidateWithPath("CT_FldChar") +} + +// ValidateWithPath validates the CT_FldChar and its children, prefixing error messages with path +func (m *CT_FldChar) ValidateWithPath(path string) error { + if m.FldCharTypeAttr == ST_FldCharTypeUnset { + return fmt.Errorf("%s/FldCharTypeAttr is a mandatory field", path) + } + if err := m.FldCharTypeAttr.ValidateWithPath(path + "/FldCharTypeAttr"); err != nil { + return err + } + if m.FldLockAttr != nil { + if err := m.FldLockAttr.ValidateWithPath(path + "/FldLockAttr"); err != nil { + return err + } + } + if m.DirtyAttr != nil { + if err := m.DirtyAttr.ValidateWithPath(path + "/DirtyAttr"); err != nil { + return err + } + } + if m.FldData != nil { + if err := m.FldData.ValidateWithPath(path + "/FldData"); err != nil { + return err + } + } + if m.FfData != nil { + if err := m.FfData.ValidateWithPath(path + "/FfData"); err != nil { + return err + } + } + if m.NumberingChange != nil { + if err := m.NumberingChange.ValidateWithPath(path + "/NumberingChange"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Font.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Font.go new file mode 100644 index 00000000..3d29320a --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Font.go @@ -0,0 +1,256 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_Font struct { + // Primary Font Name + NameAttr string + // Alternate Names for Font + AltName *CT_String + // Panose-1 Typeface Classification Number + Panose1 *CT_Panose + // Character Set Supported By Font + Charset *CT_Charset + // Font Family + Family *CT_FontFamily + // Raster or Vector Font + NotTrueType *CT_OnOff + // Font Pitch + Pitch *CT_Pitch + // Supported Unicode Subranges and Code Pages + Sig *CT_FontSig + // Regular Font Style Embedding + EmbedRegular *CT_FontRel + // Bold Style Font Style Embedding + EmbedBold *CT_FontRel + // Italic Font Style Embedding + EmbedItalic *CT_FontRel + // Bold Italic Font Style Embedding + EmbedBoldItalic *CT_FontRel +} + +func NewCT_Font() *CT_Font { + ret := &CT_Font{} + return ret +} + +func (m *CT_Font) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:name"}, + Value: fmt.Sprintf("%v", m.NameAttr)}) + e.EncodeToken(start) + if m.AltName != nil { + sealtName := xml.StartElement{Name: xml.Name{Local: "w:altName"}} + e.EncodeElement(m.AltName, sealtName) + } + if m.Panose1 != nil { + sepanose1 := xml.StartElement{Name: xml.Name{Local: "w:panose1"}} + e.EncodeElement(m.Panose1, sepanose1) + } + if m.Charset != nil { + secharset := xml.StartElement{Name: xml.Name{Local: "w:charset"}} + e.EncodeElement(m.Charset, secharset) + } + if m.Family != nil { + sefamily := xml.StartElement{Name: xml.Name{Local: "w:family"}} + e.EncodeElement(m.Family, sefamily) + } + if m.NotTrueType != nil { + senotTrueType := xml.StartElement{Name: xml.Name{Local: "w:notTrueType"}} + e.EncodeElement(m.NotTrueType, senotTrueType) + } + if m.Pitch != nil { + sepitch := xml.StartElement{Name: xml.Name{Local: "w:pitch"}} + e.EncodeElement(m.Pitch, sepitch) + } + if m.Sig != nil { + sesig := xml.StartElement{Name: xml.Name{Local: "w:sig"}} + e.EncodeElement(m.Sig, sesig) + } + if m.EmbedRegular != nil { + seembedRegular := xml.StartElement{Name: xml.Name{Local: "w:embedRegular"}} + e.EncodeElement(m.EmbedRegular, seembedRegular) + } + if m.EmbedBold != nil { + seembedBold := xml.StartElement{Name: xml.Name{Local: "w:embedBold"}} + e.EncodeElement(m.EmbedBold, seembedBold) + } + if m.EmbedItalic != nil { + seembedItalic := xml.StartElement{Name: xml.Name{Local: "w:embedItalic"}} + e.EncodeElement(m.EmbedItalic, seembedItalic) + } + if m.EmbedBoldItalic != nil { + seembedBoldItalic := xml.StartElement{Name: xml.Name{Local: "w:embedBoldItalic"}} + e.EncodeElement(m.EmbedBoldItalic, seembedBoldItalic) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Font) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "name" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.NameAttr = parsed + continue + } + } +lCT_Font: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "altName"}: + m.AltName = NewCT_String() + if err := d.DecodeElement(m.AltName, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "panose1"}: + m.Panose1 = NewCT_Panose() + if err := d.DecodeElement(m.Panose1, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "charset"}: + m.Charset = NewCT_Charset() + if err := d.DecodeElement(m.Charset, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "family"}: + m.Family = NewCT_FontFamily() + if err := d.DecodeElement(m.Family, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "notTrueType"}: + m.NotTrueType = NewCT_OnOff() + if err := d.DecodeElement(m.NotTrueType, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pitch"}: + m.Pitch = NewCT_Pitch() + if err := d.DecodeElement(m.Pitch, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sig"}: + m.Sig = NewCT_FontSig() + if err := d.DecodeElement(m.Sig, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "embedRegular"}: + m.EmbedRegular = NewCT_FontRel() + if err := d.DecodeElement(m.EmbedRegular, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "embedBold"}: + m.EmbedBold = NewCT_FontRel() + if err := d.DecodeElement(m.EmbedBold, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "embedItalic"}: + m.EmbedItalic = NewCT_FontRel() + if err := d.DecodeElement(m.EmbedItalic, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "embedBoldItalic"}: + m.EmbedBoldItalic = NewCT_FontRel() + if err := d.DecodeElement(m.EmbedBoldItalic, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_Font %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Font + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Font and its children +func (m *CT_Font) Validate() error { + return m.ValidateWithPath("CT_Font") +} + +// ValidateWithPath validates the CT_Font and its children, prefixing error messages with path +func (m *CT_Font) ValidateWithPath(path string) error { + if m.AltName != nil { + if err := m.AltName.ValidateWithPath(path + "/AltName"); err != nil { + return err + } + } + if m.Panose1 != nil { + if err := m.Panose1.ValidateWithPath(path + "/Panose1"); err != nil { + return err + } + } + if m.Charset != nil { + if err := m.Charset.ValidateWithPath(path + "/Charset"); err != nil { + return err + } + } + if m.Family != nil { + if err := m.Family.ValidateWithPath(path + "/Family"); err != nil { + return err + } + } + if m.NotTrueType != nil { + if err := m.NotTrueType.ValidateWithPath(path + "/NotTrueType"); err != nil { + return err + } + } + if m.Pitch != nil { + if err := m.Pitch.ValidateWithPath(path + "/Pitch"); err != nil { + return err + } + } + if m.Sig != nil { + if err := m.Sig.ValidateWithPath(path + "/Sig"); err != nil { + return err + } + } + if m.EmbedRegular != nil { + if err := m.EmbedRegular.ValidateWithPath(path + "/EmbedRegular"); err != nil { + return err + } + } + if m.EmbedBold != nil { + if err := m.EmbedBold.ValidateWithPath(path + "/EmbedBold"); err != nil { + return err + } + } + if m.EmbedItalic != nil { + if err := m.EmbedItalic.ValidateWithPath(path + "/EmbedItalic"); err != nil { + return err + } + } + if m.EmbedBoldItalic != nil { + if err := m.EmbedBoldItalic.ValidateWithPath(path + "/EmbedBoldItalic"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FontFamily.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FontFamily.go new file mode 100644 index 00000000..7a7ee2fb --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FontFamily.go @@ -0,0 +1,75 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_FontFamily struct { + // Font Family Value + ValAttr ST_FontFamily +} + +func NewCT_FontFamily() *CT_FontFamily { + ret := &CT_FontFamily{} + ret.ValAttr = ST_FontFamily(1) + return ret +} + +func (m *CT_FontFamily) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_FontFamily) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_FontFamily(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_FontFamily: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_FontFamily and its children +func (m *CT_FontFamily) Validate() error { + return m.ValidateWithPath("CT_FontFamily") +} + +// ValidateWithPath validates the CT_FontFamily and its children, prefixing error messages with path +func (m *CT_FontFamily) ValidateWithPath(path string) error { + if m.ValAttr == ST_FontFamilyUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FontRel.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FontRel.go new file mode 100644 index 00000000..35c099f6 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FontRel.go @@ -0,0 +1,99 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_FontRel struct { + FontKeyAttr string + SubsettedAttr sharedTypes.ST_OnOff + IdAttr string +} + +func NewCT_FontRel() *CT_FontRel { + ret := &CT_FontRel{} + ret.FontKeyAttr = "{00000000-0000-0000-0000-000000000000}" + return ret +} + +func (m *CT_FontRel) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:fontKey"}, + Value: fmt.Sprintf("%v", m.FontKeyAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:subsetted"}, + Value: fmt.Sprintf("%v", m.SubsettedAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "r:id"}, + Value: fmt.Sprintf("%v", m.IdAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_FontRel) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.FontKeyAttr = "{00000000-0000-0000-0000-000000000000}" + for _, attr := range start.Attr { + if attr.Name.Space == "http://schemas.openxmlformats.org/officeDocument/2006/relationships" && attr.Name.Local == "id" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.IdAttr = parsed + continue + } + if attr.Name.Local == "fontKey" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.FontKeyAttr = parsed + continue + } + if attr.Name.Local == "subsetted" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.SubsettedAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_FontRel: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_FontRel and its children +func (m *CT_FontRel) Validate() error { + return m.ValidateWithPath("CT_FontRel") +} + +// ValidateWithPath validates the CT_FontRel and its children, prefixing error messages with path +func (m *CT_FontRel) ValidateWithPath(path string) error { + if !sharedTypes.ST_GuidPatternRe.MatchString(m.FontKeyAttr) { + return fmt.Errorf(`%s/m.FontKeyAttr must match '%s' (have %v)`, path, sharedTypes.ST_GuidPatternRe, m.FontKeyAttr) + } + if err := m.SubsettedAttr.ValidateWithPath(path + "/SubsettedAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FontSig.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FontSig.go new file mode 100644 index 00000000..5974ea94 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FontSig.go @@ -0,0 +1,128 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_FontSig struct { + // First 32 Bits of Unicode Subset Bitfield + Usb0Attr string + // Second 32 Bits of Unicode Subset Bitfield + Usb1Attr string + // Third 32 Bits of Unicode Subset Bitfield + Usb2Attr string + // Fourth 32 Bits of Unicode Subset Bitfield + Usb3Attr string + // Lower 32 Bits of Code Page Bit Field + Csb0Attr string + // Upper 32 Bits of Code Page Bit Field + Csb1Attr string +} + +func NewCT_FontSig() *CT_FontSig { + ret := &CT_FontSig{} + return ret +} + +func (m *CT_FontSig) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:usb0"}, + Value: fmt.Sprintf("%v", m.Usb0Attr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:usb1"}, + Value: fmt.Sprintf("%v", m.Usb1Attr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:usb2"}, + Value: fmt.Sprintf("%v", m.Usb2Attr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:usb3"}, + Value: fmt.Sprintf("%v", m.Usb3Attr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:csb0"}, + Value: fmt.Sprintf("%v", m.Csb0Attr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:csb1"}, + Value: fmt.Sprintf("%v", m.Csb1Attr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_FontSig) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "usb0" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.Usb0Attr = parsed + continue + } + if attr.Name.Local == "usb1" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.Usb1Attr = parsed + continue + } + if attr.Name.Local == "usb2" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.Usb2Attr = parsed + continue + } + if attr.Name.Local == "usb3" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.Usb3Attr = parsed + continue + } + if attr.Name.Local == "csb0" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.Csb0Attr = parsed + continue + } + if attr.Name.Local == "csb1" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.Csb1Attr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_FontSig: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_FontSig and its children +func (m *CT_FontSig) Validate() error { + return m.ValidateWithPath("CT_FontSig") +} + +// ValidateWithPath validates the CT_FontSig and its children, prefixing error messages with path +func (m *CT_FontSig) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Fonts.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Fonts.go new file mode 100644 index 00000000..f8881dff --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Fonts.go @@ -0,0 +1,192 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_Fonts struct { + // Font Content Type + HintAttr ST_Hint + // ASCII Font + AsciiAttr *string + // High ANSI Font + HAnsiAttr *string + // East Asian Font + EastAsiaAttr *string + // Complex Script Font + CsAttr *string + // ASCII Theme Font + AsciiThemeAttr ST_Theme + // High ANSI Theme Font + HAnsiThemeAttr ST_Theme + // East Asian Theme Font + EastAsiaThemeAttr ST_Theme + // Complex Script Theme Font + CsthemeAttr ST_Theme +} + +func NewCT_Fonts() *CT_Fonts { + ret := &CT_Fonts{} + return ret +} + +func (m *CT_Fonts) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.HintAttr != ST_HintUnset { + attr, err := m.HintAttr.MarshalXMLAttr(xml.Name{Local: "w:hint"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.AsciiAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:ascii"}, + Value: fmt.Sprintf("%v", *m.AsciiAttr)}) + } + if m.HAnsiAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:hAnsi"}, + Value: fmt.Sprintf("%v", *m.HAnsiAttr)}) + } + if m.EastAsiaAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:eastAsia"}, + Value: fmt.Sprintf("%v", *m.EastAsiaAttr)}) + } + if m.CsAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:cs"}, + Value: fmt.Sprintf("%v", *m.CsAttr)}) + } + if m.AsciiThemeAttr != ST_ThemeUnset { + attr, err := m.AsciiThemeAttr.MarshalXMLAttr(xml.Name{Local: "w:asciiTheme"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.HAnsiThemeAttr != ST_ThemeUnset { + attr, err := m.HAnsiThemeAttr.MarshalXMLAttr(xml.Name{Local: "w:hAnsiTheme"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.EastAsiaThemeAttr != ST_ThemeUnset { + attr, err := m.EastAsiaThemeAttr.MarshalXMLAttr(xml.Name{Local: "w:eastAsiaTheme"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.CsthemeAttr != ST_ThemeUnset { + attr, err := m.CsthemeAttr.MarshalXMLAttr(xml.Name{Local: "w:cstheme"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Fonts) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "hint" { + m.HintAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "ascii" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.AsciiAttr = &parsed + continue + } + if attr.Name.Local == "hAnsi" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.HAnsiAttr = &parsed + continue + } + if attr.Name.Local == "eastAsia" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.EastAsiaAttr = &parsed + continue + } + if attr.Name.Local == "cs" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.CsAttr = &parsed + continue + } + if attr.Name.Local == "asciiTheme" { + m.AsciiThemeAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "hAnsiTheme" { + m.HAnsiThemeAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "eastAsiaTheme" { + m.EastAsiaThemeAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "cstheme" { + m.CsthemeAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Fonts: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Fonts and its children +func (m *CT_Fonts) Validate() error { + return m.ValidateWithPath("CT_Fonts") +} + +// ValidateWithPath validates the CT_Fonts and its children, prefixing error messages with path +func (m *CT_Fonts) ValidateWithPath(path string) error { + if err := m.HintAttr.ValidateWithPath(path + "/HintAttr"); err != nil { + return err + } + if err := m.AsciiThemeAttr.ValidateWithPath(path + "/AsciiThemeAttr"); err != nil { + return err + } + if err := m.HAnsiThemeAttr.ValidateWithPath(path + "/HAnsiThemeAttr"); err != nil { + return err + } + if err := m.EastAsiaThemeAttr.ValidateWithPath(path + "/EastAsiaThemeAttr"); err != nil { + return err + } + if err := m.CsthemeAttr.ValidateWithPath(path + "/CsthemeAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FontsList.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FontsList.go new file mode 100644 index 00000000..e39e1f40 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FontsList.go @@ -0,0 +1,85 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_FontsList struct { + // Properties for a Single Font + Font []*CT_Font +} + +func NewCT_FontsList() *CT_FontsList { + ret := &CT_FontsList{} + return ret +} + +func (m *CT_FontsList) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Font != nil { + sefont := xml.StartElement{Name: xml.Name{Local: "w:font"}} + for _, c := range m.Font { + e.EncodeElement(c, sefont) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_FontsList) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_FontsList: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "font"}: + tmp := NewCT_Font() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Font = append(m.Font, tmp) + default: + gooxml.Log("skipping unsupported element on CT_FontsList %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_FontsList + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_FontsList and its children +func (m *CT_FontsList) Validate() error { + return m.ValidateWithPath("CT_FontsList") +} + +// ValidateWithPath validates the CT_FontsList and its children, prefixing error messages with path +func (m *CT_FontsList) ValidateWithPath(path string) error { + for i, v := range m.Font { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Font[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Footnotes.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Footnotes.go new file mode 100644 index 00000000..253df1a0 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Footnotes.go @@ -0,0 +1,85 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_Footnotes struct { + // Footnote Content + Footnote []*CT_FtnEdn +} + +func NewCT_Footnotes() *CT_Footnotes { + ret := &CT_Footnotes{} + return ret +} + +func (m *CT_Footnotes) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Footnote != nil { + sefootnote := xml.StartElement{Name: xml.Name{Local: "w:footnote"}} + for _, c := range m.Footnote { + e.EncodeElement(c, sefootnote) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Footnotes) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_Footnotes: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "footnote"}: + tmp := NewCT_FtnEdn() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Footnote = append(m.Footnote, tmp) + default: + gooxml.Log("skipping unsupported element on CT_Footnotes %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Footnotes + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Footnotes and its children +func (m *CT_Footnotes) Validate() error { + return m.ValidateWithPath("CT_Footnotes") +} + +// ValidateWithPath validates the CT_Footnotes and its children, prefixing error messages with path +func (m *CT_Footnotes) ValidateWithPath(path string) error { + for i, v := range m.Footnote { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Footnote[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Frame.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Frame.go new file mode 100644 index 00000000..b3c59067 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Frame.go @@ -0,0 +1,225 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_Frame struct { + // Frame Size + Sz *CT_String + // Frame Name + Name *CT_String + // Frame or Frameset Title + Title *CT_String + // Frame Long Description + LongDesc *CT_Rel + // Source File for Frame + SourceFileName *CT_Rel + // Left and Right Margin for Frame + MarW *CT_PixelsMeasure + // Top and Bottom Margin for Frame + MarH *CT_PixelsMeasure + // Scrollbar Display Option + Scrollbar *CT_FrameScrollbar + // Frame Cannot Be Resized + NoResizeAllowed *CT_OnOff + // Maintain Link to Existing File + LinkedToFile *CT_OnOff +} + +func NewCT_Frame() *CT_Frame { + ret := &CT_Frame{} + return ret +} + +func (m *CT_Frame) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Sz != nil { + sesz := xml.StartElement{Name: xml.Name{Local: "w:sz"}} + e.EncodeElement(m.Sz, sesz) + } + if m.Name != nil { + sename := xml.StartElement{Name: xml.Name{Local: "w:name"}} + e.EncodeElement(m.Name, sename) + } + if m.Title != nil { + setitle := xml.StartElement{Name: xml.Name{Local: "w:title"}} + e.EncodeElement(m.Title, setitle) + } + if m.LongDesc != nil { + selongDesc := xml.StartElement{Name: xml.Name{Local: "w:longDesc"}} + e.EncodeElement(m.LongDesc, selongDesc) + } + if m.SourceFileName != nil { + sesourceFileName := xml.StartElement{Name: xml.Name{Local: "w:sourceFileName"}} + e.EncodeElement(m.SourceFileName, sesourceFileName) + } + if m.MarW != nil { + semarW := xml.StartElement{Name: xml.Name{Local: "w:marW"}} + e.EncodeElement(m.MarW, semarW) + } + if m.MarH != nil { + semarH := xml.StartElement{Name: xml.Name{Local: "w:marH"}} + e.EncodeElement(m.MarH, semarH) + } + if m.Scrollbar != nil { + sescrollbar := xml.StartElement{Name: xml.Name{Local: "w:scrollbar"}} + e.EncodeElement(m.Scrollbar, sescrollbar) + } + if m.NoResizeAllowed != nil { + senoResizeAllowed := xml.StartElement{Name: xml.Name{Local: "w:noResizeAllowed"}} + e.EncodeElement(m.NoResizeAllowed, senoResizeAllowed) + } + if m.LinkedToFile != nil { + selinkedToFile := xml.StartElement{Name: xml.Name{Local: "w:linkedToFile"}} + e.EncodeElement(m.LinkedToFile, selinkedToFile) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Frame) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_Frame: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sz"}: + m.Sz = NewCT_String() + if err := d.DecodeElement(m.Sz, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "name"}: + m.Name = NewCT_String() + if err := d.DecodeElement(m.Name, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "title"}: + m.Title = NewCT_String() + if err := d.DecodeElement(m.Title, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "longDesc"}: + m.LongDesc = NewCT_Rel() + if err := d.DecodeElement(m.LongDesc, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sourceFileName"}: + m.SourceFileName = NewCT_Rel() + if err := d.DecodeElement(m.SourceFileName, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "marW"}: + m.MarW = NewCT_PixelsMeasure() + if err := d.DecodeElement(m.MarW, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "marH"}: + m.MarH = NewCT_PixelsMeasure() + if err := d.DecodeElement(m.MarH, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "scrollbar"}: + m.Scrollbar = NewCT_FrameScrollbar() + if err := d.DecodeElement(m.Scrollbar, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "noResizeAllowed"}: + m.NoResizeAllowed = NewCT_OnOff() + if err := d.DecodeElement(m.NoResizeAllowed, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "linkedToFile"}: + m.LinkedToFile = NewCT_OnOff() + if err := d.DecodeElement(m.LinkedToFile, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_Frame %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Frame + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Frame and its children +func (m *CT_Frame) Validate() error { + return m.ValidateWithPath("CT_Frame") +} + +// ValidateWithPath validates the CT_Frame and its children, prefixing error messages with path +func (m *CT_Frame) ValidateWithPath(path string) error { + if m.Sz != nil { + if err := m.Sz.ValidateWithPath(path + "/Sz"); err != nil { + return err + } + } + if m.Name != nil { + if err := m.Name.ValidateWithPath(path + "/Name"); err != nil { + return err + } + } + if m.Title != nil { + if err := m.Title.ValidateWithPath(path + "/Title"); err != nil { + return err + } + } + if m.LongDesc != nil { + if err := m.LongDesc.ValidateWithPath(path + "/LongDesc"); err != nil { + return err + } + } + if m.SourceFileName != nil { + if err := m.SourceFileName.ValidateWithPath(path + "/SourceFileName"); err != nil { + return err + } + } + if m.MarW != nil { + if err := m.MarW.ValidateWithPath(path + "/MarW"); err != nil { + return err + } + } + if m.MarH != nil { + if err := m.MarH.ValidateWithPath(path + "/MarH"); err != nil { + return err + } + } + if m.Scrollbar != nil { + if err := m.Scrollbar.ValidateWithPath(path + "/Scrollbar"); err != nil { + return err + } + } + if m.NoResizeAllowed != nil { + if err := m.NoResizeAllowed.ValidateWithPath(path + "/NoResizeAllowed"); err != nil { + return err + } + } + if m.LinkedToFile != nil { + if err := m.LinkedToFile.ValidateWithPath(path + "/LinkedToFile"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FrameLayout.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FrameLayout.go new file mode 100644 index 00000000..bc2efadf --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FrameLayout.go @@ -0,0 +1,75 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_FrameLayout struct { + // Frameset Layout Value + ValAttr ST_FrameLayout +} + +func NewCT_FrameLayout() *CT_FrameLayout { + ret := &CT_FrameLayout{} + ret.ValAttr = ST_FrameLayout(1) + return ret +} + +func (m *CT_FrameLayout) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_FrameLayout) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_FrameLayout(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_FrameLayout: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_FrameLayout and its children +func (m *CT_FrameLayout) Validate() error { + return m.ValidateWithPath("CT_FrameLayout") +} + +// ValidateWithPath validates the CT_FrameLayout and its children, prefixing error messages with path +func (m *CT_FrameLayout) ValidateWithPath(path string) error { + if m.ValAttr == ST_FrameLayoutUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FramePr.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FramePr.go new file mode 100644 index 00000000..f5da6c01 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FramePr.go @@ -0,0 +1,318 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_FramePr struct { + // Drop Cap Frame + DropCapAttr ST_DropCap + // Drop Cap Vertical Height in Lines + LinesAttr *int64 + // Frame Width + WAttr *sharedTypes.ST_TwipsMeasure + // Frame Height + HAttr *sharedTypes.ST_TwipsMeasure + // Vertical Frame Padding + VSpaceAttr *sharedTypes.ST_TwipsMeasure + // Horizontal Frame Padding + HSpaceAttr *sharedTypes.ST_TwipsMeasure + // Text Wrapping Around Frame + WrapAttr ST_Wrap + // Frame Horizontal Positioning Base + HAnchorAttr ST_HAnchor + // Frame Vertical Positioning Base + VAnchorAttr ST_VAnchor + // Absolute Horizontal Position + XAttr *ST_SignedTwipsMeasure + // Relative Horizontal Position + XAlignAttr sharedTypes.ST_XAlign + // Absolute Vertical Position + YAttr *ST_SignedTwipsMeasure + // Relative Vertical Position + YAlignAttr sharedTypes.ST_YAlign + // Frame Height Type + HRuleAttr ST_HeightRule + // Lock Frame Anchor to Paragraph + AnchorLockAttr *sharedTypes.ST_OnOff +} + +func NewCT_FramePr() *CT_FramePr { + ret := &CT_FramePr{} + return ret +} + +func (m *CT_FramePr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.DropCapAttr != ST_DropCapUnset { + attr, err := m.DropCapAttr.MarshalXMLAttr(xml.Name{Local: "w:dropCap"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.LinesAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:lines"}, + Value: fmt.Sprintf("%v", *m.LinesAttr)}) + } + if m.WAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:w"}, + Value: fmt.Sprintf("%v", *m.WAttr)}) + } + if m.HAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:h"}, + Value: fmt.Sprintf("%v", *m.HAttr)}) + } + if m.VSpaceAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:vSpace"}, + Value: fmt.Sprintf("%v", *m.VSpaceAttr)}) + } + if m.HSpaceAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:hSpace"}, + Value: fmt.Sprintf("%v", *m.HSpaceAttr)}) + } + if m.WrapAttr != ST_WrapUnset { + attr, err := m.WrapAttr.MarshalXMLAttr(xml.Name{Local: "w:wrap"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.HAnchorAttr != ST_HAnchorUnset { + attr, err := m.HAnchorAttr.MarshalXMLAttr(xml.Name{Local: "w:hAnchor"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.VAnchorAttr != ST_VAnchorUnset { + attr, err := m.VAnchorAttr.MarshalXMLAttr(xml.Name{Local: "w:vAnchor"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.XAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:x"}, + Value: fmt.Sprintf("%v", *m.XAttr)}) + } + if m.XAlignAttr != sharedTypes.ST_XAlignUnset { + attr, err := m.XAlignAttr.MarshalXMLAttr(xml.Name{Local: "w:xAlign"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.YAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:y"}, + Value: fmt.Sprintf("%v", *m.YAttr)}) + } + if m.YAlignAttr != sharedTypes.ST_YAlignUnset { + attr, err := m.YAlignAttr.MarshalXMLAttr(xml.Name{Local: "w:yAlign"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.HRuleAttr != ST_HeightRuleUnset { + attr, err := m.HRuleAttr.MarshalXMLAttr(xml.Name{Local: "w:hRule"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.AnchorLockAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:anchorLock"}, + Value: fmt.Sprintf("%v", *m.AnchorLockAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_FramePr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "hAnchor" { + m.HAnchorAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "vAnchor" { + m.VAnchorAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "lines" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.LinesAttr = &parsed + continue + } + if attr.Name.Local == "h" { + parsed, err := ParseUnionST_TwipsMeasure(attr.Value) + if err != nil { + return err + } + m.HAttr = &parsed + continue + } + if attr.Name.Local == "vSpace" { + parsed, err := ParseUnionST_TwipsMeasure(attr.Value) + if err != nil { + return err + } + m.VSpaceAttr = &parsed + continue + } + if attr.Name.Local == "hSpace" { + parsed, err := ParseUnionST_TwipsMeasure(attr.Value) + if err != nil { + return err + } + m.HSpaceAttr = &parsed + continue + } + if attr.Name.Local == "wrap" { + m.WrapAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "dropCap" { + m.DropCapAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "w" { + parsed, err := ParseUnionST_TwipsMeasure(attr.Value) + if err != nil { + return err + } + m.WAttr = &parsed + continue + } + if attr.Name.Local == "x" { + parsed, err := ParseUnionST_SignedTwipsMeasure(attr.Value) + if err != nil { + return err + } + m.XAttr = &parsed + continue + } + if attr.Name.Local == "xAlign" { + m.XAlignAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "y" { + parsed, err := ParseUnionST_SignedTwipsMeasure(attr.Value) + if err != nil { + return err + } + m.YAttr = &parsed + continue + } + if attr.Name.Local == "yAlign" { + m.YAlignAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "hRule" { + m.HRuleAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "anchorLock" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.AnchorLockAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_FramePr: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_FramePr and its children +func (m *CT_FramePr) Validate() error { + return m.ValidateWithPath("CT_FramePr") +} + +// ValidateWithPath validates the CT_FramePr and its children, prefixing error messages with path +func (m *CT_FramePr) ValidateWithPath(path string) error { + if err := m.DropCapAttr.ValidateWithPath(path + "/DropCapAttr"); err != nil { + return err + } + if m.WAttr != nil { + if err := m.WAttr.ValidateWithPath(path + "/WAttr"); err != nil { + return err + } + } + if m.HAttr != nil { + if err := m.HAttr.ValidateWithPath(path + "/HAttr"); err != nil { + return err + } + } + if m.VSpaceAttr != nil { + if err := m.VSpaceAttr.ValidateWithPath(path + "/VSpaceAttr"); err != nil { + return err + } + } + if m.HSpaceAttr != nil { + if err := m.HSpaceAttr.ValidateWithPath(path + "/HSpaceAttr"); err != nil { + return err + } + } + if err := m.WrapAttr.ValidateWithPath(path + "/WrapAttr"); err != nil { + return err + } + if err := m.HAnchorAttr.ValidateWithPath(path + "/HAnchorAttr"); err != nil { + return err + } + if err := m.VAnchorAttr.ValidateWithPath(path + "/VAnchorAttr"); err != nil { + return err + } + if m.XAttr != nil { + if err := m.XAttr.ValidateWithPath(path + "/XAttr"); err != nil { + return err + } + } + if err := m.XAlignAttr.ValidateWithPath(path + "/XAlignAttr"); err != nil { + return err + } + if m.YAttr != nil { + if err := m.YAttr.ValidateWithPath(path + "/YAttr"); err != nil { + return err + } + } + if err := m.YAlignAttr.ValidateWithPath(path + "/YAlignAttr"); err != nil { + return err + } + if err := m.HRuleAttr.ValidateWithPath(path + "/HRuleAttr"); err != nil { + return err + } + if m.AnchorLockAttr != nil { + if err := m.AnchorLockAttr.ValidateWithPath(path + "/AnchorLockAttr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FrameScrollbar.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FrameScrollbar.go new file mode 100644 index 00000000..9152cbd8 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FrameScrollbar.go @@ -0,0 +1,75 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_FrameScrollbar struct { + // Scrollbar Display Option Value + ValAttr ST_FrameScrollbar +} + +func NewCT_FrameScrollbar() *CT_FrameScrollbar { + ret := &CT_FrameScrollbar{} + ret.ValAttr = ST_FrameScrollbar(1) + return ret +} + +func (m *CT_FrameScrollbar) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_FrameScrollbar) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_FrameScrollbar(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_FrameScrollbar: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_FrameScrollbar and its children +func (m *CT_FrameScrollbar) Validate() error { + return m.ValidateWithPath("CT_FrameScrollbar") +} + +// ValidateWithPath validates the CT_FrameScrollbar and its children, prefixing error messages with path +func (m *CT_FrameScrollbar) ValidateWithPath(path string) error { + if m.ValAttr == ST_FrameScrollbarUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Frameset.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Frameset.go new file mode 100644 index 00000000..156c4140 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Frameset.go @@ -0,0 +1,152 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_Frameset struct { + // Nested Frameset Size + Sz *CT_String + // Frameset Splitter Properties + FramesetSplitbar *CT_FramesetSplitbar + // Frameset Layout + FrameLayout *CT_FrameLayout + Title *CT_String + Choice []*CT_FramesetChoice +} + +func NewCT_Frameset() *CT_Frameset { + ret := &CT_Frameset{} + return ret +} + +func (m *CT_Frameset) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Sz != nil { + sesz := xml.StartElement{Name: xml.Name{Local: "w:sz"}} + e.EncodeElement(m.Sz, sesz) + } + if m.FramesetSplitbar != nil { + seframesetSplitbar := xml.StartElement{Name: xml.Name{Local: "w:framesetSplitbar"}} + e.EncodeElement(m.FramesetSplitbar, seframesetSplitbar) + } + if m.FrameLayout != nil { + seframeLayout := xml.StartElement{Name: xml.Name{Local: "w:frameLayout"}} + e.EncodeElement(m.FrameLayout, seframeLayout) + } + if m.Title != nil { + setitle := xml.StartElement{Name: xml.Name{Local: "w:title"}} + e.EncodeElement(m.Title, setitle) + } + if m.Choice != nil { + for _, c := range m.Choice { + c.MarshalXML(e, xml.StartElement{}) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Frameset) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_Frameset: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sz"}: + m.Sz = NewCT_String() + if err := d.DecodeElement(m.Sz, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "framesetSplitbar"}: + m.FramesetSplitbar = NewCT_FramesetSplitbar() + if err := d.DecodeElement(m.FramesetSplitbar, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "frameLayout"}: + m.FrameLayout = NewCT_FrameLayout() + if err := d.DecodeElement(m.FrameLayout, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "title"}: + m.Title = NewCT_String() + if err := d.DecodeElement(m.Title, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "frameset"}: + tmp := NewCT_FramesetChoice() + if err := d.DecodeElement(&tmp.Frameset, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "frame"}: + tmp := NewCT_FramesetChoice() + if err := d.DecodeElement(&tmp.Frame, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + default: + gooxml.Log("skipping unsupported element on CT_Frameset %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Frameset + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Frameset and its children +func (m *CT_Frameset) Validate() error { + return m.ValidateWithPath("CT_Frameset") +} + +// ValidateWithPath validates the CT_Frameset and its children, prefixing error messages with path +func (m *CT_Frameset) ValidateWithPath(path string) error { + if m.Sz != nil { + if err := m.Sz.ValidateWithPath(path + "/Sz"); err != nil { + return err + } + } + if m.FramesetSplitbar != nil { + if err := m.FramesetSplitbar.ValidateWithPath(path + "/FramesetSplitbar"); err != nil { + return err + } + } + if m.FrameLayout != nil { + if err := m.FrameLayout.ValidateWithPath(path + "/FrameLayout"); err != nil { + return err + } + } + if m.Title != nil { + if err := m.Title.ValidateWithPath(path + "/Title"); err != nil { + return err + } + } + for i, v := range m.Choice { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Choice[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FramesetChoice.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FramesetChoice.go new file mode 100644 index 00000000..7e019533 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FramesetChoice.go @@ -0,0 +1,100 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_FramesetChoice struct { + Frameset []*CT_Frameset + Frame []*CT_Frame +} + +func NewCT_FramesetChoice() *CT_FramesetChoice { + ret := &CT_FramesetChoice{} + return ret +} + +func (m *CT_FramesetChoice) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.Frameset != nil { + seframeset := xml.StartElement{Name: xml.Name{Local: "w:frameset"}} + for _, c := range m.Frameset { + e.EncodeElement(c, seframeset) + } + } + if m.Frame != nil { + seframe := xml.StartElement{Name: xml.Name{Local: "w:frame"}} + for _, c := range m.Frame { + e.EncodeElement(c, seframe) + } + } + return nil +} + +func (m *CT_FramesetChoice) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_FramesetChoice: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "frameset"}: + tmp := NewCT_Frameset() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Frameset = append(m.Frameset, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "frame"}: + tmp := NewCT_Frame() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Frame = append(m.Frame, tmp) + default: + gooxml.Log("skipping unsupported element on CT_FramesetChoice %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_FramesetChoice + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_FramesetChoice and its children +func (m *CT_FramesetChoice) Validate() error { + return m.ValidateWithPath("CT_FramesetChoice") +} + +// ValidateWithPath validates the CT_FramesetChoice and its children, prefixing error messages with path +func (m *CT_FramesetChoice) ValidateWithPath(path string) error { + for i, v := range m.Frameset { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Frameset[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.Frame { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Frame[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FramesetSplitbar.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FramesetSplitbar.go new file mode 100644 index 00000000..eb21d1f6 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FramesetSplitbar.go @@ -0,0 +1,129 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_FramesetSplitbar struct { + // Frameset Splitter Width + W *CT_TwipsMeasure + // Frameset Splitter Color + Color *CT_Color + // Do Not Display Frameset Splitters + NoBorder *CT_OnOff + // Frameset Splitter Border Style + FlatBorders *CT_OnOff +} + +func NewCT_FramesetSplitbar() *CT_FramesetSplitbar { + ret := &CT_FramesetSplitbar{} + return ret +} + +func (m *CT_FramesetSplitbar) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.W != nil { + sew := xml.StartElement{Name: xml.Name{Local: "w:w"}} + e.EncodeElement(m.W, sew) + } + if m.Color != nil { + secolor := xml.StartElement{Name: xml.Name{Local: "w:color"}} + e.EncodeElement(m.Color, secolor) + } + if m.NoBorder != nil { + senoBorder := xml.StartElement{Name: xml.Name{Local: "w:noBorder"}} + e.EncodeElement(m.NoBorder, senoBorder) + } + if m.FlatBorders != nil { + seflatBorders := xml.StartElement{Name: xml.Name{Local: "w:flatBorders"}} + e.EncodeElement(m.FlatBorders, seflatBorders) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_FramesetSplitbar) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_FramesetSplitbar: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "w"}: + m.W = NewCT_TwipsMeasure() + if err := d.DecodeElement(m.W, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "color"}: + m.Color = NewCT_Color() + if err := d.DecodeElement(m.Color, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "noBorder"}: + m.NoBorder = NewCT_OnOff() + if err := d.DecodeElement(m.NoBorder, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "flatBorders"}: + m.FlatBorders = NewCT_OnOff() + if err := d.DecodeElement(m.FlatBorders, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_FramesetSplitbar %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_FramesetSplitbar + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_FramesetSplitbar and its children +func (m *CT_FramesetSplitbar) Validate() error { + return m.ValidateWithPath("CT_FramesetSplitbar") +} + +// ValidateWithPath validates the CT_FramesetSplitbar and its children, prefixing error messages with path +func (m *CT_FramesetSplitbar) ValidateWithPath(path string) error { + if m.W != nil { + if err := m.W.ValidateWithPath(path + "/W"); err != nil { + return err + } + } + if m.Color != nil { + if err := m.Color.ValidateWithPath(path + "/Color"); err != nil { + return err + } + } + if m.NoBorder != nil { + if err := m.NoBorder.ValidateWithPath(path + "/NoBorder"); err != nil { + return err + } + } + if m.FlatBorders != nil { + if err := m.FlatBorders.ValidateWithPath(path + "/FlatBorders"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FtnDocProps.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FtnDocProps.go new file mode 100644 index 00000000..080b0f65 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FtnDocProps.go @@ -0,0 +1,148 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_FtnDocProps struct { + // Footnote Placement + Pos *CT_FtnPos + // Footnote Numbering Format + NumFmt *CT_NumFmt + // Footnote and Endnote Numbering Starting Value + NumStart *CT_DecimalNumber + // Footnote and Endnote Numbering Restart Location + NumRestart *CT_NumRestart + Footnote []*CT_FtnEdnSepRef +} + +func NewCT_FtnDocProps() *CT_FtnDocProps { + ret := &CT_FtnDocProps{} + return ret +} + +func (m *CT_FtnDocProps) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Pos != nil { + sepos := xml.StartElement{Name: xml.Name{Local: "w:pos"}} + e.EncodeElement(m.Pos, sepos) + } + if m.NumFmt != nil { + senumFmt := xml.StartElement{Name: xml.Name{Local: "w:numFmt"}} + e.EncodeElement(m.NumFmt, senumFmt) + } + if m.NumStart != nil { + senumStart := xml.StartElement{Name: xml.Name{Local: "w:numStart"}} + e.EncodeElement(m.NumStart, senumStart) + } + if m.NumRestart != nil { + senumRestart := xml.StartElement{Name: xml.Name{Local: "w:numRestart"}} + e.EncodeElement(m.NumRestart, senumRestart) + } + if m.Footnote != nil { + sefootnote := xml.StartElement{Name: xml.Name{Local: "w:footnote"}} + for _, c := range m.Footnote { + e.EncodeElement(c, sefootnote) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_FtnDocProps) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_FtnDocProps: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pos"}: + m.Pos = NewCT_FtnPos() + if err := d.DecodeElement(m.Pos, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "numFmt"}: + m.NumFmt = NewCT_NumFmt() + if err := d.DecodeElement(m.NumFmt, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "numStart"}: + m.NumStart = NewCT_DecimalNumber() + if err := d.DecodeElement(m.NumStart, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "numRestart"}: + m.NumRestart = NewCT_NumRestart() + if err := d.DecodeElement(m.NumRestart, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "footnote"}: + tmp := NewCT_FtnEdnSepRef() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Footnote = append(m.Footnote, tmp) + default: + gooxml.Log("skipping unsupported element on CT_FtnDocProps %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_FtnDocProps + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_FtnDocProps and its children +func (m *CT_FtnDocProps) Validate() error { + return m.ValidateWithPath("CT_FtnDocProps") +} + +// ValidateWithPath validates the CT_FtnDocProps and its children, prefixing error messages with path +func (m *CT_FtnDocProps) ValidateWithPath(path string) error { + if m.Pos != nil { + if err := m.Pos.ValidateWithPath(path + "/Pos"); err != nil { + return err + } + } + if m.NumFmt != nil { + if err := m.NumFmt.ValidateWithPath(path + "/NumFmt"); err != nil { + return err + } + } + if m.NumStart != nil { + if err := m.NumStart.ValidateWithPath(path + "/NumStart"); err != nil { + return err + } + } + if m.NumRestart != nil { + if err := m.NumRestart.ValidateWithPath(path + "/NumRestart"); err != nil { + return err + } + } + for i, v := range m.Footnote { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Footnote[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FtnEdn.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FtnEdn.go new file mode 100644 index 00000000..8de7a025 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FtnEdn.go @@ -0,0 +1,464 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/math" +) + +type CT_FtnEdn struct { + // Footnote/Endnote Type + TypeAttr ST_FtnEdn + // Footnote/Endnote ID + IdAttr int64 + EG_BlockLevelElts []*EG_BlockLevelElts +} + +func NewCT_FtnEdn() *CT_FtnEdn { + ret := &CT_FtnEdn{} + return ret +} + +func (m *CT_FtnEdn) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.TypeAttr != ST_FtnEdnUnset { + attr, err := m.TypeAttr.MarshalXMLAttr(xml.Name{Local: "w:type"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:id"}, + Value: fmt.Sprintf("%v", m.IdAttr)}) + e.EncodeToken(start) + for _, c := range m.EG_BlockLevelElts { + c.MarshalXML(e, xml.StartElement{}) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_FtnEdn) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "type" { + m.TypeAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "id" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.IdAttr = parsed + continue + } + } +lCT_FtnEdn: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "altChunk"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmp := NewCT_AltChunk() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + tmpblocklevelelts.AltChunk = append(tmpblocklevelelts.AltChunk, tmp) + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXml"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmpcontentblockcontent.CustomXml = NewCT_CustomXmlBlock() + if err := d.DecodeElement(tmpcontentblockcontent.CustomXml, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdt"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmpcontentblockcontent.Sdt = NewCT_SdtBlock() + if err := d.DecodeElement(tmpcontentblockcontent.Sdt, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "p"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmp := NewCT_P() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + tmpcontentblockcontent.P = append(tmpcontentblockcontent.P, tmp) + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tbl"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmp := NewCT_Tbl() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + tmpcontentblockcontent.Tbl = append(tmpcontentblockcontent.Tbl, tmp) + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "proofErr"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.ProofErr = NewCT_ProofErr() + if err := d.DecodeElement(tmprunlevelelts.ProofErr, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permStart"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermStart = NewCT_PermStart() + if err := d.DecodeElement(tmprunlevelelts.PermStart, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permEnd"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermEnd = NewCT_Perm() + if err := d.DecodeElement(tmprunlevelelts.PermEnd, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Ins = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Ins, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Del = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Del, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFrom"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveFrom = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveFrom, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveTo"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveTo = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveTo, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkStart"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkStart = NewCT_Bookmark() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkStart, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkEnd"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkEnd, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeStart"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeStart, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeEnd"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeStart"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeStart, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeEnd"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeEnd, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeStart"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeStart = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeStart, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeEnd"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeEnd, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeStart"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeStart, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeEnd"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeEnd, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeStart"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeStart, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeEnd"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeEnd, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeStart"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeStart, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeEnd"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeStart"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeStart, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeEnd"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeEnd, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMathPara"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMathPara = math.NewOMathPara() + if err := d.DecodeElement(tmpmathcontent.OMathPara, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMath"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMath = math.NewOMath() + if err := d.DecodeElement(tmpmathcontent.OMath, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + default: + gooxml.Log("skipping unsupported element on CT_FtnEdn %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_FtnEdn + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_FtnEdn and its children +func (m *CT_FtnEdn) Validate() error { + return m.ValidateWithPath("CT_FtnEdn") +} + +// ValidateWithPath validates the CT_FtnEdn and its children, prefixing error messages with path +func (m *CT_FtnEdn) ValidateWithPath(path string) error { + if err := m.TypeAttr.ValidateWithPath(path + "/TypeAttr"); err != nil { + return err + } + for i, v := range m.EG_BlockLevelElts { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_BlockLevelElts[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FtnEdnRef.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FtnEdnRef.go new file mode 100644 index 00000000..224a7b8f --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FtnEdnRef.go @@ -0,0 +1,90 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_FtnEdnRef struct { + // Suppress Footnote/Endnote Reference Mark + CustomMarkFollowsAttr *sharedTypes.ST_OnOff + // Footnote/Endnote ID Reference + IdAttr int64 +} + +func NewCT_FtnEdnRef() *CT_FtnEdnRef { + ret := &CT_FtnEdnRef{} + return ret +} + +func (m *CT_FtnEdnRef) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.CustomMarkFollowsAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:customMarkFollows"}, + Value: fmt.Sprintf("%v", *m.CustomMarkFollowsAttr)}) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:id"}, + Value: fmt.Sprintf("%v", m.IdAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_FtnEdnRef) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "customMarkFollows" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.CustomMarkFollowsAttr = &parsed + continue + } + if attr.Name.Local == "id" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.IdAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_FtnEdnRef: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_FtnEdnRef and its children +func (m *CT_FtnEdnRef) Validate() error { + return m.ValidateWithPath("CT_FtnEdnRef") +} + +// ValidateWithPath validates the CT_FtnEdnRef and its children, prefixing error messages with path +func (m *CT_FtnEdnRef) ValidateWithPath(path string) error { + if m.CustomMarkFollowsAttr != nil { + if err := m.CustomMarkFollowsAttr.ValidateWithPath(path + "/CustomMarkFollowsAttr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FtnEdnSepRef.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FtnEdnSepRef.go new file mode 100644 index 00000000..072a317c --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FtnEdnSepRef.go @@ -0,0 +1,69 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" +) + +type CT_FtnEdnSepRef struct { + // Footnote/Endnote ID + IdAttr int64 +} + +func NewCT_FtnEdnSepRef() *CT_FtnEdnSepRef { + ret := &CT_FtnEdnSepRef{} + return ret +} + +func (m *CT_FtnEdnSepRef) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:id"}, + Value: fmt.Sprintf("%v", m.IdAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_FtnEdnSepRef) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "id" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.IdAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_FtnEdnSepRef: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_FtnEdnSepRef and its children +func (m *CT_FtnEdnSepRef) Validate() error { + return m.ValidateWithPath("CT_FtnEdnSepRef") +} + +// ValidateWithPath validates the CT_FtnEdnSepRef and its children, prefixing error messages with path +func (m *CT_FtnEdnSepRef) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FtnPos.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FtnPos.go new file mode 100644 index 00000000..19ad8486 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FtnPos.go @@ -0,0 +1,75 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_FtnPos struct { + // Footnote Position Type + ValAttr ST_FtnPos +} + +func NewCT_FtnPos() *CT_FtnPos { + ret := &CT_FtnPos{} + ret.ValAttr = ST_FtnPos(1) + return ret +} + +func (m *CT_FtnPos) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_FtnPos) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_FtnPos(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_FtnPos: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_FtnPos and its children +func (m *CT_FtnPos) Validate() error { + return m.ValidateWithPath("CT_FtnPos") +} + +// ValidateWithPath validates the CT_FtnPos and its children, prefixing error messages with path +func (m *CT_FtnPos) ValidateWithPath(path string) error { + if m.ValAttr == ST_FtnPosUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FtnProps.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FtnProps.go new file mode 100644 index 00000000..a7dd7bb4 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_FtnProps.go @@ -0,0 +1,129 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_FtnProps struct { + // Footnote Placement + Pos *CT_FtnPos + // Footnote Numbering Format + NumFmt *CT_NumFmt + // Footnote and Endnote Numbering Starting Value + NumStart *CT_DecimalNumber + // Footnote and Endnote Numbering Restart Location + NumRestart *CT_NumRestart +} + +func NewCT_FtnProps() *CT_FtnProps { + ret := &CT_FtnProps{} + return ret +} + +func (m *CT_FtnProps) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Pos != nil { + sepos := xml.StartElement{Name: xml.Name{Local: "w:pos"}} + e.EncodeElement(m.Pos, sepos) + } + if m.NumFmt != nil { + senumFmt := xml.StartElement{Name: xml.Name{Local: "w:numFmt"}} + e.EncodeElement(m.NumFmt, senumFmt) + } + if m.NumStart != nil { + senumStart := xml.StartElement{Name: xml.Name{Local: "w:numStart"}} + e.EncodeElement(m.NumStart, senumStart) + } + if m.NumRestart != nil { + senumRestart := xml.StartElement{Name: xml.Name{Local: "w:numRestart"}} + e.EncodeElement(m.NumRestart, senumRestart) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_FtnProps) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_FtnProps: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pos"}: + m.Pos = NewCT_FtnPos() + if err := d.DecodeElement(m.Pos, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "numFmt"}: + m.NumFmt = NewCT_NumFmt() + if err := d.DecodeElement(m.NumFmt, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "numStart"}: + m.NumStart = NewCT_DecimalNumber() + if err := d.DecodeElement(m.NumStart, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "numRestart"}: + m.NumRestart = NewCT_NumRestart() + if err := d.DecodeElement(m.NumRestart, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_FtnProps %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_FtnProps + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_FtnProps and its children +func (m *CT_FtnProps) Validate() error { + return m.ValidateWithPath("CT_FtnProps") +} + +// ValidateWithPath validates the CT_FtnProps and its children, prefixing error messages with path +func (m *CT_FtnProps) ValidateWithPath(path string) error { + if m.Pos != nil { + if err := m.Pos.ValidateWithPath(path + "/Pos"); err != nil { + return err + } + } + if m.NumFmt != nil { + if err := m.NumFmt.ValidateWithPath(path + "/NumFmt"); err != nil { + return err + } + } + if m.NumStart != nil { + if err := m.NumStart.ValidateWithPath(path + "/NumStart"); err != nil { + return err + } + } + if m.NumRestart != nil { + if err := m.NumRestart.ValidateWithPath(path + "/NumRestart"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_GlossaryDocument.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_GlossaryDocument.go new file mode 100644 index 00000000..f2d76213 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_GlossaryDocument.go @@ -0,0 +1,96 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_GlossaryDocument struct { + // Document Background + Background *CT_Background + DocParts *CT_DocParts +} + +func NewCT_GlossaryDocument() *CT_GlossaryDocument { + ret := &CT_GlossaryDocument{} + return ret +} + +func (m *CT_GlossaryDocument) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Background != nil { + sebackground := xml.StartElement{Name: xml.Name{Local: "w:background"}} + e.EncodeElement(m.Background, sebackground) + } + if m.DocParts != nil { + sedocParts := xml.StartElement{Name: xml.Name{Local: "w:docParts"}} + e.EncodeElement(m.DocParts, sedocParts) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_GlossaryDocument) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_GlossaryDocument: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "background"}: + m.Background = NewCT_Background() + if err := d.DecodeElement(m.Background, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "docParts"}: + m.DocParts = NewCT_DocParts() + if err := d.DecodeElement(m.DocParts, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_GlossaryDocument %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_GlossaryDocument + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_GlossaryDocument and its children +func (m *CT_GlossaryDocument) Validate() error { + return m.ValidateWithPath("CT_GlossaryDocument") +} + +// ValidateWithPath validates the CT_GlossaryDocument and its children, prefixing error messages with path +func (m *CT_GlossaryDocument) ValidateWithPath(path string) error { + if m.Background != nil { + if err := m.Background.ValidateWithPath(path + "/Background"); err != nil { + return err + } + } + if m.DocParts != nil { + if err := m.DocParts.ValidateWithPath(path + "/DocParts"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Guid.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Guid.go new file mode 100644 index 00000000..b97d6c59 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Guid.go @@ -0,0 +1,77 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_Guid struct { + // GUID Value + ValAttr *string +} + +func NewCT_Guid() *CT_Guid { + ret := &CT_Guid{} + return ret +} + +func (m *CT_Guid) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.ValAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:val"}, + Value: fmt.Sprintf("%v", *m.ValAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Guid) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ValAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Guid: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Guid and its children +func (m *CT_Guid) Validate() error { + return m.ValidateWithPath("CT_Guid") +} + +// ValidateWithPath validates the CT_Guid and its children, prefixing error messages with path +func (m *CT_Guid) ValidateWithPath(path string) error { + if m.ValAttr != nil { + if !sharedTypes.ST_GuidPatternRe.MatchString(*m.ValAttr) { + return fmt.Errorf(`%s/m.ValAttr must match '%s' (have %v)`, path, sharedTypes.ST_GuidPatternRe, *m.ValAttr) + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_HMerge.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_HMerge.go new file mode 100644 index 00000000..078a8585 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_HMerge.go @@ -0,0 +1,72 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_HMerge struct { + // Horizontal Merge Type + ValAttr ST_Merge +} + +func NewCT_HMerge() *CT_HMerge { + ret := &CT_HMerge{} + return ret +} + +func (m *CT_HMerge) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.ValAttr != ST_MergeUnset { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_HMerge) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_HMerge: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_HMerge and its children +func (m *CT_HMerge) Validate() error { + return m.ValidateWithPath("CT_HMerge") +} + +// ValidateWithPath validates the CT_HMerge and its children, prefixing error messages with path +func (m *CT_HMerge) ValidateWithPath(path string) error { + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_HdrFtr.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_HdrFtr.go new file mode 100644 index 00000000..e92ea17e --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_HdrFtr.go @@ -0,0 +1,388 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/math" +) + +type CT_HdrFtr struct { + // Anchor for Imported External Content + AltChunk []*CT_AltChunk + EG_ContentBlockContent []*EG_ContentBlockContent +} + +func NewCT_HdrFtr() *CT_HdrFtr { + ret := &CT_HdrFtr{} + return ret +} + +func (m *CT_HdrFtr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.AltChunk != nil { + sealtChunk := xml.StartElement{Name: xml.Name{Local: "w:altChunk"}} + for _, c := range m.AltChunk { + e.EncodeElement(c, sealtChunk) + } + } + if m.EG_ContentBlockContent != nil { + for _, c := range m.EG_ContentBlockContent { + c.MarshalXML(e, xml.StartElement{}) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_HdrFtr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_HdrFtr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "altChunk"}: + tmp := NewCT_AltChunk() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.AltChunk = append(m.AltChunk, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXml"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmpcontentblockcontent.CustomXml = NewCT_CustomXmlBlock() + if err := d.DecodeElement(tmpcontentblockcontent.CustomXml, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdt"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmpcontentblockcontent.Sdt = NewCT_SdtBlock() + if err := d.DecodeElement(tmpcontentblockcontent.Sdt, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "p"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmp := NewCT_P() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + tmpcontentblockcontent.P = append(tmpcontentblockcontent.P, tmp) + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tbl"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmp := NewCT_Tbl() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + tmpcontentblockcontent.Tbl = append(tmpcontentblockcontent.Tbl, tmp) + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "proofErr"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.ProofErr = NewCT_ProofErr() + if err := d.DecodeElement(tmprunlevelelts.ProofErr, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermStart = NewCT_PermStart() + if err := d.DecodeElement(tmprunlevelelts.PermStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermEnd = NewCT_Perm() + if err := d.DecodeElement(tmprunlevelelts.PermEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Ins = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Ins, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Del = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Del, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFrom"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveFrom = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveFrom, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveTo"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveTo = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveTo, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkStart = NewCT_Bookmark() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeStart = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMathPara"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMathPara = math.NewOMathPara() + if err := d.DecodeElement(tmpmathcontent.OMathPara, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMath"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMath = math.NewOMath() + if err := d.DecodeElement(tmpmathcontent.OMath, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + default: + gooxml.Log("skipping unsupported element on CT_HdrFtr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_HdrFtr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_HdrFtr and its children +func (m *CT_HdrFtr) Validate() error { + return m.ValidateWithPath("CT_HdrFtr") +} + +// ValidateWithPath validates the CT_HdrFtr and its children, prefixing error messages with path +func (m *CT_HdrFtr) ValidateWithPath(path string) error { + for i, v := range m.AltChunk { + if err := v.ValidateWithPath(fmt.Sprintf("%s/AltChunk[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.EG_ContentBlockContent { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_ContentBlockContent[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_HdrFtrRef.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_HdrFtrRef.go new file mode 100644 index 00000000..5e1648cd --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_HdrFtrRef.go @@ -0,0 +1,85 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_HdrFtrRef struct { + TypeAttr ST_HdrFtr + IdAttr string +} + +func NewCT_HdrFtrRef() *CT_HdrFtrRef { + ret := &CT_HdrFtrRef{} + ret.TypeAttr = ST_HdrFtr(1) + return ret +} + +func (m *CT_HdrFtrRef) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.TypeAttr.MarshalXMLAttr(xml.Name{Local: "w:type"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "r:id"}, + Value: fmt.Sprintf("%v", m.IdAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_HdrFtrRef) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.TypeAttr = ST_HdrFtr(1) + for _, attr := range start.Attr { + if attr.Name.Space == "http://schemas.openxmlformats.org/officeDocument/2006/relationships" && attr.Name.Local == "id" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.IdAttr = parsed + continue + } + if attr.Name.Local == "type" { + m.TypeAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_HdrFtrRef: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_HdrFtrRef and its children +func (m *CT_HdrFtrRef) Validate() error { + return m.ValidateWithPath("CT_HdrFtrRef") +} + +// ValidateWithPath validates the CT_HdrFtrRef and its children, prefixing error messages with path +func (m *CT_HdrFtrRef) ValidateWithPath(path string) error { + if m.TypeAttr == ST_HdrFtrUnset { + return fmt.Errorf("%s/TypeAttr is a mandatory field", path) + } + if err := m.TypeAttr.ValidateWithPath(path + "/TypeAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Headers.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Headers.go new file mode 100644 index 00000000..d12a43d8 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Headers.go @@ -0,0 +1,83 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_Headers struct { + // Header Cell Reference + Header []*CT_String +} + +func NewCT_Headers() *CT_Headers { + ret := &CT_Headers{} + return ret +} + +func (m *CT_Headers) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + seheader := xml.StartElement{Name: xml.Name{Local: "w:header"}} + for _, c := range m.Header { + e.EncodeElement(c, seheader) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Headers) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_Headers: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "header"}: + tmp := NewCT_String() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Header = append(m.Header, tmp) + default: + gooxml.Log("skipping unsupported element on CT_Headers %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Headers + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Headers and its children +func (m *CT_Headers) Validate() error { + return m.ValidateWithPath("CT_Headers") +} + +// ValidateWithPath validates the CT_Headers and its children, prefixing error messages with path +func (m *CT_Headers) ValidateWithPath(path string) error { + for i, v := range m.Header { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Header[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Height.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Height.go new file mode 100644 index 00000000..1975043f --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Height.go @@ -0,0 +1,93 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_Height struct { + // Table Row Height + ValAttr *sharedTypes.ST_TwipsMeasure + // Table Row Height Type + HRuleAttr ST_HeightRule +} + +func NewCT_Height() *CT_Height { + ret := &CT_Height{} + return ret +} + +func (m *CT_Height) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.ValAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:val"}, + Value: fmt.Sprintf("%v", *m.ValAttr)}) + } + if m.HRuleAttr != ST_HeightRuleUnset { + attr, err := m.HRuleAttr.MarshalXMLAttr(xml.Name{Local: "w:hRule"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Height) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := ParseUnionST_TwipsMeasure(attr.Value) + if err != nil { + return err + } + m.ValAttr = &parsed + continue + } + if attr.Name.Local == "hRule" { + m.HRuleAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Height: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Height and its children +func (m *CT_Height) Validate() error { + return m.ValidateWithPath("CT_Height") +} + +// ValidateWithPath validates the CT_Height and its children, prefixing error messages with path +func (m *CT_Height) ValidateWithPath(path string) error { + if m.ValAttr != nil { + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + } + if err := m.HRuleAttr.ValidateWithPath(path + "/HRuleAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Highlight.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Highlight.go new file mode 100644 index 00000000..478ffa9b --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Highlight.go @@ -0,0 +1,75 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_Highlight struct { + // Highlighting Color + ValAttr ST_HighlightColor +} + +func NewCT_Highlight() *CT_Highlight { + ret := &CT_Highlight{} + ret.ValAttr = ST_HighlightColor(1) + return ret +} + +func (m *CT_Highlight) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Highlight) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_HighlightColor(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Highlight: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Highlight and its children +func (m *CT_Highlight) Validate() error { + return m.ValidateWithPath("CT_Highlight") +} + +// ValidateWithPath validates the CT_Highlight and its children, prefixing error messages with path +func (m *CT_Highlight) ValidateWithPath(path string) error { + if m.ValAttr == ST_HighlightColorUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_HpsMeasure.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_HpsMeasure.go new file mode 100644 index 00000000..135f1805 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_HpsMeasure.go @@ -0,0 +1,71 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_HpsMeasure struct { + // Half Point Measurement + ValAttr ST_HpsMeasure +} + +func NewCT_HpsMeasure() *CT_HpsMeasure { + ret := &CT_HpsMeasure{} + return ret +} + +func (m *CT_HpsMeasure) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:val"}, + Value: fmt.Sprintf("%v", m.ValAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_HpsMeasure) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := ParseUnionST_HpsMeasure(attr.Value) + if err != nil { + return err + } + m.ValAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_HpsMeasure: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_HpsMeasure and its children +func (m *CT_HpsMeasure) Validate() error { + return m.ValidateWithPath("CT_HpsMeasure") +} + +// ValidateWithPath validates the CT_HpsMeasure and its children, prefixing error messages with path +func (m *CT_HpsMeasure) ValidateWithPath(path string) error { + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Hyperlink.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Hyperlink.go new file mode 100644 index 00000000..14ea199a --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Hyperlink.go @@ -0,0 +1,523 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/math" + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_Hyperlink struct { + // Hyperlink Target Frame + TgtFrameAttr *string + // Associated String + TooltipAttr *string + // Location in Target Document + DocLocationAttr *string + // Add To Viewed Hyperlinks + HistoryAttr *sharedTypes.ST_OnOff + // Hyperlink Anchor + AnchorAttr *string + IdAttr *string + // Simple Field + FldSimple []*CT_SimpleField + // Hyperlink + Hyperlink *CT_Hyperlink + // Anchor for Subdocument Location + SubDoc *CT_Rel + EG_ContentRunContent []*EG_ContentRunContent +} + +func NewCT_Hyperlink() *CT_Hyperlink { + ret := &CT_Hyperlink{} + return ret +} + +func (m *CT_Hyperlink) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.TgtFrameAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:tgtFrame"}, + Value: fmt.Sprintf("%v", *m.TgtFrameAttr)}) + } + if m.TooltipAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:tooltip"}, + Value: fmt.Sprintf("%v", *m.TooltipAttr)}) + } + if m.DocLocationAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:docLocation"}, + Value: fmt.Sprintf("%v", *m.DocLocationAttr)}) + } + if m.HistoryAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:history"}, + Value: fmt.Sprintf("%v", *m.HistoryAttr)}) + } + if m.AnchorAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:anchor"}, + Value: fmt.Sprintf("%v", *m.AnchorAttr)}) + } + if m.IdAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "r:id"}, + Value: fmt.Sprintf("%v", *m.IdAttr)}) + } + e.EncodeToken(start) + if m.FldSimple != nil { + sefldSimple := xml.StartElement{Name: xml.Name{Local: "w:fldSimple"}} + for _, c := range m.FldSimple { + e.EncodeElement(c, sefldSimple) + } + } + if m.Hyperlink != nil { + sehyperlink := xml.StartElement{Name: xml.Name{Local: "w:hyperlink"}} + e.EncodeElement(m.Hyperlink, sehyperlink) + } + if m.SubDoc != nil { + sesubDoc := xml.StartElement{Name: xml.Name{Local: "w:subDoc"}} + e.EncodeElement(m.SubDoc, sesubDoc) + } + if m.EG_ContentRunContent != nil { + for _, c := range m.EG_ContentRunContent { + c.MarshalXML(e, xml.StartElement{}) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Hyperlink) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Space == "http://schemas.openxmlformats.org/officeDocument/2006/relationships" && attr.Name.Local == "id" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.IdAttr = &parsed + continue + } + if attr.Name.Local == "tgtFrame" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.TgtFrameAttr = &parsed + continue + } + if attr.Name.Local == "tooltip" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.TooltipAttr = &parsed + continue + } + if attr.Name.Local == "docLocation" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.DocLocationAttr = &parsed + continue + } + if attr.Name.Local == "anchor" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.AnchorAttr = &parsed + continue + } + if attr.Name.Local == "history" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.HistoryAttr = &parsed + continue + } + } +lCT_Hyperlink: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "fldSimple"}: + tmp := NewCT_SimpleField() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.FldSimple = append(m.FldSimple, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "hyperlink"}: + m.Hyperlink = NewCT_Hyperlink() + if err := d.DecodeElement(m.Hyperlink, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "subDoc"}: + m.SubDoc = NewCT_Rel() + if err := d.DecodeElement(m.SubDoc, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXml"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.CustomXml = NewCT_CustomXmlRun() + if err := d.DecodeElement(tmpcontentruncontent.CustomXml, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "smartTag"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.SmartTag = NewCT_SmartTagRun() + if err := d.DecodeElement(tmpcontentruncontent.SmartTag, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdt"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.Sdt = NewCT_SdtRun() + if err := d.DecodeElement(tmpcontentruncontent.Sdt, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "dir"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.Dir = NewCT_DirContentRun() + if err := d.DecodeElement(tmpcontentruncontent.Dir, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bdo"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.Bdo = NewCT_BdoContentRun() + if err := d.DecodeElement(tmpcontentruncontent.Bdo, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "r"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.R = NewCT_R() + if err := d.DecodeElement(tmpcontentruncontent.R, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "proofErr"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.ProofErr = NewCT_ProofErr() + if err := d.DecodeElement(tmprunlevelelts.ProofErr, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermStart = NewCT_PermStart() + if err := d.DecodeElement(tmprunlevelelts.PermStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermEnd = NewCT_Perm() + if err := d.DecodeElement(tmprunlevelelts.PermEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Ins = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Ins, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Del = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Del, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFrom"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveFrom = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveFrom, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveTo"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveTo = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveTo, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkStart = NewCT_Bookmark() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeStart = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMathPara"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMathPara = math.NewOMathPara() + if err := d.DecodeElement(tmpmathcontent.OMathPara, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMath"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMath = math.NewOMath() + if err := d.DecodeElement(tmpmathcontent.OMath, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + default: + gooxml.Log("skipping unsupported element on CT_Hyperlink %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Hyperlink + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Hyperlink and its children +func (m *CT_Hyperlink) Validate() error { + return m.ValidateWithPath("CT_Hyperlink") +} + +// ValidateWithPath validates the CT_Hyperlink and its children, prefixing error messages with path +func (m *CT_Hyperlink) ValidateWithPath(path string) error { + if m.HistoryAttr != nil { + if err := m.HistoryAttr.ValidateWithPath(path + "/HistoryAttr"); err != nil { + return err + } + } + for i, v := range m.FldSimple { + if err := v.ValidateWithPath(fmt.Sprintf("%s/FldSimple[%d]", path, i)); err != nil { + return err + } + } + if m.Hyperlink != nil { + if err := m.Hyperlink.ValidateWithPath(path + "/Hyperlink"); err != nil { + return err + } + } + if m.SubDoc != nil { + if err := m.SubDoc.ValidateWithPath(path + "/SubDoc"); err != nil { + return err + } + } + for i, v := range m.EG_ContentRunContent { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_ContentRunContent[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Ind.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Ind.go new file mode 100644 index 00000000..ed09d2d4 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Ind.go @@ -0,0 +1,257 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_Ind struct { + // Start Indentation + StartAttr *ST_SignedTwipsMeasure + // Start Indentation in Character Units + StartCharsAttr *int64 + // End Indentation + EndAttr *ST_SignedTwipsMeasure + // End Indentation in Character Units + EndCharsAttr *int64 + // Start Indentation + LeftAttr *ST_SignedTwipsMeasure + // Start Indentation in Character Units + LeftCharsAttr *int64 + // End Indentation + RightAttr *ST_SignedTwipsMeasure + // End Indentation in Character Units + RightCharsAttr *int64 + // Indentation Removed from First Line + HangingAttr *sharedTypes.ST_TwipsMeasure + // Indentation Removed From First Line in Character Units + HangingCharsAttr *int64 + // Additional First Line Indentation + FirstLineAttr *sharedTypes.ST_TwipsMeasure + // Additional First Line Indentation in Character Units + FirstLineCharsAttr *int64 +} + +func NewCT_Ind() *CT_Ind { + ret := &CT_Ind{} + return ret +} + +func (m *CT_Ind) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.StartAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:start"}, + Value: fmt.Sprintf("%v", *m.StartAttr)}) + } + if m.StartCharsAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:startChars"}, + Value: fmt.Sprintf("%v", *m.StartCharsAttr)}) + } + if m.EndAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:end"}, + Value: fmt.Sprintf("%v", *m.EndAttr)}) + } + if m.EndCharsAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:endChars"}, + Value: fmt.Sprintf("%v", *m.EndCharsAttr)}) + } + if m.LeftAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:left"}, + Value: fmt.Sprintf("%v", *m.LeftAttr)}) + } + if m.LeftCharsAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:leftChars"}, + Value: fmt.Sprintf("%v", *m.LeftCharsAttr)}) + } + if m.RightAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:right"}, + Value: fmt.Sprintf("%v", *m.RightAttr)}) + } + if m.RightCharsAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:rightChars"}, + Value: fmt.Sprintf("%v", *m.RightCharsAttr)}) + } + if m.HangingAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:hanging"}, + Value: fmt.Sprintf("%v", *m.HangingAttr)}) + } + if m.HangingCharsAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:hangingChars"}, + Value: fmt.Sprintf("%v", *m.HangingCharsAttr)}) + } + if m.FirstLineAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:firstLine"}, + Value: fmt.Sprintf("%v", *m.FirstLineAttr)}) + } + if m.FirstLineCharsAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:firstLineChars"}, + Value: fmt.Sprintf("%v", *m.FirstLineCharsAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Ind) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "start" { + parsed, err := ParseUnionST_SignedTwipsMeasure(attr.Value) + if err != nil { + return err + } + m.StartAttr = &parsed + continue + } + if attr.Name.Local == "startChars" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.StartCharsAttr = &parsed + continue + } + if attr.Name.Local == "end" { + parsed, err := ParseUnionST_SignedTwipsMeasure(attr.Value) + if err != nil { + return err + } + m.EndAttr = &parsed + continue + } + if attr.Name.Local == "endChars" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.EndCharsAttr = &parsed + continue + } + if attr.Name.Local == "left" { + parsed, err := ParseUnionST_SignedTwipsMeasure(attr.Value) + if err != nil { + return err + } + m.LeftAttr = &parsed + continue + } + if attr.Name.Local == "leftChars" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.LeftCharsAttr = &parsed + continue + } + if attr.Name.Local == "right" { + parsed, err := ParseUnionST_SignedTwipsMeasure(attr.Value) + if err != nil { + return err + } + m.RightAttr = &parsed + continue + } + if attr.Name.Local == "rightChars" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.RightCharsAttr = &parsed + continue + } + if attr.Name.Local == "hanging" { + parsed, err := ParseUnionST_TwipsMeasure(attr.Value) + if err != nil { + return err + } + m.HangingAttr = &parsed + continue + } + if attr.Name.Local == "hangingChars" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.HangingCharsAttr = &parsed + continue + } + if attr.Name.Local == "firstLine" { + parsed, err := ParseUnionST_TwipsMeasure(attr.Value) + if err != nil { + return err + } + m.FirstLineAttr = &parsed + continue + } + if attr.Name.Local == "firstLineChars" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.FirstLineCharsAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Ind: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Ind and its children +func (m *CT_Ind) Validate() error { + return m.ValidateWithPath("CT_Ind") +} + +// ValidateWithPath validates the CT_Ind and its children, prefixing error messages with path +func (m *CT_Ind) ValidateWithPath(path string) error { + if m.StartAttr != nil { + if err := m.StartAttr.ValidateWithPath(path + "/StartAttr"); err != nil { + return err + } + } + if m.EndAttr != nil { + if err := m.EndAttr.ValidateWithPath(path + "/EndAttr"); err != nil { + return err + } + } + if m.LeftAttr != nil { + if err := m.LeftAttr.ValidateWithPath(path + "/LeftAttr"); err != nil { + return err + } + } + if m.RightAttr != nil { + if err := m.RightAttr.ValidateWithPath(path + "/RightAttr"); err != nil { + return err + } + } + if m.HangingAttr != nil { + if err := m.HangingAttr.ValidateWithPath(path + "/HangingAttr"); err != nil { + return err + } + } + if m.FirstLineAttr != nil { + if err := m.FirstLineAttr.ValidateWithPath(path + "/FirstLineAttr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Jc.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Jc.go new file mode 100644 index 00000000..8ce234ac --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Jc.go @@ -0,0 +1,75 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_Jc struct { + // Alignment Type + ValAttr ST_Jc +} + +func NewCT_Jc() *CT_Jc { + ret := &CT_Jc{} + ret.ValAttr = ST_Jc(1) + return ret +} + +func (m *CT_Jc) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Jc) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_Jc(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Jc: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Jc and its children +func (m *CT_Jc) Validate() error { + return m.ValidateWithPath("CT_Jc") +} + +// ValidateWithPath validates the CT_Jc and its children, prefixing error messages with path +func (m *CT_Jc) ValidateWithPath(path string) error { + if m.ValAttr == ST_JcUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_JcTable.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_JcTable.go new file mode 100644 index 00000000..8c543bb5 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_JcTable.go @@ -0,0 +1,75 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_JcTable struct { + // Alignment Type + ValAttr ST_JcTable +} + +func NewCT_JcTable() *CT_JcTable { + ret := &CT_JcTable{} + ret.ValAttr = ST_JcTable(1) + return ret +} + +func (m *CT_JcTable) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_JcTable) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_JcTable(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_JcTable: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_JcTable and its children +func (m *CT_JcTable) Validate() error { + return m.ValidateWithPath("CT_JcTable") +} + +// ValidateWithPath validates the CT_JcTable and its children, prefixing error messages with path +func (m *CT_JcTable) ValidateWithPath(path string) error { + if m.ValAttr == ST_JcTableUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Kinsoku.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Kinsoku.go new file mode 100644 index 00000000..54dbc139 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Kinsoku.go @@ -0,0 +1,80 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_Kinsoku struct { + // Language For Which Custom Line Breaking Rule Applies + LangAttr string + // Characters For Custom Line Breaking Rule + ValAttr string +} + +func NewCT_Kinsoku() *CT_Kinsoku { + ret := &CT_Kinsoku{} + return ret +} + +func (m *CT_Kinsoku) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:lang"}, + Value: fmt.Sprintf("%v", m.LangAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:val"}, + Value: fmt.Sprintf("%v", m.ValAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Kinsoku) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "lang" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.LangAttr = parsed + continue + } + if attr.Name.Local == "val" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ValAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Kinsoku: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Kinsoku and its children +func (m *CT_Kinsoku) Validate() error { + return m.ValidateWithPath("CT_Kinsoku") +} + +// ValidateWithPath validates the CT_Kinsoku and its children, prefixing error messages with path +func (m *CT_Kinsoku) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Lang.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Lang.go new file mode 100644 index 00000000..f95b64fd --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Lang.go @@ -0,0 +1,68 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_Lang struct { + // Language Code + ValAttr string +} + +func NewCT_Lang() *CT_Lang { + ret := &CT_Lang{} + return ret +} + +func (m *CT_Lang) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:val"}, + Value: fmt.Sprintf("%v", m.ValAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Lang) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ValAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Lang: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Lang and its children +func (m *CT_Lang) Validate() error { + return m.ValidateWithPath("CT_Lang") +} + +// ValidateWithPath validates the CT_Lang and its children, prefixing error messages with path +func (m *CT_Lang) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Language.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Language.go new file mode 100644 index 00000000..310742e5 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Language.go @@ -0,0 +1,98 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_Language struct { + // Latin Language + ValAttr *string + // East Asian Language + EastAsiaAttr *string + // Complex Script Language + BidiAttr *string +} + +func NewCT_Language() *CT_Language { + ret := &CT_Language{} + return ret +} + +func (m *CT_Language) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.ValAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:val"}, + Value: fmt.Sprintf("%v", *m.ValAttr)}) + } + if m.EastAsiaAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:eastAsia"}, + Value: fmt.Sprintf("%v", *m.EastAsiaAttr)}) + } + if m.BidiAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:bidi"}, + Value: fmt.Sprintf("%v", *m.BidiAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Language) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ValAttr = &parsed + continue + } + if attr.Name.Local == "eastAsia" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.EastAsiaAttr = &parsed + continue + } + if attr.Name.Local == "bidi" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.BidiAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Language: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Language and its children +func (m *CT_Language) Validate() error { + return m.ValidateWithPath("CT_Language") +} + +// ValidateWithPath validates the CT_Language and its children, prefixing error messages with path +func (m *CT_Language) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_LatentStyles.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_LatentStyles.go new file mode 100644 index 00000000..686c7971 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_LatentStyles.go @@ -0,0 +1,193 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_LatentStyles struct { + // Default Style Locking Setting + DefLockedStateAttr *sharedTypes.ST_OnOff + // Default User Interface Priority Setting + DefUIPriorityAttr *int64 + // Default Semi-Hidden Setting + DefSemiHiddenAttr *sharedTypes.ST_OnOff + // Default Hidden Until Used Setting + DefUnhideWhenUsedAttr *sharedTypes.ST_OnOff + // Default Primary Style Setting + DefQFormatAttr *sharedTypes.ST_OnOff + // Latent Style Count + CountAttr *int64 + // Latent Style Exception + LsdException []*CT_LsdException +} + +func NewCT_LatentStyles() *CT_LatentStyles { + ret := &CT_LatentStyles{} + return ret +} + +func (m *CT_LatentStyles) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.DefLockedStateAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:defLockedState"}, + Value: fmt.Sprintf("%v", *m.DefLockedStateAttr)}) + } + if m.DefUIPriorityAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:defUIPriority"}, + Value: fmt.Sprintf("%v", *m.DefUIPriorityAttr)}) + } + if m.DefSemiHiddenAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:defSemiHidden"}, + Value: fmt.Sprintf("%v", *m.DefSemiHiddenAttr)}) + } + if m.DefUnhideWhenUsedAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:defUnhideWhenUsed"}, + Value: fmt.Sprintf("%v", *m.DefUnhideWhenUsedAttr)}) + } + if m.DefQFormatAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:defQFormat"}, + Value: fmt.Sprintf("%v", *m.DefQFormatAttr)}) + } + if m.CountAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:count"}, + Value: fmt.Sprintf("%v", *m.CountAttr)}) + } + e.EncodeToken(start) + if m.LsdException != nil { + selsdException := xml.StartElement{Name: xml.Name{Local: "w:lsdException"}} + for _, c := range m.LsdException { + e.EncodeElement(c, selsdException) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_LatentStyles) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "defLockedState" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.DefLockedStateAttr = &parsed + continue + } + if attr.Name.Local == "defUIPriority" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.DefUIPriorityAttr = &parsed + continue + } + if attr.Name.Local == "defSemiHidden" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.DefSemiHiddenAttr = &parsed + continue + } + if attr.Name.Local == "defUnhideWhenUsed" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.DefUnhideWhenUsedAttr = &parsed + continue + } + if attr.Name.Local == "defQFormat" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.DefQFormatAttr = &parsed + continue + } + if attr.Name.Local == "count" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.CountAttr = &parsed + continue + } + } +lCT_LatentStyles: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "lsdException"}: + tmp := NewCT_LsdException() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.LsdException = append(m.LsdException, tmp) + default: + gooxml.Log("skipping unsupported element on CT_LatentStyles %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_LatentStyles + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_LatentStyles and its children +func (m *CT_LatentStyles) Validate() error { + return m.ValidateWithPath("CT_LatentStyles") +} + +// ValidateWithPath validates the CT_LatentStyles and its children, prefixing error messages with path +func (m *CT_LatentStyles) ValidateWithPath(path string) error { + if m.DefLockedStateAttr != nil { + if err := m.DefLockedStateAttr.ValidateWithPath(path + "/DefLockedStateAttr"); err != nil { + return err + } + } + if m.DefSemiHiddenAttr != nil { + if err := m.DefSemiHiddenAttr.ValidateWithPath(path + "/DefSemiHiddenAttr"); err != nil { + return err + } + } + if m.DefUnhideWhenUsedAttr != nil { + if err := m.DefUnhideWhenUsedAttr.ValidateWithPath(path + "/DefUnhideWhenUsedAttr"); err != nil { + return err + } + } + if m.DefQFormatAttr != nil { + if err := m.DefQFormatAttr.ValidateWithPath(path + "/DefQFormatAttr"); err != nil { + return err + } + } + for i, v := range m.LsdException { + if err := v.ValidateWithPath(fmt.Sprintf("%s/LsdException[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_LevelSuffix.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_LevelSuffix.go new file mode 100644 index 00000000..6fda0a0f --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_LevelSuffix.go @@ -0,0 +1,75 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_LevelSuffix struct { + // Character Type Between Numbering and Text + ValAttr ST_LevelSuffix +} + +func NewCT_LevelSuffix() *CT_LevelSuffix { + ret := &CT_LevelSuffix{} + ret.ValAttr = ST_LevelSuffix(1) + return ret +} + +func (m *CT_LevelSuffix) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_LevelSuffix) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_LevelSuffix(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_LevelSuffix: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_LevelSuffix and its children +func (m *CT_LevelSuffix) Validate() error { + return m.ValidateWithPath("CT_LevelSuffix") +} + +// ValidateWithPath validates the CT_LevelSuffix and its children, prefixing error messages with path +func (m *CT_LevelSuffix) ValidateWithPath(path string) error { + if m.ValAttr == ST_LevelSuffixUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_LevelText.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_LevelText.go new file mode 100644 index 00000000..473558bd --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_LevelText.go @@ -0,0 +1,91 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_LevelText struct { + // Level Text + ValAttr *string + // Level Text Is Null Character + NullAttr *sharedTypes.ST_OnOff +} + +func NewCT_LevelText() *CT_LevelText { + ret := &CT_LevelText{} + return ret +} + +func (m *CT_LevelText) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.ValAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:val"}, + Value: fmt.Sprintf("%v", *m.ValAttr)}) + } + if m.NullAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:null"}, + Value: fmt.Sprintf("%v", *m.NullAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_LevelText) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ValAttr = &parsed + continue + } + if attr.Name.Local == "null" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.NullAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_LevelText: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_LevelText and its children +func (m *CT_LevelText) Validate() error { + return m.ValidateWithPath("CT_LevelText") +} + +// ValidateWithPath validates the CT_LevelText and its children, prefixing error messages with path +func (m *CT_LevelText) ValidateWithPath(path string) error { + if m.NullAttr != nil { + if err := m.NullAttr.ValidateWithPath(path + "/NullAttr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_LineNumber.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_LineNumber.go new file mode 100644 index 00000000..17e0fe9f --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_LineNumber.go @@ -0,0 +1,122 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_LineNumber struct { + // Line Number Increments to Display + CountByAttr *int64 + // Line Numbering Starting Value + StartAttr *int64 + // Distance Between Text and Line Numbering + DistanceAttr *sharedTypes.ST_TwipsMeasure + // Line Numbering Restart Setting + RestartAttr ST_LineNumberRestart +} + +func NewCT_LineNumber() *CT_LineNumber { + ret := &CT_LineNumber{} + return ret +} + +func (m *CT_LineNumber) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.CountByAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:countBy"}, + Value: fmt.Sprintf("%v", *m.CountByAttr)}) + } + if m.StartAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:start"}, + Value: fmt.Sprintf("%v", *m.StartAttr)}) + } + if m.DistanceAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:distance"}, + Value: fmt.Sprintf("%v", *m.DistanceAttr)}) + } + if m.RestartAttr != ST_LineNumberRestartUnset { + attr, err := m.RestartAttr.MarshalXMLAttr(xml.Name{Local: "w:restart"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_LineNumber) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "countBy" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.CountByAttr = &parsed + continue + } + if attr.Name.Local == "start" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.StartAttr = &parsed + continue + } + if attr.Name.Local == "distance" { + parsed, err := ParseUnionST_TwipsMeasure(attr.Value) + if err != nil { + return err + } + m.DistanceAttr = &parsed + continue + } + if attr.Name.Local == "restart" { + m.RestartAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_LineNumber: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_LineNumber and its children +func (m *CT_LineNumber) Validate() error { + return m.ValidateWithPath("CT_LineNumber") +} + +// ValidateWithPath validates the CT_LineNumber and its children, prefixing error messages with path +func (m *CT_LineNumber) ValidateWithPath(path string) error { + if m.DistanceAttr != nil { + if err := m.DistanceAttr.ValidateWithPath(path + "/DistanceAttr"); err != nil { + return err + } + } + if err := m.RestartAttr.ValidateWithPath(path + "/RestartAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Lock.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Lock.go new file mode 100644 index 00000000..eb9965db --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Lock.go @@ -0,0 +1,72 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_Lock struct { + // Locking Type + ValAttr ST_Lock +} + +func NewCT_Lock() *CT_Lock { + ret := &CT_Lock{} + return ret +} + +func (m *CT_Lock) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.ValAttr != ST_LockUnset { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Lock) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Lock: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Lock and its children +func (m *CT_Lock) Validate() error { + return m.ValidateWithPath("CT_Lock") +} + +// ValidateWithPath validates the CT_Lock and its children, prefixing error messages with path +func (m *CT_Lock) ValidateWithPath(path string) error { + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_LongHexNumber.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_LongHexNumber.go new file mode 100644 index 00000000..15c04ae1 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_LongHexNumber.go @@ -0,0 +1,68 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_LongHexNumber struct { + // Long Hexadecimal Number Value + ValAttr string +} + +func NewCT_LongHexNumber() *CT_LongHexNumber { + ret := &CT_LongHexNumber{} + return ret +} + +func (m *CT_LongHexNumber) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:val"}, + Value: fmt.Sprintf("%v", m.ValAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_LongHexNumber) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ValAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_LongHexNumber: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_LongHexNumber and its children +func (m *CT_LongHexNumber) Validate() error { + return m.ValidateWithPath("CT_LongHexNumber") +} + +// ValidateWithPath validates the CT_LongHexNumber and its children, prefixing error messages with path +func (m *CT_LongHexNumber) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_LsdException.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_LsdException.go new file mode 100644 index 00000000..029c0c20 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_LsdException.go @@ -0,0 +1,161 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_LsdException struct { + // Primary Style Name + NameAttr string + // Latent Style Locking Setting + LockedAttr *sharedTypes.ST_OnOff + // Override default sorting order + UiPriorityAttr *int64 + // Semi hidden text override + SemiHiddenAttr *sharedTypes.ST_OnOff + // Unhide when used + UnhideWhenUsedAttr *sharedTypes.ST_OnOff + // Latent Style Primary Style Setting + QFormatAttr *sharedTypes.ST_OnOff +} + +func NewCT_LsdException() *CT_LsdException { + ret := &CT_LsdException{} + return ret +} + +func (m *CT_LsdException) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:name"}, + Value: fmt.Sprintf("%v", m.NameAttr)}) + if m.LockedAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:locked"}, + Value: fmt.Sprintf("%v", *m.LockedAttr)}) + } + if m.UiPriorityAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:uiPriority"}, + Value: fmt.Sprintf("%v", *m.UiPriorityAttr)}) + } + if m.SemiHiddenAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:semiHidden"}, + Value: fmt.Sprintf("%v", *m.SemiHiddenAttr)}) + } + if m.UnhideWhenUsedAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:unhideWhenUsed"}, + Value: fmt.Sprintf("%v", *m.UnhideWhenUsedAttr)}) + } + if m.QFormatAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:qFormat"}, + Value: fmt.Sprintf("%v", *m.QFormatAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_LsdException) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "name" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.NameAttr = parsed + continue + } + if attr.Name.Local == "locked" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.LockedAttr = &parsed + continue + } + if attr.Name.Local == "uiPriority" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.UiPriorityAttr = &parsed + continue + } + if attr.Name.Local == "semiHidden" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.SemiHiddenAttr = &parsed + continue + } + if attr.Name.Local == "unhideWhenUsed" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.UnhideWhenUsedAttr = &parsed + continue + } + if attr.Name.Local == "qFormat" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.QFormatAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_LsdException: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_LsdException and its children +func (m *CT_LsdException) Validate() error { + return m.ValidateWithPath("CT_LsdException") +} + +// ValidateWithPath validates the CT_LsdException and its children, prefixing error messages with path +func (m *CT_LsdException) ValidateWithPath(path string) error { + if m.LockedAttr != nil { + if err := m.LockedAttr.ValidateWithPath(path + "/LockedAttr"); err != nil { + return err + } + } + if m.SemiHiddenAttr != nil { + if err := m.SemiHiddenAttr.ValidateWithPath(path + "/SemiHiddenAttr"); err != nil { + return err + } + } + if m.UnhideWhenUsedAttr != nil { + if err := m.UnhideWhenUsedAttr.ValidateWithPath(path + "/UnhideWhenUsedAttr"); err != nil { + return err + } + } + if m.QFormatAttr != nil { + if err := m.QFormatAttr.ValidateWithPath(path + "/QFormatAttr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Lvl.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Lvl.go new file mode 100644 index 00000000..d0f8408e --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Lvl.go @@ -0,0 +1,307 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_Lvl struct { + // Numbering Level + IlvlAttr int64 + // Template Code + TplcAttr *string + // Tentative Numbering + TentativeAttr *sharedTypes.ST_OnOff + // Starting Value + Start *CT_DecimalNumber + // Numbering Format + NumFmt *CT_NumFmt + // Restart Numbering Level Symbol + LvlRestart *CT_DecimalNumber + // Paragraph Style's Associated Numbering Level + PStyle *CT_String + // Display All Levels Using Arabic Numerals + IsLgl *CT_OnOff + // Content Between Numbering Symbol and Paragraph Text + Suff *CT_LevelSuffix + // Numbering Level Text + LvlText *CT_LevelText + // Picture Numbering Symbol Definition Reference + LvlPicBulletId *CT_DecimalNumber + // Legacy Numbering Level Properties + Legacy *CT_LvlLegacy + // Justification + LvlJc *CT_Jc + // Numbering Level Associated Paragraph Properties + PPr *CT_PPrGeneral + // Numbering Symbol Run Properties + RPr *CT_RPr +} + +func NewCT_Lvl() *CT_Lvl { + ret := &CT_Lvl{} + return ret +} + +func (m *CT_Lvl) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:ilvl"}, + Value: fmt.Sprintf("%v", m.IlvlAttr)}) + if m.TplcAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:tplc"}, + Value: fmt.Sprintf("%v", *m.TplcAttr)}) + } + if m.TentativeAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:tentative"}, + Value: fmt.Sprintf("%v", *m.TentativeAttr)}) + } + e.EncodeToken(start) + if m.Start != nil { + sestart := xml.StartElement{Name: xml.Name{Local: "w:start"}} + e.EncodeElement(m.Start, sestart) + } + if m.NumFmt != nil { + senumFmt := xml.StartElement{Name: xml.Name{Local: "w:numFmt"}} + e.EncodeElement(m.NumFmt, senumFmt) + } + if m.LvlRestart != nil { + selvlRestart := xml.StartElement{Name: xml.Name{Local: "w:lvlRestart"}} + e.EncodeElement(m.LvlRestart, selvlRestart) + } + if m.PStyle != nil { + sepStyle := xml.StartElement{Name: xml.Name{Local: "w:pStyle"}} + e.EncodeElement(m.PStyle, sepStyle) + } + if m.IsLgl != nil { + seisLgl := xml.StartElement{Name: xml.Name{Local: "w:isLgl"}} + e.EncodeElement(m.IsLgl, seisLgl) + } + if m.Suff != nil { + sesuff := xml.StartElement{Name: xml.Name{Local: "w:suff"}} + e.EncodeElement(m.Suff, sesuff) + } + if m.LvlText != nil { + selvlText := xml.StartElement{Name: xml.Name{Local: "w:lvlText"}} + e.EncodeElement(m.LvlText, selvlText) + } + if m.LvlPicBulletId != nil { + selvlPicBulletId := xml.StartElement{Name: xml.Name{Local: "w:lvlPicBulletId"}} + e.EncodeElement(m.LvlPicBulletId, selvlPicBulletId) + } + if m.Legacy != nil { + selegacy := xml.StartElement{Name: xml.Name{Local: "w:legacy"}} + e.EncodeElement(m.Legacy, selegacy) + } + if m.LvlJc != nil { + selvlJc := xml.StartElement{Name: xml.Name{Local: "w:lvlJc"}} + e.EncodeElement(m.LvlJc, selvlJc) + } + if m.PPr != nil { + sepPr := xml.StartElement{Name: xml.Name{Local: "w:pPr"}} + e.EncodeElement(m.PPr, sepPr) + } + if m.RPr != nil { + serPr := xml.StartElement{Name: xml.Name{Local: "w:rPr"}} + e.EncodeElement(m.RPr, serPr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Lvl) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "tplc" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.TplcAttr = &parsed + continue + } + if attr.Name.Local == "ilvl" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.IlvlAttr = parsed + continue + } + if attr.Name.Local == "tentative" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.TentativeAttr = &parsed + continue + } + } +lCT_Lvl: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "start"}: + m.Start = NewCT_DecimalNumber() + if err := d.DecodeElement(m.Start, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "numFmt"}: + m.NumFmt = NewCT_NumFmt() + if err := d.DecodeElement(m.NumFmt, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "lvlRestart"}: + m.LvlRestart = NewCT_DecimalNumber() + if err := d.DecodeElement(m.LvlRestart, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pStyle"}: + m.PStyle = NewCT_String() + if err := d.DecodeElement(m.PStyle, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "isLgl"}: + m.IsLgl = NewCT_OnOff() + if err := d.DecodeElement(m.IsLgl, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "suff"}: + m.Suff = NewCT_LevelSuffix() + if err := d.DecodeElement(m.Suff, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "lvlText"}: + m.LvlText = NewCT_LevelText() + if err := d.DecodeElement(m.LvlText, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "lvlPicBulletId"}: + m.LvlPicBulletId = NewCT_DecimalNumber() + if err := d.DecodeElement(m.LvlPicBulletId, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "legacy"}: + m.Legacy = NewCT_LvlLegacy() + if err := d.DecodeElement(m.Legacy, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "lvlJc"}: + m.LvlJc = NewCT_Jc() + if err := d.DecodeElement(m.LvlJc, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pPr"}: + m.PPr = NewCT_PPrGeneral() + if err := d.DecodeElement(m.PPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rPr"}: + m.RPr = NewCT_RPr() + if err := d.DecodeElement(m.RPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_Lvl %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Lvl + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Lvl and its children +func (m *CT_Lvl) Validate() error { + return m.ValidateWithPath("CT_Lvl") +} + +// ValidateWithPath validates the CT_Lvl and its children, prefixing error messages with path +func (m *CT_Lvl) ValidateWithPath(path string) error { + if m.TentativeAttr != nil { + if err := m.TentativeAttr.ValidateWithPath(path + "/TentativeAttr"); err != nil { + return err + } + } + if m.Start != nil { + if err := m.Start.ValidateWithPath(path + "/Start"); err != nil { + return err + } + } + if m.NumFmt != nil { + if err := m.NumFmt.ValidateWithPath(path + "/NumFmt"); err != nil { + return err + } + } + if m.LvlRestart != nil { + if err := m.LvlRestart.ValidateWithPath(path + "/LvlRestart"); err != nil { + return err + } + } + if m.PStyle != nil { + if err := m.PStyle.ValidateWithPath(path + "/PStyle"); err != nil { + return err + } + } + if m.IsLgl != nil { + if err := m.IsLgl.ValidateWithPath(path + "/IsLgl"); err != nil { + return err + } + } + if m.Suff != nil { + if err := m.Suff.ValidateWithPath(path + "/Suff"); err != nil { + return err + } + } + if m.LvlText != nil { + if err := m.LvlText.ValidateWithPath(path + "/LvlText"); err != nil { + return err + } + } + if m.LvlPicBulletId != nil { + if err := m.LvlPicBulletId.ValidateWithPath(path + "/LvlPicBulletId"); err != nil { + return err + } + } + if m.Legacy != nil { + if err := m.Legacy.ValidateWithPath(path + "/Legacy"); err != nil { + return err + } + } + if m.LvlJc != nil { + if err := m.LvlJc.ValidateWithPath(path + "/LvlJc"); err != nil { + return err + } + } + if m.PPr != nil { + if err := m.PPr.ValidateWithPath(path + "/PPr"); err != nil { + return err + } + } + if m.RPr != nil { + if err := m.RPr.ValidateWithPath(path + "/RPr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_LvlLegacy.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_LvlLegacy.go new file mode 100644 index 00000000..67219856 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_LvlLegacy.go @@ -0,0 +1,115 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_LvlLegacy struct { + // Use Legacy Numbering Properties + LegacyAttr *sharedTypes.ST_OnOff + // Legacy Spacing + LegacySpaceAttr *sharedTypes.ST_TwipsMeasure + // Legacy Indent + LegacyIndentAttr *ST_SignedTwipsMeasure +} + +func NewCT_LvlLegacy() *CT_LvlLegacy { + ret := &CT_LvlLegacy{} + return ret +} + +func (m *CT_LvlLegacy) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.LegacyAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:legacy"}, + Value: fmt.Sprintf("%v", *m.LegacyAttr)}) + } + if m.LegacySpaceAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:legacySpace"}, + Value: fmt.Sprintf("%v", *m.LegacySpaceAttr)}) + } + if m.LegacyIndentAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:legacyIndent"}, + Value: fmt.Sprintf("%v", *m.LegacyIndentAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_LvlLegacy) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "legacy" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.LegacyAttr = &parsed + continue + } + if attr.Name.Local == "legacySpace" { + parsed, err := ParseUnionST_TwipsMeasure(attr.Value) + if err != nil { + return err + } + m.LegacySpaceAttr = &parsed + continue + } + if attr.Name.Local == "legacyIndent" { + parsed, err := ParseUnionST_SignedTwipsMeasure(attr.Value) + if err != nil { + return err + } + m.LegacyIndentAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_LvlLegacy: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_LvlLegacy and its children +func (m *CT_LvlLegacy) Validate() error { + return m.ValidateWithPath("CT_LvlLegacy") +} + +// ValidateWithPath validates the CT_LvlLegacy and its children, prefixing error messages with path +func (m *CT_LvlLegacy) ValidateWithPath(path string) error { + if m.LegacyAttr != nil { + if err := m.LegacyAttr.ValidateWithPath(path + "/LegacyAttr"); err != nil { + return err + } + } + if m.LegacySpaceAttr != nil { + if err := m.LegacySpaceAttr.ValidateWithPath(path + "/LegacySpaceAttr"); err != nil { + return err + } + } + if m.LegacyIndentAttr != nil { + if err := m.LegacyIndentAttr.ValidateWithPath(path + "/LegacyIndentAttr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_MacroName.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_MacroName.go new file mode 100644 index 00000000..d900d85e --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_MacroName.go @@ -0,0 +1,68 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_MacroName struct { + // Name of Script Function + ValAttr string +} + +func NewCT_MacroName() *CT_MacroName { + ret := &CT_MacroName{} + return ret +} + +func (m *CT_MacroName) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:val"}, + Value: fmt.Sprintf("%v", m.ValAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_MacroName) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ValAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_MacroName: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_MacroName and its children +func (m *CT_MacroName) Validate() error { + return m.ValidateWithPath("CT_MacroName") +} + +// ValidateWithPath validates the CT_MacroName and its children, prefixing error messages with path +func (m *CT_MacroName) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_MailMerge.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_MailMerge.go new file mode 100644 index 00000000..08e2c4da --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_MailMerge.go @@ -0,0 +1,315 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_MailMerge struct { + // Source Document Type + MainDocumentType *CT_MailMergeDocType + // Query Contains Link to External Query File + LinkToQuery *CT_OnOff + // Data Source Type + DataType *CT_MailMergeDataType + // Data Source Connection String + ConnectString *CT_String + // Query For Data Source Records To Merge + Query *CT_String + // Data Source File Path + DataSource *CT_Rel + // Header Definition File Path + HeaderSource *CT_Rel + // Remove Blank Lines from Merged Documents + DoNotSuppressBlankLines *CT_OnOff + // Merged Document Destination + Destination *CT_MailMergeDest + // Column Containing E-mail Address + AddressFieldName *CT_String + // Merged E-mail or Fax Subject Line + MailSubject *CT_String + // Merged Document To E-Mail Attachment + MailAsAttachment *CT_OnOff + // View Merged Data Within Document + ViewMergedData *CT_OnOff + // Record Currently Displayed In Merged Document + ActiveRecord *CT_DecimalNumber + // Mail Merge Error Reporting Setting + CheckErrors *CT_DecimalNumber + // Office Data Source Object Settings + Odso *CT_Odso +} + +func NewCT_MailMerge() *CT_MailMerge { + ret := &CT_MailMerge{} + ret.MainDocumentType = NewCT_MailMergeDocType() + ret.DataType = NewCT_MailMergeDataType() + return ret +} + +func (m *CT_MailMerge) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + semainDocumentType := xml.StartElement{Name: xml.Name{Local: "w:mainDocumentType"}} + e.EncodeElement(m.MainDocumentType, semainDocumentType) + if m.LinkToQuery != nil { + selinkToQuery := xml.StartElement{Name: xml.Name{Local: "w:linkToQuery"}} + e.EncodeElement(m.LinkToQuery, selinkToQuery) + } + sedataType := xml.StartElement{Name: xml.Name{Local: "w:dataType"}} + e.EncodeElement(m.DataType, sedataType) + if m.ConnectString != nil { + seconnectString := xml.StartElement{Name: xml.Name{Local: "w:connectString"}} + e.EncodeElement(m.ConnectString, seconnectString) + } + if m.Query != nil { + sequery := xml.StartElement{Name: xml.Name{Local: "w:query"}} + e.EncodeElement(m.Query, sequery) + } + if m.DataSource != nil { + sedataSource := xml.StartElement{Name: xml.Name{Local: "w:dataSource"}} + e.EncodeElement(m.DataSource, sedataSource) + } + if m.HeaderSource != nil { + seheaderSource := xml.StartElement{Name: xml.Name{Local: "w:headerSource"}} + e.EncodeElement(m.HeaderSource, seheaderSource) + } + if m.DoNotSuppressBlankLines != nil { + sedoNotSuppressBlankLines := xml.StartElement{Name: xml.Name{Local: "w:doNotSuppressBlankLines"}} + e.EncodeElement(m.DoNotSuppressBlankLines, sedoNotSuppressBlankLines) + } + if m.Destination != nil { + sedestination := xml.StartElement{Name: xml.Name{Local: "w:destination"}} + e.EncodeElement(m.Destination, sedestination) + } + if m.AddressFieldName != nil { + seaddressFieldName := xml.StartElement{Name: xml.Name{Local: "w:addressFieldName"}} + e.EncodeElement(m.AddressFieldName, seaddressFieldName) + } + if m.MailSubject != nil { + semailSubject := xml.StartElement{Name: xml.Name{Local: "w:mailSubject"}} + e.EncodeElement(m.MailSubject, semailSubject) + } + if m.MailAsAttachment != nil { + semailAsAttachment := xml.StartElement{Name: xml.Name{Local: "w:mailAsAttachment"}} + e.EncodeElement(m.MailAsAttachment, semailAsAttachment) + } + if m.ViewMergedData != nil { + seviewMergedData := xml.StartElement{Name: xml.Name{Local: "w:viewMergedData"}} + e.EncodeElement(m.ViewMergedData, seviewMergedData) + } + if m.ActiveRecord != nil { + seactiveRecord := xml.StartElement{Name: xml.Name{Local: "w:activeRecord"}} + e.EncodeElement(m.ActiveRecord, seactiveRecord) + } + if m.CheckErrors != nil { + secheckErrors := xml.StartElement{Name: xml.Name{Local: "w:checkErrors"}} + e.EncodeElement(m.CheckErrors, secheckErrors) + } + if m.Odso != nil { + seodso := xml.StartElement{Name: xml.Name{Local: "w:odso"}} + e.EncodeElement(m.Odso, seodso) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_MailMerge) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.MainDocumentType = NewCT_MailMergeDocType() + m.DataType = NewCT_MailMergeDataType() +lCT_MailMerge: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "mainDocumentType"}: + if err := d.DecodeElement(m.MainDocumentType, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "linkToQuery"}: + m.LinkToQuery = NewCT_OnOff() + if err := d.DecodeElement(m.LinkToQuery, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "dataType"}: + if err := d.DecodeElement(m.DataType, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "connectString"}: + m.ConnectString = NewCT_String() + if err := d.DecodeElement(m.ConnectString, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "query"}: + m.Query = NewCT_String() + if err := d.DecodeElement(m.Query, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "dataSource"}: + m.DataSource = NewCT_Rel() + if err := d.DecodeElement(m.DataSource, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "headerSource"}: + m.HeaderSource = NewCT_Rel() + if err := d.DecodeElement(m.HeaderSource, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotSuppressBlankLines"}: + m.DoNotSuppressBlankLines = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotSuppressBlankLines, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "destination"}: + m.Destination = NewCT_MailMergeDest() + if err := d.DecodeElement(m.Destination, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "addressFieldName"}: + m.AddressFieldName = NewCT_String() + if err := d.DecodeElement(m.AddressFieldName, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "mailSubject"}: + m.MailSubject = NewCT_String() + if err := d.DecodeElement(m.MailSubject, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "mailAsAttachment"}: + m.MailAsAttachment = NewCT_OnOff() + if err := d.DecodeElement(m.MailAsAttachment, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "viewMergedData"}: + m.ViewMergedData = NewCT_OnOff() + if err := d.DecodeElement(m.ViewMergedData, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "activeRecord"}: + m.ActiveRecord = NewCT_DecimalNumber() + if err := d.DecodeElement(m.ActiveRecord, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "checkErrors"}: + m.CheckErrors = NewCT_DecimalNumber() + if err := d.DecodeElement(m.CheckErrors, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "odso"}: + m.Odso = NewCT_Odso() + if err := d.DecodeElement(m.Odso, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_MailMerge %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_MailMerge + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_MailMerge and its children +func (m *CT_MailMerge) Validate() error { + return m.ValidateWithPath("CT_MailMerge") +} + +// ValidateWithPath validates the CT_MailMerge and its children, prefixing error messages with path +func (m *CT_MailMerge) ValidateWithPath(path string) error { + if err := m.MainDocumentType.ValidateWithPath(path + "/MainDocumentType"); err != nil { + return err + } + if m.LinkToQuery != nil { + if err := m.LinkToQuery.ValidateWithPath(path + "/LinkToQuery"); err != nil { + return err + } + } + if err := m.DataType.ValidateWithPath(path + "/DataType"); err != nil { + return err + } + if m.ConnectString != nil { + if err := m.ConnectString.ValidateWithPath(path + "/ConnectString"); err != nil { + return err + } + } + if m.Query != nil { + if err := m.Query.ValidateWithPath(path + "/Query"); err != nil { + return err + } + } + if m.DataSource != nil { + if err := m.DataSource.ValidateWithPath(path + "/DataSource"); err != nil { + return err + } + } + if m.HeaderSource != nil { + if err := m.HeaderSource.ValidateWithPath(path + "/HeaderSource"); err != nil { + return err + } + } + if m.DoNotSuppressBlankLines != nil { + if err := m.DoNotSuppressBlankLines.ValidateWithPath(path + "/DoNotSuppressBlankLines"); err != nil { + return err + } + } + if m.Destination != nil { + if err := m.Destination.ValidateWithPath(path + "/Destination"); err != nil { + return err + } + } + if m.AddressFieldName != nil { + if err := m.AddressFieldName.ValidateWithPath(path + "/AddressFieldName"); err != nil { + return err + } + } + if m.MailSubject != nil { + if err := m.MailSubject.ValidateWithPath(path + "/MailSubject"); err != nil { + return err + } + } + if m.MailAsAttachment != nil { + if err := m.MailAsAttachment.ValidateWithPath(path + "/MailAsAttachment"); err != nil { + return err + } + } + if m.ViewMergedData != nil { + if err := m.ViewMergedData.ValidateWithPath(path + "/ViewMergedData"); err != nil { + return err + } + } + if m.ActiveRecord != nil { + if err := m.ActiveRecord.ValidateWithPath(path + "/ActiveRecord"); err != nil { + return err + } + } + if m.CheckErrors != nil { + if err := m.CheckErrors.ValidateWithPath(path + "/CheckErrors"); err != nil { + return err + } + } + if m.Odso != nil { + if err := m.Odso.ValidateWithPath(path + "/Odso"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_MailMergeDataType.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_MailMergeDataType.go new file mode 100644 index 00000000..8b46cee4 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_MailMergeDataType.go @@ -0,0 +1,68 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_MailMergeDataType struct { + // Value + ValAttr string +} + +func NewCT_MailMergeDataType() *CT_MailMergeDataType { + ret := &CT_MailMergeDataType{} + return ret +} + +func (m *CT_MailMergeDataType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:val"}, + Value: fmt.Sprintf("%v", m.ValAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_MailMergeDataType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ValAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_MailMergeDataType: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_MailMergeDataType and its children +func (m *CT_MailMergeDataType) Validate() error { + return m.ValidateWithPath("CT_MailMergeDataType") +} + +// ValidateWithPath validates the CT_MailMergeDataType and its children, prefixing error messages with path +func (m *CT_MailMergeDataType) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_MailMergeDest.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_MailMergeDest.go new file mode 100644 index 00000000..a5508d5a --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_MailMergeDest.go @@ -0,0 +1,75 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_MailMergeDest struct { + // Mail Merge Merged Document Type + ValAttr ST_MailMergeDest +} + +func NewCT_MailMergeDest() *CT_MailMergeDest { + ret := &CT_MailMergeDest{} + ret.ValAttr = ST_MailMergeDest(1) + return ret +} + +func (m *CT_MailMergeDest) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_MailMergeDest) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_MailMergeDest(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_MailMergeDest: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_MailMergeDest and its children +func (m *CT_MailMergeDest) Validate() error { + return m.ValidateWithPath("CT_MailMergeDest") +} + +// ValidateWithPath validates the CT_MailMergeDest and its children, prefixing error messages with path +func (m *CT_MailMergeDest) ValidateWithPath(path string) error { + if m.ValAttr == ST_MailMergeDestUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_MailMergeDocType.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_MailMergeDocType.go new file mode 100644 index 00000000..333b8cd5 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_MailMergeDocType.go @@ -0,0 +1,75 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_MailMergeDocType struct { + // Mail Merge Source Document Type + ValAttr ST_MailMergeDocType +} + +func NewCT_MailMergeDocType() *CT_MailMergeDocType { + ret := &CT_MailMergeDocType{} + ret.ValAttr = ST_MailMergeDocType(1) + return ret +} + +func (m *CT_MailMergeDocType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_MailMergeDocType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_MailMergeDocType(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_MailMergeDocType: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_MailMergeDocType and its children +func (m *CT_MailMergeDocType) Validate() error { + return m.ValidateWithPath("CT_MailMergeDocType") +} + +// ValidateWithPath validates the CT_MailMergeDocType and its children, prefixing error messages with path +func (m *CT_MailMergeDocType) ValidateWithPath(path string) error { + if m.ValAttr == ST_MailMergeDocTypeUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_MailMergeOdsoFMDFieldType.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_MailMergeOdsoFMDFieldType.go new file mode 100644 index 00000000..ce87f145 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_MailMergeOdsoFMDFieldType.go @@ -0,0 +1,75 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_MailMergeOdsoFMDFieldType struct { + // Merge Field Mapping Type + ValAttr ST_MailMergeOdsoFMDFieldType +} + +func NewCT_MailMergeOdsoFMDFieldType() *CT_MailMergeOdsoFMDFieldType { + ret := &CT_MailMergeOdsoFMDFieldType{} + ret.ValAttr = ST_MailMergeOdsoFMDFieldType(1) + return ret +} + +func (m *CT_MailMergeOdsoFMDFieldType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_MailMergeOdsoFMDFieldType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_MailMergeOdsoFMDFieldType(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_MailMergeOdsoFMDFieldType: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_MailMergeOdsoFMDFieldType and its children +func (m *CT_MailMergeOdsoFMDFieldType) Validate() error { + return m.ValidateWithPath("CT_MailMergeOdsoFMDFieldType") +} + +// ValidateWithPath validates the CT_MailMergeOdsoFMDFieldType and its children, prefixing error messages with path +func (m *CT_MailMergeOdsoFMDFieldType) ValidateWithPath(path string) error { + if m.ValAttr == ST_MailMergeOdsoFMDFieldTypeUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_MailMergeSourceType.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_MailMergeSourceType.go new file mode 100644 index 00000000..44afcd73 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_MailMergeSourceType.go @@ -0,0 +1,75 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_MailMergeSourceType struct { + // Data Source Type Value + ValAttr ST_MailMergeSourceType +} + +func NewCT_MailMergeSourceType() *CT_MailMergeSourceType { + ret := &CT_MailMergeSourceType{} + ret.ValAttr = ST_MailMergeSourceType(1) + return ret +} + +func (m *CT_MailMergeSourceType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_MailMergeSourceType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_MailMergeSourceType(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_MailMergeSourceType: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_MailMergeSourceType and its children +func (m *CT_MailMergeSourceType) Validate() error { + return m.ValidateWithPath("CT_MailMergeSourceType") +} + +// ValidateWithPath validates the CT_MailMergeSourceType and its children, prefixing error messages with path +func (m *CT_MailMergeSourceType) ValidateWithPath(path string) error { + if m.ValAttr == ST_MailMergeSourceTypeUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Markup.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Markup.go new file mode 100644 index 00000000..1429bc2c --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Markup.go @@ -0,0 +1,69 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" +) + +type CT_Markup struct { + // Annotation Identifier + IdAttr int64 +} + +func NewCT_Markup() *CT_Markup { + ret := &CT_Markup{} + return ret +} + +func (m *CT_Markup) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:id"}, + Value: fmt.Sprintf("%v", m.IdAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Markup) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "id" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.IdAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Markup: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Markup and its children +func (m *CT_Markup) Validate() error { + return m.ValidateWithPath("CT_Markup") +} + +// ValidateWithPath validates the CT_Markup and its children, prefixing error messages with path +func (m *CT_Markup) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_MarkupRange.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_MarkupRange.go new file mode 100644 index 00000000..0783c164 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_MarkupRange.go @@ -0,0 +1,84 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" +) + +type CT_MarkupRange struct { + DisplacedByCustomXmlAttr ST_DisplacedByCustomXml + // Annotation Identifier + IdAttr int64 +} + +func NewCT_MarkupRange() *CT_MarkupRange { + ret := &CT_MarkupRange{} + return ret +} + +func (m *CT_MarkupRange) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.DisplacedByCustomXmlAttr != ST_DisplacedByCustomXmlUnset { + attr, err := m.DisplacedByCustomXmlAttr.MarshalXMLAttr(xml.Name{Local: "w:displacedByCustomXml"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:id"}, + Value: fmt.Sprintf("%v", m.IdAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_MarkupRange) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "displacedByCustomXml" { + m.DisplacedByCustomXmlAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "id" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.IdAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_MarkupRange: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_MarkupRange and its children +func (m *CT_MarkupRange) Validate() error { + return m.ValidateWithPath("CT_MarkupRange") +} + +// ValidateWithPath validates the CT_MarkupRange and its children, prefixing error messages with path +func (m *CT_MarkupRange) ValidateWithPath(path string) error { + if err := m.DisplacedByCustomXmlAttr.ValidateWithPath(path + "/DisplacedByCustomXmlAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_MathCtrlDel.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_MathCtrlDel.go new file mode 100644 index 00000000..083370f6 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_MathCtrlDel.go @@ -0,0 +1,94 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + "time" +) + +type CT_MathCtrlDel struct { + AuthorAttr string + DateAttr *time.Time + // Annotation Identifier + IdAttr int64 +} + +func NewCT_MathCtrlDel() *CT_MathCtrlDel { + ret := &CT_MathCtrlDel{} + return ret +} + +func (m *CT_MathCtrlDel) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:author"}, + Value: fmt.Sprintf("%v", m.AuthorAttr)}) + if m.DateAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:date"}, + Value: fmt.Sprintf("%v", *m.DateAttr)}) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:id"}, + Value: fmt.Sprintf("%v", m.IdAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_MathCtrlDel) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "author" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.AuthorAttr = parsed + continue + } + if attr.Name.Local == "date" { + parsed, err := ParseStdlibTime(attr.Value) + if err != nil { + return err + } + m.DateAttr = &parsed + continue + } + if attr.Name.Local == "id" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.IdAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_MathCtrlDel: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_MathCtrlDel and its children +func (m *CT_MathCtrlDel) Validate() error { + return m.ValidateWithPath("CT_MathCtrlDel") +} + +// ValidateWithPath validates the CT_MathCtrlDel and its children, prefixing error messages with path +func (m *CT_MathCtrlDel) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_MathCtrlIns.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_MathCtrlIns.go new file mode 100644 index 00000000..19c973ba --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_MathCtrlIns.go @@ -0,0 +1,94 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + "time" +) + +type CT_MathCtrlIns struct { + AuthorAttr string + DateAttr *time.Time + // Annotation Identifier + IdAttr int64 +} + +func NewCT_MathCtrlIns() *CT_MathCtrlIns { + ret := &CT_MathCtrlIns{} + return ret +} + +func (m *CT_MathCtrlIns) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:author"}, + Value: fmt.Sprintf("%v", m.AuthorAttr)}) + if m.DateAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:date"}, + Value: fmt.Sprintf("%v", *m.DateAttr)}) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:id"}, + Value: fmt.Sprintf("%v", m.IdAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_MathCtrlIns) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "author" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.AuthorAttr = parsed + continue + } + if attr.Name.Local == "date" { + parsed, err := ParseStdlibTime(attr.Value) + if err != nil { + return err + } + m.DateAttr = &parsed + continue + } + if attr.Name.Local == "id" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.IdAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_MathCtrlIns: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_MathCtrlIns and its children +func (m *CT_MathCtrlIns) Validate() error { + return m.ValidateWithPath("CT_MathCtrlIns") +} + +// ValidateWithPath validates the CT_MathCtrlIns and its children, prefixing error messages with path +func (m *CT_MathCtrlIns) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_MoveBookmark.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_MoveBookmark.go new file mode 100644 index 00000000..f0b30fc9 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_MoveBookmark.go @@ -0,0 +1,144 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + "time" +) + +type CT_MoveBookmark struct { + AuthorAttr string + DateAttr time.Time + NameAttr string + ColFirstAttr *int64 + ColLastAttr *int64 + DisplacedByCustomXmlAttr ST_DisplacedByCustomXml + // Annotation Identifier + IdAttr int64 +} + +func NewCT_MoveBookmark() *CT_MoveBookmark { + ret := &CT_MoveBookmark{} + return ret +} + +func (m *CT_MoveBookmark) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:author"}, + Value: fmt.Sprintf("%v", m.AuthorAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:date"}, + Value: fmt.Sprintf("%v", m.DateAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:name"}, + Value: fmt.Sprintf("%v", m.NameAttr)}) + if m.ColFirstAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:colFirst"}, + Value: fmt.Sprintf("%v", *m.ColFirstAttr)}) + } + if m.ColLastAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:colLast"}, + Value: fmt.Sprintf("%v", *m.ColLastAttr)}) + } + if m.DisplacedByCustomXmlAttr != ST_DisplacedByCustomXmlUnset { + attr, err := m.DisplacedByCustomXmlAttr.MarshalXMLAttr(xml.Name{Local: "w:displacedByCustomXml"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:id"}, + Value: fmt.Sprintf("%v", m.IdAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_MoveBookmark) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "author" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.AuthorAttr = parsed + continue + } + if attr.Name.Local == "date" { + parsed, err := ParseStdlibTime(attr.Value) + if err != nil { + return err + } + m.DateAttr = parsed + continue + } + if attr.Name.Local == "name" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.NameAttr = parsed + continue + } + if attr.Name.Local == "colFirst" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.ColFirstAttr = &parsed + continue + } + if attr.Name.Local == "colLast" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.ColLastAttr = &parsed + continue + } + if attr.Name.Local == "displacedByCustomXml" { + m.DisplacedByCustomXmlAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "id" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.IdAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_MoveBookmark: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_MoveBookmark and its children +func (m *CT_MoveBookmark) Validate() error { + return m.ValidateWithPath("CT_MoveBookmark") +} + +// ValidateWithPath validates the CT_MoveBookmark and its children, prefixing error messages with path +func (m *CT_MoveBookmark) ValidateWithPath(path string) error { + if err := m.DisplacedByCustomXmlAttr.ValidateWithPath(path + "/DisplacedByCustomXmlAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_MultiLevelType.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_MultiLevelType.go new file mode 100644 index 00000000..0f6f13ff --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_MultiLevelType.go @@ -0,0 +1,75 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_MultiLevelType struct { + // Abstract Numbering Definition Type + ValAttr ST_MultiLevelType +} + +func NewCT_MultiLevelType() *CT_MultiLevelType { + ret := &CT_MultiLevelType{} + ret.ValAttr = ST_MultiLevelType(1) + return ret +} + +func (m *CT_MultiLevelType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_MultiLevelType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_MultiLevelType(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_MultiLevelType: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_MultiLevelType and its children +func (m *CT_MultiLevelType) Validate() error { + return m.ValidateWithPath("CT_MultiLevelType") +} + +// ValidateWithPath validates the CT_MultiLevelType and its children, prefixing error messages with path +func (m *CT_MultiLevelType) ValidateWithPath(path string) error { + if m.ValAttr == ST_MultiLevelTypeUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Num.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Num.go new file mode 100644 index 00000000..117426a4 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Num.go @@ -0,0 +1,113 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type CT_Num struct { + // Numbering Definition Instance ID + NumIdAttr int64 + // Abstract Numbering Definition Reference + AbstractNumId *CT_DecimalNumber + // Numbering Level Definition Override + LvlOverride []*CT_NumLvl +} + +func NewCT_Num() *CT_Num { + ret := &CT_Num{} + ret.AbstractNumId = NewCT_DecimalNumber() + return ret +} + +func (m *CT_Num) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:numId"}, + Value: fmt.Sprintf("%v", m.NumIdAttr)}) + e.EncodeToken(start) + seabstractNumId := xml.StartElement{Name: xml.Name{Local: "w:abstractNumId"}} + e.EncodeElement(m.AbstractNumId, seabstractNumId) + if m.LvlOverride != nil { + selvlOverride := xml.StartElement{Name: xml.Name{Local: "w:lvlOverride"}} + for _, c := range m.LvlOverride { + e.EncodeElement(c, selvlOverride) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Num) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.AbstractNumId = NewCT_DecimalNumber() + for _, attr := range start.Attr { + if attr.Name.Local == "numId" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.NumIdAttr = parsed + continue + } + } +lCT_Num: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "abstractNumId"}: + if err := d.DecodeElement(m.AbstractNumId, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "lvlOverride"}: + tmp := NewCT_NumLvl() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.LvlOverride = append(m.LvlOverride, tmp) + default: + gooxml.Log("skipping unsupported element on CT_Num %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Num + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Num and its children +func (m *CT_Num) Validate() error { + return m.ValidateWithPath("CT_Num") +} + +// ValidateWithPath validates the CT_Num and its children, prefixing error messages with path +func (m *CT_Num) ValidateWithPath(path string) error { + if err := m.AbstractNumId.ValidateWithPath(path + "/AbstractNumId"); err != nil { + return err + } + for i, v := range m.LvlOverride { + if err := v.ValidateWithPath(fmt.Sprintf("%s/LvlOverride[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_NumFmt.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_NumFmt.go new file mode 100644 index 00000000..097c9f7d --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_NumFmt.go @@ -0,0 +1,89 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_NumFmt struct { + // Numbering Format Type + ValAttr ST_NumberFormat + // Custom Defined Number Format + FormatAttr *string +} + +func NewCT_NumFmt() *CT_NumFmt { + ret := &CT_NumFmt{} + ret.ValAttr = ST_NumberFormat(1) + return ret +} + +func (m *CT_NumFmt) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + if m.FormatAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:format"}, + Value: fmt.Sprintf("%v", *m.FormatAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_NumFmt) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_NumberFormat(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "format" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.FormatAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_NumFmt: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_NumFmt and its children +func (m *CT_NumFmt) Validate() error { + return m.ValidateWithPath("CT_NumFmt") +} + +// ValidateWithPath validates the CT_NumFmt and its children, prefixing error messages with path +func (m *CT_NumFmt) ValidateWithPath(path string) error { + if m.ValAttr == ST_NumberFormatUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_NumLvl.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_NumLvl.go new file mode 100644 index 00000000..4a6d872e --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_NumLvl.go @@ -0,0 +1,113 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type CT_NumLvl struct { + // Numbering Level ID + IlvlAttr int64 + // Numbering Level Starting Value Override + StartOverride *CT_DecimalNumber + // Numbering Level Override Definition + Lvl *CT_Lvl +} + +func NewCT_NumLvl() *CT_NumLvl { + ret := &CT_NumLvl{} + return ret +} + +func (m *CT_NumLvl) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:ilvl"}, + Value: fmt.Sprintf("%v", m.IlvlAttr)}) + e.EncodeToken(start) + if m.StartOverride != nil { + sestartOverride := xml.StartElement{Name: xml.Name{Local: "w:startOverride"}} + e.EncodeElement(m.StartOverride, sestartOverride) + } + if m.Lvl != nil { + selvl := xml.StartElement{Name: xml.Name{Local: "w:lvl"}} + e.EncodeElement(m.Lvl, selvl) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_NumLvl) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "ilvl" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.IlvlAttr = parsed + continue + } + } +lCT_NumLvl: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "startOverride"}: + m.StartOverride = NewCT_DecimalNumber() + if err := d.DecodeElement(m.StartOverride, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "lvl"}: + m.Lvl = NewCT_Lvl() + if err := d.DecodeElement(m.Lvl, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_NumLvl %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_NumLvl + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_NumLvl and its children +func (m *CT_NumLvl) Validate() error { + return m.ValidateWithPath("CT_NumLvl") +} + +// ValidateWithPath validates the CT_NumLvl and its children, prefixing error messages with path +func (m *CT_NumLvl) ValidateWithPath(path string) error { + if m.StartOverride != nil { + if err := m.StartOverride.ValidateWithPath(path + "/StartOverride"); err != nil { + return err + } + } + if m.Lvl != nil { + if err := m.Lvl.ValidateWithPath(path + "/Lvl"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_NumPicBullet.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_NumPicBullet.go new file mode 100644 index 00000000..adf7c65f --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_NumPicBullet.go @@ -0,0 +1,112 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type CT_NumPicBullet struct { + // Picture Numbering Symbol ID + NumPicBulletIdAttr int64 + // Picture Numbering Symbol Properties + Pict *CT_Picture + Drawing *CT_Drawing +} + +func NewCT_NumPicBullet() *CT_NumPicBullet { + ret := &CT_NumPicBullet{} + return ret +} + +func (m *CT_NumPicBullet) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:numPicBulletId"}, + Value: fmt.Sprintf("%v", m.NumPicBulletIdAttr)}) + e.EncodeToken(start) + if m.Pict != nil { + sepict := xml.StartElement{Name: xml.Name{Local: "w:pict"}} + e.EncodeElement(m.Pict, sepict) + } + if m.Drawing != nil { + sedrawing := xml.StartElement{Name: xml.Name{Local: "w:drawing"}} + e.EncodeElement(m.Drawing, sedrawing) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_NumPicBullet) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "numPicBulletId" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.NumPicBulletIdAttr = parsed + continue + } + } +lCT_NumPicBullet: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pict"}: + m.Pict = NewCT_Picture() + if err := d.DecodeElement(m.Pict, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "drawing"}: + m.Drawing = NewCT_Drawing() + if err := d.DecodeElement(m.Drawing, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_NumPicBullet %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_NumPicBullet + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_NumPicBullet and its children +func (m *CT_NumPicBullet) Validate() error { + return m.ValidateWithPath("CT_NumPicBullet") +} + +// ValidateWithPath validates the CT_NumPicBullet and its children, prefixing error messages with path +func (m *CT_NumPicBullet) ValidateWithPath(path string) error { + if m.Pict != nil { + if err := m.Pict.ValidateWithPath(path + "/Pict"); err != nil { + return err + } + } + if m.Drawing != nil { + if err := m.Drawing.ValidateWithPath(path + "/Drawing"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_NumPr.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_NumPr.go new file mode 100644 index 00000000..24804be4 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_NumPr.go @@ -0,0 +1,129 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_NumPr struct { + // Numbering Level Reference + Ilvl *CT_DecimalNumber + // Numbering Definition Instance Reference + NumId *CT_DecimalNumber + // Previous Paragraph Numbering Properties + NumberingChange *CT_TrackChangeNumbering + // Inserted Numbering Properties + Ins *CT_TrackChange +} + +func NewCT_NumPr() *CT_NumPr { + ret := &CT_NumPr{} + return ret +} + +func (m *CT_NumPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Ilvl != nil { + seilvl := xml.StartElement{Name: xml.Name{Local: "w:ilvl"}} + e.EncodeElement(m.Ilvl, seilvl) + } + if m.NumId != nil { + senumId := xml.StartElement{Name: xml.Name{Local: "w:numId"}} + e.EncodeElement(m.NumId, senumId) + } + if m.NumberingChange != nil { + senumberingChange := xml.StartElement{Name: xml.Name{Local: "w:numberingChange"}} + e.EncodeElement(m.NumberingChange, senumberingChange) + } + if m.Ins != nil { + seins := xml.StartElement{Name: xml.Name{Local: "w:ins"}} + e.EncodeElement(m.Ins, seins) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_NumPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_NumPr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ilvl"}: + m.Ilvl = NewCT_DecimalNumber() + if err := d.DecodeElement(m.Ilvl, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "numId"}: + m.NumId = NewCT_DecimalNumber() + if err := d.DecodeElement(m.NumId, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "numberingChange"}: + m.NumberingChange = NewCT_TrackChangeNumbering() + if err := d.DecodeElement(m.NumberingChange, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + m.Ins = NewCT_TrackChange() + if err := d.DecodeElement(m.Ins, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_NumPr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_NumPr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_NumPr and its children +func (m *CT_NumPr) Validate() error { + return m.ValidateWithPath("CT_NumPr") +} + +// ValidateWithPath validates the CT_NumPr and its children, prefixing error messages with path +func (m *CT_NumPr) ValidateWithPath(path string) error { + if m.Ilvl != nil { + if err := m.Ilvl.ValidateWithPath(path + "/Ilvl"); err != nil { + return err + } + } + if m.NumId != nil { + if err := m.NumId.ValidateWithPath(path + "/NumId"); err != nil { + return err + } + } + if m.NumberingChange != nil { + if err := m.NumberingChange.ValidateWithPath(path + "/NumberingChange"); err != nil { + return err + } + } + if m.Ins != nil { + if err := m.Ins.ValidateWithPath(path + "/Ins"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_NumRestart.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_NumRestart.go new file mode 100644 index 00000000..834337d0 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_NumRestart.go @@ -0,0 +1,75 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_NumRestart struct { + // Automatic Numbering Restart Value + ValAttr ST_RestartNumber +} + +func NewCT_NumRestart() *CT_NumRestart { + ret := &CT_NumRestart{} + ret.ValAttr = ST_RestartNumber(1) + return ret +} + +func (m *CT_NumRestart) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_NumRestart) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_RestartNumber(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_NumRestart: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_NumRestart and its children +func (m *CT_NumRestart) Validate() error { + return m.ValidateWithPath("CT_NumRestart") +} + +// ValidateWithPath validates the CT_NumRestart and its children, prefixing error messages with path +func (m *CT_NumRestart) ValidateWithPath(path string) error { + if m.ValAttr == ST_RestartNumberUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Numbering.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Numbering.go new file mode 100644 index 00000000..e5c09f4c --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Numbering.go @@ -0,0 +1,139 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_Numbering struct { + // Picture Numbering Symbol Definition + NumPicBullet []*CT_NumPicBullet + // Abstract Numbering Definition + AbstractNum []*CT_AbstractNum + // Numbering Definition Instance + Num []*CT_Num + // Last Reviewed Abstract Numbering Definition + NumIdMacAtCleanup *CT_DecimalNumber +} + +func NewCT_Numbering() *CT_Numbering { + ret := &CT_Numbering{} + return ret +} + +func (m *CT_Numbering) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.NumPicBullet != nil { + senumPicBullet := xml.StartElement{Name: xml.Name{Local: "w:numPicBullet"}} + for _, c := range m.NumPicBullet { + e.EncodeElement(c, senumPicBullet) + } + } + if m.AbstractNum != nil { + seabstractNum := xml.StartElement{Name: xml.Name{Local: "w:abstractNum"}} + for _, c := range m.AbstractNum { + e.EncodeElement(c, seabstractNum) + } + } + if m.Num != nil { + senum := xml.StartElement{Name: xml.Name{Local: "w:num"}} + for _, c := range m.Num { + e.EncodeElement(c, senum) + } + } + if m.NumIdMacAtCleanup != nil { + senumIdMacAtCleanup := xml.StartElement{Name: xml.Name{Local: "w:numIdMacAtCleanup"}} + e.EncodeElement(m.NumIdMacAtCleanup, senumIdMacAtCleanup) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Numbering) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_Numbering: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "numPicBullet"}: + tmp := NewCT_NumPicBullet() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.NumPicBullet = append(m.NumPicBullet, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "abstractNum"}: + tmp := NewCT_AbstractNum() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.AbstractNum = append(m.AbstractNum, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "num"}: + tmp := NewCT_Num() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Num = append(m.Num, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "numIdMacAtCleanup"}: + m.NumIdMacAtCleanup = NewCT_DecimalNumber() + if err := d.DecodeElement(m.NumIdMacAtCleanup, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_Numbering %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Numbering + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Numbering and its children +func (m *CT_Numbering) Validate() error { + return m.ValidateWithPath("CT_Numbering") +} + +// ValidateWithPath validates the CT_Numbering and its children, prefixing error messages with path +func (m *CT_Numbering) ValidateWithPath(path string) error { + for i, v := range m.NumPicBullet { + if err := v.ValidateWithPath(fmt.Sprintf("%s/NumPicBullet[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.AbstractNum { + if err := v.ValidateWithPath(fmt.Sprintf("%s/AbstractNum[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.Num { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Num[%d]", path, i)); err != nil { + return err + } + } + if m.NumIdMacAtCleanup != nil { + if err := m.NumIdMacAtCleanup.ValidateWithPath(path + "/NumIdMacAtCleanup"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Object.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Object.go new file mode 100644 index 00000000..fecc535e --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Object.go @@ -0,0 +1,151 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_Object struct { + // Original Image Width + DxaOrigAttr *sharedTypes.ST_TwipsMeasure + // Original Image Height + DyaOrigAttr *sharedTypes.ST_TwipsMeasure + Drawing *CT_Drawing + Choice *CT_ObjectChoice +} + +func NewCT_Object() *CT_Object { + ret := &CT_Object{} + return ret +} + +func (m *CT_Object) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.DxaOrigAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:dxaOrig"}, + Value: fmt.Sprintf("%v", *m.DxaOrigAttr)}) + } + if m.DyaOrigAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:dyaOrig"}, + Value: fmt.Sprintf("%v", *m.DyaOrigAttr)}) + } + e.EncodeToken(start) + if m.Drawing != nil { + sedrawing := xml.StartElement{Name: xml.Name{Local: "w:drawing"}} + e.EncodeElement(m.Drawing, sedrawing) + } + if m.Choice != nil { + m.Choice.MarshalXML(e, xml.StartElement{}) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Object) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "dxaOrig" { + parsed, err := ParseUnionST_TwipsMeasure(attr.Value) + if err != nil { + return err + } + m.DxaOrigAttr = &parsed + continue + } + if attr.Name.Local == "dyaOrig" { + parsed, err := ParseUnionST_TwipsMeasure(attr.Value) + if err != nil { + return err + } + m.DyaOrigAttr = &parsed + continue + } + } +lCT_Object: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "drawing"}: + m.Drawing = NewCT_Drawing() + if err := d.DecodeElement(m.Drawing, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "control"}: + m.Choice = NewCT_ObjectChoice() + if err := d.DecodeElement(&m.Choice.Control, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "objectLink"}: + m.Choice = NewCT_ObjectChoice() + if err := d.DecodeElement(&m.Choice.ObjectLink, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "objectEmbed"}: + m.Choice = NewCT_ObjectChoice() + if err := d.DecodeElement(&m.Choice.ObjectEmbed, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "movie"}: + m.Choice = NewCT_ObjectChoice() + if err := d.DecodeElement(&m.Choice.Movie, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_Object %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Object + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Object and its children +func (m *CT_Object) Validate() error { + return m.ValidateWithPath("CT_Object") +} + +// ValidateWithPath validates the CT_Object and its children, prefixing error messages with path +func (m *CT_Object) ValidateWithPath(path string) error { + if m.DxaOrigAttr != nil { + if err := m.DxaOrigAttr.ValidateWithPath(path + "/DxaOrigAttr"); err != nil { + return err + } + } + if m.DyaOrigAttr != nil { + if err := m.DyaOrigAttr.ValidateWithPath(path + "/DyaOrigAttr"); err != nil { + return err + } + } + if m.Drawing != nil { + if err := m.Drawing.ValidateWithPath(path + "/Drawing"); err != nil { + return err + } + } + if m.Choice != nil { + if err := m.Choice.ValidateWithPath(path + "/Choice"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_ObjectChoice.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_ObjectChoice.go new file mode 100644 index 00000000..215943d8 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_ObjectChoice.go @@ -0,0 +1,123 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_ObjectChoice struct { + Control *CT_Control + ObjectLink *CT_ObjectLink + ObjectEmbed *CT_ObjectEmbed + Movie *CT_Rel +} + +func NewCT_ObjectChoice() *CT_ObjectChoice { + ret := &CT_ObjectChoice{} + return ret +} + +func (m *CT_ObjectChoice) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.Control != nil { + secontrol := xml.StartElement{Name: xml.Name{Local: "w:control"}} + e.EncodeElement(m.Control, secontrol) + } + if m.ObjectLink != nil { + seobjectLink := xml.StartElement{Name: xml.Name{Local: "w:objectLink"}} + e.EncodeElement(m.ObjectLink, seobjectLink) + } + if m.ObjectEmbed != nil { + seobjectEmbed := xml.StartElement{Name: xml.Name{Local: "w:objectEmbed"}} + e.EncodeElement(m.ObjectEmbed, seobjectEmbed) + } + if m.Movie != nil { + semovie := xml.StartElement{Name: xml.Name{Local: "w:movie"}} + e.EncodeElement(m.Movie, semovie) + } + return nil +} + +func (m *CT_ObjectChoice) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_ObjectChoice: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "control"}: + m.Control = NewCT_Control() + if err := d.DecodeElement(m.Control, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "objectLink"}: + m.ObjectLink = NewCT_ObjectLink() + if err := d.DecodeElement(m.ObjectLink, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "objectEmbed"}: + m.ObjectEmbed = NewCT_ObjectEmbed() + if err := d.DecodeElement(m.ObjectEmbed, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "movie"}: + m.Movie = NewCT_Rel() + if err := d.DecodeElement(m.Movie, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_ObjectChoice %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_ObjectChoice + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_ObjectChoice and its children +func (m *CT_ObjectChoice) Validate() error { + return m.ValidateWithPath("CT_ObjectChoice") +} + +// ValidateWithPath validates the CT_ObjectChoice and its children, prefixing error messages with path +func (m *CT_ObjectChoice) ValidateWithPath(path string) error { + if m.Control != nil { + if err := m.Control.ValidateWithPath(path + "/Control"); err != nil { + return err + } + } + if m.ObjectLink != nil { + if err := m.ObjectLink.ValidateWithPath(path + "/ObjectLink"); err != nil { + return err + } + } + if m.ObjectEmbed != nil { + if err := m.ObjectEmbed.ValidateWithPath(path + "/ObjectEmbed"); err != nil { + return err + } + } + if m.Movie != nil { + if err := m.Movie.ValidateWithPath(path + "/Movie"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_ObjectEmbed.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_ObjectEmbed.go new file mode 100644 index 00000000..2cfe84c9 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_ObjectEmbed.go @@ -0,0 +1,125 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_ObjectEmbed struct { + // Object Representation + DrawAspectAttr ST_ObjectDrawAspect + IdAttr string + // Object Application + ProgIdAttr *string + // Object Shape + ShapeIdAttr *string + // Field Switches + FieldCodesAttr *string +} + +func NewCT_ObjectEmbed() *CT_ObjectEmbed { + ret := &CT_ObjectEmbed{} + return ret +} + +func (m *CT_ObjectEmbed) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.DrawAspectAttr != ST_ObjectDrawAspectUnset { + attr, err := m.DrawAspectAttr.MarshalXMLAttr(xml.Name{Local: "w:drawAspect"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "r:id"}, + Value: fmt.Sprintf("%v", m.IdAttr)}) + if m.ProgIdAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:progId"}, + Value: fmt.Sprintf("%v", *m.ProgIdAttr)}) + } + if m.ShapeIdAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:shapeId"}, + Value: fmt.Sprintf("%v", *m.ShapeIdAttr)}) + } + if m.FieldCodesAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:fieldCodes"}, + Value: fmt.Sprintf("%v", *m.FieldCodesAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_ObjectEmbed) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Space == "http://schemas.openxmlformats.org/officeDocument/2006/relationships" && attr.Name.Local == "id" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.IdAttr = parsed + continue + } + if attr.Name.Local == "drawAspect" { + m.DrawAspectAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "progId" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ProgIdAttr = &parsed + continue + } + if attr.Name.Local == "shapeId" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ShapeIdAttr = &parsed + continue + } + if attr.Name.Local == "fieldCodes" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.FieldCodesAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_ObjectEmbed: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_ObjectEmbed and its children +func (m *CT_ObjectEmbed) Validate() error { + return m.ValidateWithPath("CT_ObjectEmbed") +} + +// ValidateWithPath validates the CT_ObjectEmbed and its children, prefixing error messages with path +func (m *CT_ObjectEmbed) ValidateWithPath(path string) error { + if err := m.DrawAspectAttr.ValidateWithPath(path + "/DrawAspectAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_ObjectLink.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_ObjectLink.go new file mode 100644 index 00000000..fb92d4d5 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_ObjectLink.go @@ -0,0 +1,163 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_ObjectLink struct { + UpdateModeAttr ST_ObjectUpdateMode + LockedFieldAttr *sharedTypes.ST_OnOff + // Object Representation + DrawAspectAttr ST_ObjectDrawAspect + IdAttr string + // Object Application + ProgIdAttr *string + // Object Shape + ShapeIdAttr *string + // Field Switches + FieldCodesAttr *string +} + +func NewCT_ObjectLink() *CT_ObjectLink { + ret := &CT_ObjectLink{} + ret.UpdateModeAttr = ST_ObjectUpdateMode(1) + return ret +} + +func (m *CT_ObjectLink) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.UpdateModeAttr.MarshalXMLAttr(xml.Name{Local: "w:updateMode"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + if m.LockedFieldAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:lockedField"}, + Value: fmt.Sprintf("%v", *m.LockedFieldAttr)}) + } + if m.DrawAspectAttr != ST_ObjectDrawAspectUnset { + attr, err := m.DrawAspectAttr.MarshalXMLAttr(xml.Name{Local: "w:drawAspect"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "r:id"}, + Value: fmt.Sprintf("%v", m.IdAttr)}) + if m.ProgIdAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:progId"}, + Value: fmt.Sprintf("%v", *m.ProgIdAttr)}) + } + if m.ShapeIdAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:shapeId"}, + Value: fmt.Sprintf("%v", *m.ShapeIdAttr)}) + } + if m.FieldCodesAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:fieldCodes"}, + Value: fmt.Sprintf("%v", *m.FieldCodesAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_ObjectLink) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.UpdateModeAttr = ST_ObjectUpdateMode(1) + for _, attr := range start.Attr { + if attr.Name.Space == "http://schemas.openxmlformats.org/officeDocument/2006/relationships" && attr.Name.Local == "id" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.IdAttr = parsed + continue + } + if attr.Name.Local == "updateMode" { + m.UpdateModeAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "lockedField" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.LockedFieldAttr = &parsed + continue + } + if attr.Name.Local == "drawAspect" { + m.DrawAspectAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "progId" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ProgIdAttr = &parsed + continue + } + if attr.Name.Local == "shapeId" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ShapeIdAttr = &parsed + continue + } + if attr.Name.Local == "fieldCodes" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.FieldCodesAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_ObjectLink: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_ObjectLink and its children +func (m *CT_ObjectLink) Validate() error { + return m.ValidateWithPath("CT_ObjectLink") +} + +// ValidateWithPath validates the CT_ObjectLink and its children, prefixing error messages with path +func (m *CT_ObjectLink) ValidateWithPath(path string) error { + if m.UpdateModeAttr == ST_ObjectUpdateModeUnset { + return fmt.Errorf("%s/UpdateModeAttr is a mandatory field", path) + } + if err := m.UpdateModeAttr.ValidateWithPath(path + "/UpdateModeAttr"); err != nil { + return err + } + if m.LockedFieldAttr != nil { + if err := m.LockedFieldAttr.ValidateWithPath(path + "/LockedFieldAttr"); err != nil { + return err + } + } + if err := m.DrawAspectAttr.ValidateWithPath(path + "/DrawAspectAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Odso.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Odso.go new file mode 100644 index 00000000..8e9cbb99 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Odso.go @@ -0,0 +1,200 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_Odso struct { + // UDL Connection String + Udl *CT_String + // Data Source Table Name + Table *CT_String + // ODSO Data Source File Path + Src *CT_Rel + // Column Delimiter for Data Source + ColDelim *CT_DecimalNumber + // ODSO Data Source Type + Type *CT_MailMergeSourceType + // First Row of Data Source Contains Column Names + FHdr *CT_OnOff + // External Data Source to Merge Field Mapping + FieldMapData []*CT_OdsoFieldMapData + // Reference to Inclusion/Exclusion Data for Data Source + RecipientData []*CT_Rel +} + +func NewCT_Odso() *CT_Odso { + ret := &CT_Odso{} + return ret +} + +func (m *CT_Odso) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Udl != nil { + seudl := xml.StartElement{Name: xml.Name{Local: "w:udl"}} + e.EncodeElement(m.Udl, seudl) + } + if m.Table != nil { + setable := xml.StartElement{Name: xml.Name{Local: "w:table"}} + e.EncodeElement(m.Table, setable) + } + if m.Src != nil { + sesrc := xml.StartElement{Name: xml.Name{Local: "w:src"}} + e.EncodeElement(m.Src, sesrc) + } + if m.ColDelim != nil { + secolDelim := xml.StartElement{Name: xml.Name{Local: "w:colDelim"}} + e.EncodeElement(m.ColDelim, secolDelim) + } + if m.Type != nil { + setype := xml.StartElement{Name: xml.Name{Local: "w:type"}} + e.EncodeElement(m.Type, setype) + } + if m.FHdr != nil { + sefHdr := xml.StartElement{Name: xml.Name{Local: "w:fHdr"}} + e.EncodeElement(m.FHdr, sefHdr) + } + if m.FieldMapData != nil { + sefieldMapData := xml.StartElement{Name: xml.Name{Local: "w:fieldMapData"}} + for _, c := range m.FieldMapData { + e.EncodeElement(c, sefieldMapData) + } + } + if m.RecipientData != nil { + serecipientData := xml.StartElement{Name: xml.Name{Local: "w:recipientData"}} + for _, c := range m.RecipientData { + e.EncodeElement(c, serecipientData) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Odso) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_Odso: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "udl"}: + m.Udl = NewCT_String() + if err := d.DecodeElement(m.Udl, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "table"}: + m.Table = NewCT_String() + if err := d.DecodeElement(m.Table, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "src"}: + m.Src = NewCT_Rel() + if err := d.DecodeElement(m.Src, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "colDelim"}: + m.ColDelim = NewCT_DecimalNumber() + if err := d.DecodeElement(m.ColDelim, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "type"}: + m.Type = NewCT_MailMergeSourceType() + if err := d.DecodeElement(m.Type, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "fHdr"}: + m.FHdr = NewCT_OnOff() + if err := d.DecodeElement(m.FHdr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "fieldMapData"}: + tmp := NewCT_OdsoFieldMapData() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.FieldMapData = append(m.FieldMapData, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "recipientData"}: + tmp := NewCT_Rel() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.RecipientData = append(m.RecipientData, tmp) + default: + gooxml.Log("skipping unsupported element on CT_Odso %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Odso + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Odso and its children +func (m *CT_Odso) Validate() error { + return m.ValidateWithPath("CT_Odso") +} + +// ValidateWithPath validates the CT_Odso and its children, prefixing error messages with path +func (m *CT_Odso) ValidateWithPath(path string) error { + if m.Udl != nil { + if err := m.Udl.ValidateWithPath(path + "/Udl"); err != nil { + return err + } + } + if m.Table != nil { + if err := m.Table.ValidateWithPath(path + "/Table"); err != nil { + return err + } + } + if m.Src != nil { + if err := m.Src.ValidateWithPath(path + "/Src"); err != nil { + return err + } + } + if m.ColDelim != nil { + if err := m.ColDelim.ValidateWithPath(path + "/ColDelim"); err != nil { + return err + } + } + if m.Type != nil { + if err := m.Type.ValidateWithPath(path + "/Type"); err != nil { + return err + } + } + if m.FHdr != nil { + if err := m.FHdr.ValidateWithPath(path + "/FHdr"); err != nil { + return err + } + } + for i, v := range m.FieldMapData { + if err := v.ValidateWithPath(fmt.Sprintf("%s/FieldMapData[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.RecipientData { + if err := v.ValidateWithPath(fmt.Sprintf("%s/RecipientData[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_OdsoFieldMapData.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_OdsoFieldMapData.go new file mode 100644 index 00000000..44f55432 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_OdsoFieldMapData.go @@ -0,0 +1,161 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_OdsoFieldMapData struct { + // Merge Field Mapping + Type *CT_MailMergeOdsoFMDFieldType + // Data Source Name for Column + Name *CT_String + // Predefined Merge Field Name + MappedName *CT_String + // Index of Column Being Mapped + Column *CT_DecimalNumber + // Merge Field Name Language ID + Lid *CT_Lang + // Use Country-Based Address Field Ordering + DynamicAddress *CT_OnOff +} + +func NewCT_OdsoFieldMapData() *CT_OdsoFieldMapData { + ret := &CT_OdsoFieldMapData{} + return ret +} + +func (m *CT_OdsoFieldMapData) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Type != nil { + setype := xml.StartElement{Name: xml.Name{Local: "w:type"}} + e.EncodeElement(m.Type, setype) + } + if m.Name != nil { + sename := xml.StartElement{Name: xml.Name{Local: "w:name"}} + e.EncodeElement(m.Name, sename) + } + if m.MappedName != nil { + semappedName := xml.StartElement{Name: xml.Name{Local: "w:mappedName"}} + e.EncodeElement(m.MappedName, semappedName) + } + if m.Column != nil { + secolumn := xml.StartElement{Name: xml.Name{Local: "w:column"}} + e.EncodeElement(m.Column, secolumn) + } + if m.Lid != nil { + selid := xml.StartElement{Name: xml.Name{Local: "w:lid"}} + e.EncodeElement(m.Lid, selid) + } + if m.DynamicAddress != nil { + sedynamicAddress := xml.StartElement{Name: xml.Name{Local: "w:dynamicAddress"}} + e.EncodeElement(m.DynamicAddress, sedynamicAddress) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_OdsoFieldMapData) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_OdsoFieldMapData: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "type"}: + m.Type = NewCT_MailMergeOdsoFMDFieldType() + if err := d.DecodeElement(m.Type, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "name"}: + m.Name = NewCT_String() + if err := d.DecodeElement(m.Name, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "mappedName"}: + m.MappedName = NewCT_String() + if err := d.DecodeElement(m.MappedName, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "column"}: + m.Column = NewCT_DecimalNumber() + if err := d.DecodeElement(m.Column, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "lid"}: + m.Lid = NewCT_Lang() + if err := d.DecodeElement(m.Lid, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "dynamicAddress"}: + m.DynamicAddress = NewCT_OnOff() + if err := d.DecodeElement(m.DynamicAddress, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_OdsoFieldMapData %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_OdsoFieldMapData + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_OdsoFieldMapData and its children +func (m *CT_OdsoFieldMapData) Validate() error { + return m.ValidateWithPath("CT_OdsoFieldMapData") +} + +// ValidateWithPath validates the CT_OdsoFieldMapData and its children, prefixing error messages with path +func (m *CT_OdsoFieldMapData) ValidateWithPath(path string) error { + if m.Type != nil { + if err := m.Type.ValidateWithPath(path + "/Type"); err != nil { + return err + } + } + if m.Name != nil { + if err := m.Name.ValidateWithPath(path + "/Name"); err != nil { + return err + } + } + if m.MappedName != nil { + if err := m.MappedName.ValidateWithPath(path + "/MappedName"); err != nil { + return err + } + } + if m.Column != nil { + if err := m.Column.ValidateWithPath(path + "/Column"); err != nil { + return err + } + } + if m.Lid != nil { + if err := m.Lid.ValidateWithPath(path + "/Lid"); err != nil { + return err + } + } + if m.DynamicAddress != nil { + if err := m.DynamicAddress.ValidateWithPath(path + "/DynamicAddress"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_OnOff.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_OnOff.go new file mode 100644 index 00000000..8beb7e9f --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_OnOff.go @@ -0,0 +1,77 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_OnOff struct { + // On/Off Value + ValAttr *sharedTypes.ST_OnOff +} + +func NewCT_OnOff() *CT_OnOff { + ret := &CT_OnOff{} + return ret +} + +func (m *CT_OnOff) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.ValAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:val"}, + Value: fmt.Sprintf("%v", *m.ValAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_OnOff) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.ValAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_OnOff: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_OnOff and its children +func (m *CT_OnOff) Validate() error { + return m.ValidateWithPath("CT_OnOff") +} + +// ValidateWithPath validates the CT_OnOff and its children, prefixing error messages with path +func (m *CT_OnOff) ValidateWithPath(path string) error { + if m.ValAttr != nil { + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_OptimizeForBrowser.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_OptimizeForBrowser.go new file mode 100644 index 00000000..e02ceb16 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_OptimizeForBrowser.go @@ -0,0 +1,90 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_OptimizeForBrowser struct { + TargetAttr *string + // On/Off Value + ValAttr *sharedTypes.ST_OnOff +} + +func NewCT_OptimizeForBrowser() *CT_OptimizeForBrowser { + ret := &CT_OptimizeForBrowser{} + return ret +} + +func (m *CT_OptimizeForBrowser) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.TargetAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:target"}, + Value: fmt.Sprintf("%v", *m.TargetAttr)}) + } + if m.ValAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:val"}, + Value: fmt.Sprintf("%v", *m.ValAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_OptimizeForBrowser) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "target" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.TargetAttr = &parsed + continue + } + if attr.Name.Local == "val" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.ValAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_OptimizeForBrowser: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_OptimizeForBrowser and its children +func (m *CT_OptimizeForBrowser) Validate() error { + return m.ValidateWithPath("CT_OptimizeForBrowser") +} + +// ValidateWithPath validates the CT_OptimizeForBrowser and its children, prefixing error messages with path +func (m *CT_OptimizeForBrowser) ValidateWithPath(path string) error { + if m.ValAttr != nil { + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_P.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_P.go new file mode 100644 index 00000000..a0046f49 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_P.go @@ -0,0 +1,553 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/math" +) + +type CT_P struct { + // Revision Identifier for Paragraph Glyph Formatting + RsidRPrAttr *string + // Revision Identifier for Paragraph + RsidRAttr *string + // Revision Identifier for Paragraph Deletion + RsidDelAttr *string + // Revision Identifier for Paragraph Properties + RsidPAttr *string + // Default Revision Identifier for Runs + RsidRDefaultAttr *string + // Paragraph Properties + PPr *CT_PPr + EG_PContent []*EG_PContent +} + +func NewCT_P() *CT_P { + ret := &CT_P{} + return ret +} + +func (m *CT_P) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.RsidRPrAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:rsidRPr"}, + Value: fmt.Sprintf("%v", *m.RsidRPrAttr)}) + } + if m.RsidRAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:rsidR"}, + Value: fmt.Sprintf("%v", *m.RsidRAttr)}) + } + if m.RsidDelAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:rsidDel"}, + Value: fmt.Sprintf("%v", *m.RsidDelAttr)}) + } + if m.RsidPAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:rsidP"}, + Value: fmt.Sprintf("%v", *m.RsidPAttr)}) + } + if m.RsidRDefaultAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:rsidRDefault"}, + Value: fmt.Sprintf("%v", *m.RsidRDefaultAttr)}) + } + e.EncodeToken(start) + if m.PPr != nil { + sepPr := xml.StartElement{Name: xml.Name{Local: "w:pPr"}} + e.EncodeElement(m.PPr, sepPr) + } + if m.EG_PContent != nil { + for _, c := range m.EG_PContent { + c.MarshalXML(e, xml.StartElement{}) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_P) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "rsidR" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.RsidRAttr = &parsed + continue + } + if attr.Name.Local == "rsidDel" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.RsidDelAttr = &parsed + continue + } + if attr.Name.Local == "rsidP" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.RsidPAttr = &parsed + continue + } + if attr.Name.Local == "rsidRDefault" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.RsidRDefaultAttr = &parsed + continue + } + if attr.Name.Local == "rsidRPr" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.RsidRPrAttr = &parsed + continue + } + } +lCT_P: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pPr"}: + m.PPr = NewCT_PPr() + if err := d.DecodeElement(m.PPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "fldSimple"}: + tmppcontent := NewEG_PContent() + tmp := NewCT_SimpleField() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + tmppcontent.FldSimple = append(tmppcontent.FldSimple, tmp) + m.EG_PContent = append(m.EG_PContent, tmppcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "hyperlink"}: + tmppcontent := NewEG_PContent() + tmppcontent.Hyperlink = NewCT_Hyperlink() + if err := d.DecodeElement(tmppcontent.Hyperlink, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "subDoc"}: + tmppcontent := NewEG_PContent() + tmppcontent.SubDoc = NewCT_Rel() + if err := d.DecodeElement(tmppcontent.SubDoc, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXml"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.CustomXml = NewCT_CustomXmlRun() + if err := d.DecodeElement(tmpcontentruncontent.CustomXml, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "smartTag"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.SmartTag = NewCT_SmartTagRun() + if err := d.DecodeElement(tmpcontentruncontent.SmartTag, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdt"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.Sdt = NewCT_SdtRun() + if err := d.DecodeElement(tmpcontentruncontent.Sdt, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "dir"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.Dir = NewCT_DirContentRun() + if err := d.DecodeElement(tmpcontentruncontent.Dir, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bdo"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.Bdo = NewCT_BdoContentRun() + if err := d.DecodeElement(tmpcontentruncontent.Bdo, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "r"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.R = NewCT_R() + if err := d.DecodeElement(tmpcontentruncontent.R, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "proofErr"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.ProofErr = NewCT_ProofErr() + if err := d.DecodeElement(tmprunlevelelts.ProofErr, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permStart"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermStart = NewCT_PermStart() + if err := d.DecodeElement(tmprunlevelelts.PermStart, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permEnd"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermEnd = NewCT_Perm() + if err := d.DecodeElement(tmprunlevelelts.PermEnd, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Ins = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Ins, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Del = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Del, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFrom"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveFrom = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveFrom, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveTo"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveTo = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveTo, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkStart"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkStart = NewCT_Bookmark() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkStart, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkEnd"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkEnd, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeStart"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeStart, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeEnd"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeStart"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeStart, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeEnd"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeEnd, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeStart"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeStart = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeStart, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeEnd"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeEnd, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeStart"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeStart, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeEnd"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeEnd, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeStart"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeStart, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeEnd"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeEnd, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeStart"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeStart, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeEnd"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeStart"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeStart, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeEnd"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeEnd, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMathPara"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMathPara = math.NewOMathPara() + if err := d.DecodeElement(tmpmathcontent.OMathPara, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMath"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMath = math.NewOMath() + if err := d.DecodeElement(tmpmathcontent.OMath, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + default: + gooxml.Log("skipping unsupported element on CT_P %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_P + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_P and its children +func (m *CT_P) Validate() error { + return m.ValidateWithPath("CT_P") +} + +// ValidateWithPath validates the CT_P and its children, prefixing error messages with path +func (m *CT_P) ValidateWithPath(path string) error { + if m.PPr != nil { + if err := m.PPr.ValidateWithPath(path + "/PPr"); err != nil { + return err + } + } + for i, v := range m.EG_PContent { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_PContent[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PBdr.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PBdr.go new file mode 100644 index 00000000..899247fc --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PBdr.go @@ -0,0 +1,161 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_PBdr struct { + // Paragraph Border Above Identical Paragraphs + Top *CT_Border + // Left Paragraph Border + Left *CT_Border + // Paragraph Border Below Identical Paragraphs + Bottom *CT_Border + // Right Paragraph Border + Right *CT_Border + // Paragraph Border Between Identical Paragraphs + Between *CT_Border + // Paragraph Border Between Facing Pages + Bar *CT_Border +} + +func NewCT_PBdr() *CT_PBdr { + ret := &CT_PBdr{} + return ret +} + +func (m *CT_PBdr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Top != nil { + setop := xml.StartElement{Name: xml.Name{Local: "w:top"}} + e.EncodeElement(m.Top, setop) + } + if m.Left != nil { + seleft := xml.StartElement{Name: xml.Name{Local: "w:left"}} + e.EncodeElement(m.Left, seleft) + } + if m.Bottom != nil { + sebottom := xml.StartElement{Name: xml.Name{Local: "w:bottom"}} + e.EncodeElement(m.Bottom, sebottom) + } + if m.Right != nil { + seright := xml.StartElement{Name: xml.Name{Local: "w:right"}} + e.EncodeElement(m.Right, seright) + } + if m.Between != nil { + sebetween := xml.StartElement{Name: xml.Name{Local: "w:between"}} + e.EncodeElement(m.Between, sebetween) + } + if m.Bar != nil { + sebar := xml.StartElement{Name: xml.Name{Local: "w:bar"}} + e.EncodeElement(m.Bar, sebar) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_PBdr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_PBdr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "top"}: + m.Top = NewCT_Border() + if err := d.DecodeElement(m.Top, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "left"}: + m.Left = NewCT_Border() + if err := d.DecodeElement(m.Left, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bottom"}: + m.Bottom = NewCT_Border() + if err := d.DecodeElement(m.Bottom, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "right"}: + m.Right = NewCT_Border() + if err := d.DecodeElement(m.Right, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "between"}: + m.Between = NewCT_Border() + if err := d.DecodeElement(m.Between, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bar"}: + m.Bar = NewCT_Border() + if err := d.DecodeElement(m.Bar, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_PBdr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_PBdr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_PBdr and its children +func (m *CT_PBdr) Validate() error { + return m.ValidateWithPath("CT_PBdr") +} + +// ValidateWithPath validates the CT_PBdr and its children, prefixing error messages with path +func (m *CT_PBdr) ValidateWithPath(path string) error { + if m.Top != nil { + if err := m.Top.ValidateWithPath(path + "/Top"); err != nil { + return err + } + } + if m.Left != nil { + if err := m.Left.ValidateWithPath(path + "/Left"); err != nil { + return err + } + } + if m.Bottom != nil { + if err := m.Bottom.ValidateWithPath(path + "/Bottom"); err != nil { + return err + } + } + if m.Right != nil { + if err := m.Right.ValidateWithPath(path + "/Right"); err != nil { + return err + } + } + if m.Between != nil { + if err := m.Between.ValidateWithPath(path + "/Between"); err != nil { + return err + } + } + if m.Bar != nil { + if err := m.Bar.ValidateWithPath(path + "/Bar"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PPr.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PPr.go new file mode 100644 index 00000000..2103c3ce --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PPr.go @@ -0,0 +1,638 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_PPr struct { + // Referenced Paragraph Style + PStyle *CT_String + // Keep Paragraph With Next Paragraph + KeepNext *CT_OnOff + // Keep All Lines On One Page + KeepLines *CT_OnOff + // Start Paragraph on Next Page + PageBreakBefore *CT_OnOff + // Text Frame Properties + FramePr *CT_FramePr + // Allow First/Last Line to Display on a Separate Page + WidowControl *CT_OnOff + // Numbering Definition Instance Reference + NumPr *CT_NumPr + // Suppress Line Numbers for Paragraph + SuppressLineNumbers *CT_OnOff + // Paragraph Borders + PBdr *CT_PBdr + // Paragraph Shading + Shd *CT_Shd + // Set of Custom Tab Stops + Tabs *CT_Tabs + // Suppress Hyphenation for Paragraph + SuppressAutoHyphens *CT_OnOff + // Use East Asian Typography Rules for First and Last Character per Line + Kinsoku *CT_OnOff + // Allow Line Breaking At Character Level + WordWrap *CT_OnOff + // Allow Punctuation to Extend Past Text Extents + OverflowPunct *CT_OnOff + // Compress Punctuation at Start of a Line + TopLinePunct *CT_OnOff + // Automatically Adjust Spacing of Latin and East Asian Text + AutoSpaceDE *CT_OnOff + // Automatically Adjust Spacing of East Asian Text and Numbers + AutoSpaceDN *CT_OnOff + // Right to Left Paragraph Layout + Bidi *CT_OnOff + // Automatically Adjust Right Indent When Using Document Grid + AdjustRightInd *CT_OnOff + // Use Document Grid Settings for Inter-Line Paragraph Spacing + SnapToGrid *CT_OnOff + // Spacing Between Lines and Above/Below Paragraph + Spacing *CT_Spacing + // Paragraph Indentation + Ind *CT_Ind + // Ignore Spacing Above and Below When Using Identical Styles + ContextualSpacing *CT_OnOff + // Use Left/Right Indents as Inside/Outside Indents + MirrorIndents *CT_OnOff + // Prevent Text Frames From Overlapping + SuppressOverlap *CT_OnOff + // Paragraph Alignment + Jc *CT_Jc + // Paragraph Text Flow Direction + TextDirection *CT_TextDirection + // Vertical Character Alignment on Line + TextAlignment *CT_TextAlignment + // Allow Surrounding Paragraphs to Tight Wrap to Text Box Contents + TextboxTightWrap *CT_TextboxTightWrap + // Associated Outline Level + OutlineLvl *CT_DecimalNumber + // Associated HTML div ID + DivId *CT_DecimalNumber + // Paragraph Conditional Formatting + CnfStyle *CT_Cnf + RPr *CT_ParaRPr + SectPr *CT_SectPr + PPrChange *CT_PPrChange +} + +func NewCT_PPr() *CT_PPr { + ret := &CT_PPr{} + return ret +} + +func (m *CT_PPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.PStyle != nil { + sepStyle := xml.StartElement{Name: xml.Name{Local: "w:pStyle"}} + e.EncodeElement(m.PStyle, sepStyle) + } + if m.KeepNext != nil { + sekeepNext := xml.StartElement{Name: xml.Name{Local: "w:keepNext"}} + e.EncodeElement(m.KeepNext, sekeepNext) + } + if m.KeepLines != nil { + sekeepLines := xml.StartElement{Name: xml.Name{Local: "w:keepLines"}} + e.EncodeElement(m.KeepLines, sekeepLines) + } + if m.PageBreakBefore != nil { + sepageBreakBefore := xml.StartElement{Name: xml.Name{Local: "w:pageBreakBefore"}} + e.EncodeElement(m.PageBreakBefore, sepageBreakBefore) + } + if m.FramePr != nil { + seframePr := xml.StartElement{Name: xml.Name{Local: "w:framePr"}} + e.EncodeElement(m.FramePr, seframePr) + } + if m.WidowControl != nil { + sewidowControl := xml.StartElement{Name: xml.Name{Local: "w:widowControl"}} + e.EncodeElement(m.WidowControl, sewidowControl) + } + if m.NumPr != nil { + senumPr := xml.StartElement{Name: xml.Name{Local: "w:numPr"}} + e.EncodeElement(m.NumPr, senumPr) + } + if m.SuppressLineNumbers != nil { + sesuppressLineNumbers := xml.StartElement{Name: xml.Name{Local: "w:suppressLineNumbers"}} + e.EncodeElement(m.SuppressLineNumbers, sesuppressLineNumbers) + } + if m.PBdr != nil { + sepBdr := xml.StartElement{Name: xml.Name{Local: "w:pBdr"}} + e.EncodeElement(m.PBdr, sepBdr) + } + if m.Shd != nil { + seshd := xml.StartElement{Name: xml.Name{Local: "w:shd"}} + e.EncodeElement(m.Shd, seshd) + } + if m.Tabs != nil { + setabs := xml.StartElement{Name: xml.Name{Local: "w:tabs"}} + e.EncodeElement(m.Tabs, setabs) + } + if m.SuppressAutoHyphens != nil { + sesuppressAutoHyphens := xml.StartElement{Name: xml.Name{Local: "w:suppressAutoHyphens"}} + e.EncodeElement(m.SuppressAutoHyphens, sesuppressAutoHyphens) + } + if m.Kinsoku != nil { + sekinsoku := xml.StartElement{Name: xml.Name{Local: "w:kinsoku"}} + e.EncodeElement(m.Kinsoku, sekinsoku) + } + if m.WordWrap != nil { + sewordWrap := xml.StartElement{Name: xml.Name{Local: "w:wordWrap"}} + e.EncodeElement(m.WordWrap, sewordWrap) + } + if m.OverflowPunct != nil { + seoverflowPunct := xml.StartElement{Name: xml.Name{Local: "w:overflowPunct"}} + e.EncodeElement(m.OverflowPunct, seoverflowPunct) + } + if m.TopLinePunct != nil { + setopLinePunct := xml.StartElement{Name: xml.Name{Local: "w:topLinePunct"}} + e.EncodeElement(m.TopLinePunct, setopLinePunct) + } + if m.AutoSpaceDE != nil { + seautoSpaceDE := xml.StartElement{Name: xml.Name{Local: "w:autoSpaceDE"}} + e.EncodeElement(m.AutoSpaceDE, seautoSpaceDE) + } + if m.AutoSpaceDN != nil { + seautoSpaceDN := xml.StartElement{Name: xml.Name{Local: "w:autoSpaceDN"}} + e.EncodeElement(m.AutoSpaceDN, seautoSpaceDN) + } + if m.Bidi != nil { + sebidi := xml.StartElement{Name: xml.Name{Local: "w:bidi"}} + e.EncodeElement(m.Bidi, sebidi) + } + if m.AdjustRightInd != nil { + seadjustRightInd := xml.StartElement{Name: xml.Name{Local: "w:adjustRightInd"}} + e.EncodeElement(m.AdjustRightInd, seadjustRightInd) + } + if m.SnapToGrid != nil { + sesnapToGrid := xml.StartElement{Name: xml.Name{Local: "w:snapToGrid"}} + e.EncodeElement(m.SnapToGrid, sesnapToGrid) + } + if m.Spacing != nil { + sespacing := xml.StartElement{Name: xml.Name{Local: "w:spacing"}} + e.EncodeElement(m.Spacing, sespacing) + } + if m.Ind != nil { + seind := xml.StartElement{Name: xml.Name{Local: "w:ind"}} + e.EncodeElement(m.Ind, seind) + } + if m.ContextualSpacing != nil { + secontextualSpacing := xml.StartElement{Name: xml.Name{Local: "w:contextualSpacing"}} + e.EncodeElement(m.ContextualSpacing, secontextualSpacing) + } + if m.MirrorIndents != nil { + semirrorIndents := xml.StartElement{Name: xml.Name{Local: "w:mirrorIndents"}} + e.EncodeElement(m.MirrorIndents, semirrorIndents) + } + if m.SuppressOverlap != nil { + sesuppressOverlap := xml.StartElement{Name: xml.Name{Local: "w:suppressOverlap"}} + e.EncodeElement(m.SuppressOverlap, sesuppressOverlap) + } + if m.Jc != nil { + sejc := xml.StartElement{Name: xml.Name{Local: "w:jc"}} + e.EncodeElement(m.Jc, sejc) + } + if m.TextDirection != nil { + setextDirection := xml.StartElement{Name: xml.Name{Local: "w:textDirection"}} + e.EncodeElement(m.TextDirection, setextDirection) + } + if m.TextAlignment != nil { + setextAlignment := xml.StartElement{Name: xml.Name{Local: "w:textAlignment"}} + e.EncodeElement(m.TextAlignment, setextAlignment) + } + if m.TextboxTightWrap != nil { + setextboxTightWrap := xml.StartElement{Name: xml.Name{Local: "w:textboxTightWrap"}} + e.EncodeElement(m.TextboxTightWrap, setextboxTightWrap) + } + if m.OutlineLvl != nil { + seoutlineLvl := xml.StartElement{Name: xml.Name{Local: "w:outlineLvl"}} + e.EncodeElement(m.OutlineLvl, seoutlineLvl) + } + if m.DivId != nil { + sedivId := xml.StartElement{Name: xml.Name{Local: "w:divId"}} + e.EncodeElement(m.DivId, sedivId) + } + if m.CnfStyle != nil { + secnfStyle := xml.StartElement{Name: xml.Name{Local: "w:cnfStyle"}} + e.EncodeElement(m.CnfStyle, secnfStyle) + } + if m.RPr != nil { + serPr := xml.StartElement{Name: xml.Name{Local: "w:rPr"}} + e.EncodeElement(m.RPr, serPr) + } + if m.SectPr != nil { + sesectPr := xml.StartElement{Name: xml.Name{Local: "w:sectPr"}} + e.EncodeElement(m.SectPr, sesectPr) + } + if m.PPrChange != nil { + sepPrChange := xml.StartElement{Name: xml.Name{Local: "w:pPrChange"}} + e.EncodeElement(m.PPrChange, sepPrChange) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_PPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_PPr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pStyle"}: + m.PStyle = NewCT_String() + if err := d.DecodeElement(m.PStyle, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "keepNext"}: + m.KeepNext = NewCT_OnOff() + if err := d.DecodeElement(m.KeepNext, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "keepLines"}: + m.KeepLines = NewCT_OnOff() + if err := d.DecodeElement(m.KeepLines, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pageBreakBefore"}: + m.PageBreakBefore = NewCT_OnOff() + if err := d.DecodeElement(m.PageBreakBefore, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "framePr"}: + m.FramePr = NewCT_FramePr() + if err := d.DecodeElement(m.FramePr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "widowControl"}: + m.WidowControl = NewCT_OnOff() + if err := d.DecodeElement(m.WidowControl, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "numPr"}: + m.NumPr = NewCT_NumPr() + if err := d.DecodeElement(m.NumPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "suppressLineNumbers"}: + m.SuppressLineNumbers = NewCT_OnOff() + if err := d.DecodeElement(m.SuppressLineNumbers, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pBdr"}: + m.PBdr = NewCT_PBdr() + if err := d.DecodeElement(m.PBdr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "shd"}: + m.Shd = NewCT_Shd() + if err := d.DecodeElement(m.Shd, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tabs"}: + m.Tabs = NewCT_Tabs() + if err := d.DecodeElement(m.Tabs, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "suppressAutoHyphens"}: + m.SuppressAutoHyphens = NewCT_OnOff() + if err := d.DecodeElement(m.SuppressAutoHyphens, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "kinsoku"}: + m.Kinsoku = NewCT_OnOff() + if err := d.DecodeElement(m.Kinsoku, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "wordWrap"}: + m.WordWrap = NewCT_OnOff() + if err := d.DecodeElement(m.WordWrap, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "overflowPunct"}: + m.OverflowPunct = NewCT_OnOff() + if err := d.DecodeElement(m.OverflowPunct, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "topLinePunct"}: + m.TopLinePunct = NewCT_OnOff() + if err := d.DecodeElement(m.TopLinePunct, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "autoSpaceDE"}: + m.AutoSpaceDE = NewCT_OnOff() + if err := d.DecodeElement(m.AutoSpaceDE, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "autoSpaceDN"}: + m.AutoSpaceDN = NewCT_OnOff() + if err := d.DecodeElement(m.AutoSpaceDN, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bidi"}: + m.Bidi = NewCT_OnOff() + if err := d.DecodeElement(m.Bidi, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "adjustRightInd"}: + m.AdjustRightInd = NewCT_OnOff() + if err := d.DecodeElement(m.AdjustRightInd, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "snapToGrid"}: + m.SnapToGrid = NewCT_OnOff() + if err := d.DecodeElement(m.SnapToGrid, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "spacing"}: + m.Spacing = NewCT_Spacing() + if err := d.DecodeElement(m.Spacing, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ind"}: + m.Ind = NewCT_Ind() + if err := d.DecodeElement(m.Ind, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "contextualSpacing"}: + m.ContextualSpacing = NewCT_OnOff() + if err := d.DecodeElement(m.ContextualSpacing, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "mirrorIndents"}: + m.MirrorIndents = NewCT_OnOff() + if err := d.DecodeElement(m.MirrorIndents, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "suppressOverlap"}: + m.SuppressOverlap = NewCT_OnOff() + if err := d.DecodeElement(m.SuppressOverlap, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "jc"}: + m.Jc = NewCT_Jc() + if err := d.DecodeElement(m.Jc, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "textDirection"}: + m.TextDirection = NewCT_TextDirection() + if err := d.DecodeElement(m.TextDirection, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "textAlignment"}: + m.TextAlignment = NewCT_TextAlignment() + if err := d.DecodeElement(m.TextAlignment, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "textboxTightWrap"}: + m.TextboxTightWrap = NewCT_TextboxTightWrap() + if err := d.DecodeElement(m.TextboxTightWrap, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "outlineLvl"}: + m.OutlineLvl = NewCT_DecimalNumber() + if err := d.DecodeElement(m.OutlineLvl, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "divId"}: + m.DivId = NewCT_DecimalNumber() + if err := d.DecodeElement(m.DivId, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "cnfStyle"}: + m.CnfStyle = NewCT_Cnf() + if err := d.DecodeElement(m.CnfStyle, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rPr"}: + m.RPr = NewCT_ParaRPr() + if err := d.DecodeElement(m.RPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sectPr"}: + m.SectPr = NewCT_SectPr() + if err := d.DecodeElement(m.SectPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pPrChange"}: + m.PPrChange = NewCT_PPrChange() + if err := d.DecodeElement(m.PPrChange, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_PPr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_PPr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_PPr and its children +func (m *CT_PPr) Validate() error { + return m.ValidateWithPath("CT_PPr") +} + +// ValidateWithPath validates the CT_PPr and its children, prefixing error messages with path +func (m *CT_PPr) ValidateWithPath(path string) error { + if m.PStyle != nil { + if err := m.PStyle.ValidateWithPath(path + "/PStyle"); err != nil { + return err + } + } + if m.KeepNext != nil { + if err := m.KeepNext.ValidateWithPath(path + "/KeepNext"); err != nil { + return err + } + } + if m.KeepLines != nil { + if err := m.KeepLines.ValidateWithPath(path + "/KeepLines"); err != nil { + return err + } + } + if m.PageBreakBefore != nil { + if err := m.PageBreakBefore.ValidateWithPath(path + "/PageBreakBefore"); err != nil { + return err + } + } + if m.FramePr != nil { + if err := m.FramePr.ValidateWithPath(path + "/FramePr"); err != nil { + return err + } + } + if m.WidowControl != nil { + if err := m.WidowControl.ValidateWithPath(path + "/WidowControl"); err != nil { + return err + } + } + if m.NumPr != nil { + if err := m.NumPr.ValidateWithPath(path + "/NumPr"); err != nil { + return err + } + } + if m.SuppressLineNumbers != nil { + if err := m.SuppressLineNumbers.ValidateWithPath(path + "/SuppressLineNumbers"); err != nil { + return err + } + } + if m.PBdr != nil { + if err := m.PBdr.ValidateWithPath(path + "/PBdr"); err != nil { + return err + } + } + if m.Shd != nil { + if err := m.Shd.ValidateWithPath(path + "/Shd"); err != nil { + return err + } + } + if m.Tabs != nil { + if err := m.Tabs.ValidateWithPath(path + "/Tabs"); err != nil { + return err + } + } + if m.SuppressAutoHyphens != nil { + if err := m.SuppressAutoHyphens.ValidateWithPath(path + "/SuppressAutoHyphens"); err != nil { + return err + } + } + if m.Kinsoku != nil { + if err := m.Kinsoku.ValidateWithPath(path + "/Kinsoku"); err != nil { + return err + } + } + if m.WordWrap != nil { + if err := m.WordWrap.ValidateWithPath(path + "/WordWrap"); err != nil { + return err + } + } + if m.OverflowPunct != nil { + if err := m.OverflowPunct.ValidateWithPath(path + "/OverflowPunct"); err != nil { + return err + } + } + if m.TopLinePunct != nil { + if err := m.TopLinePunct.ValidateWithPath(path + "/TopLinePunct"); err != nil { + return err + } + } + if m.AutoSpaceDE != nil { + if err := m.AutoSpaceDE.ValidateWithPath(path + "/AutoSpaceDE"); err != nil { + return err + } + } + if m.AutoSpaceDN != nil { + if err := m.AutoSpaceDN.ValidateWithPath(path + "/AutoSpaceDN"); err != nil { + return err + } + } + if m.Bidi != nil { + if err := m.Bidi.ValidateWithPath(path + "/Bidi"); err != nil { + return err + } + } + if m.AdjustRightInd != nil { + if err := m.AdjustRightInd.ValidateWithPath(path + "/AdjustRightInd"); err != nil { + return err + } + } + if m.SnapToGrid != nil { + if err := m.SnapToGrid.ValidateWithPath(path + "/SnapToGrid"); err != nil { + return err + } + } + if m.Spacing != nil { + if err := m.Spacing.ValidateWithPath(path + "/Spacing"); err != nil { + return err + } + } + if m.Ind != nil { + if err := m.Ind.ValidateWithPath(path + "/Ind"); err != nil { + return err + } + } + if m.ContextualSpacing != nil { + if err := m.ContextualSpacing.ValidateWithPath(path + "/ContextualSpacing"); err != nil { + return err + } + } + if m.MirrorIndents != nil { + if err := m.MirrorIndents.ValidateWithPath(path + "/MirrorIndents"); err != nil { + return err + } + } + if m.SuppressOverlap != nil { + if err := m.SuppressOverlap.ValidateWithPath(path + "/SuppressOverlap"); err != nil { + return err + } + } + if m.Jc != nil { + if err := m.Jc.ValidateWithPath(path + "/Jc"); err != nil { + return err + } + } + if m.TextDirection != nil { + if err := m.TextDirection.ValidateWithPath(path + "/TextDirection"); err != nil { + return err + } + } + if m.TextAlignment != nil { + if err := m.TextAlignment.ValidateWithPath(path + "/TextAlignment"); err != nil { + return err + } + } + if m.TextboxTightWrap != nil { + if err := m.TextboxTightWrap.ValidateWithPath(path + "/TextboxTightWrap"); err != nil { + return err + } + } + if m.OutlineLvl != nil { + if err := m.OutlineLvl.ValidateWithPath(path + "/OutlineLvl"); err != nil { + return err + } + } + if m.DivId != nil { + if err := m.DivId.ValidateWithPath(path + "/DivId"); err != nil { + return err + } + } + if m.CnfStyle != nil { + if err := m.CnfStyle.ValidateWithPath(path + "/CnfStyle"); err != nil { + return err + } + } + if m.RPr != nil { + if err := m.RPr.ValidateWithPath(path + "/RPr"); err != nil { + return err + } + } + if m.SectPr != nil { + if err := m.SectPr.ValidateWithPath(path + "/SectPr"); err != nil { + return err + } + } + if m.PPrChange != nil { + if err := m.PPrChange.ValidateWithPath(path + "/PPrChange"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PPrBase.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PPrBase.go new file mode 100644 index 00000000..378c6f2c --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PPrBase.go @@ -0,0 +1,593 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_PPrBase struct { + // Referenced Paragraph Style + PStyle *CT_String + // Keep Paragraph With Next Paragraph + KeepNext *CT_OnOff + // Keep All Lines On One Page + KeepLines *CT_OnOff + // Start Paragraph on Next Page + PageBreakBefore *CT_OnOff + // Text Frame Properties + FramePr *CT_FramePr + // Allow First/Last Line to Display on a Separate Page + WidowControl *CT_OnOff + // Numbering Definition Instance Reference + NumPr *CT_NumPr + // Suppress Line Numbers for Paragraph + SuppressLineNumbers *CT_OnOff + // Paragraph Borders + PBdr *CT_PBdr + // Paragraph Shading + Shd *CT_Shd + // Set of Custom Tab Stops + Tabs *CT_Tabs + // Suppress Hyphenation for Paragraph + SuppressAutoHyphens *CT_OnOff + // Use East Asian Typography Rules for First and Last Character per Line + Kinsoku *CT_OnOff + // Allow Line Breaking At Character Level + WordWrap *CT_OnOff + // Allow Punctuation to Extend Past Text Extents + OverflowPunct *CT_OnOff + // Compress Punctuation at Start of a Line + TopLinePunct *CT_OnOff + // Automatically Adjust Spacing of Latin and East Asian Text + AutoSpaceDE *CT_OnOff + // Automatically Adjust Spacing of East Asian Text and Numbers + AutoSpaceDN *CT_OnOff + // Right to Left Paragraph Layout + Bidi *CT_OnOff + // Automatically Adjust Right Indent When Using Document Grid + AdjustRightInd *CT_OnOff + // Use Document Grid Settings for Inter-Line Paragraph Spacing + SnapToGrid *CT_OnOff + // Spacing Between Lines and Above/Below Paragraph + Spacing *CT_Spacing + // Paragraph Indentation + Ind *CT_Ind + // Ignore Spacing Above and Below When Using Identical Styles + ContextualSpacing *CT_OnOff + // Use Left/Right Indents as Inside/Outside Indents + MirrorIndents *CT_OnOff + // Prevent Text Frames From Overlapping + SuppressOverlap *CT_OnOff + // Paragraph Alignment + Jc *CT_Jc + // Paragraph Text Flow Direction + TextDirection *CT_TextDirection + // Vertical Character Alignment on Line + TextAlignment *CT_TextAlignment + // Allow Surrounding Paragraphs to Tight Wrap to Text Box Contents + TextboxTightWrap *CT_TextboxTightWrap + // Associated Outline Level + OutlineLvl *CT_DecimalNumber + // Associated HTML div ID + DivId *CT_DecimalNumber + // Paragraph Conditional Formatting + CnfStyle *CT_Cnf +} + +func NewCT_PPrBase() *CT_PPrBase { + ret := &CT_PPrBase{} + return ret +} + +func (m *CT_PPrBase) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.PStyle != nil { + sepStyle := xml.StartElement{Name: xml.Name{Local: "w:pStyle"}} + e.EncodeElement(m.PStyle, sepStyle) + } + if m.KeepNext != nil { + sekeepNext := xml.StartElement{Name: xml.Name{Local: "w:keepNext"}} + e.EncodeElement(m.KeepNext, sekeepNext) + } + if m.KeepLines != nil { + sekeepLines := xml.StartElement{Name: xml.Name{Local: "w:keepLines"}} + e.EncodeElement(m.KeepLines, sekeepLines) + } + if m.PageBreakBefore != nil { + sepageBreakBefore := xml.StartElement{Name: xml.Name{Local: "w:pageBreakBefore"}} + e.EncodeElement(m.PageBreakBefore, sepageBreakBefore) + } + if m.FramePr != nil { + seframePr := xml.StartElement{Name: xml.Name{Local: "w:framePr"}} + e.EncodeElement(m.FramePr, seframePr) + } + if m.WidowControl != nil { + sewidowControl := xml.StartElement{Name: xml.Name{Local: "w:widowControl"}} + e.EncodeElement(m.WidowControl, sewidowControl) + } + if m.NumPr != nil { + senumPr := xml.StartElement{Name: xml.Name{Local: "w:numPr"}} + e.EncodeElement(m.NumPr, senumPr) + } + if m.SuppressLineNumbers != nil { + sesuppressLineNumbers := xml.StartElement{Name: xml.Name{Local: "w:suppressLineNumbers"}} + e.EncodeElement(m.SuppressLineNumbers, sesuppressLineNumbers) + } + if m.PBdr != nil { + sepBdr := xml.StartElement{Name: xml.Name{Local: "w:pBdr"}} + e.EncodeElement(m.PBdr, sepBdr) + } + if m.Shd != nil { + seshd := xml.StartElement{Name: xml.Name{Local: "w:shd"}} + e.EncodeElement(m.Shd, seshd) + } + if m.Tabs != nil { + setabs := xml.StartElement{Name: xml.Name{Local: "w:tabs"}} + e.EncodeElement(m.Tabs, setabs) + } + if m.SuppressAutoHyphens != nil { + sesuppressAutoHyphens := xml.StartElement{Name: xml.Name{Local: "w:suppressAutoHyphens"}} + e.EncodeElement(m.SuppressAutoHyphens, sesuppressAutoHyphens) + } + if m.Kinsoku != nil { + sekinsoku := xml.StartElement{Name: xml.Name{Local: "w:kinsoku"}} + e.EncodeElement(m.Kinsoku, sekinsoku) + } + if m.WordWrap != nil { + sewordWrap := xml.StartElement{Name: xml.Name{Local: "w:wordWrap"}} + e.EncodeElement(m.WordWrap, sewordWrap) + } + if m.OverflowPunct != nil { + seoverflowPunct := xml.StartElement{Name: xml.Name{Local: "w:overflowPunct"}} + e.EncodeElement(m.OverflowPunct, seoverflowPunct) + } + if m.TopLinePunct != nil { + setopLinePunct := xml.StartElement{Name: xml.Name{Local: "w:topLinePunct"}} + e.EncodeElement(m.TopLinePunct, setopLinePunct) + } + if m.AutoSpaceDE != nil { + seautoSpaceDE := xml.StartElement{Name: xml.Name{Local: "w:autoSpaceDE"}} + e.EncodeElement(m.AutoSpaceDE, seautoSpaceDE) + } + if m.AutoSpaceDN != nil { + seautoSpaceDN := xml.StartElement{Name: xml.Name{Local: "w:autoSpaceDN"}} + e.EncodeElement(m.AutoSpaceDN, seautoSpaceDN) + } + if m.Bidi != nil { + sebidi := xml.StartElement{Name: xml.Name{Local: "w:bidi"}} + e.EncodeElement(m.Bidi, sebidi) + } + if m.AdjustRightInd != nil { + seadjustRightInd := xml.StartElement{Name: xml.Name{Local: "w:adjustRightInd"}} + e.EncodeElement(m.AdjustRightInd, seadjustRightInd) + } + if m.SnapToGrid != nil { + sesnapToGrid := xml.StartElement{Name: xml.Name{Local: "w:snapToGrid"}} + e.EncodeElement(m.SnapToGrid, sesnapToGrid) + } + if m.Spacing != nil { + sespacing := xml.StartElement{Name: xml.Name{Local: "w:spacing"}} + e.EncodeElement(m.Spacing, sespacing) + } + if m.Ind != nil { + seind := xml.StartElement{Name: xml.Name{Local: "w:ind"}} + e.EncodeElement(m.Ind, seind) + } + if m.ContextualSpacing != nil { + secontextualSpacing := xml.StartElement{Name: xml.Name{Local: "w:contextualSpacing"}} + e.EncodeElement(m.ContextualSpacing, secontextualSpacing) + } + if m.MirrorIndents != nil { + semirrorIndents := xml.StartElement{Name: xml.Name{Local: "w:mirrorIndents"}} + e.EncodeElement(m.MirrorIndents, semirrorIndents) + } + if m.SuppressOverlap != nil { + sesuppressOverlap := xml.StartElement{Name: xml.Name{Local: "w:suppressOverlap"}} + e.EncodeElement(m.SuppressOverlap, sesuppressOverlap) + } + if m.Jc != nil { + sejc := xml.StartElement{Name: xml.Name{Local: "w:jc"}} + e.EncodeElement(m.Jc, sejc) + } + if m.TextDirection != nil { + setextDirection := xml.StartElement{Name: xml.Name{Local: "w:textDirection"}} + e.EncodeElement(m.TextDirection, setextDirection) + } + if m.TextAlignment != nil { + setextAlignment := xml.StartElement{Name: xml.Name{Local: "w:textAlignment"}} + e.EncodeElement(m.TextAlignment, setextAlignment) + } + if m.TextboxTightWrap != nil { + setextboxTightWrap := xml.StartElement{Name: xml.Name{Local: "w:textboxTightWrap"}} + e.EncodeElement(m.TextboxTightWrap, setextboxTightWrap) + } + if m.OutlineLvl != nil { + seoutlineLvl := xml.StartElement{Name: xml.Name{Local: "w:outlineLvl"}} + e.EncodeElement(m.OutlineLvl, seoutlineLvl) + } + if m.DivId != nil { + sedivId := xml.StartElement{Name: xml.Name{Local: "w:divId"}} + e.EncodeElement(m.DivId, sedivId) + } + if m.CnfStyle != nil { + secnfStyle := xml.StartElement{Name: xml.Name{Local: "w:cnfStyle"}} + e.EncodeElement(m.CnfStyle, secnfStyle) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_PPrBase) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_PPrBase: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pStyle"}: + m.PStyle = NewCT_String() + if err := d.DecodeElement(m.PStyle, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "keepNext"}: + m.KeepNext = NewCT_OnOff() + if err := d.DecodeElement(m.KeepNext, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "keepLines"}: + m.KeepLines = NewCT_OnOff() + if err := d.DecodeElement(m.KeepLines, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pageBreakBefore"}: + m.PageBreakBefore = NewCT_OnOff() + if err := d.DecodeElement(m.PageBreakBefore, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "framePr"}: + m.FramePr = NewCT_FramePr() + if err := d.DecodeElement(m.FramePr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "widowControl"}: + m.WidowControl = NewCT_OnOff() + if err := d.DecodeElement(m.WidowControl, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "numPr"}: + m.NumPr = NewCT_NumPr() + if err := d.DecodeElement(m.NumPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "suppressLineNumbers"}: + m.SuppressLineNumbers = NewCT_OnOff() + if err := d.DecodeElement(m.SuppressLineNumbers, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pBdr"}: + m.PBdr = NewCT_PBdr() + if err := d.DecodeElement(m.PBdr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "shd"}: + m.Shd = NewCT_Shd() + if err := d.DecodeElement(m.Shd, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tabs"}: + m.Tabs = NewCT_Tabs() + if err := d.DecodeElement(m.Tabs, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "suppressAutoHyphens"}: + m.SuppressAutoHyphens = NewCT_OnOff() + if err := d.DecodeElement(m.SuppressAutoHyphens, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "kinsoku"}: + m.Kinsoku = NewCT_OnOff() + if err := d.DecodeElement(m.Kinsoku, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "wordWrap"}: + m.WordWrap = NewCT_OnOff() + if err := d.DecodeElement(m.WordWrap, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "overflowPunct"}: + m.OverflowPunct = NewCT_OnOff() + if err := d.DecodeElement(m.OverflowPunct, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "topLinePunct"}: + m.TopLinePunct = NewCT_OnOff() + if err := d.DecodeElement(m.TopLinePunct, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "autoSpaceDE"}: + m.AutoSpaceDE = NewCT_OnOff() + if err := d.DecodeElement(m.AutoSpaceDE, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "autoSpaceDN"}: + m.AutoSpaceDN = NewCT_OnOff() + if err := d.DecodeElement(m.AutoSpaceDN, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bidi"}: + m.Bidi = NewCT_OnOff() + if err := d.DecodeElement(m.Bidi, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "adjustRightInd"}: + m.AdjustRightInd = NewCT_OnOff() + if err := d.DecodeElement(m.AdjustRightInd, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "snapToGrid"}: + m.SnapToGrid = NewCT_OnOff() + if err := d.DecodeElement(m.SnapToGrid, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "spacing"}: + m.Spacing = NewCT_Spacing() + if err := d.DecodeElement(m.Spacing, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ind"}: + m.Ind = NewCT_Ind() + if err := d.DecodeElement(m.Ind, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "contextualSpacing"}: + m.ContextualSpacing = NewCT_OnOff() + if err := d.DecodeElement(m.ContextualSpacing, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "mirrorIndents"}: + m.MirrorIndents = NewCT_OnOff() + if err := d.DecodeElement(m.MirrorIndents, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "suppressOverlap"}: + m.SuppressOverlap = NewCT_OnOff() + if err := d.DecodeElement(m.SuppressOverlap, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "jc"}: + m.Jc = NewCT_Jc() + if err := d.DecodeElement(m.Jc, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "textDirection"}: + m.TextDirection = NewCT_TextDirection() + if err := d.DecodeElement(m.TextDirection, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "textAlignment"}: + m.TextAlignment = NewCT_TextAlignment() + if err := d.DecodeElement(m.TextAlignment, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "textboxTightWrap"}: + m.TextboxTightWrap = NewCT_TextboxTightWrap() + if err := d.DecodeElement(m.TextboxTightWrap, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "outlineLvl"}: + m.OutlineLvl = NewCT_DecimalNumber() + if err := d.DecodeElement(m.OutlineLvl, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "divId"}: + m.DivId = NewCT_DecimalNumber() + if err := d.DecodeElement(m.DivId, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "cnfStyle"}: + m.CnfStyle = NewCT_Cnf() + if err := d.DecodeElement(m.CnfStyle, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_PPrBase %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_PPrBase + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_PPrBase and its children +func (m *CT_PPrBase) Validate() error { + return m.ValidateWithPath("CT_PPrBase") +} + +// ValidateWithPath validates the CT_PPrBase and its children, prefixing error messages with path +func (m *CT_PPrBase) ValidateWithPath(path string) error { + if m.PStyle != nil { + if err := m.PStyle.ValidateWithPath(path + "/PStyle"); err != nil { + return err + } + } + if m.KeepNext != nil { + if err := m.KeepNext.ValidateWithPath(path + "/KeepNext"); err != nil { + return err + } + } + if m.KeepLines != nil { + if err := m.KeepLines.ValidateWithPath(path + "/KeepLines"); err != nil { + return err + } + } + if m.PageBreakBefore != nil { + if err := m.PageBreakBefore.ValidateWithPath(path + "/PageBreakBefore"); err != nil { + return err + } + } + if m.FramePr != nil { + if err := m.FramePr.ValidateWithPath(path + "/FramePr"); err != nil { + return err + } + } + if m.WidowControl != nil { + if err := m.WidowControl.ValidateWithPath(path + "/WidowControl"); err != nil { + return err + } + } + if m.NumPr != nil { + if err := m.NumPr.ValidateWithPath(path + "/NumPr"); err != nil { + return err + } + } + if m.SuppressLineNumbers != nil { + if err := m.SuppressLineNumbers.ValidateWithPath(path + "/SuppressLineNumbers"); err != nil { + return err + } + } + if m.PBdr != nil { + if err := m.PBdr.ValidateWithPath(path + "/PBdr"); err != nil { + return err + } + } + if m.Shd != nil { + if err := m.Shd.ValidateWithPath(path + "/Shd"); err != nil { + return err + } + } + if m.Tabs != nil { + if err := m.Tabs.ValidateWithPath(path + "/Tabs"); err != nil { + return err + } + } + if m.SuppressAutoHyphens != nil { + if err := m.SuppressAutoHyphens.ValidateWithPath(path + "/SuppressAutoHyphens"); err != nil { + return err + } + } + if m.Kinsoku != nil { + if err := m.Kinsoku.ValidateWithPath(path + "/Kinsoku"); err != nil { + return err + } + } + if m.WordWrap != nil { + if err := m.WordWrap.ValidateWithPath(path + "/WordWrap"); err != nil { + return err + } + } + if m.OverflowPunct != nil { + if err := m.OverflowPunct.ValidateWithPath(path + "/OverflowPunct"); err != nil { + return err + } + } + if m.TopLinePunct != nil { + if err := m.TopLinePunct.ValidateWithPath(path + "/TopLinePunct"); err != nil { + return err + } + } + if m.AutoSpaceDE != nil { + if err := m.AutoSpaceDE.ValidateWithPath(path + "/AutoSpaceDE"); err != nil { + return err + } + } + if m.AutoSpaceDN != nil { + if err := m.AutoSpaceDN.ValidateWithPath(path + "/AutoSpaceDN"); err != nil { + return err + } + } + if m.Bidi != nil { + if err := m.Bidi.ValidateWithPath(path + "/Bidi"); err != nil { + return err + } + } + if m.AdjustRightInd != nil { + if err := m.AdjustRightInd.ValidateWithPath(path + "/AdjustRightInd"); err != nil { + return err + } + } + if m.SnapToGrid != nil { + if err := m.SnapToGrid.ValidateWithPath(path + "/SnapToGrid"); err != nil { + return err + } + } + if m.Spacing != nil { + if err := m.Spacing.ValidateWithPath(path + "/Spacing"); err != nil { + return err + } + } + if m.Ind != nil { + if err := m.Ind.ValidateWithPath(path + "/Ind"); err != nil { + return err + } + } + if m.ContextualSpacing != nil { + if err := m.ContextualSpacing.ValidateWithPath(path + "/ContextualSpacing"); err != nil { + return err + } + } + if m.MirrorIndents != nil { + if err := m.MirrorIndents.ValidateWithPath(path + "/MirrorIndents"); err != nil { + return err + } + } + if m.SuppressOverlap != nil { + if err := m.SuppressOverlap.ValidateWithPath(path + "/SuppressOverlap"); err != nil { + return err + } + } + if m.Jc != nil { + if err := m.Jc.ValidateWithPath(path + "/Jc"); err != nil { + return err + } + } + if m.TextDirection != nil { + if err := m.TextDirection.ValidateWithPath(path + "/TextDirection"); err != nil { + return err + } + } + if m.TextAlignment != nil { + if err := m.TextAlignment.ValidateWithPath(path + "/TextAlignment"); err != nil { + return err + } + } + if m.TextboxTightWrap != nil { + if err := m.TextboxTightWrap.ValidateWithPath(path + "/TextboxTightWrap"); err != nil { + return err + } + } + if m.OutlineLvl != nil { + if err := m.OutlineLvl.ValidateWithPath(path + "/OutlineLvl"); err != nil { + return err + } + } + if m.DivId != nil { + if err := m.DivId.ValidateWithPath(path + "/DivId"); err != nil { + return err + } + } + if m.CnfStyle != nil { + if err := m.CnfStyle.ValidateWithPath(path + "/CnfStyle"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PPrChange.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PPrChange.go new file mode 100644 index 00000000..f5fc9c32 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PPrChange.go @@ -0,0 +1,118 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + "time" + + "baliance.com/gooxml" +) + +type CT_PPrChange struct { + AuthorAttr string + DateAttr *time.Time + // Annotation Identifier + IdAttr int64 + PPr *CT_PPrBase +} + +func NewCT_PPrChange() *CT_PPrChange { + ret := &CT_PPrChange{} + ret.PPr = NewCT_PPrBase() + return ret +} + +func (m *CT_PPrChange) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:author"}, + Value: fmt.Sprintf("%v", m.AuthorAttr)}) + if m.DateAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:date"}, + Value: fmt.Sprintf("%v", *m.DateAttr)}) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:id"}, + Value: fmt.Sprintf("%v", m.IdAttr)}) + e.EncodeToken(start) + sepPr := xml.StartElement{Name: xml.Name{Local: "w:pPr"}} + e.EncodeElement(m.PPr, sepPr) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_PPrChange) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.PPr = NewCT_PPrBase() + for _, attr := range start.Attr { + if attr.Name.Local == "author" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.AuthorAttr = parsed + continue + } + if attr.Name.Local == "date" { + parsed, err := ParseStdlibTime(attr.Value) + if err != nil { + return err + } + m.DateAttr = &parsed + continue + } + if attr.Name.Local == "id" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.IdAttr = parsed + continue + } + } +lCT_PPrChange: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pPr"}: + if err := d.DecodeElement(m.PPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_PPrChange %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_PPrChange + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_PPrChange and its children +func (m *CT_PPrChange) Validate() error { + return m.ValidateWithPath("CT_PPrChange") +} + +// ValidateWithPath validates the CT_PPrChange and its children, prefixing error messages with path +func (m *CT_PPrChange) ValidateWithPath(path string) error { + if err := m.PPr.ValidateWithPath(path + "/PPr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PPrDefault.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PPrDefault.go new file mode 100644 index 00000000..285a7712 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PPrDefault.go @@ -0,0 +1,81 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_PPrDefault struct { + // Paragraph Properties + PPr *CT_PPrGeneral +} + +func NewCT_PPrDefault() *CT_PPrDefault { + ret := &CT_PPrDefault{} + return ret +} + +func (m *CT_PPrDefault) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.PPr != nil { + sepPr := xml.StartElement{Name: xml.Name{Local: "w:pPr"}} + e.EncodeElement(m.PPr, sepPr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_PPrDefault) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_PPrDefault: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pPr"}: + m.PPr = NewCT_PPrGeneral() + if err := d.DecodeElement(m.PPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_PPrDefault %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_PPrDefault + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_PPrDefault and its children +func (m *CT_PPrDefault) Validate() error { + return m.ValidateWithPath("CT_PPrDefault") +} + +// ValidateWithPath validates the CT_PPrDefault and its children, prefixing error messages with path +func (m *CT_PPrDefault) ValidateWithPath(path string) error { + if m.PPr != nil { + if err := m.PPr.ValidateWithPath(path + "/PPr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PPrGeneral.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PPrGeneral.go new file mode 100644 index 00000000..f1f7d648 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PPrGeneral.go @@ -0,0 +1,608 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_PPrGeneral struct { + // Referenced Paragraph Style + PStyle *CT_String + // Keep Paragraph With Next Paragraph + KeepNext *CT_OnOff + // Keep All Lines On One Page + KeepLines *CT_OnOff + // Start Paragraph on Next Page + PageBreakBefore *CT_OnOff + // Text Frame Properties + FramePr *CT_FramePr + // Allow First/Last Line to Display on a Separate Page + WidowControl *CT_OnOff + // Numbering Definition Instance Reference + NumPr *CT_NumPr + // Suppress Line Numbers for Paragraph + SuppressLineNumbers *CT_OnOff + // Paragraph Borders + PBdr *CT_PBdr + // Paragraph Shading + Shd *CT_Shd + // Set of Custom Tab Stops + Tabs *CT_Tabs + // Suppress Hyphenation for Paragraph + SuppressAutoHyphens *CT_OnOff + // Use East Asian Typography Rules for First and Last Character per Line + Kinsoku *CT_OnOff + // Allow Line Breaking At Character Level + WordWrap *CT_OnOff + // Allow Punctuation to Extend Past Text Extents + OverflowPunct *CT_OnOff + // Compress Punctuation at Start of a Line + TopLinePunct *CT_OnOff + // Automatically Adjust Spacing of Latin and East Asian Text + AutoSpaceDE *CT_OnOff + // Automatically Adjust Spacing of East Asian Text and Numbers + AutoSpaceDN *CT_OnOff + // Right to Left Paragraph Layout + Bidi *CT_OnOff + // Automatically Adjust Right Indent When Using Document Grid + AdjustRightInd *CT_OnOff + // Use Document Grid Settings for Inter-Line Paragraph Spacing + SnapToGrid *CT_OnOff + // Spacing Between Lines and Above/Below Paragraph + Spacing *CT_Spacing + // Paragraph Indentation + Ind *CT_Ind + // Ignore Spacing Above and Below When Using Identical Styles + ContextualSpacing *CT_OnOff + // Use Left/Right Indents as Inside/Outside Indents + MirrorIndents *CT_OnOff + // Prevent Text Frames From Overlapping + SuppressOverlap *CT_OnOff + // Paragraph Alignment + Jc *CT_Jc + // Paragraph Text Flow Direction + TextDirection *CT_TextDirection + // Vertical Character Alignment on Line + TextAlignment *CT_TextAlignment + // Allow Surrounding Paragraphs to Tight Wrap to Text Box Contents + TextboxTightWrap *CT_TextboxTightWrap + // Associated Outline Level + OutlineLvl *CT_DecimalNumber + // Associated HTML div ID + DivId *CT_DecimalNumber + // Paragraph Conditional Formatting + CnfStyle *CT_Cnf + PPrChange *CT_PPrChange +} + +func NewCT_PPrGeneral() *CT_PPrGeneral { + ret := &CT_PPrGeneral{} + return ret +} + +func (m *CT_PPrGeneral) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.PStyle != nil { + sepStyle := xml.StartElement{Name: xml.Name{Local: "w:pStyle"}} + e.EncodeElement(m.PStyle, sepStyle) + } + if m.KeepNext != nil { + sekeepNext := xml.StartElement{Name: xml.Name{Local: "w:keepNext"}} + e.EncodeElement(m.KeepNext, sekeepNext) + } + if m.KeepLines != nil { + sekeepLines := xml.StartElement{Name: xml.Name{Local: "w:keepLines"}} + e.EncodeElement(m.KeepLines, sekeepLines) + } + if m.PageBreakBefore != nil { + sepageBreakBefore := xml.StartElement{Name: xml.Name{Local: "w:pageBreakBefore"}} + e.EncodeElement(m.PageBreakBefore, sepageBreakBefore) + } + if m.FramePr != nil { + seframePr := xml.StartElement{Name: xml.Name{Local: "w:framePr"}} + e.EncodeElement(m.FramePr, seframePr) + } + if m.WidowControl != nil { + sewidowControl := xml.StartElement{Name: xml.Name{Local: "w:widowControl"}} + e.EncodeElement(m.WidowControl, sewidowControl) + } + if m.NumPr != nil { + senumPr := xml.StartElement{Name: xml.Name{Local: "w:numPr"}} + e.EncodeElement(m.NumPr, senumPr) + } + if m.SuppressLineNumbers != nil { + sesuppressLineNumbers := xml.StartElement{Name: xml.Name{Local: "w:suppressLineNumbers"}} + e.EncodeElement(m.SuppressLineNumbers, sesuppressLineNumbers) + } + if m.PBdr != nil { + sepBdr := xml.StartElement{Name: xml.Name{Local: "w:pBdr"}} + e.EncodeElement(m.PBdr, sepBdr) + } + if m.Shd != nil { + seshd := xml.StartElement{Name: xml.Name{Local: "w:shd"}} + e.EncodeElement(m.Shd, seshd) + } + if m.Tabs != nil { + setabs := xml.StartElement{Name: xml.Name{Local: "w:tabs"}} + e.EncodeElement(m.Tabs, setabs) + } + if m.SuppressAutoHyphens != nil { + sesuppressAutoHyphens := xml.StartElement{Name: xml.Name{Local: "w:suppressAutoHyphens"}} + e.EncodeElement(m.SuppressAutoHyphens, sesuppressAutoHyphens) + } + if m.Kinsoku != nil { + sekinsoku := xml.StartElement{Name: xml.Name{Local: "w:kinsoku"}} + e.EncodeElement(m.Kinsoku, sekinsoku) + } + if m.WordWrap != nil { + sewordWrap := xml.StartElement{Name: xml.Name{Local: "w:wordWrap"}} + e.EncodeElement(m.WordWrap, sewordWrap) + } + if m.OverflowPunct != nil { + seoverflowPunct := xml.StartElement{Name: xml.Name{Local: "w:overflowPunct"}} + e.EncodeElement(m.OverflowPunct, seoverflowPunct) + } + if m.TopLinePunct != nil { + setopLinePunct := xml.StartElement{Name: xml.Name{Local: "w:topLinePunct"}} + e.EncodeElement(m.TopLinePunct, setopLinePunct) + } + if m.AutoSpaceDE != nil { + seautoSpaceDE := xml.StartElement{Name: xml.Name{Local: "w:autoSpaceDE"}} + e.EncodeElement(m.AutoSpaceDE, seautoSpaceDE) + } + if m.AutoSpaceDN != nil { + seautoSpaceDN := xml.StartElement{Name: xml.Name{Local: "w:autoSpaceDN"}} + e.EncodeElement(m.AutoSpaceDN, seautoSpaceDN) + } + if m.Bidi != nil { + sebidi := xml.StartElement{Name: xml.Name{Local: "w:bidi"}} + e.EncodeElement(m.Bidi, sebidi) + } + if m.AdjustRightInd != nil { + seadjustRightInd := xml.StartElement{Name: xml.Name{Local: "w:adjustRightInd"}} + e.EncodeElement(m.AdjustRightInd, seadjustRightInd) + } + if m.SnapToGrid != nil { + sesnapToGrid := xml.StartElement{Name: xml.Name{Local: "w:snapToGrid"}} + e.EncodeElement(m.SnapToGrid, sesnapToGrid) + } + if m.Spacing != nil { + sespacing := xml.StartElement{Name: xml.Name{Local: "w:spacing"}} + e.EncodeElement(m.Spacing, sespacing) + } + if m.Ind != nil { + seind := xml.StartElement{Name: xml.Name{Local: "w:ind"}} + e.EncodeElement(m.Ind, seind) + } + if m.ContextualSpacing != nil { + secontextualSpacing := xml.StartElement{Name: xml.Name{Local: "w:contextualSpacing"}} + e.EncodeElement(m.ContextualSpacing, secontextualSpacing) + } + if m.MirrorIndents != nil { + semirrorIndents := xml.StartElement{Name: xml.Name{Local: "w:mirrorIndents"}} + e.EncodeElement(m.MirrorIndents, semirrorIndents) + } + if m.SuppressOverlap != nil { + sesuppressOverlap := xml.StartElement{Name: xml.Name{Local: "w:suppressOverlap"}} + e.EncodeElement(m.SuppressOverlap, sesuppressOverlap) + } + if m.Jc != nil { + sejc := xml.StartElement{Name: xml.Name{Local: "w:jc"}} + e.EncodeElement(m.Jc, sejc) + } + if m.TextDirection != nil { + setextDirection := xml.StartElement{Name: xml.Name{Local: "w:textDirection"}} + e.EncodeElement(m.TextDirection, setextDirection) + } + if m.TextAlignment != nil { + setextAlignment := xml.StartElement{Name: xml.Name{Local: "w:textAlignment"}} + e.EncodeElement(m.TextAlignment, setextAlignment) + } + if m.TextboxTightWrap != nil { + setextboxTightWrap := xml.StartElement{Name: xml.Name{Local: "w:textboxTightWrap"}} + e.EncodeElement(m.TextboxTightWrap, setextboxTightWrap) + } + if m.OutlineLvl != nil { + seoutlineLvl := xml.StartElement{Name: xml.Name{Local: "w:outlineLvl"}} + e.EncodeElement(m.OutlineLvl, seoutlineLvl) + } + if m.DivId != nil { + sedivId := xml.StartElement{Name: xml.Name{Local: "w:divId"}} + e.EncodeElement(m.DivId, sedivId) + } + if m.CnfStyle != nil { + secnfStyle := xml.StartElement{Name: xml.Name{Local: "w:cnfStyle"}} + e.EncodeElement(m.CnfStyle, secnfStyle) + } + if m.PPrChange != nil { + sepPrChange := xml.StartElement{Name: xml.Name{Local: "w:pPrChange"}} + e.EncodeElement(m.PPrChange, sepPrChange) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_PPrGeneral) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_PPrGeneral: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pStyle"}: + m.PStyle = NewCT_String() + if err := d.DecodeElement(m.PStyle, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "keepNext"}: + m.KeepNext = NewCT_OnOff() + if err := d.DecodeElement(m.KeepNext, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "keepLines"}: + m.KeepLines = NewCT_OnOff() + if err := d.DecodeElement(m.KeepLines, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pageBreakBefore"}: + m.PageBreakBefore = NewCT_OnOff() + if err := d.DecodeElement(m.PageBreakBefore, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "framePr"}: + m.FramePr = NewCT_FramePr() + if err := d.DecodeElement(m.FramePr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "widowControl"}: + m.WidowControl = NewCT_OnOff() + if err := d.DecodeElement(m.WidowControl, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "numPr"}: + m.NumPr = NewCT_NumPr() + if err := d.DecodeElement(m.NumPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "suppressLineNumbers"}: + m.SuppressLineNumbers = NewCT_OnOff() + if err := d.DecodeElement(m.SuppressLineNumbers, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pBdr"}: + m.PBdr = NewCT_PBdr() + if err := d.DecodeElement(m.PBdr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "shd"}: + m.Shd = NewCT_Shd() + if err := d.DecodeElement(m.Shd, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tabs"}: + m.Tabs = NewCT_Tabs() + if err := d.DecodeElement(m.Tabs, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "suppressAutoHyphens"}: + m.SuppressAutoHyphens = NewCT_OnOff() + if err := d.DecodeElement(m.SuppressAutoHyphens, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "kinsoku"}: + m.Kinsoku = NewCT_OnOff() + if err := d.DecodeElement(m.Kinsoku, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "wordWrap"}: + m.WordWrap = NewCT_OnOff() + if err := d.DecodeElement(m.WordWrap, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "overflowPunct"}: + m.OverflowPunct = NewCT_OnOff() + if err := d.DecodeElement(m.OverflowPunct, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "topLinePunct"}: + m.TopLinePunct = NewCT_OnOff() + if err := d.DecodeElement(m.TopLinePunct, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "autoSpaceDE"}: + m.AutoSpaceDE = NewCT_OnOff() + if err := d.DecodeElement(m.AutoSpaceDE, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "autoSpaceDN"}: + m.AutoSpaceDN = NewCT_OnOff() + if err := d.DecodeElement(m.AutoSpaceDN, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bidi"}: + m.Bidi = NewCT_OnOff() + if err := d.DecodeElement(m.Bidi, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "adjustRightInd"}: + m.AdjustRightInd = NewCT_OnOff() + if err := d.DecodeElement(m.AdjustRightInd, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "snapToGrid"}: + m.SnapToGrid = NewCT_OnOff() + if err := d.DecodeElement(m.SnapToGrid, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "spacing"}: + m.Spacing = NewCT_Spacing() + if err := d.DecodeElement(m.Spacing, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ind"}: + m.Ind = NewCT_Ind() + if err := d.DecodeElement(m.Ind, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "contextualSpacing"}: + m.ContextualSpacing = NewCT_OnOff() + if err := d.DecodeElement(m.ContextualSpacing, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "mirrorIndents"}: + m.MirrorIndents = NewCT_OnOff() + if err := d.DecodeElement(m.MirrorIndents, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "suppressOverlap"}: + m.SuppressOverlap = NewCT_OnOff() + if err := d.DecodeElement(m.SuppressOverlap, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "jc"}: + m.Jc = NewCT_Jc() + if err := d.DecodeElement(m.Jc, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "textDirection"}: + m.TextDirection = NewCT_TextDirection() + if err := d.DecodeElement(m.TextDirection, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "textAlignment"}: + m.TextAlignment = NewCT_TextAlignment() + if err := d.DecodeElement(m.TextAlignment, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "textboxTightWrap"}: + m.TextboxTightWrap = NewCT_TextboxTightWrap() + if err := d.DecodeElement(m.TextboxTightWrap, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "outlineLvl"}: + m.OutlineLvl = NewCT_DecimalNumber() + if err := d.DecodeElement(m.OutlineLvl, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "divId"}: + m.DivId = NewCT_DecimalNumber() + if err := d.DecodeElement(m.DivId, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "cnfStyle"}: + m.CnfStyle = NewCT_Cnf() + if err := d.DecodeElement(m.CnfStyle, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pPrChange"}: + m.PPrChange = NewCT_PPrChange() + if err := d.DecodeElement(m.PPrChange, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_PPrGeneral %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_PPrGeneral + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_PPrGeneral and its children +func (m *CT_PPrGeneral) Validate() error { + return m.ValidateWithPath("CT_PPrGeneral") +} + +// ValidateWithPath validates the CT_PPrGeneral and its children, prefixing error messages with path +func (m *CT_PPrGeneral) ValidateWithPath(path string) error { + if m.PStyle != nil { + if err := m.PStyle.ValidateWithPath(path + "/PStyle"); err != nil { + return err + } + } + if m.KeepNext != nil { + if err := m.KeepNext.ValidateWithPath(path + "/KeepNext"); err != nil { + return err + } + } + if m.KeepLines != nil { + if err := m.KeepLines.ValidateWithPath(path + "/KeepLines"); err != nil { + return err + } + } + if m.PageBreakBefore != nil { + if err := m.PageBreakBefore.ValidateWithPath(path + "/PageBreakBefore"); err != nil { + return err + } + } + if m.FramePr != nil { + if err := m.FramePr.ValidateWithPath(path + "/FramePr"); err != nil { + return err + } + } + if m.WidowControl != nil { + if err := m.WidowControl.ValidateWithPath(path + "/WidowControl"); err != nil { + return err + } + } + if m.NumPr != nil { + if err := m.NumPr.ValidateWithPath(path + "/NumPr"); err != nil { + return err + } + } + if m.SuppressLineNumbers != nil { + if err := m.SuppressLineNumbers.ValidateWithPath(path + "/SuppressLineNumbers"); err != nil { + return err + } + } + if m.PBdr != nil { + if err := m.PBdr.ValidateWithPath(path + "/PBdr"); err != nil { + return err + } + } + if m.Shd != nil { + if err := m.Shd.ValidateWithPath(path + "/Shd"); err != nil { + return err + } + } + if m.Tabs != nil { + if err := m.Tabs.ValidateWithPath(path + "/Tabs"); err != nil { + return err + } + } + if m.SuppressAutoHyphens != nil { + if err := m.SuppressAutoHyphens.ValidateWithPath(path + "/SuppressAutoHyphens"); err != nil { + return err + } + } + if m.Kinsoku != nil { + if err := m.Kinsoku.ValidateWithPath(path + "/Kinsoku"); err != nil { + return err + } + } + if m.WordWrap != nil { + if err := m.WordWrap.ValidateWithPath(path + "/WordWrap"); err != nil { + return err + } + } + if m.OverflowPunct != nil { + if err := m.OverflowPunct.ValidateWithPath(path + "/OverflowPunct"); err != nil { + return err + } + } + if m.TopLinePunct != nil { + if err := m.TopLinePunct.ValidateWithPath(path + "/TopLinePunct"); err != nil { + return err + } + } + if m.AutoSpaceDE != nil { + if err := m.AutoSpaceDE.ValidateWithPath(path + "/AutoSpaceDE"); err != nil { + return err + } + } + if m.AutoSpaceDN != nil { + if err := m.AutoSpaceDN.ValidateWithPath(path + "/AutoSpaceDN"); err != nil { + return err + } + } + if m.Bidi != nil { + if err := m.Bidi.ValidateWithPath(path + "/Bidi"); err != nil { + return err + } + } + if m.AdjustRightInd != nil { + if err := m.AdjustRightInd.ValidateWithPath(path + "/AdjustRightInd"); err != nil { + return err + } + } + if m.SnapToGrid != nil { + if err := m.SnapToGrid.ValidateWithPath(path + "/SnapToGrid"); err != nil { + return err + } + } + if m.Spacing != nil { + if err := m.Spacing.ValidateWithPath(path + "/Spacing"); err != nil { + return err + } + } + if m.Ind != nil { + if err := m.Ind.ValidateWithPath(path + "/Ind"); err != nil { + return err + } + } + if m.ContextualSpacing != nil { + if err := m.ContextualSpacing.ValidateWithPath(path + "/ContextualSpacing"); err != nil { + return err + } + } + if m.MirrorIndents != nil { + if err := m.MirrorIndents.ValidateWithPath(path + "/MirrorIndents"); err != nil { + return err + } + } + if m.SuppressOverlap != nil { + if err := m.SuppressOverlap.ValidateWithPath(path + "/SuppressOverlap"); err != nil { + return err + } + } + if m.Jc != nil { + if err := m.Jc.ValidateWithPath(path + "/Jc"); err != nil { + return err + } + } + if m.TextDirection != nil { + if err := m.TextDirection.ValidateWithPath(path + "/TextDirection"); err != nil { + return err + } + } + if m.TextAlignment != nil { + if err := m.TextAlignment.ValidateWithPath(path + "/TextAlignment"); err != nil { + return err + } + } + if m.TextboxTightWrap != nil { + if err := m.TextboxTightWrap.ValidateWithPath(path + "/TextboxTightWrap"); err != nil { + return err + } + } + if m.OutlineLvl != nil { + if err := m.OutlineLvl.ValidateWithPath(path + "/OutlineLvl"); err != nil { + return err + } + } + if m.DivId != nil { + if err := m.DivId.ValidateWithPath(path + "/DivId"); err != nil { + return err + } + } + if m.CnfStyle != nil { + if err := m.CnfStyle.ValidateWithPath(path + "/CnfStyle"); err != nil { + return err + } + } + if m.PPrChange != nil { + if err := m.PPrChange.ValidateWithPath(path + "/PPrChange"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PTab.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PTab.go new file mode 100644 index 00000000..1fe7d0c0 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PTab.go @@ -0,0 +1,113 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_PTab struct { + // Positional Tab Stop Alignment + AlignmentAttr ST_PTabAlignment + // Positional Tab Base + RelativeToAttr ST_PTabRelativeTo + // Tab Leader Character + LeaderAttr ST_PTabLeader +} + +func NewCT_PTab() *CT_PTab { + ret := &CT_PTab{} + ret.AlignmentAttr = ST_PTabAlignment(1) + ret.RelativeToAttr = ST_PTabRelativeTo(1) + ret.LeaderAttr = ST_PTabLeader(1) + return ret +} + +func (m *CT_PTab) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.AlignmentAttr.MarshalXMLAttr(xml.Name{Local: "w:alignment"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + attr, err = m.RelativeToAttr.MarshalXMLAttr(xml.Name{Local: "w:relativeTo"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + attr, err = m.LeaderAttr.MarshalXMLAttr(xml.Name{Local: "w:leader"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_PTab) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.AlignmentAttr = ST_PTabAlignment(1) + m.RelativeToAttr = ST_PTabRelativeTo(1) + m.LeaderAttr = ST_PTabLeader(1) + for _, attr := range start.Attr { + if attr.Name.Local == "alignment" { + m.AlignmentAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "relativeTo" { + m.RelativeToAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "leader" { + m.LeaderAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_PTab: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_PTab and its children +func (m *CT_PTab) Validate() error { + return m.ValidateWithPath("CT_PTab") +} + +// ValidateWithPath validates the CT_PTab and its children, prefixing error messages with path +func (m *CT_PTab) ValidateWithPath(path string) error { + if m.AlignmentAttr == ST_PTabAlignmentUnset { + return fmt.Errorf("%s/AlignmentAttr is a mandatory field", path) + } + if err := m.AlignmentAttr.ValidateWithPath(path + "/AlignmentAttr"); err != nil { + return err + } + if m.RelativeToAttr == ST_PTabRelativeToUnset { + return fmt.Errorf("%s/RelativeToAttr is a mandatory field", path) + } + if err := m.RelativeToAttr.ValidateWithPath(path + "/RelativeToAttr"); err != nil { + return err + } + if m.LeaderAttr == ST_PTabLeaderUnset { + return fmt.Errorf("%s/LeaderAttr is a mandatory field", path) + } + if err := m.LeaderAttr.ValidateWithPath(path + "/LeaderAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PageBorder.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PageBorder.go new file mode 100644 index 00000000..0621270f --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PageBorder.go @@ -0,0 +1,220 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_PageBorder struct { + IdAttr *string + // Border Style + ValAttr ST_Border + // Border Color + ColorAttr *ST_HexColor + // Border Theme Color + ThemeColorAttr ST_ThemeColor + // Border Theme Color Tint + ThemeTintAttr *string + // Border Theme Color Shade + ThemeShadeAttr *string + // Border Width + SzAttr *uint64 + // Border Spacing Measurement + SpaceAttr *uint64 + // Border Shadow + ShadowAttr *sharedTypes.ST_OnOff + // Create Frame Effect + FrameAttr *sharedTypes.ST_OnOff +} + +func NewCT_PageBorder() *CT_PageBorder { + ret := &CT_PageBorder{} + ret.ValAttr = ST_Border(1) + return ret +} + +func (m *CT_PageBorder) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.IdAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "r:id"}, + Value: fmt.Sprintf("%v", *m.IdAttr)}) + } + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + if m.ColorAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:color"}, + Value: fmt.Sprintf("%v", *m.ColorAttr)}) + } + if m.ThemeColorAttr != ST_ThemeColorUnset { + attr, err := m.ThemeColorAttr.MarshalXMLAttr(xml.Name{Local: "w:themeColor"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.ThemeTintAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:themeTint"}, + Value: fmt.Sprintf("%v", *m.ThemeTintAttr)}) + } + if m.ThemeShadeAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:themeShade"}, + Value: fmt.Sprintf("%v", *m.ThemeShadeAttr)}) + } + if m.SzAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:sz"}, + Value: fmt.Sprintf("%v", *m.SzAttr)}) + } + if m.SpaceAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:space"}, + Value: fmt.Sprintf("%v", *m.SpaceAttr)}) + } + if m.ShadowAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:shadow"}, + Value: fmt.Sprintf("%v", *m.ShadowAttr)}) + } + if m.FrameAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:frame"}, + Value: fmt.Sprintf("%v", *m.FrameAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_PageBorder) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_Border(1) + for _, attr := range start.Attr { + if attr.Name.Space == "http://schemas.openxmlformats.org/officeDocument/2006/relationships" && attr.Name.Local == "id" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.IdAttr = &parsed + continue + } + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "color" { + parsed, err := ParseUnionST_HexColor(attr.Value) + if err != nil { + return err + } + m.ColorAttr = &parsed + continue + } + if attr.Name.Local == "themeColor" { + m.ThemeColorAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "themeTint" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ThemeTintAttr = &parsed + continue + } + if attr.Name.Local == "themeShade" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ThemeShadeAttr = &parsed + continue + } + if attr.Name.Local == "sz" { + parsed, err := strconv.ParseUint(attr.Value, 10, 64) + if err != nil { + return err + } + m.SzAttr = &parsed + continue + } + if attr.Name.Local == "space" { + parsed, err := strconv.ParseUint(attr.Value, 10, 64) + if err != nil { + return err + } + m.SpaceAttr = &parsed + continue + } + if attr.Name.Local == "shadow" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.ShadowAttr = &parsed + continue + } + if attr.Name.Local == "frame" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.FrameAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_PageBorder: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_PageBorder and its children +func (m *CT_PageBorder) Validate() error { + return m.ValidateWithPath("CT_PageBorder") +} + +// ValidateWithPath validates the CT_PageBorder and its children, prefixing error messages with path +func (m *CT_PageBorder) ValidateWithPath(path string) error { + if m.ValAttr == ST_BorderUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + if m.ColorAttr != nil { + if err := m.ColorAttr.ValidateWithPath(path + "/ColorAttr"); err != nil { + return err + } + } + if err := m.ThemeColorAttr.ValidateWithPath(path + "/ThemeColorAttr"); err != nil { + return err + } + if m.ShadowAttr != nil { + if err := m.ShadowAttr.ValidateWithPath(path + "/ShadowAttr"); err != nil { + return err + } + } + if m.FrameAttr != nil { + if err := m.FrameAttr.ValidateWithPath(path + "/FrameAttr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PageBorders.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PageBorders.go new file mode 100644 index 00000000..53f88293 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PageBorders.go @@ -0,0 +1,179 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_PageBorders struct { + // Z-Ordering of Page Border + ZOrderAttr ST_PageBorderZOrder + // Pages to Display Page Borders + DisplayAttr ST_PageBorderDisplay + // Page Border Positioning + OffsetFromAttr ST_PageBorderOffset + // Top Border + Top *CT_TopPageBorder + // Left Border + Left *CT_PageBorder + // Bottom Border + Bottom *CT_BottomPageBorder + // Right Border + Right *CT_PageBorder +} + +func NewCT_PageBorders() *CT_PageBorders { + ret := &CT_PageBorders{} + return ret +} + +func (m *CT_PageBorders) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.ZOrderAttr != ST_PageBorderZOrderUnset { + attr, err := m.ZOrderAttr.MarshalXMLAttr(xml.Name{Local: "w:zOrder"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.DisplayAttr != ST_PageBorderDisplayUnset { + attr, err := m.DisplayAttr.MarshalXMLAttr(xml.Name{Local: "w:display"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.OffsetFromAttr != ST_PageBorderOffsetUnset { + attr, err := m.OffsetFromAttr.MarshalXMLAttr(xml.Name{Local: "w:offsetFrom"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + if m.Top != nil { + setop := xml.StartElement{Name: xml.Name{Local: "w:top"}} + e.EncodeElement(m.Top, setop) + } + if m.Left != nil { + seleft := xml.StartElement{Name: xml.Name{Local: "w:left"}} + e.EncodeElement(m.Left, seleft) + } + if m.Bottom != nil { + sebottom := xml.StartElement{Name: xml.Name{Local: "w:bottom"}} + e.EncodeElement(m.Bottom, sebottom) + } + if m.Right != nil { + seright := xml.StartElement{Name: xml.Name{Local: "w:right"}} + e.EncodeElement(m.Right, seright) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_PageBorders) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "zOrder" { + m.ZOrderAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "display" { + m.DisplayAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "offsetFrom" { + m.OffsetFromAttr.UnmarshalXMLAttr(attr) + continue + } + } +lCT_PageBorders: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "top"}: + m.Top = NewCT_TopPageBorder() + if err := d.DecodeElement(m.Top, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "left"}: + m.Left = NewCT_PageBorder() + if err := d.DecodeElement(m.Left, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bottom"}: + m.Bottom = NewCT_BottomPageBorder() + if err := d.DecodeElement(m.Bottom, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "right"}: + m.Right = NewCT_PageBorder() + if err := d.DecodeElement(m.Right, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_PageBorders %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_PageBorders + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_PageBorders and its children +func (m *CT_PageBorders) Validate() error { + return m.ValidateWithPath("CT_PageBorders") +} + +// ValidateWithPath validates the CT_PageBorders and its children, prefixing error messages with path +func (m *CT_PageBorders) ValidateWithPath(path string) error { + if err := m.ZOrderAttr.ValidateWithPath(path + "/ZOrderAttr"); err != nil { + return err + } + if err := m.DisplayAttr.ValidateWithPath(path + "/DisplayAttr"); err != nil { + return err + } + if err := m.OffsetFromAttr.ValidateWithPath(path + "/OffsetFromAttr"); err != nil { + return err + } + if m.Top != nil { + if err := m.Top.ValidateWithPath(path + "/Top"); err != nil { + return err + } + } + if m.Left != nil { + if err := m.Left.ValidateWithPath(path + "/Left"); err != nil { + return err + } + } + if m.Bottom != nil { + if err := m.Bottom.ValidateWithPath(path + "/Bottom"); err != nil { + return err + } + } + if m.Right != nil { + if err := m.Right.ValidateWithPath(path + "/Right"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PageMar.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PageMar.go new file mode 100644 index 00000000..c66874b1 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PageMar.go @@ -0,0 +1,163 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_PageMar struct { + // Top Margin Spacing + TopAttr ST_SignedTwipsMeasure + // Right Margin Spacing + RightAttr sharedTypes.ST_TwipsMeasure + // Page Bottom Spacing + BottomAttr ST_SignedTwipsMeasure + // Left Margin Spacing + LeftAttr sharedTypes.ST_TwipsMeasure + // Spacing to Top of Header + HeaderAttr sharedTypes.ST_TwipsMeasure + // Spacing to Bottom of Footer + FooterAttr sharedTypes.ST_TwipsMeasure + // Page Gutter Spacing + GutterAttr sharedTypes.ST_TwipsMeasure +} + +func NewCT_PageMar() *CT_PageMar { + ret := &CT_PageMar{} + return ret +} + +func (m *CT_PageMar) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:top"}, + Value: fmt.Sprintf("%v", m.TopAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:right"}, + Value: fmt.Sprintf("%v", m.RightAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:bottom"}, + Value: fmt.Sprintf("%v", m.BottomAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:left"}, + Value: fmt.Sprintf("%v", m.LeftAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:header"}, + Value: fmt.Sprintf("%v", m.HeaderAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:footer"}, + Value: fmt.Sprintf("%v", m.FooterAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:gutter"}, + Value: fmt.Sprintf("%v", m.GutterAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_PageMar) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "top" { + parsed, err := ParseUnionST_SignedTwipsMeasure(attr.Value) + if err != nil { + return err + } + m.TopAttr = parsed + continue + } + if attr.Name.Local == "right" { + parsed, err := ParseUnionST_TwipsMeasure(attr.Value) + if err != nil { + return err + } + m.RightAttr = parsed + continue + } + if attr.Name.Local == "bottom" { + parsed, err := ParseUnionST_SignedTwipsMeasure(attr.Value) + if err != nil { + return err + } + m.BottomAttr = parsed + continue + } + if attr.Name.Local == "left" { + parsed, err := ParseUnionST_TwipsMeasure(attr.Value) + if err != nil { + return err + } + m.LeftAttr = parsed + continue + } + if attr.Name.Local == "header" { + parsed, err := ParseUnionST_TwipsMeasure(attr.Value) + if err != nil { + return err + } + m.HeaderAttr = parsed + continue + } + if attr.Name.Local == "footer" { + parsed, err := ParseUnionST_TwipsMeasure(attr.Value) + if err != nil { + return err + } + m.FooterAttr = parsed + continue + } + if attr.Name.Local == "gutter" { + parsed, err := ParseUnionST_TwipsMeasure(attr.Value) + if err != nil { + return err + } + m.GutterAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_PageMar: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_PageMar and its children +func (m *CT_PageMar) Validate() error { + return m.ValidateWithPath("CT_PageMar") +} + +// ValidateWithPath validates the CT_PageMar and its children, prefixing error messages with path +func (m *CT_PageMar) ValidateWithPath(path string) error { + if err := m.TopAttr.ValidateWithPath(path + "/TopAttr"); err != nil { + return err + } + if err := m.RightAttr.ValidateWithPath(path + "/RightAttr"); err != nil { + return err + } + if err := m.BottomAttr.ValidateWithPath(path + "/BottomAttr"); err != nil { + return err + } + if err := m.LeftAttr.ValidateWithPath(path + "/LeftAttr"); err != nil { + return err + } + if err := m.HeaderAttr.ValidateWithPath(path + "/HeaderAttr"); err != nil { + return err + } + if err := m.FooterAttr.ValidateWithPath(path + "/FooterAttr"); err != nil { + return err + } + if err := m.GutterAttr.ValidateWithPath(path + "/GutterAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PageNumber.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PageNumber.go new file mode 100644 index 00000000..3169d79a --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PageNumber.go @@ -0,0 +1,117 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" +) + +type CT_PageNumber struct { + // Page Number Format + FmtAttr ST_NumberFormat + // Starting Page Number + StartAttr *int64 + // Chapter Heading Style + ChapStyleAttr *int64 + // Chapter Separator Character + ChapSepAttr ST_ChapterSep +} + +func NewCT_PageNumber() *CT_PageNumber { + ret := &CT_PageNumber{} + return ret +} + +func (m *CT_PageNumber) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.FmtAttr != ST_NumberFormatUnset { + attr, err := m.FmtAttr.MarshalXMLAttr(xml.Name{Local: "w:fmt"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.StartAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:start"}, + Value: fmt.Sprintf("%v", *m.StartAttr)}) + } + if m.ChapStyleAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:chapStyle"}, + Value: fmt.Sprintf("%v", *m.ChapStyleAttr)}) + } + if m.ChapSepAttr != ST_ChapterSepUnset { + attr, err := m.ChapSepAttr.MarshalXMLAttr(xml.Name{Local: "w:chapSep"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_PageNumber) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "fmt" { + m.FmtAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "start" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.StartAttr = &parsed + continue + } + if attr.Name.Local == "chapStyle" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.ChapStyleAttr = &parsed + continue + } + if attr.Name.Local == "chapSep" { + m.ChapSepAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_PageNumber: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_PageNumber and its children +func (m *CT_PageNumber) Validate() error { + return m.ValidateWithPath("CT_PageNumber") +} + +// ValidateWithPath validates the CT_PageNumber and its children, prefixing error messages with path +func (m *CT_PageNumber) ValidateWithPath(path string) error { + if err := m.FmtAttr.ValidateWithPath(path + "/FmtAttr"); err != nil { + return err + } + if err := m.ChapSepAttr.ValidateWithPath(path + "/ChapSepAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PageSz.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PageSz.go new file mode 100644 index 00000000..9c543984 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PageSz.go @@ -0,0 +1,127 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_PageSz struct { + // Page Width + WAttr *sharedTypes.ST_TwipsMeasure + // Page Height + HAttr *sharedTypes.ST_TwipsMeasure + // Page Orientation + OrientAttr ST_PageOrientation + // Printer Paper Code + CodeAttr *int64 +} + +func NewCT_PageSz() *CT_PageSz { + ret := &CT_PageSz{} + return ret +} + +func (m *CT_PageSz) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.WAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:w"}, + Value: fmt.Sprintf("%v", *m.WAttr)}) + } + if m.HAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:h"}, + Value: fmt.Sprintf("%v", *m.HAttr)}) + } + if m.OrientAttr != ST_PageOrientationUnset { + attr, err := m.OrientAttr.MarshalXMLAttr(xml.Name{Local: "w:orient"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.CodeAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:code"}, + Value: fmt.Sprintf("%v", *m.CodeAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_PageSz) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "w" { + parsed, err := ParseUnionST_TwipsMeasure(attr.Value) + if err != nil { + return err + } + m.WAttr = &parsed + continue + } + if attr.Name.Local == "h" { + parsed, err := ParseUnionST_TwipsMeasure(attr.Value) + if err != nil { + return err + } + m.HAttr = &parsed + continue + } + if attr.Name.Local == "orient" { + m.OrientAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "code" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.CodeAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_PageSz: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_PageSz and its children +func (m *CT_PageSz) Validate() error { + return m.ValidateWithPath("CT_PageSz") +} + +// ValidateWithPath validates the CT_PageSz and its children, prefixing error messages with path +func (m *CT_PageSz) ValidateWithPath(path string) error { + if m.WAttr != nil { + if err := m.WAttr.ValidateWithPath(path + "/WAttr"); err != nil { + return err + } + } + if m.HAttr != nil { + if err := m.HAttr.ValidateWithPath(path + "/HAttr"); err != nil { + return err + } + } + if err := m.OrientAttr.ValidateWithPath(path + "/OrientAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Panose.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Panose.go new file mode 100644 index 00000000..f9c3cb24 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Panose.go @@ -0,0 +1,68 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_Panose struct { + // Value + ValAttr string +} + +func NewCT_Panose() *CT_Panose { + ret := &CT_Panose{} + return ret +} + +func (m *CT_Panose) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:val"}, + Value: fmt.Sprintf("%v", m.ValAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Panose) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ValAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Panose: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Panose and its children +func (m *CT_Panose) Validate() error { + return m.ValidateWithPath("CT_Panose") +} + +// ValidateWithPath validates the CT_Panose and its children, prefixing error messages with path +func (m *CT_Panose) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PaperSource.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PaperSource.go new file mode 100644 index 00000000..f44d2f91 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PaperSource.go @@ -0,0 +1,85 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" +) + +type CT_PaperSource struct { + // First Page Printer Tray Code + FirstAttr *int64 + // Non-First Page Printer Tray Code + OtherAttr *int64 +} + +func NewCT_PaperSource() *CT_PaperSource { + ret := &CT_PaperSource{} + return ret +} + +func (m *CT_PaperSource) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.FirstAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:first"}, + Value: fmt.Sprintf("%v", *m.FirstAttr)}) + } + if m.OtherAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:other"}, + Value: fmt.Sprintf("%v", *m.OtherAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_PaperSource) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "first" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.FirstAttr = &parsed + continue + } + if attr.Name.Local == "other" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.OtherAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_PaperSource: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_PaperSource and its children +func (m *CT_PaperSource) Validate() error { + return m.ValidateWithPath("CT_PaperSource") +} + +// ValidateWithPath validates the CT_PaperSource and its children, prefixing error messages with path +func (m *CT_PaperSource) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_ParaRPr.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_ParaRPr.go new file mode 100644 index 00000000..de0aed13 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_ParaRPr.go @@ -0,0 +1,769 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_ParaRPr struct { + // Inserted Paragraph + Ins *CT_TrackChange + // Deleted Paragraph + Del *CT_TrackChange + // Move Source Paragraph + MoveFrom *CT_TrackChange + // Move Destination Paragraph + MoveTo *CT_TrackChange + // Referenced Character Style + RStyle *CT_String + // Run Fonts + RFonts *CT_Fonts + // Bold + B *CT_OnOff + // Complex Script Bold + BCs *CT_OnOff + // Italics + I *CT_OnOff + // Complex Script Italics + ICs *CT_OnOff + // Display All Characters As Capital Letters + Caps *CT_OnOff + // Small Caps + SmallCaps *CT_OnOff + // Single Strikethrough + Strike *CT_OnOff + // Double Strikethrough + Dstrike *CT_OnOff + // Display Character Outline + Outline *CT_OnOff + // Shadow + Shadow *CT_OnOff + // Embossing + Emboss *CT_OnOff + // Imprinting + Imprint *CT_OnOff + // Do Not Check Spelling or Grammar + NoProof *CT_OnOff + // Use Document Grid Settings For Inter-Character Spacing + SnapToGrid *CT_OnOff + // Hidden Text + Vanish *CT_OnOff + // Web Hidden Text + WebHidden *CT_OnOff + // Run Content Color + Color *CT_Color + // Character Spacing Adjustment + Spacing *CT_SignedTwipsMeasure + // Expanded/Compressed Text + W *CT_TextScale + // Font Kerning + Kern *CT_HpsMeasure + // Vertically Raised or Lowered Text + Position *CT_SignedHpsMeasure + // Non-Complex Script Font Size + Sz *CT_HpsMeasure + // Complex Script Font Size + SzCs *CT_HpsMeasure + // Text Highlighting + Highlight *CT_Highlight + // Underline + U *CT_Underline + // Animated Text Effect + Effect *CT_TextEffect + // Text Border + Bdr *CT_Border + // Run Shading + Shd *CT_Shd + // Manual Run Width + FitText *CT_FitText + // Subscript/Superscript Text + VertAlign *CT_VerticalAlignRun + // Right To Left Text + Rtl *CT_OnOff + // Use Complex Script Formatting on Run + Cs *CT_OnOff + // Emphasis Mark + Em *CT_Em + // Languages for Run Content + Lang *CT_Language + // East Asian Typography Settings + EastAsianLayout *CT_EastAsianLayout + // Paragraph Mark Is Always Hidden + SpecVanish *CT_OnOff + // Office Open XML Math + OMath *CT_OnOff + // Revision Information for Run Properties on the Paragraph Mark + RPrChange *CT_ParaRPrChange +} + +func NewCT_ParaRPr() *CT_ParaRPr { + ret := &CT_ParaRPr{} + return ret +} + +func (m *CT_ParaRPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Ins != nil { + seins := xml.StartElement{Name: xml.Name{Local: "w:ins"}} + e.EncodeElement(m.Ins, seins) + } + if m.Del != nil { + sedel := xml.StartElement{Name: xml.Name{Local: "w:del"}} + e.EncodeElement(m.Del, sedel) + } + if m.MoveFrom != nil { + semoveFrom := xml.StartElement{Name: xml.Name{Local: "w:moveFrom"}} + e.EncodeElement(m.MoveFrom, semoveFrom) + } + if m.MoveTo != nil { + semoveTo := xml.StartElement{Name: xml.Name{Local: "w:moveTo"}} + e.EncodeElement(m.MoveTo, semoveTo) + } + if m.RStyle != nil { + serStyle := xml.StartElement{Name: xml.Name{Local: "w:rStyle"}} + e.EncodeElement(m.RStyle, serStyle) + } + if m.RFonts != nil { + serFonts := xml.StartElement{Name: xml.Name{Local: "w:rFonts"}} + e.EncodeElement(m.RFonts, serFonts) + } + if m.B != nil { + seb := xml.StartElement{Name: xml.Name{Local: "w:b"}} + e.EncodeElement(m.B, seb) + } + if m.BCs != nil { + sebCs := xml.StartElement{Name: xml.Name{Local: "w:bCs"}} + e.EncodeElement(m.BCs, sebCs) + } + if m.I != nil { + sei := xml.StartElement{Name: xml.Name{Local: "w:i"}} + e.EncodeElement(m.I, sei) + } + if m.ICs != nil { + seiCs := xml.StartElement{Name: xml.Name{Local: "w:iCs"}} + e.EncodeElement(m.ICs, seiCs) + } + if m.Caps != nil { + secaps := xml.StartElement{Name: xml.Name{Local: "w:caps"}} + e.EncodeElement(m.Caps, secaps) + } + if m.SmallCaps != nil { + sesmallCaps := xml.StartElement{Name: xml.Name{Local: "w:smallCaps"}} + e.EncodeElement(m.SmallCaps, sesmallCaps) + } + if m.Strike != nil { + sestrike := xml.StartElement{Name: xml.Name{Local: "w:strike"}} + e.EncodeElement(m.Strike, sestrike) + } + if m.Dstrike != nil { + sedstrike := xml.StartElement{Name: xml.Name{Local: "w:dstrike"}} + e.EncodeElement(m.Dstrike, sedstrike) + } + if m.Outline != nil { + seoutline := xml.StartElement{Name: xml.Name{Local: "w:outline"}} + e.EncodeElement(m.Outline, seoutline) + } + if m.Shadow != nil { + seshadow := xml.StartElement{Name: xml.Name{Local: "w:shadow"}} + e.EncodeElement(m.Shadow, seshadow) + } + if m.Emboss != nil { + seemboss := xml.StartElement{Name: xml.Name{Local: "w:emboss"}} + e.EncodeElement(m.Emboss, seemboss) + } + if m.Imprint != nil { + seimprint := xml.StartElement{Name: xml.Name{Local: "w:imprint"}} + e.EncodeElement(m.Imprint, seimprint) + } + if m.NoProof != nil { + senoProof := xml.StartElement{Name: xml.Name{Local: "w:noProof"}} + e.EncodeElement(m.NoProof, senoProof) + } + if m.SnapToGrid != nil { + sesnapToGrid := xml.StartElement{Name: xml.Name{Local: "w:snapToGrid"}} + e.EncodeElement(m.SnapToGrid, sesnapToGrid) + } + if m.Vanish != nil { + sevanish := xml.StartElement{Name: xml.Name{Local: "w:vanish"}} + e.EncodeElement(m.Vanish, sevanish) + } + if m.WebHidden != nil { + sewebHidden := xml.StartElement{Name: xml.Name{Local: "w:webHidden"}} + e.EncodeElement(m.WebHidden, sewebHidden) + } + if m.Color != nil { + secolor := xml.StartElement{Name: xml.Name{Local: "w:color"}} + e.EncodeElement(m.Color, secolor) + } + if m.Spacing != nil { + sespacing := xml.StartElement{Name: xml.Name{Local: "w:spacing"}} + e.EncodeElement(m.Spacing, sespacing) + } + if m.W != nil { + sew := xml.StartElement{Name: xml.Name{Local: "w:w"}} + e.EncodeElement(m.W, sew) + } + if m.Kern != nil { + sekern := xml.StartElement{Name: xml.Name{Local: "w:kern"}} + e.EncodeElement(m.Kern, sekern) + } + if m.Position != nil { + seposition := xml.StartElement{Name: xml.Name{Local: "w:position"}} + e.EncodeElement(m.Position, seposition) + } + if m.Sz != nil { + sesz := xml.StartElement{Name: xml.Name{Local: "w:sz"}} + e.EncodeElement(m.Sz, sesz) + } + if m.SzCs != nil { + seszCs := xml.StartElement{Name: xml.Name{Local: "w:szCs"}} + e.EncodeElement(m.SzCs, seszCs) + } + if m.Highlight != nil { + sehighlight := xml.StartElement{Name: xml.Name{Local: "w:highlight"}} + e.EncodeElement(m.Highlight, sehighlight) + } + if m.U != nil { + seu := xml.StartElement{Name: xml.Name{Local: "w:u"}} + e.EncodeElement(m.U, seu) + } + if m.Effect != nil { + seeffect := xml.StartElement{Name: xml.Name{Local: "w:effect"}} + e.EncodeElement(m.Effect, seeffect) + } + if m.Bdr != nil { + sebdr := xml.StartElement{Name: xml.Name{Local: "w:bdr"}} + e.EncodeElement(m.Bdr, sebdr) + } + if m.Shd != nil { + seshd := xml.StartElement{Name: xml.Name{Local: "w:shd"}} + e.EncodeElement(m.Shd, seshd) + } + if m.FitText != nil { + sefitText := xml.StartElement{Name: xml.Name{Local: "w:fitText"}} + e.EncodeElement(m.FitText, sefitText) + } + if m.VertAlign != nil { + severtAlign := xml.StartElement{Name: xml.Name{Local: "w:vertAlign"}} + e.EncodeElement(m.VertAlign, severtAlign) + } + if m.Rtl != nil { + sertl := xml.StartElement{Name: xml.Name{Local: "w:rtl"}} + e.EncodeElement(m.Rtl, sertl) + } + if m.Cs != nil { + secs := xml.StartElement{Name: xml.Name{Local: "w:cs"}} + e.EncodeElement(m.Cs, secs) + } + if m.Em != nil { + seem := xml.StartElement{Name: xml.Name{Local: "w:em"}} + e.EncodeElement(m.Em, seem) + } + if m.Lang != nil { + selang := xml.StartElement{Name: xml.Name{Local: "w:lang"}} + e.EncodeElement(m.Lang, selang) + } + if m.EastAsianLayout != nil { + seeastAsianLayout := xml.StartElement{Name: xml.Name{Local: "w:eastAsianLayout"}} + e.EncodeElement(m.EastAsianLayout, seeastAsianLayout) + } + if m.SpecVanish != nil { + sespecVanish := xml.StartElement{Name: xml.Name{Local: "w:specVanish"}} + e.EncodeElement(m.SpecVanish, sespecVanish) + } + if m.OMath != nil { + seoMath := xml.StartElement{Name: xml.Name{Local: "w:oMath"}} + e.EncodeElement(m.OMath, seoMath) + } + if m.RPrChange != nil { + serPrChange := xml.StartElement{Name: xml.Name{Local: "w:rPrChange"}} + e.EncodeElement(m.RPrChange, serPrChange) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_ParaRPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_ParaRPr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + m.Ins = NewCT_TrackChange() + if err := d.DecodeElement(m.Ins, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + m.Del = NewCT_TrackChange() + if err := d.DecodeElement(m.Del, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFrom"}: + m.MoveFrom = NewCT_TrackChange() + if err := d.DecodeElement(m.MoveFrom, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveTo"}: + m.MoveTo = NewCT_TrackChange() + if err := d.DecodeElement(m.MoveTo, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rStyle"}: + m.RStyle = NewCT_String() + if err := d.DecodeElement(m.RStyle, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rFonts"}: + m.RFonts = NewCT_Fonts() + if err := d.DecodeElement(m.RFonts, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "b"}: + m.B = NewCT_OnOff() + if err := d.DecodeElement(m.B, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bCs"}: + m.BCs = NewCT_OnOff() + if err := d.DecodeElement(m.BCs, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "i"}: + m.I = NewCT_OnOff() + if err := d.DecodeElement(m.I, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "iCs"}: + m.ICs = NewCT_OnOff() + if err := d.DecodeElement(m.ICs, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "caps"}: + m.Caps = NewCT_OnOff() + if err := d.DecodeElement(m.Caps, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "smallCaps"}: + m.SmallCaps = NewCT_OnOff() + if err := d.DecodeElement(m.SmallCaps, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "strike"}: + m.Strike = NewCT_OnOff() + if err := d.DecodeElement(m.Strike, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "dstrike"}: + m.Dstrike = NewCT_OnOff() + if err := d.DecodeElement(m.Dstrike, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "outline"}: + m.Outline = NewCT_OnOff() + if err := d.DecodeElement(m.Outline, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "shadow"}: + m.Shadow = NewCT_OnOff() + if err := d.DecodeElement(m.Shadow, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "emboss"}: + m.Emboss = NewCT_OnOff() + if err := d.DecodeElement(m.Emboss, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "imprint"}: + m.Imprint = NewCT_OnOff() + if err := d.DecodeElement(m.Imprint, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "noProof"}: + m.NoProof = NewCT_OnOff() + if err := d.DecodeElement(m.NoProof, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "snapToGrid"}: + m.SnapToGrid = NewCT_OnOff() + if err := d.DecodeElement(m.SnapToGrid, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "vanish"}: + m.Vanish = NewCT_OnOff() + if err := d.DecodeElement(m.Vanish, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "webHidden"}: + m.WebHidden = NewCT_OnOff() + if err := d.DecodeElement(m.WebHidden, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "color"}: + m.Color = NewCT_Color() + if err := d.DecodeElement(m.Color, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "spacing"}: + m.Spacing = NewCT_SignedTwipsMeasure() + if err := d.DecodeElement(m.Spacing, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "w"}: + m.W = NewCT_TextScale() + if err := d.DecodeElement(m.W, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "kern"}: + m.Kern = NewCT_HpsMeasure() + if err := d.DecodeElement(m.Kern, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "position"}: + m.Position = NewCT_SignedHpsMeasure() + if err := d.DecodeElement(m.Position, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sz"}: + m.Sz = NewCT_HpsMeasure() + if err := d.DecodeElement(m.Sz, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "szCs"}: + m.SzCs = NewCT_HpsMeasure() + if err := d.DecodeElement(m.SzCs, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "highlight"}: + m.Highlight = NewCT_Highlight() + if err := d.DecodeElement(m.Highlight, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "u"}: + m.U = NewCT_Underline() + if err := d.DecodeElement(m.U, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "effect"}: + m.Effect = NewCT_TextEffect() + if err := d.DecodeElement(m.Effect, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bdr"}: + m.Bdr = NewCT_Border() + if err := d.DecodeElement(m.Bdr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "shd"}: + m.Shd = NewCT_Shd() + if err := d.DecodeElement(m.Shd, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "fitText"}: + m.FitText = NewCT_FitText() + if err := d.DecodeElement(m.FitText, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "vertAlign"}: + m.VertAlign = NewCT_VerticalAlignRun() + if err := d.DecodeElement(m.VertAlign, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rtl"}: + m.Rtl = NewCT_OnOff() + if err := d.DecodeElement(m.Rtl, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "cs"}: + m.Cs = NewCT_OnOff() + if err := d.DecodeElement(m.Cs, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "em"}: + m.Em = NewCT_Em() + if err := d.DecodeElement(m.Em, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "lang"}: + m.Lang = NewCT_Language() + if err := d.DecodeElement(m.Lang, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "eastAsianLayout"}: + m.EastAsianLayout = NewCT_EastAsianLayout() + if err := d.DecodeElement(m.EastAsianLayout, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "specVanish"}: + m.SpecVanish = NewCT_OnOff() + if err := d.DecodeElement(m.SpecVanish, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "oMath"}: + m.OMath = NewCT_OnOff() + if err := d.DecodeElement(m.OMath, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rPrChange"}: + m.RPrChange = NewCT_ParaRPrChange() + if err := d.DecodeElement(m.RPrChange, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_ParaRPr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_ParaRPr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_ParaRPr and its children +func (m *CT_ParaRPr) Validate() error { + return m.ValidateWithPath("CT_ParaRPr") +} + +// ValidateWithPath validates the CT_ParaRPr and its children, prefixing error messages with path +func (m *CT_ParaRPr) ValidateWithPath(path string) error { + if m.Ins != nil { + if err := m.Ins.ValidateWithPath(path + "/Ins"); err != nil { + return err + } + } + if m.Del != nil { + if err := m.Del.ValidateWithPath(path + "/Del"); err != nil { + return err + } + } + if m.MoveFrom != nil { + if err := m.MoveFrom.ValidateWithPath(path + "/MoveFrom"); err != nil { + return err + } + } + if m.MoveTo != nil { + if err := m.MoveTo.ValidateWithPath(path + "/MoveTo"); err != nil { + return err + } + } + if m.RStyle != nil { + if err := m.RStyle.ValidateWithPath(path + "/RStyle"); err != nil { + return err + } + } + if m.RFonts != nil { + if err := m.RFonts.ValidateWithPath(path + "/RFonts"); err != nil { + return err + } + } + if m.B != nil { + if err := m.B.ValidateWithPath(path + "/B"); err != nil { + return err + } + } + if m.BCs != nil { + if err := m.BCs.ValidateWithPath(path + "/BCs"); err != nil { + return err + } + } + if m.I != nil { + if err := m.I.ValidateWithPath(path + "/I"); err != nil { + return err + } + } + if m.ICs != nil { + if err := m.ICs.ValidateWithPath(path + "/ICs"); err != nil { + return err + } + } + if m.Caps != nil { + if err := m.Caps.ValidateWithPath(path + "/Caps"); err != nil { + return err + } + } + if m.SmallCaps != nil { + if err := m.SmallCaps.ValidateWithPath(path + "/SmallCaps"); err != nil { + return err + } + } + if m.Strike != nil { + if err := m.Strike.ValidateWithPath(path + "/Strike"); err != nil { + return err + } + } + if m.Dstrike != nil { + if err := m.Dstrike.ValidateWithPath(path + "/Dstrike"); err != nil { + return err + } + } + if m.Outline != nil { + if err := m.Outline.ValidateWithPath(path + "/Outline"); err != nil { + return err + } + } + if m.Shadow != nil { + if err := m.Shadow.ValidateWithPath(path + "/Shadow"); err != nil { + return err + } + } + if m.Emboss != nil { + if err := m.Emboss.ValidateWithPath(path + "/Emboss"); err != nil { + return err + } + } + if m.Imprint != nil { + if err := m.Imprint.ValidateWithPath(path + "/Imprint"); err != nil { + return err + } + } + if m.NoProof != nil { + if err := m.NoProof.ValidateWithPath(path + "/NoProof"); err != nil { + return err + } + } + if m.SnapToGrid != nil { + if err := m.SnapToGrid.ValidateWithPath(path + "/SnapToGrid"); err != nil { + return err + } + } + if m.Vanish != nil { + if err := m.Vanish.ValidateWithPath(path + "/Vanish"); err != nil { + return err + } + } + if m.WebHidden != nil { + if err := m.WebHidden.ValidateWithPath(path + "/WebHidden"); err != nil { + return err + } + } + if m.Color != nil { + if err := m.Color.ValidateWithPath(path + "/Color"); err != nil { + return err + } + } + if m.Spacing != nil { + if err := m.Spacing.ValidateWithPath(path + "/Spacing"); err != nil { + return err + } + } + if m.W != nil { + if err := m.W.ValidateWithPath(path + "/W"); err != nil { + return err + } + } + if m.Kern != nil { + if err := m.Kern.ValidateWithPath(path + "/Kern"); err != nil { + return err + } + } + if m.Position != nil { + if err := m.Position.ValidateWithPath(path + "/Position"); err != nil { + return err + } + } + if m.Sz != nil { + if err := m.Sz.ValidateWithPath(path + "/Sz"); err != nil { + return err + } + } + if m.SzCs != nil { + if err := m.SzCs.ValidateWithPath(path + "/SzCs"); err != nil { + return err + } + } + if m.Highlight != nil { + if err := m.Highlight.ValidateWithPath(path + "/Highlight"); err != nil { + return err + } + } + if m.U != nil { + if err := m.U.ValidateWithPath(path + "/U"); err != nil { + return err + } + } + if m.Effect != nil { + if err := m.Effect.ValidateWithPath(path + "/Effect"); err != nil { + return err + } + } + if m.Bdr != nil { + if err := m.Bdr.ValidateWithPath(path + "/Bdr"); err != nil { + return err + } + } + if m.Shd != nil { + if err := m.Shd.ValidateWithPath(path + "/Shd"); err != nil { + return err + } + } + if m.FitText != nil { + if err := m.FitText.ValidateWithPath(path + "/FitText"); err != nil { + return err + } + } + if m.VertAlign != nil { + if err := m.VertAlign.ValidateWithPath(path + "/VertAlign"); err != nil { + return err + } + } + if m.Rtl != nil { + if err := m.Rtl.ValidateWithPath(path + "/Rtl"); err != nil { + return err + } + } + if m.Cs != nil { + if err := m.Cs.ValidateWithPath(path + "/Cs"); err != nil { + return err + } + } + if m.Em != nil { + if err := m.Em.ValidateWithPath(path + "/Em"); err != nil { + return err + } + } + if m.Lang != nil { + if err := m.Lang.ValidateWithPath(path + "/Lang"); err != nil { + return err + } + } + if m.EastAsianLayout != nil { + if err := m.EastAsianLayout.ValidateWithPath(path + "/EastAsianLayout"); err != nil { + return err + } + } + if m.SpecVanish != nil { + if err := m.SpecVanish.ValidateWithPath(path + "/SpecVanish"); err != nil { + return err + } + } + if m.OMath != nil { + if err := m.OMath.ValidateWithPath(path + "/OMath"); err != nil { + return err + } + } + if m.RPrChange != nil { + if err := m.RPrChange.ValidateWithPath(path + "/RPrChange"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_ParaRPrChange.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_ParaRPrChange.go new file mode 100644 index 00000000..03c729f7 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_ParaRPrChange.go @@ -0,0 +1,118 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + "time" + + "baliance.com/gooxml" +) + +type CT_ParaRPrChange struct { + AuthorAttr string + DateAttr *time.Time + // Annotation Identifier + IdAttr int64 + RPr *CT_ParaRPrOriginal +} + +func NewCT_ParaRPrChange() *CT_ParaRPrChange { + ret := &CT_ParaRPrChange{} + ret.RPr = NewCT_ParaRPrOriginal() + return ret +} + +func (m *CT_ParaRPrChange) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:author"}, + Value: fmt.Sprintf("%v", m.AuthorAttr)}) + if m.DateAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:date"}, + Value: fmt.Sprintf("%v", *m.DateAttr)}) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:id"}, + Value: fmt.Sprintf("%v", m.IdAttr)}) + e.EncodeToken(start) + serPr := xml.StartElement{Name: xml.Name{Local: "w:rPr"}} + e.EncodeElement(m.RPr, serPr) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_ParaRPrChange) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.RPr = NewCT_ParaRPrOriginal() + for _, attr := range start.Attr { + if attr.Name.Local == "author" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.AuthorAttr = parsed + continue + } + if attr.Name.Local == "date" { + parsed, err := ParseStdlibTime(attr.Value) + if err != nil { + return err + } + m.DateAttr = &parsed + continue + } + if attr.Name.Local == "id" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.IdAttr = parsed + continue + } + } +lCT_ParaRPrChange: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rPr"}: + if err := d.DecodeElement(m.RPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_ParaRPrChange %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_ParaRPrChange + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_ParaRPrChange and its children +func (m *CT_ParaRPrChange) Validate() error { + return m.ValidateWithPath("CT_ParaRPrChange") +} + +// ValidateWithPath validates the CT_ParaRPrChange and its children, prefixing error messages with path +func (m *CT_ParaRPrChange) ValidateWithPath(path string) error { + if err := m.RPr.ValidateWithPath(path + "/RPr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_ParaRPrOriginal.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_ParaRPrOriginal.go new file mode 100644 index 00000000..6e33fa1f --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_ParaRPrOriginal.go @@ -0,0 +1,753 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_ParaRPrOriginal struct { + // Inserted Paragraph + Ins *CT_TrackChange + // Deleted Paragraph + Del *CT_TrackChange + // Move Source Paragraph + MoveFrom *CT_TrackChange + // Move Destination Paragraph + MoveTo *CT_TrackChange + // Referenced Character Style + RStyle *CT_String + // Run Fonts + RFonts *CT_Fonts + // Bold + B *CT_OnOff + // Complex Script Bold + BCs *CT_OnOff + // Italics + I *CT_OnOff + // Complex Script Italics + ICs *CT_OnOff + // Display All Characters As Capital Letters + Caps *CT_OnOff + // Small Caps + SmallCaps *CT_OnOff + // Single Strikethrough + Strike *CT_OnOff + // Double Strikethrough + Dstrike *CT_OnOff + // Display Character Outline + Outline *CT_OnOff + // Shadow + Shadow *CT_OnOff + // Embossing + Emboss *CT_OnOff + // Imprinting + Imprint *CT_OnOff + // Do Not Check Spelling or Grammar + NoProof *CT_OnOff + // Use Document Grid Settings For Inter-Character Spacing + SnapToGrid *CT_OnOff + // Hidden Text + Vanish *CT_OnOff + // Web Hidden Text + WebHidden *CT_OnOff + // Run Content Color + Color *CT_Color + // Character Spacing Adjustment + Spacing *CT_SignedTwipsMeasure + // Expanded/Compressed Text + W *CT_TextScale + // Font Kerning + Kern *CT_HpsMeasure + // Vertically Raised or Lowered Text + Position *CT_SignedHpsMeasure + // Non-Complex Script Font Size + Sz *CT_HpsMeasure + // Complex Script Font Size + SzCs *CT_HpsMeasure + // Text Highlighting + Highlight *CT_Highlight + // Underline + U *CT_Underline + // Animated Text Effect + Effect *CT_TextEffect + // Text Border + Bdr *CT_Border + // Run Shading + Shd *CT_Shd + // Manual Run Width + FitText *CT_FitText + // Subscript/Superscript Text + VertAlign *CT_VerticalAlignRun + // Right To Left Text + Rtl *CT_OnOff + // Use Complex Script Formatting on Run + Cs *CT_OnOff + // Emphasis Mark + Em *CT_Em + // Languages for Run Content + Lang *CT_Language + // East Asian Typography Settings + EastAsianLayout *CT_EastAsianLayout + // Paragraph Mark Is Always Hidden + SpecVanish *CT_OnOff + // Office Open XML Math + OMath *CT_OnOff +} + +func NewCT_ParaRPrOriginal() *CT_ParaRPrOriginal { + ret := &CT_ParaRPrOriginal{} + return ret +} + +func (m *CT_ParaRPrOriginal) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Ins != nil { + seins := xml.StartElement{Name: xml.Name{Local: "w:ins"}} + e.EncodeElement(m.Ins, seins) + } + if m.Del != nil { + sedel := xml.StartElement{Name: xml.Name{Local: "w:del"}} + e.EncodeElement(m.Del, sedel) + } + if m.MoveFrom != nil { + semoveFrom := xml.StartElement{Name: xml.Name{Local: "w:moveFrom"}} + e.EncodeElement(m.MoveFrom, semoveFrom) + } + if m.MoveTo != nil { + semoveTo := xml.StartElement{Name: xml.Name{Local: "w:moveTo"}} + e.EncodeElement(m.MoveTo, semoveTo) + } + if m.RStyle != nil { + serStyle := xml.StartElement{Name: xml.Name{Local: "w:rStyle"}} + e.EncodeElement(m.RStyle, serStyle) + } + if m.RFonts != nil { + serFonts := xml.StartElement{Name: xml.Name{Local: "w:rFonts"}} + e.EncodeElement(m.RFonts, serFonts) + } + if m.B != nil { + seb := xml.StartElement{Name: xml.Name{Local: "w:b"}} + e.EncodeElement(m.B, seb) + } + if m.BCs != nil { + sebCs := xml.StartElement{Name: xml.Name{Local: "w:bCs"}} + e.EncodeElement(m.BCs, sebCs) + } + if m.I != nil { + sei := xml.StartElement{Name: xml.Name{Local: "w:i"}} + e.EncodeElement(m.I, sei) + } + if m.ICs != nil { + seiCs := xml.StartElement{Name: xml.Name{Local: "w:iCs"}} + e.EncodeElement(m.ICs, seiCs) + } + if m.Caps != nil { + secaps := xml.StartElement{Name: xml.Name{Local: "w:caps"}} + e.EncodeElement(m.Caps, secaps) + } + if m.SmallCaps != nil { + sesmallCaps := xml.StartElement{Name: xml.Name{Local: "w:smallCaps"}} + e.EncodeElement(m.SmallCaps, sesmallCaps) + } + if m.Strike != nil { + sestrike := xml.StartElement{Name: xml.Name{Local: "w:strike"}} + e.EncodeElement(m.Strike, sestrike) + } + if m.Dstrike != nil { + sedstrike := xml.StartElement{Name: xml.Name{Local: "w:dstrike"}} + e.EncodeElement(m.Dstrike, sedstrike) + } + if m.Outline != nil { + seoutline := xml.StartElement{Name: xml.Name{Local: "w:outline"}} + e.EncodeElement(m.Outline, seoutline) + } + if m.Shadow != nil { + seshadow := xml.StartElement{Name: xml.Name{Local: "w:shadow"}} + e.EncodeElement(m.Shadow, seshadow) + } + if m.Emboss != nil { + seemboss := xml.StartElement{Name: xml.Name{Local: "w:emboss"}} + e.EncodeElement(m.Emboss, seemboss) + } + if m.Imprint != nil { + seimprint := xml.StartElement{Name: xml.Name{Local: "w:imprint"}} + e.EncodeElement(m.Imprint, seimprint) + } + if m.NoProof != nil { + senoProof := xml.StartElement{Name: xml.Name{Local: "w:noProof"}} + e.EncodeElement(m.NoProof, senoProof) + } + if m.SnapToGrid != nil { + sesnapToGrid := xml.StartElement{Name: xml.Name{Local: "w:snapToGrid"}} + e.EncodeElement(m.SnapToGrid, sesnapToGrid) + } + if m.Vanish != nil { + sevanish := xml.StartElement{Name: xml.Name{Local: "w:vanish"}} + e.EncodeElement(m.Vanish, sevanish) + } + if m.WebHidden != nil { + sewebHidden := xml.StartElement{Name: xml.Name{Local: "w:webHidden"}} + e.EncodeElement(m.WebHidden, sewebHidden) + } + if m.Color != nil { + secolor := xml.StartElement{Name: xml.Name{Local: "w:color"}} + e.EncodeElement(m.Color, secolor) + } + if m.Spacing != nil { + sespacing := xml.StartElement{Name: xml.Name{Local: "w:spacing"}} + e.EncodeElement(m.Spacing, sespacing) + } + if m.W != nil { + sew := xml.StartElement{Name: xml.Name{Local: "w:w"}} + e.EncodeElement(m.W, sew) + } + if m.Kern != nil { + sekern := xml.StartElement{Name: xml.Name{Local: "w:kern"}} + e.EncodeElement(m.Kern, sekern) + } + if m.Position != nil { + seposition := xml.StartElement{Name: xml.Name{Local: "w:position"}} + e.EncodeElement(m.Position, seposition) + } + if m.Sz != nil { + sesz := xml.StartElement{Name: xml.Name{Local: "w:sz"}} + e.EncodeElement(m.Sz, sesz) + } + if m.SzCs != nil { + seszCs := xml.StartElement{Name: xml.Name{Local: "w:szCs"}} + e.EncodeElement(m.SzCs, seszCs) + } + if m.Highlight != nil { + sehighlight := xml.StartElement{Name: xml.Name{Local: "w:highlight"}} + e.EncodeElement(m.Highlight, sehighlight) + } + if m.U != nil { + seu := xml.StartElement{Name: xml.Name{Local: "w:u"}} + e.EncodeElement(m.U, seu) + } + if m.Effect != nil { + seeffect := xml.StartElement{Name: xml.Name{Local: "w:effect"}} + e.EncodeElement(m.Effect, seeffect) + } + if m.Bdr != nil { + sebdr := xml.StartElement{Name: xml.Name{Local: "w:bdr"}} + e.EncodeElement(m.Bdr, sebdr) + } + if m.Shd != nil { + seshd := xml.StartElement{Name: xml.Name{Local: "w:shd"}} + e.EncodeElement(m.Shd, seshd) + } + if m.FitText != nil { + sefitText := xml.StartElement{Name: xml.Name{Local: "w:fitText"}} + e.EncodeElement(m.FitText, sefitText) + } + if m.VertAlign != nil { + severtAlign := xml.StartElement{Name: xml.Name{Local: "w:vertAlign"}} + e.EncodeElement(m.VertAlign, severtAlign) + } + if m.Rtl != nil { + sertl := xml.StartElement{Name: xml.Name{Local: "w:rtl"}} + e.EncodeElement(m.Rtl, sertl) + } + if m.Cs != nil { + secs := xml.StartElement{Name: xml.Name{Local: "w:cs"}} + e.EncodeElement(m.Cs, secs) + } + if m.Em != nil { + seem := xml.StartElement{Name: xml.Name{Local: "w:em"}} + e.EncodeElement(m.Em, seem) + } + if m.Lang != nil { + selang := xml.StartElement{Name: xml.Name{Local: "w:lang"}} + e.EncodeElement(m.Lang, selang) + } + if m.EastAsianLayout != nil { + seeastAsianLayout := xml.StartElement{Name: xml.Name{Local: "w:eastAsianLayout"}} + e.EncodeElement(m.EastAsianLayout, seeastAsianLayout) + } + if m.SpecVanish != nil { + sespecVanish := xml.StartElement{Name: xml.Name{Local: "w:specVanish"}} + e.EncodeElement(m.SpecVanish, sespecVanish) + } + if m.OMath != nil { + seoMath := xml.StartElement{Name: xml.Name{Local: "w:oMath"}} + e.EncodeElement(m.OMath, seoMath) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_ParaRPrOriginal) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_ParaRPrOriginal: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + m.Ins = NewCT_TrackChange() + if err := d.DecodeElement(m.Ins, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + m.Del = NewCT_TrackChange() + if err := d.DecodeElement(m.Del, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFrom"}: + m.MoveFrom = NewCT_TrackChange() + if err := d.DecodeElement(m.MoveFrom, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveTo"}: + m.MoveTo = NewCT_TrackChange() + if err := d.DecodeElement(m.MoveTo, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rStyle"}: + m.RStyle = NewCT_String() + if err := d.DecodeElement(m.RStyle, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rFonts"}: + m.RFonts = NewCT_Fonts() + if err := d.DecodeElement(m.RFonts, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "b"}: + m.B = NewCT_OnOff() + if err := d.DecodeElement(m.B, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bCs"}: + m.BCs = NewCT_OnOff() + if err := d.DecodeElement(m.BCs, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "i"}: + m.I = NewCT_OnOff() + if err := d.DecodeElement(m.I, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "iCs"}: + m.ICs = NewCT_OnOff() + if err := d.DecodeElement(m.ICs, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "caps"}: + m.Caps = NewCT_OnOff() + if err := d.DecodeElement(m.Caps, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "smallCaps"}: + m.SmallCaps = NewCT_OnOff() + if err := d.DecodeElement(m.SmallCaps, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "strike"}: + m.Strike = NewCT_OnOff() + if err := d.DecodeElement(m.Strike, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "dstrike"}: + m.Dstrike = NewCT_OnOff() + if err := d.DecodeElement(m.Dstrike, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "outline"}: + m.Outline = NewCT_OnOff() + if err := d.DecodeElement(m.Outline, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "shadow"}: + m.Shadow = NewCT_OnOff() + if err := d.DecodeElement(m.Shadow, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "emboss"}: + m.Emboss = NewCT_OnOff() + if err := d.DecodeElement(m.Emboss, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "imprint"}: + m.Imprint = NewCT_OnOff() + if err := d.DecodeElement(m.Imprint, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "noProof"}: + m.NoProof = NewCT_OnOff() + if err := d.DecodeElement(m.NoProof, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "snapToGrid"}: + m.SnapToGrid = NewCT_OnOff() + if err := d.DecodeElement(m.SnapToGrid, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "vanish"}: + m.Vanish = NewCT_OnOff() + if err := d.DecodeElement(m.Vanish, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "webHidden"}: + m.WebHidden = NewCT_OnOff() + if err := d.DecodeElement(m.WebHidden, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "color"}: + m.Color = NewCT_Color() + if err := d.DecodeElement(m.Color, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "spacing"}: + m.Spacing = NewCT_SignedTwipsMeasure() + if err := d.DecodeElement(m.Spacing, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "w"}: + m.W = NewCT_TextScale() + if err := d.DecodeElement(m.W, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "kern"}: + m.Kern = NewCT_HpsMeasure() + if err := d.DecodeElement(m.Kern, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "position"}: + m.Position = NewCT_SignedHpsMeasure() + if err := d.DecodeElement(m.Position, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sz"}: + m.Sz = NewCT_HpsMeasure() + if err := d.DecodeElement(m.Sz, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "szCs"}: + m.SzCs = NewCT_HpsMeasure() + if err := d.DecodeElement(m.SzCs, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "highlight"}: + m.Highlight = NewCT_Highlight() + if err := d.DecodeElement(m.Highlight, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "u"}: + m.U = NewCT_Underline() + if err := d.DecodeElement(m.U, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "effect"}: + m.Effect = NewCT_TextEffect() + if err := d.DecodeElement(m.Effect, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bdr"}: + m.Bdr = NewCT_Border() + if err := d.DecodeElement(m.Bdr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "shd"}: + m.Shd = NewCT_Shd() + if err := d.DecodeElement(m.Shd, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "fitText"}: + m.FitText = NewCT_FitText() + if err := d.DecodeElement(m.FitText, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "vertAlign"}: + m.VertAlign = NewCT_VerticalAlignRun() + if err := d.DecodeElement(m.VertAlign, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rtl"}: + m.Rtl = NewCT_OnOff() + if err := d.DecodeElement(m.Rtl, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "cs"}: + m.Cs = NewCT_OnOff() + if err := d.DecodeElement(m.Cs, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "em"}: + m.Em = NewCT_Em() + if err := d.DecodeElement(m.Em, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "lang"}: + m.Lang = NewCT_Language() + if err := d.DecodeElement(m.Lang, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "eastAsianLayout"}: + m.EastAsianLayout = NewCT_EastAsianLayout() + if err := d.DecodeElement(m.EastAsianLayout, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "specVanish"}: + m.SpecVanish = NewCT_OnOff() + if err := d.DecodeElement(m.SpecVanish, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "oMath"}: + m.OMath = NewCT_OnOff() + if err := d.DecodeElement(m.OMath, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_ParaRPrOriginal %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_ParaRPrOriginal + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_ParaRPrOriginal and its children +func (m *CT_ParaRPrOriginal) Validate() error { + return m.ValidateWithPath("CT_ParaRPrOriginal") +} + +// ValidateWithPath validates the CT_ParaRPrOriginal and its children, prefixing error messages with path +func (m *CT_ParaRPrOriginal) ValidateWithPath(path string) error { + if m.Ins != nil { + if err := m.Ins.ValidateWithPath(path + "/Ins"); err != nil { + return err + } + } + if m.Del != nil { + if err := m.Del.ValidateWithPath(path + "/Del"); err != nil { + return err + } + } + if m.MoveFrom != nil { + if err := m.MoveFrom.ValidateWithPath(path + "/MoveFrom"); err != nil { + return err + } + } + if m.MoveTo != nil { + if err := m.MoveTo.ValidateWithPath(path + "/MoveTo"); err != nil { + return err + } + } + if m.RStyle != nil { + if err := m.RStyle.ValidateWithPath(path + "/RStyle"); err != nil { + return err + } + } + if m.RFonts != nil { + if err := m.RFonts.ValidateWithPath(path + "/RFonts"); err != nil { + return err + } + } + if m.B != nil { + if err := m.B.ValidateWithPath(path + "/B"); err != nil { + return err + } + } + if m.BCs != nil { + if err := m.BCs.ValidateWithPath(path + "/BCs"); err != nil { + return err + } + } + if m.I != nil { + if err := m.I.ValidateWithPath(path + "/I"); err != nil { + return err + } + } + if m.ICs != nil { + if err := m.ICs.ValidateWithPath(path + "/ICs"); err != nil { + return err + } + } + if m.Caps != nil { + if err := m.Caps.ValidateWithPath(path + "/Caps"); err != nil { + return err + } + } + if m.SmallCaps != nil { + if err := m.SmallCaps.ValidateWithPath(path + "/SmallCaps"); err != nil { + return err + } + } + if m.Strike != nil { + if err := m.Strike.ValidateWithPath(path + "/Strike"); err != nil { + return err + } + } + if m.Dstrike != nil { + if err := m.Dstrike.ValidateWithPath(path + "/Dstrike"); err != nil { + return err + } + } + if m.Outline != nil { + if err := m.Outline.ValidateWithPath(path + "/Outline"); err != nil { + return err + } + } + if m.Shadow != nil { + if err := m.Shadow.ValidateWithPath(path + "/Shadow"); err != nil { + return err + } + } + if m.Emboss != nil { + if err := m.Emboss.ValidateWithPath(path + "/Emboss"); err != nil { + return err + } + } + if m.Imprint != nil { + if err := m.Imprint.ValidateWithPath(path + "/Imprint"); err != nil { + return err + } + } + if m.NoProof != nil { + if err := m.NoProof.ValidateWithPath(path + "/NoProof"); err != nil { + return err + } + } + if m.SnapToGrid != nil { + if err := m.SnapToGrid.ValidateWithPath(path + "/SnapToGrid"); err != nil { + return err + } + } + if m.Vanish != nil { + if err := m.Vanish.ValidateWithPath(path + "/Vanish"); err != nil { + return err + } + } + if m.WebHidden != nil { + if err := m.WebHidden.ValidateWithPath(path + "/WebHidden"); err != nil { + return err + } + } + if m.Color != nil { + if err := m.Color.ValidateWithPath(path + "/Color"); err != nil { + return err + } + } + if m.Spacing != nil { + if err := m.Spacing.ValidateWithPath(path + "/Spacing"); err != nil { + return err + } + } + if m.W != nil { + if err := m.W.ValidateWithPath(path + "/W"); err != nil { + return err + } + } + if m.Kern != nil { + if err := m.Kern.ValidateWithPath(path + "/Kern"); err != nil { + return err + } + } + if m.Position != nil { + if err := m.Position.ValidateWithPath(path + "/Position"); err != nil { + return err + } + } + if m.Sz != nil { + if err := m.Sz.ValidateWithPath(path + "/Sz"); err != nil { + return err + } + } + if m.SzCs != nil { + if err := m.SzCs.ValidateWithPath(path + "/SzCs"); err != nil { + return err + } + } + if m.Highlight != nil { + if err := m.Highlight.ValidateWithPath(path + "/Highlight"); err != nil { + return err + } + } + if m.U != nil { + if err := m.U.ValidateWithPath(path + "/U"); err != nil { + return err + } + } + if m.Effect != nil { + if err := m.Effect.ValidateWithPath(path + "/Effect"); err != nil { + return err + } + } + if m.Bdr != nil { + if err := m.Bdr.ValidateWithPath(path + "/Bdr"); err != nil { + return err + } + } + if m.Shd != nil { + if err := m.Shd.ValidateWithPath(path + "/Shd"); err != nil { + return err + } + } + if m.FitText != nil { + if err := m.FitText.ValidateWithPath(path + "/FitText"); err != nil { + return err + } + } + if m.VertAlign != nil { + if err := m.VertAlign.ValidateWithPath(path + "/VertAlign"); err != nil { + return err + } + } + if m.Rtl != nil { + if err := m.Rtl.ValidateWithPath(path + "/Rtl"); err != nil { + return err + } + } + if m.Cs != nil { + if err := m.Cs.ValidateWithPath(path + "/Cs"); err != nil { + return err + } + } + if m.Em != nil { + if err := m.Em.ValidateWithPath(path + "/Em"); err != nil { + return err + } + } + if m.Lang != nil { + if err := m.Lang.ValidateWithPath(path + "/Lang"); err != nil { + return err + } + } + if m.EastAsianLayout != nil { + if err := m.EastAsianLayout.ValidateWithPath(path + "/EastAsianLayout"); err != nil { + return err + } + } + if m.SpecVanish != nil { + if err := m.SpecVanish.ValidateWithPath(path + "/SpecVanish"); err != nil { + return err + } + } + if m.OMath != nil { + if err := m.OMath.ValidateWithPath(path + "/OMath"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Perm.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Perm.go new file mode 100644 index 00000000..17a1fce1 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Perm.go @@ -0,0 +1,84 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_Perm struct { + // Annotation ID + IdAttr string + // Annotation Displaced By Custom XML Markup + DisplacedByCustomXmlAttr ST_DisplacedByCustomXml +} + +func NewCT_Perm() *CT_Perm { + ret := &CT_Perm{} + return ret +} + +func (m *CT_Perm) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:id"}, + Value: fmt.Sprintf("%v", m.IdAttr)}) + if m.DisplacedByCustomXmlAttr != ST_DisplacedByCustomXmlUnset { + attr, err := m.DisplacedByCustomXmlAttr.MarshalXMLAttr(xml.Name{Local: "w:displacedByCustomXml"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Perm) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "id" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.IdAttr = parsed + continue + } + if attr.Name.Local == "displacedByCustomXml" { + m.DisplacedByCustomXmlAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Perm: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Perm and its children +func (m *CT_Perm) Validate() error { + return m.ValidateWithPath("CT_Perm") +} + +// ValidateWithPath validates the CT_Perm and its children, prefixing error messages with path +func (m *CT_Perm) ValidateWithPath(path string) error { + if err := m.DisplacedByCustomXmlAttr.ValidateWithPath(path + "/DisplacedByCustomXmlAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PermStart.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PermStart.go new file mode 100644 index 00000000..b8b92e8b --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PermStart.go @@ -0,0 +1,139 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" +) + +type CT_PermStart struct { + EdGrpAttr ST_EdGrp + EdAttr *string + ColFirstAttr *int64 + ColLastAttr *int64 + // Annotation ID + IdAttr string + // Annotation Displaced By Custom XML Markup + DisplacedByCustomXmlAttr ST_DisplacedByCustomXml +} + +func NewCT_PermStart() *CT_PermStart { + ret := &CT_PermStart{} + return ret +} + +func (m *CT_PermStart) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.EdGrpAttr != ST_EdGrpUnset { + attr, err := m.EdGrpAttr.MarshalXMLAttr(xml.Name{Local: "w:edGrp"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.EdAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:ed"}, + Value: fmt.Sprintf("%v", *m.EdAttr)}) + } + if m.ColFirstAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:colFirst"}, + Value: fmt.Sprintf("%v", *m.ColFirstAttr)}) + } + if m.ColLastAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:colLast"}, + Value: fmt.Sprintf("%v", *m.ColLastAttr)}) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:id"}, + Value: fmt.Sprintf("%v", m.IdAttr)}) + if m.DisplacedByCustomXmlAttr != ST_DisplacedByCustomXmlUnset { + attr, err := m.DisplacedByCustomXmlAttr.MarshalXMLAttr(xml.Name{Local: "w:displacedByCustomXml"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_PermStart) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "edGrp" { + m.EdGrpAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "ed" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.EdAttr = &parsed + continue + } + if attr.Name.Local == "colFirst" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.ColFirstAttr = &parsed + continue + } + if attr.Name.Local == "colLast" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.ColLastAttr = &parsed + continue + } + if attr.Name.Local == "id" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.IdAttr = parsed + continue + } + if attr.Name.Local == "displacedByCustomXml" { + m.DisplacedByCustomXmlAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_PermStart: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_PermStart and its children +func (m *CT_PermStart) Validate() error { + return m.ValidateWithPath("CT_PermStart") +} + +// ValidateWithPath validates the CT_PermStart and its children, prefixing error messages with path +func (m *CT_PermStart) ValidateWithPath(path string) error { + if err := m.EdGrpAttr.ValidateWithPath(path + "/EdGrpAttr"); err != nil { + return err + } + if err := m.DisplacedByCustomXmlAttr.ValidateWithPath(path + "/DisplacedByCustomXmlAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Picture.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Picture.go new file mode 100644 index 00000000..1367fd0f --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Picture.go @@ -0,0 +1,97 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_Picture struct { + // Embedded Video + Movie *CT_Rel + // Floating Embedded Control + Control *CT_Control +} + +func NewCT_Picture() *CT_Picture { + ret := &CT_Picture{} + return ret +} + +func (m *CT_Picture) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Movie != nil { + semovie := xml.StartElement{Name: xml.Name{Local: "w:movie"}} + e.EncodeElement(m.Movie, semovie) + } + if m.Control != nil { + secontrol := xml.StartElement{Name: xml.Name{Local: "w:control"}} + e.EncodeElement(m.Control, secontrol) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Picture) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_Picture: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "movie"}: + m.Movie = NewCT_Rel() + if err := d.DecodeElement(m.Movie, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "control"}: + m.Control = NewCT_Control() + if err := d.DecodeElement(m.Control, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_Picture %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Picture + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Picture and its children +func (m *CT_Picture) Validate() error { + return m.ValidateWithPath("CT_Picture") +} + +// ValidateWithPath validates the CT_Picture and its children, prefixing error messages with path +func (m *CT_Picture) ValidateWithPath(path string) error { + if m.Movie != nil { + if err := m.Movie.ValidateWithPath(path + "/Movie"); err != nil { + return err + } + } + if m.Control != nil { + if err := m.Control.ValidateWithPath(path + "/Control"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Pitch.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Pitch.go new file mode 100644 index 00000000..5eded8aa --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Pitch.go @@ -0,0 +1,75 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_Pitch struct { + // Value + ValAttr ST_Pitch +} + +func NewCT_Pitch() *CT_Pitch { + ret := &CT_Pitch{} + ret.ValAttr = ST_Pitch(1) + return ret +} + +func (m *CT_Pitch) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Pitch) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_Pitch(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Pitch: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Pitch and its children +func (m *CT_Pitch) Validate() error { + return m.ValidateWithPath("CT_Pitch") +} + +// ValidateWithPath validates the CT_Pitch and its children, prefixing error messages with path +func (m *CT_Pitch) ValidateWithPath(path string) error { + if m.ValAttr == ST_PitchUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PixelsMeasure.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PixelsMeasure.go new file mode 100644 index 00000000..8ef637cf --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_PixelsMeasure.go @@ -0,0 +1,69 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" +) + +type CT_PixelsMeasure struct { + // Measurement in Pixels + ValAttr uint64 +} + +func NewCT_PixelsMeasure() *CT_PixelsMeasure { + ret := &CT_PixelsMeasure{} + return ret +} + +func (m *CT_PixelsMeasure) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:val"}, + Value: fmt.Sprintf("%v", m.ValAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_PixelsMeasure) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := strconv.ParseUint(attr.Value, 10, 64) + if err != nil { + return err + } + m.ValAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_PixelsMeasure: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_PixelsMeasure and its children +func (m *CT_PixelsMeasure) Validate() error { + return m.ValidateWithPath("CT_PixelsMeasure") +} + +// ValidateWithPath validates the CT_PixelsMeasure and its children, prefixing error messages with path +func (m *CT_PixelsMeasure) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Placeholder.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Placeholder.go new file mode 100644 index 00000000..2eeef1a2 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Placeholder.go @@ -0,0 +1,78 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_Placeholder struct { + // Document Part Reference + DocPart *CT_String +} + +func NewCT_Placeholder() *CT_Placeholder { + ret := &CT_Placeholder{} + ret.DocPart = NewCT_String() + return ret +} + +func (m *CT_Placeholder) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + sedocPart := xml.StartElement{Name: xml.Name{Local: "w:docPart"}} + e.EncodeElement(m.DocPart, sedocPart) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Placeholder) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.DocPart = NewCT_String() +lCT_Placeholder: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "docPart"}: + if err := d.DecodeElement(m.DocPart, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_Placeholder %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Placeholder + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Placeholder and its children +func (m *CT_Placeholder) Validate() error { + return m.ValidateWithPath("CT_Placeholder") +} + +// ValidateWithPath validates the CT_Placeholder and its children, prefixing error messages with path +func (m *CT_Placeholder) ValidateWithPath(path string) error { + if err := m.DocPart.ValidateWithPath(path + "/DocPart"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Proof.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Proof.go new file mode 100644 index 00000000..2edc2205 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Proof.go @@ -0,0 +1,88 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_Proof struct { + // Spell Checking State + SpellingAttr ST_Proof + // Grammatical Checking State + GrammarAttr ST_Proof +} + +func NewCT_Proof() *CT_Proof { + ret := &CT_Proof{} + return ret +} + +func (m *CT_Proof) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.SpellingAttr != ST_ProofUnset { + attr, err := m.SpellingAttr.MarshalXMLAttr(xml.Name{Local: "w:spelling"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.GrammarAttr != ST_ProofUnset { + attr, err := m.GrammarAttr.MarshalXMLAttr(xml.Name{Local: "w:grammar"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Proof) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "spelling" { + m.SpellingAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "grammar" { + m.GrammarAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Proof: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Proof and its children +func (m *CT_Proof) Validate() error { + return m.ValidateWithPath("CT_Proof") +} + +// ValidateWithPath validates the CT_Proof and its children, prefixing error messages with path +func (m *CT_Proof) ValidateWithPath(path string) error { + if err := m.SpellingAttr.ValidateWithPath(path + "/SpellingAttr"); err != nil { + return err + } + if err := m.GrammarAttr.ValidateWithPath(path + "/GrammarAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_ProofErr.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_ProofErr.go new file mode 100644 index 00000000..304a947d --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_ProofErr.go @@ -0,0 +1,75 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_ProofErr struct { + // Proofing Error Anchor Type + TypeAttr ST_ProofErr +} + +func NewCT_ProofErr() *CT_ProofErr { + ret := &CT_ProofErr{} + ret.TypeAttr = ST_ProofErr(1) + return ret +} + +func (m *CT_ProofErr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.TypeAttr.MarshalXMLAttr(xml.Name{Local: "w:type"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_ProofErr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.TypeAttr = ST_ProofErr(1) + for _, attr := range start.Attr { + if attr.Name.Local == "type" { + m.TypeAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_ProofErr: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_ProofErr and its children +func (m *CT_ProofErr) Validate() error { + return m.ValidateWithPath("CT_ProofErr") +} + +// ValidateWithPath validates the CT_ProofErr and its children, prefixing error messages with path +func (m *CT_ProofErr) ValidateWithPath(path string) error { + if m.TypeAttr == ST_ProofErrUnset { + return fmt.Errorf("%s/TypeAttr is a mandatory field", path) + } + if err := m.TypeAttr.ValidateWithPath(path + "/TypeAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_R.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_R.go new file mode 100644 index 00000000..32e3f532 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_R.go @@ -0,0 +1,375 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_R struct { + // Revision Identifier for Run Properties + RsidRPrAttr *string + // Revision Identifier for Run Deletion + RsidDelAttr *string + // Revision Identifier for Run + RsidRAttr *string + // Run Properties + RPr *CT_RPr + EG_RunInnerContent []*EG_RunInnerContent + Extra []gooxml.Any +} + +func NewCT_R() *CT_R { + ret := &CT_R{} + return ret +} + +func (m *CT_R) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.RsidRPrAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:rsidRPr"}, + Value: fmt.Sprintf("%v", *m.RsidRPrAttr)}) + } + if m.RsidDelAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:rsidDel"}, + Value: fmt.Sprintf("%v", *m.RsidDelAttr)}) + } + if m.RsidRAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:rsidR"}, + Value: fmt.Sprintf("%v", *m.RsidRAttr)}) + } + e.EncodeToken(start) + if m.RPr != nil { + serPr := xml.StartElement{Name: xml.Name{Local: "w:rPr"}} + e.EncodeElement(m.RPr, serPr) + } + if m.EG_RunInnerContent != nil { + for _, c := range m.EG_RunInnerContent { + c.MarshalXML(e, xml.StartElement{}) + } + } + for _, any := range m.Extra { + if err := any.MarshalXML(e, xml.StartElement{}); err != nil { + return err + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_R) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "rsidRPr" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.RsidRPrAttr = &parsed + continue + } + if attr.Name.Local == "rsidDel" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.RsidDelAttr = &parsed + continue + } + if attr.Name.Local == "rsidR" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.RsidRAttr = &parsed + continue + } + } +lCT_R: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rPr"}: + m.RPr = NewCT_RPr() + if err := d.DecodeElement(m.RPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "br"}: + tmpruninnercontent := NewEG_RunInnerContent() + tmpruninnercontent.Br = NewCT_Br() + if err := d.DecodeElement(tmpruninnercontent.Br, &el); err != nil { + return err + } + m.EG_RunInnerContent = append(m.EG_RunInnerContent, tmpruninnercontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "t"}: + tmpruninnercontent := NewEG_RunInnerContent() + tmpruninnercontent.T = NewCT_Text() + if err := d.DecodeElement(tmpruninnercontent.T, &el); err != nil { + return err + } + m.EG_RunInnerContent = append(m.EG_RunInnerContent, tmpruninnercontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "contentPart"}: + tmpruninnercontent := NewEG_RunInnerContent() + tmpruninnercontent.ContentPart = NewCT_Rel() + if err := d.DecodeElement(tmpruninnercontent.ContentPart, &el); err != nil { + return err + } + m.EG_RunInnerContent = append(m.EG_RunInnerContent, tmpruninnercontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "delText"}: + tmpruninnercontent := NewEG_RunInnerContent() + tmpruninnercontent.DelText = NewCT_Text() + if err := d.DecodeElement(tmpruninnercontent.DelText, &el); err != nil { + return err + } + m.EG_RunInnerContent = append(m.EG_RunInnerContent, tmpruninnercontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "instrText"}: + tmpruninnercontent := NewEG_RunInnerContent() + tmpruninnercontent.InstrText = NewCT_Text() + if err := d.DecodeElement(tmpruninnercontent.InstrText, &el); err != nil { + return err + } + m.EG_RunInnerContent = append(m.EG_RunInnerContent, tmpruninnercontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "delInstrText"}: + tmpruninnercontent := NewEG_RunInnerContent() + tmpruninnercontent.DelInstrText = NewCT_Text() + if err := d.DecodeElement(tmpruninnercontent.DelInstrText, &el); err != nil { + return err + } + m.EG_RunInnerContent = append(m.EG_RunInnerContent, tmpruninnercontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "noBreakHyphen"}: + tmpruninnercontent := NewEG_RunInnerContent() + tmpruninnercontent.NoBreakHyphen = NewCT_Empty() + if err := d.DecodeElement(tmpruninnercontent.NoBreakHyphen, &el); err != nil { + return err + } + m.EG_RunInnerContent = append(m.EG_RunInnerContent, tmpruninnercontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "softHyphen"}: + tmpruninnercontent := NewEG_RunInnerContent() + tmpruninnercontent.SoftHyphen = NewCT_Empty() + if err := d.DecodeElement(tmpruninnercontent.SoftHyphen, &el); err != nil { + return err + } + m.EG_RunInnerContent = append(m.EG_RunInnerContent, tmpruninnercontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "dayShort"}: + tmpruninnercontent := NewEG_RunInnerContent() + tmpruninnercontent.DayShort = NewCT_Empty() + if err := d.DecodeElement(tmpruninnercontent.DayShort, &el); err != nil { + return err + } + m.EG_RunInnerContent = append(m.EG_RunInnerContent, tmpruninnercontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "monthShort"}: + tmpruninnercontent := NewEG_RunInnerContent() + tmpruninnercontent.MonthShort = NewCT_Empty() + if err := d.DecodeElement(tmpruninnercontent.MonthShort, &el); err != nil { + return err + } + m.EG_RunInnerContent = append(m.EG_RunInnerContent, tmpruninnercontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "yearShort"}: + tmpruninnercontent := NewEG_RunInnerContent() + tmpruninnercontent.YearShort = NewCT_Empty() + if err := d.DecodeElement(tmpruninnercontent.YearShort, &el); err != nil { + return err + } + m.EG_RunInnerContent = append(m.EG_RunInnerContent, tmpruninnercontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "dayLong"}: + tmpruninnercontent := NewEG_RunInnerContent() + tmpruninnercontent.DayLong = NewCT_Empty() + if err := d.DecodeElement(tmpruninnercontent.DayLong, &el); err != nil { + return err + } + m.EG_RunInnerContent = append(m.EG_RunInnerContent, tmpruninnercontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "monthLong"}: + tmpruninnercontent := NewEG_RunInnerContent() + tmpruninnercontent.MonthLong = NewCT_Empty() + if err := d.DecodeElement(tmpruninnercontent.MonthLong, &el); err != nil { + return err + } + m.EG_RunInnerContent = append(m.EG_RunInnerContent, tmpruninnercontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "yearLong"}: + tmpruninnercontent := NewEG_RunInnerContent() + tmpruninnercontent.YearLong = NewCT_Empty() + if err := d.DecodeElement(tmpruninnercontent.YearLong, &el); err != nil { + return err + } + m.EG_RunInnerContent = append(m.EG_RunInnerContent, tmpruninnercontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "annotationRef"}: + tmpruninnercontent := NewEG_RunInnerContent() + tmpruninnercontent.AnnotationRef = NewCT_Empty() + if err := d.DecodeElement(tmpruninnercontent.AnnotationRef, &el); err != nil { + return err + } + m.EG_RunInnerContent = append(m.EG_RunInnerContent, tmpruninnercontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "footnoteRef"}: + tmpruninnercontent := NewEG_RunInnerContent() + tmpruninnercontent.FootnoteRef = NewCT_Empty() + if err := d.DecodeElement(tmpruninnercontent.FootnoteRef, &el); err != nil { + return err + } + m.EG_RunInnerContent = append(m.EG_RunInnerContent, tmpruninnercontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "endnoteRef"}: + tmpruninnercontent := NewEG_RunInnerContent() + tmpruninnercontent.EndnoteRef = NewCT_Empty() + if err := d.DecodeElement(tmpruninnercontent.EndnoteRef, &el); err != nil { + return err + } + m.EG_RunInnerContent = append(m.EG_RunInnerContent, tmpruninnercontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "separator"}: + tmpruninnercontent := NewEG_RunInnerContent() + tmpruninnercontent.Separator = NewCT_Empty() + if err := d.DecodeElement(tmpruninnercontent.Separator, &el); err != nil { + return err + } + m.EG_RunInnerContent = append(m.EG_RunInnerContent, tmpruninnercontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "continuationSeparator"}: + tmpruninnercontent := NewEG_RunInnerContent() + tmpruninnercontent.ContinuationSeparator = NewCT_Empty() + if err := d.DecodeElement(tmpruninnercontent.ContinuationSeparator, &el); err != nil { + return err + } + m.EG_RunInnerContent = append(m.EG_RunInnerContent, tmpruninnercontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sym"}: + tmpruninnercontent := NewEG_RunInnerContent() + tmpruninnercontent.Sym = NewCT_Sym() + if err := d.DecodeElement(tmpruninnercontent.Sym, &el); err != nil { + return err + } + m.EG_RunInnerContent = append(m.EG_RunInnerContent, tmpruninnercontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pgNum"}: + tmpruninnercontent := NewEG_RunInnerContent() + tmpruninnercontent.PgNum = NewCT_Empty() + if err := d.DecodeElement(tmpruninnercontent.PgNum, &el); err != nil { + return err + } + m.EG_RunInnerContent = append(m.EG_RunInnerContent, tmpruninnercontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "cr"}: + tmpruninnercontent := NewEG_RunInnerContent() + tmpruninnercontent.Cr = NewCT_Empty() + if err := d.DecodeElement(tmpruninnercontent.Cr, &el); err != nil { + return err + } + m.EG_RunInnerContent = append(m.EG_RunInnerContent, tmpruninnercontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tab"}: + tmpruninnercontent := NewEG_RunInnerContent() + tmpruninnercontent.Tab = NewCT_Empty() + if err := d.DecodeElement(tmpruninnercontent.Tab, &el); err != nil { + return err + } + m.EG_RunInnerContent = append(m.EG_RunInnerContent, tmpruninnercontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "object"}: + tmpruninnercontent := NewEG_RunInnerContent() + tmpruninnercontent.Object = NewCT_Object() + if err := d.DecodeElement(tmpruninnercontent.Object, &el); err != nil { + return err + } + m.EG_RunInnerContent = append(m.EG_RunInnerContent, tmpruninnercontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pict"}: + tmpruninnercontent := NewEG_RunInnerContent() + tmpruninnercontent.Pict = NewCT_Picture() + if err := d.DecodeElement(tmpruninnercontent.Pict, &el); err != nil { + return err + } + m.EG_RunInnerContent = append(m.EG_RunInnerContent, tmpruninnercontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "fldChar"}: + tmpruninnercontent := NewEG_RunInnerContent() + tmpruninnercontent.FldChar = NewCT_FldChar() + if err := d.DecodeElement(tmpruninnercontent.FldChar, &el); err != nil { + return err + } + m.EG_RunInnerContent = append(m.EG_RunInnerContent, tmpruninnercontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ruby"}: + tmpruninnercontent := NewEG_RunInnerContent() + tmpruninnercontent.Ruby = NewCT_Ruby() + if err := d.DecodeElement(tmpruninnercontent.Ruby, &el); err != nil { + return err + } + m.EG_RunInnerContent = append(m.EG_RunInnerContent, tmpruninnercontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "footnoteReference"}: + tmpruninnercontent := NewEG_RunInnerContent() + tmpruninnercontent.FootnoteReference = NewCT_FtnEdnRef() + if err := d.DecodeElement(tmpruninnercontent.FootnoteReference, &el); err != nil { + return err + } + m.EG_RunInnerContent = append(m.EG_RunInnerContent, tmpruninnercontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "endnoteReference"}: + tmpruninnercontent := NewEG_RunInnerContent() + tmpruninnercontent.EndnoteReference = NewCT_FtnEdnRef() + if err := d.DecodeElement(tmpruninnercontent.EndnoteReference, &el); err != nil { + return err + } + m.EG_RunInnerContent = append(m.EG_RunInnerContent, tmpruninnercontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentReference"}: + tmpruninnercontent := NewEG_RunInnerContent() + tmpruninnercontent.CommentReference = NewCT_Markup() + if err := d.DecodeElement(tmpruninnercontent.CommentReference, &el); err != nil { + return err + } + m.EG_RunInnerContent = append(m.EG_RunInnerContent, tmpruninnercontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "drawing"}: + tmpruninnercontent := NewEG_RunInnerContent() + tmpruninnercontent.Drawing = NewCT_Drawing() + if err := d.DecodeElement(tmpruninnercontent.Drawing, &el); err != nil { + return err + } + m.EG_RunInnerContent = append(m.EG_RunInnerContent, tmpruninnercontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ptab"}: + tmpruninnercontent := NewEG_RunInnerContent() + tmpruninnercontent.Ptab = NewCT_PTab() + if err := d.DecodeElement(tmpruninnercontent.Ptab, &el); err != nil { + return err + } + m.EG_RunInnerContent = append(m.EG_RunInnerContent, tmpruninnercontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "lastRenderedPageBreak"}: + tmpruninnercontent := NewEG_RunInnerContent() + tmpruninnercontent.LastRenderedPageBreak = NewCT_Empty() + if err := d.DecodeElement(tmpruninnercontent.LastRenderedPageBreak, &el); err != nil { + return err + } + m.EG_RunInnerContent = append(m.EG_RunInnerContent, tmpruninnercontent) + default: + any := &gooxml.XSDAny{} + if err := d.DecodeElement(any, &el); err != nil { + return err + } + m.Extra = append(m.Extra, any) + } + case xml.EndElement: + break lCT_R + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_R and its children +func (m *CT_R) Validate() error { + return m.ValidateWithPath("CT_R") +} + +// ValidateWithPath validates the CT_R and its children, prefixing error messages with path +func (m *CT_R) ValidateWithPath(path string) error { + if m.RPr != nil { + if err := m.RPr.ValidateWithPath(path + "/RPr"); err != nil { + return err + } + } + for i, v := range m.EG_RunInnerContent { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_RunInnerContent[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_RPr.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_RPr.go new file mode 100644 index 00000000..68c850cf --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_RPr.go @@ -0,0 +1,705 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_RPr struct { + // Referenced Character Style + RStyle *CT_String + // Run Fonts + RFonts *CT_Fonts + // Bold + B *CT_OnOff + // Complex Script Bold + BCs *CT_OnOff + // Italics + I *CT_OnOff + // Complex Script Italics + ICs *CT_OnOff + // Display All Characters As Capital Letters + Caps *CT_OnOff + // Small Caps + SmallCaps *CT_OnOff + // Single Strikethrough + Strike *CT_OnOff + // Double Strikethrough + Dstrike *CT_OnOff + // Display Character Outline + Outline *CT_OnOff + // Shadow + Shadow *CT_OnOff + // Embossing + Emboss *CT_OnOff + // Imprinting + Imprint *CT_OnOff + // Do Not Check Spelling or Grammar + NoProof *CT_OnOff + // Use Document Grid Settings For Inter-Character Spacing + SnapToGrid *CT_OnOff + // Hidden Text + Vanish *CT_OnOff + // Web Hidden Text + WebHidden *CT_OnOff + // Run Content Color + Color *CT_Color + // Character Spacing Adjustment + Spacing *CT_SignedTwipsMeasure + // Expanded/Compressed Text + W *CT_TextScale + // Font Kerning + Kern *CT_HpsMeasure + // Vertically Raised or Lowered Text + Position *CT_SignedHpsMeasure + // Non-Complex Script Font Size + Sz *CT_HpsMeasure + // Complex Script Font Size + SzCs *CT_HpsMeasure + // Text Highlighting + Highlight *CT_Highlight + // Underline + U *CT_Underline + // Animated Text Effect + Effect *CT_TextEffect + // Text Border + Bdr *CT_Border + // Run Shading + Shd *CT_Shd + // Manual Run Width + FitText *CT_FitText + // Subscript/Superscript Text + VertAlign *CT_VerticalAlignRun + // Right To Left Text + Rtl *CT_OnOff + // Use Complex Script Formatting on Run + Cs *CT_OnOff + // Emphasis Mark + Em *CT_Em + // Languages for Run Content + Lang *CT_Language + // East Asian Typography Settings + EastAsianLayout *CT_EastAsianLayout + // Paragraph Mark Is Always Hidden + SpecVanish *CT_OnOff + // Office Open XML Math + OMath *CT_OnOff + // Revision Information for Run Properties + RPrChange *CT_RPrChange +} + +func NewCT_RPr() *CT_RPr { + ret := &CT_RPr{} + return ret +} + +func (m *CT_RPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.RStyle != nil { + serStyle := xml.StartElement{Name: xml.Name{Local: "w:rStyle"}} + e.EncodeElement(m.RStyle, serStyle) + } + if m.RFonts != nil { + serFonts := xml.StartElement{Name: xml.Name{Local: "w:rFonts"}} + e.EncodeElement(m.RFonts, serFonts) + } + if m.B != nil { + seb := xml.StartElement{Name: xml.Name{Local: "w:b"}} + e.EncodeElement(m.B, seb) + } + if m.BCs != nil { + sebCs := xml.StartElement{Name: xml.Name{Local: "w:bCs"}} + e.EncodeElement(m.BCs, sebCs) + } + if m.I != nil { + sei := xml.StartElement{Name: xml.Name{Local: "w:i"}} + e.EncodeElement(m.I, sei) + } + if m.ICs != nil { + seiCs := xml.StartElement{Name: xml.Name{Local: "w:iCs"}} + e.EncodeElement(m.ICs, seiCs) + } + if m.Caps != nil { + secaps := xml.StartElement{Name: xml.Name{Local: "w:caps"}} + e.EncodeElement(m.Caps, secaps) + } + if m.SmallCaps != nil { + sesmallCaps := xml.StartElement{Name: xml.Name{Local: "w:smallCaps"}} + e.EncodeElement(m.SmallCaps, sesmallCaps) + } + if m.Strike != nil { + sestrike := xml.StartElement{Name: xml.Name{Local: "w:strike"}} + e.EncodeElement(m.Strike, sestrike) + } + if m.Dstrike != nil { + sedstrike := xml.StartElement{Name: xml.Name{Local: "w:dstrike"}} + e.EncodeElement(m.Dstrike, sedstrike) + } + if m.Outline != nil { + seoutline := xml.StartElement{Name: xml.Name{Local: "w:outline"}} + e.EncodeElement(m.Outline, seoutline) + } + if m.Shadow != nil { + seshadow := xml.StartElement{Name: xml.Name{Local: "w:shadow"}} + e.EncodeElement(m.Shadow, seshadow) + } + if m.Emboss != nil { + seemboss := xml.StartElement{Name: xml.Name{Local: "w:emboss"}} + e.EncodeElement(m.Emboss, seemboss) + } + if m.Imprint != nil { + seimprint := xml.StartElement{Name: xml.Name{Local: "w:imprint"}} + e.EncodeElement(m.Imprint, seimprint) + } + if m.NoProof != nil { + senoProof := xml.StartElement{Name: xml.Name{Local: "w:noProof"}} + e.EncodeElement(m.NoProof, senoProof) + } + if m.SnapToGrid != nil { + sesnapToGrid := xml.StartElement{Name: xml.Name{Local: "w:snapToGrid"}} + e.EncodeElement(m.SnapToGrid, sesnapToGrid) + } + if m.Vanish != nil { + sevanish := xml.StartElement{Name: xml.Name{Local: "w:vanish"}} + e.EncodeElement(m.Vanish, sevanish) + } + if m.WebHidden != nil { + sewebHidden := xml.StartElement{Name: xml.Name{Local: "w:webHidden"}} + e.EncodeElement(m.WebHidden, sewebHidden) + } + if m.Color != nil { + secolor := xml.StartElement{Name: xml.Name{Local: "w:color"}} + e.EncodeElement(m.Color, secolor) + } + if m.Spacing != nil { + sespacing := xml.StartElement{Name: xml.Name{Local: "w:spacing"}} + e.EncodeElement(m.Spacing, sespacing) + } + if m.W != nil { + sew := xml.StartElement{Name: xml.Name{Local: "w:w"}} + e.EncodeElement(m.W, sew) + } + if m.Kern != nil { + sekern := xml.StartElement{Name: xml.Name{Local: "w:kern"}} + e.EncodeElement(m.Kern, sekern) + } + if m.Position != nil { + seposition := xml.StartElement{Name: xml.Name{Local: "w:position"}} + e.EncodeElement(m.Position, seposition) + } + if m.Sz != nil { + sesz := xml.StartElement{Name: xml.Name{Local: "w:sz"}} + e.EncodeElement(m.Sz, sesz) + } + if m.SzCs != nil { + seszCs := xml.StartElement{Name: xml.Name{Local: "w:szCs"}} + e.EncodeElement(m.SzCs, seszCs) + } + if m.Highlight != nil { + sehighlight := xml.StartElement{Name: xml.Name{Local: "w:highlight"}} + e.EncodeElement(m.Highlight, sehighlight) + } + if m.U != nil { + seu := xml.StartElement{Name: xml.Name{Local: "w:u"}} + e.EncodeElement(m.U, seu) + } + if m.Effect != nil { + seeffect := xml.StartElement{Name: xml.Name{Local: "w:effect"}} + e.EncodeElement(m.Effect, seeffect) + } + if m.Bdr != nil { + sebdr := xml.StartElement{Name: xml.Name{Local: "w:bdr"}} + e.EncodeElement(m.Bdr, sebdr) + } + if m.Shd != nil { + seshd := xml.StartElement{Name: xml.Name{Local: "w:shd"}} + e.EncodeElement(m.Shd, seshd) + } + if m.FitText != nil { + sefitText := xml.StartElement{Name: xml.Name{Local: "w:fitText"}} + e.EncodeElement(m.FitText, sefitText) + } + if m.VertAlign != nil { + severtAlign := xml.StartElement{Name: xml.Name{Local: "w:vertAlign"}} + e.EncodeElement(m.VertAlign, severtAlign) + } + if m.Rtl != nil { + sertl := xml.StartElement{Name: xml.Name{Local: "w:rtl"}} + e.EncodeElement(m.Rtl, sertl) + } + if m.Cs != nil { + secs := xml.StartElement{Name: xml.Name{Local: "w:cs"}} + e.EncodeElement(m.Cs, secs) + } + if m.Em != nil { + seem := xml.StartElement{Name: xml.Name{Local: "w:em"}} + e.EncodeElement(m.Em, seem) + } + if m.Lang != nil { + selang := xml.StartElement{Name: xml.Name{Local: "w:lang"}} + e.EncodeElement(m.Lang, selang) + } + if m.EastAsianLayout != nil { + seeastAsianLayout := xml.StartElement{Name: xml.Name{Local: "w:eastAsianLayout"}} + e.EncodeElement(m.EastAsianLayout, seeastAsianLayout) + } + if m.SpecVanish != nil { + sespecVanish := xml.StartElement{Name: xml.Name{Local: "w:specVanish"}} + e.EncodeElement(m.SpecVanish, sespecVanish) + } + if m.OMath != nil { + seoMath := xml.StartElement{Name: xml.Name{Local: "w:oMath"}} + e.EncodeElement(m.OMath, seoMath) + } + if m.RPrChange != nil { + serPrChange := xml.StartElement{Name: xml.Name{Local: "w:rPrChange"}} + e.EncodeElement(m.RPrChange, serPrChange) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_RPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_RPr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rStyle"}: + m.RStyle = NewCT_String() + if err := d.DecodeElement(m.RStyle, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rFonts"}: + m.RFonts = NewCT_Fonts() + if err := d.DecodeElement(m.RFonts, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "b"}: + m.B = NewCT_OnOff() + if err := d.DecodeElement(m.B, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bCs"}: + m.BCs = NewCT_OnOff() + if err := d.DecodeElement(m.BCs, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "i"}: + m.I = NewCT_OnOff() + if err := d.DecodeElement(m.I, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "iCs"}: + m.ICs = NewCT_OnOff() + if err := d.DecodeElement(m.ICs, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "caps"}: + m.Caps = NewCT_OnOff() + if err := d.DecodeElement(m.Caps, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "smallCaps"}: + m.SmallCaps = NewCT_OnOff() + if err := d.DecodeElement(m.SmallCaps, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "strike"}: + m.Strike = NewCT_OnOff() + if err := d.DecodeElement(m.Strike, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "dstrike"}: + m.Dstrike = NewCT_OnOff() + if err := d.DecodeElement(m.Dstrike, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "outline"}: + m.Outline = NewCT_OnOff() + if err := d.DecodeElement(m.Outline, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "shadow"}: + m.Shadow = NewCT_OnOff() + if err := d.DecodeElement(m.Shadow, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "emboss"}: + m.Emboss = NewCT_OnOff() + if err := d.DecodeElement(m.Emboss, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "imprint"}: + m.Imprint = NewCT_OnOff() + if err := d.DecodeElement(m.Imprint, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "noProof"}: + m.NoProof = NewCT_OnOff() + if err := d.DecodeElement(m.NoProof, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "snapToGrid"}: + m.SnapToGrid = NewCT_OnOff() + if err := d.DecodeElement(m.SnapToGrid, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "vanish"}: + m.Vanish = NewCT_OnOff() + if err := d.DecodeElement(m.Vanish, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "webHidden"}: + m.WebHidden = NewCT_OnOff() + if err := d.DecodeElement(m.WebHidden, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "color"}: + m.Color = NewCT_Color() + if err := d.DecodeElement(m.Color, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "spacing"}: + m.Spacing = NewCT_SignedTwipsMeasure() + if err := d.DecodeElement(m.Spacing, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "w"}: + m.W = NewCT_TextScale() + if err := d.DecodeElement(m.W, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "kern"}: + m.Kern = NewCT_HpsMeasure() + if err := d.DecodeElement(m.Kern, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "position"}: + m.Position = NewCT_SignedHpsMeasure() + if err := d.DecodeElement(m.Position, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sz"}: + m.Sz = NewCT_HpsMeasure() + if err := d.DecodeElement(m.Sz, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "szCs"}: + m.SzCs = NewCT_HpsMeasure() + if err := d.DecodeElement(m.SzCs, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "highlight"}: + m.Highlight = NewCT_Highlight() + if err := d.DecodeElement(m.Highlight, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "u"}: + m.U = NewCT_Underline() + if err := d.DecodeElement(m.U, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "effect"}: + m.Effect = NewCT_TextEffect() + if err := d.DecodeElement(m.Effect, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bdr"}: + m.Bdr = NewCT_Border() + if err := d.DecodeElement(m.Bdr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "shd"}: + m.Shd = NewCT_Shd() + if err := d.DecodeElement(m.Shd, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "fitText"}: + m.FitText = NewCT_FitText() + if err := d.DecodeElement(m.FitText, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "vertAlign"}: + m.VertAlign = NewCT_VerticalAlignRun() + if err := d.DecodeElement(m.VertAlign, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rtl"}: + m.Rtl = NewCT_OnOff() + if err := d.DecodeElement(m.Rtl, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "cs"}: + m.Cs = NewCT_OnOff() + if err := d.DecodeElement(m.Cs, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "em"}: + m.Em = NewCT_Em() + if err := d.DecodeElement(m.Em, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "lang"}: + m.Lang = NewCT_Language() + if err := d.DecodeElement(m.Lang, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "eastAsianLayout"}: + m.EastAsianLayout = NewCT_EastAsianLayout() + if err := d.DecodeElement(m.EastAsianLayout, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "specVanish"}: + m.SpecVanish = NewCT_OnOff() + if err := d.DecodeElement(m.SpecVanish, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "oMath"}: + m.OMath = NewCT_OnOff() + if err := d.DecodeElement(m.OMath, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rPrChange"}: + m.RPrChange = NewCT_RPrChange() + if err := d.DecodeElement(m.RPrChange, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_RPr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_RPr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_RPr and its children +func (m *CT_RPr) Validate() error { + return m.ValidateWithPath("CT_RPr") +} + +// ValidateWithPath validates the CT_RPr and its children, prefixing error messages with path +func (m *CT_RPr) ValidateWithPath(path string) error { + if m.RStyle != nil { + if err := m.RStyle.ValidateWithPath(path + "/RStyle"); err != nil { + return err + } + } + if m.RFonts != nil { + if err := m.RFonts.ValidateWithPath(path + "/RFonts"); err != nil { + return err + } + } + if m.B != nil { + if err := m.B.ValidateWithPath(path + "/B"); err != nil { + return err + } + } + if m.BCs != nil { + if err := m.BCs.ValidateWithPath(path + "/BCs"); err != nil { + return err + } + } + if m.I != nil { + if err := m.I.ValidateWithPath(path + "/I"); err != nil { + return err + } + } + if m.ICs != nil { + if err := m.ICs.ValidateWithPath(path + "/ICs"); err != nil { + return err + } + } + if m.Caps != nil { + if err := m.Caps.ValidateWithPath(path + "/Caps"); err != nil { + return err + } + } + if m.SmallCaps != nil { + if err := m.SmallCaps.ValidateWithPath(path + "/SmallCaps"); err != nil { + return err + } + } + if m.Strike != nil { + if err := m.Strike.ValidateWithPath(path + "/Strike"); err != nil { + return err + } + } + if m.Dstrike != nil { + if err := m.Dstrike.ValidateWithPath(path + "/Dstrike"); err != nil { + return err + } + } + if m.Outline != nil { + if err := m.Outline.ValidateWithPath(path + "/Outline"); err != nil { + return err + } + } + if m.Shadow != nil { + if err := m.Shadow.ValidateWithPath(path + "/Shadow"); err != nil { + return err + } + } + if m.Emboss != nil { + if err := m.Emboss.ValidateWithPath(path + "/Emboss"); err != nil { + return err + } + } + if m.Imprint != nil { + if err := m.Imprint.ValidateWithPath(path + "/Imprint"); err != nil { + return err + } + } + if m.NoProof != nil { + if err := m.NoProof.ValidateWithPath(path + "/NoProof"); err != nil { + return err + } + } + if m.SnapToGrid != nil { + if err := m.SnapToGrid.ValidateWithPath(path + "/SnapToGrid"); err != nil { + return err + } + } + if m.Vanish != nil { + if err := m.Vanish.ValidateWithPath(path + "/Vanish"); err != nil { + return err + } + } + if m.WebHidden != nil { + if err := m.WebHidden.ValidateWithPath(path + "/WebHidden"); err != nil { + return err + } + } + if m.Color != nil { + if err := m.Color.ValidateWithPath(path + "/Color"); err != nil { + return err + } + } + if m.Spacing != nil { + if err := m.Spacing.ValidateWithPath(path + "/Spacing"); err != nil { + return err + } + } + if m.W != nil { + if err := m.W.ValidateWithPath(path + "/W"); err != nil { + return err + } + } + if m.Kern != nil { + if err := m.Kern.ValidateWithPath(path + "/Kern"); err != nil { + return err + } + } + if m.Position != nil { + if err := m.Position.ValidateWithPath(path + "/Position"); err != nil { + return err + } + } + if m.Sz != nil { + if err := m.Sz.ValidateWithPath(path + "/Sz"); err != nil { + return err + } + } + if m.SzCs != nil { + if err := m.SzCs.ValidateWithPath(path + "/SzCs"); err != nil { + return err + } + } + if m.Highlight != nil { + if err := m.Highlight.ValidateWithPath(path + "/Highlight"); err != nil { + return err + } + } + if m.U != nil { + if err := m.U.ValidateWithPath(path + "/U"); err != nil { + return err + } + } + if m.Effect != nil { + if err := m.Effect.ValidateWithPath(path + "/Effect"); err != nil { + return err + } + } + if m.Bdr != nil { + if err := m.Bdr.ValidateWithPath(path + "/Bdr"); err != nil { + return err + } + } + if m.Shd != nil { + if err := m.Shd.ValidateWithPath(path + "/Shd"); err != nil { + return err + } + } + if m.FitText != nil { + if err := m.FitText.ValidateWithPath(path + "/FitText"); err != nil { + return err + } + } + if m.VertAlign != nil { + if err := m.VertAlign.ValidateWithPath(path + "/VertAlign"); err != nil { + return err + } + } + if m.Rtl != nil { + if err := m.Rtl.ValidateWithPath(path + "/Rtl"); err != nil { + return err + } + } + if m.Cs != nil { + if err := m.Cs.ValidateWithPath(path + "/Cs"); err != nil { + return err + } + } + if m.Em != nil { + if err := m.Em.ValidateWithPath(path + "/Em"); err != nil { + return err + } + } + if m.Lang != nil { + if err := m.Lang.ValidateWithPath(path + "/Lang"); err != nil { + return err + } + } + if m.EastAsianLayout != nil { + if err := m.EastAsianLayout.ValidateWithPath(path + "/EastAsianLayout"); err != nil { + return err + } + } + if m.SpecVanish != nil { + if err := m.SpecVanish.ValidateWithPath(path + "/SpecVanish"); err != nil { + return err + } + } + if m.OMath != nil { + if err := m.OMath.ValidateWithPath(path + "/OMath"); err != nil { + return err + } + } + if m.RPrChange != nil { + if err := m.RPrChange.ValidateWithPath(path + "/RPrChange"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_RPrChange.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_RPrChange.go new file mode 100644 index 00000000..8987bf7e --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_RPrChange.go @@ -0,0 +1,118 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + "time" + + "baliance.com/gooxml" +) + +type CT_RPrChange struct { + AuthorAttr string + DateAttr *time.Time + // Annotation Identifier + IdAttr int64 + RPr *CT_RPrOriginal +} + +func NewCT_RPrChange() *CT_RPrChange { + ret := &CT_RPrChange{} + ret.RPr = NewCT_RPrOriginal() + return ret +} + +func (m *CT_RPrChange) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:author"}, + Value: fmt.Sprintf("%v", m.AuthorAttr)}) + if m.DateAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:date"}, + Value: fmt.Sprintf("%v", *m.DateAttr)}) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:id"}, + Value: fmt.Sprintf("%v", m.IdAttr)}) + e.EncodeToken(start) + serPr := xml.StartElement{Name: xml.Name{Local: "w:rPr"}} + e.EncodeElement(m.RPr, serPr) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_RPrChange) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.RPr = NewCT_RPrOriginal() + for _, attr := range start.Attr { + if attr.Name.Local == "author" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.AuthorAttr = parsed + continue + } + if attr.Name.Local == "date" { + parsed, err := ParseStdlibTime(attr.Value) + if err != nil { + return err + } + m.DateAttr = &parsed + continue + } + if attr.Name.Local == "id" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.IdAttr = parsed + continue + } + } +lCT_RPrChange: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rPr"}: + if err := d.DecodeElement(m.RPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_RPrChange %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_RPrChange + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_RPrChange and its children +func (m *CT_RPrChange) Validate() error { + return m.ValidateWithPath("CT_RPrChange") +} + +// ValidateWithPath validates the CT_RPrChange and its children, prefixing error messages with path +func (m *CT_RPrChange) ValidateWithPath(path string) error { + if err := m.RPr.ValidateWithPath(path + "/RPr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_RPrDefault.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_RPrDefault.go new file mode 100644 index 00000000..c5931071 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_RPrDefault.go @@ -0,0 +1,81 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_RPrDefault struct { + // Run Properties + RPr *CT_RPr +} + +func NewCT_RPrDefault() *CT_RPrDefault { + ret := &CT_RPrDefault{} + return ret +} + +func (m *CT_RPrDefault) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.RPr != nil { + serPr := xml.StartElement{Name: xml.Name{Local: "w:rPr"}} + e.EncodeElement(m.RPr, serPr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_RPrDefault) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_RPrDefault: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rPr"}: + m.RPr = NewCT_RPr() + if err := d.DecodeElement(m.RPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_RPrDefault %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_RPrDefault + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_RPrDefault and its children +func (m *CT_RPrDefault) Validate() error { + return m.ValidateWithPath("CT_RPrDefault") +} + +// ValidateWithPath validates the CT_RPrDefault and its children, prefixing error messages with path +func (m *CT_RPrDefault) ValidateWithPath(path string) error { + if m.RPr != nil { + if err := m.RPr.ValidateWithPath(path + "/RPr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_RPrOriginal.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_RPrOriginal.go new file mode 100644 index 00000000..f63d8c94 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_RPrOriginal.go @@ -0,0 +1,689 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_RPrOriginal struct { + // Referenced Character Style + RStyle *CT_String + // Run Fonts + RFonts *CT_Fonts + // Bold + B *CT_OnOff + // Complex Script Bold + BCs *CT_OnOff + // Italics + I *CT_OnOff + // Complex Script Italics + ICs *CT_OnOff + // Display All Characters As Capital Letters + Caps *CT_OnOff + // Small Caps + SmallCaps *CT_OnOff + // Single Strikethrough + Strike *CT_OnOff + // Double Strikethrough + Dstrike *CT_OnOff + // Display Character Outline + Outline *CT_OnOff + // Shadow + Shadow *CT_OnOff + // Embossing + Emboss *CT_OnOff + // Imprinting + Imprint *CT_OnOff + // Do Not Check Spelling or Grammar + NoProof *CT_OnOff + // Use Document Grid Settings For Inter-Character Spacing + SnapToGrid *CT_OnOff + // Hidden Text + Vanish *CT_OnOff + // Web Hidden Text + WebHidden *CT_OnOff + // Run Content Color + Color *CT_Color + // Character Spacing Adjustment + Spacing *CT_SignedTwipsMeasure + // Expanded/Compressed Text + W *CT_TextScale + // Font Kerning + Kern *CT_HpsMeasure + // Vertically Raised or Lowered Text + Position *CT_SignedHpsMeasure + // Non-Complex Script Font Size + Sz *CT_HpsMeasure + // Complex Script Font Size + SzCs *CT_HpsMeasure + // Text Highlighting + Highlight *CT_Highlight + // Underline + U *CT_Underline + // Animated Text Effect + Effect *CT_TextEffect + // Text Border + Bdr *CT_Border + // Run Shading + Shd *CT_Shd + // Manual Run Width + FitText *CT_FitText + // Subscript/Superscript Text + VertAlign *CT_VerticalAlignRun + // Right To Left Text + Rtl *CT_OnOff + // Use Complex Script Formatting on Run + Cs *CT_OnOff + // Emphasis Mark + Em *CT_Em + // Languages for Run Content + Lang *CT_Language + // East Asian Typography Settings + EastAsianLayout *CT_EastAsianLayout + // Paragraph Mark Is Always Hidden + SpecVanish *CT_OnOff + // Office Open XML Math + OMath *CT_OnOff +} + +func NewCT_RPrOriginal() *CT_RPrOriginal { + ret := &CT_RPrOriginal{} + return ret +} + +func (m *CT_RPrOriginal) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.RStyle != nil { + serStyle := xml.StartElement{Name: xml.Name{Local: "w:rStyle"}} + e.EncodeElement(m.RStyle, serStyle) + } + if m.RFonts != nil { + serFonts := xml.StartElement{Name: xml.Name{Local: "w:rFonts"}} + e.EncodeElement(m.RFonts, serFonts) + } + if m.B != nil { + seb := xml.StartElement{Name: xml.Name{Local: "w:b"}} + e.EncodeElement(m.B, seb) + } + if m.BCs != nil { + sebCs := xml.StartElement{Name: xml.Name{Local: "w:bCs"}} + e.EncodeElement(m.BCs, sebCs) + } + if m.I != nil { + sei := xml.StartElement{Name: xml.Name{Local: "w:i"}} + e.EncodeElement(m.I, sei) + } + if m.ICs != nil { + seiCs := xml.StartElement{Name: xml.Name{Local: "w:iCs"}} + e.EncodeElement(m.ICs, seiCs) + } + if m.Caps != nil { + secaps := xml.StartElement{Name: xml.Name{Local: "w:caps"}} + e.EncodeElement(m.Caps, secaps) + } + if m.SmallCaps != nil { + sesmallCaps := xml.StartElement{Name: xml.Name{Local: "w:smallCaps"}} + e.EncodeElement(m.SmallCaps, sesmallCaps) + } + if m.Strike != nil { + sestrike := xml.StartElement{Name: xml.Name{Local: "w:strike"}} + e.EncodeElement(m.Strike, sestrike) + } + if m.Dstrike != nil { + sedstrike := xml.StartElement{Name: xml.Name{Local: "w:dstrike"}} + e.EncodeElement(m.Dstrike, sedstrike) + } + if m.Outline != nil { + seoutline := xml.StartElement{Name: xml.Name{Local: "w:outline"}} + e.EncodeElement(m.Outline, seoutline) + } + if m.Shadow != nil { + seshadow := xml.StartElement{Name: xml.Name{Local: "w:shadow"}} + e.EncodeElement(m.Shadow, seshadow) + } + if m.Emboss != nil { + seemboss := xml.StartElement{Name: xml.Name{Local: "w:emboss"}} + e.EncodeElement(m.Emboss, seemboss) + } + if m.Imprint != nil { + seimprint := xml.StartElement{Name: xml.Name{Local: "w:imprint"}} + e.EncodeElement(m.Imprint, seimprint) + } + if m.NoProof != nil { + senoProof := xml.StartElement{Name: xml.Name{Local: "w:noProof"}} + e.EncodeElement(m.NoProof, senoProof) + } + if m.SnapToGrid != nil { + sesnapToGrid := xml.StartElement{Name: xml.Name{Local: "w:snapToGrid"}} + e.EncodeElement(m.SnapToGrid, sesnapToGrid) + } + if m.Vanish != nil { + sevanish := xml.StartElement{Name: xml.Name{Local: "w:vanish"}} + e.EncodeElement(m.Vanish, sevanish) + } + if m.WebHidden != nil { + sewebHidden := xml.StartElement{Name: xml.Name{Local: "w:webHidden"}} + e.EncodeElement(m.WebHidden, sewebHidden) + } + if m.Color != nil { + secolor := xml.StartElement{Name: xml.Name{Local: "w:color"}} + e.EncodeElement(m.Color, secolor) + } + if m.Spacing != nil { + sespacing := xml.StartElement{Name: xml.Name{Local: "w:spacing"}} + e.EncodeElement(m.Spacing, sespacing) + } + if m.W != nil { + sew := xml.StartElement{Name: xml.Name{Local: "w:w"}} + e.EncodeElement(m.W, sew) + } + if m.Kern != nil { + sekern := xml.StartElement{Name: xml.Name{Local: "w:kern"}} + e.EncodeElement(m.Kern, sekern) + } + if m.Position != nil { + seposition := xml.StartElement{Name: xml.Name{Local: "w:position"}} + e.EncodeElement(m.Position, seposition) + } + if m.Sz != nil { + sesz := xml.StartElement{Name: xml.Name{Local: "w:sz"}} + e.EncodeElement(m.Sz, sesz) + } + if m.SzCs != nil { + seszCs := xml.StartElement{Name: xml.Name{Local: "w:szCs"}} + e.EncodeElement(m.SzCs, seszCs) + } + if m.Highlight != nil { + sehighlight := xml.StartElement{Name: xml.Name{Local: "w:highlight"}} + e.EncodeElement(m.Highlight, sehighlight) + } + if m.U != nil { + seu := xml.StartElement{Name: xml.Name{Local: "w:u"}} + e.EncodeElement(m.U, seu) + } + if m.Effect != nil { + seeffect := xml.StartElement{Name: xml.Name{Local: "w:effect"}} + e.EncodeElement(m.Effect, seeffect) + } + if m.Bdr != nil { + sebdr := xml.StartElement{Name: xml.Name{Local: "w:bdr"}} + e.EncodeElement(m.Bdr, sebdr) + } + if m.Shd != nil { + seshd := xml.StartElement{Name: xml.Name{Local: "w:shd"}} + e.EncodeElement(m.Shd, seshd) + } + if m.FitText != nil { + sefitText := xml.StartElement{Name: xml.Name{Local: "w:fitText"}} + e.EncodeElement(m.FitText, sefitText) + } + if m.VertAlign != nil { + severtAlign := xml.StartElement{Name: xml.Name{Local: "w:vertAlign"}} + e.EncodeElement(m.VertAlign, severtAlign) + } + if m.Rtl != nil { + sertl := xml.StartElement{Name: xml.Name{Local: "w:rtl"}} + e.EncodeElement(m.Rtl, sertl) + } + if m.Cs != nil { + secs := xml.StartElement{Name: xml.Name{Local: "w:cs"}} + e.EncodeElement(m.Cs, secs) + } + if m.Em != nil { + seem := xml.StartElement{Name: xml.Name{Local: "w:em"}} + e.EncodeElement(m.Em, seem) + } + if m.Lang != nil { + selang := xml.StartElement{Name: xml.Name{Local: "w:lang"}} + e.EncodeElement(m.Lang, selang) + } + if m.EastAsianLayout != nil { + seeastAsianLayout := xml.StartElement{Name: xml.Name{Local: "w:eastAsianLayout"}} + e.EncodeElement(m.EastAsianLayout, seeastAsianLayout) + } + if m.SpecVanish != nil { + sespecVanish := xml.StartElement{Name: xml.Name{Local: "w:specVanish"}} + e.EncodeElement(m.SpecVanish, sespecVanish) + } + if m.OMath != nil { + seoMath := xml.StartElement{Name: xml.Name{Local: "w:oMath"}} + e.EncodeElement(m.OMath, seoMath) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_RPrOriginal) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_RPrOriginal: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rStyle"}: + m.RStyle = NewCT_String() + if err := d.DecodeElement(m.RStyle, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rFonts"}: + m.RFonts = NewCT_Fonts() + if err := d.DecodeElement(m.RFonts, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "b"}: + m.B = NewCT_OnOff() + if err := d.DecodeElement(m.B, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bCs"}: + m.BCs = NewCT_OnOff() + if err := d.DecodeElement(m.BCs, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "i"}: + m.I = NewCT_OnOff() + if err := d.DecodeElement(m.I, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "iCs"}: + m.ICs = NewCT_OnOff() + if err := d.DecodeElement(m.ICs, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "caps"}: + m.Caps = NewCT_OnOff() + if err := d.DecodeElement(m.Caps, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "smallCaps"}: + m.SmallCaps = NewCT_OnOff() + if err := d.DecodeElement(m.SmallCaps, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "strike"}: + m.Strike = NewCT_OnOff() + if err := d.DecodeElement(m.Strike, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "dstrike"}: + m.Dstrike = NewCT_OnOff() + if err := d.DecodeElement(m.Dstrike, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "outline"}: + m.Outline = NewCT_OnOff() + if err := d.DecodeElement(m.Outline, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "shadow"}: + m.Shadow = NewCT_OnOff() + if err := d.DecodeElement(m.Shadow, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "emboss"}: + m.Emboss = NewCT_OnOff() + if err := d.DecodeElement(m.Emboss, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "imprint"}: + m.Imprint = NewCT_OnOff() + if err := d.DecodeElement(m.Imprint, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "noProof"}: + m.NoProof = NewCT_OnOff() + if err := d.DecodeElement(m.NoProof, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "snapToGrid"}: + m.SnapToGrid = NewCT_OnOff() + if err := d.DecodeElement(m.SnapToGrid, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "vanish"}: + m.Vanish = NewCT_OnOff() + if err := d.DecodeElement(m.Vanish, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "webHidden"}: + m.WebHidden = NewCT_OnOff() + if err := d.DecodeElement(m.WebHidden, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "color"}: + m.Color = NewCT_Color() + if err := d.DecodeElement(m.Color, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "spacing"}: + m.Spacing = NewCT_SignedTwipsMeasure() + if err := d.DecodeElement(m.Spacing, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "w"}: + m.W = NewCT_TextScale() + if err := d.DecodeElement(m.W, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "kern"}: + m.Kern = NewCT_HpsMeasure() + if err := d.DecodeElement(m.Kern, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "position"}: + m.Position = NewCT_SignedHpsMeasure() + if err := d.DecodeElement(m.Position, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sz"}: + m.Sz = NewCT_HpsMeasure() + if err := d.DecodeElement(m.Sz, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "szCs"}: + m.SzCs = NewCT_HpsMeasure() + if err := d.DecodeElement(m.SzCs, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "highlight"}: + m.Highlight = NewCT_Highlight() + if err := d.DecodeElement(m.Highlight, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "u"}: + m.U = NewCT_Underline() + if err := d.DecodeElement(m.U, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "effect"}: + m.Effect = NewCT_TextEffect() + if err := d.DecodeElement(m.Effect, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bdr"}: + m.Bdr = NewCT_Border() + if err := d.DecodeElement(m.Bdr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "shd"}: + m.Shd = NewCT_Shd() + if err := d.DecodeElement(m.Shd, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "fitText"}: + m.FitText = NewCT_FitText() + if err := d.DecodeElement(m.FitText, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "vertAlign"}: + m.VertAlign = NewCT_VerticalAlignRun() + if err := d.DecodeElement(m.VertAlign, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rtl"}: + m.Rtl = NewCT_OnOff() + if err := d.DecodeElement(m.Rtl, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "cs"}: + m.Cs = NewCT_OnOff() + if err := d.DecodeElement(m.Cs, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "em"}: + m.Em = NewCT_Em() + if err := d.DecodeElement(m.Em, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "lang"}: + m.Lang = NewCT_Language() + if err := d.DecodeElement(m.Lang, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "eastAsianLayout"}: + m.EastAsianLayout = NewCT_EastAsianLayout() + if err := d.DecodeElement(m.EastAsianLayout, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "specVanish"}: + m.SpecVanish = NewCT_OnOff() + if err := d.DecodeElement(m.SpecVanish, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "oMath"}: + m.OMath = NewCT_OnOff() + if err := d.DecodeElement(m.OMath, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_RPrOriginal %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_RPrOriginal + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_RPrOriginal and its children +func (m *CT_RPrOriginal) Validate() error { + return m.ValidateWithPath("CT_RPrOriginal") +} + +// ValidateWithPath validates the CT_RPrOriginal and its children, prefixing error messages with path +func (m *CT_RPrOriginal) ValidateWithPath(path string) error { + if m.RStyle != nil { + if err := m.RStyle.ValidateWithPath(path + "/RStyle"); err != nil { + return err + } + } + if m.RFonts != nil { + if err := m.RFonts.ValidateWithPath(path + "/RFonts"); err != nil { + return err + } + } + if m.B != nil { + if err := m.B.ValidateWithPath(path + "/B"); err != nil { + return err + } + } + if m.BCs != nil { + if err := m.BCs.ValidateWithPath(path + "/BCs"); err != nil { + return err + } + } + if m.I != nil { + if err := m.I.ValidateWithPath(path + "/I"); err != nil { + return err + } + } + if m.ICs != nil { + if err := m.ICs.ValidateWithPath(path + "/ICs"); err != nil { + return err + } + } + if m.Caps != nil { + if err := m.Caps.ValidateWithPath(path + "/Caps"); err != nil { + return err + } + } + if m.SmallCaps != nil { + if err := m.SmallCaps.ValidateWithPath(path + "/SmallCaps"); err != nil { + return err + } + } + if m.Strike != nil { + if err := m.Strike.ValidateWithPath(path + "/Strike"); err != nil { + return err + } + } + if m.Dstrike != nil { + if err := m.Dstrike.ValidateWithPath(path + "/Dstrike"); err != nil { + return err + } + } + if m.Outline != nil { + if err := m.Outline.ValidateWithPath(path + "/Outline"); err != nil { + return err + } + } + if m.Shadow != nil { + if err := m.Shadow.ValidateWithPath(path + "/Shadow"); err != nil { + return err + } + } + if m.Emboss != nil { + if err := m.Emboss.ValidateWithPath(path + "/Emboss"); err != nil { + return err + } + } + if m.Imprint != nil { + if err := m.Imprint.ValidateWithPath(path + "/Imprint"); err != nil { + return err + } + } + if m.NoProof != nil { + if err := m.NoProof.ValidateWithPath(path + "/NoProof"); err != nil { + return err + } + } + if m.SnapToGrid != nil { + if err := m.SnapToGrid.ValidateWithPath(path + "/SnapToGrid"); err != nil { + return err + } + } + if m.Vanish != nil { + if err := m.Vanish.ValidateWithPath(path + "/Vanish"); err != nil { + return err + } + } + if m.WebHidden != nil { + if err := m.WebHidden.ValidateWithPath(path + "/WebHidden"); err != nil { + return err + } + } + if m.Color != nil { + if err := m.Color.ValidateWithPath(path + "/Color"); err != nil { + return err + } + } + if m.Spacing != nil { + if err := m.Spacing.ValidateWithPath(path + "/Spacing"); err != nil { + return err + } + } + if m.W != nil { + if err := m.W.ValidateWithPath(path + "/W"); err != nil { + return err + } + } + if m.Kern != nil { + if err := m.Kern.ValidateWithPath(path + "/Kern"); err != nil { + return err + } + } + if m.Position != nil { + if err := m.Position.ValidateWithPath(path + "/Position"); err != nil { + return err + } + } + if m.Sz != nil { + if err := m.Sz.ValidateWithPath(path + "/Sz"); err != nil { + return err + } + } + if m.SzCs != nil { + if err := m.SzCs.ValidateWithPath(path + "/SzCs"); err != nil { + return err + } + } + if m.Highlight != nil { + if err := m.Highlight.ValidateWithPath(path + "/Highlight"); err != nil { + return err + } + } + if m.U != nil { + if err := m.U.ValidateWithPath(path + "/U"); err != nil { + return err + } + } + if m.Effect != nil { + if err := m.Effect.ValidateWithPath(path + "/Effect"); err != nil { + return err + } + } + if m.Bdr != nil { + if err := m.Bdr.ValidateWithPath(path + "/Bdr"); err != nil { + return err + } + } + if m.Shd != nil { + if err := m.Shd.ValidateWithPath(path + "/Shd"); err != nil { + return err + } + } + if m.FitText != nil { + if err := m.FitText.ValidateWithPath(path + "/FitText"); err != nil { + return err + } + } + if m.VertAlign != nil { + if err := m.VertAlign.ValidateWithPath(path + "/VertAlign"); err != nil { + return err + } + } + if m.Rtl != nil { + if err := m.Rtl.ValidateWithPath(path + "/Rtl"); err != nil { + return err + } + } + if m.Cs != nil { + if err := m.Cs.ValidateWithPath(path + "/Cs"); err != nil { + return err + } + } + if m.Em != nil { + if err := m.Em.ValidateWithPath(path + "/Em"); err != nil { + return err + } + } + if m.Lang != nil { + if err := m.Lang.ValidateWithPath(path + "/Lang"); err != nil { + return err + } + } + if m.EastAsianLayout != nil { + if err := m.EastAsianLayout.ValidateWithPath(path + "/EastAsianLayout"); err != nil { + return err + } + } + if m.SpecVanish != nil { + if err := m.SpecVanish.ValidateWithPath(path + "/SpecVanish"); err != nil { + return err + } + } + if m.OMath != nil { + if err := m.OMath.ValidateWithPath(path + "/OMath"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_ReadingModeInkLockDown.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_ReadingModeInkLockDown.go new file mode 100644 index 00000000..7ed62c9f --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_ReadingModeInkLockDown.go @@ -0,0 +1,113 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_ReadingModeInkLockDown struct { + // Use Actual Pages, Not Virtual Pages + ActualPgAttr sharedTypes.ST_OnOff + // Virtual Page Width + WAttr uint64 + // Virtual Page Height + HAttr uint64 + // Font Size Scaling + FontSzAttr ST_DecimalNumberOrPercent +} + +func NewCT_ReadingModeInkLockDown() *CT_ReadingModeInkLockDown { + ret := &CT_ReadingModeInkLockDown{} + return ret +} + +func (m *CT_ReadingModeInkLockDown) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:actualPg"}, + Value: fmt.Sprintf("%v", m.ActualPgAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:w"}, + Value: fmt.Sprintf("%v", m.WAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:h"}, + Value: fmt.Sprintf("%v", m.HAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:fontSz"}, + Value: fmt.Sprintf("%v", m.FontSzAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_ReadingModeInkLockDown) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "actualPg" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.ActualPgAttr = parsed + continue + } + if attr.Name.Local == "w" { + parsed, err := strconv.ParseUint(attr.Value, 10, 64) + if err != nil { + return err + } + m.WAttr = parsed + continue + } + if attr.Name.Local == "h" { + parsed, err := strconv.ParseUint(attr.Value, 10, 64) + if err != nil { + return err + } + m.HAttr = parsed + continue + } + if attr.Name.Local == "fontSz" { + parsed, err := ParseUnionST_DecimalNumberOrPercent(attr.Value) + if err != nil { + return err + } + m.FontSzAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_ReadingModeInkLockDown: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_ReadingModeInkLockDown and its children +func (m *CT_ReadingModeInkLockDown) Validate() error { + return m.ValidateWithPath("CT_ReadingModeInkLockDown") +} + +// ValidateWithPath validates the CT_ReadingModeInkLockDown and its children, prefixing error messages with path +func (m *CT_ReadingModeInkLockDown) ValidateWithPath(path string) error { + if err := m.ActualPgAttr.ValidateWithPath(path + "/ActualPgAttr"); err != nil { + return err + } + if err := m.FontSzAttr.ValidateWithPath(path + "/FontSzAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_RecipientData.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_RecipientData.go new file mode 100644 index 00000000..6233c600 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_RecipientData.go @@ -0,0 +1,107 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_RecipientData struct { + // Record Is Included in Mail Merge + Active *CT_OnOff + // Index of Column Containing Unique Values for Record + Column *CT_DecimalNumber + // Unique Value for Record + UniqueTag *CT_Base64Binary +} + +func NewCT_RecipientData() *CT_RecipientData { + ret := &CT_RecipientData{} + ret.Column = NewCT_DecimalNumber() + ret.UniqueTag = NewCT_Base64Binary() + return ret +} + +func (m *CT_RecipientData) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Active != nil { + seactive := xml.StartElement{Name: xml.Name{Local: "w:active"}} + e.EncodeElement(m.Active, seactive) + } + secolumn := xml.StartElement{Name: xml.Name{Local: "w:column"}} + e.EncodeElement(m.Column, secolumn) + seuniqueTag := xml.StartElement{Name: xml.Name{Local: "w:uniqueTag"}} + e.EncodeElement(m.UniqueTag, seuniqueTag) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_RecipientData) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.Column = NewCT_DecimalNumber() + m.UniqueTag = NewCT_Base64Binary() +lCT_RecipientData: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "active"}: + m.Active = NewCT_OnOff() + if err := d.DecodeElement(m.Active, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "column"}: + if err := d.DecodeElement(m.Column, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "uniqueTag"}: + if err := d.DecodeElement(m.UniqueTag, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_RecipientData %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_RecipientData + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_RecipientData and its children +func (m *CT_RecipientData) Validate() error { + return m.ValidateWithPath("CT_RecipientData") +} + +// ValidateWithPath validates the CT_RecipientData and its children, prefixing error messages with path +func (m *CT_RecipientData) ValidateWithPath(path string) error { + if m.Active != nil { + if err := m.Active.ValidateWithPath(path + "/Active"); err != nil { + return err + } + } + if err := m.Column.ValidateWithPath(path + "/Column"); err != nil { + return err + } + if err := m.UniqueTag.ValidateWithPath(path + "/UniqueTag"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Recipients.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Recipients.go new file mode 100644 index 00000000..95847eaf --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Recipients.go @@ -0,0 +1,83 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_Recipients struct { + // Data About Single Data Source Record + RecipientData []*CT_RecipientData +} + +func NewCT_Recipients() *CT_Recipients { + ret := &CT_Recipients{} + return ret +} + +func (m *CT_Recipients) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + serecipientData := xml.StartElement{Name: xml.Name{Local: "w:recipientData"}} + for _, c := range m.RecipientData { + e.EncodeElement(c, serecipientData) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Recipients) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_Recipients: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "recipientData"}: + tmp := NewCT_RecipientData() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.RecipientData = append(m.RecipientData, tmp) + default: + gooxml.Log("skipping unsupported element on CT_Recipients %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Recipients + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Recipients and its children +func (m *CT_Recipients) Validate() error { + return m.ValidateWithPath("CT_Recipients") +} + +// ValidateWithPath validates the CT_Recipients and its children, prefixing error messages with path +func (m *CT_Recipients) ValidateWithPath(path string) error { + for i, v := range m.RecipientData { + if err := v.ValidateWithPath(fmt.Sprintf("%s/RecipientData[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Rel.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Rel.go new file mode 100644 index 00000000..05e763d5 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Rel.go @@ -0,0 +1,67 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_Rel struct { + IdAttr string +} + +func NewCT_Rel() *CT_Rel { + ret := &CT_Rel{} + return ret +} + +func (m *CT_Rel) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "r:id"}, + Value: fmt.Sprintf("%v", m.IdAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Rel) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Space == "http://schemas.openxmlformats.org/officeDocument/2006/relationships" && attr.Name.Local == "id" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.IdAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Rel: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Rel and its children +func (m *CT_Rel) Validate() error { + return m.ValidateWithPath("CT_Rel") +} + +// ValidateWithPath validates the CT_Rel and its children, prefixing error messages with path +func (m *CT_Rel) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Row.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Row.go new file mode 100644 index 00000000..0355cbf1 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Row.go @@ -0,0 +1,451 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/math" +) + +type CT_Row struct { + // Revision Identifier for Table Row Glyph Formatting + RsidRPrAttr *string + // Revision Identifier for Table Row + RsidRAttr *string + // Revision Identifier for Table Row Deletion + RsidDelAttr *string + // Revision Identifier for Table Row Properties + RsidTrAttr *string + // Table-Level Property Exceptions + TblPrEx *CT_TblPrEx + // Table Row Properties + TrPr *CT_TrPr + EG_ContentCellContent []*EG_ContentCellContent +} + +func NewCT_Row() *CT_Row { + ret := &CT_Row{} + return ret +} + +func (m *CT_Row) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.RsidRPrAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:rsidRPr"}, + Value: fmt.Sprintf("%v", *m.RsidRPrAttr)}) + } + if m.RsidRAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:rsidR"}, + Value: fmt.Sprintf("%v", *m.RsidRAttr)}) + } + if m.RsidDelAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:rsidDel"}, + Value: fmt.Sprintf("%v", *m.RsidDelAttr)}) + } + if m.RsidTrAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:rsidTr"}, + Value: fmt.Sprintf("%v", *m.RsidTrAttr)}) + } + e.EncodeToken(start) + if m.TblPrEx != nil { + setblPrEx := xml.StartElement{Name: xml.Name{Local: "w:tblPrEx"}} + e.EncodeElement(m.TblPrEx, setblPrEx) + } + if m.TrPr != nil { + setrPr := xml.StartElement{Name: xml.Name{Local: "w:trPr"}} + e.EncodeElement(m.TrPr, setrPr) + } + if m.EG_ContentCellContent != nil { + for _, c := range m.EG_ContentCellContent { + c.MarshalXML(e, xml.StartElement{}) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Row) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "rsidR" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.RsidRAttr = &parsed + continue + } + if attr.Name.Local == "rsidDel" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.RsidDelAttr = &parsed + continue + } + if attr.Name.Local == "rsidTr" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.RsidTrAttr = &parsed + continue + } + if attr.Name.Local == "rsidRPr" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.RsidRPrAttr = &parsed + continue + } + } +lCT_Row: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblPrEx"}: + m.TblPrEx = NewCT_TblPrEx() + if err := d.DecodeElement(m.TblPrEx, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "trPr"}: + m.TrPr = NewCT_TrPr() + if err := d.DecodeElement(m.TrPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tc"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmp := NewCT_Tc() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + tmpcontentcellcontent.Tc = append(tmpcontentcellcontent.Tc, tmp) + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXml"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmpcontentcellcontent.CustomXml = NewCT_CustomXmlCell() + if err := d.DecodeElement(tmpcontentcellcontent.CustomXml, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdt"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmpcontentcellcontent.Sdt = NewCT_SdtCell() + if err := d.DecodeElement(tmpcontentcellcontent.Sdt, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "proofErr"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.ProofErr = NewCT_ProofErr() + if err := d.DecodeElement(tmprunlevelelts.ProofErr, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permStart"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermStart = NewCT_PermStart() + if err := d.DecodeElement(tmprunlevelelts.PermStart, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permEnd"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermEnd = NewCT_Perm() + if err := d.DecodeElement(tmprunlevelelts.PermEnd, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Ins = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Ins, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Del = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Del, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFrom"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveFrom = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveFrom, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveTo"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveTo = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveTo, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkStart"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkStart = NewCT_Bookmark() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkStart, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkEnd"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkEnd, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeStart"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeStart, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeEnd"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeStart"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeStart, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeEnd"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeEnd, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeStart"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeStart = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeStart, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeEnd"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeEnd, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeStart"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeStart, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeEnd"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeEnd, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeStart"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeStart, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeEnd"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeEnd, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeStart"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeStart, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeEnd"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeStart"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeStart, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeEnd"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeEnd, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMathPara"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMathPara = math.NewOMathPara() + if err := d.DecodeElement(tmpmathcontent.OMathPara, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMath"}: + tmpcontentcellcontent := NewEG_ContentCellContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMath = math.NewOMath() + if err := d.DecodeElement(tmpmathcontent.OMath, &el); err != nil { + return err + } + m.EG_ContentCellContent = append(m.EG_ContentCellContent, tmpcontentcellcontent) + tmpcontentcellcontent.EG_RunLevelElts = append(tmpcontentcellcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + default: + gooxml.Log("skipping unsupported element on CT_Row %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Row + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Row and its children +func (m *CT_Row) Validate() error { + return m.ValidateWithPath("CT_Row") +} + +// ValidateWithPath validates the CT_Row and its children, prefixing error messages with path +func (m *CT_Row) ValidateWithPath(path string) error { + if m.TblPrEx != nil { + if err := m.TblPrEx.ValidateWithPath(path + "/TblPrEx"); err != nil { + return err + } + } + if m.TrPr != nil { + if err := m.TrPr.ValidateWithPath(path + "/TrPr"); err != nil { + return err + } + } + for i, v := range m.EG_ContentCellContent { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_ContentCellContent[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Ruby.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Ruby.go new file mode 100644 index 00000000..92669621 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Ruby.go @@ -0,0 +1,104 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_Ruby struct { + // Phonetic Guide Properties + RubyPr *CT_RubyPr + // Phonetic Guide Text + Rt *CT_RubyContent + // Phonetic Guide Base Text + RubyBase *CT_RubyContent +} + +func NewCT_Ruby() *CT_Ruby { + ret := &CT_Ruby{} + ret.RubyPr = NewCT_RubyPr() + ret.Rt = NewCT_RubyContent() + ret.RubyBase = NewCT_RubyContent() + return ret +} + +func (m *CT_Ruby) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + serubyPr := xml.StartElement{Name: xml.Name{Local: "w:rubyPr"}} + e.EncodeElement(m.RubyPr, serubyPr) + sert := xml.StartElement{Name: xml.Name{Local: "w:rt"}} + e.EncodeElement(m.Rt, sert) + serubyBase := xml.StartElement{Name: xml.Name{Local: "w:rubyBase"}} + e.EncodeElement(m.RubyBase, serubyBase) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Ruby) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.RubyPr = NewCT_RubyPr() + m.Rt = NewCT_RubyContent() + m.RubyBase = NewCT_RubyContent() +lCT_Ruby: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rubyPr"}: + if err := d.DecodeElement(m.RubyPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rt"}: + if err := d.DecodeElement(m.Rt, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rubyBase"}: + if err := d.DecodeElement(m.RubyBase, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_Ruby %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Ruby + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Ruby and its children +func (m *CT_Ruby) Validate() error { + return m.ValidateWithPath("CT_Ruby") +} + +// ValidateWithPath validates the CT_Ruby and its children, prefixing error messages with path +func (m *CT_Ruby) ValidateWithPath(path string) error { + if err := m.RubyPr.ValidateWithPath(path + "/RubyPr"); err != nil { + return err + } + if err := m.Rt.ValidateWithPath(path + "/Rt"); err != nil { + return err + } + if err := m.RubyBase.ValidateWithPath(path + "/RubyBase"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_RubyAlign.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_RubyAlign.go new file mode 100644 index 00000000..d7e6388d --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_RubyAlign.go @@ -0,0 +1,75 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_RubyAlign struct { + // Phonetic Guide Text Alignment Value + ValAttr ST_RubyAlign +} + +func NewCT_RubyAlign() *CT_RubyAlign { + ret := &CT_RubyAlign{} + ret.ValAttr = ST_RubyAlign(1) + return ret +} + +func (m *CT_RubyAlign) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_RubyAlign) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_RubyAlign(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_RubyAlign: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_RubyAlign and its children +func (m *CT_RubyAlign) Validate() error { + return m.ValidateWithPath("CT_RubyAlign") +} + +// ValidateWithPath validates the CT_RubyAlign and its children, prefixing error messages with path +func (m *CT_RubyAlign) ValidateWithPath(path string) error { + if m.ValAttr == ST_RubyAlignUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_RubyContent.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_RubyContent.go new file mode 100644 index 00000000..03526b4a --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_RubyContent.go @@ -0,0 +1,305 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/math" +) + +type CT_RubyContent struct { + // Phonetic Guide Text Run + R *CT_R + EG_RunLevelElts []*EG_RunLevelElts +} + +func NewCT_RubyContent() *CT_RubyContent { + ret := &CT_RubyContent{} + return ret +} + +func (m *CT_RubyContent) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.R != nil { + ser := xml.StartElement{Name: xml.Name{Local: "w:r"}} + e.EncodeElement(m.R, ser) + } + if m.EG_RunLevelElts != nil { + for _, c := range m.EG_RunLevelElts { + c.MarshalXML(e, xml.StartElement{}) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_RubyContent) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_RubyContent: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "r"}: + m.R = NewCT_R() + if err := d.DecodeElement(m.R, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "proofErr"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.ProofErr = NewCT_ProofErr() + if err := d.DecodeElement(tmprunlevelelts.ProofErr, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermStart = NewCT_PermStart() + if err := d.DecodeElement(tmprunlevelelts.PermStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermEnd = NewCT_Perm() + if err := d.DecodeElement(tmprunlevelelts.PermEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Ins = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Ins, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Del = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Del, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFrom"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveFrom = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveFrom, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveTo"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveTo = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveTo, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkStart = NewCT_Bookmark() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeStart = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMathPara"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMathPara = math.NewOMathPara() + if err := d.DecodeElement(tmpmathcontent.OMathPara, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMath"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMath = math.NewOMath() + if err := d.DecodeElement(tmpmathcontent.OMath, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + default: + gooxml.Log("skipping unsupported element on CT_RubyContent %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_RubyContent + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_RubyContent and its children +func (m *CT_RubyContent) Validate() error { + return m.ValidateWithPath("CT_RubyContent") +} + +// ValidateWithPath validates the CT_RubyContent and its children, prefixing error messages with path +func (m *CT_RubyContent) ValidateWithPath(path string) error { + if m.R != nil { + if err := m.R.ValidateWithPath(path + "/R"); err != nil { + return err + } + } + for i, v := range m.EG_RunLevelElts { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_RunLevelElts[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_RubyPr.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_RubyPr.go new file mode 100644 index 00000000..14a69c6f --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_RubyPr.go @@ -0,0 +1,146 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_RubyPr struct { + // Phonetic Guide Text Alignment + RubyAlign *CT_RubyAlign + // Phonetic Guide Text Font Size + Hps *CT_HpsMeasure + // Distance Between Phonetic Guide Text and Phonetic Guide Base Text + HpsRaise *CT_HpsMeasure + // Phonetic Guide Base Text Font Size + HpsBaseText *CT_HpsMeasure + // Language ID for Phonetic Guide + Lid *CT_Lang + // Invalidated Field Cache + Dirty *CT_OnOff +} + +func NewCT_RubyPr() *CT_RubyPr { + ret := &CT_RubyPr{} + ret.RubyAlign = NewCT_RubyAlign() + ret.Hps = NewCT_HpsMeasure() + ret.HpsRaise = NewCT_HpsMeasure() + ret.HpsBaseText = NewCT_HpsMeasure() + ret.Lid = NewCT_Lang() + return ret +} + +func (m *CT_RubyPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + serubyAlign := xml.StartElement{Name: xml.Name{Local: "w:rubyAlign"}} + e.EncodeElement(m.RubyAlign, serubyAlign) + sehps := xml.StartElement{Name: xml.Name{Local: "w:hps"}} + e.EncodeElement(m.Hps, sehps) + sehpsRaise := xml.StartElement{Name: xml.Name{Local: "w:hpsRaise"}} + e.EncodeElement(m.HpsRaise, sehpsRaise) + sehpsBaseText := xml.StartElement{Name: xml.Name{Local: "w:hpsBaseText"}} + e.EncodeElement(m.HpsBaseText, sehpsBaseText) + selid := xml.StartElement{Name: xml.Name{Local: "w:lid"}} + e.EncodeElement(m.Lid, selid) + if m.Dirty != nil { + sedirty := xml.StartElement{Name: xml.Name{Local: "w:dirty"}} + e.EncodeElement(m.Dirty, sedirty) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_RubyPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.RubyAlign = NewCT_RubyAlign() + m.Hps = NewCT_HpsMeasure() + m.HpsRaise = NewCT_HpsMeasure() + m.HpsBaseText = NewCT_HpsMeasure() + m.Lid = NewCT_Lang() +lCT_RubyPr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rubyAlign"}: + if err := d.DecodeElement(m.RubyAlign, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "hps"}: + if err := d.DecodeElement(m.Hps, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "hpsRaise"}: + if err := d.DecodeElement(m.HpsRaise, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "hpsBaseText"}: + if err := d.DecodeElement(m.HpsBaseText, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "lid"}: + if err := d.DecodeElement(m.Lid, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "dirty"}: + m.Dirty = NewCT_OnOff() + if err := d.DecodeElement(m.Dirty, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_RubyPr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_RubyPr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_RubyPr and its children +func (m *CT_RubyPr) Validate() error { + return m.ValidateWithPath("CT_RubyPr") +} + +// ValidateWithPath validates the CT_RubyPr and its children, prefixing error messages with path +func (m *CT_RubyPr) ValidateWithPath(path string) error { + if err := m.RubyAlign.ValidateWithPath(path + "/RubyAlign"); err != nil { + return err + } + if err := m.Hps.ValidateWithPath(path + "/Hps"); err != nil { + return err + } + if err := m.HpsRaise.ValidateWithPath(path + "/HpsRaise"); err != nil { + return err + } + if err := m.HpsBaseText.ValidateWithPath(path + "/HpsBaseText"); err != nil { + return err + } + if err := m.Lid.ValidateWithPath(path + "/Lid"); err != nil { + return err + } + if m.Dirty != nil { + if err := m.Dirty.ValidateWithPath(path + "/Dirty"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_RunTrackChange.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_RunTrackChange.go new file mode 100644 index 00000000..a7690514 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_RunTrackChange.go @@ -0,0 +1,94 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + "time" +) + +type CT_RunTrackChange struct { + AuthorAttr string + DateAttr *time.Time + // Annotation Identifier + IdAttr int64 +} + +func NewCT_RunTrackChange() *CT_RunTrackChange { + ret := &CT_RunTrackChange{} + return ret +} + +func (m *CT_RunTrackChange) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:author"}, + Value: fmt.Sprintf("%v", m.AuthorAttr)}) + if m.DateAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:date"}, + Value: fmt.Sprintf("%v", *m.DateAttr)}) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:id"}, + Value: fmt.Sprintf("%v", m.IdAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_RunTrackChange) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "author" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.AuthorAttr = parsed + continue + } + if attr.Name.Local == "date" { + parsed, err := ParseStdlibTime(attr.Value) + if err != nil { + return err + } + m.DateAttr = &parsed + continue + } + if attr.Name.Local == "id" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.IdAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_RunTrackChange: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_RunTrackChange and its children +func (m *CT_RunTrackChange) Validate() error { + return m.ValidateWithPath("CT_RunTrackChange") +} + +// ValidateWithPath validates the CT_RunTrackChange and its children, prefixing error messages with path +func (m *CT_RunTrackChange) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SaveThroughXslt.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SaveThroughXslt.go new file mode 100644 index 00000000..6862afc9 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SaveThroughXslt.go @@ -0,0 +1,83 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_SaveThroughXslt struct { + IdAttr *string + // Local Identifier for XSL Transform + SolutionIDAttr *string +} + +func NewCT_SaveThroughXslt() *CT_SaveThroughXslt { + ret := &CT_SaveThroughXslt{} + return ret +} + +func (m *CT_SaveThroughXslt) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.IdAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "r:id"}, + Value: fmt.Sprintf("%v", *m.IdAttr)}) + } + if m.SolutionIDAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:solutionID"}, + Value: fmt.Sprintf("%v", *m.SolutionIDAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SaveThroughXslt) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Space == "http://schemas.openxmlformats.org/officeDocument/2006/relationships" && attr.Name.Local == "id" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.IdAttr = &parsed + continue + } + if attr.Name.Local == "solutionID" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.SolutionIDAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_SaveThroughXslt: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_SaveThroughXslt and its children +func (m *CT_SaveThroughXslt) Validate() error { + return m.ValidateWithPath("CT_SaveThroughXslt") +} + +// ValidateWithPath validates the CT_SaveThroughXslt and its children, prefixing error messages with path +func (m *CT_SaveThroughXslt) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtBlock.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtBlock.go new file mode 100644 index 00000000..f8da5c33 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtBlock.go @@ -0,0 +1,113 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_SdtBlock struct { + // Structured Document Tag Properties + SdtPr *CT_SdtPr + // Structured Document Tag End Character Properties + SdtEndPr *CT_SdtEndPr + // Block-Level Structured Document Tag Content + SdtContent *CT_SdtContentBlock +} + +func NewCT_SdtBlock() *CT_SdtBlock { + ret := &CT_SdtBlock{} + return ret +} + +func (m *CT_SdtBlock) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.SdtPr != nil { + sesdtPr := xml.StartElement{Name: xml.Name{Local: "w:sdtPr"}} + e.EncodeElement(m.SdtPr, sesdtPr) + } + if m.SdtEndPr != nil { + sesdtEndPr := xml.StartElement{Name: xml.Name{Local: "w:sdtEndPr"}} + e.EncodeElement(m.SdtEndPr, sesdtEndPr) + } + if m.SdtContent != nil { + sesdtContent := xml.StartElement{Name: xml.Name{Local: "w:sdtContent"}} + e.EncodeElement(m.SdtContent, sesdtContent) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SdtBlock) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_SdtBlock: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdtPr"}: + m.SdtPr = NewCT_SdtPr() + if err := d.DecodeElement(m.SdtPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdtEndPr"}: + m.SdtEndPr = NewCT_SdtEndPr() + if err := d.DecodeElement(m.SdtEndPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdtContent"}: + m.SdtContent = NewCT_SdtContentBlock() + if err := d.DecodeElement(m.SdtContent, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_SdtBlock %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_SdtBlock + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_SdtBlock and its children +func (m *CT_SdtBlock) Validate() error { + return m.ValidateWithPath("CT_SdtBlock") +} + +// ValidateWithPath validates the CT_SdtBlock and its children, prefixing error messages with path +func (m *CT_SdtBlock) ValidateWithPath(path string) error { + if m.SdtPr != nil { + if err := m.SdtPr.ValidateWithPath(path + "/SdtPr"); err != nil { + return err + } + } + if m.SdtEndPr != nil { + if err := m.SdtEndPr.ValidateWithPath(path + "/SdtEndPr"); err != nil { + return err + } + } + if m.SdtContent != nil { + if err := m.SdtContent.ValidateWithPath(path + "/SdtContent"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtCell.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtCell.go new file mode 100644 index 00000000..cd377467 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtCell.go @@ -0,0 +1,113 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_SdtCell struct { + // Structured Document Tag Properties + SdtPr *CT_SdtPr + // Structured Document Tag End Character Properties + SdtEndPr *CT_SdtEndPr + // Cell-Level Structured Document Tag Content + SdtContent *CT_SdtContentCell +} + +func NewCT_SdtCell() *CT_SdtCell { + ret := &CT_SdtCell{} + return ret +} + +func (m *CT_SdtCell) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.SdtPr != nil { + sesdtPr := xml.StartElement{Name: xml.Name{Local: "w:sdtPr"}} + e.EncodeElement(m.SdtPr, sesdtPr) + } + if m.SdtEndPr != nil { + sesdtEndPr := xml.StartElement{Name: xml.Name{Local: "w:sdtEndPr"}} + e.EncodeElement(m.SdtEndPr, sesdtEndPr) + } + if m.SdtContent != nil { + sesdtContent := xml.StartElement{Name: xml.Name{Local: "w:sdtContent"}} + e.EncodeElement(m.SdtContent, sesdtContent) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SdtCell) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_SdtCell: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdtPr"}: + m.SdtPr = NewCT_SdtPr() + if err := d.DecodeElement(m.SdtPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdtEndPr"}: + m.SdtEndPr = NewCT_SdtEndPr() + if err := d.DecodeElement(m.SdtEndPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdtContent"}: + m.SdtContent = NewCT_SdtContentCell() + if err := d.DecodeElement(m.SdtContent, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_SdtCell %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_SdtCell + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_SdtCell and its children +func (m *CT_SdtCell) Validate() error { + return m.ValidateWithPath("CT_SdtCell") +} + +// ValidateWithPath validates the CT_SdtCell and its children, prefixing error messages with path +func (m *CT_SdtCell) ValidateWithPath(path string) error { + if m.SdtPr != nil { + if err := m.SdtPr.ValidateWithPath(path + "/SdtPr"); err != nil { + return err + } + } + if m.SdtEndPr != nil { + if err := m.SdtEndPr.ValidateWithPath(path + "/SdtEndPr"); err != nil { + return err + } + } + if m.SdtContent != nil { + if err := m.SdtContent.ValidateWithPath(path + "/SdtContent"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtComboBox.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtComboBox.go new file mode 100644 index 00000000..4eb8791c --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtComboBox.go @@ -0,0 +1,101 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_SdtComboBox struct { + // Combo Box Last Saved Value + LastValueAttr *string + // Combo Box List Item + ListItem []*CT_SdtListItem +} + +func NewCT_SdtComboBox() *CT_SdtComboBox { + ret := &CT_SdtComboBox{} + return ret +} + +func (m *CT_SdtComboBox) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.LastValueAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:lastValue"}, + Value: fmt.Sprintf("%v", *m.LastValueAttr)}) + } + e.EncodeToken(start) + if m.ListItem != nil { + selistItem := xml.StartElement{Name: xml.Name{Local: "w:listItem"}} + for _, c := range m.ListItem { + e.EncodeElement(c, selistItem) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SdtComboBox) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "lastValue" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.LastValueAttr = &parsed + continue + } + } +lCT_SdtComboBox: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "listItem"}: + tmp := NewCT_SdtListItem() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.ListItem = append(m.ListItem, tmp) + default: + gooxml.Log("skipping unsupported element on CT_SdtComboBox %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_SdtComboBox + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_SdtComboBox and its children +func (m *CT_SdtComboBox) Validate() error { + return m.ValidateWithPath("CT_SdtComboBox") +} + +// ValidateWithPath validates the CT_SdtComboBox and its children, prefixing error messages with path +func (m *CT_SdtComboBox) ValidateWithPath(path string) error { + for i, v := range m.ListItem { + if err := v.ValidateWithPath(fmt.Sprintf("%s/ListItem[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtContentBlock.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtContentBlock.go new file mode 100644 index 00000000..66da36dd --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtContentBlock.go @@ -0,0 +1,359 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/math" +) + +type CT_SdtContentBlock struct { + // Block-Level Custom XML Element + CustomXml *CT_CustomXmlBlock + // Block-Level Structured Document Tag + Sdt *CT_SdtBlock + // Paragraph + P []*CT_P + // Table + Tbl []*CT_Tbl + EG_RunLevelElts []*EG_RunLevelElts +} + +func NewCT_SdtContentBlock() *CT_SdtContentBlock { + ret := &CT_SdtContentBlock{} + return ret +} + +func (m *CT_SdtContentBlock) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.CustomXml != nil { + secustomXml := xml.StartElement{Name: xml.Name{Local: "w:customXml"}} + e.EncodeElement(m.CustomXml, secustomXml) + } + if m.Sdt != nil { + sesdt := xml.StartElement{Name: xml.Name{Local: "w:sdt"}} + e.EncodeElement(m.Sdt, sesdt) + } + if m.P != nil { + sep := xml.StartElement{Name: xml.Name{Local: "w:p"}} + for _, c := range m.P { + e.EncodeElement(c, sep) + } + } + if m.Tbl != nil { + setbl := xml.StartElement{Name: xml.Name{Local: "w:tbl"}} + for _, c := range m.Tbl { + e.EncodeElement(c, setbl) + } + } + if m.EG_RunLevelElts != nil { + for _, c := range m.EG_RunLevelElts { + c.MarshalXML(e, xml.StartElement{}) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SdtContentBlock) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_SdtContentBlock: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXml"}: + m.CustomXml = NewCT_CustomXmlBlock() + if err := d.DecodeElement(m.CustomXml, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdt"}: + m.Sdt = NewCT_SdtBlock() + if err := d.DecodeElement(m.Sdt, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "p"}: + tmp := NewCT_P() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.P = append(m.P, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tbl"}: + tmp := NewCT_Tbl() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Tbl = append(m.Tbl, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "proofErr"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.ProofErr = NewCT_ProofErr() + if err := d.DecodeElement(tmprunlevelelts.ProofErr, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermStart = NewCT_PermStart() + if err := d.DecodeElement(tmprunlevelelts.PermStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermEnd = NewCT_Perm() + if err := d.DecodeElement(tmprunlevelelts.PermEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Ins = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Ins, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Del = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Del, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFrom"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveFrom = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveFrom, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveTo"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveTo = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveTo, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkStart = NewCT_Bookmark() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeStart = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMathPara"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMathPara = math.NewOMathPara() + if err := d.DecodeElement(tmpmathcontent.OMathPara, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMath"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMath = math.NewOMath() + if err := d.DecodeElement(tmpmathcontent.OMath, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + default: + gooxml.Log("skipping unsupported element on CT_SdtContentBlock %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_SdtContentBlock + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_SdtContentBlock and its children +func (m *CT_SdtContentBlock) Validate() error { + return m.ValidateWithPath("CT_SdtContentBlock") +} + +// ValidateWithPath validates the CT_SdtContentBlock and its children, prefixing error messages with path +func (m *CT_SdtContentBlock) ValidateWithPath(path string) error { + if m.CustomXml != nil { + if err := m.CustomXml.ValidateWithPath(path + "/CustomXml"); err != nil { + return err + } + } + if m.Sdt != nil { + if err := m.Sdt.ValidateWithPath(path + "/Sdt"); err != nil { + return err + } + } + for i, v := range m.P { + if err := v.ValidateWithPath(fmt.Sprintf("%s/P[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.Tbl { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Tbl[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.EG_RunLevelElts { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_RunLevelElts[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtContentCell.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtContentCell.go new file mode 100644 index 00000000..4d7f2e3d --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtContentCell.go @@ -0,0 +1,340 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/math" +) + +type CT_SdtContentCell struct { + // Table Cell + Tc []*CT_Tc + // Cell-Level Custom XML Element + CustomXml *CT_CustomXmlCell + // Cell-Level Structured Document Tag + Sdt *CT_SdtCell + EG_RunLevelElts []*EG_RunLevelElts +} + +func NewCT_SdtContentCell() *CT_SdtContentCell { + ret := &CT_SdtContentCell{} + return ret +} + +func (m *CT_SdtContentCell) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Tc != nil { + setc := xml.StartElement{Name: xml.Name{Local: "w:tc"}} + for _, c := range m.Tc { + e.EncodeElement(c, setc) + } + } + if m.CustomXml != nil { + secustomXml := xml.StartElement{Name: xml.Name{Local: "w:customXml"}} + e.EncodeElement(m.CustomXml, secustomXml) + } + if m.Sdt != nil { + sesdt := xml.StartElement{Name: xml.Name{Local: "w:sdt"}} + e.EncodeElement(m.Sdt, sesdt) + } + if m.EG_RunLevelElts != nil { + for _, c := range m.EG_RunLevelElts { + c.MarshalXML(e, xml.StartElement{}) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SdtContentCell) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_SdtContentCell: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tc"}: + tmp := NewCT_Tc() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Tc = append(m.Tc, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXml"}: + m.CustomXml = NewCT_CustomXmlCell() + if err := d.DecodeElement(m.CustomXml, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdt"}: + m.Sdt = NewCT_SdtCell() + if err := d.DecodeElement(m.Sdt, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "proofErr"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.ProofErr = NewCT_ProofErr() + if err := d.DecodeElement(tmprunlevelelts.ProofErr, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermStart = NewCT_PermStart() + if err := d.DecodeElement(tmprunlevelelts.PermStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermEnd = NewCT_Perm() + if err := d.DecodeElement(tmprunlevelelts.PermEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Ins = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Ins, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Del = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Del, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFrom"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveFrom = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveFrom, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveTo"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveTo = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveTo, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkStart = NewCT_Bookmark() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeStart = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMathPara"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMathPara = math.NewOMathPara() + if err := d.DecodeElement(tmpmathcontent.OMathPara, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMath"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMath = math.NewOMath() + if err := d.DecodeElement(tmpmathcontent.OMath, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + default: + gooxml.Log("skipping unsupported element on CT_SdtContentCell %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_SdtContentCell + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_SdtContentCell and its children +func (m *CT_SdtContentCell) Validate() error { + return m.ValidateWithPath("CT_SdtContentCell") +} + +// ValidateWithPath validates the CT_SdtContentCell and its children, prefixing error messages with path +func (m *CT_SdtContentCell) ValidateWithPath(path string) error { + for i, v := range m.Tc { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Tc[%d]", path, i)); err != nil { + return err + } + } + if m.CustomXml != nil { + if err := m.CustomXml.ValidateWithPath(path + "/CustomXml"); err != nil { + return err + } + } + if m.Sdt != nil { + if err := m.Sdt.ValidateWithPath(path + "/Sdt"); err != nil { + return err + } + } + for i, v := range m.EG_RunLevelElts { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_RunLevelElts[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtContentRow.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtContentRow.go new file mode 100644 index 00000000..799f04d0 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtContentRow.go @@ -0,0 +1,340 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/math" +) + +type CT_SdtContentRow struct { + // Table Row + Tr []*CT_Row + // Row-Level Custom XML Element + CustomXml *CT_CustomXmlRow + // Row-Level Structured Document Tag + Sdt *CT_SdtRow + EG_RunLevelElts []*EG_RunLevelElts +} + +func NewCT_SdtContentRow() *CT_SdtContentRow { + ret := &CT_SdtContentRow{} + return ret +} + +func (m *CT_SdtContentRow) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Tr != nil { + setr := xml.StartElement{Name: xml.Name{Local: "w:tr"}} + for _, c := range m.Tr { + e.EncodeElement(c, setr) + } + } + if m.CustomXml != nil { + secustomXml := xml.StartElement{Name: xml.Name{Local: "w:customXml"}} + e.EncodeElement(m.CustomXml, secustomXml) + } + if m.Sdt != nil { + sesdt := xml.StartElement{Name: xml.Name{Local: "w:sdt"}} + e.EncodeElement(m.Sdt, sesdt) + } + if m.EG_RunLevelElts != nil { + for _, c := range m.EG_RunLevelElts { + c.MarshalXML(e, xml.StartElement{}) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SdtContentRow) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_SdtContentRow: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tr"}: + tmp := NewCT_Row() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Tr = append(m.Tr, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXml"}: + m.CustomXml = NewCT_CustomXmlRow() + if err := d.DecodeElement(m.CustomXml, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdt"}: + m.Sdt = NewCT_SdtRow() + if err := d.DecodeElement(m.Sdt, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "proofErr"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.ProofErr = NewCT_ProofErr() + if err := d.DecodeElement(tmprunlevelelts.ProofErr, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermStart = NewCT_PermStart() + if err := d.DecodeElement(tmprunlevelelts.PermStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermEnd = NewCT_Perm() + if err := d.DecodeElement(tmprunlevelelts.PermEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Ins = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Ins, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Del = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Del, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFrom"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveFrom = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveFrom, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveTo"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveTo = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveTo, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkStart = NewCT_Bookmark() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeStart = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMathPara"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMathPara = math.NewOMathPara() + if err := d.DecodeElement(tmpmathcontent.OMathPara, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMath"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMath = math.NewOMath() + if err := d.DecodeElement(tmpmathcontent.OMath, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + default: + gooxml.Log("skipping unsupported element on CT_SdtContentRow %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_SdtContentRow + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_SdtContentRow and its children +func (m *CT_SdtContentRow) Validate() error { + return m.ValidateWithPath("CT_SdtContentRow") +} + +// ValidateWithPath validates the CT_SdtContentRow and its children, prefixing error messages with path +func (m *CT_SdtContentRow) ValidateWithPath(path string) error { + for i, v := range m.Tr { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Tr[%d]", path, i)); err != nil { + return err + } + } + if m.CustomXml != nil { + if err := m.CustomXml.ValidateWithPath(path + "/CustomXml"); err != nil { + return err + } + } + if m.Sdt != nil { + if err := m.Sdt.ValidateWithPath(path + "/Sdt"); err != nil { + return err + } + } + for i, v := range m.EG_RunLevelElts { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_RunLevelElts[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtContentRun.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtContentRun.go new file mode 100644 index 00000000..24fae64d --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtContentRun.go @@ -0,0 +1,432 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/math" +) + +type CT_SdtContentRun struct { + // Simple Field + FldSimple []*CT_SimpleField + // Hyperlink + Hyperlink *CT_Hyperlink + // Anchor for Subdocument Location + SubDoc *CT_Rel + EG_ContentRunContent []*EG_ContentRunContent +} + +func NewCT_SdtContentRun() *CT_SdtContentRun { + ret := &CT_SdtContentRun{} + return ret +} + +func (m *CT_SdtContentRun) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.FldSimple != nil { + sefldSimple := xml.StartElement{Name: xml.Name{Local: "w:fldSimple"}} + for _, c := range m.FldSimple { + e.EncodeElement(c, sefldSimple) + } + } + if m.Hyperlink != nil { + sehyperlink := xml.StartElement{Name: xml.Name{Local: "w:hyperlink"}} + e.EncodeElement(m.Hyperlink, sehyperlink) + } + if m.SubDoc != nil { + sesubDoc := xml.StartElement{Name: xml.Name{Local: "w:subDoc"}} + e.EncodeElement(m.SubDoc, sesubDoc) + } + if m.EG_ContentRunContent != nil { + for _, c := range m.EG_ContentRunContent { + c.MarshalXML(e, xml.StartElement{}) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SdtContentRun) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_SdtContentRun: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "fldSimple"}: + tmp := NewCT_SimpleField() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.FldSimple = append(m.FldSimple, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "hyperlink"}: + m.Hyperlink = NewCT_Hyperlink() + if err := d.DecodeElement(m.Hyperlink, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "subDoc"}: + m.SubDoc = NewCT_Rel() + if err := d.DecodeElement(m.SubDoc, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXml"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.CustomXml = NewCT_CustomXmlRun() + if err := d.DecodeElement(tmpcontentruncontent.CustomXml, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "smartTag"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.SmartTag = NewCT_SmartTagRun() + if err := d.DecodeElement(tmpcontentruncontent.SmartTag, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdt"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.Sdt = NewCT_SdtRun() + if err := d.DecodeElement(tmpcontentruncontent.Sdt, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "dir"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.Dir = NewCT_DirContentRun() + if err := d.DecodeElement(tmpcontentruncontent.Dir, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bdo"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.Bdo = NewCT_BdoContentRun() + if err := d.DecodeElement(tmpcontentruncontent.Bdo, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "r"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.R = NewCT_R() + if err := d.DecodeElement(tmpcontentruncontent.R, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "proofErr"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.ProofErr = NewCT_ProofErr() + if err := d.DecodeElement(tmprunlevelelts.ProofErr, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermStart = NewCT_PermStart() + if err := d.DecodeElement(tmprunlevelelts.PermStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermEnd = NewCT_Perm() + if err := d.DecodeElement(tmprunlevelelts.PermEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Ins = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Ins, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Del = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Del, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFrom"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveFrom = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveFrom, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveTo"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveTo = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveTo, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkStart = NewCT_Bookmark() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeStart = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMathPara"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMathPara = math.NewOMathPara() + if err := d.DecodeElement(tmpmathcontent.OMathPara, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMath"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMath = math.NewOMath() + if err := d.DecodeElement(tmpmathcontent.OMath, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + default: + gooxml.Log("skipping unsupported element on CT_SdtContentRun %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_SdtContentRun + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_SdtContentRun and its children +func (m *CT_SdtContentRun) Validate() error { + return m.ValidateWithPath("CT_SdtContentRun") +} + +// ValidateWithPath validates the CT_SdtContentRun and its children, prefixing error messages with path +func (m *CT_SdtContentRun) ValidateWithPath(path string) error { + for i, v := range m.FldSimple { + if err := v.ValidateWithPath(fmt.Sprintf("%s/FldSimple[%d]", path, i)); err != nil { + return err + } + } + if m.Hyperlink != nil { + if err := m.Hyperlink.ValidateWithPath(path + "/Hyperlink"); err != nil { + return err + } + } + if m.SubDoc != nil { + if err := m.SubDoc.ValidateWithPath(path + "/SubDoc"); err != nil { + return err + } + } + for i, v := range m.EG_ContentRunContent { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_ContentRunContent[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtDate.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtDate.go new file mode 100644 index 00000000..51f5a149 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtDate.go @@ -0,0 +1,147 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "time" + + "baliance.com/gooxml" +) + +type CT_SdtDate struct { + // Last Known Date in XML Schema DateTime Format + FullDateAttr *time.Time + // Date Display Mask + DateFormat *CT_String + // Date Picker Language ID + Lid *CT_Lang + // Custom XML Data Date Storage Format + StoreMappedDataAs *CT_SdtDateMappingType + // Date Picker Calendar Type + Calendar *CT_CalendarType +} + +func NewCT_SdtDate() *CT_SdtDate { + ret := &CT_SdtDate{} + return ret +} + +func (m *CT_SdtDate) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.FullDateAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:fullDate"}, + Value: fmt.Sprintf("%v", *m.FullDateAttr)}) + } + e.EncodeToken(start) + if m.DateFormat != nil { + sedateFormat := xml.StartElement{Name: xml.Name{Local: "w:dateFormat"}} + e.EncodeElement(m.DateFormat, sedateFormat) + } + if m.Lid != nil { + selid := xml.StartElement{Name: xml.Name{Local: "w:lid"}} + e.EncodeElement(m.Lid, selid) + } + if m.StoreMappedDataAs != nil { + sestoreMappedDataAs := xml.StartElement{Name: xml.Name{Local: "w:storeMappedDataAs"}} + e.EncodeElement(m.StoreMappedDataAs, sestoreMappedDataAs) + } + if m.Calendar != nil { + secalendar := xml.StartElement{Name: xml.Name{Local: "w:calendar"}} + e.EncodeElement(m.Calendar, secalendar) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SdtDate) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "fullDate" { + parsed, err := ParseStdlibTime(attr.Value) + if err != nil { + return err + } + m.FullDateAttr = &parsed + continue + } + } +lCT_SdtDate: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "dateFormat"}: + m.DateFormat = NewCT_String() + if err := d.DecodeElement(m.DateFormat, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "lid"}: + m.Lid = NewCT_Lang() + if err := d.DecodeElement(m.Lid, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "storeMappedDataAs"}: + m.StoreMappedDataAs = NewCT_SdtDateMappingType() + if err := d.DecodeElement(m.StoreMappedDataAs, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "calendar"}: + m.Calendar = NewCT_CalendarType() + if err := d.DecodeElement(m.Calendar, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_SdtDate %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_SdtDate + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_SdtDate and its children +func (m *CT_SdtDate) Validate() error { + return m.ValidateWithPath("CT_SdtDate") +} + +// ValidateWithPath validates the CT_SdtDate and its children, prefixing error messages with path +func (m *CT_SdtDate) ValidateWithPath(path string) error { + if m.DateFormat != nil { + if err := m.DateFormat.ValidateWithPath(path + "/DateFormat"); err != nil { + return err + } + } + if m.Lid != nil { + if err := m.Lid.ValidateWithPath(path + "/Lid"); err != nil { + return err + } + } + if m.StoreMappedDataAs != nil { + if err := m.StoreMappedDataAs.ValidateWithPath(path + "/StoreMappedDataAs"); err != nil { + return err + } + } + if m.Calendar != nil { + if err := m.Calendar.ValidateWithPath(path + "/Calendar"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtDateMappingType.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtDateMappingType.go new file mode 100644 index 00000000..15075c66 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtDateMappingType.go @@ -0,0 +1,72 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_SdtDateMappingType struct { + // Date Storage Type + ValAttr ST_SdtDateMappingType +} + +func NewCT_SdtDateMappingType() *CT_SdtDateMappingType { + ret := &CT_SdtDateMappingType{} + return ret +} + +func (m *CT_SdtDateMappingType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.ValAttr != ST_SdtDateMappingTypeUnset { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SdtDateMappingType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_SdtDateMappingType: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_SdtDateMappingType and its children +func (m *CT_SdtDateMappingType) Validate() error { + return m.ValidateWithPath("CT_SdtDateMappingType") +} + +// ValidateWithPath validates the CT_SdtDateMappingType and its children, prefixing error messages with path +func (m *CT_SdtDateMappingType) ValidateWithPath(path string) error { + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtDocPart.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtDocPart.go new file mode 100644 index 00000000..5cc34cf5 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtDocPart.go @@ -0,0 +1,113 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_SdtDocPart struct { + // Document Part Gallery Filter + DocPartGallery *CT_String + // Document Part Category Filter + DocPartCategory *CT_String + // Built-In Document Part + DocPartUnique *CT_OnOff +} + +func NewCT_SdtDocPart() *CT_SdtDocPart { + ret := &CT_SdtDocPart{} + return ret +} + +func (m *CT_SdtDocPart) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.DocPartGallery != nil { + sedocPartGallery := xml.StartElement{Name: xml.Name{Local: "w:docPartGallery"}} + e.EncodeElement(m.DocPartGallery, sedocPartGallery) + } + if m.DocPartCategory != nil { + sedocPartCategory := xml.StartElement{Name: xml.Name{Local: "w:docPartCategory"}} + e.EncodeElement(m.DocPartCategory, sedocPartCategory) + } + if m.DocPartUnique != nil { + sedocPartUnique := xml.StartElement{Name: xml.Name{Local: "w:docPartUnique"}} + e.EncodeElement(m.DocPartUnique, sedocPartUnique) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SdtDocPart) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_SdtDocPart: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "docPartGallery"}: + m.DocPartGallery = NewCT_String() + if err := d.DecodeElement(m.DocPartGallery, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "docPartCategory"}: + m.DocPartCategory = NewCT_String() + if err := d.DecodeElement(m.DocPartCategory, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "docPartUnique"}: + m.DocPartUnique = NewCT_OnOff() + if err := d.DecodeElement(m.DocPartUnique, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_SdtDocPart %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_SdtDocPart + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_SdtDocPart and its children +func (m *CT_SdtDocPart) Validate() error { + return m.ValidateWithPath("CT_SdtDocPart") +} + +// ValidateWithPath validates the CT_SdtDocPart and its children, prefixing error messages with path +func (m *CT_SdtDocPart) ValidateWithPath(path string) error { + if m.DocPartGallery != nil { + if err := m.DocPartGallery.ValidateWithPath(path + "/DocPartGallery"); err != nil { + return err + } + } + if m.DocPartCategory != nil { + if err := m.DocPartCategory.ValidateWithPath(path + "/DocPartCategory"); err != nil { + return err + } + } + if m.DocPartUnique != nil { + if err := m.DocPartUnique.ValidateWithPath(path + "/DocPartUnique"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtDropDownList.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtDropDownList.go new file mode 100644 index 00000000..ac172401 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtDropDownList.go @@ -0,0 +1,101 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_SdtDropDownList struct { + // Drop-down List Last Saved Value + LastValueAttr *string + // Drop-Down List Item + ListItem []*CT_SdtListItem +} + +func NewCT_SdtDropDownList() *CT_SdtDropDownList { + ret := &CT_SdtDropDownList{} + return ret +} + +func (m *CT_SdtDropDownList) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.LastValueAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:lastValue"}, + Value: fmt.Sprintf("%v", *m.LastValueAttr)}) + } + e.EncodeToken(start) + if m.ListItem != nil { + selistItem := xml.StartElement{Name: xml.Name{Local: "w:listItem"}} + for _, c := range m.ListItem { + e.EncodeElement(c, selistItem) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SdtDropDownList) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "lastValue" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.LastValueAttr = &parsed + continue + } + } +lCT_SdtDropDownList: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "listItem"}: + tmp := NewCT_SdtListItem() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.ListItem = append(m.ListItem, tmp) + default: + gooxml.Log("skipping unsupported element on CT_SdtDropDownList %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_SdtDropDownList + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_SdtDropDownList and its children +func (m *CT_SdtDropDownList) Validate() error { + return m.ValidateWithPath("CT_SdtDropDownList") +} + +// ValidateWithPath validates the CT_SdtDropDownList and its children, prefixing error messages with path +func (m *CT_SdtDropDownList) ValidateWithPath(path string) error { + for i, v := range m.ListItem { + if err := v.ValidateWithPath(fmt.Sprintf("%s/ListItem[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtEndPr.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtEndPr.go new file mode 100644 index 00000000..ef5416c2 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtEndPr.go @@ -0,0 +1,85 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_SdtEndPr struct { + // Structured Document Tag End Character Run Properties + RPr []*CT_RPr +} + +func NewCT_SdtEndPr() *CT_SdtEndPr { + ret := &CT_SdtEndPr{} + return ret +} + +func (m *CT_SdtEndPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.RPr != nil { + serPr := xml.StartElement{Name: xml.Name{Local: "w:rPr"}} + for _, c := range m.RPr { + e.EncodeElement(c, serPr) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SdtEndPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_SdtEndPr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rPr"}: + tmp := NewCT_RPr() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.RPr = append(m.RPr, tmp) + default: + gooxml.Log("skipping unsupported element on CT_SdtEndPr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_SdtEndPr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_SdtEndPr and its children +func (m *CT_SdtEndPr) Validate() error { + return m.ValidateWithPath("CT_SdtEndPr") +} + +// ValidateWithPath validates the CT_SdtEndPr and its children, prefixing error messages with path +func (m *CT_SdtEndPr) ValidateWithPath(path string) error { + for i, v := range m.RPr { + if err := v.ValidateWithPath(fmt.Sprintf("%s/RPr[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtListItem.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtListItem.go new file mode 100644 index 00000000..da36675d --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtListItem.go @@ -0,0 +1,84 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_SdtListItem struct { + // List Entry Display Text + DisplayTextAttr *string + // List Entry Value + ValueAttr *string +} + +func NewCT_SdtListItem() *CT_SdtListItem { + ret := &CT_SdtListItem{} + return ret +} + +func (m *CT_SdtListItem) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.DisplayTextAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:displayText"}, + Value: fmt.Sprintf("%v", *m.DisplayTextAttr)}) + } + if m.ValueAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:value"}, + Value: fmt.Sprintf("%v", *m.ValueAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SdtListItem) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "displayText" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.DisplayTextAttr = &parsed + continue + } + if attr.Name.Local == "value" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ValueAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_SdtListItem: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_SdtListItem and its children +func (m *CT_SdtListItem) Validate() error { + return m.ValidateWithPath("CT_SdtListItem") +} + +// ValidateWithPath validates the CT_SdtListItem and its children, prefixing error messages with path +func (m *CT_SdtListItem) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtPr.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtPr.go new file mode 100644 index 00000000..8e472069 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtPr.go @@ -0,0 +1,317 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_SdtPr struct { + // Run Properties For Structured Document Tag Contents + RPr *CT_RPr + // Friendly Name + Alias *CT_String + // Programmatic Tag + Tag *CT_String + // Unique ID + Id *CT_DecimalNumber + // Locking Setting + Lock *CT_Lock + // Structured Document Tag Placeholder Text + Placeholder *CT_Placeholder + // Remove Structured Document Tag When Contents Are Edited + Temporary *CT_OnOff + // Current Contents Are Placeholder Text + ShowingPlcHdr *CT_OnOff + // XML Mapping + DataBinding *CT_DataBinding + // Structured Document Tag Label + Label *CT_DecimalNumber + // Structured Document Tag Navigation Order Index + TabIndex *CT_UnsignedDecimalNumber + Choice *CT_SdtPrChoice + Extra []gooxml.Any +} + +func NewCT_SdtPr() *CT_SdtPr { + ret := &CT_SdtPr{} + return ret +} + +func (m *CT_SdtPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.RPr != nil { + serPr := xml.StartElement{Name: xml.Name{Local: "w:rPr"}} + e.EncodeElement(m.RPr, serPr) + } + if m.Alias != nil { + sealias := xml.StartElement{Name: xml.Name{Local: "w:alias"}} + e.EncodeElement(m.Alias, sealias) + } + if m.Tag != nil { + setag := xml.StartElement{Name: xml.Name{Local: "w:tag"}} + e.EncodeElement(m.Tag, setag) + } + if m.Id != nil { + seid := xml.StartElement{Name: xml.Name{Local: "w:id"}} + e.EncodeElement(m.Id, seid) + } + if m.Lock != nil { + selock := xml.StartElement{Name: xml.Name{Local: "w:lock"}} + e.EncodeElement(m.Lock, selock) + } + if m.Placeholder != nil { + seplaceholder := xml.StartElement{Name: xml.Name{Local: "w:placeholder"}} + e.EncodeElement(m.Placeholder, seplaceholder) + } + if m.Temporary != nil { + setemporary := xml.StartElement{Name: xml.Name{Local: "w:temporary"}} + e.EncodeElement(m.Temporary, setemporary) + } + if m.ShowingPlcHdr != nil { + seshowingPlcHdr := xml.StartElement{Name: xml.Name{Local: "w:showingPlcHdr"}} + e.EncodeElement(m.ShowingPlcHdr, seshowingPlcHdr) + } + if m.DataBinding != nil { + sedataBinding := xml.StartElement{Name: xml.Name{Local: "w:dataBinding"}} + e.EncodeElement(m.DataBinding, sedataBinding) + } + if m.Label != nil { + selabel := xml.StartElement{Name: xml.Name{Local: "w:label"}} + e.EncodeElement(m.Label, selabel) + } + if m.TabIndex != nil { + setabIndex := xml.StartElement{Name: xml.Name{Local: "w:tabIndex"}} + e.EncodeElement(m.TabIndex, setabIndex) + } + if m.Choice != nil { + m.Choice.MarshalXML(e, xml.StartElement{}) + } + for _, any := range m.Extra { + if err := any.MarshalXML(e, xml.StartElement{}); err != nil { + return err + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SdtPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_SdtPr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rPr"}: + m.RPr = NewCT_RPr() + if err := d.DecodeElement(m.RPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "alias"}: + m.Alias = NewCT_String() + if err := d.DecodeElement(m.Alias, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tag"}: + m.Tag = NewCT_String() + if err := d.DecodeElement(m.Tag, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "id"}: + m.Id = NewCT_DecimalNumber() + if err := d.DecodeElement(m.Id, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "lock"}: + m.Lock = NewCT_Lock() + if err := d.DecodeElement(m.Lock, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "placeholder"}: + m.Placeholder = NewCT_Placeholder() + if err := d.DecodeElement(m.Placeholder, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "temporary"}: + m.Temporary = NewCT_OnOff() + if err := d.DecodeElement(m.Temporary, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "showingPlcHdr"}: + m.ShowingPlcHdr = NewCT_OnOff() + if err := d.DecodeElement(m.ShowingPlcHdr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "dataBinding"}: + m.DataBinding = NewCT_DataBinding() + if err := d.DecodeElement(m.DataBinding, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "label"}: + m.Label = NewCT_DecimalNumber() + if err := d.DecodeElement(m.Label, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tabIndex"}: + m.TabIndex = NewCT_UnsignedDecimalNumber() + if err := d.DecodeElement(m.TabIndex, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "equation"}: + m.Choice = NewCT_SdtPrChoice() + if err := d.DecodeElement(&m.Choice.Equation, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "comboBox"}: + m.Choice = NewCT_SdtPrChoice() + if err := d.DecodeElement(&m.Choice.ComboBox, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "date"}: + m.Choice = NewCT_SdtPrChoice() + if err := d.DecodeElement(&m.Choice.Date, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "docPartObj"}: + m.Choice = NewCT_SdtPrChoice() + if err := d.DecodeElement(&m.Choice.DocPartObj, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "docPartList"}: + m.Choice = NewCT_SdtPrChoice() + if err := d.DecodeElement(&m.Choice.DocPartList, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "dropDownList"}: + m.Choice = NewCT_SdtPrChoice() + if err := d.DecodeElement(&m.Choice.DropDownList, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "picture"}: + m.Choice = NewCT_SdtPrChoice() + if err := d.DecodeElement(&m.Choice.Picture, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "richText"}: + m.Choice = NewCT_SdtPrChoice() + if err := d.DecodeElement(&m.Choice.RichText, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "text"}: + m.Choice = NewCT_SdtPrChoice() + if err := d.DecodeElement(&m.Choice.Text, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "citation"}: + m.Choice = NewCT_SdtPrChoice() + if err := d.DecodeElement(&m.Choice.Citation, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "group"}: + m.Choice = NewCT_SdtPrChoice() + if err := d.DecodeElement(&m.Choice.Group, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bibliography"}: + m.Choice = NewCT_SdtPrChoice() + if err := d.DecodeElement(&m.Choice.Bibliography, &el); err != nil { + return err + } + default: + any := &gooxml.XSDAny{} + if err := d.DecodeElement(any, &el); err != nil { + return err + } + m.Extra = append(m.Extra, any) + } + case xml.EndElement: + break lCT_SdtPr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_SdtPr and its children +func (m *CT_SdtPr) Validate() error { + return m.ValidateWithPath("CT_SdtPr") +} + +// ValidateWithPath validates the CT_SdtPr and its children, prefixing error messages with path +func (m *CT_SdtPr) ValidateWithPath(path string) error { + if m.RPr != nil { + if err := m.RPr.ValidateWithPath(path + "/RPr"); err != nil { + return err + } + } + if m.Alias != nil { + if err := m.Alias.ValidateWithPath(path + "/Alias"); err != nil { + return err + } + } + if m.Tag != nil { + if err := m.Tag.ValidateWithPath(path + "/Tag"); err != nil { + return err + } + } + if m.Id != nil { + if err := m.Id.ValidateWithPath(path + "/Id"); err != nil { + return err + } + } + if m.Lock != nil { + if err := m.Lock.ValidateWithPath(path + "/Lock"); err != nil { + return err + } + } + if m.Placeholder != nil { + if err := m.Placeholder.ValidateWithPath(path + "/Placeholder"); err != nil { + return err + } + } + if m.Temporary != nil { + if err := m.Temporary.ValidateWithPath(path + "/Temporary"); err != nil { + return err + } + } + if m.ShowingPlcHdr != nil { + if err := m.ShowingPlcHdr.ValidateWithPath(path + "/ShowingPlcHdr"); err != nil { + return err + } + } + if m.DataBinding != nil { + if err := m.DataBinding.ValidateWithPath(path + "/DataBinding"); err != nil { + return err + } + } + if m.Label != nil { + if err := m.Label.ValidateWithPath(path + "/Label"); err != nil { + return err + } + } + if m.TabIndex != nil { + if err := m.TabIndex.ValidateWithPath(path + "/TabIndex"); err != nil { + return err + } + } + if m.Choice != nil { + if err := m.Choice.ValidateWithPath(path + "/Choice"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtPrChoice.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtPrChoice.go new file mode 100644 index 00000000..500e4cbd --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtPrChoice.go @@ -0,0 +1,243 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_SdtPrChoice struct { + Equation *CT_Empty + ComboBox *CT_SdtComboBox + Date *CT_SdtDate + DocPartObj *CT_SdtDocPart + DocPartList *CT_SdtDocPart + DropDownList *CT_SdtDropDownList + Picture *CT_Empty + RichText *CT_Empty + Text *CT_SdtText + Citation *CT_Empty + Group *CT_Empty + Bibliography *CT_Empty +} + +func NewCT_SdtPrChoice() *CT_SdtPrChoice { + ret := &CT_SdtPrChoice{} + return ret +} + +func (m *CT_SdtPrChoice) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.Equation != nil { + seequation := xml.StartElement{Name: xml.Name{Local: "w:equation"}} + e.EncodeElement(m.Equation, seequation) + } + if m.ComboBox != nil { + secomboBox := xml.StartElement{Name: xml.Name{Local: "w:comboBox"}} + e.EncodeElement(m.ComboBox, secomboBox) + } + if m.Date != nil { + sedate := xml.StartElement{Name: xml.Name{Local: "w:date"}} + e.EncodeElement(m.Date, sedate) + } + if m.DocPartObj != nil { + sedocPartObj := xml.StartElement{Name: xml.Name{Local: "w:docPartObj"}} + e.EncodeElement(m.DocPartObj, sedocPartObj) + } + if m.DocPartList != nil { + sedocPartList := xml.StartElement{Name: xml.Name{Local: "w:docPartList"}} + e.EncodeElement(m.DocPartList, sedocPartList) + } + if m.DropDownList != nil { + sedropDownList := xml.StartElement{Name: xml.Name{Local: "w:dropDownList"}} + e.EncodeElement(m.DropDownList, sedropDownList) + } + if m.Picture != nil { + sepicture := xml.StartElement{Name: xml.Name{Local: "w:picture"}} + e.EncodeElement(m.Picture, sepicture) + } + if m.RichText != nil { + serichText := xml.StartElement{Name: xml.Name{Local: "w:richText"}} + e.EncodeElement(m.RichText, serichText) + } + if m.Text != nil { + setext := xml.StartElement{Name: xml.Name{Local: "w:text"}} + e.EncodeElement(m.Text, setext) + } + if m.Citation != nil { + secitation := xml.StartElement{Name: xml.Name{Local: "w:citation"}} + e.EncodeElement(m.Citation, secitation) + } + if m.Group != nil { + segroup := xml.StartElement{Name: xml.Name{Local: "w:group"}} + e.EncodeElement(m.Group, segroup) + } + if m.Bibliography != nil { + sebibliography := xml.StartElement{Name: xml.Name{Local: "w:bibliography"}} + e.EncodeElement(m.Bibliography, sebibliography) + } + return nil +} + +func (m *CT_SdtPrChoice) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_SdtPrChoice: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "equation"}: + m.Equation = NewCT_Empty() + if err := d.DecodeElement(m.Equation, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "comboBox"}: + m.ComboBox = NewCT_SdtComboBox() + if err := d.DecodeElement(m.ComboBox, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "date"}: + m.Date = NewCT_SdtDate() + if err := d.DecodeElement(m.Date, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "docPartObj"}: + m.DocPartObj = NewCT_SdtDocPart() + if err := d.DecodeElement(m.DocPartObj, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "docPartList"}: + m.DocPartList = NewCT_SdtDocPart() + if err := d.DecodeElement(m.DocPartList, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "dropDownList"}: + m.DropDownList = NewCT_SdtDropDownList() + if err := d.DecodeElement(m.DropDownList, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "picture"}: + m.Picture = NewCT_Empty() + if err := d.DecodeElement(m.Picture, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "richText"}: + m.RichText = NewCT_Empty() + if err := d.DecodeElement(m.RichText, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "text"}: + m.Text = NewCT_SdtText() + if err := d.DecodeElement(m.Text, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "citation"}: + m.Citation = NewCT_Empty() + if err := d.DecodeElement(m.Citation, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "group"}: + m.Group = NewCT_Empty() + if err := d.DecodeElement(m.Group, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bibliography"}: + m.Bibliography = NewCT_Empty() + if err := d.DecodeElement(m.Bibliography, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_SdtPrChoice %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_SdtPrChoice + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_SdtPrChoice and its children +func (m *CT_SdtPrChoice) Validate() error { + return m.ValidateWithPath("CT_SdtPrChoice") +} + +// ValidateWithPath validates the CT_SdtPrChoice and its children, prefixing error messages with path +func (m *CT_SdtPrChoice) ValidateWithPath(path string) error { + if m.Equation != nil { + if err := m.Equation.ValidateWithPath(path + "/Equation"); err != nil { + return err + } + } + if m.ComboBox != nil { + if err := m.ComboBox.ValidateWithPath(path + "/ComboBox"); err != nil { + return err + } + } + if m.Date != nil { + if err := m.Date.ValidateWithPath(path + "/Date"); err != nil { + return err + } + } + if m.DocPartObj != nil { + if err := m.DocPartObj.ValidateWithPath(path + "/DocPartObj"); err != nil { + return err + } + } + if m.DocPartList != nil { + if err := m.DocPartList.ValidateWithPath(path + "/DocPartList"); err != nil { + return err + } + } + if m.DropDownList != nil { + if err := m.DropDownList.ValidateWithPath(path + "/DropDownList"); err != nil { + return err + } + } + if m.Picture != nil { + if err := m.Picture.ValidateWithPath(path + "/Picture"); err != nil { + return err + } + } + if m.RichText != nil { + if err := m.RichText.ValidateWithPath(path + "/RichText"); err != nil { + return err + } + } + if m.Text != nil { + if err := m.Text.ValidateWithPath(path + "/Text"); err != nil { + return err + } + } + if m.Citation != nil { + if err := m.Citation.ValidateWithPath(path + "/Citation"); err != nil { + return err + } + } + if m.Group != nil { + if err := m.Group.ValidateWithPath(path + "/Group"); err != nil { + return err + } + } + if m.Bibliography != nil { + if err := m.Bibliography.ValidateWithPath(path + "/Bibliography"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtRow.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtRow.go new file mode 100644 index 00000000..42d23b13 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtRow.go @@ -0,0 +1,113 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_SdtRow struct { + // Structured Document Tag Properties + SdtPr *CT_SdtPr + // Structured Document Tag End Character Properties + SdtEndPr *CT_SdtEndPr + // Row-Level Structured Document Tag Content + SdtContent *CT_SdtContentRow +} + +func NewCT_SdtRow() *CT_SdtRow { + ret := &CT_SdtRow{} + return ret +} + +func (m *CT_SdtRow) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.SdtPr != nil { + sesdtPr := xml.StartElement{Name: xml.Name{Local: "w:sdtPr"}} + e.EncodeElement(m.SdtPr, sesdtPr) + } + if m.SdtEndPr != nil { + sesdtEndPr := xml.StartElement{Name: xml.Name{Local: "w:sdtEndPr"}} + e.EncodeElement(m.SdtEndPr, sesdtEndPr) + } + if m.SdtContent != nil { + sesdtContent := xml.StartElement{Name: xml.Name{Local: "w:sdtContent"}} + e.EncodeElement(m.SdtContent, sesdtContent) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SdtRow) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_SdtRow: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdtPr"}: + m.SdtPr = NewCT_SdtPr() + if err := d.DecodeElement(m.SdtPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdtEndPr"}: + m.SdtEndPr = NewCT_SdtEndPr() + if err := d.DecodeElement(m.SdtEndPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdtContent"}: + m.SdtContent = NewCT_SdtContentRow() + if err := d.DecodeElement(m.SdtContent, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_SdtRow %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_SdtRow + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_SdtRow and its children +func (m *CT_SdtRow) Validate() error { + return m.ValidateWithPath("CT_SdtRow") +} + +// ValidateWithPath validates the CT_SdtRow and its children, prefixing error messages with path +func (m *CT_SdtRow) ValidateWithPath(path string) error { + if m.SdtPr != nil { + if err := m.SdtPr.ValidateWithPath(path + "/SdtPr"); err != nil { + return err + } + } + if m.SdtEndPr != nil { + if err := m.SdtEndPr.ValidateWithPath(path + "/SdtEndPr"); err != nil { + return err + } + } + if m.SdtContent != nil { + if err := m.SdtContent.ValidateWithPath(path + "/SdtContent"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtRun.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtRun.go new file mode 100644 index 00000000..486710cb --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtRun.go @@ -0,0 +1,113 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_SdtRun struct { + // Structured Document Tag Properties + SdtPr *CT_SdtPr + // Structured Document Tag End Character Properties + SdtEndPr *CT_SdtEndPr + // Inline-Level Structured Document Tag Content + SdtContent *CT_SdtContentRun +} + +func NewCT_SdtRun() *CT_SdtRun { + ret := &CT_SdtRun{} + return ret +} + +func (m *CT_SdtRun) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.SdtPr != nil { + sesdtPr := xml.StartElement{Name: xml.Name{Local: "w:sdtPr"}} + e.EncodeElement(m.SdtPr, sesdtPr) + } + if m.SdtEndPr != nil { + sesdtEndPr := xml.StartElement{Name: xml.Name{Local: "w:sdtEndPr"}} + e.EncodeElement(m.SdtEndPr, sesdtEndPr) + } + if m.SdtContent != nil { + sesdtContent := xml.StartElement{Name: xml.Name{Local: "w:sdtContent"}} + e.EncodeElement(m.SdtContent, sesdtContent) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SdtRun) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_SdtRun: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdtPr"}: + m.SdtPr = NewCT_SdtPr() + if err := d.DecodeElement(m.SdtPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdtEndPr"}: + m.SdtEndPr = NewCT_SdtEndPr() + if err := d.DecodeElement(m.SdtEndPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdtContent"}: + m.SdtContent = NewCT_SdtContentRun() + if err := d.DecodeElement(m.SdtContent, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_SdtRun %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_SdtRun + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_SdtRun and its children +func (m *CT_SdtRun) Validate() error { + return m.ValidateWithPath("CT_SdtRun") +} + +// ValidateWithPath validates the CT_SdtRun and its children, prefixing error messages with path +func (m *CT_SdtRun) ValidateWithPath(path string) error { + if m.SdtPr != nil { + if err := m.SdtPr.ValidateWithPath(path + "/SdtPr"); err != nil { + return err + } + } + if m.SdtEndPr != nil { + if err := m.SdtEndPr.ValidateWithPath(path + "/SdtEndPr"); err != nil { + return err + } + } + if m.SdtContent != nil { + if err := m.SdtContent.ValidateWithPath(path + "/SdtContent"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtText.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtText.go new file mode 100644 index 00000000..8b9594c2 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SdtText.go @@ -0,0 +1,77 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_SdtText struct { + // Allow Soft Line Breaks + MultiLineAttr *sharedTypes.ST_OnOff +} + +func NewCT_SdtText() *CT_SdtText { + ret := &CT_SdtText{} + return ret +} + +func (m *CT_SdtText) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.MultiLineAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:multiLine"}, + Value: fmt.Sprintf("%v", *m.MultiLineAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SdtText) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "multiLine" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.MultiLineAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_SdtText: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_SdtText and its children +func (m *CT_SdtText) Validate() error { + return m.ValidateWithPath("CT_SdtText") +} + +// ValidateWithPath validates the CT_SdtText and its children, prefixing error messages with path +func (m *CT_SdtText) ValidateWithPath(path string) error { + if m.MultiLineAttr != nil { + if err := m.MultiLineAttr.ValidateWithPath(path + "/MultiLineAttr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SectPr.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SectPr.go new file mode 100644 index 00000000..08eca9ca --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SectPr.go @@ -0,0 +1,465 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_SectPr struct { + EG_HdrFtrReferences []*EG_HdrFtrReferences + // Section-Wide Footnote Properties + FootnotePr *CT_FtnProps + // Section-Wide Endnote Properties + EndnotePr *CT_EdnProps + // Section Type + Type *CT_SectType + // Page Size + PgSz *CT_PageSz + // Page Margins + PgMar *CT_PageMar + // Paper Source Information + PaperSrc *CT_PaperSource + // Page Borders + PgBorders *CT_PageBorders + // Line Numbering Settings + LnNumType *CT_LineNumber + // Page Numbering Settings + PgNumType *CT_PageNumber + // Column Definitions + Cols *CT_Columns + // Only Allow Editing of Form Fields + FormProt *CT_OnOff + // Vertical Text Alignment on Page + VAlign *CT_VerticalJc + // Suppress Endnotes In Document + NoEndnote *CT_OnOff + // Different First Page Headers and Footers + TitlePg *CT_OnOff + // Text Flow Direction + TextDirection *CT_TextDirection + // Right to Left Section Layout + Bidi *CT_OnOff + // Gutter on Right Side of Page + RtlGutter *CT_OnOff + // Document Grid + DocGrid *CT_DocGrid + // Reference to Printer Settings Data + PrinterSettings *CT_Rel + // Revision Information for Section Properties + SectPrChange *CT_SectPrChange + RsidRPrAttr *string + RsidDelAttr *string + RsidRAttr *string + RsidSectAttr *string +} + +func NewCT_SectPr() *CT_SectPr { + ret := &CT_SectPr{} + return ret +} + +func (m *CT_SectPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.RsidRPrAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:rsidRPr"}, + Value: fmt.Sprintf("%v", *m.RsidRPrAttr)}) + } + if m.RsidDelAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:rsidDel"}, + Value: fmt.Sprintf("%v", *m.RsidDelAttr)}) + } + if m.RsidRAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:rsidR"}, + Value: fmt.Sprintf("%v", *m.RsidRAttr)}) + } + if m.RsidSectAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:rsidSect"}, + Value: fmt.Sprintf("%v", *m.RsidSectAttr)}) + } + e.EncodeToken(start) + if m.EG_HdrFtrReferences != nil { + for _, c := range m.EG_HdrFtrReferences { + c.MarshalXML(e, xml.StartElement{}) + } + } + if m.FootnotePr != nil { + sefootnotePr := xml.StartElement{Name: xml.Name{Local: "w:footnotePr"}} + e.EncodeElement(m.FootnotePr, sefootnotePr) + } + if m.EndnotePr != nil { + seendnotePr := xml.StartElement{Name: xml.Name{Local: "w:endnotePr"}} + e.EncodeElement(m.EndnotePr, seendnotePr) + } + if m.Type != nil { + setype := xml.StartElement{Name: xml.Name{Local: "w:type"}} + e.EncodeElement(m.Type, setype) + } + if m.PgSz != nil { + sepgSz := xml.StartElement{Name: xml.Name{Local: "w:pgSz"}} + e.EncodeElement(m.PgSz, sepgSz) + } + if m.PgMar != nil { + sepgMar := xml.StartElement{Name: xml.Name{Local: "w:pgMar"}} + e.EncodeElement(m.PgMar, sepgMar) + } + if m.PaperSrc != nil { + sepaperSrc := xml.StartElement{Name: xml.Name{Local: "w:paperSrc"}} + e.EncodeElement(m.PaperSrc, sepaperSrc) + } + if m.PgBorders != nil { + sepgBorders := xml.StartElement{Name: xml.Name{Local: "w:pgBorders"}} + e.EncodeElement(m.PgBorders, sepgBorders) + } + if m.LnNumType != nil { + selnNumType := xml.StartElement{Name: xml.Name{Local: "w:lnNumType"}} + e.EncodeElement(m.LnNumType, selnNumType) + } + if m.PgNumType != nil { + sepgNumType := xml.StartElement{Name: xml.Name{Local: "w:pgNumType"}} + e.EncodeElement(m.PgNumType, sepgNumType) + } + if m.Cols != nil { + secols := xml.StartElement{Name: xml.Name{Local: "w:cols"}} + e.EncodeElement(m.Cols, secols) + } + if m.FormProt != nil { + seformProt := xml.StartElement{Name: xml.Name{Local: "w:formProt"}} + e.EncodeElement(m.FormProt, seformProt) + } + if m.VAlign != nil { + sevAlign := xml.StartElement{Name: xml.Name{Local: "w:vAlign"}} + e.EncodeElement(m.VAlign, sevAlign) + } + if m.NoEndnote != nil { + senoEndnote := xml.StartElement{Name: xml.Name{Local: "w:noEndnote"}} + e.EncodeElement(m.NoEndnote, senoEndnote) + } + if m.TitlePg != nil { + setitlePg := xml.StartElement{Name: xml.Name{Local: "w:titlePg"}} + e.EncodeElement(m.TitlePg, setitlePg) + } + if m.TextDirection != nil { + setextDirection := xml.StartElement{Name: xml.Name{Local: "w:textDirection"}} + e.EncodeElement(m.TextDirection, setextDirection) + } + if m.Bidi != nil { + sebidi := xml.StartElement{Name: xml.Name{Local: "w:bidi"}} + e.EncodeElement(m.Bidi, sebidi) + } + if m.RtlGutter != nil { + sertlGutter := xml.StartElement{Name: xml.Name{Local: "w:rtlGutter"}} + e.EncodeElement(m.RtlGutter, sertlGutter) + } + if m.DocGrid != nil { + sedocGrid := xml.StartElement{Name: xml.Name{Local: "w:docGrid"}} + e.EncodeElement(m.DocGrid, sedocGrid) + } + if m.PrinterSettings != nil { + seprinterSettings := xml.StartElement{Name: xml.Name{Local: "w:printerSettings"}} + e.EncodeElement(m.PrinterSettings, seprinterSettings) + } + if m.SectPrChange != nil { + sesectPrChange := xml.StartElement{Name: xml.Name{Local: "w:sectPrChange"}} + e.EncodeElement(m.SectPrChange, sesectPrChange) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SectPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "rsidRPr" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.RsidRPrAttr = &parsed + continue + } + if attr.Name.Local == "rsidR" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.RsidRAttr = &parsed + continue + } + if attr.Name.Local == "rsidDel" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.RsidDelAttr = &parsed + continue + } + if attr.Name.Local == "rsidSect" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.RsidSectAttr = &parsed + continue + } + } +lCT_SectPr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "headerReference"}: + tmphdrftrreferences := NewEG_HdrFtrReferences() + tmphdrftrreferences.HeaderReference = NewCT_HdrFtrRef() + if err := d.DecodeElement(tmphdrftrreferences.HeaderReference, &el); err != nil { + return err + } + m.EG_HdrFtrReferences = append(m.EG_HdrFtrReferences, tmphdrftrreferences) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "footerReference"}: + tmphdrftrreferences := NewEG_HdrFtrReferences() + tmphdrftrreferences.FooterReference = NewCT_HdrFtrRef() + if err := d.DecodeElement(tmphdrftrreferences.FooterReference, &el); err != nil { + return err + } + m.EG_HdrFtrReferences = append(m.EG_HdrFtrReferences, tmphdrftrreferences) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "footnotePr"}: + m.FootnotePr = NewCT_FtnProps() + if err := d.DecodeElement(m.FootnotePr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "endnotePr"}: + m.EndnotePr = NewCT_EdnProps() + if err := d.DecodeElement(m.EndnotePr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "type"}: + m.Type = NewCT_SectType() + if err := d.DecodeElement(m.Type, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pgSz"}: + m.PgSz = NewCT_PageSz() + if err := d.DecodeElement(m.PgSz, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pgMar"}: + m.PgMar = NewCT_PageMar() + if err := d.DecodeElement(m.PgMar, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "paperSrc"}: + m.PaperSrc = NewCT_PaperSource() + if err := d.DecodeElement(m.PaperSrc, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pgBorders"}: + m.PgBorders = NewCT_PageBorders() + if err := d.DecodeElement(m.PgBorders, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "lnNumType"}: + m.LnNumType = NewCT_LineNumber() + if err := d.DecodeElement(m.LnNumType, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pgNumType"}: + m.PgNumType = NewCT_PageNumber() + if err := d.DecodeElement(m.PgNumType, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "cols"}: + m.Cols = NewCT_Columns() + if err := d.DecodeElement(m.Cols, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "formProt"}: + m.FormProt = NewCT_OnOff() + if err := d.DecodeElement(m.FormProt, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "vAlign"}: + m.VAlign = NewCT_VerticalJc() + if err := d.DecodeElement(m.VAlign, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "noEndnote"}: + m.NoEndnote = NewCT_OnOff() + if err := d.DecodeElement(m.NoEndnote, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "titlePg"}: + m.TitlePg = NewCT_OnOff() + if err := d.DecodeElement(m.TitlePg, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "textDirection"}: + m.TextDirection = NewCT_TextDirection() + if err := d.DecodeElement(m.TextDirection, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bidi"}: + m.Bidi = NewCT_OnOff() + if err := d.DecodeElement(m.Bidi, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rtlGutter"}: + m.RtlGutter = NewCT_OnOff() + if err := d.DecodeElement(m.RtlGutter, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "docGrid"}: + m.DocGrid = NewCT_DocGrid() + if err := d.DecodeElement(m.DocGrid, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "printerSettings"}: + m.PrinterSettings = NewCT_Rel() + if err := d.DecodeElement(m.PrinterSettings, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sectPrChange"}: + m.SectPrChange = NewCT_SectPrChange() + if err := d.DecodeElement(m.SectPrChange, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_SectPr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_SectPr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_SectPr and its children +func (m *CT_SectPr) Validate() error { + return m.ValidateWithPath("CT_SectPr") +} + +// ValidateWithPath validates the CT_SectPr and its children, prefixing error messages with path +func (m *CT_SectPr) ValidateWithPath(path string) error { + for i, v := range m.EG_HdrFtrReferences { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_HdrFtrReferences[%d]", path, i)); err != nil { + return err + } + } + if m.FootnotePr != nil { + if err := m.FootnotePr.ValidateWithPath(path + "/FootnotePr"); err != nil { + return err + } + } + if m.EndnotePr != nil { + if err := m.EndnotePr.ValidateWithPath(path + "/EndnotePr"); err != nil { + return err + } + } + if m.Type != nil { + if err := m.Type.ValidateWithPath(path + "/Type"); err != nil { + return err + } + } + if m.PgSz != nil { + if err := m.PgSz.ValidateWithPath(path + "/PgSz"); err != nil { + return err + } + } + if m.PgMar != nil { + if err := m.PgMar.ValidateWithPath(path + "/PgMar"); err != nil { + return err + } + } + if m.PaperSrc != nil { + if err := m.PaperSrc.ValidateWithPath(path + "/PaperSrc"); err != nil { + return err + } + } + if m.PgBorders != nil { + if err := m.PgBorders.ValidateWithPath(path + "/PgBorders"); err != nil { + return err + } + } + if m.LnNumType != nil { + if err := m.LnNumType.ValidateWithPath(path + "/LnNumType"); err != nil { + return err + } + } + if m.PgNumType != nil { + if err := m.PgNumType.ValidateWithPath(path + "/PgNumType"); err != nil { + return err + } + } + if m.Cols != nil { + if err := m.Cols.ValidateWithPath(path + "/Cols"); err != nil { + return err + } + } + if m.FormProt != nil { + if err := m.FormProt.ValidateWithPath(path + "/FormProt"); err != nil { + return err + } + } + if m.VAlign != nil { + if err := m.VAlign.ValidateWithPath(path + "/VAlign"); err != nil { + return err + } + } + if m.NoEndnote != nil { + if err := m.NoEndnote.ValidateWithPath(path + "/NoEndnote"); err != nil { + return err + } + } + if m.TitlePg != nil { + if err := m.TitlePg.ValidateWithPath(path + "/TitlePg"); err != nil { + return err + } + } + if m.TextDirection != nil { + if err := m.TextDirection.ValidateWithPath(path + "/TextDirection"); err != nil { + return err + } + } + if m.Bidi != nil { + if err := m.Bidi.ValidateWithPath(path + "/Bidi"); err != nil { + return err + } + } + if m.RtlGutter != nil { + if err := m.RtlGutter.ValidateWithPath(path + "/RtlGutter"); err != nil { + return err + } + } + if m.DocGrid != nil { + if err := m.DocGrid.ValidateWithPath(path + "/DocGrid"); err != nil { + return err + } + } + if m.PrinterSettings != nil { + if err := m.PrinterSettings.ValidateWithPath(path + "/PrinterSettings"); err != nil { + return err + } + } + if m.SectPrChange != nil { + if err := m.SectPrChange.ValidateWithPath(path + "/SectPrChange"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SectPrBase.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SectPrBase.go new file mode 100644 index 00000000..ca8077c5 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SectPrBase.go @@ -0,0 +1,424 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_SectPrBase struct { + // Section-Wide Footnote Properties + FootnotePr *CT_FtnProps + // Section-Wide Endnote Properties + EndnotePr *CT_EdnProps + // Section Type + Type *CT_SectType + // Page Size + PgSz *CT_PageSz + // Page Margins + PgMar *CT_PageMar + // Paper Source Information + PaperSrc *CT_PaperSource + // Page Borders + PgBorders *CT_PageBorders + // Line Numbering Settings + LnNumType *CT_LineNumber + // Page Numbering Settings + PgNumType *CT_PageNumber + // Column Definitions + Cols *CT_Columns + // Only Allow Editing of Form Fields + FormProt *CT_OnOff + // Vertical Text Alignment on Page + VAlign *CT_VerticalJc + // Suppress Endnotes In Document + NoEndnote *CT_OnOff + // Different First Page Headers and Footers + TitlePg *CT_OnOff + // Text Flow Direction + TextDirection *CT_TextDirection + // Right to Left Section Layout + Bidi *CT_OnOff + // Gutter on Right Side of Page + RtlGutter *CT_OnOff + // Document Grid + DocGrid *CT_DocGrid + // Reference to Printer Settings Data + PrinterSettings *CT_Rel + RsidRPrAttr *string + RsidDelAttr *string + RsidRAttr *string + RsidSectAttr *string +} + +func NewCT_SectPrBase() *CT_SectPrBase { + ret := &CT_SectPrBase{} + return ret +} + +func (m *CT_SectPrBase) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.RsidRPrAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:rsidRPr"}, + Value: fmt.Sprintf("%v", *m.RsidRPrAttr)}) + } + if m.RsidDelAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:rsidDel"}, + Value: fmt.Sprintf("%v", *m.RsidDelAttr)}) + } + if m.RsidRAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:rsidR"}, + Value: fmt.Sprintf("%v", *m.RsidRAttr)}) + } + if m.RsidSectAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:rsidSect"}, + Value: fmt.Sprintf("%v", *m.RsidSectAttr)}) + } + e.EncodeToken(start) + if m.FootnotePr != nil { + sefootnotePr := xml.StartElement{Name: xml.Name{Local: "w:footnotePr"}} + e.EncodeElement(m.FootnotePr, sefootnotePr) + } + if m.EndnotePr != nil { + seendnotePr := xml.StartElement{Name: xml.Name{Local: "w:endnotePr"}} + e.EncodeElement(m.EndnotePr, seendnotePr) + } + if m.Type != nil { + setype := xml.StartElement{Name: xml.Name{Local: "w:type"}} + e.EncodeElement(m.Type, setype) + } + if m.PgSz != nil { + sepgSz := xml.StartElement{Name: xml.Name{Local: "w:pgSz"}} + e.EncodeElement(m.PgSz, sepgSz) + } + if m.PgMar != nil { + sepgMar := xml.StartElement{Name: xml.Name{Local: "w:pgMar"}} + e.EncodeElement(m.PgMar, sepgMar) + } + if m.PaperSrc != nil { + sepaperSrc := xml.StartElement{Name: xml.Name{Local: "w:paperSrc"}} + e.EncodeElement(m.PaperSrc, sepaperSrc) + } + if m.PgBorders != nil { + sepgBorders := xml.StartElement{Name: xml.Name{Local: "w:pgBorders"}} + e.EncodeElement(m.PgBorders, sepgBorders) + } + if m.LnNumType != nil { + selnNumType := xml.StartElement{Name: xml.Name{Local: "w:lnNumType"}} + e.EncodeElement(m.LnNumType, selnNumType) + } + if m.PgNumType != nil { + sepgNumType := xml.StartElement{Name: xml.Name{Local: "w:pgNumType"}} + e.EncodeElement(m.PgNumType, sepgNumType) + } + if m.Cols != nil { + secols := xml.StartElement{Name: xml.Name{Local: "w:cols"}} + e.EncodeElement(m.Cols, secols) + } + if m.FormProt != nil { + seformProt := xml.StartElement{Name: xml.Name{Local: "w:formProt"}} + e.EncodeElement(m.FormProt, seformProt) + } + if m.VAlign != nil { + sevAlign := xml.StartElement{Name: xml.Name{Local: "w:vAlign"}} + e.EncodeElement(m.VAlign, sevAlign) + } + if m.NoEndnote != nil { + senoEndnote := xml.StartElement{Name: xml.Name{Local: "w:noEndnote"}} + e.EncodeElement(m.NoEndnote, senoEndnote) + } + if m.TitlePg != nil { + setitlePg := xml.StartElement{Name: xml.Name{Local: "w:titlePg"}} + e.EncodeElement(m.TitlePg, setitlePg) + } + if m.TextDirection != nil { + setextDirection := xml.StartElement{Name: xml.Name{Local: "w:textDirection"}} + e.EncodeElement(m.TextDirection, setextDirection) + } + if m.Bidi != nil { + sebidi := xml.StartElement{Name: xml.Name{Local: "w:bidi"}} + e.EncodeElement(m.Bidi, sebidi) + } + if m.RtlGutter != nil { + sertlGutter := xml.StartElement{Name: xml.Name{Local: "w:rtlGutter"}} + e.EncodeElement(m.RtlGutter, sertlGutter) + } + if m.DocGrid != nil { + sedocGrid := xml.StartElement{Name: xml.Name{Local: "w:docGrid"}} + e.EncodeElement(m.DocGrid, sedocGrid) + } + if m.PrinterSettings != nil { + seprinterSettings := xml.StartElement{Name: xml.Name{Local: "w:printerSettings"}} + e.EncodeElement(m.PrinterSettings, seprinterSettings) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SectPrBase) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "rsidDel" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.RsidDelAttr = &parsed + continue + } + if attr.Name.Local == "rsidSect" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.RsidSectAttr = &parsed + continue + } + if attr.Name.Local == "rsidRPr" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.RsidRPrAttr = &parsed + continue + } + if attr.Name.Local == "rsidR" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.RsidRAttr = &parsed + continue + } + } +lCT_SectPrBase: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "footnotePr"}: + m.FootnotePr = NewCT_FtnProps() + if err := d.DecodeElement(m.FootnotePr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "endnotePr"}: + m.EndnotePr = NewCT_EdnProps() + if err := d.DecodeElement(m.EndnotePr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "type"}: + m.Type = NewCT_SectType() + if err := d.DecodeElement(m.Type, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pgSz"}: + m.PgSz = NewCT_PageSz() + if err := d.DecodeElement(m.PgSz, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pgMar"}: + m.PgMar = NewCT_PageMar() + if err := d.DecodeElement(m.PgMar, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "paperSrc"}: + m.PaperSrc = NewCT_PaperSource() + if err := d.DecodeElement(m.PaperSrc, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pgBorders"}: + m.PgBorders = NewCT_PageBorders() + if err := d.DecodeElement(m.PgBorders, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "lnNumType"}: + m.LnNumType = NewCT_LineNumber() + if err := d.DecodeElement(m.LnNumType, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pgNumType"}: + m.PgNumType = NewCT_PageNumber() + if err := d.DecodeElement(m.PgNumType, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "cols"}: + m.Cols = NewCT_Columns() + if err := d.DecodeElement(m.Cols, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "formProt"}: + m.FormProt = NewCT_OnOff() + if err := d.DecodeElement(m.FormProt, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "vAlign"}: + m.VAlign = NewCT_VerticalJc() + if err := d.DecodeElement(m.VAlign, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "noEndnote"}: + m.NoEndnote = NewCT_OnOff() + if err := d.DecodeElement(m.NoEndnote, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "titlePg"}: + m.TitlePg = NewCT_OnOff() + if err := d.DecodeElement(m.TitlePg, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "textDirection"}: + m.TextDirection = NewCT_TextDirection() + if err := d.DecodeElement(m.TextDirection, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bidi"}: + m.Bidi = NewCT_OnOff() + if err := d.DecodeElement(m.Bidi, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rtlGutter"}: + m.RtlGutter = NewCT_OnOff() + if err := d.DecodeElement(m.RtlGutter, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "docGrid"}: + m.DocGrid = NewCT_DocGrid() + if err := d.DecodeElement(m.DocGrid, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "printerSettings"}: + m.PrinterSettings = NewCT_Rel() + if err := d.DecodeElement(m.PrinterSettings, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_SectPrBase %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_SectPrBase + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_SectPrBase and its children +func (m *CT_SectPrBase) Validate() error { + return m.ValidateWithPath("CT_SectPrBase") +} + +// ValidateWithPath validates the CT_SectPrBase and its children, prefixing error messages with path +func (m *CT_SectPrBase) ValidateWithPath(path string) error { + if m.FootnotePr != nil { + if err := m.FootnotePr.ValidateWithPath(path + "/FootnotePr"); err != nil { + return err + } + } + if m.EndnotePr != nil { + if err := m.EndnotePr.ValidateWithPath(path + "/EndnotePr"); err != nil { + return err + } + } + if m.Type != nil { + if err := m.Type.ValidateWithPath(path + "/Type"); err != nil { + return err + } + } + if m.PgSz != nil { + if err := m.PgSz.ValidateWithPath(path + "/PgSz"); err != nil { + return err + } + } + if m.PgMar != nil { + if err := m.PgMar.ValidateWithPath(path + "/PgMar"); err != nil { + return err + } + } + if m.PaperSrc != nil { + if err := m.PaperSrc.ValidateWithPath(path + "/PaperSrc"); err != nil { + return err + } + } + if m.PgBorders != nil { + if err := m.PgBorders.ValidateWithPath(path + "/PgBorders"); err != nil { + return err + } + } + if m.LnNumType != nil { + if err := m.LnNumType.ValidateWithPath(path + "/LnNumType"); err != nil { + return err + } + } + if m.PgNumType != nil { + if err := m.PgNumType.ValidateWithPath(path + "/PgNumType"); err != nil { + return err + } + } + if m.Cols != nil { + if err := m.Cols.ValidateWithPath(path + "/Cols"); err != nil { + return err + } + } + if m.FormProt != nil { + if err := m.FormProt.ValidateWithPath(path + "/FormProt"); err != nil { + return err + } + } + if m.VAlign != nil { + if err := m.VAlign.ValidateWithPath(path + "/VAlign"); err != nil { + return err + } + } + if m.NoEndnote != nil { + if err := m.NoEndnote.ValidateWithPath(path + "/NoEndnote"); err != nil { + return err + } + } + if m.TitlePg != nil { + if err := m.TitlePg.ValidateWithPath(path + "/TitlePg"); err != nil { + return err + } + } + if m.TextDirection != nil { + if err := m.TextDirection.ValidateWithPath(path + "/TextDirection"); err != nil { + return err + } + } + if m.Bidi != nil { + if err := m.Bidi.ValidateWithPath(path + "/Bidi"); err != nil { + return err + } + } + if m.RtlGutter != nil { + if err := m.RtlGutter.ValidateWithPath(path + "/RtlGutter"); err != nil { + return err + } + } + if m.DocGrid != nil { + if err := m.DocGrid.ValidateWithPath(path + "/DocGrid"); err != nil { + return err + } + } + if m.PrinterSettings != nil { + if err := m.PrinterSettings.ValidateWithPath(path + "/PrinterSettings"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SectPrChange.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SectPrChange.go new file mode 100644 index 00000000..bef371df --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SectPrChange.go @@ -0,0 +1,121 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + "time" + + "baliance.com/gooxml" +) + +type CT_SectPrChange struct { + AuthorAttr string + DateAttr *time.Time + // Annotation Identifier + IdAttr int64 + SectPr *CT_SectPrBase +} + +func NewCT_SectPrChange() *CT_SectPrChange { + ret := &CT_SectPrChange{} + return ret +} + +func (m *CT_SectPrChange) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:author"}, + Value: fmt.Sprintf("%v", m.AuthorAttr)}) + if m.DateAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:date"}, + Value: fmt.Sprintf("%v", *m.DateAttr)}) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:id"}, + Value: fmt.Sprintf("%v", m.IdAttr)}) + e.EncodeToken(start) + if m.SectPr != nil { + sesectPr := xml.StartElement{Name: xml.Name{Local: "w:sectPr"}} + e.EncodeElement(m.SectPr, sesectPr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SectPrChange) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "author" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.AuthorAttr = parsed + continue + } + if attr.Name.Local == "date" { + parsed, err := ParseStdlibTime(attr.Value) + if err != nil { + return err + } + m.DateAttr = &parsed + continue + } + if attr.Name.Local == "id" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.IdAttr = parsed + continue + } + } +lCT_SectPrChange: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sectPr"}: + m.SectPr = NewCT_SectPrBase() + if err := d.DecodeElement(m.SectPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_SectPrChange %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_SectPrChange + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_SectPrChange and its children +func (m *CT_SectPrChange) Validate() error { + return m.ValidateWithPath("CT_SectPrChange") +} + +// ValidateWithPath validates the CT_SectPrChange and its children, prefixing error messages with path +func (m *CT_SectPrChange) ValidateWithPath(path string) error { + if m.SectPr != nil { + if err := m.SectPr.ValidateWithPath(path + "/SectPr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SectType.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SectType.go new file mode 100644 index 00000000..3bdcf446 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SectType.go @@ -0,0 +1,72 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_SectType struct { + // Section Type Setting + ValAttr ST_SectionMark +} + +func NewCT_SectType() *CT_SectType { + ret := &CT_SectType{} + return ret +} + +func (m *CT_SectType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.ValAttr != ST_SectionMarkUnset { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SectType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_SectType: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_SectType and its children +func (m *CT_SectType) Validate() error { + return m.ValidateWithPath("CT_SectType") +} + +// ValidateWithPath validates the CT_SectType and its children, prefixing error messages with path +func (m *CT_SectType) ValidateWithPath(path string) error { + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Settings.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Settings.go new file mode 100644 index 00000000..4cf21099 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Settings.go @@ -0,0 +1,1650 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/math" + "baliance.com/gooxml/schema/soo/schemaLibrary" +) + +type CT_Settings struct { + // Write Protection + WriteProtection *CT_WriteProtection + // Document View Setting + View *CT_View + // Magnification Setting + Zoom *CT_Zoom + // Remove Personal Information from Document Properties + RemovePersonalInformation *CT_OnOff + // Remove Date and Time from Annotations + RemoveDateAndTime *CT_OnOff + // Do Not Display Visual Boundary For Header/Footer or Between Pages + DoNotDisplayPageBoundaries *CT_OnOff + // Display Background Objects When Displaying Document + DisplayBackgroundShape *CT_OnOff + // Print PostScript Codes With Document Text + PrintPostScriptOverText *CT_OnOff + // Print Fractional Character Widths + PrintFractionalCharacterWidth *CT_OnOff + // Only Print Form Field Content + PrintFormsData *CT_OnOff + // Embed TrueType Fonts + EmbedTrueTypeFonts *CT_OnOff + // Embed Common System Fonts + EmbedSystemFonts *CT_OnOff + // Subset Fonts When Embedding + SaveSubsetFonts *CT_OnOff + // Only Save Form Field Content + SaveFormsData *CT_OnOff + // Mirror Page Margins + MirrorMargins *CT_OnOff + // Align Paragraph and Table Borders with Page Border + AlignBordersAndEdges *CT_OnOff + // Page Border Excludes Header + BordersDoNotSurroundHeader *CT_OnOff + // Page Border Excludes Footer + BordersDoNotSurroundFooter *CT_OnOff + // Position Gutter At Top of Page + GutterAtTop *CT_OnOff + // Do Not Display Visual Indication of Spelling Errors + HideSpellingErrors *CT_OnOff + // Do Not Display Visual Indication of Grammatical Errors + HideGrammaticalErrors *CT_OnOff + // Grammar Checking Settings + ActiveWritingStyle []*CT_WritingStyle + // Spelling and Grammatical Checking State + ProofState *CT_Proof + // Structured Document Tag Placeholder Text Should be Resaved + FormsDesign *CT_OnOff + // Attached Document Template + AttachedTemplate *CT_Rel + // Automatically Update Styles From Document Template + LinkStyles *CT_OnOff + // Suggested Filtering for List of Document Styles + StylePaneFormatFilter *CT_StylePaneFilter + // Suggested Sorting for List of Document Styles + StylePaneSortMethod *CT_StyleSort + // Document Classification + DocumentType *CT_DocType + // Mail Merge Settings + MailMerge *CT_MailMerge + // Visibility of Annotation Types + RevisionView *CT_TrackChangesView + // Track Revisions to Document + TrackRevisions *CT_OnOff + // Do Not Use Move Syntax When Tracking Revisions + DoNotTrackMoves *CT_OnOff + // Do Not Track Formatting Revisions When Tracking Revisions + DoNotTrackFormatting *CT_OnOff + // Document Editing Restrictions + DocumentProtection *CT_DocProtect + // Allow Automatic Formatting to Override Formatting Protection Settings + AutoFormatOverride *CT_OnOff + // Prevent Modification of Themes Part + StyleLockTheme *CT_OnOff + // Prevent Replacement of Styles Part + StyleLockQFSet *CT_OnOff + // Distance Between Automatic Tab Stops + DefaultTabStop *CT_TwipsMeasure + // Automatically Hyphenate Document Contents When Displayed + AutoHyphenation *CT_OnOff + // Maximum Number of Consecutively Hyphenated Lines + ConsecutiveHyphenLimit *CT_DecimalNumber + // Hyphenation Zone + HyphenationZone *CT_TwipsMeasure + // Do Not Hyphenate Words in ALL CAPITAL LETTERS + DoNotHyphenateCaps *CT_OnOff + // Show E-Mail Message Header + ShowEnvelope *CT_OnOff + // Percentage of Document to Use When Generating Summary + SummaryLength *CT_DecimalNumberOrPrecent + // Paragraph Style Applied to Automatically Generated Paragraphs + ClickAndTypeStyle *CT_String + // Default Table Style for Newly Inserted Tables + DefaultTableStyle *CT_String + // Different Even/Odd Page Headers and Footers + EvenAndOddHeaders *CT_OnOff + // Reverse Book Fold Printing + BookFoldRevPrinting *CT_OnOff + // Book Fold Printing + BookFoldPrinting *CT_OnOff + // Number of Pages Per Booklet + BookFoldPrintingSheets *CT_DecimalNumber + // Drawing Grid Horizontal Grid Unit Size + DrawingGridHorizontalSpacing *CT_TwipsMeasure + // Drawing Grid Vertical Grid Unit Size + DrawingGridVerticalSpacing *CT_TwipsMeasure + // Distance between Horizontal Gridlines + DisplayHorizontalDrawingGridEvery *CT_DecimalNumber + // Distance between Vertical Gridlines + DisplayVerticalDrawingGridEvery *CT_DecimalNumber + // Do Not Use Margins for Drawing Grid Origin + DoNotUseMarginsForDrawingGridOrigin *CT_OnOff + // Drawing Grid Horizontal Origin Point + DrawingGridHorizontalOrigin *CT_TwipsMeasure + // Drawing Grid Vertical Origin Point + DrawingGridVerticalOrigin *CT_TwipsMeasure + // Do Not Show Visual Indicator For Form Fields + DoNotShadeFormData *CT_OnOff + // Never Kern Punctuation Characters + NoPunctuationKerning *CT_OnOff + // Character-Level Whitespace Compression + CharacterSpacingControl *CT_CharacterSpacing + // Print Two Pages Per Sheet + PrintTwoOnOne *CT_OnOff + // Use Strict Kinsoku Rules for Japanese Text + StrictFirstAndLastChars *CT_OnOff + // Custom Set of Characters Which Cannot End a Line + NoLineBreaksAfter *CT_Kinsoku + // Custom Set Of Characters Which Cannot Begin A Line + NoLineBreaksBefore *CT_Kinsoku + // Generate Thumbnail For Document On Save + SavePreviewPicture *CT_OnOff + // Do Not Validate Custom XML Markup Against Schemas + DoNotValidateAgainstSchema *CT_OnOff + // Allow Saving Document As XML File When Custom XML Markup Is Invalid + SaveInvalidXml *CT_OnOff + // Ignore Mixed Content When Validating Custom XML Markup + IgnoreMixedContent *CT_OnOff + // Use Custom XML Element Names as Default Placeholder Text + AlwaysShowPlaceholderText *CT_OnOff + // Do Not Show Visual Indicator For Invalid Custom XML Markup + DoNotDemarcateInvalidXml *CT_OnOff + // Only Save Custom XML Markup + SaveXmlDataOnly *CT_OnOff + // Save Document as XML File through Custom XSL Transform + UseXSLTWhenSaving *CT_OnOff + // Custom XSL Transform To Use When Saving As XML File + SaveThroughXslt *CT_SaveThroughXslt + // Show Visual Indicators for Custom XML Markup Start/End Locations + ShowXMLTags *CT_OnOff + // Do Not Mark Custom XML Elements With No Namespace As Invalid + AlwaysMergeEmptyNamespace *CT_OnOff + // Automatically Recalculate Fields on Open + UpdateFields *CT_OnOff + // Default Properties for VML Objects in Header and Footer + HdrShapeDefaults *CT_ShapeDefaults + // Document-Wide Footnote Properties + FootnotePr *CT_FtnDocProps + // Document-Wide Endnote Properties + EndnotePr *CT_EdnDocProps + // Compatibility Settings + Compat *CT_Compat + // Document Variables + DocVars *CT_DocVars + // Listing of All Revision Save ID Values + Rsids *CT_DocRsids + MathPr *math.MathPr + // Attached Custom XML Schema + AttachedSchema []*CT_String + // Theme Font Languages + ThemeFontLang *CT_Language + // Theme Color Mappings + ClrSchemeMapping *CT_ColorSchemeMapping + // Do Not Include Content in Text Boxes, Footnotes, and Endnotes in Document Statistics + DoNotIncludeSubdocsInStats *CT_OnOff + // Do Not Automatically Compress Images + DoNotAutoCompressPictures *CT_OnOff + // Upgrade Document on Open + ForceUpgrade *CT_Empty + // Caption Settings + Captions *CT_Captions + // Freeze Document Layout + ReadModeInkLockDown *CT_ReadingModeInkLockDown + // Supplementary Smart Tag Information + SmartTagType []*CT_SmartTagType + SchemaLibrary *schemaLibrary.SchemaLibrary + // Default Properties for VML Objects in Main Document + ShapeDefaults *CT_ShapeDefaults + // Remove Smart Tags When Saving + DoNotEmbedSmartTags *CT_OnOff + // Radix Point for Field Code Evaluation + DecimalSymbol *CT_String + // List Separator for Field Code Evaluation + ListSeparator *CT_String + Extra []gooxml.Any +} + +func NewCT_Settings() *CT_Settings { + ret := &CT_Settings{} + return ret +} + +func (m *CT_Settings) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.WriteProtection != nil { + sewriteProtection := xml.StartElement{Name: xml.Name{Local: "w:writeProtection"}} + e.EncodeElement(m.WriteProtection, sewriteProtection) + } + if m.View != nil { + seview := xml.StartElement{Name: xml.Name{Local: "w:view"}} + e.EncodeElement(m.View, seview) + } + if m.Zoom != nil { + sezoom := xml.StartElement{Name: xml.Name{Local: "w:zoom"}} + e.EncodeElement(m.Zoom, sezoom) + } + if m.RemovePersonalInformation != nil { + seremovePersonalInformation := xml.StartElement{Name: xml.Name{Local: "w:removePersonalInformation"}} + e.EncodeElement(m.RemovePersonalInformation, seremovePersonalInformation) + } + if m.RemoveDateAndTime != nil { + seremoveDateAndTime := xml.StartElement{Name: xml.Name{Local: "w:removeDateAndTime"}} + e.EncodeElement(m.RemoveDateAndTime, seremoveDateAndTime) + } + if m.DoNotDisplayPageBoundaries != nil { + sedoNotDisplayPageBoundaries := xml.StartElement{Name: xml.Name{Local: "w:doNotDisplayPageBoundaries"}} + e.EncodeElement(m.DoNotDisplayPageBoundaries, sedoNotDisplayPageBoundaries) + } + if m.DisplayBackgroundShape != nil { + sedisplayBackgroundShape := xml.StartElement{Name: xml.Name{Local: "w:displayBackgroundShape"}} + e.EncodeElement(m.DisplayBackgroundShape, sedisplayBackgroundShape) + } + if m.PrintPostScriptOverText != nil { + seprintPostScriptOverText := xml.StartElement{Name: xml.Name{Local: "w:printPostScriptOverText"}} + e.EncodeElement(m.PrintPostScriptOverText, seprintPostScriptOverText) + } + if m.PrintFractionalCharacterWidth != nil { + seprintFractionalCharacterWidth := xml.StartElement{Name: xml.Name{Local: "w:printFractionalCharacterWidth"}} + e.EncodeElement(m.PrintFractionalCharacterWidth, seprintFractionalCharacterWidth) + } + if m.PrintFormsData != nil { + seprintFormsData := xml.StartElement{Name: xml.Name{Local: "w:printFormsData"}} + e.EncodeElement(m.PrintFormsData, seprintFormsData) + } + if m.EmbedTrueTypeFonts != nil { + seembedTrueTypeFonts := xml.StartElement{Name: xml.Name{Local: "w:embedTrueTypeFonts"}} + e.EncodeElement(m.EmbedTrueTypeFonts, seembedTrueTypeFonts) + } + if m.EmbedSystemFonts != nil { + seembedSystemFonts := xml.StartElement{Name: xml.Name{Local: "w:embedSystemFonts"}} + e.EncodeElement(m.EmbedSystemFonts, seembedSystemFonts) + } + if m.SaveSubsetFonts != nil { + sesaveSubsetFonts := xml.StartElement{Name: xml.Name{Local: "w:saveSubsetFonts"}} + e.EncodeElement(m.SaveSubsetFonts, sesaveSubsetFonts) + } + if m.SaveFormsData != nil { + sesaveFormsData := xml.StartElement{Name: xml.Name{Local: "w:saveFormsData"}} + e.EncodeElement(m.SaveFormsData, sesaveFormsData) + } + if m.MirrorMargins != nil { + semirrorMargins := xml.StartElement{Name: xml.Name{Local: "w:mirrorMargins"}} + e.EncodeElement(m.MirrorMargins, semirrorMargins) + } + if m.AlignBordersAndEdges != nil { + sealignBordersAndEdges := xml.StartElement{Name: xml.Name{Local: "w:alignBordersAndEdges"}} + e.EncodeElement(m.AlignBordersAndEdges, sealignBordersAndEdges) + } + if m.BordersDoNotSurroundHeader != nil { + sebordersDoNotSurroundHeader := xml.StartElement{Name: xml.Name{Local: "w:bordersDoNotSurroundHeader"}} + e.EncodeElement(m.BordersDoNotSurroundHeader, sebordersDoNotSurroundHeader) + } + if m.BordersDoNotSurroundFooter != nil { + sebordersDoNotSurroundFooter := xml.StartElement{Name: xml.Name{Local: "w:bordersDoNotSurroundFooter"}} + e.EncodeElement(m.BordersDoNotSurroundFooter, sebordersDoNotSurroundFooter) + } + if m.GutterAtTop != nil { + segutterAtTop := xml.StartElement{Name: xml.Name{Local: "w:gutterAtTop"}} + e.EncodeElement(m.GutterAtTop, segutterAtTop) + } + if m.HideSpellingErrors != nil { + sehideSpellingErrors := xml.StartElement{Name: xml.Name{Local: "w:hideSpellingErrors"}} + e.EncodeElement(m.HideSpellingErrors, sehideSpellingErrors) + } + if m.HideGrammaticalErrors != nil { + sehideGrammaticalErrors := xml.StartElement{Name: xml.Name{Local: "w:hideGrammaticalErrors"}} + e.EncodeElement(m.HideGrammaticalErrors, sehideGrammaticalErrors) + } + if m.ActiveWritingStyle != nil { + seactiveWritingStyle := xml.StartElement{Name: xml.Name{Local: "w:activeWritingStyle"}} + for _, c := range m.ActiveWritingStyle { + e.EncodeElement(c, seactiveWritingStyle) + } + } + if m.ProofState != nil { + seproofState := xml.StartElement{Name: xml.Name{Local: "w:proofState"}} + e.EncodeElement(m.ProofState, seproofState) + } + if m.FormsDesign != nil { + seformsDesign := xml.StartElement{Name: xml.Name{Local: "w:formsDesign"}} + e.EncodeElement(m.FormsDesign, seformsDesign) + } + if m.AttachedTemplate != nil { + seattachedTemplate := xml.StartElement{Name: xml.Name{Local: "w:attachedTemplate"}} + e.EncodeElement(m.AttachedTemplate, seattachedTemplate) + } + if m.LinkStyles != nil { + selinkStyles := xml.StartElement{Name: xml.Name{Local: "w:linkStyles"}} + e.EncodeElement(m.LinkStyles, selinkStyles) + } + if m.StylePaneFormatFilter != nil { + sestylePaneFormatFilter := xml.StartElement{Name: xml.Name{Local: "w:stylePaneFormatFilter"}} + e.EncodeElement(m.StylePaneFormatFilter, sestylePaneFormatFilter) + } + if m.StylePaneSortMethod != nil { + sestylePaneSortMethod := xml.StartElement{Name: xml.Name{Local: "w:stylePaneSortMethod"}} + e.EncodeElement(m.StylePaneSortMethod, sestylePaneSortMethod) + } + if m.DocumentType != nil { + sedocumentType := xml.StartElement{Name: xml.Name{Local: "w:documentType"}} + e.EncodeElement(m.DocumentType, sedocumentType) + } + if m.MailMerge != nil { + semailMerge := xml.StartElement{Name: xml.Name{Local: "w:mailMerge"}} + e.EncodeElement(m.MailMerge, semailMerge) + } + if m.RevisionView != nil { + serevisionView := xml.StartElement{Name: xml.Name{Local: "w:revisionView"}} + e.EncodeElement(m.RevisionView, serevisionView) + } + if m.TrackRevisions != nil { + setrackRevisions := xml.StartElement{Name: xml.Name{Local: "w:trackRevisions"}} + e.EncodeElement(m.TrackRevisions, setrackRevisions) + } + if m.DoNotTrackMoves != nil { + sedoNotTrackMoves := xml.StartElement{Name: xml.Name{Local: "w:doNotTrackMoves"}} + e.EncodeElement(m.DoNotTrackMoves, sedoNotTrackMoves) + } + if m.DoNotTrackFormatting != nil { + sedoNotTrackFormatting := xml.StartElement{Name: xml.Name{Local: "w:doNotTrackFormatting"}} + e.EncodeElement(m.DoNotTrackFormatting, sedoNotTrackFormatting) + } + if m.DocumentProtection != nil { + sedocumentProtection := xml.StartElement{Name: xml.Name{Local: "w:documentProtection"}} + e.EncodeElement(m.DocumentProtection, sedocumentProtection) + } + if m.AutoFormatOverride != nil { + seautoFormatOverride := xml.StartElement{Name: xml.Name{Local: "w:autoFormatOverride"}} + e.EncodeElement(m.AutoFormatOverride, seautoFormatOverride) + } + if m.StyleLockTheme != nil { + sestyleLockTheme := xml.StartElement{Name: xml.Name{Local: "w:styleLockTheme"}} + e.EncodeElement(m.StyleLockTheme, sestyleLockTheme) + } + if m.StyleLockQFSet != nil { + sestyleLockQFSet := xml.StartElement{Name: xml.Name{Local: "w:styleLockQFSet"}} + e.EncodeElement(m.StyleLockQFSet, sestyleLockQFSet) + } + if m.DefaultTabStop != nil { + sedefaultTabStop := xml.StartElement{Name: xml.Name{Local: "w:defaultTabStop"}} + e.EncodeElement(m.DefaultTabStop, sedefaultTabStop) + } + if m.AutoHyphenation != nil { + seautoHyphenation := xml.StartElement{Name: xml.Name{Local: "w:autoHyphenation"}} + e.EncodeElement(m.AutoHyphenation, seautoHyphenation) + } + if m.ConsecutiveHyphenLimit != nil { + seconsecutiveHyphenLimit := xml.StartElement{Name: xml.Name{Local: "w:consecutiveHyphenLimit"}} + e.EncodeElement(m.ConsecutiveHyphenLimit, seconsecutiveHyphenLimit) + } + if m.HyphenationZone != nil { + sehyphenationZone := xml.StartElement{Name: xml.Name{Local: "w:hyphenationZone"}} + e.EncodeElement(m.HyphenationZone, sehyphenationZone) + } + if m.DoNotHyphenateCaps != nil { + sedoNotHyphenateCaps := xml.StartElement{Name: xml.Name{Local: "w:doNotHyphenateCaps"}} + e.EncodeElement(m.DoNotHyphenateCaps, sedoNotHyphenateCaps) + } + if m.ShowEnvelope != nil { + seshowEnvelope := xml.StartElement{Name: xml.Name{Local: "w:showEnvelope"}} + e.EncodeElement(m.ShowEnvelope, seshowEnvelope) + } + if m.SummaryLength != nil { + sesummaryLength := xml.StartElement{Name: xml.Name{Local: "w:summaryLength"}} + e.EncodeElement(m.SummaryLength, sesummaryLength) + } + if m.ClickAndTypeStyle != nil { + seclickAndTypeStyle := xml.StartElement{Name: xml.Name{Local: "w:clickAndTypeStyle"}} + e.EncodeElement(m.ClickAndTypeStyle, seclickAndTypeStyle) + } + if m.DefaultTableStyle != nil { + sedefaultTableStyle := xml.StartElement{Name: xml.Name{Local: "w:defaultTableStyle"}} + e.EncodeElement(m.DefaultTableStyle, sedefaultTableStyle) + } + if m.EvenAndOddHeaders != nil { + seevenAndOddHeaders := xml.StartElement{Name: xml.Name{Local: "w:evenAndOddHeaders"}} + e.EncodeElement(m.EvenAndOddHeaders, seevenAndOddHeaders) + } + if m.BookFoldRevPrinting != nil { + sebookFoldRevPrinting := xml.StartElement{Name: xml.Name{Local: "w:bookFoldRevPrinting"}} + e.EncodeElement(m.BookFoldRevPrinting, sebookFoldRevPrinting) + } + if m.BookFoldPrinting != nil { + sebookFoldPrinting := xml.StartElement{Name: xml.Name{Local: "w:bookFoldPrinting"}} + e.EncodeElement(m.BookFoldPrinting, sebookFoldPrinting) + } + if m.BookFoldPrintingSheets != nil { + sebookFoldPrintingSheets := xml.StartElement{Name: xml.Name{Local: "w:bookFoldPrintingSheets"}} + e.EncodeElement(m.BookFoldPrintingSheets, sebookFoldPrintingSheets) + } + if m.DrawingGridHorizontalSpacing != nil { + sedrawingGridHorizontalSpacing := xml.StartElement{Name: xml.Name{Local: "w:drawingGridHorizontalSpacing"}} + e.EncodeElement(m.DrawingGridHorizontalSpacing, sedrawingGridHorizontalSpacing) + } + if m.DrawingGridVerticalSpacing != nil { + sedrawingGridVerticalSpacing := xml.StartElement{Name: xml.Name{Local: "w:drawingGridVerticalSpacing"}} + e.EncodeElement(m.DrawingGridVerticalSpacing, sedrawingGridVerticalSpacing) + } + if m.DisplayHorizontalDrawingGridEvery != nil { + sedisplayHorizontalDrawingGridEvery := xml.StartElement{Name: xml.Name{Local: "w:displayHorizontalDrawingGridEvery"}} + e.EncodeElement(m.DisplayHorizontalDrawingGridEvery, sedisplayHorizontalDrawingGridEvery) + } + if m.DisplayVerticalDrawingGridEvery != nil { + sedisplayVerticalDrawingGridEvery := xml.StartElement{Name: xml.Name{Local: "w:displayVerticalDrawingGridEvery"}} + e.EncodeElement(m.DisplayVerticalDrawingGridEvery, sedisplayVerticalDrawingGridEvery) + } + if m.DoNotUseMarginsForDrawingGridOrigin != nil { + sedoNotUseMarginsForDrawingGridOrigin := xml.StartElement{Name: xml.Name{Local: "w:doNotUseMarginsForDrawingGridOrigin"}} + e.EncodeElement(m.DoNotUseMarginsForDrawingGridOrigin, sedoNotUseMarginsForDrawingGridOrigin) + } + if m.DrawingGridHorizontalOrigin != nil { + sedrawingGridHorizontalOrigin := xml.StartElement{Name: xml.Name{Local: "w:drawingGridHorizontalOrigin"}} + e.EncodeElement(m.DrawingGridHorizontalOrigin, sedrawingGridHorizontalOrigin) + } + if m.DrawingGridVerticalOrigin != nil { + sedrawingGridVerticalOrigin := xml.StartElement{Name: xml.Name{Local: "w:drawingGridVerticalOrigin"}} + e.EncodeElement(m.DrawingGridVerticalOrigin, sedrawingGridVerticalOrigin) + } + if m.DoNotShadeFormData != nil { + sedoNotShadeFormData := xml.StartElement{Name: xml.Name{Local: "w:doNotShadeFormData"}} + e.EncodeElement(m.DoNotShadeFormData, sedoNotShadeFormData) + } + if m.NoPunctuationKerning != nil { + senoPunctuationKerning := xml.StartElement{Name: xml.Name{Local: "w:noPunctuationKerning"}} + e.EncodeElement(m.NoPunctuationKerning, senoPunctuationKerning) + } + if m.CharacterSpacingControl != nil { + secharacterSpacingControl := xml.StartElement{Name: xml.Name{Local: "w:characterSpacingControl"}} + e.EncodeElement(m.CharacterSpacingControl, secharacterSpacingControl) + } + if m.PrintTwoOnOne != nil { + seprintTwoOnOne := xml.StartElement{Name: xml.Name{Local: "w:printTwoOnOne"}} + e.EncodeElement(m.PrintTwoOnOne, seprintTwoOnOne) + } + if m.StrictFirstAndLastChars != nil { + sestrictFirstAndLastChars := xml.StartElement{Name: xml.Name{Local: "w:strictFirstAndLastChars"}} + e.EncodeElement(m.StrictFirstAndLastChars, sestrictFirstAndLastChars) + } + if m.NoLineBreaksAfter != nil { + senoLineBreaksAfter := xml.StartElement{Name: xml.Name{Local: "w:noLineBreaksAfter"}} + e.EncodeElement(m.NoLineBreaksAfter, senoLineBreaksAfter) + } + if m.NoLineBreaksBefore != nil { + senoLineBreaksBefore := xml.StartElement{Name: xml.Name{Local: "w:noLineBreaksBefore"}} + e.EncodeElement(m.NoLineBreaksBefore, senoLineBreaksBefore) + } + if m.SavePreviewPicture != nil { + sesavePreviewPicture := xml.StartElement{Name: xml.Name{Local: "w:savePreviewPicture"}} + e.EncodeElement(m.SavePreviewPicture, sesavePreviewPicture) + } + if m.DoNotValidateAgainstSchema != nil { + sedoNotValidateAgainstSchema := xml.StartElement{Name: xml.Name{Local: "w:doNotValidateAgainstSchema"}} + e.EncodeElement(m.DoNotValidateAgainstSchema, sedoNotValidateAgainstSchema) + } + if m.SaveInvalidXml != nil { + sesaveInvalidXml := xml.StartElement{Name: xml.Name{Local: "w:saveInvalidXml"}} + e.EncodeElement(m.SaveInvalidXml, sesaveInvalidXml) + } + if m.IgnoreMixedContent != nil { + seignoreMixedContent := xml.StartElement{Name: xml.Name{Local: "w:ignoreMixedContent"}} + e.EncodeElement(m.IgnoreMixedContent, seignoreMixedContent) + } + if m.AlwaysShowPlaceholderText != nil { + sealwaysShowPlaceholderText := xml.StartElement{Name: xml.Name{Local: "w:alwaysShowPlaceholderText"}} + e.EncodeElement(m.AlwaysShowPlaceholderText, sealwaysShowPlaceholderText) + } + if m.DoNotDemarcateInvalidXml != nil { + sedoNotDemarcateInvalidXml := xml.StartElement{Name: xml.Name{Local: "w:doNotDemarcateInvalidXml"}} + e.EncodeElement(m.DoNotDemarcateInvalidXml, sedoNotDemarcateInvalidXml) + } + if m.SaveXmlDataOnly != nil { + sesaveXmlDataOnly := xml.StartElement{Name: xml.Name{Local: "w:saveXmlDataOnly"}} + e.EncodeElement(m.SaveXmlDataOnly, sesaveXmlDataOnly) + } + if m.UseXSLTWhenSaving != nil { + seuseXSLTWhenSaving := xml.StartElement{Name: xml.Name{Local: "w:useXSLTWhenSaving"}} + e.EncodeElement(m.UseXSLTWhenSaving, seuseXSLTWhenSaving) + } + if m.SaveThroughXslt != nil { + sesaveThroughXslt := xml.StartElement{Name: xml.Name{Local: "w:saveThroughXslt"}} + e.EncodeElement(m.SaveThroughXslt, sesaveThroughXslt) + } + if m.ShowXMLTags != nil { + seshowXMLTags := xml.StartElement{Name: xml.Name{Local: "w:showXMLTags"}} + e.EncodeElement(m.ShowXMLTags, seshowXMLTags) + } + if m.AlwaysMergeEmptyNamespace != nil { + sealwaysMergeEmptyNamespace := xml.StartElement{Name: xml.Name{Local: "w:alwaysMergeEmptyNamespace"}} + e.EncodeElement(m.AlwaysMergeEmptyNamespace, sealwaysMergeEmptyNamespace) + } + if m.UpdateFields != nil { + seupdateFields := xml.StartElement{Name: xml.Name{Local: "w:updateFields"}} + e.EncodeElement(m.UpdateFields, seupdateFields) + } + if m.HdrShapeDefaults != nil { + sehdrShapeDefaults := xml.StartElement{Name: xml.Name{Local: "w:hdrShapeDefaults"}} + e.EncodeElement(m.HdrShapeDefaults, sehdrShapeDefaults) + } + if m.FootnotePr != nil { + sefootnotePr := xml.StartElement{Name: xml.Name{Local: "w:footnotePr"}} + e.EncodeElement(m.FootnotePr, sefootnotePr) + } + if m.EndnotePr != nil { + seendnotePr := xml.StartElement{Name: xml.Name{Local: "w:endnotePr"}} + e.EncodeElement(m.EndnotePr, seendnotePr) + } + if m.Compat != nil { + secompat := xml.StartElement{Name: xml.Name{Local: "w:compat"}} + e.EncodeElement(m.Compat, secompat) + } + if m.DocVars != nil { + sedocVars := xml.StartElement{Name: xml.Name{Local: "w:docVars"}} + e.EncodeElement(m.DocVars, sedocVars) + } + if m.Rsids != nil { + sersids := xml.StartElement{Name: xml.Name{Local: "w:rsids"}} + e.EncodeElement(m.Rsids, sersids) + } + if m.MathPr != nil { + semathPr := xml.StartElement{Name: xml.Name{Local: "m:mathPr"}} + e.EncodeElement(m.MathPr, semathPr) + } + if m.AttachedSchema != nil { + seattachedSchema := xml.StartElement{Name: xml.Name{Local: "w:attachedSchema"}} + for _, c := range m.AttachedSchema { + e.EncodeElement(c, seattachedSchema) + } + } + if m.ThemeFontLang != nil { + sethemeFontLang := xml.StartElement{Name: xml.Name{Local: "w:themeFontLang"}} + e.EncodeElement(m.ThemeFontLang, sethemeFontLang) + } + if m.ClrSchemeMapping != nil { + seclrSchemeMapping := xml.StartElement{Name: xml.Name{Local: "w:clrSchemeMapping"}} + e.EncodeElement(m.ClrSchemeMapping, seclrSchemeMapping) + } + if m.DoNotIncludeSubdocsInStats != nil { + sedoNotIncludeSubdocsInStats := xml.StartElement{Name: xml.Name{Local: "w:doNotIncludeSubdocsInStats"}} + e.EncodeElement(m.DoNotIncludeSubdocsInStats, sedoNotIncludeSubdocsInStats) + } + if m.DoNotAutoCompressPictures != nil { + sedoNotAutoCompressPictures := xml.StartElement{Name: xml.Name{Local: "w:doNotAutoCompressPictures"}} + e.EncodeElement(m.DoNotAutoCompressPictures, sedoNotAutoCompressPictures) + } + if m.ForceUpgrade != nil { + seforceUpgrade := xml.StartElement{Name: xml.Name{Local: "w:forceUpgrade"}} + e.EncodeElement(m.ForceUpgrade, seforceUpgrade) + } + if m.Captions != nil { + secaptions := xml.StartElement{Name: xml.Name{Local: "w:captions"}} + e.EncodeElement(m.Captions, secaptions) + } + if m.ReadModeInkLockDown != nil { + sereadModeInkLockDown := xml.StartElement{Name: xml.Name{Local: "w:readModeInkLockDown"}} + e.EncodeElement(m.ReadModeInkLockDown, sereadModeInkLockDown) + } + if m.SmartTagType != nil { + sesmartTagType := xml.StartElement{Name: xml.Name{Local: "w:smartTagType"}} + for _, c := range m.SmartTagType { + e.EncodeElement(c, sesmartTagType) + } + } + if m.SchemaLibrary != nil { + seschemaLibrary := xml.StartElement{Name: xml.Name{Local: "ma:schemaLibrary"}} + e.EncodeElement(m.SchemaLibrary, seschemaLibrary) + } + if m.ShapeDefaults != nil { + seshapeDefaults := xml.StartElement{Name: xml.Name{Local: "w:shapeDefaults"}} + e.EncodeElement(m.ShapeDefaults, seshapeDefaults) + } + if m.DoNotEmbedSmartTags != nil { + sedoNotEmbedSmartTags := xml.StartElement{Name: xml.Name{Local: "w:doNotEmbedSmartTags"}} + e.EncodeElement(m.DoNotEmbedSmartTags, sedoNotEmbedSmartTags) + } + if m.DecimalSymbol != nil { + sedecimalSymbol := xml.StartElement{Name: xml.Name{Local: "w:decimalSymbol"}} + e.EncodeElement(m.DecimalSymbol, sedecimalSymbol) + } + if m.ListSeparator != nil { + selistSeparator := xml.StartElement{Name: xml.Name{Local: "w:listSeparator"}} + e.EncodeElement(m.ListSeparator, selistSeparator) + } + for _, any := range m.Extra { + if err := any.MarshalXML(e, xml.StartElement{}); err != nil { + return err + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Settings) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_Settings: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "writeProtection"}: + m.WriteProtection = NewCT_WriteProtection() + if err := d.DecodeElement(m.WriteProtection, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "view"}: + m.View = NewCT_View() + if err := d.DecodeElement(m.View, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "zoom"}: + m.Zoom = NewCT_Zoom() + if err := d.DecodeElement(m.Zoom, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "removePersonalInformation"}: + m.RemovePersonalInformation = NewCT_OnOff() + if err := d.DecodeElement(m.RemovePersonalInformation, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "removeDateAndTime"}: + m.RemoveDateAndTime = NewCT_OnOff() + if err := d.DecodeElement(m.RemoveDateAndTime, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotDisplayPageBoundaries"}: + m.DoNotDisplayPageBoundaries = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotDisplayPageBoundaries, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "displayBackgroundShape"}: + m.DisplayBackgroundShape = NewCT_OnOff() + if err := d.DecodeElement(m.DisplayBackgroundShape, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "printPostScriptOverText"}: + m.PrintPostScriptOverText = NewCT_OnOff() + if err := d.DecodeElement(m.PrintPostScriptOverText, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "printFractionalCharacterWidth"}: + m.PrintFractionalCharacterWidth = NewCT_OnOff() + if err := d.DecodeElement(m.PrintFractionalCharacterWidth, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "printFormsData"}: + m.PrintFormsData = NewCT_OnOff() + if err := d.DecodeElement(m.PrintFormsData, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "embedTrueTypeFonts"}: + m.EmbedTrueTypeFonts = NewCT_OnOff() + if err := d.DecodeElement(m.EmbedTrueTypeFonts, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "embedSystemFonts"}: + m.EmbedSystemFonts = NewCT_OnOff() + if err := d.DecodeElement(m.EmbedSystemFonts, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "saveSubsetFonts"}: + m.SaveSubsetFonts = NewCT_OnOff() + if err := d.DecodeElement(m.SaveSubsetFonts, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "saveFormsData"}: + m.SaveFormsData = NewCT_OnOff() + if err := d.DecodeElement(m.SaveFormsData, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "mirrorMargins"}: + m.MirrorMargins = NewCT_OnOff() + if err := d.DecodeElement(m.MirrorMargins, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "alignBordersAndEdges"}: + m.AlignBordersAndEdges = NewCT_OnOff() + if err := d.DecodeElement(m.AlignBordersAndEdges, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bordersDoNotSurroundHeader"}: + m.BordersDoNotSurroundHeader = NewCT_OnOff() + if err := d.DecodeElement(m.BordersDoNotSurroundHeader, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bordersDoNotSurroundFooter"}: + m.BordersDoNotSurroundFooter = NewCT_OnOff() + if err := d.DecodeElement(m.BordersDoNotSurroundFooter, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "gutterAtTop"}: + m.GutterAtTop = NewCT_OnOff() + if err := d.DecodeElement(m.GutterAtTop, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "hideSpellingErrors"}: + m.HideSpellingErrors = NewCT_OnOff() + if err := d.DecodeElement(m.HideSpellingErrors, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "hideGrammaticalErrors"}: + m.HideGrammaticalErrors = NewCT_OnOff() + if err := d.DecodeElement(m.HideGrammaticalErrors, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "activeWritingStyle"}: + tmp := NewCT_WritingStyle() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.ActiveWritingStyle = append(m.ActiveWritingStyle, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "proofState"}: + m.ProofState = NewCT_Proof() + if err := d.DecodeElement(m.ProofState, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "formsDesign"}: + m.FormsDesign = NewCT_OnOff() + if err := d.DecodeElement(m.FormsDesign, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "attachedTemplate"}: + m.AttachedTemplate = NewCT_Rel() + if err := d.DecodeElement(m.AttachedTemplate, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "linkStyles"}: + m.LinkStyles = NewCT_OnOff() + if err := d.DecodeElement(m.LinkStyles, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "stylePaneFormatFilter"}: + m.StylePaneFormatFilter = NewCT_StylePaneFilter() + if err := d.DecodeElement(m.StylePaneFormatFilter, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "stylePaneSortMethod"}: + m.StylePaneSortMethod = NewCT_StyleSort() + if err := d.DecodeElement(m.StylePaneSortMethod, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "documentType"}: + m.DocumentType = NewCT_DocType() + if err := d.DecodeElement(m.DocumentType, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "mailMerge"}: + m.MailMerge = NewCT_MailMerge() + if err := d.DecodeElement(m.MailMerge, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "revisionView"}: + m.RevisionView = NewCT_TrackChangesView() + if err := d.DecodeElement(m.RevisionView, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "trackRevisions"}: + m.TrackRevisions = NewCT_OnOff() + if err := d.DecodeElement(m.TrackRevisions, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotTrackMoves"}: + m.DoNotTrackMoves = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotTrackMoves, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotTrackFormatting"}: + m.DoNotTrackFormatting = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotTrackFormatting, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "documentProtection"}: + m.DocumentProtection = NewCT_DocProtect() + if err := d.DecodeElement(m.DocumentProtection, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "autoFormatOverride"}: + m.AutoFormatOverride = NewCT_OnOff() + if err := d.DecodeElement(m.AutoFormatOverride, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "styleLockTheme"}: + m.StyleLockTheme = NewCT_OnOff() + if err := d.DecodeElement(m.StyleLockTheme, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "styleLockQFSet"}: + m.StyleLockQFSet = NewCT_OnOff() + if err := d.DecodeElement(m.StyleLockQFSet, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "defaultTabStop"}: + m.DefaultTabStop = NewCT_TwipsMeasure() + if err := d.DecodeElement(m.DefaultTabStop, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "autoHyphenation"}: + m.AutoHyphenation = NewCT_OnOff() + if err := d.DecodeElement(m.AutoHyphenation, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "consecutiveHyphenLimit"}: + m.ConsecutiveHyphenLimit = NewCT_DecimalNumber() + if err := d.DecodeElement(m.ConsecutiveHyphenLimit, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "hyphenationZone"}: + m.HyphenationZone = NewCT_TwipsMeasure() + if err := d.DecodeElement(m.HyphenationZone, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotHyphenateCaps"}: + m.DoNotHyphenateCaps = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotHyphenateCaps, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "showEnvelope"}: + m.ShowEnvelope = NewCT_OnOff() + if err := d.DecodeElement(m.ShowEnvelope, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "summaryLength"}: + m.SummaryLength = NewCT_DecimalNumberOrPrecent() + if err := d.DecodeElement(m.SummaryLength, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "clickAndTypeStyle"}: + m.ClickAndTypeStyle = NewCT_String() + if err := d.DecodeElement(m.ClickAndTypeStyle, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "defaultTableStyle"}: + m.DefaultTableStyle = NewCT_String() + if err := d.DecodeElement(m.DefaultTableStyle, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "evenAndOddHeaders"}: + m.EvenAndOddHeaders = NewCT_OnOff() + if err := d.DecodeElement(m.EvenAndOddHeaders, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookFoldRevPrinting"}: + m.BookFoldRevPrinting = NewCT_OnOff() + if err := d.DecodeElement(m.BookFoldRevPrinting, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookFoldPrinting"}: + m.BookFoldPrinting = NewCT_OnOff() + if err := d.DecodeElement(m.BookFoldPrinting, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookFoldPrintingSheets"}: + m.BookFoldPrintingSheets = NewCT_DecimalNumber() + if err := d.DecodeElement(m.BookFoldPrintingSheets, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "drawingGridHorizontalSpacing"}: + m.DrawingGridHorizontalSpacing = NewCT_TwipsMeasure() + if err := d.DecodeElement(m.DrawingGridHorizontalSpacing, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "drawingGridVerticalSpacing"}: + m.DrawingGridVerticalSpacing = NewCT_TwipsMeasure() + if err := d.DecodeElement(m.DrawingGridVerticalSpacing, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "displayHorizontalDrawingGridEvery"}: + m.DisplayHorizontalDrawingGridEvery = NewCT_DecimalNumber() + if err := d.DecodeElement(m.DisplayHorizontalDrawingGridEvery, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "displayVerticalDrawingGridEvery"}: + m.DisplayVerticalDrawingGridEvery = NewCT_DecimalNumber() + if err := d.DecodeElement(m.DisplayVerticalDrawingGridEvery, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotUseMarginsForDrawingGridOrigin"}: + m.DoNotUseMarginsForDrawingGridOrigin = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotUseMarginsForDrawingGridOrigin, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "drawingGridHorizontalOrigin"}: + m.DrawingGridHorizontalOrigin = NewCT_TwipsMeasure() + if err := d.DecodeElement(m.DrawingGridHorizontalOrigin, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "drawingGridVerticalOrigin"}: + m.DrawingGridVerticalOrigin = NewCT_TwipsMeasure() + if err := d.DecodeElement(m.DrawingGridVerticalOrigin, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotShadeFormData"}: + m.DoNotShadeFormData = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotShadeFormData, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "noPunctuationKerning"}: + m.NoPunctuationKerning = NewCT_OnOff() + if err := d.DecodeElement(m.NoPunctuationKerning, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "characterSpacingControl"}: + m.CharacterSpacingControl = NewCT_CharacterSpacing() + if err := d.DecodeElement(m.CharacterSpacingControl, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "printTwoOnOne"}: + m.PrintTwoOnOne = NewCT_OnOff() + if err := d.DecodeElement(m.PrintTwoOnOne, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "strictFirstAndLastChars"}: + m.StrictFirstAndLastChars = NewCT_OnOff() + if err := d.DecodeElement(m.StrictFirstAndLastChars, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "noLineBreaksAfter"}: + m.NoLineBreaksAfter = NewCT_Kinsoku() + if err := d.DecodeElement(m.NoLineBreaksAfter, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "noLineBreaksBefore"}: + m.NoLineBreaksBefore = NewCT_Kinsoku() + if err := d.DecodeElement(m.NoLineBreaksBefore, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "savePreviewPicture"}: + m.SavePreviewPicture = NewCT_OnOff() + if err := d.DecodeElement(m.SavePreviewPicture, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotValidateAgainstSchema"}: + m.DoNotValidateAgainstSchema = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotValidateAgainstSchema, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "saveInvalidXml"}: + m.SaveInvalidXml = NewCT_OnOff() + if err := d.DecodeElement(m.SaveInvalidXml, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ignoreMixedContent"}: + m.IgnoreMixedContent = NewCT_OnOff() + if err := d.DecodeElement(m.IgnoreMixedContent, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "alwaysShowPlaceholderText"}: + m.AlwaysShowPlaceholderText = NewCT_OnOff() + if err := d.DecodeElement(m.AlwaysShowPlaceholderText, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotDemarcateInvalidXml"}: + m.DoNotDemarcateInvalidXml = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotDemarcateInvalidXml, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "saveXmlDataOnly"}: + m.SaveXmlDataOnly = NewCT_OnOff() + if err := d.DecodeElement(m.SaveXmlDataOnly, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "useXSLTWhenSaving"}: + m.UseXSLTWhenSaving = NewCT_OnOff() + if err := d.DecodeElement(m.UseXSLTWhenSaving, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "saveThroughXslt"}: + m.SaveThroughXslt = NewCT_SaveThroughXslt() + if err := d.DecodeElement(m.SaveThroughXslt, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "showXMLTags"}: + m.ShowXMLTags = NewCT_OnOff() + if err := d.DecodeElement(m.ShowXMLTags, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "alwaysMergeEmptyNamespace"}: + m.AlwaysMergeEmptyNamespace = NewCT_OnOff() + if err := d.DecodeElement(m.AlwaysMergeEmptyNamespace, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "updateFields"}: + m.UpdateFields = NewCT_OnOff() + if err := d.DecodeElement(m.UpdateFields, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "hdrShapeDefaults"}: + m.HdrShapeDefaults = NewCT_ShapeDefaults() + if err := d.DecodeElement(m.HdrShapeDefaults, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "footnotePr"}: + m.FootnotePr = NewCT_FtnDocProps() + if err := d.DecodeElement(m.FootnotePr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "endnotePr"}: + m.EndnotePr = NewCT_EdnDocProps() + if err := d.DecodeElement(m.EndnotePr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "compat"}: + m.Compat = NewCT_Compat() + if err := d.DecodeElement(m.Compat, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "docVars"}: + m.DocVars = NewCT_DocVars() + if err := d.DecodeElement(m.DocVars, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rsids"}: + m.Rsids = NewCT_DocRsids() + if err := d.DecodeElement(m.Rsids, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "mathPr"}: + m.MathPr = math.NewMathPr() + if err := d.DecodeElement(m.MathPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "attachedSchema"}: + tmp := NewCT_String() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.AttachedSchema = append(m.AttachedSchema, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "themeFontLang"}: + m.ThemeFontLang = NewCT_Language() + if err := d.DecodeElement(m.ThemeFontLang, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "clrSchemeMapping"}: + m.ClrSchemeMapping = NewCT_ColorSchemeMapping() + if err := d.DecodeElement(m.ClrSchemeMapping, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotIncludeSubdocsInStats"}: + m.DoNotIncludeSubdocsInStats = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotIncludeSubdocsInStats, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotAutoCompressPictures"}: + m.DoNotAutoCompressPictures = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotAutoCompressPictures, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "forceUpgrade"}: + m.ForceUpgrade = NewCT_Empty() + if err := d.DecodeElement(m.ForceUpgrade, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "captions"}: + m.Captions = NewCT_Captions() + if err := d.DecodeElement(m.Captions, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "readModeInkLockDown"}: + m.ReadModeInkLockDown = NewCT_ReadingModeInkLockDown() + if err := d.DecodeElement(m.ReadModeInkLockDown, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "smartTagType"}: + tmp := NewCT_SmartTagType() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.SmartTagType = append(m.SmartTagType, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/schemaLibrary/2006/main", Local: "schemaLibrary"}: + m.SchemaLibrary = schemaLibrary.NewSchemaLibrary() + if err := d.DecodeElement(m.SchemaLibrary, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "shapeDefaults"}: + m.ShapeDefaults = NewCT_ShapeDefaults() + if err := d.DecodeElement(m.ShapeDefaults, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotEmbedSmartTags"}: + m.DoNotEmbedSmartTags = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotEmbedSmartTags, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "decimalSymbol"}: + m.DecimalSymbol = NewCT_String() + if err := d.DecodeElement(m.DecimalSymbol, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "listSeparator"}: + m.ListSeparator = NewCT_String() + if err := d.DecodeElement(m.ListSeparator, &el); err != nil { + return err + } + default: + any := &gooxml.XSDAny{} + if err := d.DecodeElement(any, &el); err != nil { + return err + } + m.Extra = append(m.Extra, any) + } + case xml.EndElement: + break lCT_Settings + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Settings and its children +func (m *CT_Settings) Validate() error { + return m.ValidateWithPath("CT_Settings") +} + +// ValidateWithPath validates the CT_Settings and its children, prefixing error messages with path +func (m *CT_Settings) ValidateWithPath(path string) error { + if m.WriteProtection != nil { + if err := m.WriteProtection.ValidateWithPath(path + "/WriteProtection"); err != nil { + return err + } + } + if m.View != nil { + if err := m.View.ValidateWithPath(path + "/View"); err != nil { + return err + } + } + if m.Zoom != nil { + if err := m.Zoom.ValidateWithPath(path + "/Zoom"); err != nil { + return err + } + } + if m.RemovePersonalInformation != nil { + if err := m.RemovePersonalInformation.ValidateWithPath(path + "/RemovePersonalInformation"); err != nil { + return err + } + } + if m.RemoveDateAndTime != nil { + if err := m.RemoveDateAndTime.ValidateWithPath(path + "/RemoveDateAndTime"); err != nil { + return err + } + } + if m.DoNotDisplayPageBoundaries != nil { + if err := m.DoNotDisplayPageBoundaries.ValidateWithPath(path + "/DoNotDisplayPageBoundaries"); err != nil { + return err + } + } + if m.DisplayBackgroundShape != nil { + if err := m.DisplayBackgroundShape.ValidateWithPath(path + "/DisplayBackgroundShape"); err != nil { + return err + } + } + if m.PrintPostScriptOverText != nil { + if err := m.PrintPostScriptOverText.ValidateWithPath(path + "/PrintPostScriptOverText"); err != nil { + return err + } + } + if m.PrintFractionalCharacterWidth != nil { + if err := m.PrintFractionalCharacterWidth.ValidateWithPath(path + "/PrintFractionalCharacterWidth"); err != nil { + return err + } + } + if m.PrintFormsData != nil { + if err := m.PrintFormsData.ValidateWithPath(path + "/PrintFormsData"); err != nil { + return err + } + } + if m.EmbedTrueTypeFonts != nil { + if err := m.EmbedTrueTypeFonts.ValidateWithPath(path + "/EmbedTrueTypeFonts"); err != nil { + return err + } + } + if m.EmbedSystemFonts != nil { + if err := m.EmbedSystemFonts.ValidateWithPath(path + "/EmbedSystemFonts"); err != nil { + return err + } + } + if m.SaveSubsetFonts != nil { + if err := m.SaveSubsetFonts.ValidateWithPath(path + "/SaveSubsetFonts"); err != nil { + return err + } + } + if m.SaveFormsData != nil { + if err := m.SaveFormsData.ValidateWithPath(path + "/SaveFormsData"); err != nil { + return err + } + } + if m.MirrorMargins != nil { + if err := m.MirrorMargins.ValidateWithPath(path + "/MirrorMargins"); err != nil { + return err + } + } + if m.AlignBordersAndEdges != nil { + if err := m.AlignBordersAndEdges.ValidateWithPath(path + "/AlignBordersAndEdges"); err != nil { + return err + } + } + if m.BordersDoNotSurroundHeader != nil { + if err := m.BordersDoNotSurroundHeader.ValidateWithPath(path + "/BordersDoNotSurroundHeader"); err != nil { + return err + } + } + if m.BordersDoNotSurroundFooter != nil { + if err := m.BordersDoNotSurroundFooter.ValidateWithPath(path + "/BordersDoNotSurroundFooter"); err != nil { + return err + } + } + if m.GutterAtTop != nil { + if err := m.GutterAtTop.ValidateWithPath(path + "/GutterAtTop"); err != nil { + return err + } + } + if m.HideSpellingErrors != nil { + if err := m.HideSpellingErrors.ValidateWithPath(path + "/HideSpellingErrors"); err != nil { + return err + } + } + if m.HideGrammaticalErrors != nil { + if err := m.HideGrammaticalErrors.ValidateWithPath(path + "/HideGrammaticalErrors"); err != nil { + return err + } + } + for i, v := range m.ActiveWritingStyle { + if err := v.ValidateWithPath(fmt.Sprintf("%s/ActiveWritingStyle[%d]", path, i)); err != nil { + return err + } + } + if m.ProofState != nil { + if err := m.ProofState.ValidateWithPath(path + "/ProofState"); err != nil { + return err + } + } + if m.FormsDesign != nil { + if err := m.FormsDesign.ValidateWithPath(path + "/FormsDesign"); err != nil { + return err + } + } + if m.AttachedTemplate != nil { + if err := m.AttachedTemplate.ValidateWithPath(path + "/AttachedTemplate"); err != nil { + return err + } + } + if m.LinkStyles != nil { + if err := m.LinkStyles.ValidateWithPath(path + "/LinkStyles"); err != nil { + return err + } + } + if m.StylePaneFormatFilter != nil { + if err := m.StylePaneFormatFilter.ValidateWithPath(path + "/StylePaneFormatFilter"); err != nil { + return err + } + } + if m.StylePaneSortMethod != nil { + if err := m.StylePaneSortMethod.ValidateWithPath(path + "/StylePaneSortMethod"); err != nil { + return err + } + } + if m.DocumentType != nil { + if err := m.DocumentType.ValidateWithPath(path + "/DocumentType"); err != nil { + return err + } + } + if m.MailMerge != nil { + if err := m.MailMerge.ValidateWithPath(path + "/MailMerge"); err != nil { + return err + } + } + if m.RevisionView != nil { + if err := m.RevisionView.ValidateWithPath(path + "/RevisionView"); err != nil { + return err + } + } + if m.TrackRevisions != nil { + if err := m.TrackRevisions.ValidateWithPath(path + "/TrackRevisions"); err != nil { + return err + } + } + if m.DoNotTrackMoves != nil { + if err := m.DoNotTrackMoves.ValidateWithPath(path + "/DoNotTrackMoves"); err != nil { + return err + } + } + if m.DoNotTrackFormatting != nil { + if err := m.DoNotTrackFormatting.ValidateWithPath(path + "/DoNotTrackFormatting"); err != nil { + return err + } + } + if m.DocumentProtection != nil { + if err := m.DocumentProtection.ValidateWithPath(path + "/DocumentProtection"); err != nil { + return err + } + } + if m.AutoFormatOverride != nil { + if err := m.AutoFormatOverride.ValidateWithPath(path + "/AutoFormatOverride"); err != nil { + return err + } + } + if m.StyleLockTheme != nil { + if err := m.StyleLockTheme.ValidateWithPath(path + "/StyleLockTheme"); err != nil { + return err + } + } + if m.StyleLockQFSet != nil { + if err := m.StyleLockQFSet.ValidateWithPath(path + "/StyleLockQFSet"); err != nil { + return err + } + } + if m.DefaultTabStop != nil { + if err := m.DefaultTabStop.ValidateWithPath(path + "/DefaultTabStop"); err != nil { + return err + } + } + if m.AutoHyphenation != nil { + if err := m.AutoHyphenation.ValidateWithPath(path + "/AutoHyphenation"); err != nil { + return err + } + } + if m.ConsecutiveHyphenLimit != nil { + if err := m.ConsecutiveHyphenLimit.ValidateWithPath(path + "/ConsecutiveHyphenLimit"); err != nil { + return err + } + } + if m.HyphenationZone != nil { + if err := m.HyphenationZone.ValidateWithPath(path + "/HyphenationZone"); err != nil { + return err + } + } + if m.DoNotHyphenateCaps != nil { + if err := m.DoNotHyphenateCaps.ValidateWithPath(path + "/DoNotHyphenateCaps"); err != nil { + return err + } + } + if m.ShowEnvelope != nil { + if err := m.ShowEnvelope.ValidateWithPath(path + "/ShowEnvelope"); err != nil { + return err + } + } + if m.SummaryLength != nil { + if err := m.SummaryLength.ValidateWithPath(path + "/SummaryLength"); err != nil { + return err + } + } + if m.ClickAndTypeStyle != nil { + if err := m.ClickAndTypeStyle.ValidateWithPath(path + "/ClickAndTypeStyle"); err != nil { + return err + } + } + if m.DefaultTableStyle != nil { + if err := m.DefaultTableStyle.ValidateWithPath(path + "/DefaultTableStyle"); err != nil { + return err + } + } + if m.EvenAndOddHeaders != nil { + if err := m.EvenAndOddHeaders.ValidateWithPath(path + "/EvenAndOddHeaders"); err != nil { + return err + } + } + if m.BookFoldRevPrinting != nil { + if err := m.BookFoldRevPrinting.ValidateWithPath(path + "/BookFoldRevPrinting"); err != nil { + return err + } + } + if m.BookFoldPrinting != nil { + if err := m.BookFoldPrinting.ValidateWithPath(path + "/BookFoldPrinting"); err != nil { + return err + } + } + if m.BookFoldPrintingSheets != nil { + if err := m.BookFoldPrintingSheets.ValidateWithPath(path + "/BookFoldPrintingSheets"); err != nil { + return err + } + } + if m.DrawingGridHorizontalSpacing != nil { + if err := m.DrawingGridHorizontalSpacing.ValidateWithPath(path + "/DrawingGridHorizontalSpacing"); err != nil { + return err + } + } + if m.DrawingGridVerticalSpacing != nil { + if err := m.DrawingGridVerticalSpacing.ValidateWithPath(path + "/DrawingGridVerticalSpacing"); err != nil { + return err + } + } + if m.DisplayHorizontalDrawingGridEvery != nil { + if err := m.DisplayHorizontalDrawingGridEvery.ValidateWithPath(path + "/DisplayHorizontalDrawingGridEvery"); err != nil { + return err + } + } + if m.DisplayVerticalDrawingGridEvery != nil { + if err := m.DisplayVerticalDrawingGridEvery.ValidateWithPath(path + "/DisplayVerticalDrawingGridEvery"); err != nil { + return err + } + } + if m.DoNotUseMarginsForDrawingGridOrigin != nil { + if err := m.DoNotUseMarginsForDrawingGridOrigin.ValidateWithPath(path + "/DoNotUseMarginsForDrawingGridOrigin"); err != nil { + return err + } + } + if m.DrawingGridHorizontalOrigin != nil { + if err := m.DrawingGridHorizontalOrigin.ValidateWithPath(path + "/DrawingGridHorizontalOrigin"); err != nil { + return err + } + } + if m.DrawingGridVerticalOrigin != nil { + if err := m.DrawingGridVerticalOrigin.ValidateWithPath(path + "/DrawingGridVerticalOrigin"); err != nil { + return err + } + } + if m.DoNotShadeFormData != nil { + if err := m.DoNotShadeFormData.ValidateWithPath(path + "/DoNotShadeFormData"); err != nil { + return err + } + } + if m.NoPunctuationKerning != nil { + if err := m.NoPunctuationKerning.ValidateWithPath(path + "/NoPunctuationKerning"); err != nil { + return err + } + } + if m.CharacterSpacingControl != nil { + if err := m.CharacterSpacingControl.ValidateWithPath(path + "/CharacterSpacingControl"); err != nil { + return err + } + } + if m.PrintTwoOnOne != nil { + if err := m.PrintTwoOnOne.ValidateWithPath(path + "/PrintTwoOnOne"); err != nil { + return err + } + } + if m.StrictFirstAndLastChars != nil { + if err := m.StrictFirstAndLastChars.ValidateWithPath(path + "/StrictFirstAndLastChars"); err != nil { + return err + } + } + if m.NoLineBreaksAfter != nil { + if err := m.NoLineBreaksAfter.ValidateWithPath(path + "/NoLineBreaksAfter"); err != nil { + return err + } + } + if m.NoLineBreaksBefore != nil { + if err := m.NoLineBreaksBefore.ValidateWithPath(path + "/NoLineBreaksBefore"); err != nil { + return err + } + } + if m.SavePreviewPicture != nil { + if err := m.SavePreviewPicture.ValidateWithPath(path + "/SavePreviewPicture"); err != nil { + return err + } + } + if m.DoNotValidateAgainstSchema != nil { + if err := m.DoNotValidateAgainstSchema.ValidateWithPath(path + "/DoNotValidateAgainstSchema"); err != nil { + return err + } + } + if m.SaveInvalidXml != nil { + if err := m.SaveInvalidXml.ValidateWithPath(path + "/SaveInvalidXml"); err != nil { + return err + } + } + if m.IgnoreMixedContent != nil { + if err := m.IgnoreMixedContent.ValidateWithPath(path + "/IgnoreMixedContent"); err != nil { + return err + } + } + if m.AlwaysShowPlaceholderText != nil { + if err := m.AlwaysShowPlaceholderText.ValidateWithPath(path + "/AlwaysShowPlaceholderText"); err != nil { + return err + } + } + if m.DoNotDemarcateInvalidXml != nil { + if err := m.DoNotDemarcateInvalidXml.ValidateWithPath(path + "/DoNotDemarcateInvalidXml"); err != nil { + return err + } + } + if m.SaveXmlDataOnly != nil { + if err := m.SaveXmlDataOnly.ValidateWithPath(path + "/SaveXmlDataOnly"); err != nil { + return err + } + } + if m.UseXSLTWhenSaving != nil { + if err := m.UseXSLTWhenSaving.ValidateWithPath(path + "/UseXSLTWhenSaving"); err != nil { + return err + } + } + if m.SaveThroughXslt != nil { + if err := m.SaveThroughXslt.ValidateWithPath(path + "/SaveThroughXslt"); err != nil { + return err + } + } + if m.ShowXMLTags != nil { + if err := m.ShowXMLTags.ValidateWithPath(path + "/ShowXMLTags"); err != nil { + return err + } + } + if m.AlwaysMergeEmptyNamespace != nil { + if err := m.AlwaysMergeEmptyNamespace.ValidateWithPath(path + "/AlwaysMergeEmptyNamespace"); err != nil { + return err + } + } + if m.UpdateFields != nil { + if err := m.UpdateFields.ValidateWithPath(path + "/UpdateFields"); err != nil { + return err + } + } + if m.HdrShapeDefaults != nil { + if err := m.HdrShapeDefaults.ValidateWithPath(path + "/HdrShapeDefaults"); err != nil { + return err + } + } + if m.FootnotePr != nil { + if err := m.FootnotePr.ValidateWithPath(path + "/FootnotePr"); err != nil { + return err + } + } + if m.EndnotePr != nil { + if err := m.EndnotePr.ValidateWithPath(path + "/EndnotePr"); err != nil { + return err + } + } + if m.Compat != nil { + if err := m.Compat.ValidateWithPath(path + "/Compat"); err != nil { + return err + } + } + if m.DocVars != nil { + if err := m.DocVars.ValidateWithPath(path + "/DocVars"); err != nil { + return err + } + } + if m.Rsids != nil { + if err := m.Rsids.ValidateWithPath(path + "/Rsids"); err != nil { + return err + } + } + if m.MathPr != nil { + if err := m.MathPr.ValidateWithPath(path + "/MathPr"); err != nil { + return err + } + } + for i, v := range m.AttachedSchema { + if err := v.ValidateWithPath(fmt.Sprintf("%s/AttachedSchema[%d]", path, i)); err != nil { + return err + } + } + if m.ThemeFontLang != nil { + if err := m.ThemeFontLang.ValidateWithPath(path + "/ThemeFontLang"); err != nil { + return err + } + } + if m.ClrSchemeMapping != nil { + if err := m.ClrSchemeMapping.ValidateWithPath(path + "/ClrSchemeMapping"); err != nil { + return err + } + } + if m.DoNotIncludeSubdocsInStats != nil { + if err := m.DoNotIncludeSubdocsInStats.ValidateWithPath(path + "/DoNotIncludeSubdocsInStats"); err != nil { + return err + } + } + if m.DoNotAutoCompressPictures != nil { + if err := m.DoNotAutoCompressPictures.ValidateWithPath(path + "/DoNotAutoCompressPictures"); err != nil { + return err + } + } + if m.ForceUpgrade != nil { + if err := m.ForceUpgrade.ValidateWithPath(path + "/ForceUpgrade"); err != nil { + return err + } + } + if m.Captions != nil { + if err := m.Captions.ValidateWithPath(path + "/Captions"); err != nil { + return err + } + } + if m.ReadModeInkLockDown != nil { + if err := m.ReadModeInkLockDown.ValidateWithPath(path + "/ReadModeInkLockDown"); err != nil { + return err + } + } + for i, v := range m.SmartTagType { + if err := v.ValidateWithPath(fmt.Sprintf("%s/SmartTagType[%d]", path, i)); err != nil { + return err + } + } + if m.SchemaLibrary != nil { + if err := m.SchemaLibrary.ValidateWithPath(path + "/SchemaLibrary"); err != nil { + return err + } + } + if m.ShapeDefaults != nil { + if err := m.ShapeDefaults.ValidateWithPath(path + "/ShapeDefaults"); err != nil { + return err + } + } + if m.DoNotEmbedSmartTags != nil { + if err := m.DoNotEmbedSmartTags.ValidateWithPath(path + "/DoNotEmbedSmartTags"); err != nil { + return err + } + } + if m.DecimalSymbol != nil { + if err := m.DecimalSymbol.ValidateWithPath(path + "/DecimalSymbol"); err != nil { + return err + } + } + if m.ListSeparator != nil { + if err := m.ListSeparator.ValidateWithPath(path + "/ListSeparator"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_ShapeDefaults.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_ShapeDefaults.go new file mode 100644 index 00000000..176ef89a --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_ShapeDefaults.go @@ -0,0 +1,75 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_ShapeDefaults struct { + Any []gooxml.Any +} + +func NewCT_ShapeDefaults() *CT_ShapeDefaults { + ret := &CT_ShapeDefaults{} + return ret +} + +func (m *CT_ShapeDefaults) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Any != nil { + for _, c := range m.Any { + c.MarshalXML(e, xml.StartElement{}) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_ShapeDefaults) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_ShapeDefaults: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + default: + if anyEl, err := gooxml.CreateElement(el); err != nil { + return err + } else { + if err := d.DecodeElement(anyEl, &el); err != nil { + return err + } + m.Any = append(m.Any, anyEl) + } + } + case xml.EndElement: + break lCT_ShapeDefaults + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_ShapeDefaults and its children +func (m *CT_ShapeDefaults) Validate() error { + return m.ValidateWithPath("CT_ShapeDefaults") +} + +// ValidateWithPath validates the CT_ShapeDefaults and its children, prefixing error messages with path +func (m *CT_ShapeDefaults) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Shd.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Shd.go new file mode 100644 index 00000000..66359ea3 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Shd.go @@ -0,0 +1,201 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_Shd struct { + // Shading Pattern + ValAttr ST_Shd + // Shading Pattern Color + ColorAttr *ST_HexColor + // Shading Pattern Theme Color + ThemeColorAttr ST_ThemeColor + // Shading Pattern Theme Color Tint + ThemeTintAttr *string + // Shading Pattern Theme Color Shade + ThemeShadeAttr *string + // Shading Background Color + FillAttr *ST_HexColor + // Shading Background Theme Color + ThemeFillAttr ST_ThemeColor + // Shading Background Theme Color Tint + ThemeFillTintAttr *string + // Shading Background Theme Color Shade + ThemeFillShadeAttr *string +} + +func NewCT_Shd() *CT_Shd { + ret := &CT_Shd{} + ret.ValAttr = ST_Shd(1) + return ret +} + +func (m *CT_Shd) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + if m.ColorAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:color"}, + Value: fmt.Sprintf("%v", *m.ColorAttr)}) + } + if m.ThemeColorAttr != ST_ThemeColorUnset { + attr, err := m.ThemeColorAttr.MarshalXMLAttr(xml.Name{Local: "w:themeColor"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.ThemeTintAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:themeTint"}, + Value: fmt.Sprintf("%v", *m.ThemeTintAttr)}) + } + if m.ThemeShadeAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:themeShade"}, + Value: fmt.Sprintf("%v", *m.ThemeShadeAttr)}) + } + if m.FillAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:fill"}, + Value: fmt.Sprintf("%v", *m.FillAttr)}) + } + if m.ThemeFillAttr != ST_ThemeColorUnset { + attr, err := m.ThemeFillAttr.MarshalXMLAttr(xml.Name{Local: "w:themeFill"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.ThemeFillTintAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:themeFillTint"}, + Value: fmt.Sprintf("%v", *m.ThemeFillTintAttr)}) + } + if m.ThemeFillShadeAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:themeFillShade"}, + Value: fmt.Sprintf("%v", *m.ThemeFillShadeAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Shd) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_Shd(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "color" { + parsed, err := ParseUnionST_HexColor(attr.Value) + if err != nil { + return err + } + m.ColorAttr = &parsed + continue + } + if attr.Name.Local == "themeColor" { + m.ThemeColorAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "themeTint" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ThemeTintAttr = &parsed + continue + } + if attr.Name.Local == "themeShade" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ThemeShadeAttr = &parsed + continue + } + if attr.Name.Local == "fill" { + parsed, err := ParseUnionST_HexColor(attr.Value) + if err != nil { + return err + } + m.FillAttr = &parsed + continue + } + if attr.Name.Local == "themeFill" { + m.ThemeFillAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "themeFillTint" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ThemeFillTintAttr = &parsed + continue + } + if attr.Name.Local == "themeFillShade" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ThemeFillShadeAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Shd: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Shd and its children +func (m *CT_Shd) Validate() error { + return m.ValidateWithPath("CT_Shd") +} + +// ValidateWithPath validates the CT_Shd and its children, prefixing error messages with path +func (m *CT_Shd) ValidateWithPath(path string) error { + if m.ValAttr == ST_ShdUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + if m.ColorAttr != nil { + if err := m.ColorAttr.ValidateWithPath(path + "/ColorAttr"); err != nil { + return err + } + } + if err := m.ThemeColorAttr.ValidateWithPath(path + "/ThemeColorAttr"); err != nil { + return err + } + if m.FillAttr != nil { + if err := m.FillAttr.ValidateWithPath(path + "/FillAttr"); err != nil { + return err + } + } + if err := m.ThemeFillAttr.ValidateWithPath(path + "/ThemeFillAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SignedHpsMeasure.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SignedHpsMeasure.go new file mode 100644 index 00000000..eb6b5c95 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SignedHpsMeasure.go @@ -0,0 +1,71 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_SignedHpsMeasure struct { + // Signed Half-Point Measurement + ValAttr ST_SignedHpsMeasure +} + +func NewCT_SignedHpsMeasure() *CT_SignedHpsMeasure { + ret := &CT_SignedHpsMeasure{} + return ret +} + +func (m *CT_SignedHpsMeasure) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:val"}, + Value: fmt.Sprintf("%v", m.ValAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SignedHpsMeasure) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := ParseUnionST_SignedHpsMeasure(attr.Value) + if err != nil { + return err + } + m.ValAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_SignedHpsMeasure: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_SignedHpsMeasure and its children +func (m *CT_SignedHpsMeasure) Validate() error { + return m.ValidateWithPath("CT_SignedHpsMeasure") +} + +// ValidateWithPath validates the CT_SignedHpsMeasure and its children, prefixing error messages with path +func (m *CT_SignedHpsMeasure) ValidateWithPath(path string) error { + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SignedTwipsMeasure.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SignedTwipsMeasure.go new file mode 100644 index 00000000..0debc55d --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SignedTwipsMeasure.go @@ -0,0 +1,71 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_SignedTwipsMeasure struct { + // Positive or Negative Value in Twentieths of a Point + ValAttr ST_SignedTwipsMeasure +} + +func NewCT_SignedTwipsMeasure() *CT_SignedTwipsMeasure { + ret := &CT_SignedTwipsMeasure{} + return ret +} + +func (m *CT_SignedTwipsMeasure) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:val"}, + Value: fmt.Sprintf("%v", m.ValAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SignedTwipsMeasure) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := ParseUnionST_SignedTwipsMeasure(attr.Value) + if err != nil { + return err + } + m.ValAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_SignedTwipsMeasure: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_SignedTwipsMeasure and its children +func (m *CT_SignedTwipsMeasure) Validate() error { + return m.ValidateWithPath("CT_SignedTwipsMeasure") +} + +// ValidateWithPath validates the CT_SignedTwipsMeasure and its children, prefixing error messages with path +func (m *CT_SignedTwipsMeasure) ValidateWithPath(path string) error { + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SimpleField.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SimpleField.go new file mode 100644 index 00000000..72122719 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SimpleField.go @@ -0,0 +1,534 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/math" + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_SimpleField struct { + // Field Codes + InstrAttr string + // Field Should Not Be Recalculated + FldLockAttr *sharedTypes.ST_OnOff + // Field Result Invalidated + DirtyAttr *sharedTypes.ST_OnOff + // Custom Field Data + FldData *CT_Text + EG_PContent []*EG_PContent +} + +func NewCT_SimpleField() *CT_SimpleField { + ret := &CT_SimpleField{} + return ret +} + +func (m *CT_SimpleField) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:instr"}, + Value: fmt.Sprintf("%v", m.InstrAttr)}) + if m.FldLockAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:fldLock"}, + Value: fmt.Sprintf("%v", *m.FldLockAttr)}) + } + if m.DirtyAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:dirty"}, + Value: fmt.Sprintf("%v", *m.DirtyAttr)}) + } + e.EncodeToken(start) + if m.FldData != nil { + sefldData := xml.StartElement{Name: xml.Name{Local: "w:fldData"}} + e.EncodeElement(m.FldData, sefldData) + } + if m.EG_PContent != nil { + for _, c := range m.EG_PContent { + c.MarshalXML(e, xml.StartElement{}) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SimpleField) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "instr" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.InstrAttr = parsed + continue + } + if attr.Name.Local == "fldLock" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.FldLockAttr = &parsed + continue + } + if attr.Name.Local == "dirty" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.DirtyAttr = &parsed + continue + } + } +lCT_SimpleField: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "fldData"}: + m.FldData = NewCT_Text() + if err := d.DecodeElement(m.FldData, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "fldSimple"}: + tmppcontent := NewEG_PContent() + tmp := NewCT_SimpleField() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + tmppcontent.FldSimple = append(tmppcontent.FldSimple, tmp) + m.EG_PContent = append(m.EG_PContent, tmppcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "hyperlink"}: + tmppcontent := NewEG_PContent() + tmppcontent.Hyperlink = NewCT_Hyperlink() + if err := d.DecodeElement(tmppcontent.Hyperlink, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "subDoc"}: + tmppcontent := NewEG_PContent() + tmppcontent.SubDoc = NewCT_Rel() + if err := d.DecodeElement(tmppcontent.SubDoc, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXml"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.CustomXml = NewCT_CustomXmlRun() + if err := d.DecodeElement(tmpcontentruncontent.CustomXml, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "smartTag"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.SmartTag = NewCT_SmartTagRun() + if err := d.DecodeElement(tmpcontentruncontent.SmartTag, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdt"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.Sdt = NewCT_SdtRun() + if err := d.DecodeElement(tmpcontentruncontent.Sdt, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "dir"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.Dir = NewCT_DirContentRun() + if err := d.DecodeElement(tmpcontentruncontent.Dir, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bdo"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.Bdo = NewCT_BdoContentRun() + if err := d.DecodeElement(tmpcontentruncontent.Bdo, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "r"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.R = NewCT_R() + if err := d.DecodeElement(tmpcontentruncontent.R, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "proofErr"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.ProofErr = NewCT_ProofErr() + if err := d.DecodeElement(tmprunlevelelts.ProofErr, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permStart"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermStart = NewCT_PermStart() + if err := d.DecodeElement(tmprunlevelelts.PermStart, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permEnd"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermEnd = NewCT_Perm() + if err := d.DecodeElement(tmprunlevelelts.PermEnd, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Ins = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Ins, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Del = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Del, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFrom"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveFrom = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveFrom, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveTo"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveTo = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveTo, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkStart"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkStart = NewCT_Bookmark() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkStart, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkEnd"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkEnd, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeStart"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeStart, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeEnd"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeStart"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeStart, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeEnd"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeEnd, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeStart"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeStart = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeStart, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeEnd"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeEnd, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeStart"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeStart, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeEnd"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeEnd, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeStart"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeStart, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeEnd"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeEnd, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeStart"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeStart, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeEnd"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeStart"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeStart, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeEnd"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeEnd, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMathPara"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMathPara = math.NewOMathPara() + if err := d.DecodeElement(tmpmathcontent.OMathPara, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMath"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMath = math.NewOMath() + if err := d.DecodeElement(tmpmathcontent.OMath, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + default: + gooxml.Log("skipping unsupported element on CT_SimpleField %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_SimpleField + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_SimpleField and its children +func (m *CT_SimpleField) Validate() error { + return m.ValidateWithPath("CT_SimpleField") +} + +// ValidateWithPath validates the CT_SimpleField and its children, prefixing error messages with path +func (m *CT_SimpleField) ValidateWithPath(path string) error { + if m.FldLockAttr != nil { + if err := m.FldLockAttr.ValidateWithPath(path + "/FldLockAttr"); err != nil { + return err + } + } + if m.DirtyAttr != nil { + if err := m.DirtyAttr.ValidateWithPath(path + "/DirtyAttr"); err != nil { + return err + } + } + if m.FldData != nil { + if err := m.FldData.ValidateWithPath(path + "/FldData"); err != nil { + return err + } + } + for i, v := range m.EG_PContent { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_PContent[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SmartTagPr.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SmartTagPr.go new file mode 100644 index 00000000..90c43434 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SmartTagPr.go @@ -0,0 +1,85 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_SmartTagPr struct { + // Smart Tag Property + Attr []*CT_Attr +} + +func NewCT_SmartTagPr() *CT_SmartTagPr { + ret := &CT_SmartTagPr{} + return ret +} + +func (m *CT_SmartTagPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Attr != nil { + seattr := xml.StartElement{Name: xml.Name{Local: "w:attr"}} + for _, c := range m.Attr { + e.EncodeElement(c, seattr) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SmartTagPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_SmartTagPr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "attr"}: + tmp := NewCT_Attr() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Attr = append(m.Attr, tmp) + default: + gooxml.Log("skipping unsupported element on CT_SmartTagPr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_SmartTagPr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_SmartTagPr and its children +func (m *CT_SmartTagPr) Validate() error { + return m.ValidateWithPath("CT_SmartTagPr") +} + +// ValidateWithPath validates the CT_SmartTagPr and its children, prefixing error messages with path +func (m *CT_SmartTagPr) ValidateWithPath(path string) error { + for i, v := range m.Attr { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Attr[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SmartTagRun.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SmartTagRun.go new file mode 100644 index 00000000..448aa9e3 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SmartTagRun.go @@ -0,0 +1,509 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/math" +) + +type CT_SmartTagRun struct { + // Smart Tag Namespace + UriAttr *string + // Smart Tag Name + ElementAttr string + // Smart Tag Properties + SmartTagPr *CT_SmartTagPr + EG_PContent []*EG_PContent +} + +func NewCT_SmartTagRun() *CT_SmartTagRun { + ret := &CT_SmartTagRun{} + return ret +} + +func (m *CT_SmartTagRun) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.UriAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:uri"}, + Value: fmt.Sprintf("%v", *m.UriAttr)}) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:element"}, + Value: fmt.Sprintf("%v", m.ElementAttr)}) + e.EncodeToken(start) + if m.SmartTagPr != nil { + sesmartTagPr := xml.StartElement{Name: xml.Name{Local: "w:smartTagPr"}} + e.EncodeElement(m.SmartTagPr, sesmartTagPr) + } + if m.EG_PContent != nil { + for _, c := range m.EG_PContent { + c.MarshalXML(e, xml.StartElement{}) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SmartTagRun) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "uri" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.UriAttr = &parsed + continue + } + if attr.Name.Local == "element" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ElementAttr = parsed + continue + } + } +lCT_SmartTagRun: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "smartTagPr"}: + m.SmartTagPr = NewCT_SmartTagPr() + if err := d.DecodeElement(m.SmartTagPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "fldSimple"}: + tmppcontent := NewEG_PContent() + tmp := NewCT_SimpleField() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + tmppcontent.FldSimple = append(tmppcontent.FldSimple, tmp) + m.EG_PContent = append(m.EG_PContent, tmppcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "hyperlink"}: + tmppcontent := NewEG_PContent() + tmppcontent.Hyperlink = NewCT_Hyperlink() + if err := d.DecodeElement(tmppcontent.Hyperlink, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "subDoc"}: + tmppcontent := NewEG_PContent() + tmppcontent.SubDoc = NewCT_Rel() + if err := d.DecodeElement(tmppcontent.SubDoc, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXml"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.CustomXml = NewCT_CustomXmlRun() + if err := d.DecodeElement(tmpcontentruncontent.CustomXml, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "smartTag"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.SmartTag = NewCT_SmartTagRun() + if err := d.DecodeElement(tmpcontentruncontent.SmartTag, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdt"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.Sdt = NewCT_SdtRun() + if err := d.DecodeElement(tmpcontentruncontent.Sdt, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "dir"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.Dir = NewCT_DirContentRun() + if err := d.DecodeElement(tmpcontentruncontent.Dir, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bdo"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.Bdo = NewCT_BdoContentRun() + if err := d.DecodeElement(tmpcontentruncontent.Bdo, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "r"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.R = NewCT_R() + if err := d.DecodeElement(tmpcontentruncontent.R, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "proofErr"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.ProofErr = NewCT_ProofErr() + if err := d.DecodeElement(tmprunlevelelts.ProofErr, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permStart"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermStart = NewCT_PermStart() + if err := d.DecodeElement(tmprunlevelelts.PermStart, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permEnd"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermEnd = NewCT_Perm() + if err := d.DecodeElement(tmprunlevelelts.PermEnd, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Ins = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Ins, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Del = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Del, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFrom"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveFrom = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveFrom, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveTo"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveTo = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveTo, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkStart"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkStart = NewCT_Bookmark() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkStart, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkEnd"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkEnd, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeStart"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeStart, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeEnd"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeStart"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeStart, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeEnd"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeEnd, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeStart"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeStart = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeStart, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeEnd"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeEnd, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeStart"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeStart, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeEnd"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeEnd, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeStart"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeStart, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeEnd"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeEnd, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeStart"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeStart, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeEnd"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeStart"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeStart, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeEnd"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeEnd, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMathPara"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMathPara = math.NewOMathPara() + if err := d.DecodeElement(tmpmathcontent.OMathPara, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMath"}: + tmppcontent := NewEG_PContent() + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMath = math.NewOMath() + if err := d.DecodeElement(tmpmathcontent.OMath, &el); err != nil { + return err + } + m.EG_PContent = append(m.EG_PContent, tmppcontent) + tmppcontent.EG_ContentRunContent = append(tmppcontent.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + default: + gooxml.Log("skipping unsupported element on CT_SmartTagRun %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_SmartTagRun + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_SmartTagRun and its children +func (m *CT_SmartTagRun) Validate() error { + return m.ValidateWithPath("CT_SmartTagRun") +} + +// ValidateWithPath validates the CT_SmartTagRun and its children, prefixing error messages with path +func (m *CT_SmartTagRun) ValidateWithPath(path string) error { + if m.SmartTagPr != nil { + if err := m.SmartTagPr.ValidateWithPath(path + "/SmartTagPr"); err != nil { + return err + } + } + for i, v := range m.EG_PContent { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_PContent[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SmartTagType.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SmartTagType.go new file mode 100644 index 00000000..f28d7bb4 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_SmartTagType.go @@ -0,0 +1,98 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_SmartTagType struct { + // Smart Tag Namespace + NamespaceuriAttr *string + // Smart Tag Name + NameAttr *string + // Smart Tag Supplementary URL + UrlAttr *string +} + +func NewCT_SmartTagType() *CT_SmartTagType { + ret := &CT_SmartTagType{} + return ret +} + +func (m *CT_SmartTagType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.NamespaceuriAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:namespaceuri"}, + Value: fmt.Sprintf("%v", *m.NamespaceuriAttr)}) + } + if m.NameAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:name"}, + Value: fmt.Sprintf("%v", *m.NameAttr)}) + } + if m.UrlAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:url"}, + Value: fmt.Sprintf("%v", *m.UrlAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_SmartTagType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "namespaceuri" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.NamespaceuriAttr = &parsed + continue + } + if attr.Name.Local == "name" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.NameAttr = &parsed + continue + } + if attr.Name.Local == "url" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.UrlAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_SmartTagType: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_SmartTagType and its children +func (m *CT_SmartTagType) Validate() error { + return m.ValidateWithPath("CT_SmartTagType") +} + +// ValidateWithPath validates the CT_SmartTagType and its children, prefixing error messages with path +func (m *CT_SmartTagType) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Spacing.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Spacing.go new file mode 100644 index 00000000..c2760419 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Spacing.go @@ -0,0 +1,198 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_Spacing struct { + // Spacing Above Paragraph + BeforeAttr *sharedTypes.ST_TwipsMeasure + // Spacing Above Paragraph IN Line Units + BeforeLinesAttr *int64 + // Automatically Determine Spacing Above Paragraph + BeforeAutospacingAttr *sharedTypes.ST_OnOff + // Spacing Below Paragraph + AfterAttr *sharedTypes.ST_TwipsMeasure + // Spacing Below Paragraph in Line Units + AfterLinesAttr *int64 + // Automatically Determine Spacing Below Paragraph + AfterAutospacingAttr *sharedTypes.ST_OnOff + // Spacing Between Lines in Paragraph + LineAttr *ST_SignedTwipsMeasure + // Spacing Between Lines + LineRuleAttr ST_LineSpacingRule +} + +func NewCT_Spacing() *CT_Spacing { + ret := &CT_Spacing{} + return ret +} + +func (m *CT_Spacing) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.BeforeAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:before"}, + Value: fmt.Sprintf("%v", *m.BeforeAttr)}) + } + if m.BeforeLinesAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:beforeLines"}, + Value: fmt.Sprintf("%v", *m.BeforeLinesAttr)}) + } + if m.BeforeAutospacingAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:beforeAutospacing"}, + Value: fmt.Sprintf("%v", *m.BeforeAutospacingAttr)}) + } + if m.AfterAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:after"}, + Value: fmt.Sprintf("%v", *m.AfterAttr)}) + } + if m.AfterLinesAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:afterLines"}, + Value: fmt.Sprintf("%v", *m.AfterLinesAttr)}) + } + if m.AfterAutospacingAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:afterAutospacing"}, + Value: fmt.Sprintf("%v", *m.AfterAutospacingAttr)}) + } + if m.LineAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:line"}, + Value: fmt.Sprintf("%v", *m.LineAttr)}) + } + if m.LineRuleAttr != ST_LineSpacingRuleUnset { + attr, err := m.LineRuleAttr.MarshalXMLAttr(xml.Name{Local: "w:lineRule"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Spacing) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "before" { + parsed, err := ParseUnionST_TwipsMeasure(attr.Value) + if err != nil { + return err + } + m.BeforeAttr = &parsed + continue + } + if attr.Name.Local == "beforeLines" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.BeforeLinesAttr = &parsed + continue + } + if attr.Name.Local == "beforeAutospacing" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.BeforeAutospacingAttr = &parsed + continue + } + if attr.Name.Local == "after" { + parsed, err := ParseUnionST_TwipsMeasure(attr.Value) + if err != nil { + return err + } + m.AfterAttr = &parsed + continue + } + if attr.Name.Local == "afterLines" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.AfterLinesAttr = &parsed + continue + } + if attr.Name.Local == "afterAutospacing" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.AfterAutospacingAttr = &parsed + continue + } + if attr.Name.Local == "line" { + parsed, err := ParseUnionST_SignedTwipsMeasure(attr.Value) + if err != nil { + return err + } + m.LineAttr = &parsed + continue + } + if attr.Name.Local == "lineRule" { + m.LineRuleAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Spacing: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Spacing and its children +func (m *CT_Spacing) Validate() error { + return m.ValidateWithPath("CT_Spacing") +} + +// ValidateWithPath validates the CT_Spacing and its children, prefixing error messages with path +func (m *CT_Spacing) ValidateWithPath(path string) error { + if m.BeforeAttr != nil { + if err := m.BeforeAttr.ValidateWithPath(path + "/BeforeAttr"); err != nil { + return err + } + } + if m.BeforeAutospacingAttr != nil { + if err := m.BeforeAutospacingAttr.ValidateWithPath(path + "/BeforeAutospacingAttr"); err != nil { + return err + } + } + if m.AfterAttr != nil { + if err := m.AfterAttr.ValidateWithPath(path + "/AfterAttr"); err != nil { + return err + } + } + if m.AfterAutospacingAttr != nil { + if err := m.AfterAutospacingAttr.ValidateWithPath(path + "/AfterAutospacingAttr"); err != nil { + return err + } + } + if m.LineAttr != nil { + if err := m.LineAttr.ValidateWithPath(path + "/LineAttr"); err != nil { + return err + } + } + if err := m.LineRuleAttr.ValidateWithPath(path + "/LineRuleAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_String.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_String.go new file mode 100644 index 00000000..4a3f124b --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_String.go @@ -0,0 +1,68 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_String struct { + // String Value + ValAttr string +} + +func NewCT_String() *CT_String { + ret := &CT_String{} + return ret +} + +func (m *CT_String) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:val"}, + Value: fmt.Sprintf("%v", m.ValAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_String) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ValAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_String: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_String and its children +func (m *CT_String) Validate() error { + return m.ValidateWithPath("CT_String") +} + +// ValidateWithPath validates the CT_String and its children, prefixing error messages with path +func (m *CT_String) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Style.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Style.go new file mode 100644 index 00000000..2c20f04a --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Style.go @@ -0,0 +1,492 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_Style struct { + // Style Type + TypeAttr ST_StyleType + // Style ID + StyleIdAttr *string + // Default Style + DefaultAttr *sharedTypes.ST_OnOff + // User-Defined Style + CustomStyleAttr *sharedTypes.ST_OnOff + // Primary Style Name + Name *CT_String + // Alternate Style Names + Aliases *CT_String + // Parent Style ID + BasedOn *CT_String + // Style For Next Paragraph + Next *CT_String + // Linked Style Reference + Link *CT_String + // Automatically Merge User Formatting Into Style Definition + AutoRedefine *CT_OnOff + // Hide Style From User Interface + Hidden *CT_OnOff + // Optional User Interface Sorting Order + UiPriority *CT_DecimalNumber + // Hide Style From Main User Interface + SemiHidden *CT_OnOff + // Remove Semi-Hidden Property When Style Is Used + UnhideWhenUsed *CT_OnOff + // Primary Style + QFormat *CT_OnOff + // Style Cannot Be Applied + Locked *CT_OnOff + // E-Mail Message Text Style + Personal *CT_OnOff + // E-Mail Message Composition Style + PersonalCompose *CT_OnOff + // E-Mail Message Reply Style + PersonalReply *CT_OnOff + // Revision Identifier for Style Definition + Rsid *CT_LongHexNumber + // Style Paragraph Properties + PPr *CT_PPrGeneral + // Run Properties + RPr *CT_RPr + // Style Table Properties + TblPr *CT_TblPrBase + // Style Table Row Properties + TrPr *CT_TrPr + // Style Table Cell Properties + TcPr *CT_TcPr + // Style Conditional Table Formatting Properties + TblStylePr []*CT_TblStylePr +} + +func NewCT_Style() *CT_Style { + ret := &CT_Style{} + return ret +} + +func (m *CT_Style) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.TypeAttr != ST_StyleTypeUnset { + attr, err := m.TypeAttr.MarshalXMLAttr(xml.Name{Local: "w:type"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.StyleIdAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:styleId"}, + Value: fmt.Sprintf("%v", *m.StyleIdAttr)}) + } + if m.DefaultAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:default"}, + Value: fmt.Sprintf("%v", *m.DefaultAttr)}) + } + if m.CustomStyleAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:customStyle"}, + Value: fmt.Sprintf("%v", *m.CustomStyleAttr)}) + } + e.EncodeToken(start) + if m.Name != nil { + sename := xml.StartElement{Name: xml.Name{Local: "w:name"}} + e.EncodeElement(m.Name, sename) + } + if m.Aliases != nil { + sealiases := xml.StartElement{Name: xml.Name{Local: "w:aliases"}} + e.EncodeElement(m.Aliases, sealiases) + } + if m.BasedOn != nil { + sebasedOn := xml.StartElement{Name: xml.Name{Local: "w:basedOn"}} + e.EncodeElement(m.BasedOn, sebasedOn) + } + if m.Next != nil { + senext := xml.StartElement{Name: xml.Name{Local: "w:next"}} + e.EncodeElement(m.Next, senext) + } + if m.Link != nil { + selink := xml.StartElement{Name: xml.Name{Local: "w:link"}} + e.EncodeElement(m.Link, selink) + } + if m.AutoRedefine != nil { + seautoRedefine := xml.StartElement{Name: xml.Name{Local: "w:autoRedefine"}} + e.EncodeElement(m.AutoRedefine, seautoRedefine) + } + if m.Hidden != nil { + sehidden := xml.StartElement{Name: xml.Name{Local: "w:hidden"}} + e.EncodeElement(m.Hidden, sehidden) + } + if m.UiPriority != nil { + seuiPriority := xml.StartElement{Name: xml.Name{Local: "w:uiPriority"}} + e.EncodeElement(m.UiPriority, seuiPriority) + } + if m.SemiHidden != nil { + sesemiHidden := xml.StartElement{Name: xml.Name{Local: "w:semiHidden"}} + e.EncodeElement(m.SemiHidden, sesemiHidden) + } + if m.UnhideWhenUsed != nil { + seunhideWhenUsed := xml.StartElement{Name: xml.Name{Local: "w:unhideWhenUsed"}} + e.EncodeElement(m.UnhideWhenUsed, seunhideWhenUsed) + } + if m.QFormat != nil { + seqFormat := xml.StartElement{Name: xml.Name{Local: "w:qFormat"}} + e.EncodeElement(m.QFormat, seqFormat) + } + if m.Locked != nil { + selocked := xml.StartElement{Name: xml.Name{Local: "w:locked"}} + e.EncodeElement(m.Locked, selocked) + } + if m.Personal != nil { + sepersonal := xml.StartElement{Name: xml.Name{Local: "w:personal"}} + e.EncodeElement(m.Personal, sepersonal) + } + if m.PersonalCompose != nil { + sepersonalCompose := xml.StartElement{Name: xml.Name{Local: "w:personalCompose"}} + e.EncodeElement(m.PersonalCompose, sepersonalCompose) + } + if m.PersonalReply != nil { + sepersonalReply := xml.StartElement{Name: xml.Name{Local: "w:personalReply"}} + e.EncodeElement(m.PersonalReply, sepersonalReply) + } + if m.Rsid != nil { + sersid := xml.StartElement{Name: xml.Name{Local: "w:rsid"}} + e.EncodeElement(m.Rsid, sersid) + } + if m.PPr != nil { + sepPr := xml.StartElement{Name: xml.Name{Local: "w:pPr"}} + e.EncodeElement(m.PPr, sepPr) + } + if m.RPr != nil { + serPr := xml.StartElement{Name: xml.Name{Local: "w:rPr"}} + e.EncodeElement(m.RPr, serPr) + } + if m.TblPr != nil { + setblPr := xml.StartElement{Name: xml.Name{Local: "w:tblPr"}} + e.EncodeElement(m.TblPr, setblPr) + } + if m.TrPr != nil { + setrPr := xml.StartElement{Name: xml.Name{Local: "w:trPr"}} + e.EncodeElement(m.TrPr, setrPr) + } + if m.TcPr != nil { + setcPr := xml.StartElement{Name: xml.Name{Local: "w:tcPr"}} + e.EncodeElement(m.TcPr, setcPr) + } + if m.TblStylePr != nil { + setblStylePr := xml.StartElement{Name: xml.Name{Local: "w:tblStylePr"}} + for _, c := range m.TblStylePr { + e.EncodeElement(c, setblStylePr) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Style) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "type" { + m.TypeAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "default" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.DefaultAttr = &parsed + continue + } + if attr.Name.Local == "customStyle" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.CustomStyleAttr = &parsed + continue + } + if attr.Name.Local == "styleId" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.StyleIdAttr = &parsed + continue + } + } +lCT_Style: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "name"}: + m.Name = NewCT_String() + if err := d.DecodeElement(m.Name, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "aliases"}: + m.Aliases = NewCT_String() + if err := d.DecodeElement(m.Aliases, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "basedOn"}: + m.BasedOn = NewCT_String() + if err := d.DecodeElement(m.BasedOn, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "next"}: + m.Next = NewCT_String() + if err := d.DecodeElement(m.Next, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "link"}: + m.Link = NewCT_String() + if err := d.DecodeElement(m.Link, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "autoRedefine"}: + m.AutoRedefine = NewCT_OnOff() + if err := d.DecodeElement(m.AutoRedefine, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "hidden"}: + m.Hidden = NewCT_OnOff() + if err := d.DecodeElement(m.Hidden, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "uiPriority"}: + m.UiPriority = NewCT_DecimalNumber() + if err := d.DecodeElement(m.UiPriority, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "semiHidden"}: + m.SemiHidden = NewCT_OnOff() + if err := d.DecodeElement(m.SemiHidden, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "unhideWhenUsed"}: + m.UnhideWhenUsed = NewCT_OnOff() + if err := d.DecodeElement(m.UnhideWhenUsed, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "qFormat"}: + m.QFormat = NewCT_OnOff() + if err := d.DecodeElement(m.QFormat, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "locked"}: + m.Locked = NewCT_OnOff() + if err := d.DecodeElement(m.Locked, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "personal"}: + m.Personal = NewCT_OnOff() + if err := d.DecodeElement(m.Personal, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "personalCompose"}: + m.PersonalCompose = NewCT_OnOff() + if err := d.DecodeElement(m.PersonalCompose, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "personalReply"}: + m.PersonalReply = NewCT_OnOff() + if err := d.DecodeElement(m.PersonalReply, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rsid"}: + m.Rsid = NewCT_LongHexNumber() + if err := d.DecodeElement(m.Rsid, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pPr"}: + m.PPr = NewCT_PPrGeneral() + if err := d.DecodeElement(m.PPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rPr"}: + m.RPr = NewCT_RPr() + if err := d.DecodeElement(m.RPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblPr"}: + m.TblPr = NewCT_TblPrBase() + if err := d.DecodeElement(m.TblPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "trPr"}: + m.TrPr = NewCT_TrPr() + if err := d.DecodeElement(m.TrPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tcPr"}: + m.TcPr = NewCT_TcPr() + if err := d.DecodeElement(m.TcPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblStylePr"}: + tmp := NewCT_TblStylePr() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.TblStylePr = append(m.TblStylePr, tmp) + default: + gooxml.Log("skipping unsupported element on CT_Style %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Style + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Style and its children +func (m *CT_Style) Validate() error { + return m.ValidateWithPath("CT_Style") +} + +// ValidateWithPath validates the CT_Style and its children, prefixing error messages with path +func (m *CT_Style) ValidateWithPath(path string) error { + if err := m.TypeAttr.ValidateWithPath(path + "/TypeAttr"); err != nil { + return err + } + if m.DefaultAttr != nil { + if err := m.DefaultAttr.ValidateWithPath(path + "/DefaultAttr"); err != nil { + return err + } + } + if m.CustomStyleAttr != nil { + if err := m.CustomStyleAttr.ValidateWithPath(path + "/CustomStyleAttr"); err != nil { + return err + } + } + if m.Name != nil { + if err := m.Name.ValidateWithPath(path + "/Name"); err != nil { + return err + } + } + if m.Aliases != nil { + if err := m.Aliases.ValidateWithPath(path + "/Aliases"); err != nil { + return err + } + } + if m.BasedOn != nil { + if err := m.BasedOn.ValidateWithPath(path + "/BasedOn"); err != nil { + return err + } + } + if m.Next != nil { + if err := m.Next.ValidateWithPath(path + "/Next"); err != nil { + return err + } + } + if m.Link != nil { + if err := m.Link.ValidateWithPath(path + "/Link"); err != nil { + return err + } + } + if m.AutoRedefine != nil { + if err := m.AutoRedefine.ValidateWithPath(path + "/AutoRedefine"); err != nil { + return err + } + } + if m.Hidden != nil { + if err := m.Hidden.ValidateWithPath(path + "/Hidden"); err != nil { + return err + } + } + if m.UiPriority != nil { + if err := m.UiPriority.ValidateWithPath(path + "/UiPriority"); err != nil { + return err + } + } + if m.SemiHidden != nil { + if err := m.SemiHidden.ValidateWithPath(path + "/SemiHidden"); err != nil { + return err + } + } + if m.UnhideWhenUsed != nil { + if err := m.UnhideWhenUsed.ValidateWithPath(path + "/UnhideWhenUsed"); err != nil { + return err + } + } + if m.QFormat != nil { + if err := m.QFormat.ValidateWithPath(path + "/QFormat"); err != nil { + return err + } + } + if m.Locked != nil { + if err := m.Locked.ValidateWithPath(path + "/Locked"); err != nil { + return err + } + } + if m.Personal != nil { + if err := m.Personal.ValidateWithPath(path + "/Personal"); err != nil { + return err + } + } + if m.PersonalCompose != nil { + if err := m.PersonalCompose.ValidateWithPath(path + "/PersonalCompose"); err != nil { + return err + } + } + if m.PersonalReply != nil { + if err := m.PersonalReply.ValidateWithPath(path + "/PersonalReply"); err != nil { + return err + } + } + if m.Rsid != nil { + if err := m.Rsid.ValidateWithPath(path + "/Rsid"); err != nil { + return err + } + } + if m.PPr != nil { + if err := m.PPr.ValidateWithPath(path + "/PPr"); err != nil { + return err + } + } + if m.RPr != nil { + if err := m.RPr.ValidateWithPath(path + "/RPr"); err != nil { + return err + } + } + if m.TblPr != nil { + if err := m.TblPr.ValidateWithPath(path + "/TblPr"); err != nil { + return err + } + } + if m.TrPr != nil { + if err := m.TrPr.ValidateWithPath(path + "/TrPr"); err != nil { + return err + } + } + if m.TcPr != nil { + if err := m.TcPr.ValidateWithPath(path + "/TcPr"); err != nil { + return err + } + } + for i, v := range m.TblStylePr { + if err := v.ValidateWithPath(fmt.Sprintf("%s/TblStylePr[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_StylePaneFilter.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_StylePaneFilter.go new file mode 100644 index 00000000..f58c7fc6 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_StylePaneFilter.go @@ -0,0 +1,357 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_StylePaneFilter struct { + // Display All Styles + AllStylesAttr *sharedTypes.ST_OnOff + // Display Only Custom Styles + CustomStylesAttr *sharedTypes.ST_OnOff + // Display Latent Styles + LatentStylesAttr *sharedTypes.ST_OnOff + // Display Styles in Use + StylesInUseAttr *sharedTypes.ST_OnOff + // Display Heading Styles + HeadingStylesAttr *sharedTypes.ST_OnOff + // Display Numbering Styles + NumberingStylesAttr *sharedTypes.ST_OnOff + // Display Table Styles + TableStylesAttr *sharedTypes.ST_OnOff + // Display Run Level Direct Formatting + DirectFormattingOnRunsAttr *sharedTypes.ST_OnOff + // Display Paragraph Level Direct Formatting + DirectFormattingOnParagraphsAttr *sharedTypes.ST_OnOff + // Display Direct Formatting on Numbering Data + DirectFormattingOnNumberingAttr *sharedTypes.ST_OnOff + // Display Direct Formatting on Tables + DirectFormattingOnTablesAttr *sharedTypes.ST_OnOff + // Display Styles to Remove Formatting + ClearFormattingAttr *sharedTypes.ST_OnOff + // Display Heading 1 through 3 + Top3HeadingStylesAttr *sharedTypes.ST_OnOff + // Only Show Visible Styles + VisibleStylesAttr *sharedTypes.ST_OnOff + // Use the Alternate Style Name + AlternateStyleNamesAttr *sharedTypes.ST_OnOff + // Bitmask of Suggested Filtering Options + ValAttr *string +} + +func NewCT_StylePaneFilter() *CT_StylePaneFilter { + ret := &CT_StylePaneFilter{} + return ret +} + +func (m *CT_StylePaneFilter) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.AllStylesAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:allStyles"}, + Value: fmt.Sprintf("%v", *m.AllStylesAttr)}) + } + if m.CustomStylesAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:customStyles"}, + Value: fmt.Sprintf("%v", *m.CustomStylesAttr)}) + } + if m.LatentStylesAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:latentStyles"}, + Value: fmt.Sprintf("%v", *m.LatentStylesAttr)}) + } + if m.StylesInUseAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:stylesInUse"}, + Value: fmt.Sprintf("%v", *m.StylesInUseAttr)}) + } + if m.HeadingStylesAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:headingStyles"}, + Value: fmt.Sprintf("%v", *m.HeadingStylesAttr)}) + } + if m.NumberingStylesAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:numberingStyles"}, + Value: fmt.Sprintf("%v", *m.NumberingStylesAttr)}) + } + if m.TableStylesAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:tableStyles"}, + Value: fmt.Sprintf("%v", *m.TableStylesAttr)}) + } + if m.DirectFormattingOnRunsAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:directFormattingOnRuns"}, + Value: fmt.Sprintf("%v", *m.DirectFormattingOnRunsAttr)}) + } + if m.DirectFormattingOnParagraphsAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:directFormattingOnParagraphs"}, + Value: fmt.Sprintf("%v", *m.DirectFormattingOnParagraphsAttr)}) + } + if m.DirectFormattingOnNumberingAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:directFormattingOnNumbering"}, + Value: fmt.Sprintf("%v", *m.DirectFormattingOnNumberingAttr)}) + } + if m.DirectFormattingOnTablesAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:directFormattingOnTables"}, + Value: fmt.Sprintf("%v", *m.DirectFormattingOnTablesAttr)}) + } + if m.ClearFormattingAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:clearFormatting"}, + Value: fmt.Sprintf("%v", *m.ClearFormattingAttr)}) + } + if m.Top3HeadingStylesAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:top3HeadingStyles"}, + Value: fmt.Sprintf("%v", *m.Top3HeadingStylesAttr)}) + } + if m.VisibleStylesAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:visibleStyles"}, + Value: fmt.Sprintf("%v", *m.VisibleStylesAttr)}) + } + if m.AlternateStyleNamesAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:alternateStyleNames"}, + Value: fmt.Sprintf("%v", *m.AlternateStyleNamesAttr)}) + } + if m.ValAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:val"}, + Value: fmt.Sprintf("%v", *m.ValAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_StylePaneFilter) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "directFormattingOnParagraphs" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.DirectFormattingOnParagraphsAttr = &parsed + continue + } + if attr.Name.Local == "allStyles" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.AllStylesAttr = &parsed + continue + } + if attr.Name.Local == "directFormattingOnNumbering" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.DirectFormattingOnNumberingAttr = &parsed + continue + } + if attr.Name.Local == "latentStyles" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.LatentStylesAttr = &parsed + continue + } + if attr.Name.Local == "headingStyles" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.HeadingStylesAttr = &parsed + continue + } + if attr.Name.Local == "numberingStyles" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.NumberingStylesAttr = &parsed + continue + } + if attr.Name.Local == "tableStyles" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.TableStylesAttr = &parsed + continue + } + if attr.Name.Local == "directFormattingOnRuns" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.DirectFormattingOnRunsAttr = &parsed + continue + } + if attr.Name.Local == "customStyles" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.CustomStylesAttr = &parsed + continue + } + if attr.Name.Local == "stylesInUse" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.StylesInUseAttr = &parsed + continue + } + if attr.Name.Local == "directFormattingOnTables" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.DirectFormattingOnTablesAttr = &parsed + continue + } + if attr.Name.Local == "clearFormatting" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.ClearFormattingAttr = &parsed + continue + } + if attr.Name.Local == "top3HeadingStyles" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.Top3HeadingStylesAttr = &parsed + continue + } + if attr.Name.Local == "visibleStyles" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.VisibleStylesAttr = &parsed + continue + } + if attr.Name.Local == "alternateStyleNames" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.AlternateStyleNamesAttr = &parsed + continue + } + if attr.Name.Local == "val" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ValAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_StylePaneFilter: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_StylePaneFilter and its children +func (m *CT_StylePaneFilter) Validate() error { + return m.ValidateWithPath("CT_StylePaneFilter") +} + +// ValidateWithPath validates the CT_StylePaneFilter and its children, prefixing error messages with path +func (m *CT_StylePaneFilter) ValidateWithPath(path string) error { + if m.AllStylesAttr != nil { + if err := m.AllStylesAttr.ValidateWithPath(path + "/AllStylesAttr"); err != nil { + return err + } + } + if m.CustomStylesAttr != nil { + if err := m.CustomStylesAttr.ValidateWithPath(path + "/CustomStylesAttr"); err != nil { + return err + } + } + if m.LatentStylesAttr != nil { + if err := m.LatentStylesAttr.ValidateWithPath(path + "/LatentStylesAttr"); err != nil { + return err + } + } + if m.StylesInUseAttr != nil { + if err := m.StylesInUseAttr.ValidateWithPath(path + "/StylesInUseAttr"); err != nil { + return err + } + } + if m.HeadingStylesAttr != nil { + if err := m.HeadingStylesAttr.ValidateWithPath(path + "/HeadingStylesAttr"); err != nil { + return err + } + } + if m.NumberingStylesAttr != nil { + if err := m.NumberingStylesAttr.ValidateWithPath(path + "/NumberingStylesAttr"); err != nil { + return err + } + } + if m.TableStylesAttr != nil { + if err := m.TableStylesAttr.ValidateWithPath(path + "/TableStylesAttr"); err != nil { + return err + } + } + if m.DirectFormattingOnRunsAttr != nil { + if err := m.DirectFormattingOnRunsAttr.ValidateWithPath(path + "/DirectFormattingOnRunsAttr"); err != nil { + return err + } + } + if m.DirectFormattingOnParagraphsAttr != nil { + if err := m.DirectFormattingOnParagraphsAttr.ValidateWithPath(path + "/DirectFormattingOnParagraphsAttr"); err != nil { + return err + } + } + if m.DirectFormattingOnNumberingAttr != nil { + if err := m.DirectFormattingOnNumberingAttr.ValidateWithPath(path + "/DirectFormattingOnNumberingAttr"); err != nil { + return err + } + } + if m.DirectFormattingOnTablesAttr != nil { + if err := m.DirectFormattingOnTablesAttr.ValidateWithPath(path + "/DirectFormattingOnTablesAttr"); err != nil { + return err + } + } + if m.ClearFormattingAttr != nil { + if err := m.ClearFormattingAttr.ValidateWithPath(path + "/ClearFormattingAttr"); err != nil { + return err + } + } + if m.Top3HeadingStylesAttr != nil { + if err := m.Top3HeadingStylesAttr.ValidateWithPath(path + "/Top3HeadingStylesAttr"); err != nil { + return err + } + } + if m.VisibleStylesAttr != nil { + if err := m.VisibleStylesAttr.ValidateWithPath(path + "/VisibleStylesAttr"); err != nil { + return err + } + } + if m.AlternateStyleNamesAttr != nil { + if err := m.AlternateStyleNamesAttr.ValidateWithPath(path + "/AlternateStyleNamesAttr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_StyleSort.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_StyleSort.go new file mode 100644 index 00000000..c08350cb --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_StyleSort.go @@ -0,0 +1,75 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_StyleSort struct { + // Style Sorting + ValAttr ST_StyleSort +} + +func NewCT_StyleSort() *CT_StyleSort { + ret := &CT_StyleSort{} + ret.ValAttr = ST_StyleSort(1) + return ret +} + +func (m *CT_StyleSort) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_StyleSort) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_StyleSort(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_StyleSort: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_StyleSort and its children +func (m *CT_StyleSort) Validate() error { + return m.ValidateWithPath("CT_StyleSort") +} + +// ValidateWithPath validates the CT_StyleSort and its children, prefixing error messages with path +func (m *CT_StyleSort) ValidateWithPath(path string) error { + if m.ValAttr == ST_StyleSortUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Styles.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Styles.go new file mode 100644 index 00000000..420b578e --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Styles.go @@ -0,0 +1,117 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_Styles struct { + // Document Default Paragraph and Run Properties + DocDefaults *CT_DocDefaults + // Latent Style Information + LatentStyles *CT_LatentStyles + // Style Definition + Style []*CT_Style +} + +func NewCT_Styles() *CT_Styles { + ret := &CT_Styles{} + return ret +} + +func (m *CT_Styles) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.DocDefaults != nil { + sedocDefaults := xml.StartElement{Name: xml.Name{Local: "w:docDefaults"}} + e.EncodeElement(m.DocDefaults, sedocDefaults) + } + if m.LatentStyles != nil { + selatentStyles := xml.StartElement{Name: xml.Name{Local: "w:latentStyles"}} + e.EncodeElement(m.LatentStyles, selatentStyles) + } + if m.Style != nil { + sestyle := xml.StartElement{Name: xml.Name{Local: "w:style"}} + for _, c := range m.Style { + e.EncodeElement(c, sestyle) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Styles) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_Styles: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "docDefaults"}: + m.DocDefaults = NewCT_DocDefaults() + if err := d.DecodeElement(m.DocDefaults, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "latentStyles"}: + m.LatentStyles = NewCT_LatentStyles() + if err := d.DecodeElement(m.LatentStyles, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "style"}: + tmp := NewCT_Style() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Style = append(m.Style, tmp) + default: + gooxml.Log("skipping unsupported element on CT_Styles %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Styles + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Styles and its children +func (m *CT_Styles) Validate() error { + return m.ValidateWithPath("CT_Styles") +} + +// ValidateWithPath validates the CT_Styles and its children, prefixing error messages with path +func (m *CT_Styles) ValidateWithPath(path string) error { + if m.DocDefaults != nil { + if err := m.DocDefaults.ValidateWithPath(path + "/DocDefaults"); err != nil { + return err + } + } + if m.LatentStyles != nil { + if err := m.LatentStyles.ValidateWithPath(path + "/LatentStyles"); err != nil { + return err + } + } + for i, v := range m.Style { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Style[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Sym.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Sym.go new file mode 100644 index 00000000..8eb58c1d --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Sym.go @@ -0,0 +1,84 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_Sym struct { + // Symbol Character Font + FontAttr *string + // Symbol Character Code + CharAttr *string +} + +func NewCT_Sym() *CT_Sym { + ret := &CT_Sym{} + return ret +} + +func (m *CT_Sym) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.FontAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:font"}, + Value: fmt.Sprintf("%v", *m.FontAttr)}) + } + if m.CharAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:char"}, + Value: fmt.Sprintf("%v", *m.CharAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Sym) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "font" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.FontAttr = &parsed + continue + } + if attr.Name.Local == "char" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.CharAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Sym: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Sym and its children +func (m *CT_Sym) Validate() error { + return m.ValidateWithPath("CT_Sym") +} + +// ValidateWithPath validates the CT_Sym and its children, prefixing error messages with path +func (m *CT_Sym) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TabStop.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TabStop.go new file mode 100644 index 00000000..5486b961 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TabStop.go @@ -0,0 +1,106 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_TabStop struct { + // Tab Stop Type + ValAttr ST_TabJc + // Tab Leader Character + LeaderAttr ST_TabTlc + // Tab Stop Position + PosAttr ST_SignedTwipsMeasure +} + +func NewCT_TabStop() *CT_TabStop { + ret := &CT_TabStop{} + ret.ValAttr = ST_TabJc(1) + return ret +} + +func (m *CT_TabStop) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + if m.LeaderAttr != ST_TabTlcUnset { + attr, err := m.LeaderAttr.MarshalXMLAttr(xml.Name{Local: "w:leader"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:pos"}, + Value: fmt.Sprintf("%v", m.PosAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TabStop) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_TabJc(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "leader" { + m.LeaderAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "pos" { + parsed, err := ParseUnionST_SignedTwipsMeasure(attr.Value) + if err != nil { + return err + } + m.PosAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_TabStop: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_TabStop and its children +func (m *CT_TabStop) Validate() error { + return m.ValidateWithPath("CT_TabStop") +} + +// ValidateWithPath validates the CT_TabStop and its children, prefixing error messages with path +func (m *CT_TabStop) ValidateWithPath(path string) error { + if m.ValAttr == ST_TabJcUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + if err := m.LeaderAttr.ValidateWithPath(path + "/LeaderAttr"); err != nil { + return err + } + if err := m.PosAttr.ValidateWithPath(path + "/PosAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Tabs.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Tabs.go new file mode 100644 index 00000000..59c86586 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Tabs.go @@ -0,0 +1,83 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_Tabs struct { + // Custom Tab Stop + Tab []*CT_TabStop +} + +func NewCT_Tabs() *CT_Tabs { + ret := &CT_Tabs{} + return ret +} + +func (m *CT_Tabs) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + setab := xml.StartElement{Name: xml.Name{Local: "w:tab"}} + for _, c := range m.Tab { + e.EncodeElement(c, setab) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Tabs) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_Tabs: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tab"}: + tmp := NewCT_TabStop() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Tab = append(m.Tab, tmp) + default: + gooxml.Log("skipping unsupported element on CT_Tabs %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Tabs + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Tabs and its children +func (m *CT_Tabs) Validate() error { + return m.ValidateWithPath("CT_Tabs") +} + +// ValidateWithPath validates the CT_Tabs and its children, prefixing error messages with path +func (m *CT_Tabs) ValidateWithPath(path string) error { + for i, v := range m.Tab { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Tab[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TargetScreenSz.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TargetScreenSz.go new file mode 100644 index 00000000..a8a6eb43 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TargetScreenSz.go @@ -0,0 +1,75 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_TargetScreenSz struct { + // Target Screen Size Value + ValAttr ST_TargetScreenSz +} + +func NewCT_TargetScreenSz() *CT_TargetScreenSz { + ret := &CT_TargetScreenSz{} + ret.ValAttr = ST_TargetScreenSz(1) + return ret +} + +func (m *CT_TargetScreenSz) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TargetScreenSz) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_TargetScreenSz(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_TargetScreenSz: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_TargetScreenSz and its children +func (m *CT_TargetScreenSz) Validate() error { + return m.ValidateWithPath("CT_TargetScreenSz") +} + +// ValidateWithPath validates the CT_TargetScreenSz and its children, prefixing error messages with path +func (m *CT_TargetScreenSz) ValidateWithPath(path string) error { + if m.ValAttr == ST_TargetScreenSzUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Tbl.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Tbl.go new file mode 100644 index 00000000..9a3de5f7 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Tbl.go @@ -0,0 +1,334 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/math" +) + +type CT_Tbl struct { + EG_RangeMarkupElements []*EG_RangeMarkupElements + // Table Properties + TblPr *CT_TblPr + // Table Grid + TblGrid *CT_TblGrid + EG_ContentRowContent []*EG_ContentRowContent +} + +func NewCT_Tbl() *CT_Tbl { + ret := &CT_Tbl{} + ret.TblPr = NewCT_TblPr() + ret.TblGrid = NewCT_TblGrid() + return ret +} + +func (m *CT_Tbl) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.EG_RangeMarkupElements != nil { + for _, c := range m.EG_RangeMarkupElements { + c.MarshalXML(e, xml.StartElement{}) + } + } + setblPr := xml.StartElement{Name: xml.Name{Local: "w:tblPr"}} + e.EncodeElement(m.TblPr, setblPr) + setblGrid := xml.StartElement{Name: xml.Name{Local: "w:tblGrid"}} + e.EncodeElement(m.TblGrid, setblGrid) + if m.EG_ContentRowContent != nil { + for _, c := range m.EG_ContentRowContent { + c.MarshalXML(e, xml.StartElement{}) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Tbl) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.TblPr = NewCT_TblPr() + m.TblGrid = NewCT_TblGrid() +lCT_Tbl: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkStart"}: + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkStart = NewCT_Bookmark() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkStart, &el); err != nil { + return err + } + m.EG_RangeMarkupElements = append(m.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkEnd"}: + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkEnd, &el); err != nil { + return err + } + m.EG_RangeMarkupElements = append(m.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeStart"}: + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeStart, &el); err != nil { + return err + } + m.EG_RangeMarkupElements = append(m.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeEnd"}: + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_RangeMarkupElements = append(m.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeStart"}: + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeStart, &el); err != nil { + return err + } + m.EG_RangeMarkupElements = append(m.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeEnd"}: + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeEnd, &el); err != nil { + return err + } + m.EG_RangeMarkupElements = append(m.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeStart"}: + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeStart = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeStart, &el); err != nil { + return err + } + m.EG_RangeMarkupElements = append(m.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeEnd"}: + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeEnd, &el); err != nil { + return err + } + m.EG_RangeMarkupElements = append(m.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeStart"}: + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeStart, &el); err != nil { + return err + } + m.EG_RangeMarkupElements = append(m.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeEnd"}: + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeEnd, &el); err != nil { + return err + } + m.EG_RangeMarkupElements = append(m.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeStart"}: + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeStart, &el); err != nil { + return err + } + m.EG_RangeMarkupElements = append(m.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeEnd"}: + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeEnd, &el); err != nil { + return err + } + m.EG_RangeMarkupElements = append(m.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeStart"}: + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeStart, &el); err != nil { + return err + } + m.EG_RangeMarkupElements = append(m.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeEnd"}: + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_RangeMarkupElements = append(m.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeStart"}: + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeStart, &el); err != nil { + return err + } + m.EG_RangeMarkupElements = append(m.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeEnd"}: + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeEnd, &el); err != nil { + return err + } + m.EG_RangeMarkupElements = append(m.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblPr"}: + if err := d.DecodeElement(m.TblPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblGrid"}: + if err := d.DecodeElement(m.TblGrid, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tr"}: + tmpcontentrowcontent := NewEG_ContentRowContent() + tmp := NewCT_Row() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + tmpcontentrowcontent.Tr = append(tmpcontentrowcontent.Tr, tmp) + m.EG_ContentRowContent = append(m.EG_ContentRowContent, tmpcontentrowcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXml"}: + tmpcontentrowcontent := NewEG_ContentRowContent() + tmpcontentrowcontent.CustomXml = NewCT_CustomXmlRow() + if err := d.DecodeElement(tmpcontentrowcontent.CustomXml, &el); err != nil { + return err + } + m.EG_ContentRowContent = append(m.EG_ContentRowContent, tmpcontentrowcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdt"}: + tmpcontentrowcontent := NewEG_ContentRowContent() + tmpcontentrowcontent.Sdt = NewCT_SdtRow() + if err := d.DecodeElement(tmpcontentrowcontent.Sdt, &el); err != nil { + return err + } + m.EG_ContentRowContent = append(m.EG_ContentRowContent, tmpcontentrowcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "proofErr"}: + tmpcontentrowcontent := NewEG_ContentRowContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.ProofErr = NewCT_ProofErr() + if err := d.DecodeElement(tmprunlevelelts.ProofErr, &el); err != nil { + return err + } + m.EG_ContentRowContent = append(m.EG_ContentRowContent, tmpcontentrowcontent) + tmpcontentrowcontent.EG_RunLevelElts = append(tmpcontentrowcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permStart"}: + tmpcontentrowcontent := NewEG_ContentRowContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermStart = NewCT_PermStart() + if err := d.DecodeElement(tmprunlevelelts.PermStart, &el); err != nil { + return err + } + m.EG_ContentRowContent = append(m.EG_ContentRowContent, tmpcontentrowcontent) + tmpcontentrowcontent.EG_RunLevelElts = append(tmpcontentrowcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permEnd"}: + tmpcontentrowcontent := NewEG_ContentRowContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermEnd = NewCT_Perm() + if err := d.DecodeElement(tmprunlevelelts.PermEnd, &el); err != nil { + return err + } + m.EG_ContentRowContent = append(m.EG_ContentRowContent, tmpcontentrowcontent) + tmpcontentrowcontent.EG_RunLevelElts = append(tmpcontentrowcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + tmpcontentrowcontent := NewEG_ContentRowContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Ins = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Ins, &el); err != nil { + return err + } + m.EG_ContentRowContent = append(m.EG_ContentRowContent, tmpcontentrowcontent) + tmpcontentrowcontent.EG_RunLevelElts = append(tmpcontentrowcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + tmpcontentrowcontent := NewEG_ContentRowContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Del = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Del, &el); err != nil { + return err + } + m.EG_ContentRowContent = append(m.EG_ContentRowContent, tmpcontentrowcontent) + tmpcontentrowcontent.EG_RunLevelElts = append(tmpcontentrowcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFrom"}: + tmpcontentrowcontent := NewEG_ContentRowContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveFrom = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveFrom, &el); err != nil { + return err + } + m.EG_ContentRowContent = append(m.EG_ContentRowContent, tmpcontentrowcontent) + tmpcontentrowcontent.EG_RunLevelElts = append(tmpcontentrowcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveTo"}: + tmpcontentrowcontent := NewEG_ContentRowContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveTo = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveTo, &el); err != nil { + return err + } + m.EG_ContentRowContent = append(m.EG_ContentRowContent, tmpcontentrowcontent) + tmpcontentrowcontent.EG_RunLevelElts = append(tmpcontentrowcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMathPara"}: + tmpcontentrowcontent := NewEG_ContentRowContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMathPara = math.NewOMathPara() + if err := d.DecodeElement(tmpmathcontent.OMathPara, &el); err != nil { + return err + } + m.EG_ContentRowContent = append(m.EG_ContentRowContent, tmpcontentrowcontent) + tmpcontentrowcontent.EG_RunLevelElts = append(tmpcontentrowcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMath"}: + tmpcontentrowcontent := NewEG_ContentRowContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMath = math.NewOMath() + if err := d.DecodeElement(tmpmathcontent.OMath, &el); err != nil { + return err + } + m.EG_ContentRowContent = append(m.EG_ContentRowContent, tmpcontentrowcontent) + tmpcontentrowcontent.EG_RunLevelElts = append(tmpcontentrowcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + default: + gooxml.Log("skipping unsupported element on CT_Tbl %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Tbl + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Tbl and its children +func (m *CT_Tbl) Validate() error { + return m.ValidateWithPath("CT_Tbl") +} + +// ValidateWithPath validates the CT_Tbl and its children, prefixing error messages with path +func (m *CT_Tbl) ValidateWithPath(path string) error { + for i, v := range m.EG_RangeMarkupElements { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_RangeMarkupElements[%d]", path, i)); err != nil { + return err + } + } + if err := m.TblPr.ValidateWithPath(path + "/TblPr"); err != nil { + return err + } + if err := m.TblGrid.ValidateWithPath(path + "/TblGrid"); err != nil { + return err + } + for i, v := range m.EG_ContentRowContent { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_ContentRowContent[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblBorders.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblBorders.go new file mode 100644 index 00000000..0582f82a --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblBorders.go @@ -0,0 +1,193 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_TblBorders struct { + // Table Top Border + Top *CT_Border + // Table Leading Edge Border + Start *CT_Border + // Table Leading Edge Border + Left *CT_Border + // Table Bottom Border + Bottom *CT_Border + // Table Trailing Edge Border + End *CT_Border + // Table Trailing Edge Border + Right *CT_Border + // Table Inside Horizontal Edges Border + InsideH *CT_Border + // Table Inside Vertical Edges Border + InsideV *CT_Border +} + +func NewCT_TblBorders() *CT_TblBorders { + ret := &CT_TblBorders{} + return ret +} + +func (m *CT_TblBorders) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Top != nil { + setop := xml.StartElement{Name: xml.Name{Local: "w:top"}} + e.EncodeElement(m.Top, setop) + } + if m.Start != nil { + sestart := xml.StartElement{Name: xml.Name{Local: "w:start"}} + e.EncodeElement(m.Start, sestart) + } + if m.Left != nil { + seleft := xml.StartElement{Name: xml.Name{Local: "w:left"}} + e.EncodeElement(m.Left, seleft) + } + if m.Bottom != nil { + sebottom := xml.StartElement{Name: xml.Name{Local: "w:bottom"}} + e.EncodeElement(m.Bottom, sebottom) + } + if m.End != nil { + seend := xml.StartElement{Name: xml.Name{Local: "w:end"}} + e.EncodeElement(m.End, seend) + } + if m.Right != nil { + seright := xml.StartElement{Name: xml.Name{Local: "w:right"}} + e.EncodeElement(m.Right, seright) + } + if m.InsideH != nil { + seinsideH := xml.StartElement{Name: xml.Name{Local: "w:insideH"}} + e.EncodeElement(m.InsideH, seinsideH) + } + if m.InsideV != nil { + seinsideV := xml.StartElement{Name: xml.Name{Local: "w:insideV"}} + e.EncodeElement(m.InsideV, seinsideV) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TblBorders) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_TblBorders: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "top"}: + m.Top = NewCT_Border() + if err := d.DecodeElement(m.Top, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "start"}: + m.Start = NewCT_Border() + if err := d.DecodeElement(m.Start, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "left"}: + m.Left = NewCT_Border() + if err := d.DecodeElement(m.Left, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bottom"}: + m.Bottom = NewCT_Border() + if err := d.DecodeElement(m.Bottom, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "end"}: + m.End = NewCT_Border() + if err := d.DecodeElement(m.End, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "right"}: + m.Right = NewCT_Border() + if err := d.DecodeElement(m.Right, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "insideH"}: + m.InsideH = NewCT_Border() + if err := d.DecodeElement(m.InsideH, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "insideV"}: + m.InsideV = NewCT_Border() + if err := d.DecodeElement(m.InsideV, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_TblBorders %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TblBorders + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TblBorders and its children +func (m *CT_TblBorders) Validate() error { + return m.ValidateWithPath("CT_TblBorders") +} + +// ValidateWithPath validates the CT_TblBorders and its children, prefixing error messages with path +func (m *CT_TblBorders) ValidateWithPath(path string) error { + if m.Top != nil { + if err := m.Top.ValidateWithPath(path + "/Top"); err != nil { + return err + } + } + if m.Start != nil { + if err := m.Start.ValidateWithPath(path + "/Start"); err != nil { + return err + } + } + if m.Left != nil { + if err := m.Left.ValidateWithPath(path + "/Left"); err != nil { + return err + } + } + if m.Bottom != nil { + if err := m.Bottom.ValidateWithPath(path + "/Bottom"); err != nil { + return err + } + } + if m.End != nil { + if err := m.End.ValidateWithPath(path + "/End"); err != nil { + return err + } + } + if m.Right != nil { + if err := m.Right.ValidateWithPath(path + "/Right"); err != nil { + return err + } + } + if m.InsideH != nil { + if err := m.InsideH.ValidateWithPath(path + "/InsideH"); err != nil { + return err + } + } + if m.InsideV != nil { + if err := m.InsideV.ValidateWithPath(path + "/InsideV"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblCellMar.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblCellMar.go new file mode 100644 index 00000000..2cec1d48 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblCellMar.go @@ -0,0 +1,161 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_TblCellMar struct { + // Table Cell Top Margin Default + Top *CT_TblWidth + // Table Cell Leading Margin Default + Start *CT_TblWidth + // Table Cell Leading Margin Default + Left *CT_TblWidth + // Table Cell Bottom Margin Default + Bottom *CT_TblWidth + // Table Cell Trailing Margin Default + End *CT_TblWidth + // Table Cell Trailing Margin Default + Right *CT_TblWidth +} + +func NewCT_TblCellMar() *CT_TblCellMar { + ret := &CT_TblCellMar{} + return ret +} + +func (m *CT_TblCellMar) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Top != nil { + setop := xml.StartElement{Name: xml.Name{Local: "w:top"}} + e.EncodeElement(m.Top, setop) + } + if m.Start != nil { + sestart := xml.StartElement{Name: xml.Name{Local: "w:start"}} + e.EncodeElement(m.Start, sestart) + } + if m.Left != nil { + seleft := xml.StartElement{Name: xml.Name{Local: "w:left"}} + e.EncodeElement(m.Left, seleft) + } + if m.Bottom != nil { + sebottom := xml.StartElement{Name: xml.Name{Local: "w:bottom"}} + e.EncodeElement(m.Bottom, sebottom) + } + if m.End != nil { + seend := xml.StartElement{Name: xml.Name{Local: "w:end"}} + e.EncodeElement(m.End, seend) + } + if m.Right != nil { + seright := xml.StartElement{Name: xml.Name{Local: "w:right"}} + e.EncodeElement(m.Right, seright) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TblCellMar) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_TblCellMar: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "top"}: + m.Top = NewCT_TblWidth() + if err := d.DecodeElement(m.Top, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "start"}: + m.Start = NewCT_TblWidth() + if err := d.DecodeElement(m.Start, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "left"}: + m.Left = NewCT_TblWidth() + if err := d.DecodeElement(m.Left, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bottom"}: + m.Bottom = NewCT_TblWidth() + if err := d.DecodeElement(m.Bottom, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "end"}: + m.End = NewCT_TblWidth() + if err := d.DecodeElement(m.End, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "right"}: + m.Right = NewCT_TblWidth() + if err := d.DecodeElement(m.Right, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_TblCellMar %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TblCellMar + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TblCellMar and its children +func (m *CT_TblCellMar) Validate() error { + return m.ValidateWithPath("CT_TblCellMar") +} + +// ValidateWithPath validates the CT_TblCellMar and its children, prefixing error messages with path +func (m *CT_TblCellMar) ValidateWithPath(path string) error { + if m.Top != nil { + if err := m.Top.ValidateWithPath(path + "/Top"); err != nil { + return err + } + } + if m.Start != nil { + if err := m.Start.ValidateWithPath(path + "/Start"); err != nil { + return err + } + } + if m.Left != nil { + if err := m.Left.ValidateWithPath(path + "/Left"); err != nil { + return err + } + } + if m.Bottom != nil { + if err := m.Bottom.ValidateWithPath(path + "/Bottom"); err != nil { + return err + } + } + if m.End != nil { + if err := m.End.ValidateWithPath(path + "/End"); err != nil { + return err + } + } + if m.Right != nil { + if err := m.Right.ValidateWithPath(path + "/Right"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblGrid.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblGrid.go new file mode 100644 index 00000000..869722cb --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblGrid.go @@ -0,0 +1,100 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_TblGrid struct { + // Grid Column Definition + GridCol []*CT_TblGridCol + TblGridChange *CT_TblGridChange +} + +func NewCT_TblGrid() *CT_TblGrid { + ret := &CT_TblGrid{} + return ret +} + +func (m *CT_TblGrid) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.GridCol != nil { + segridCol := xml.StartElement{Name: xml.Name{Local: "w:gridCol"}} + for _, c := range m.GridCol { + e.EncodeElement(c, segridCol) + } + } + if m.TblGridChange != nil { + setblGridChange := xml.StartElement{Name: xml.Name{Local: "w:tblGridChange"}} + e.EncodeElement(m.TblGridChange, setblGridChange) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TblGrid) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_TblGrid: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "gridCol"}: + tmp := NewCT_TblGridCol() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.GridCol = append(m.GridCol, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblGridChange"}: + m.TblGridChange = NewCT_TblGridChange() + if err := d.DecodeElement(m.TblGridChange, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_TblGrid %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TblGrid + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TblGrid and its children +func (m *CT_TblGrid) Validate() error { + return m.ValidateWithPath("CT_TblGrid") +} + +// ValidateWithPath validates the CT_TblGrid and its children, prefixing error messages with path +func (m *CT_TblGrid) ValidateWithPath(path string) error { + for i, v := range m.GridCol { + if err := v.ValidateWithPath(fmt.Sprintf("%s/GridCol[%d]", path, i)); err != nil { + return err + } + } + if m.TblGridChange != nil { + if err := m.TblGridChange.ValidateWithPath(path + "/TblGridChange"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblGridBase.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblGridBase.go new file mode 100644 index 00000000..ecebca34 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblGridBase.go @@ -0,0 +1,85 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_TblGridBase struct { + // Grid Column Definition + GridCol []*CT_TblGridCol +} + +func NewCT_TblGridBase() *CT_TblGridBase { + ret := &CT_TblGridBase{} + return ret +} + +func (m *CT_TblGridBase) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.GridCol != nil { + segridCol := xml.StartElement{Name: xml.Name{Local: "w:gridCol"}} + for _, c := range m.GridCol { + e.EncodeElement(c, segridCol) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TblGridBase) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_TblGridBase: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "gridCol"}: + tmp := NewCT_TblGridCol() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.GridCol = append(m.GridCol, tmp) + default: + gooxml.Log("skipping unsupported element on CT_TblGridBase %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TblGridBase + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TblGridBase and its children +func (m *CT_TblGridBase) Validate() error { + return m.ValidateWithPath("CT_TblGridBase") +} + +// ValidateWithPath validates the CT_TblGridBase and its children, prefixing error messages with path +func (m *CT_TblGridBase) ValidateWithPath(path string) error { + for i, v := range m.GridCol { + if err := v.ValidateWithPath(fmt.Sprintf("%s/GridCol[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblGridChange.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblGridChange.go new file mode 100644 index 00000000..bd08b6ac --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblGridChange.go @@ -0,0 +1,93 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type CT_TblGridChange struct { + // Annotation Identifier + IdAttr int64 + TblGrid *CT_TblGridBase +} + +func NewCT_TblGridChange() *CT_TblGridChange { + ret := &CT_TblGridChange{} + ret.TblGrid = NewCT_TblGridBase() + return ret +} + +func (m *CT_TblGridChange) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:id"}, + Value: fmt.Sprintf("%v", m.IdAttr)}) + e.EncodeToken(start) + setblGrid := xml.StartElement{Name: xml.Name{Local: "w:tblGrid"}} + e.EncodeElement(m.TblGrid, setblGrid) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TblGridChange) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.TblGrid = NewCT_TblGridBase() + for _, attr := range start.Attr { + if attr.Name.Local == "id" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.IdAttr = parsed + continue + } + } +lCT_TblGridChange: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblGrid"}: + if err := d.DecodeElement(m.TblGrid, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_TblGridChange %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TblGridChange + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TblGridChange and its children +func (m *CT_TblGridChange) Validate() error { + return m.ValidateWithPath("CT_TblGridChange") +} + +// ValidateWithPath validates the CT_TblGridChange and its children, prefixing error messages with path +func (m *CT_TblGridChange) ValidateWithPath(path string) error { + if err := m.TblGrid.ValidateWithPath(path + "/TblGrid"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblGridCol.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblGridCol.go new file mode 100644 index 00000000..8e233d7c --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblGridCol.go @@ -0,0 +1,77 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_TblGridCol struct { + // Grid Column Width + WAttr *sharedTypes.ST_TwipsMeasure +} + +func NewCT_TblGridCol() *CT_TblGridCol { + ret := &CT_TblGridCol{} + return ret +} + +func (m *CT_TblGridCol) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.WAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:w"}, + Value: fmt.Sprintf("%v", *m.WAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TblGridCol) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "w" { + parsed, err := ParseUnionST_TwipsMeasure(attr.Value) + if err != nil { + return err + } + m.WAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_TblGridCol: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_TblGridCol and its children +func (m *CT_TblGridCol) Validate() error { + return m.ValidateWithPath("CT_TblGridCol") +} + +// ValidateWithPath validates the CT_TblGridCol and its children, prefixing error messages with path +func (m *CT_TblGridCol) ValidateWithPath(path string) error { + if m.WAttr != nil { + if err := m.WAttr.ValidateWithPath(path + "/WAttr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblLayoutType.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblLayoutType.go new file mode 100644 index 00000000..e8378961 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblLayoutType.go @@ -0,0 +1,72 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_TblLayoutType struct { + // Table Layout Setting + TypeAttr ST_TblLayoutType +} + +func NewCT_TblLayoutType() *CT_TblLayoutType { + ret := &CT_TblLayoutType{} + return ret +} + +func (m *CT_TblLayoutType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.TypeAttr != ST_TblLayoutTypeUnset { + attr, err := m.TypeAttr.MarshalXMLAttr(xml.Name{Local: "w:type"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TblLayoutType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "type" { + m.TypeAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_TblLayoutType: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_TblLayoutType and its children +func (m *CT_TblLayoutType) Validate() error { + return m.ValidateWithPath("CT_TblLayoutType") +} + +// ValidateWithPath validates the CT_TblLayoutType and its children, prefixing error messages with path +func (m *CT_TblLayoutType) ValidateWithPath(path string) error { + if err := m.TypeAttr.ValidateWithPath(path + "/TypeAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblLook.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblLook.go new file mode 100644 index 00000000..fc46554d --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblLook.go @@ -0,0 +1,186 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_TblLook struct { + // First Row + FirstRowAttr *sharedTypes.ST_OnOff + // Last Row + LastRowAttr *sharedTypes.ST_OnOff + // First Column + FirstColumnAttr *sharedTypes.ST_OnOff + // Last Column + LastColumnAttr *sharedTypes.ST_OnOff + // No Horizontal Banding + NoHBandAttr *sharedTypes.ST_OnOff + // No Vertical Banding + NoVBandAttr *sharedTypes.ST_OnOff + // Bitmask of Table Conditional Formatting + ValAttr *string +} + +func NewCT_TblLook() *CT_TblLook { + ret := &CT_TblLook{} + return ret +} + +func (m *CT_TblLook) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.FirstRowAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:firstRow"}, + Value: fmt.Sprintf("%v", *m.FirstRowAttr)}) + } + if m.LastRowAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:lastRow"}, + Value: fmt.Sprintf("%v", *m.LastRowAttr)}) + } + if m.FirstColumnAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:firstColumn"}, + Value: fmt.Sprintf("%v", *m.FirstColumnAttr)}) + } + if m.LastColumnAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:lastColumn"}, + Value: fmt.Sprintf("%v", *m.LastColumnAttr)}) + } + if m.NoHBandAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:noHBand"}, + Value: fmt.Sprintf("%v", *m.NoHBandAttr)}) + } + if m.NoVBandAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:noVBand"}, + Value: fmt.Sprintf("%v", *m.NoVBandAttr)}) + } + if m.ValAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:val"}, + Value: fmt.Sprintf("%v", *m.ValAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TblLook) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "firstRow" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.FirstRowAttr = &parsed + continue + } + if attr.Name.Local == "lastRow" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.LastRowAttr = &parsed + continue + } + if attr.Name.Local == "firstColumn" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.FirstColumnAttr = &parsed + continue + } + if attr.Name.Local == "lastColumn" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.LastColumnAttr = &parsed + continue + } + if attr.Name.Local == "noHBand" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.NoHBandAttr = &parsed + continue + } + if attr.Name.Local == "noVBand" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.NoVBandAttr = &parsed + continue + } + if attr.Name.Local == "val" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ValAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_TblLook: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_TblLook and its children +func (m *CT_TblLook) Validate() error { + return m.ValidateWithPath("CT_TblLook") +} + +// ValidateWithPath validates the CT_TblLook and its children, prefixing error messages with path +func (m *CT_TblLook) ValidateWithPath(path string) error { + if m.FirstRowAttr != nil { + if err := m.FirstRowAttr.ValidateWithPath(path + "/FirstRowAttr"); err != nil { + return err + } + } + if m.LastRowAttr != nil { + if err := m.LastRowAttr.ValidateWithPath(path + "/LastRowAttr"); err != nil { + return err + } + } + if m.FirstColumnAttr != nil { + if err := m.FirstColumnAttr.ValidateWithPath(path + "/FirstColumnAttr"); err != nil { + return err + } + } + if m.LastColumnAttr != nil { + if err := m.LastColumnAttr.ValidateWithPath(path + "/LastColumnAttr"); err != nil { + return err + } + } + if m.NoHBandAttr != nil { + if err := m.NoHBandAttr.ValidateWithPath(path + "/NoHBandAttr"); err != nil { + return err + } + } + if m.NoVBandAttr != nil { + if err := m.NoVBandAttr.ValidateWithPath(path + "/NoVBandAttr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblOverlap.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblOverlap.go new file mode 100644 index 00000000..c7d5a22d --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblOverlap.go @@ -0,0 +1,75 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_TblOverlap struct { + // Floating Table Overlap Setting + ValAttr ST_TblOverlap +} + +func NewCT_TblOverlap() *CT_TblOverlap { + ret := &CT_TblOverlap{} + ret.ValAttr = ST_TblOverlap(1) + return ret +} + +func (m *CT_TblOverlap) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TblOverlap) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_TblOverlap(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_TblOverlap: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_TblOverlap and its children +func (m *CT_TblOverlap) Validate() error { + return m.ValidateWithPath("CT_TblOverlap") +} + +// ValidateWithPath validates the CT_TblOverlap and its children, prefixing error messages with path +func (m *CT_TblOverlap) ValidateWithPath(path string) error { + if m.ValAttr == ST_TblOverlapUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblPPr.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblPPr.go new file mode 100644 index 00000000..86731214 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblPPr.go @@ -0,0 +1,236 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_TblPPr struct { + // Distance From Left of Table to Text + LeftFromTextAttr *sharedTypes.ST_TwipsMeasure + // (Distance From Right of Table to Text + RightFromTextAttr *sharedTypes.ST_TwipsMeasure + // Distance From Top of Table to Text + TopFromTextAttr *sharedTypes.ST_TwipsMeasure + // Distance From Bottom of Table to Text + BottomFromTextAttr *sharedTypes.ST_TwipsMeasure + // Table Vertical Anchor + VertAnchorAttr ST_VAnchor + // Table Horizontal Anchor + HorzAnchorAttr ST_HAnchor + // Relative Horizontal Alignment From Anchor + TblpXSpecAttr sharedTypes.ST_XAlign + // Absolute Horizontal Distance From Anchor + TblpXAttr *ST_SignedTwipsMeasure + // Relative Vertical Alignment from Anchor + TblpYSpecAttr sharedTypes.ST_YAlign + // Absolute Vertical Distance From Anchor + TblpYAttr *ST_SignedTwipsMeasure +} + +func NewCT_TblPPr() *CT_TblPPr { + ret := &CT_TblPPr{} + return ret +} + +func (m *CT_TblPPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.LeftFromTextAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:leftFromText"}, + Value: fmt.Sprintf("%v", *m.LeftFromTextAttr)}) + } + if m.RightFromTextAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:rightFromText"}, + Value: fmt.Sprintf("%v", *m.RightFromTextAttr)}) + } + if m.TopFromTextAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:topFromText"}, + Value: fmt.Sprintf("%v", *m.TopFromTextAttr)}) + } + if m.BottomFromTextAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:bottomFromText"}, + Value: fmt.Sprintf("%v", *m.BottomFromTextAttr)}) + } + if m.VertAnchorAttr != ST_VAnchorUnset { + attr, err := m.VertAnchorAttr.MarshalXMLAttr(xml.Name{Local: "w:vertAnchor"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.HorzAnchorAttr != ST_HAnchorUnset { + attr, err := m.HorzAnchorAttr.MarshalXMLAttr(xml.Name{Local: "w:horzAnchor"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.TblpXSpecAttr != sharedTypes.ST_XAlignUnset { + attr, err := m.TblpXSpecAttr.MarshalXMLAttr(xml.Name{Local: "w:tblpXSpec"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.TblpXAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:tblpX"}, + Value: fmt.Sprintf("%v", *m.TblpXAttr)}) + } + if m.TblpYSpecAttr != sharedTypes.ST_YAlignUnset { + attr, err := m.TblpYSpecAttr.MarshalXMLAttr(xml.Name{Local: "w:tblpYSpec"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.TblpYAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:tblpY"}, + Value: fmt.Sprintf("%v", *m.TblpYAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TblPPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "leftFromText" { + parsed, err := ParseUnionST_TwipsMeasure(attr.Value) + if err != nil { + return err + } + m.LeftFromTextAttr = &parsed + continue + } + if attr.Name.Local == "rightFromText" { + parsed, err := ParseUnionST_TwipsMeasure(attr.Value) + if err != nil { + return err + } + m.RightFromTextAttr = &parsed + continue + } + if attr.Name.Local == "topFromText" { + parsed, err := ParseUnionST_TwipsMeasure(attr.Value) + if err != nil { + return err + } + m.TopFromTextAttr = &parsed + continue + } + if attr.Name.Local == "bottomFromText" { + parsed, err := ParseUnionST_TwipsMeasure(attr.Value) + if err != nil { + return err + } + m.BottomFromTextAttr = &parsed + continue + } + if attr.Name.Local == "vertAnchor" { + m.VertAnchorAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "horzAnchor" { + m.HorzAnchorAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "tblpXSpec" { + m.TblpXSpecAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "tblpX" { + parsed, err := ParseUnionST_SignedTwipsMeasure(attr.Value) + if err != nil { + return err + } + m.TblpXAttr = &parsed + continue + } + if attr.Name.Local == "tblpYSpec" { + m.TblpYSpecAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "tblpY" { + parsed, err := ParseUnionST_SignedTwipsMeasure(attr.Value) + if err != nil { + return err + } + m.TblpYAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_TblPPr: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_TblPPr and its children +func (m *CT_TblPPr) Validate() error { + return m.ValidateWithPath("CT_TblPPr") +} + +// ValidateWithPath validates the CT_TblPPr and its children, prefixing error messages with path +func (m *CT_TblPPr) ValidateWithPath(path string) error { + if m.LeftFromTextAttr != nil { + if err := m.LeftFromTextAttr.ValidateWithPath(path + "/LeftFromTextAttr"); err != nil { + return err + } + } + if m.RightFromTextAttr != nil { + if err := m.RightFromTextAttr.ValidateWithPath(path + "/RightFromTextAttr"); err != nil { + return err + } + } + if m.TopFromTextAttr != nil { + if err := m.TopFromTextAttr.ValidateWithPath(path + "/TopFromTextAttr"); err != nil { + return err + } + } + if m.BottomFromTextAttr != nil { + if err := m.BottomFromTextAttr.ValidateWithPath(path + "/BottomFromTextAttr"); err != nil { + return err + } + } + if err := m.VertAnchorAttr.ValidateWithPath(path + "/VertAnchorAttr"); err != nil { + return err + } + if err := m.HorzAnchorAttr.ValidateWithPath(path + "/HorzAnchorAttr"); err != nil { + return err + } + if err := m.TblpXSpecAttr.ValidateWithPath(path + "/TblpXSpecAttr"); err != nil { + return err + } + if m.TblpXAttr != nil { + if err := m.TblpXAttr.ValidateWithPath(path + "/TblpXAttr"); err != nil { + return err + } + } + if err := m.TblpYSpecAttr.ValidateWithPath(path + "/TblpYSpecAttr"); err != nil { + return err + } + if m.TblpYAttr != nil { + if err := m.TblpYAttr.ValidateWithPath(path + "/TblpYAttr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblPr.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblPr.go new file mode 100644 index 00000000..a96c4b51 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblPr.go @@ -0,0 +1,352 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_TblPr struct { + // Referenced Table Style + TblStyle *CT_String + // Floating Table Positioning + TblpPr *CT_TblPPr + // Floating Table Allows Other Tables to Overlap + TblOverlap *CT_TblOverlap + // Visually Right to Left Table + BidiVisual *CT_OnOff + // Number of Rows in Row Band + TblStyleRowBandSize *CT_DecimalNumber + // Number of Columns in Column Band + TblStyleColBandSize *CT_DecimalNumber + // Preferred Table Width + TblW *CT_TblWidth + // Table Alignment + Jc *CT_JcTable + // Table Cell Spacing Default + TblCellSpacing *CT_TblWidth + // Table Indent from Leading Margin + TblInd *CT_TblWidth + // Table Borders + TblBorders *CT_TblBorders + // Table Shading + Shd *CT_Shd + // Table Layout + TblLayout *CT_TblLayoutType + // Table Cell Margin Defaults + TblCellMar *CT_TblCellMar + // Table Style Conditional Formatting Settings + TblLook *CT_TblLook + // Table Caption + TblCaption *CT_String + // Table Description + TblDescription *CT_String + TblPrChange *CT_TblPrChange +} + +func NewCT_TblPr() *CT_TblPr { + ret := &CT_TblPr{} + return ret +} + +func (m *CT_TblPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.TblStyle != nil { + setblStyle := xml.StartElement{Name: xml.Name{Local: "w:tblStyle"}} + e.EncodeElement(m.TblStyle, setblStyle) + } + if m.TblpPr != nil { + setblpPr := xml.StartElement{Name: xml.Name{Local: "w:tblpPr"}} + e.EncodeElement(m.TblpPr, setblpPr) + } + if m.TblOverlap != nil { + setblOverlap := xml.StartElement{Name: xml.Name{Local: "w:tblOverlap"}} + e.EncodeElement(m.TblOverlap, setblOverlap) + } + if m.BidiVisual != nil { + sebidiVisual := xml.StartElement{Name: xml.Name{Local: "w:bidiVisual"}} + e.EncodeElement(m.BidiVisual, sebidiVisual) + } + if m.TblStyleRowBandSize != nil { + setblStyleRowBandSize := xml.StartElement{Name: xml.Name{Local: "w:tblStyleRowBandSize"}} + e.EncodeElement(m.TblStyleRowBandSize, setblStyleRowBandSize) + } + if m.TblStyleColBandSize != nil { + setblStyleColBandSize := xml.StartElement{Name: xml.Name{Local: "w:tblStyleColBandSize"}} + e.EncodeElement(m.TblStyleColBandSize, setblStyleColBandSize) + } + if m.TblW != nil { + setblW := xml.StartElement{Name: xml.Name{Local: "w:tblW"}} + e.EncodeElement(m.TblW, setblW) + } + if m.Jc != nil { + sejc := xml.StartElement{Name: xml.Name{Local: "w:jc"}} + e.EncodeElement(m.Jc, sejc) + } + if m.TblCellSpacing != nil { + setblCellSpacing := xml.StartElement{Name: xml.Name{Local: "w:tblCellSpacing"}} + e.EncodeElement(m.TblCellSpacing, setblCellSpacing) + } + if m.TblInd != nil { + setblInd := xml.StartElement{Name: xml.Name{Local: "w:tblInd"}} + e.EncodeElement(m.TblInd, setblInd) + } + if m.TblBorders != nil { + setblBorders := xml.StartElement{Name: xml.Name{Local: "w:tblBorders"}} + e.EncodeElement(m.TblBorders, setblBorders) + } + if m.Shd != nil { + seshd := xml.StartElement{Name: xml.Name{Local: "w:shd"}} + e.EncodeElement(m.Shd, seshd) + } + if m.TblLayout != nil { + setblLayout := xml.StartElement{Name: xml.Name{Local: "w:tblLayout"}} + e.EncodeElement(m.TblLayout, setblLayout) + } + if m.TblCellMar != nil { + setblCellMar := xml.StartElement{Name: xml.Name{Local: "w:tblCellMar"}} + e.EncodeElement(m.TblCellMar, setblCellMar) + } + if m.TblLook != nil { + setblLook := xml.StartElement{Name: xml.Name{Local: "w:tblLook"}} + e.EncodeElement(m.TblLook, setblLook) + } + if m.TblCaption != nil { + setblCaption := xml.StartElement{Name: xml.Name{Local: "w:tblCaption"}} + e.EncodeElement(m.TblCaption, setblCaption) + } + if m.TblDescription != nil { + setblDescription := xml.StartElement{Name: xml.Name{Local: "w:tblDescription"}} + e.EncodeElement(m.TblDescription, setblDescription) + } + if m.TblPrChange != nil { + setblPrChange := xml.StartElement{Name: xml.Name{Local: "w:tblPrChange"}} + e.EncodeElement(m.TblPrChange, setblPrChange) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TblPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_TblPr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblStyle"}: + m.TblStyle = NewCT_String() + if err := d.DecodeElement(m.TblStyle, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblpPr"}: + m.TblpPr = NewCT_TblPPr() + if err := d.DecodeElement(m.TblpPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblOverlap"}: + m.TblOverlap = NewCT_TblOverlap() + if err := d.DecodeElement(m.TblOverlap, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bidiVisual"}: + m.BidiVisual = NewCT_OnOff() + if err := d.DecodeElement(m.BidiVisual, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblStyleRowBandSize"}: + m.TblStyleRowBandSize = NewCT_DecimalNumber() + if err := d.DecodeElement(m.TblStyleRowBandSize, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblStyleColBandSize"}: + m.TblStyleColBandSize = NewCT_DecimalNumber() + if err := d.DecodeElement(m.TblStyleColBandSize, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblW"}: + m.TblW = NewCT_TblWidth() + if err := d.DecodeElement(m.TblW, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "jc"}: + m.Jc = NewCT_JcTable() + if err := d.DecodeElement(m.Jc, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblCellSpacing"}: + m.TblCellSpacing = NewCT_TblWidth() + if err := d.DecodeElement(m.TblCellSpacing, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblInd"}: + m.TblInd = NewCT_TblWidth() + if err := d.DecodeElement(m.TblInd, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblBorders"}: + m.TblBorders = NewCT_TblBorders() + if err := d.DecodeElement(m.TblBorders, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "shd"}: + m.Shd = NewCT_Shd() + if err := d.DecodeElement(m.Shd, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblLayout"}: + m.TblLayout = NewCT_TblLayoutType() + if err := d.DecodeElement(m.TblLayout, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblCellMar"}: + m.TblCellMar = NewCT_TblCellMar() + if err := d.DecodeElement(m.TblCellMar, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblLook"}: + m.TblLook = NewCT_TblLook() + if err := d.DecodeElement(m.TblLook, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblCaption"}: + m.TblCaption = NewCT_String() + if err := d.DecodeElement(m.TblCaption, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblDescription"}: + m.TblDescription = NewCT_String() + if err := d.DecodeElement(m.TblDescription, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblPrChange"}: + m.TblPrChange = NewCT_TblPrChange() + if err := d.DecodeElement(m.TblPrChange, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_TblPr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TblPr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TblPr and its children +func (m *CT_TblPr) Validate() error { + return m.ValidateWithPath("CT_TblPr") +} + +// ValidateWithPath validates the CT_TblPr and its children, prefixing error messages with path +func (m *CT_TblPr) ValidateWithPath(path string) error { + if m.TblStyle != nil { + if err := m.TblStyle.ValidateWithPath(path + "/TblStyle"); err != nil { + return err + } + } + if m.TblpPr != nil { + if err := m.TblpPr.ValidateWithPath(path + "/TblpPr"); err != nil { + return err + } + } + if m.TblOverlap != nil { + if err := m.TblOverlap.ValidateWithPath(path + "/TblOverlap"); err != nil { + return err + } + } + if m.BidiVisual != nil { + if err := m.BidiVisual.ValidateWithPath(path + "/BidiVisual"); err != nil { + return err + } + } + if m.TblStyleRowBandSize != nil { + if err := m.TblStyleRowBandSize.ValidateWithPath(path + "/TblStyleRowBandSize"); err != nil { + return err + } + } + if m.TblStyleColBandSize != nil { + if err := m.TblStyleColBandSize.ValidateWithPath(path + "/TblStyleColBandSize"); err != nil { + return err + } + } + if m.TblW != nil { + if err := m.TblW.ValidateWithPath(path + "/TblW"); err != nil { + return err + } + } + if m.Jc != nil { + if err := m.Jc.ValidateWithPath(path + "/Jc"); err != nil { + return err + } + } + if m.TblCellSpacing != nil { + if err := m.TblCellSpacing.ValidateWithPath(path + "/TblCellSpacing"); err != nil { + return err + } + } + if m.TblInd != nil { + if err := m.TblInd.ValidateWithPath(path + "/TblInd"); err != nil { + return err + } + } + if m.TblBorders != nil { + if err := m.TblBorders.ValidateWithPath(path + "/TblBorders"); err != nil { + return err + } + } + if m.Shd != nil { + if err := m.Shd.ValidateWithPath(path + "/Shd"); err != nil { + return err + } + } + if m.TblLayout != nil { + if err := m.TblLayout.ValidateWithPath(path + "/TblLayout"); err != nil { + return err + } + } + if m.TblCellMar != nil { + if err := m.TblCellMar.ValidateWithPath(path + "/TblCellMar"); err != nil { + return err + } + } + if m.TblLook != nil { + if err := m.TblLook.ValidateWithPath(path + "/TblLook"); err != nil { + return err + } + } + if m.TblCaption != nil { + if err := m.TblCaption.ValidateWithPath(path + "/TblCaption"); err != nil { + return err + } + } + if m.TblDescription != nil { + if err := m.TblDescription.ValidateWithPath(path + "/TblDescription"); err != nil { + return err + } + } + if m.TblPrChange != nil { + if err := m.TblPrChange.ValidateWithPath(path + "/TblPrChange"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblPrBase.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblPrBase.go new file mode 100644 index 00000000..11bb06b1 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblPrBase.go @@ -0,0 +1,337 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_TblPrBase struct { + // Referenced Table Style + TblStyle *CT_String + // Floating Table Positioning + TblpPr *CT_TblPPr + // Floating Table Allows Other Tables to Overlap + TblOverlap *CT_TblOverlap + // Visually Right to Left Table + BidiVisual *CT_OnOff + // Number of Rows in Row Band + TblStyleRowBandSize *CT_DecimalNumber + // Number of Columns in Column Band + TblStyleColBandSize *CT_DecimalNumber + // Preferred Table Width + TblW *CT_TblWidth + // Table Alignment + Jc *CT_JcTable + // Table Cell Spacing Default + TblCellSpacing *CT_TblWidth + // Table Indent from Leading Margin + TblInd *CT_TblWidth + // Table Borders + TblBorders *CT_TblBorders + // Table Shading + Shd *CT_Shd + // Table Layout + TblLayout *CT_TblLayoutType + // Table Cell Margin Defaults + TblCellMar *CT_TblCellMar + // Table Style Conditional Formatting Settings + TblLook *CT_TblLook + // Table Caption + TblCaption *CT_String + // Table Description + TblDescription *CT_String +} + +func NewCT_TblPrBase() *CT_TblPrBase { + ret := &CT_TblPrBase{} + return ret +} + +func (m *CT_TblPrBase) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.TblStyle != nil { + setblStyle := xml.StartElement{Name: xml.Name{Local: "w:tblStyle"}} + e.EncodeElement(m.TblStyle, setblStyle) + } + if m.TblpPr != nil { + setblpPr := xml.StartElement{Name: xml.Name{Local: "w:tblpPr"}} + e.EncodeElement(m.TblpPr, setblpPr) + } + if m.TblOverlap != nil { + setblOverlap := xml.StartElement{Name: xml.Name{Local: "w:tblOverlap"}} + e.EncodeElement(m.TblOverlap, setblOverlap) + } + if m.BidiVisual != nil { + sebidiVisual := xml.StartElement{Name: xml.Name{Local: "w:bidiVisual"}} + e.EncodeElement(m.BidiVisual, sebidiVisual) + } + if m.TblStyleRowBandSize != nil { + setblStyleRowBandSize := xml.StartElement{Name: xml.Name{Local: "w:tblStyleRowBandSize"}} + e.EncodeElement(m.TblStyleRowBandSize, setblStyleRowBandSize) + } + if m.TblStyleColBandSize != nil { + setblStyleColBandSize := xml.StartElement{Name: xml.Name{Local: "w:tblStyleColBandSize"}} + e.EncodeElement(m.TblStyleColBandSize, setblStyleColBandSize) + } + if m.TblW != nil { + setblW := xml.StartElement{Name: xml.Name{Local: "w:tblW"}} + e.EncodeElement(m.TblW, setblW) + } + if m.Jc != nil { + sejc := xml.StartElement{Name: xml.Name{Local: "w:jc"}} + e.EncodeElement(m.Jc, sejc) + } + if m.TblCellSpacing != nil { + setblCellSpacing := xml.StartElement{Name: xml.Name{Local: "w:tblCellSpacing"}} + e.EncodeElement(m.TblCellSpacing, setblCellSpacing) + } + if m.TblInd != nil { + setblInd := xml.StartElement{Name: xml.Name{Local: "w:tblInd"}} + e.EncodeElement(m.TblInd, setblInd) + } + if m.TblBorders != nil { + setblBorders := xml.StartElement{Name: xml.Name{Local: "w:tblBorders"}} + e.EncodeElement(m.TblBorders, setblBorders) + } + if m.Shd != nil { + seshd := xml.StartElement{Name: xml.Name{Local: "w:shd"}} + e.EncodeElement(m.Shd, seshd) + } + if m.TblLayout != nil { + setblLayout := xml.StartElement{Name: xml.Name{Local: "w:tblLayout"}} + e.EncodeElement(m.TblLayout, setblLayout) + } + if m.TblCellMar != nil { + setblCellMar := xml.StartElement{Name: xml.Name{Local: "w:tblCellMar"}} + e.EncodeElement(m.TblCellMar, setblCellMar) + } + if m.TblLook != nil { + setblLook := xml.StartElement{Name: xml.Name{Local: "w:tblLook"}} + e.EncodeElement(m.TblLook, setblLook) + } + if m.TblCaption != nil { + setblCaption := xml.StartElement{Name: xml.Name{Local: "w:tblCaption"}} + e.EncodeElement(m.TblCaption, setblCaption) + } + if m.TblDescription != nil { + setblDescription := xml.StartElement{Name: xml.Name{Local: "w:tblDescription"}} + e.EncodeElement(m.TblDescription, setblDescription) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TblPrBase) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_TblPrBase: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblStyle"}: + m.TblStyle = NewCT_String() + if err := d.DecodeElement(m.TblStyle, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblpPr"}: + m.TblpPr = NewCT_TblPPr() + if err := d.DecodeElement(m.TblpPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblOverlap"}: + m.TblOverlap = NewCT_TblOverlap() + if err := d.DecodeElement(m.TblOverlap, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bidiVisual"}: + m.BidiVisual = NewCT_OnOff() + if err := d.DecodeElement(m.BidiVisual, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblStyleRowBandSize"}: + m.TblStyleRowBandSize = NewCT_DecimalNumber() + if err := d.DecodeElement(m.TblStyleRowBandSize, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblStyleColBandSize"}: + m.TblStyleColBandSize = NewCT_DecimalNumber() + if err := d.DecodeElement(m.TblStyleColBandSize, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblW"}: + m.TblW = NewCT_TblWidth() + if err := d.DecodeElement(m.TblW, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "jc"}: + m.Jc = NewCT_JcTable() + if err := d.DecodeElement(m.Jc, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblCellSpacing"}: + m.TblCellSpacing = NewCT_TblWidth() + if err := d.DecodeElement(m.TblCellSpacing, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblInd"}: + m.TblInd = NewCT_TblWidth() + if err := d.DecodeElement(m.TblInd, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblBorders"}: + m.TblBorders = NewCT_TblBorders() + if err := d.DecodeElement(m.TblBorders, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "shd"}: + m.Shd = NewCT_Shd() + if err := d.DecodeElement(m.Shd, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblLayout"}: + m.TblLayout = NewCT_TblLayoutType() + if err := d.DecodeElement(m.TblLayout, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblCellMar"}: + m.TblCellMar = NewCT_TblCellMar() + if err := d.DecodeElement(m.TblCellMar, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblLook"}: + m.TblLook = NewCT_TblLook() + if err := d.DecodeElement(m.TblLook, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblCaption"}: + m.TblCaption = NewCT_String() + if err := d.DecodeElement(m.TblCaption, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblDescription"}: + m.TblDescription = NewCT_String() + if err := d.DecodeElement(m.TblDescription, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_TblPrBase %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TblPrBase + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TblPrBase and its children +func (m *CT_TblPrBase) Validate() error { + return m.ValidateWithPath("CT_TblPrBase") +} + +// ValidateWithPath validates the CT_TblPrBase and its children, prefixing error messages with path +func (m *CT_TblPrBase) ValidateWithPath(path string) error { + if m.TblStyle != nil { + if err := m.TblStyle.ValidateWithPath(path + "/TblStyle"); err != nil { + return err + } + } + if m.TblpPr != nil { + if err := m.TblpPr.ValidateWithPath(path + "/TblpPr"); err != nil { + return err + } + } + if m.TblOverlap != nil { + if err := m.TblOverlap.ValidateWithPath(path + "/TblOverlap"); err != nil { + return err + } + } + if m.BidiVisual != nil { + if err := m.BidiVisual.ValidateWithPath(path + "/BidiVisual"); err != nil { + return err + } + } + if m.TblStyleRowBandSize != nil { + if err := m.TblStyleRowBandSize.ValidateWithPath(path + "/TblStyleRowBandSize"); err != nil { + return err + } + } + if m.TblStyleColBandSize != nil { + if err := m.TblStyleColBandSize.ValidateWithPath(path + "/TblStyleColBandSize"); err != nil { + return err + } + } + if m.TblW != nil { + if err := m.TblW.ValidateWithPath(path + "/TblW"); err != nil { + return err + } + } + if m.Jc != nil { + if err := m.Jc.ValidateWithPath(path + "/Jc"); err != nil { + return err + } + } + if m.TblCellSpacing != nil { + if err := m.TblCellSpacing.ValidateWithPath(path + "/TblCellSpacing"); err != nil { + return err + } + } + if m.TblInd != nil { + if err := m.TblInd.ValidateWithPath(path + "/TblInd"); err != nil { + return err + } + } + if m.TblBorders != nil { + if err := m.TblBorders.ValidateWithPath(path + "/TblBorders"); err != nil { + return err + } + } + if m.Shd != nil { + if err := m.Shd.ValidateWithPath(path + "/Shd"); err != nil { + return err + } + } + if m.TblLayout != nil { + if err := m.TblLayout.ValidateWithPath(path + "/TblLayout"); err != nil { + return err + } + } + if m.TblCellMar != nil { + if err := m.TblCellMar.ValidateWithPath(path + "/TblCellMar"); err != nil { + return err + } + } + if m.TblLook != nil { + if err := m.TblLook.ValidateWithPath(path + "/TblLook"); err != nil { + return err + } + } + if m.TblCaption != nil { + if err := m.TblCaption.ValidateWithPath(path + "/TblCaption"); err != nil { + return err + } + } + if m.TblDescription != nil { + if err := m.TblDescription.ValidateWithPath(path + "/TblDescription"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblPrChange.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblPrChange.go new file mode 100644 index 00000000..841c1d4c --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblPrChange.go @@ -0,0 +1,118 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + "time" + + "baliance.com/gooxml" +) + +type CT_TblPrChange struct { + AuthorAttr string + DateAttr *time.Time + // Annotation Identifier + IdAttr int64 + TblPr *CT_TblPrBase +} + +func NewCT_TblPrChange() *CT_TblPrChange { + ret := &CT_TblPrChange{} + ret.TblPr = NewCT_TblPrBase() + return ret +} + +func (m *CT_TblPrChange) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:author"}, + Value: fmt.Sprintf("%v", m.AuthorAttr)}) + if m.DateAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:date"}, + Value: fmt.Sprintf("%v", *m.DateAttr)}) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:id"}, + Value: fmt.Sprintf("%v", m.IdAttr)}) + e.EncodeToken(start) + setblPr := xml.StartElement{Name: xml.Name{Local: "w:tblPr"}} + e.EncodeElement(m.TblPr, setblPr) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TblPrChange) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.TblPr = NewCT_TblPrBase() + for _, attr := range start.Attr { + if attr.Name.Local == "author" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.AuthorAttr = parsed + continue + } + if attr.Name.Local == "date" { + parsed, err := ParseStdlibTime(attr.Value) + if err != nil { + return err + } + m.DateAttr = &parsed + continue + } + if attr.Name.Local == "id" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.IdAttr = parsed + continue + } + } +lCT_TblPrChange: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblPr"}: + if err := d.DecodeElement(m.TblPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_TblPrChange %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TblPrChange + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TblPrChange and its children +func (m *CT_TblPrChange) Validate() error { + return m.ValidateWithPath("CT_TblPrChange") +} + +// ValidateWithPath validates the CT_TblPrChange and its children, prefixing error messages with path +func (m *CT_TblPrChange) ValidateWithPath(path string) error { + if err := m.TblPr.ValidateWithPath(path + "/TblPr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblPrEx.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblPrEx.go new file mode 100644 index 00000000..2d4f430b --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblPrEx.go @@ -0,0 +1,224 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_TblPrEx struct { + // Preferred Table Width Exception + TblW *CT_TblWidth + // Table Alignment Exception + Jc *CT_JcTable + // Table Cell Spacing Exception + TblCellSpacing *CT_TblWidth + // Table Indent from Leading Margin Exception + TblInd *CT_TblWidth + // Table Borders Exceptions + TblBorders *CT_TblBorders + // Table Shading Exception + Shd *CT_Shd + // Table Layout Exception + TblLayout *CT_TblLayoutType + // Table Cell Margin Exceptions + TblCellMar *CT_TblCellMar + // Table Style Conditional Formatting Settings Exception + TblLook *CT_TblLook + TblPrExChange *CT_TblPrExChange +} + +func NewCT_TblPrEx() *CT_TblPrEx { + ret := &CT_TblPrEx{} + return ret +} + +func (m *CT_TblPrEx) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.TblW != nil { + setblW := xml.StartElement{Name: xml.Name{Local: "w:tblW"}} + e.EncodeElement(m.TblW, setblW) + } + if m.Jc != nil { + sejc := xml.StartElement{Name: xml.Name{Local: "w:jc"}} + e.EncodeElement(m.Jc, sejc) + } + if m.TblCellSpacing != nil { + setblCellSpacing := xml.StartElement{Name: xml.Name{Local: "w:tblCellSpacing"}} + e.EncodeElement(m.TblCellSpacing, setblCellSpacing) + } + if m.TblInd != nil { + setblInd := xml.StartElement{Name: xml.Name{Local: "w:tblInd"}} + e.EncodeElement(m.TblInd, setblInd) + } + if m.TblBorders != nil { + setblBorders := xml.StartElement{Name: xml.Name{Local: "w:tblBorders"}} + e.EncodeElement(m.TblBorders, setblBorders) + } + if m.Shd != nil { + seshd := xml.StartElement{Name: xml.Name{Local: "w:shd"}} + e.EncodeElement(m.Shd, seshd) + } + if m.TblLayout != nil { + setblLayout := xml.StartElement{Name: xml.Name{Local: "w:tblLayout"}} + e.EncodeElement(m.TblLayout, setblLayout) + } + if m.TblCellMar != nil { + setblCellMar := xml.StartElement{Name: xml.Name{Local: "w:tblCellMar"}} + e.EncodeElement(m.TblCellMar, setblCellMar) + } + if m.TblLook != nil { + setblLook := xml.StartElement{Name: xml.Name{Local: "w:tblLook"}} + e.EncodeElement(m.TblLook, setblLook) + } + if m.TblPrExChange != nil { + setblPrExChange := xml.StartElement{Name: xml.Name{Local: "w:tblPrExChange"}} + e.EncodeElement(m.TblPrExChange, setblPrExChange) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TblPrEx) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_TblPrEx: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblW"}: + m.TblW = NewCT_TblWidth() + if err := d.DecodeElement(m.TblW, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "jc"}: + m.Jc = NewCT_JcTable() + if err := d.DecodeElement(m.Jc, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblCellSpacing"}: + m.TblCellSpacing = NewCT_TblWidth() + if err := d.DecodeElement(m.TblCellSpacing, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblInd"}: + m.TblInd = NewCT_TblWidth() + if err := d.DecodeElement(m.TblInd, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblBorders"}: + m.TblBorders = NewCT_TblBorders() + if err := d.DecodeElement(m.TblBorders, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "shd"}: + m.Shd = NewCT_Shd() + if err := d.DecodeElement(m.Shd, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblLayout"}: + m.TblLayout = NewCT_TblLayoutType() + if err := d.DecodeElement(m.TblLayout, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblCellMar"}: + m.TblCellMar = NewCT_TblCellMar() + if err := d.DecodeElement(m.TblCellMar, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblLook"}: + m.TblLook = NewCT_TblLook() + if err := d.DecodeElement(m.TblLook, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblPrExChange"}: + m.TblPrExChange = NewCT_TblPrExChange() + if err := d.DecodeElement(m.TblPrExChange, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_TblPrEx %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TblPrEx + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TblPrEx and its children +func (m *CT_TblPrEx) Validate() error { + return m.ValidateWithPath("CT_TblPrEx") +} + +// ValidateWithPath validates the CT_TblPrEx and its children, prefixing error messages with path +func (m *CT_TblPrEx) ValidateWithPath(path string) error { + if m.TblW != nil { + if err := m.TblW.ValidateWithPath(path + "/TblW"); err != nil { + return err + } + } + if m.Jc != nil { + if err := m.Jc.ValidateWithPath(path + "/Jc"); err != nil { + return err + } + } + if m.TblCellSpacing != nil { + if err := m.TblCellSpacing.ValidateWithPath(path + "/TblCellSpacing"); err != nil { + return err + } + } + if m.TblInd != nil { + if err := m.TblInd.ValidateWithPath(path + "/TblInd"); err != nil { + return err + } + } + if m.TblBorders != nil { + if err := m.TblBorders.ValidateWithPath(path + "/TblBorders"); err != nil { + return err + } + } + if m.Shd != nil { + if err := m.Shd.ValidateWithPath(path + "/Shd"); err != nil { + return err + } + } + if m.TblLayout != nil { + if err := m.TblLayout.ValidateWithPath(path + "/TblLayout"); err != nil { + return err + } + } + if m.TblCellMar != nil { + if err := m.TblCellMar.ValidateWithPath(path + "/TblCellMar"); err != nil { + return err + } + } + if m.TblLook != nil { + if err := m.TblLook.ValidateWithPath(path + "/TblLook"); err != nil { + return err + } + } + if m.TblPrExChange != nil { + if err := m.TblPrExChange.ValidateWithPath(path + "/TblPrExChange"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblPrExBase.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblPrExBase.go new file mode 100644 index 00000000..0c000ad4 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblPrExBase.go @@ -0,0 +1,209 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_TblPrExBase struct { + // Preferred Table Width Exception + TblW *CT_TblWidth + // Table Alignment Exception + Jc *CT_JcTable + // Table Cell Spacing Exception + TblCellSpacing *CT_TblWidth + // Table Indent from Leading Margin Exception + TblInd *CT_TblWidth + // Table Borders Exceptions + TblBorders *CT_TblBorders + // Table Shading Exception + Shd *CT_Shd + // Table Layout Exception + TblLayout *CT_TblLayoutType + // Table Cell Margin Exceptions + TblCellMar *CT_TblCellMar + // Table Style Conditional Formatting Settings Exception + TblLook *CT_TblLook +} + +func NewCT_TblPrExBase() *CT_TblPrExBase { + ret := &CT_TblPrExBase{} + return ret +} + +func (m *CT_TblPrExBase) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.TblW != nil { + setblW := xml.StartElement{Name: xml.Name{Local: "w:tblW"}} + e.EncodeElement(m.TblW, setblW) + } + if m.Jc != nil { + sejc := xml.StartElement{Name: xml.Name{Local: "w:jc"}} + e.EncodeElement(m.Jc, sejc) + } + if m.TblCellSpacing != nil { + setblCellSpacing := xml.StartElement{Name: xml.Name{Local: "w:tblCellSpacing"}} + e.EncodeElement(m.TblCellSpacing, setblCellSpacing) + } + if m.TblInd != nil { + setblInd := xml.StartElement{Name: xml.Name{Local: "w:tblInd"}} + e.EncodeElement(m.TblInd, setblInd) + } + if m.TblBorders != nil { + setblBorders := xml.StartElement{Name: xml.Name{Local: "w:tblBorders"}} + e.EncodeElement(m.TblBorders, setblBorders) + } + if m.Shd != nil { + seshd := xml.StartElement{Name: xml.Name{Local: "w:shd"}} + e.EncodeElement(m.Shd, seshd) + } + if m.TblLayout != nil { + setblLayout := xml.StartElement{Name: xml.Name{Local: "w:tblLayout"}} + e.EncodeElement(m.TblLayout, setblLayout) + } + if m.TblCellMar != nil { + setblCellMar := xml.StartElement{Name: xml.Name{Local: "w:tblCellMar"}} + e.EncodeElement(m.TblCellMar, setblCellMar) + } + if m.TblLook != nil { + setblLook := xml.StartElement{Name: xml.Name{Local: "w:tblLook"}} + e.EncodeElement(m.TblLook, setblLook) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TblPrExBase) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_TblPrExBase: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblW"}: + m.TblW = NewCT_TblWidth() + if err := d.DecodeElement(m.TblW, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "jc"}: + m.Jc = NewCT_JcTable() + if err := d.DecodeElement(m.Jc, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblCellSpacing"}: + m.TblCellSpacing = NewCT_TblWidth() + if err := d.DecodeElement(m.TblCellSpacing, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblInd"}: + m.TblInd = NewCT_TblWidth() + if err := d.DecodeElement(m.TblInd, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblBorders"}: + m.TblBorders = NewCT_TblBorders() + if err := d.DecodeElement(m.TblBorders, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "shd"}: + m.Shd = NewCT_Shd() + if err := d.DecodeElement(m.Shd, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblLayout"}: + m.TblLayout = NewCT_TblLayoutType() + if err := d.DecodeElement(m.TblLayout, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblCellMar"}: + m.TblCellMar = NewCT_TblCellMar() + if err := d.DecodeElement(m.TblCellMar, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblLook"}: + m.TblLook = NewCT_TblLook() + if err := d.DecodeElement(m.TblLook, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_TblPrExBase %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TblPrExBase + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TblPrExBase and its children +func (m *CT_TblPrExBase) Validate() error { + return m.ValidateWithPath("CT_TblPrExBase") +} + +// ValidateWithPath validates the CT_TblPrExBase and its children, prefixing error messages with path +func (m *CT_TblPrExBase) ValidateWithPath(path string) error { + if m.TblW != nil { + if err := m.TblW.ValidateWithPath(path + "/TblW"); err != nil { + return err + } + } + if m.Jc != nil { + if err := m.Jc.ValidateWithPath(path + "/Jc"); err != nil { + return err + } + } + if m.TblCellSpacing != nil { + if err := m.TblCellSpacing.ValidateWithPath(path + "/TblCellSpacing"); err != nil { + return err + } + } + if m.TblInd != nil { + if err := m.TblInd.ValidateWithPath(path + "/TblInd"); err != nil { + return err + } + } + if m.TblBorders != nil { + if err := m.TblBorders.ValidateWithPath(path + "/TblBorders"); err != nil { + return err + } + } + if m.Shd != nil { + if err := m.Shd.ValidateWithPath(path + "/Shd"); err != nil { + return err + } + } + if m.TblLayout != nil { + if err := m.TblLayout.ValidateWithPath(path + "/TblLayout"); err != nil { + return err + } + } + if m.TblCellMar != nil { + if err := m.TblCellMar.ValidateWithPath(path + "/TblCellMar"); err != nil { + return err + } + } + if m.TblLook != nil { + if err := m.TblLook.ValidateWithPath(path + "/TblLook"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblPrExChange.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblPrExChange.go new file mode 100644 index 00000000..03494b79 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblPrExChange.go @@ -0,0 +1,118 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + "time" + + "baliance.com/gooxml" +) + +type CT_TblPrExChange struct { + AuthorAttr string + DateAttr *time.Time + // Annotation Identifier + IdAttr int64 + TblPrEx *CT_TblPrExBase +} + +func NewCT_TblPrExChange() *CT_TblPrExChange { + ret := &CT_TblPrExChange{} + ret.TblPrEx = NewCT_TblPrExBase() + return ret +} + +func (m *CT_TblPrExChange) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:author"}, + Value: fmt.Sprintf("%v", m.AuthorAttr)}) + if m.DateAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:date"}, + Value: fmt.Sprintf("%v", *m.DateAttr)}) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:id"}, + Value: fmt.Sprintf("%v", m.IdAttr)}) + e.EncodeToken(start) + setblPrEx := xml.StartElement{Name: xml.Name{Local: "w:tblPrEx"}} + e.EncodeElement(m.TblPrEx, setblPrEx) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TblPrExChange) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.TblPrEx = NewCT_TblPrExBase() + for _, attr := range start.Attr { + if attr.Name.Local == "author" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.AuthorAttr = parsed + continue + } + if attr.Name.Local == "date" { + parsed, err := ParseStdlibTime(attr.Value) + if err != nil { + return err + } + m.DateAttr = &parsed + continue + } + if attr.Name.Local == "id" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.IdAttr = parsed + continue + } + } +lCT_TblPrExChange: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblPrEx"}: + if err := d.DecodeElement(m.TblPrEx, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_TblPrExChange %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TblPrExChange + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TblPrExChange and its children +func (m *CT_TblPrExChange) Validate() error { + return m.ValidateWithPath("CT_TblPrExChange") +} + +// ValidateWithPath validates the CT_TblPrExChange and its children, prefixing error messages with path +func (m *CT_TblPrExChange) ValidateWithPath(path string) error { + if err := m.TblPrEx.ValidateWithPath(path + "/TblPrEx"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblStylePr.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblStylePr.go new file mode 100644 index 00000000..d96dad80 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblStylePr.go @@ -0,0 +1,167 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_TblStylePr struct { + // Table Style Conditional Formatting Type + TypeAttr ST_TblStyleOverrideType + // Table Style Conditional Formatting Paragraph Properties + PPr *CT_PPrGeneral + // Table Style Conditional Formatting Run Properties + RPr *CT_RPr + // Table Style Conditional Formatting Table Properties + TblPr *CT_TblPrBase + // Table Style Conditional Formatting Table Row Properties + TrPr *CT_TrPr + // Table Style Conditional Formatting Table Cell Properties + TcPr *CT_TcPr +} + +func NewCT_TblStylePr() *CT_TblStylePr { + ret := &CT_TblStylePr{} + ret.TypeAttr = ST_TblStyleOverrideType(1) + return ret +} + +func (m *CT_TblStylePr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.TypeAttr.MarshalXMLAttr(xml.Name{Local: "w:type"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + if m.PPr != nil { + sepPr := xml.StartElement{Name: xml.Name{Local: "w:pPr"}} + e.EncodeElement(m.PPr, sepPr) + } + if m.RPr != nil { + serPr := xml.StartElement{Name: xml.Name{Local: "w:rPr"}} + e.EncodeElement(m.RPr, serPr) + } + if m.TblPr != nil { + setblPr := xml.StartElement{Name: xml.Name{Local: "w:tblPr"}} + e.EncodeElement(m.TblPr, setblPr) + } + if m.TrPr != nil { + setrPr := xml.StartElement{Name: xml.Name{Local: "w:trPr"}} + e.EncodeElement(m.TrPr, setrPr) + } + if m.TcPr != nil { + setcPr := xml.StartElement{Name: xml.Name{Local: "w:tcPr"}} + e.EncodeElement(m.TcPr, setcPr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TblStylePr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.TypeAttr = ST_TblStyleOverrideType(1) + for _, attr := range start.Attr { + if attr.Name.Local == "type" { + m.TypeAttr.UnmarshalXMLAttr(attr) + continue + } + } +lCT_TblStylePr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pPr"}: + m.PPr = NewCT_PPrGeneral() + if err := d.DecodeElement(m.PPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rPr"}: + m.RPr = NewCT_RPr() + if err := d.DecodeElement(m.RPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblPr"}: + m.TblPr = NewCT_TblPrBase() + if err := d.DecodeElement(m.TblPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "trPr"}: + m.TrPr = NewCT_TrPr() + if err := d.DecodeElement(m.TrPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tcPr"}: + m.TcPr = NewCT_TcPr() + if err := d.DecodeElement(m.TcPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_TblStylePr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TblStylePr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TblStylePr and its children +func (m *CT_TblStylePr) Validate() error { + return m.ValidateWithPath("CT_TblStylePr") +} + +// ValidateWithPath validates the CT_TblStylePr and its children, prefixing error messages with path +func (m *CT_TblStylePr) ValidateWithPath(path string) error { + if m.TypeAttr == ST_TblStyleOverrideTypeUnset { + return fmt.Errorf("%s/TypeAttr is a mandatory field", path) + } + if err := m.TypeAttr.ValidateWithPath(path + "/TypeAttr"); err != nil { + return err + } + if m.PPr != nil { + if err := m.PPr.ValidateWithPath(path + "/PPr"); err != nil { + return err + } + } + if m.RPr != nil { + if err := m.RPr.ValidateWithPath(path + "/RPr"); err != nil { + return err + } + } + if m.TblPr != nil { + if err := m.TblPr.ValidateWithPath(path + "/TblPr"); err != nil { + return err + } + } + if m.TrPr != nil { + if err := m.TrPr.ValidateWithPath(path + "/TrPr"); err != nil { + return err + } + } + if m.TcPr != nil { + if err := m.TcPr.ValidateWithPath(path + "/TcPr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblWidth.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblWidth.go new file mode 100644 index 00000000..1b2bd1c5 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TblWidth.go @@ -0,0 +1,91 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_TblWidth struct { + // Table Width Value + WAttr *ST_MeasurementOrPercent + // Table Width Type + TypeAttr ST_TblWidth +} + +func NewCT_TblWidth() *CT_TblWidth { + ret := &CT_TblWidth{} + return ret +} + +func (m *CT_TblWidth) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.WAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:w"}, + Value: fmt.Sprintf("%v", *m.WAttr)}) + } + if m.TypeAttr != ST_TblWidthUnset { + attr, err := m.TypeAttr.MarshalXMLAttr(xml.Name{Local: "w:type"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TblWidth) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "w" { + parsed, err := ParseUnionST_MeasurementOrPercent(attr.Value) + if err != nil { + return err + } + m.WAttr = &parsed + continue + } + if attr.Name.Local == "type" { + m.TypeAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_TblWidth: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_TblWidth and its children +func (m *CT_TblWidth) Validate() error { + return m.ValidateWithPath("CT_TblWidth") +} + +// ValidateWithPath validates the CT_TblWidth and its children, prefixing error messages with path +func (m *CT_TblWidth) ValidateWithPath(path string) error { + if m.WAttr != nil { + if err := m.WAttr.ValidateWithPath(path + "/WAttr"); err != nil { + return err + } + } + if err := m.TypeAttr.ValidateWithPath(path + "/TypeAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Tc.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Tc.go new file mode 100644 index 00000000..b97de0b4 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Tc.go @@ -0,0 +1,465 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/math" +) + +type CT_Tc struct { + // Table Cell Identifier + IdAttr *string + // Table Cell Properties + TcPr *CT_TcPr + EG_BlockLevelElts []*EG_BlockLevelElts +} + +func NewCT_Tc() *CT_Tc { + ret := &CT_Tc{} + return ret +} + +func (m *CT_Tc) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.IdAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:id"}, + Value: fmt.Sprintf("%v", *m.IdAttr)}) + } + e.EncodeToken(start) + if m.TcPr != nil { + setcPr := xml.StartElement{Name: xml.Name{Local: "w:tcPr"}} + e.EncodeElement(m.TcPr, setcPr) + } + for _, c := range m.EG_BlockLevelElts { + c.MarshalXML(e, xml.StartElement{}) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Tc) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "id" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.IdAttr = &parsed + continue + } + } +lCT_Tc: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tcPr"}: + m.TcPr = NewCT_TcPr() + if err := d.DecodeElement(m.TcPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "altChunk"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmp := NewCT_AltChunk() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + tmpblocklevelelts.AltChunk = append(tmpblocklevelelts.AltChunk, tmp) + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXml"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmpcontentblockcontent.CustomXml = NewCT_CustomXmlBlock() + if err := d.DecodeElement(tmpcontentblockcontent.CustomXml, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdt"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmpcontentblockcontent.Sdt = NewCT_SdtBlock() + if err := d.DecodeElement(tmpcontentblockcontent.Sdt, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "p"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmp := NewCT_P() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + tmpcontentblockcontent.P = append(tmpcontentblockcontent.P, tmp) + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tbl"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmp := NewCT_Tbl() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + tmpcontentblockcontent.Tbl = append(tmpcontentblockcontent.Tbl, tmp) + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "proofErr"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.ProofErr = NewCT_ProofErr() + if err := d.DecodeElement(tmprunlevelelts.ProofErr, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permStart"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermStart = NewCT_PermStart() + if err := d.DecodeElement(tmprunlevelelts.PermStart, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permEnd"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermEnd = NewCT_Perm() + if err := d.DecodeElement(tmprunlevelelts.PermEnd, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Ins = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Ins, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Del = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Del, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFrom"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveFrom = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveFrom, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveTo"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveTo = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveTo, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkStart"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkStart = NewCT_Bookmark() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkStart, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkEnd"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkEnd, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeStart"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeStart, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeEnd"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeStart"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeStart, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeEnd"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeEnd, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeStart"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeStart = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeStart, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeEnd"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeEnd, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeStart"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeStart, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeEnd"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeEnd, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeStart"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeStart, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeEnd"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeEnd, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeStart"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeStart, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeEnd"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeStart"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeStart, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeEnd"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeEnd, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMathPara"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMathPara = math.NewOMathPara() + if err := d.DecodeElement(tmpmathcontent.OMathPara, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMath"}: + tmpblocklevelelts := NewEG_BlockLevelElts() + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMath = math.NewOMath() + if err := d.DecodeElement(tmpmathcontent.OMath, &el); err != nil { + return err + } + m.EG_BlockLevelElts = append(m.EG_BlockLevelElts, tmpblocklevelelts) + tmpblocklevelelts.EG_ContentBlockContent = append(tmpblocklevelelts.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + default: + gooxml.Log("skipping unsupported element on CT_Tc %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_Tc + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_Tc and its children +func (m *CT_Tc) Validate() error { + return m.ValidateWithPath("CT_Tc") +} + +// ValidateWithPath validates the CT_Tc and its children, prefixing error messages with path +func (m *CT_Tc) ValidateWithPath(path string) error { + if m.TcPr != nil { + if err := m.TcPr.ValidateWithPath(path + "/TcPr"); err != nil { + return err + } + } + for i, v := range m.EG_BlockLevelElts { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_BlockLevelElts[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TcBorders.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TcBorders.go new file mode 100644 index 00000000..29c034e2 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TcBorders.go @@ -0,0 +1,225 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_TcBorders struct { + // Table Cell Top Border + Top *CT_Border + // Table Cell Leading Edge Border + Start *CT_Border + // Table Cell Leading Edge Border + Left *CT_Border + // Table Cell Bottom Border + Bottom *CT_Border + // Table Cell Trailing Edge Border + End *CT_Border + // Table Cell Trailing Edge Border + Right *CT_Border + // Table Cell Inside Horizontal Edges Border + InsideH *CT_Border + // Table Cell Inside Vertical Edges Border + InsideV *CT_Border + // Table Cell Top Left to Bottom Right Diagonal Border + Tl2br *CT_Border + // Table Cell Top Right to Bottom Left Diagonal Border + Tr2bl *CT_Border +} + +func NewCT_TcBorders() *CT_TcBorders { + ret := &CT_TcBorders{} + return ret +} + +func (m *CT_TcBorders) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Top != nil { + setop := xml.StartElement{Name: xml.Name{Local: "w:top"}} + e.EncodeElement(m.Top, setop) + } + if m.Start != nil { + sestart := xml.StartElement{Name: xml.Name{Local: "w:start"}} + e.EncodeElement(m.Start, sestart) + } + if m.Left != nil { + seleft := xml.StartElement{Name: xml.Name{Local: "w:left"}} + e.EncodeElement(m.Left, seleft) + } + if m.Bottom != nil { + sebottom := xml.StartElement{Name: xml.Name{Local: "w:bottom"}} + e.EncodeElement(m.Bottom, sebottom) + } + if m.End != nil { + seend := xml.StartElement{Name: xml.Name{Local: "w:end"}} + e.EncodeElement(m.End, seend) + } + if m.Right != nil { + seright := xml.StartElement{Name: xml.Name{Local: "w:right"}} + e.EncodeElement(m.Right, seright) + } + if m.InsideH != nil { + seinsideH := xml.StartElement{Name: xml.Name{Local: "w:insideH"}} + e.EncodeElement(m.InsideH, seinsideH) + } + if m.InsideV != nil { + seinsideV := xml.StartElement{Name: xml.Name{Local: "w:insideV"}} + e.EncodeElement(m.InsideV, seinsideV) + } + if m.Tl2br != nil { + setl2br := xml.StartElement{Name: xml.Name{Local: "w:tl2br"}} + e.EncodeElement(m.Tl2br, setl2br) + } + if m.Tr2bl != nil { + setr2bl := xml.StartElement{Name: xml.Name{Local: "w:tr2bl"}} + e.EncodeElement(m.Tr2bl, setr2bl) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TcBorders) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_TcBorders: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "top"}: + m.Top = NewCT_Border() + if err := d.DecodeElement(m.Top, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "start"}: + m.Start = NewCT_Border() + if err := d.DecodeElement(m.Start, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "left"}: + m.Left = NewCT_Border() + if err := d.DecodeElement(m.Left, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bottom"}: + m.Bottom = NewCT_Border() + if err := d.DecodeElement(m.Bottom, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "end"}: + m.End = NewCT_Border() + if err := d.DecodeElement(m.End, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "right"}: + m.Right = NewCT_Border() + if err := d.DecodeElement(m.Right, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "insideH"}: + m.InsideH = NewCT_Border() + if err := d.DecodeElement(m.InsideH, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "insideV"}: + m.InsideV = NewCT_Border() + if err := d.DecodeElement(m.InsideV, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tl2br"}: + m.Tl2br = NewCT_Border() + if err := d.DecodeElement(m.Tl2br, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tr2bl"}: + m.Tr2bl = NewCT_Border() + if err := d.DecodeElement(m.Tr2bl, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_TcBorders %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TcBorders + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TcBorders and its children +func (m *CT_TcBorders) Validate() error { + return m.ValidateWithPath("CT_TcBorders") +} + +// ValidateWithPath validates the CT_TcBorders and its children, prefixing error messages with path +func (m *CT_TcBorders) ValidateWithPath(path string) error { + if m.Top != nil { + if err := m.Top.ValidateWithPath(path + "/Top"); err != nil { + return err + } + } + if m.Start != nil { + if err := m.Start.ValidateWithPath(path + "/Start"); err != nil { + return err + } + } + if m.Left != nil { + if err := m.Left.ValidateWithPath(path + "/Left"); err != nil { + return err + } + } + if m.Bottom != nil { + if err := m.Bottom.ValidateWithPath(path + "/Bottom"); err != nil { + return err + } + } + if m.End != nil { + if err := m.End.ValidateWithPath(path + "/End"); err != nil { + return err + } + } + if m.Right != nil { + if err := m.Right.ValidateWithPath(path + "/Right"); err != nil { + return err + } + } + if m.InsideH != nil { + if err := m.InsideH.ValidateWithPath(path + "/InsideH"); err != nil { + return err + } + } + if m.InsideV != nil { + if err := m.InsideV.ValidateWithPath(path + "/InsideV"); err != nil { + return err + } + } + if m.Tl2br != nil { + if err := m.Tl2br.ValidateWithPath(path + "/Tl2br"); err != nil { + return err + } + } + if m.Tr2bl != nil { + if err := m.Tr2bl.ValidateWithPath(path + "/Tr2bl"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TcMar.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TcMar.go new file mode 100644 index 00000000..814a72b0 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TcMar.go @@ -0,0 +1,161 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_TcMar struct { + // Table Cell Top Margin Exception + Top *CT_TblWidth + // Table Cell Leading Margin Exception + Start *CT_TblWidth + // Table Cell Leading Margin Exception + Left *CT_TblWidth + // Table Cell Bottom Margin Exception + Bottom *CT_TblWidth + // Table Cell Trailing Margin Exception + End *CT_TblWidth + // Table Cell Trailing Margin Exception + Right *CT_TblWidth +} + +func NewCT_TcMar() *CT_TcMar { + ret := &CT_TcMar{} + return ret +} + +func (m *CT_TcMar) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Top != nil { + setop := xml.StartElement{Name: xml.Name{Local: "w:top"}} + e.EncodeElement(m.Top, setop) + } + if m.Start != nil { + sestart := xml.StartElement{Name: xml.Name{Local: "w:start"}} + e.EncodeElement(m.Start, sestart) + } + if m.Left != nil { + seleft := xml.StartElement{Name: xml.Name{Local: "w:left"}} + e.EncodeElement(m.Left, seleft) + } + if m.Bottom != nil { + sebottom := xml.StartElement{Name: xml.Name{Local: "w:bottom"}} + e.EncodeElement(m.Bottom, sebottom) + } + if m.End != nil { + seend := xml.StartElement{Name: xml.Name{Local: "w:end"}} + e.EncodeElement(m.End, seend) + } + if m.Right != nil { + seright := xml.StartElement{Name: xml.Name{Local: "w:right"}} + e.EncodeElement(m.Right, seright) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TcMar) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_TcMar: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "top"}: + m.Top = NewCT_TblWidth() + if err := d.DecodeElement(m.Top, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "start"}: + m.Start = NewCT_TblWidth() + if err := d.DecodeElement(m.Start, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "left"}: + m.Left = NewCT_TblWidth() + if err := d.DecodeElement(m.Left, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bottom"}: + m.Bottom = NewCT_TblWidth() + if err := d.DecodeElement(m.Bottom, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "end"}: + m.End = NewCT_TblWidth() + if err := d.DecodeElement(m.End, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "right"}: + m.Right = NewCT_TblWidth() + if err := d.DecodeElement(m.Right, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_TcMar %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TcMar + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TcMar and its children +func (m *CT_TcMar) Validate() error { + return m.ValidateWithPath("CT_TcMar") +} + +// ValidateWithPath validates the CT_TcMar and its children, prefixing error messages with path +func (m *CT_TcMar) ValidateWithPath(path string) error { + if m.Top != nil { + if err := m.Top.ValidateWithPath(path + "/Top"); err != nil { + return err + } + } + if m.Start != nil { + if err := m.Start.ValidateWithPath(path + "/Start"); err != nil { + return err + } + } + if m.Left != nil { + if err := m.Left.ValidateWithPath(path + "/Left"); err != nil { + return err + } + } + if m.Bottom != nil { + if err := m.Bottom.ValidateWithPath(path + "/Bottom"); err != nil { + return err + } + } + if m.End != nil { + if err := m.End.ValidateWithPath(path + "/End"); err != nil { + return err + } + } + if m.Right != nil { + if err := m.Right.ValidateWithPath(path + "/Right"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TcPr.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TcPr.go new file mode 100644 index 00000000..3a79e9f6 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TcPr.go @@ -0,0 +1,352 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_TcPr struct { + // Table Cell Conditional Formatting + CnfStyle *CT_Cnf + // Preferred Table Cell Width + TcW *CT_TblWidth + // Grid Columns Spanned by Current Table Cell + GridSpan *CT_DecimalNumber + // Horizontally Merged Cell + HMerge *CT_HMerge + // Vertically Merged Cell + VMerge *CT_VMerge + // Table Cell Borders + TcBorders *CT_TcBorders + // Table Cell Shading + Shd *CT_Shd + // Don't Wrap Cell Content + NoWrap *CT_OnOff + // Single Table Cell Margins + TcMar *CT_TcMar + // Table Cell Text Flow Direction + TextDirection *CT_TextDirection + // Fit Text Within Cell + TcFitText *CT_OnOff + // Table Cell Vertical Alignment + VAlign *CT_VerticalJc + // Ignore End Of Cell Marker In Row Height Calculation + HideMark *CT_OnOff + // Header Cells Associated With Table Cell + Headers *CT_Headers + // Table Cell Insertion + CellIns *CT_TrackChange + // Table Cell Deletion + CellDel *CT_TrackChange + // Vertically Merged/Split Table Cells + CellMerge *CT_CellMergeTrackChange + TcPrChange *CT_TcPrChange +} + +func NewCT_TcPr() *CT_TcPr { + ret := &CT_TcPr{} + return ret +} + +func (m *CT_TcPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.CnfStyle != nil { + secnfStyle := xml.StartElement{Name: xml.Name{Local: "w:cnfStyle"}} + e.EncodeElement(m.CnfStyle, secnfStyle) + } + if m.TcW != nil { + setcW := xml.StartElement{Name: xml.Name{Local: "w:tcW"}} + e.EncodeElement(m.TcW, setcW) + } + if m.GridSpan != nil { + segridSpan := xml.StartElement{Name: xml.Name{Local: "w:gridSpan"}} + e.EncodeElement(m.GridSpan, segridSpan) + } + if m.HMerge != nil { + sehMerge := xml.StartElement{Name: xml.Name{Local: "w:hMerge"}} + e.EncodeElement(m.HMerge, sehMerge) + } + if m.VMerge != nil { + sevMerge := xml.StartElement{Name: xml.Name{Local: "w:vMerge"}} + e.EncodeElement(m.VMerge, sevMerge) + } + if m.TcBorders != nil { + setcBorders := xml.StartElement{Name: xml.Name{Local: "w:tcBorders"}} + e.EncodeElement(m.TcBorders, setcBorders) + } + if m.Shd != nil { + seshd := xml.StartElement{Name: xml.Name{Local: "w:shd"}} + e.EncodeElement(m.Shd, seshd) + } + if m.NoWrap != nil { + senoWrap := xml.StartElement{Name: xml.Name{Local: "w:noWrap"}} + e.EncodeElement(m.NoWrap, senoWrap) + } + if m.TcMar != nil { + setcMar := xml.StartElement{Name: xml.Name{Local: "w:tcMar"}} + e.EncodeElement(m.TcMar, setcMar) + } + if m.TextDirection != nil { + setextDirection := xml.StartElement{Name: xml.Name{Local: "w:textDirection"}} + e.EncodeElement(m.TextDirection, setextDirection) + } + if m.TcFitText != nil { + setcFitText := xml.StartElement{Name: xml.Name{Local: "w:tcFitText"}} + e.EncodeElement(m.TcFitText, setcFitText) + } + if m.VAlign != nil { + sevAlign := xml.StartElement{Name: xml.Name{Local: "w:vAlign"}} + e.EncodeElement(m.VAlign, sevAlign) + } + if m.HideMark != nil { + sehideMark := xml.StartElement{Name: xml.Name{Local: "w:hideMark"}} + e.EncodeElement(m.HideMark, sehideMark) + } + if m.Headers != nil { + seheaders := xml.StartElement{Name: xml.Name{Local: "w:headers"}} + e.EncodeElement(m.Headers, seheaders) + } + if m.CellIns != nil { + secellIns := xml.StartElement{Name: xml.Name{Local: "w:cellIns"}} + e.EncodeElement(m.CellIns, secellIns) + } + if m.CellDel != nil { + secellDel := xml.StartElement{Name: xml.Name{Local: "w:cellDel"}} + e.EncodeElement(m.CellDel, secellDel) + } + if m.CellMerge != nil { + secellMerge := xml.StartElement{Name: xml.Name{Local: "w:cellMerge"}} + e.EncodeElement(m.CellMerge, secellMerge) + } + if m.TcPrChange != nil { + setcPrChange := xml.StartElement{Name: xml.Name{Local: "w:tcPrChange"}} + e.EncodeElement(m.TcPrChange, setcPrChange) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TcPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_TcPr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "cnfStyle"}: + m.CnfStyle = NewCT_Cnf() + if err := d.DecodeElement(m.CnfStyle, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tcW"}: + m.TcW = NewCT_TblWidth() + if err := d.DecodeElement(m.TcW, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "gridSpan"}: + m.GridSpan = NewCT_DecimalNumber() + if err := d.DecodeElement(m.GridSpan, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "hMerge"}: + m.HMerge = NewCT_HMerge() + if err := d.DecodeElement(m.HMerge, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "vMerge"}: + m.VMerge = NewCT_VMerge() + if err := d.DecodeElement(m.VMerge, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tcBorders"}: + m.TcBorders = NewCT_TcBorders() + if err := d.DecodeElement(m.TcBorders, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "shd"}: + m.Shd = NewCT_Shd() + if err := d.DecodeElement(m.Shd, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "noWrap"}: + m.NoWrap = NewCT_OnOff() + if err := d.DecodeElement(m.NoWrap, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tcMar"}: + m.TcMar = NewCT_TcMar() + if err := d.DecodeElement(m.TcMar, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "textDirection"}: + m.TextDirection = NewCT_TextDirection() + if err := d.DecodeElement(m.TextDirection, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tcFitText"}: + m.TcFitText = NewCT_OnOff() + if err := d.DecodeElement(m.TcFitText, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "vAlign"}: + m.VAlign = NewCT_VerticalJc() + if err := d.DecodeElement(m.VAlign, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "hideMark"}: + m.HideMark = NewCT_OnOff() + if err := d.DecodeElement(m.HideMark, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "headers"}: + m.Headers = NewCT_Headers() + if err := d.DecodeElement(m.Headers, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "cellIns"}: + m.CellIns = NewCT_TrackChange() + if err := d.DecodeElement(m.CellIns, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "cellDel"}: + m.CellDel = NewCT_TrackChange() + if err := d.DecodeElement(m.CellDel, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "cellMerge"}: + m.CellMerge = NewCT_CellMergeTrackChange() + if err := d.DecodeElement(m.CellMerge, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tcPrChange"}: + m.TcPrChange = NewCT_TcPrChange() + if err := d.DecodeElement(m.TcPrChange, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_TcPr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TcPr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TcPr and its children +func (m *CT_TcPr) Validate() error { + return m.ValidateWithPath("CT_TcPr") +} + +// ValidateWithPath validates the CT_TcPr and its children, prefixing error messages with path +func (m *CT_TcPr) ValidateWithPath(path string) error { + if m.CnfStyle != nil { + if err := m.CnfStyle.ValidateWithPath(path + "/CnfStyle"); err != nil { + return err + } + } + if m.TcW != nil { + if err := m.TcW.ValidateWithPath(path + "/TcW"); err != nil { + return err + } + } + if m.GridSpan != nil { + if err := m.GridSpan.ValidateWithPath(path + "/GridSpan"); err != nil { + return err + } + } + if m.HMerge != nil { + if err := m.HMerge.ValidateWithPath(path + "/HMerge"); err != nil { + return err + } + } + if m.VMerge != nil { + if err := m.VMerge.ValidateWithPath(path + "/VMerge"); err != nil { + return err + } + } + if m.TcBorders != nil { + if err := m.TcBorders.ValidateWithPath(path + "/TcBorders"); err != nil { + return err + } + } + if m.Shd != nil { + if err := m.Shd.ValidateWithPath(path + "/Shd"); err != nil { + return err + } + } + if m.NoWrap != nil { + if err := m.NoWrap.ValidateWithPath(path + "/NoWrap"); err != nil { + return err + } + } + if m.TcMar != nil { + if err := m.TcMar.ValidateWithPath(path + "/TcMar"); err != nil { + return err + } + } + if m.TextDirection != nil { + if err := m.TextDirection.ValidateWithPath(path + "/TextDirection"); err != nil { + return err + } + } + if m.TcFitText != nil { + if err := m.TcFitText.ValidateWithPath(path + "/TcFitText"); err != nil { + return err + } + } + if m.VAlign != nil { + if err := m.VAlign.ValidateWithPath(path + "/VAlign"); err != nil { + return err + } + } + if m.HideMark != nil { + if err := m.HideMark.ValidateWithPath(path + "/HideMark"); err != nil { + return err + } + } + if m.Headers != nil { + if err := m.Headers.ValidateWithPath(path + "/Headers"); err != nil { + return err + } + } + if m.CellIns != nil { + if err := m.CellIns.ValidateWithPath(path + "/CellIns"); err != nil { + return err + } + } + if m.CellDel != nil { + if err := m.CellDel.ValidateWithPath(path + "/CellDel"); err != nil { + return err + } + } + if m.CellMerge != nil { + if err := m.CellMerge.ValidateWithPath(path + "/CellMerge"); err != nil { + return err + } + } + if m.TcPrChange != nil { + if err := m.TcPrChange.ValidateWithPath(path + "/TcPrChange"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TcPrBase.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TcPrBase.go new file mode 100644 index 00000000..152c39f9 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TcPrBase.go @@ -0,0 +1,289 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_TcPrBase struct { + // Table Cell Conditional Formatting + CnfStyle *CT_Cnf + // Preferred Table Cell Width + TcW *CT_TblWidth + // Grid Columns Spanned by Current Table Cell + GridSpan *CT_DecimalNumber + // Horizontally Merged Cell + HMerge *CT_HMerge + // Vertically Merged Cell + VMerge *CT_VMerge + // Table Cell Borders + TcBorders *CT_TcBorders + // Table Cell Shading + Shd *CT_Shd + // Don't Wrap Cell Content + NoWrap *CT_OnOff + // Single Table Cell Margins + TcMar *CT_TcMar + // Table Cell Text Flow Direction + TextDirection *CT_TextDirection + // Fit Text Within Cell + TcFitText *CT_OnOff + // Table Cell Vertical Alignment + VAlign *CT_VerticalJc + // Ignore End Of Cell Marker In Row Height Calculation + HideMark *CT_OnOff + // Header Cells Associated With Table Cell + Headers *CT_Headers +} + +func NewCT_TcPrBase() *CT_TcPrBase { + ret := &CT_TcPrBase{} + return ret +} + +func (m *CT_TcPrBase) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.CnfStyle != nil { + secnfStyle := xml.StartElement{Name: xml.Name{Local: "w:cnfStyle"}} + e.EncodeElement(m.CnfStyle, secnfStyle) + } + if m.TcW != nil { + setcW := xml.StartElement{Name: xml.Name{Local: "w:tcW"}} + e.EncodeElement(m.TcW, setcW) + } + if m.GridSpan != nil { + segridSpan := xml.StartElement{Name: xml.Name{Local: "w:gridSpan"}} + e.EncodeElement(m.GridSpan, segridSpan) + } + if m.HMerge != nil { + sehMerge := xml.StartElement{Name: xml.Name{Local: "w:hMerge"}} + e.EncodeElement(m.HMerge, sehMerge) + } + if m.VMerge != nil { + sevMerge := xml.StartElement{Name: xml.Name{Local: "w:vMerge"}} + e.EncodeElement(m.VMerge, sevMerge) + } + if m.TcBorders != nil { + setcBorders := xml.StartElement{Name: xml.Name{Local: "w:tcBorders"}} + e.EncodeElement(m.TcBorders, setcBorders) + } + if m.Shd != nil { + seshd := xml.StartElement{Name: xml.Name{Local: "w:shd"}} + e.EncodeElement(m.Shd, seshd) + } + if m.NoWrap != nil { + senoWrap := xml.StartElement{Name: xml.Name{Local: "w:noWrap"}} + e.EncodeElement(m.NoWrap, senoWrap) + } + if m.TcMar != nil { + setcMar := xml.StartElement{Name: xml.Name{Local: "w:tcMar"}} + e.EncodeElement(m.TcMar, setcMar) + } + if m.TextDirection != nil { + setextDirection := xml.StartElement{Name: xml.Name{Local: "w:textDirection"}} + e.EncodeElement(m.TextDirection, setextDirection) + } + if m.TcFitText != nil { + setcFitText := xml.StartElement{Name: xml.Name{Local: "w:tcFitText"}} + e.EncodeElement(m.TcFitText, setcFitText) + } + if m.VAlign != nil { + sevAlign := xml.StartElement{Name: xml.Name{Local: "w:vAlign"}} + e.EncodeElement(m.VAlign, sevAlign) + } + if m.HideMark != nil { + sehideMark := xml.StartElement{Name: xml.Name{Local: "w:hideMark"}} + e.EncodeElement(m.HideMark, sehideMark) + } + if m.Headers != nil { + seheaders := xml.StartElement{Name: xml.Name{Local: "w:headers"}} + e.EncodeElement(m.Headers, seheaders) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TcPrBase) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_TcPrBase: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "cnfStyle"}: + m.CnfStyle = NewCT_Cnf() + if err := d.DecodeElement(m.CnfStyle, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tcW"}: + m.TcW = NewCT_TblWidth() + if err := d.DecodeElement(m.TcW, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "gridSpan"}: + m.GridSpan = NewCT_DecimalNumber() + if err := d.DecodeElement(m.GridSpan, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "hMerge"}: + m.HMerge = NewCT_HMerge() + if err := d.DecodeElement(m.HMerge, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "vMerge"}: + m.VMerge = NewCT_VMerge() + if err := d.DecodeElement(m.VMerge, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tcBorders"}: + m.TcBorders = NewCT_TcBorders() + if err := d.DecodeElement(m.TcBorders, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "shd"}: + m.Shd = NewCT_Shd() + if err := d.DecodeElement(m.Shd, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "noWrap"}: + m.NoWrap = NewCT_OnOff() + if err := d.DecodeElement(m.NoWrap, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tcMar"}: + m.TcMar = NewCT_TcMar() + if err := d.DecodeElement(m.TcMar, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "textDirection"}: + m.TextDirection = NewCT_TextDirection() + if err := d.DecodeElement(m.TextDirection, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tcFitText"}: + m.TcFitText = NewCT_OnOff() + if err := d.DecodeElement(m.TcFitText, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "vAlign"}: + m.VAlign = NewCT_VerticalJc() + if err := d.DecodeElement(m.VAlign, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "hideMark"}: + m.HideMark = NewCT_OnOff() + if err := d.DecodeElement(m.HideMark, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "headers"}: + m.Headers = NewCT_Headers() + if err := d.DecodeElement(m.Headers, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_TcPrBase %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TcPrBase + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TcPrBase and its children +func (m *CT_TcPrBase) Validate() error { + return m.ValidateWithPath("CT_TcPrBase") +} + +// ValidateWithPath validates the CT_TcPrBase and its children, prefixing error messages with path +func (m *CT_TcPrBase) ValidateWithPath(path string) error { + if m.CnfStyle != nil { + if err := m.CnfStyle.ValidateWithPath(path + "/CnfStyle"); err != nil { + return err + } + } + if m.TcW != nil { + if err := m.TcW.ValidateWithPath(path + "/TcW"); err != nil { + return err + } + } + if m.GridSpan != nil { + if err := m.GridSpan.ValidateWithPath(path + "/GridSpan"); err != nil { + return err + } + } + if m.HMerge != nil { + if err := m.HMerge.ValidateWithPath(path + "/HMerge"); err != nil { + return err + } + } + if m.VMerge != nil { + if err := m.VMerge.ValidateWithPath(path + "/VMerge"); err != nil { + return err + } + } + if m.TcBorders != nil { + if err := m.TcBorders.ValidateWithPath(path + "/TcBorders"); err != nil { + return err + } + } + if m.Shd != nil { + if err := m.Shd.ValidateWithPath(path + "/Shd"); err != nil { + return err + } + } + if m.NoWrap != nil { + if err := m.NoWrap.ValidateWithPath(path + "/NoWrap"); err != nil { + return err + } + } + if m.TcMar != nil { + if err := m.TcMar.ValidateWithPath(path + "/TcMar"); err != nil { + return err + } + } + if m.TextDirection != nil { + if err := m.TextDirection.ValidateWithPath(path + "/TextDirection"); err != nil { + return err + } + } + if m.TcFitText != nil { + if err := m.TcFitText.ValidateWithPath(path + "/TcFitText"); err != nil { + return err + } + } + if m.VAlign != nil { + if err := m.VAlign.ValidateWithPath(path + "/VAlign"); err != nil { + return err + } + } + if m.HideMark != nil { + if err := m.HideMark.ValidateWithPath(path + "/HideMark"); err != nil { + return err + } + } + if m.Headers != nil { + if err := m.Headers.ValidateWithPath(path + "/Headers"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TcPrChange.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TcPrChange.go new file mode 100644 index 00000000..0a710b44 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TcPrChange.go @@ -0,0 +1,118 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + "time" + + "baliance.com/gooxml" +) + +type CT_TcPrChange struct { + AuthorAttr string + DateAttr *time.Time + // Annotation Identifier + IdAttr int64 + TcPr *CT_TcPrInner +} + +func NewCT_TcPrChange() *CT_TcPrChange { + ret := &CT_TcPrChange{} + ret.TcPr = NewCT_TcPrInner() + return ret +} + +func (m *CT_TcPrChange) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:author"}, + Value: fmt.Sprintf("%v", m.AuthorAttr)}) + if m.DateAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:date"}, + Value: fmt.Sprintf("%v", *m.DateAttr)}) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:id"}, + Value: fmt.Sprintf("%v", m.IdAttr)}) + e.EncodeToken(start) + setcPr := xml.StartElement{Name: xml.Name{Local: "w:tcPr"}} + e.EncodeElement(m.TcPr, setcPr) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TcPrChange) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.TcPr = NewCT_TcPrInner() + for _, attr := range start.Attr { + if attr.Name.Local == "author" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.AuthorAttr = parsed + continue + } + if attr.Name.Local == "date" { + parsed, err := ParseStdlibTime(attr.Value) + if err != nil { + return err + } + m.DateAttr = &parsed + continue + } + if attr.Name.Local == "id" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.IdAttr = parsed + continue + } + } +lCT_TcPrChange: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tcPr"}: + if err := d.DecodeElement(m.TcPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_TcPrChange %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TcPrChange + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TcPrChange and its children +func (m *CT_TcPrChange) Validate() error { + return m.ValidateWithPath("CT_TcPrChange") +} + +// ValidateWithPath validates the CT_TcPrChange and its children, prefixing error messages with path +func (m *CT_TcPrChange) ValidateWithPath(path string) error { + if err := m.TcPr.ValidateWithPath(path + "/TcPr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TcPrInner.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TcPrInner.go new file mode 100644 index 00000000..c23aef14 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TcPrInner.go @@ -0,0 +1,337 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_TcPrInner struct { + // Table Cell Conditional Formatting + CnfStyle *CT_Cnf + // Preferred Table Cell Width + TcW *CT_TblWidth + // Grid Columns Spanned by Current Table Cell + GridSpan *CT_DecimalNumber + // Horizontally Merged Cell + HMerge *CT_HMerge + // Vertically Merged Cell + VMerge *CT_VMerge + // Table Cell Borders + TcBorders *CT_TcBorders + // Table Cell Shading + Shd *CT_Shd + // Don't Wrap Cell Content + NoWrap *CT_OnOff + // Single Table Cell Margins + TcMar *CT_TcMar + // Table Cell Text Flow Direction + TextDirection *CT_TextDirection + // Fit Text Within Cell + TcFitText *CT_OnOff + // Table Cell Vertical Alignment + VAlign *CT_VerticalJc + // Ignore End Of Cell Marker In Row Height Calculation + HideMark *CT_OnOff + // Header Cells Associated With Table Cell + Headers *CT_Headers + // Table Cell Insertion + CellIns *CT_TrackChange + // Table Cell Deletion + CellDel *CT_TrackChange + // Vertically Merged/Split Table Cells + CellMerge *CT_CellMergeTrackChange +} + +func NewCT_TcPrInner() *CT_TcPrInner { + ret := &CT_TcPrInner{} + return ret +} + +func (m *CT_TcPrInner) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.CnfStyle != nil { + secnfStyle := xml.StartElement{Name: xml.Name{Local: "w:cnfStyle"}} + e.EncodeElement(m.CnfStyle, secnfStyle) + } + if m.TcW != nil { + setcW := xml.StartElement{Name: xml.Name{Local: "w:tcW"}} + e.EncodeElement(m.TcW, setcW) + } + if m.GridSpan != nil { + segridSpan := xml.StartElement{Name: xml.Name{Local: "w:gridSpan"}} + e.EncodeElement(m.GridSpan, segridSpan) + } + if m.HMerge != nil { + sehMerge := xml.StartElement{Name: xml.Name{Local: "w:hMerge"}} + e.EncodeElement(m.HMerge, sehMerge) + } + if m.VMerge != nil { + sevMerge := xml.StartElement{Name: xml.Name{Local: "w:vMerge"}} + e.EncodeElement(m.VMerge, sevMerge) + } + if m.TcBorders != nil { + setcBorders := xml.StartElement{Name: xml.Name{Local: "w:tcBorders"}} + e.EncodeElement(m.TcBorders, setcBorders) + } + if m.Shd != nil { + seshd := xml.StartElement{Name: xml.Name{Local: "w:shd"}} + e.EncodeElement(m.Shd, seshd) + } + if m.NoWrap != nil { + senoWrap := xml.StartElement{Name: xml.Name{Local: "w:noWrap"}} + e.EncodeElement(m.NoWrap, senoWrap) + } + if m.TcMar != nil { + setcMar := xml.StartElement{Name: xml.Name{Local: "w:tcMar"}} + e.EncodeElement(m.TcMar, setcMar) + } + if m.TextDirection != nil { + setextDirection := xml.StartElement{Name: xml.Name{Local: "w:textDirection"}} + e.EncodeElement(m.TextDirection, setextDirection) + } + if m.TcFitText != nil { + setcFitText := xml.StartElement{Name: xml.Name{Local: "w:tcFitText"}} + e.EncodeElement(m.TcFitText, setcFitText) + } + if m.VAlign != nil { + sevAlign := xml.StartElement{Name: xml.Name{Local: "w:vAlign"}} + e.EncodeElement(m.VAlign, sevAlign) + } + if m.HideMark != nil { + sehideMark := xml.StartElement{Name: xml.Name{Local: "w:hideMark"}} + e.EncodeElement(m.HideMark, sehideMark) + } + if m.Headers != nil { + seheaders := xml.StartElement{Name: xml.Name{Local: "w:headers"}} + e.EncodeElement(m.Headers, seheaders) + } + if m.CellIns != nil { + secellIns := xml.StartElement{Name: xml.Name{Local: "w:cellIns"}} + e.EncodeElement(m.CellIns, secellIns) + } + if m.CellDel != nil { + secellDel := xml.StartElement{Name: xml.Name{Local: "w:cellDel"}} + e.EncodeElement(m.CellDel, secellDel) + } + if m.CellMerge != nil { + secellMerge := xml.StartElement{Name: xml.Name{Local: "w:cellMerge"}} + e.EncodeElement(m.CellMerge, secellMerge) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TcPrInner) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_TcPrInner: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "cnfStyle"}: + m.CnfStyle = NewCT_Cnf() + if err := d.DecodeElement(m.CnfStyle, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tcW"}: + m.TcW = NewCT_TblWidth() + if err := d.DecodeElement(m.TcW, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "gridSpan"}: + m.GridSpan = NewCT_DecimalNumber() + if err := d.DecodeElement(m.GridSpan, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "hMerge"}: + m.HMerge = NewCT_HMerge() + if err := d.DecodeElement(m.HMerge, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "vMerge"}: + m.VMerge = NewCT_VMerge() + if err := d.DecodeElement(m.VMerge, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tcBorders"}: + m.TcBorders = NewCT_TcBorders() + if err := d.DecodeElement(m.TcBorders, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "shd"}: + m.Shd = NewCT_Shd() + if err := d.DecodeElement(m.Shd, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "noWrap"}: + m.NoWrap = NewCT_OnOff() + if err := d.DecodeElement(m.NoWrap, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tcMar"}: + m.TcMar = NewCT_TcMar() + if err := d.DecodeElement(m.TcMar, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "textDirection"}: + m.TextDirection = NewCT_TextDirection() + if err := d.DecodeElement(m.TextDirection, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tcFitText"}: + m.TcFitText = NewCT_OnOff() + if err := d.DecodeElement(m.TcFitText, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "vAlign"}: + m.VAlign = NewCT_VerticalJc() + if err := d.DecodeElement(m.VAlign, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "hideMark"}: + m.HideMark = NewCT_OnOff() + if err := d.DecodeElement(m.HideMark, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "headers"}: + m.Headers = NewCT_Headers() + if err := d.DecodeElement(m.Headers, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "cellIns"}: + m.CellIns = NewCT_TrackChange() + if err := d.DecodeElement(m.CellIns, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "cellDel"}: + m.CellDel = NewCT_TrackChange() + if err := d.DecodeElement(m.CellDel, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "cellMerge"}: + m.CellMerge = NewCT_CellMergeTrackChange() + if err := d.DecodeElement(m.CellMerge, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_TcPrInner %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TcPrInner + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TcPrInner and its children +func (m *CT_TcPrInner) Validate() error { + return m.ValidateWithPath("CT_TcPrInner") +} + +// ValidateWithPath validates the CT_TcPrInner and its children, prefixing error messages with path +func (m *CT_TcPrInner) ValidateWithPath(path string) error { + if m.CnfStyle != nil { + if err := m.CnfStyle.ValidateWithPath(path + "/CnfStyle"); err != nil { + return err + } + } + if m.TcW != nil { + if err := m.TcW.ValidateWithPath(path + "/TcW"); err != nil { + return err + } + } + if m.GridSpan != nil { + if err := m.GridSpan.ValidateWithPath(path + "/GridSpan"); err != nil { + return err + } + } + if m.HMerge != nil { + if err := m.HMerge.ValidateWithPath(path + "/HMerge"); err != nil { + return err + } + } + if m.VMerge != nil { + if err := m.VMerge.ValidateWithPath(path + "/VMerge"); err != nil { + return err + } + } + if m.TcBorders != nil { + if err := m.TcBorders.ValidateWithPath(path + "/TcBorders"); err != nil { + return err + } + } + if m.Shd != nil { + if err := m.Shd.ValidateWithPath(path + "/Shd"); err != nil { + return err + } + } + if m.NoWrap != nil { + if err := m.NoWrap.ValidateWithPath(path + "/NoWrap"); err != nil { + return err + } + } + if m.TcMar != nil { + if err := m.TcMar.ValidateWithPath(path + "/TcMar"); err != nil { + return err + } + } + if m.TextDirection != nil { + if err := m.TextDirection.ValidateWithPath(path + "/TextDirection"); err != nil { + return err + } + } + if m.TcFitText != nil { + if err := m.TcFitText.ValidateWithPath(path + "/TcFitText"); err != nil { + return err + } + } + if m.VAlign != nil { + if err := m.VAlign.ValidateWithPath(path + "/VAlign"); err != nil { + return err + } + } + if m.HideMark != nil { + if err := m.HideMark.ValidateWithPath(path + "/HideMark"); err != nil { + return err + } + } + if m.Headers != nil { + if err := m.Headers.ValidateWithPath(path + "/Headers"); err != nil { + return err + } + } + if m.CellIns != nil { + if err := m.CellIns.ValidateWithPath(path + "/CellIns"); err != nil { + return err + } + } + if m.CellDel != nil { + if err := m.CellDel.ValidateWithPath(path + "/CellDel"); err != nil { + return err + } + } + if m.CellMerge != nil { + if err := m.CellMerge.ValidateWithPath(path + "/CellMerge"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Text.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Text.go new file mode 100644 index 00000000..30c531aa --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Text.go @@ -0,0 +1,73 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_Text struct { + SpaceAttr *string + Content string +} + +func NewCT_Text() *CT_Text { + ret := &CT_Text{} + return ret +} + +func (m *CT_Text) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.SpaceAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xml:space"}, + Value: fmt.Sprintf("%v", *m.SpaceAttr)}) + } + e.EncodeElement(m.Content, start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Text) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Space == "http://www.w3.org/XML/1998/namespace" && attr.Name.Local == "space" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.SpaceAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Text: %s", err) + } + if cd, ok := tok.(xml.CharData); ok { + m.Content = string(cd) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Text and its children +func (m *CT_Text) Validate() error { + return m.ValidateWithPath("CT_Text") +} + +// ValidateWithPath validates the CT_Text and its children, prefixing error messages with path +func (m *CT_Text) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TextAlignment.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TextAlignment.go new file mode 100644 index 00000000..10e29141 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TextAlignment.go @@ -0,0 +1,75 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_TextAlignment struct { + // Vertical Character Alignment Position + ValAttr ST_TextAlignment +} + +func NewCT_TextAlignment() *CT_TextAlignment { + ret := &CT_TextAlignment{} + ret.ValAttr = ST_TextAlignment(1) + return ret +} + +func (m *CT_TextAlignment) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TextAlignment) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_TextAlignment(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_TextAlignment: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_TextAlignment and its children +func (m *CT_TextAlignment) Validate() error { + return m.ValidateWithPath("CT_TextAlignment") +} + +// ValidateWithPath validates the CT_TextAlignment and its children, prefixing error messages with path +func (m *CT_TextAlignment) ValidateWithPath(path string) error { + if m.ValAttr == ST_TextAlignmentUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TextDirection.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TextDirection.go new file mode 100644 index 00000000..ab434f62 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TextDirection.go @@ -0,0 +1,75 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_TextDirection struct { + // Direction of Text Flow + ValAttr ST_TextDirection +} + +func NewCT_TextDirection() *CT_TextDirection { + ret := &CT_TextDirection{} + ret.ValAttr = ST_TextDirection(1) + return ret +} + +func (m *CT_TextDirection) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TextDirection) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_TextDirection(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_TextDirection: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_TextDirection and its children +func (m *CT_TextDirection) Validate() error { + return m.ValidateWithPath("CT_TextDirection") +} + +// ValidateWithPath validates the CT_TextDirection and its children, prefixing error messages with path +func (m *CT_TextDirection) ValidateWithPath(path string) error { + if m.ValAttr == ST_TextDirectionUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TextEffect.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TextEffect.go new file mode 100644 index 00000000..308296b3 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TextEffect.go @@ -0,0 +1,75 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_TextEffect struct { + // Animated Text Effect Type + ValAttr ST_TextEffect +} + +func NewCT_TextEffect() *CT_TextEffect { + ret := &CT_TextEffect{} + ret.ValAttr = ST_TextEffect(1) + return ret +} + +func (m *CT_TextEffect) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TextEffect) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_TextEffect(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_TextEffect: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_TextEffect and its children +func (m *CT_TextEffect) Validate() error { + return m.ValidateWithPath("CT_TextEffect") +} + +// ValidateWithPath validates the CT_TextEffect and its children, prefixing error messages with path +func (m *CT_TextEffect) ValidateWithPath(path string) error { + if m.ValAttr == ST_TextEffectUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TextScale.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TextScale.go new file mode 100644 index 00000000..27daa1d2 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TextScale.go @@ -0,0 +1,75 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_TextScale struct { + // Text Expansion/Compression Value + ValAttr *ST_TextScale +} + +func NewCT_TextScale() *CT_TextScale { + ret := &CT_TextScale{} + return ret +} + +func (m *CT_TextScale) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.ValAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:val"}, + Value: fmt.Sprintf("%v", *m.ValAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TextScale) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := ParseUnionST_TextScale(attr.Value) + if err != nil { + return err + } + m.ValAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_TextScale: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_TextScale and its children +func (m *CT_TextScale) Validate() error { + return m.ValidateWithPath("CT_TextScale") +} + +// ValidateWithPath validates the CT_TextScale and its children, prefixing error messages with path +func (m *CT_TextScale) ValidateWithPath(path string) error { + if m.ValAttr != nil { + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TextboxTightWrap.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TextboxTightWrap.go new file mode 100644 index 00000000..40c50e99 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TextboxTightWrap.go @@ -0,0 +1,75 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_TextboxTightWrap struct { + // Lines to Tight Wrap to Paragraph Extents + ValAttr ST_TextboxTightWrap +} + +func NewCT_TextboxTightWrap() *CT_TextboxTightWrap { + ret := &CT_TextboxTightWrap{} + ret.ValAttr = ST_TextboxTightWrap(1) + return ret +} + +func (m *CT_TextboxTightWrap) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TextboxTightWrap) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_TextboxTightWrap(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_TextboxTightWrap: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_TextboxTightWrap and its children +func (m *CT_TextboxTightWrap) Validate() error { + return m.ValidateWithPath("CT_TextboxTightWrap") +} + +// ValidateWithPath validates the CT_TextboxTightWrap and its children, prefixing error messages with path +func (m *CT_TextboxTightWrap) ValidateWithPath(path string) error { + if m.ValAttr == ST_TextboxTightWrapUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TopPageBorder.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TopPageBorder.go new file mode 100644 index 00000000..12a4c369 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TopPageBorder.go @@ -0,0 +1,246 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_TopPageBorder struct { + TopLeftAttr *string + TopRightAttr *string + IdAttr *string + // Border Style + ValAttr ST_Border + // Border Color + ColorAttr *ST_HexColor + // Border Theme Color + ThemeColorAttr ST_ThemeColor + // Border Theme Color Tint + ThemeTintAttr *string + // Border Theme Color Shade + ThemeShadeAttr *string + // Border Width + SzAttr *uint64 + // Border Spacing Measurement + SpaceAttr *uint64 + // Border Shadow + ShadowAttr *sharedTypes.ST_OnOff + // Create Frame Effect + FrameAttr *sharedTypes.ST_OnOff +} + +func NewCT_TopPageBorder() *CT_TopPageBorder { + ret := &CT_TopPageBorder{} + ret.ValAttr = ST_Border(1) + return ret +} + +func (m *CT_TopPageBorder) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.TopLeftAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "r:topLeft"}, + Value: fmt.Sprintf("%v", *m.TopLeftAttr)}) + } + if m.TopRightAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "r:topRight"}, + Value: fmt.Sprintf("%v", *m.TopRightAttr)}) + } + if m.IdAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "r:id"}, + Value: fmt.Sprintf("%v", *m.IdAttr)}) + } + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + if m.ColorAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:color"}, + Value: fmt.Sprintf("%v", *m.ColorAttr)}) + } + if m.ThemeColorAttr != ST_ThemeColorUnset { + attr, err := m.ThemeColorAttr.MarshalXMLAttr(xml.Name{Local: "w:themeColor"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.ThemeTintAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:themeTint"}, + Value: fmt.Sprintf("%v", *m.ThemeTintAttr)}) + } + if m.ThemeShadeAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:themeShade"}, + Value: fmt.Sprintf("%v", *m.ThemeShadeAttr)}) + } + if m.SzAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:sz"}, + Value: fmt.Sprintf("%v", *m.SzAttr)}) + } + if m.SpaceAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:space"}, + Value: fmt.Sprintf("%v", *m.SpaceAttr)}) + } + if m.ShadowAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:shadow"}, + Value: fmt.Sprintf("%v", *m.ShadowAttr)}) + } + if m.FrameAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:frame"}, + Value: fmt.Sprintf("%v", *m.FrameAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TopPageBorder) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_Border(1) + for _, attr := range start.Attr { + if attr.Name.Space == "http://schemas.openxmlformats.org/officeDocument/2006/relationships" && attr.Name.Local == "topLeft" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.TopLeftAttr = &parsed + continue + } + if attr.Name.Space == "http://schemas.openxmlformats.org/officeDocument/2006/relationships" && attr.Name.Local == "topRight" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.TopRightAttr = &parsed + continue + } + if attr.Name.Space == "http://schemas.openxmlformats.org/officeDocument/2006/relationships" && attr.Name.Local == "id" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.IdAttr = &parsed + continue + } + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "color" { + parsed, err := ParseUnionST_HexColor(attr.Value) + if err != nil { + return err + } + m.ColorAttr = &parsed + continue + } + if attr.Name.Local == "themeColor" { + m.ThemeColorAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "themeTint" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ThemeTintAttr = &parsed + continue + } + if attr.Name.Local == "themeShade" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ThemeShadeAttr = &parsed + continue + } + if attr.Name.Local == "sz" { + parsed, err := strconv.ParseUint(attr.Value, 10, 64) + if err != nil { + return err + } + m.SzAttr = &parsed + continue + } + if attr.Name.Local == "space" { + parsed, err := strconv.ParseUint(attr.Value, 10, 64) + if err != nil { + return err + } + m.SpaceAttr = &parsed + continue + } + if attr.Name.Local == "shadow" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.ShadowAttr = &parsed + continue + } + if attr.Name.Local == "frame" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.FrameAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_TopPageBorder: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_TopPageBorder and its children +func (m *CT_TopPageBorder) Validate() error { + return m.ValidateWithPath("CT_TopPageBorder") +} + +// ValidateWithPath validates the CT_TopPageBorder and its children, prefixing error messages with path +func (m *CT_TopPageBorder) ValidateWithPath(path string) error { + if m.ValAttr == ST_BorderUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + if m.ColorAttr != nil { + if err := m.ColorAttr.ValidateWithPath(path + "/ColorAttr"); err != nil { + return err + } + } + if err := m.ThemeColorAttr.ValidateWithPath(path + "/ThemeColorAttr"); err != nil { + return err + } + if m.ShadowAttr != nil { + if err := m.ShadowAttr.ValidateWithPath(path + "/ShadowAttr"); err != nil { + return err + } + } + if m.FrameAttr != nil { + if err := m.FrameAttr.ValidateWithPath(path + "/FrameAttr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TrPr.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TrPr.go new file mode 100644 index 00000000..45ad248a --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TrPr.go @@ -0,0 +1,339 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_TrPr struct { + // Table Row Conditional Formatting + CnfStyle []*CT_Cnf + // Associated HTML div ID + DivId []*CT_DecimalNumber + // Grid Columns Before First Cell + GridBefore []*CT_DecimalNumber + // Grid Columns After Last Cell + GridAfter []*CT_DecimalNumber + // Preferred Width Before Table Row + WBefore []*CT_TblWidth + // Preferred Width After Table Row + WAfter []*CT_TblWidth + // Table Row Cannot Break Across Pages + CantSplit []*CT_OnOff + // Table Row Height + TrHeight []*CT_Height + // Repeat Table Row on Every New Page + TblHeader []*CT_OnOff + // Table Row Cell Spacing + TblCellSpacing []*CT_TblWidth + // Table Row Alignment + Jc []*CT_JcTable + // Hidden Table Row Marker + Hidden []*CT_OnOff + Ins *CT_TrackChange + Del *CT_TrackChange + TrPrChange *CT_TrPrChange +} + +func NewCT_TrPr() *CT_TrPr { + ret := &CT_TrPr{} + return ret +} + +func (m *CT_TrPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.CnfStyle != nil { + secnfStyle := xml.StartElement{Name: xml.Name{Local: "w:cnfStyle"}} + for _, c := range m.CnfStyle { + e.EncodeElement(c, secnfStyle) + } + } + if m.DivId != nil { + sedivId := xml.StartElement{Name: xml.Name{Local: "w:divId"}} + for _, c := range m.DivId { + e.EncodeElement(c, sedivId) + } + } + if m.GridBefore != nil { + segridBefore := xml.StartElement{Name: xml.Name{Local: "w:gridBefore"}} + for _, c := range m.GridBefore { + e.EncodeElement(c, segridBefore) + } + } + if m.GridAfter != nil { + segridAfter := xml.StartElement{Name: xml.Name{Local: "w:gridAfter"}} + for _, c := range m.GridAfter { + e.EncodeElement(c, segridAfter) + } + } + if m.WBefore != nil { + sewBefore := xml.StartElement{Name: xml.Name{Local: "w:wBefore"}} + for _, c := range m.WBefore { + e.EncodeElement(c, sewBefore) + } + } + if m.WAfter != nil { + sewAfter := xml.StartElement{Name: xml.Name{Local: "w:wAfter"}} + for _, c := range m.WAfter { + e.EncodeElement(c, sewAfter) + } + } + if m.CantSplit != nil { + secantSplit := xml.StartElement{Name: xml.Name{Local: "w:cantSplit"}} + for _, c := range m.CantSplit { + e.EncodeElement(c, secantSplit) + } + } + if m.TrHeight != nil { + setrHeight := xml.StartElement{Name: xml.Name{Local: "w:trHeight"}} + for _, c := range m.TrHeight { + e.EncodeElement(c, setrHeight) + } + } + if m.TblHeader != nil { + setblHeader := xml.StartElement{Name: xml.Name{Local: "w:tblHeader"}} + for _, c := range m.TblHeader { + e.EncodeElement(c, setblHeader) + } + } + if m.TblCellSpacing != nil { + setblCellSpacing := xml.StartElement{Name: xml.Name{Local: "w:tblCellSpacing"}} + for _, c := range m.TblCellSpacing { + e.EncodeElement(c, setblCellSpacing) + } + } + if m.Jc != nil { + sejc := xml.StartElement{Name: xml.Name{Local: "w:jc"}} + for _, c := range m.Jc { + e.EncodeElement(c, sejc) + } + } + if m.Hidden != nil { + sehidden := xml.StartElement{Name: xml.Name{Local: "w:hidden"}} + for _, c := range m.Hidden { + e.EncodeElement(c, sehidden) + } + } + if m.Ins != nil { + seins := xml.StartElement{Name: xml.Name{Local: "w:ins"}} + e.EncodeElement(m.Ins, seins) + } + if m.Del != nil { + sedel := xml.StartElement{Name: xml.Name{Local: "w:del"}} + e.EncodeElement(m.Del, sedel) + } + if m.TrPrChange != nil { + setrPrChange := xml.StartElement{Name: xml.Name{Local: "w:trPrChange"}} + e.EncodeElement(m.TrPrChange, setrPrChange) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TrPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_TrPr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "cnfStyle"}: + tmp := NewCT_Cnf() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.CnfStyle = append(m.CnfStyle, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "divId"}: + tmp := NewCT_DecimalNumber() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.DivId = append(m.DivId, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "gridBefore"}: + tmp := NewCT_DecimalNumber() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.GridBefore = append(m.GridBefore, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "gridAfter"}: + tmp := NewCT_DecimalNumber() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.GridAfter = append(m.GridAfter, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "wBefore"}: + tmp := NewCT_TblWidth() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.WBefore = append(m.WBefore, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "wAfter"}: + tmp := NewCT_TblWidth() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.WAfter = append(m.WAfter, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "cantSplit"}: + tmp := NewCT_OnOff() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.CantSplit = append(m.CantSplit, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "trHeight"}: + tmp := NewCT_Height() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.TrHeight = append(m.TrHeight, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblHeader"}: + tmp := NewCT_OnOff() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.TblHeader = append(m.TblHeader, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblCellSpacing"}: + tmp := NewCT_TblWidth() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.TblCellSpacing = append(m.TblCellSpacing, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "jc"}: + tmp := NewCT_JcTable() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Jc = append(m.Jc, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "hidden"}: + tmp := NewCT_OnOff() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Hidden = append(m.Hidden, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + m.Ins = NewCT_TrackChange() + if err := d.DecodeElement(m.Ins, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + m.Del = NewCT_TrackChange() + if err := d.DecodeElement(m.Del, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "trPrChange"}: + m.TrPrChange = NewCT_TrPrChange() + if err := d.DecodeElement(m.TrPrChange, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_TrPr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TrPr + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TrPr and its children +func (m *CT_TrPr) Validate() error { + return m.ValidateWithPath("CT_TrPr") +} + +// ValidateWithPath validates the CT_TrPr and its children, prefixing error messages with path +func (m *CT_TrPr) ValidateWithPath(path string) error { + for i, v := range m.CnfStyle { + if err := v.ValidateWithPath(fmt.Sprintf("%s/CnfStyle[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.DivId { + if err := v.ValidateWithPath(fmt.Sprintf("%s/DivId[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.GridBefore { + if err := v.ValidateWithPath(fmt.Sprintf("%s/GridBefore[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.GridAfter { + if err := v.ValidateWithPath(fmt.Sprintf("%s/GridAfter[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.WBefore { + if err := v.ValidateWithPath(fmt.Sprintf("%s/WBefore[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.WAfter { + if err := v.ValidateWithPath(fmt.Sprintf("%s/WAfter[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.CantSplit { + if err := v.ValidateWithPath(fmt.Sprintf("%s/CantSplit[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.TrHeight { + if err := v.ValidateWithPath(fmt.Sprintf("%s/TrHeight[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.TblHeader { + if err := v.ValidateWithPath(fmt.Sprintf("%s/TblHeader[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.TblCellSpacing { + if err := v.ValidateWithPath(fmt.Sprintf("%s/TblCellSpacing[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.Jc { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Jc[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.Hidden { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Hidden[%d]", path, i)); err != nil { + return err + } + } + if m.Ins != nil { + if err := m.Ins.ValidateWithPath(path + "/Ins"); err != nil { + return err + } + } + if m.Del != nil { + if err := m.Del.ValidateWithPath(path + "/Del"); err != nil { + return err + } + } + if m.TrPrChange != nil { + if err := m.TrPrChange.ValidateWithPath(path + "/TrPrChange"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TrPrBase.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TrPrBase.go new file mode 100644 index 00000000..974ee79c --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TrPrBase.go @@ -0,0 +1,294 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type CT_TrPrBase struct { + // Table Row Conditional Formatting + CnfStyle []*CT_Cnf + // Associated HTML div ID + DivId []*CT_DecimalNumber + // Grid Columns Before First Cell + GridBefore []*CT_DecimalNumber + // Grid Columns After Last Cell + GridAfter []*CT_DecimalNumber + // Preferred Width Before Table Row + WBefore []*CT_TblWidth + // Preferred Width After Table Row + WAfter []*CT_TblWidth + // Table Row Cannot Break Across Pages + CantSplit []*CT_OnOff + // Table Row Height + TrHeight []*CT_Height + // Repeat Table Row on Every New Page + TblHeader []*CT_OnOff + // Table Row Cell Spacing + TblCellSpacing []*CT_TblWidth + // Table Row Alignment + Jc []*CT_JcTable + // Hidden Table Row Marker + Hidden []*CT_OnOff +} + +func NewCT_TrPrBase() *CT_TrPrBase { + ret := &CT_TrPrBase{} + return ret +} + +func (m *CT_TrPrBase) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.CnfStyle != nil { + secnfStyle := xml.StartElement{Name: xml.Name{Local: "w:cnfStyle"}} + for _, c := range m.CnfStyle { + e.EncodeElement(c, secnfStyle) + } + } + if m.DivId != nil { + sedivId := xml.StartElement{Name: xml.Name{Local: "w:divId"}} + for _, c := range m.DivId { + e.EncodeElement(c, sedivId) + } + } + if m.GridBefore != nil { + segridBefore := xml.StartElement{Name: xml.Name{Local: "w:gridBefore"}} + for _, c := range m.GridBefore { + e.EncodeElement(c, segridBefore) + } + } + if m.GridAfter != nil { + segridAfter := xml.StartElement{Name: xml.Name{Local: "w:gridAfter"}} + for _, c := range m.GridAfter { + e.EncodeElement(c, segridAfter) + } + } + if m.WBefore != nil { + sewBefore := xml.StartElement{Name: xml.Name{Local: "w:wBefore"}} + for _, c := range m.WBefore { + e.EncodeElement(c, sewBefore) + } + } + if m.WAfter != nil { + sewAfter := xml.StartElement{Name: xml.Name{Local: "w:wAfter"}} + for _, c := range m.WAfter { + e.EncodeElement(c, sewAfter) + } + } + if m.CantSplit != nil { + secantSplit := xml.StartElement{Name: xml.Name{Local: "w:cantSplit"}} + for _, c := range m.CantSplit { + e.EncodeElement(c, secantSplit) + } + } + if m.TrHeight != nil { + setrHeight := xml.StartElement{Name: xml.Name{Local: "w:trHeight"}} + for _, c := range m.TrHeight { + e.EncodeElement(c, setrHeight) + } + } + if m.TblHeader != nil { + setblHeader := xml.StartElement{Name: xml.Name{Local: "w:tblHeader"}} + for _, c := range m.TblHeader { + e.EncodeElement(c, setblHeader) + } + } + if m.TblCellSpacing != nil { + setblCellSpacing := xml.StartElement{Name: xml.Name{Local: "w:tblCellSpacing"}} + for _, c := range m.TblCellSpacing { + e.EncodeElement(c, setblCellSpacing) + } + } + if m.Jc != nil { + sejc := xml.StartElement{Name: xml.Name{Local: "w:jc"}} + for _, c := range m.Jc { + e.EncodeElement(c, sejc) + } + } + if m.Hidden != nil { + sehidden := xml.StartElement{Name: xml.Name{Local: "w:hidden"}} + for _, c := range m.Hidden { + e.EncodeElement(c, sehidden) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TrPrBase) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_TrPrBase: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "cnfStyle"}: + tmp := NewCT_Cnf() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.CnfStyle = append(m.CnfStyle, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "divId"}: + tmp := NewCT_DecimalNumber() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.DivId = append(m.DivId, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "gridBefore"}: + tmp := NewCT_DecimalNumber() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.GridBefore = append(m.GridBefore, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "gridAfter"}: + tmp := NewCT_DecimalNumber() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.GridAfter = append(m.GridAfter, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "wBefore"}: + tmp := NewCT_TblWidth() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.WBefore = append(m.WBefore, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "wAfter"}: + tmp := NewCT_TblWidth() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.WAfter = append(m.WAfter, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "cantSplit"}: + tmp := NewCT_OnOff() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.CantSplit = append(m.CantSplit, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "trHeight"}: + tmp := NewCT_Height() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.TrHeight = append(m.TrHeight, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblHeader"}: + tmp := NewCT_OnOff() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.TblHeader = append(m.TblHeader, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tblCellSpacing"}: + tmp := NewCT_TblWidth() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.TblCellSpacing = append(m.TblCellSpacing, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "jc"}: + tmp := NewCT_JcTable() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Jc = append(m.Jc, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "hidden"}: + tmp := NewCT_OnOff() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Hidden = append(m.Hidden, tmp) + default: + gooxml.Log("skipping unsupported element on CT_TrPrBase %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TrPrBase + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TrPrBase and its children +func (m *CT_TrPrBase) Validate() error { + return m.ValidateWithPath("CT_TrPrBase") +} + +// ValidateWithPath validates the CT_TrPrBase and its children, prefixing error messages with path +func (m *CT_TrPrBase) ValidateWithPath(path string) error { + for i, v := range m.CnfStyle { + if err := v.ValidateWithPath(fmt.Sprintf("%s/CnfStyle[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.DivId { + if err := v.ValidateWithPath(fmt.Sprintf("%s/DivId[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.GridBefore { + if err := v.ValidateWithPath(fmt.Sprintf("%s/GridBefore[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.GridAfter { + if err := v.ValidateWithPath(fmt.Sprintf("%s/GridAfter[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.WBefore { + if err := v.ValidateWithPath(fmt.Sprintf("%s/WBefore[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.WAfter { + if err := v.ValidateWithPath(fmt.Sprintf("%s/WAfter[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.CantSplit { + if err := v.ValidateWithPath(fmt.Sprintf("%s/CantSplit[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.TrHeight { + if err := v.ValidateWithPath(fmt.Sprintf("%s/TrHeight[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.TblHeader { + if err := v.ValidateWithPath(fmt.Sprintf("%s/TblHeader[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.TblCellSpacing { + if err := v.ValidateWithPath(fmt.Sprintf("%s/TblCellSpacing[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.Jc { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Jc[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.Hidden { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Hidden[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TrPrChange.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TrPrChange.go new file mode 100644 index 00000000..3cf41cf7 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TrPrChange.go @@ -0,0 +1,118 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + "time" + + "baliance.com/gooxml" +) + +type CT_TrPrChange struct { + AuthorAttr string + DateAttr *time.Time + // Annotation Identifier + IdAttr int64 + TrPr *CT_TrPrBase +} + +func NewCT_TrPrChange() *CT_TrPrChange { + ret := &CT_TrPrChange{} + ret.TrPr = NewCT_TrPrBase() + return ret +} + +func (m *CT_TrPrChange) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:author"}, + Value: fmt.Sprintf("%v", m.AuthorAttr)}) + if m.DateAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:date"}, + Value: fmt.Sprintf("%v", *m.DateAttr)}) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:id"}, + Value: fmt.Sprintf("%v", m.IdAttr)}) + e.EncodeToken(start) + setrPr := xml.StartElement{Name: xml.Name{Local: "w:trPr"}} + e.EncodeElement(m.TrPr, setrPr) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TrPrChange) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.TrPr = NewCT_TrPrBase() + for _, attr := range start.Attr { + if attr.Name.Local == "author" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.AuthorAttr = parsed + continue + } + if attr.Name.Local == "date" { + parsed, err := ParseStdlibTime(attr.Value) + if err != nil { + return err + } + m.DateAttr = &parsed + continue + } + if attr.Name.Local == "id" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.IdAttr = parsed + continue + } + } +lCT_TrPrChange: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "trPr"}: + if err := d.DecodeElement(m.TrPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_TrPrChange %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TrPrChange + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TrPrChange and its children +func (m *CT_TrPrChange) Validate() error { + return m.ValidateWithPath("CT_TrPrChange") +} + +// ValidateWithPath validates the CT_TrPrChange and its children, prefixing error messages with path +func (m *CT_TrPrChange) ValidateWithPath(path string) error { + if err := m.TrPr.ValidateWithPath(path + "/TrPr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TrackChange.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TrackChange.go new file mode 100644 index 00000000..df063d1f --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TrackChange.go @@ -0,0 +1,94 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + "time" +) + +type CT_TrackChange struct { + AuthorAttr string + DateAttr *time.Time + // Annotation Identifier + IdAttr int64 +} + +func NewCT_TrackChange() *CT_TrackChange { + ret := &CT_TrackChange{} + return ret +} + +func (m *CT_TrackChange) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:author"}, + Value: fmt.Sprintf("%v", m.AuthorAttr)}) + if m.DateAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:date"}, + Value: fmt.Sprintf("%v", *m.DateAttr)}) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:id"}, + Value: fmt.Sprintf("%v", m.IdAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TrackChange) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "author" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.AuthorAttr = parsed + continue + } + if attr.Name.Local == "date" { + parsed, err := ParseStdlibTime(attr.Value) + if err != nil { + return err + } + m.DateAttr = &parsed + continue + } + if attr.Name.Local == "id" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.IdAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_TrackChange: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_TrackChange and its children +func (m *CT_TrackChange) Validate() error { + return m.ValidateWithPath("CT_TrackChange") +} + +// ValidateWithPath validates the CT_TrackChange and its children, prefixing error messages with path +func (m *CT_TrackChange) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TrackChangeNumbering.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TrackChangeNumbering.go new file mode 100644 index 00000000..5fdbf9a2 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TrackChangeNumbering.go @@ -0,0 +1,107 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + "time" +) + +type CT_TrackChangeNumbering struct { + OriginalAttr *string + AuthorAttr string + DateAttr *time.Time + // Annotation Identifier + IdAttr int64 +} + +func NewCT_TrackChangeNumbering() *CT_TrackChangeNumbering { + ret := &CT_TrackChangeNumbering{} + return ret +} + +func (m *CT_TrackChangeNumbering) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.OriginalAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:original"}, + Value: fmt.Sprintf("%v", *m.OriginalAttr)}) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:author"}, + Value: fmt.Sprintf("%v", m.AuthorAttr)}) + if m.DateAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:date"}, + Value: fmt.Sprintf("%v", *m.DateAttr)}) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:id"}, + Value: fmt.Sprintf("%v", m.IdAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TrackChangeNumbering) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "original" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.OriginalAttr = &parsed + continue + } + if attr.Name.Local == "author" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.AuthorAttr = parsed + continue + } + if attr.Name.Local == "date" { + parsed, err := ParseStdlibTime(attr.Value) + if err != nil { + return err + } + m.DateAttr = &parsed + continue + } + if attr.Name.Local == "id" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.IdAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_TrackChangeNumbering: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_TrackChangeNumbering and its children +func (m *CT_TrackChangeNumbering) Validate() error { + return m.ValidateWithPath("CT_TrackChangeNumbering") +} + +// ValidateWithPath validates the CT_TrackChangeNumbering and its children, prefixing error messages with path +func (m *CT_TrackChangeNumbering) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TrackChangeRange.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TrackChangeRange.go new file mode 100644 index 00000000..48a98444 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TrackChangeRange.go @@ -0,0 +1,110 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + "time" +) + +type CT_TrackChangeRange struct { + DisplacedByCustomXmlAttr ST_DisplacedByCustomXml + AuthorAttr string + DateAttr *time.Time + // Annotation Identifier + IdAttr int64 +} + +func NewCT_TrackChangeRange() *CT_TrackChangeRange { + ret := &CT_TrackChangeRange{} + return ret +} + +func (m *CT_TrackChangeRange) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.DisplacedByCustomXmlAttr != ST_DisplacedByCustomXmlUnset { + attr, err := m.DisplacedByCustomXmlAttr.MarshalXMLAttr(xml.Name{Local: "w:displacedByCustomXml"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:author"}, + Value: fmt.Sprintf("%v", m.AuthorAttr)}) + if m.DateAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:date"}, + Value: fmt.Sprintf("%v", *m.DateAttr)}) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:id"}, + Value: fmt.Sprintf("%v", m.IdAttr)}) + start.Name.Local = "w:CT_TrackChangeRange" + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TrackChangeRange) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "displacedByCustomXml" { + m.DisplacedByCustomXmlAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "author" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.AuthorAttr = parsed + continue + } + if attr.Name.Local == "date" { + parsed, err := ParseStdlibTime(attr.Value) + if err != nil { + return err + } + m.DateAttr = &parsed + continue + } + if attr.Name.Local == "id" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.IdAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_TrackChangeRange: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_TrackChangeRange and its children +func (m *CT_TrackChangeRange) Validate() error { + return m.ValidateWithPath("CT_TrackChangeRange") +} + +// ValidateWithPath validates the CT_TrackChangeRange and its children, prefixing error messages with path +func (m *CT_TrackChangeRange) ValidateWithPath(path string) error { + if err := m.DisplacedByCustomXmlAttr.ValidateWithPath(path + "/DisplacedByCustomXmlAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TrackChangesView.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TrackChangesView.go new file mode 100644 index 00000000..3abd5713 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TrackChangesView.go @@ -0,0 +1,153 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_TrackChangesView struct { + // Display Visual Indicator Of Markup Area + MarkupAttr *sharedTypes.ST_OnOff + // Display Comments + CommentsAttr *sharedTypes.ST_OnOff + // Display Content Revisions + InsDelAttr *sharedTypes.ST_OnOff + // Display Formatting Revisions + FormattingAttr *sharedTypes.ST_OnOff + // Display Ink Annotations + InkAnnotationsAttr *sharedTypes.ST_OnOff +} + +func NewCT_TrackChangesView() *CT_TrackChangesView { + ret := &CT_TrackChangesView{} + return ret +} + +func (m *CT_TrackChangesView) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.MarkupAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:markup"}, + Value: fmt.Sprintf("%v", *m.MarkupAttr)}) + } + if m.CommentsAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:comments"}, + Value: fmt.Sprintf("%v", *m.CommentsAttr)}) + } + if m.InsDelAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:insDel"}, + Value: fmt.Sprintf("%v", *m.InsDelAttr)}) + } + if m.FormattingAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:formatting"}, + Value: fmt.Sprintf("%v", *m.FormattingAttr)}) + } + if m.InkAnnotationsAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:inkAnnotations"}, + Value: fmt.Sprintf("%v", *m.InkAnnotationsAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TrackChangesView) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "markup" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.MarkupAttr = &parsed + continue + } + if attr.Name.Local == "comments" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.CommentsAttr = &parsed + continue + } + if attr.Name.Local == "insDel" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.InsDelAttr = &parsed + continue + } + if attr.Name.Local == "formatting" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.FormattingAttr = &parsed + continue + } + if attr.Name.Local == "inkAnnotations" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.InkAnnotationsAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_TrackChangesView: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_TrackChangesView and its children +func (m *CT_TrackChangesView) Validate() error { + return m.ValidateWithPath("CT_TrackChangesView") +} + +// ValidateWithPath validates the CT_TrackChangesView and its children, prefixing error messages with path +func (m *CT_TrackChangesView) ValidateWithPath(path string) error { + if m.MarkupAttr != nil { + if err := m.MarkupAttr.ValidateWithPath(path + "/MarkupAttr"); err != nil { + return err + } + } + if m.CommentsAttr != nil { + if err := m.CommentsAttr.ValidateWithPath(path + "/CommentsAttr"); err != nil { + return err + } + } + if m.InsDelAttr != nil { + if err := m.InsDelAttr.ValidateWithPath(path + "/InsDelAttr"); err != nil { + return err + } + } + if m.FormattingAttr != nil { + if err := m.FormattingAttr.ValidateWithPath(path + "/FormattingAttr"); err != nil { + return err + } + } + if m.InkAnnotationsAttr != nil { + if err := m.InkAnnotationsAttr.ValidateWithPath(path + "/InkAnnotationsAttr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TwipsMeasure.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TwipsMeasure.go new file mode 100644 index 00000000..324d0784 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TwipsMeasure.go @@ -0,0 +1,73 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_TwipsMeasure struct { + // Measurement in Twentieths of a Point + ValAttr sharedTypes.ST_TwipsMeasure +} + +func NewCT_TwipsMeasure() *CT_TwipsMeasure { + ret := &CT_TwipsMeasure{} + return ret +} + +func (m *CT_TwipsMeasure) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:val"}, + Value: fmt.Sprintf("%v", m.ValAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TwipsMeasure) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := ParseUnionST_TwipsMeasure(attr.Value) + if err != nil { + return err + } + m.ValAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_TwipsMeasure: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_TwipsMeasure and its children +func (m *CT_TwipsMeasure) Validate() error { + return m.ValidateWithPath("CT_TwipsMeasure") +} + +// ValidateWithPath validates the CT_TwipsMeasure and its children, prefixing error messages with path +func (m *CT_TwipsMeasure) ValidateWithPath(path string) error { + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TxbxContent.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TxbxContent.go new file mode 100644 index 00000000..46896d3c --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_TxbxContent.go @@ -0,0 +1,388 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/math" +) + +type CT_TxbxContent struct { + // Anchor for Imported External Content + AltChunk []*CT_AltChunk + EG_ContentBlockContent []*EG_ContentBlockContent +} + +func NewCT_TxbxContent() *CT_TxbxContent { + ret := &CT_TxbxContent{} + return ret +} + +func (m *CT_TxbxContent) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.AltChunk != nil { + sealtChunk := xml.StartElement{Name: xml.Name{Local: "w:altChunk"}} + for _, c := range m.AltChunk { + e.EncodeElement(c, sealtChunk) + } + } + if m.EG_ContentBlockContent != nil { + for _, c := range m.EG_ContentBlockContent { + c.MarshalXML(e, xml.StartElement{}) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_TxbxContent) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_TxbxContent: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "altChunk"}: + tmp := NewCT_AltChunk() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.AltChunk = append(m.AltChunk, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXml"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmpcontentblockcontent.CustomXml = NewCT_CustomXmlBlock() + if err := d.DecodeElement(tmpcontentblockcontent.CustomXml, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdt"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmpcontentblockcontent.Sdt = NewCT_SdtBlock() + if err := d.DecodeElement(tmpcontentblockcontent.Sdt, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "p"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmp := NewCT_P() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + tmpcontentblockcontent.P = append(tmpcontentblockcontent.P, tmp) + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tbl"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmp := NewCT_Tbl() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + tmpcontentblockcontent.Tbl = append(tmpcontentblockcontent.Tbl, tmp) + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "proofErr"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.ProofErr = NewCT_ProofErr() + if err := d.DecodeElement(tmprunlevelelts.ProofErr, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermStart = NewCT_PermStart() + if err := d.DecodeElement(tmprunlevelelts.PermStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermEnd = NewCT_Perm() + if err := d.DecodeElement(tmprunlevelelts.PermEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Ins = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Ins, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Del = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Del, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFrom"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveFrom = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveFrom, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveTo"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveTo = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveTo, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkStart = NewCT_Bookmark() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeStart = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMathPara"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMathPara = math.NewOMathPara() + if err := d.DecodeElement(tmpmathcontent.OMathPara, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMath"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMath = math.NewOMath() + if err := d.DecodeElement(tmpmathcontent.OMath, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + default: + gooxml.Log("skipping unsupported element on CT_TxbxContent %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_TxbxContent + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_TxbxContent and its children +func (m *CT_TxbxContent) Validate() error { + return m.ValidateWithPath("CT_TxbxContent") +} + +// ValidateWithPath validates the CT_TxbxContent and its children, prefixing error messages with path +func (m *CT_TxbxContent) ValidateWithPath(path string) error { + for i, v := range m.AltChunk { + if err := v.ValidateWithPath(fmt.Sprintf("%s/AltChunk[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.EG_ContentBlockContent { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_ContentBlockContent[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Underline.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Underline.go new file mode 100644 index 00000000..11e551ed --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Underline.go @@ -0,0 +1,135 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_Underline struct { + // Underline Style + ValAttr ST_Underline + // Underline Color + ColorAttr *ST_HexColor + // Underline Theme Color + ThemeColorAttr ST_ThemeColor + // Underline Theme Color Tint + ThemeTintAttr *string + // Underline Theme Color Shade + ThemeShadeAttr *string +} + +func NewCT_Underline() *CT_Underline { + ret := &CT_Underline{} + return ret +} + +func (m *CT_Underline) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.ValAttr != ST_UnderlineUnset { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.ColorAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:color"}, + Value: fmt.Sprintf("%v", *m.ColorAttr)}) + } + if m.ThemeColorAttr != ST_ThemeColorUnset { + attr, err := m.ThemeColorAttr.MarshalXMLAttr(xml.Name{Local: "w:themeColor"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.ThemeTintAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:themeTint"}, + Value: fmt.Sprintf("%v", *m.ThemeTintAttr)}) + } + if m.ThemeShadeAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:themeShade"}, + Value: fmt.Sprintf("%v", *m.ThemeShadeAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Underline) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "color" { + parsed, err := ParseUnionST_HexColor(attr.Value) + if err != nil { + return err + } + m.ColorAttr = &parsed + continue + } + if attr.Name.Local == "themeColor" { + m.ThemeColorAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "themeTint" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ThemeTintAttr = &parsed + continue + } + if attr.Name.Local == "themeShade" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.ThemeShadeAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Underline: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Underline and its children +func (m *CT_Underline) Validate() error { + return m.ValidateWithPath("CT_Underline") +} + +// ValidateWithPath validates the CT_Underline and its children, prefixing error messages with path +func (m *CT_Underline) ValidateWithPath(path string) error { + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + if m.ColorAttr != nil { + if err := m.ColorAttr.ValidateWithPath(path + "/ColorAttr"); err != nil { + return err + } + } + if err := m.ThemeColorAttr.ValidateWithPath(path + "/ThemeColorAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_UnsignedDecimalNumber.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_UnsignedDecimalNumber.go new file mode 100644 index 00000000..d5e40634 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_UnsignedDecimalNumber.go @@ -0,0 +1,69 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" +) + +type CT_UnsignedDecimalNumber struct { + // Positive Decimal Number Value + ValAttr uint64 +} + +func NewCT_UnsignedDecimalNumber() *CT_UnsignedDecimalNumber { + ret := &CT_UnsignedDecimalNumber{} + return ret +} + +func (m *CT_UnsignedDecimalNumber) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:val"}, + Value: fmt.Sprintf("%v", m.ValAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_UnsignedDecimalNumber) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + parsed, err := strconv.ParseUint(attr.Value, 10, 64) + if err != nil { + return err + } + m.ValAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_UnsignedDecimalNumber: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_UnsignedDecimalNumber and its children +func (m *CT_UnsignedDecimalNumber) Validate() error { + return m.ValidateWithPath("CT_UnsignedDecimalNumber") +} + +// ValidateWithPath validates the CT_UnsignedDecimalNumber and its children, prefixing error messages with path +func (m *CT_UnsignedDecimalNumber) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_VMerge.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_VMerge.go new file mode 100644 index 00000000..dd790f30 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_VMerge.go @@ -0,0 +1,72 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_VMerge struct { + // Vertical Merge Type + ValAttr ST_Merge +} + +func NewCT_VMerge() *CT_VMerge { + ret := &CT_VMerge{} + return ret +} + +func (m *CT_VMerge) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.ValAttr != ST_MergeUnset { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_VMerge) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_VMerge: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_VMerge and its children +func (m *CT_VMerge) Validate() error { + return m.ValidateWithPath("CT_VMerge") +} + +// ValidateWithPath validates the CT_VMerge and its children, prefixing error messages with path +func (m *CT_VMerge) ValidateWithPath(path string) error { + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_VerticalAlignRun.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_VerticalAlignRun.go new file mode 100644 index 00000000..206df47b --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_VerticalAlignRun.go @@ -0,0 +1,77 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_VerticalAlignRun struct { + // Subscript/Superscript Value + ValAttr sharedTypes.ST_VerticalAlignRun +} + +func NewCT_VerticalAlignRun() *CT_VerticalAlignRun { + ret := &CT_VerticalAlignRun{} + ret.ValAttr = sharedTypes.ST_VerticalAlignRun(1) + return ret +} + +func (m *CT_VerticalAlignRun) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_VerticalAlignRun) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = sharedTypes.ST_VerticalAlignRun(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_VerticalAlignRun: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_VerticalAlignRun and its children +func (m *CT_VerticalAlignRun) Validate() error { + return m.ValidateWithPath("CT_VerticalAlignRun") +} + +// ValidateWithPath validates the CT_VerticalAlignRun and its children, prefixing error messages with path +func (m *CT_VerticalAlignRun) ValidateWithPath(path string) error { + if m.ValAttr == sharedTypes.ST_VerticalAlignRunUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_VerticalJc.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_VerticalJc.go new file mode 100644 index 00000000..eaafa2e4 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_VerticalJc.go @@ -0,0 +1,75 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_VerticalJc struct { + // Vertical Alignment Setting + ValAttr ST_VerticalJc +} + +func NewCT_VerticalJc() *CT_VerticalJc { + ret := &CT_VerticalJc{} + ret.ValAttr = ST_VerticalJc(1) + return ret +} + +func (m *CT_VerticalJc) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_VerticalJc) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_VerticalJc(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_VerticalJc: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_VerticalJc and its children +func (m *CT_VerticalJc) Validate() error { + return m.ValidateWithPath("CT_VerticalJc") +} + +// ValidateWithPath validates the CT_VerticalJc and its children, prefixing error messages with path +func (m *CT_VerticalJc) ValidateWithPath(path string) error { + if m.ValAttr == ST_VerticalJcUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_View.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_View.go new file mode 100644 index 00000000..0cf5b912 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_View.go @@ -0,0 +1,75 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_View struct { + // Document View Setting Value + ValAttr ST_View +} + +func NewCT_View() *CT_View { + ret := &CT_View{} + ret.ValAttr = ST_View(1) + return ret +} + +func (m *CT_View) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_View) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.ValAttr = ST_View(1) + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_View: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_View and its children +func (m *CT_View) Validate() error { + return m.ValidateWithPath("CT_View") +} + +// ValidateWithPath validates the CT_View and its children, prefixing error messages with path +func (m *CT_View) ValidateWithPath(path string) error { + if m.ValAttr == ST_ViewUnset { + return fmt.Errorf("%s/ValAttr is a mandatory field", path) + } + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_WebSettings.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_WebSettings.go new file mode 100644 index 00000000..cba07028 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_WebSettings.go @@ -0,0 +1,273 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type CT_WebSettings struct { + // Root Frameset Definition + Frameset *CT_Frameset + // Information about HTML div Elements + Divs *CT_Divs + // Output Encoding When Saving as Web Page + Encoding *CT_String + // Disable Features Not Supported by Target Web Browser + OptimizeForBrowser *CT_OptimizeForBrowser + // Utilize VML When Saving as Web Page + RelyOnVML *CT_OnOff + // Allow PNG as Graphic Format + AllowPNG *CT_OnOff + // Do Not Rely on CSS for Font Face Formatting + DoNotRelyOnCSS *CT_OnOff + // Recommend Web Page Format over Single File Web Page Format + DoNotSaveAsSingleFile *CT_OnOff + // Do Not Place Supporting Files in Subdirectory + DoNotOrganizeInFolder *CT_OnOff + // Do Not Use File Names Longer than 8.3 Characters + DoNotUseLongFileNames *CT_OnOff + // Pixels per Inch for Graphics/Images + PixelsPerInch *CT_DecimalNumber + // Target Screen Size for Web Page + TargetScreenSz *CT_TargetScreenSz + // Save Smart Tag Data in XML Property Bag + SaveSmartTagsAsXml *CT_OnOff +} + +func NewCT_WebSettings() *CT_WebSettings { + ret := &CT_WebSettings{} + return ret +} + +func (m *CT_WebSettings) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Frameset != nil { + seframeset := xml.StartElement{Name: xml.Name{Local: "w:frameset"}} + e.EncodeElement(m.Frameset, seframeset) + } + if m.Divs != nil { + sedivs := xml.StartElement{Name: xml.Name{Local: "w:divs"}} + e.EncodeElement(m.Divs, sedivs) + } + if m.Encoding != nil { + seencoding := xml.StartElement{Name: xml.Name{Local: "w:encoding"}} + e.EncodeElement(m.Encoding, seencoding) + } + if m.OptimizeForBrowser != nil { + seoptimizeForBrowser := xml.StartElement{Name: xml.Name{Local: "w:optimizeForBrowser"}} + e.EncodeElement(m.OptimizeForBrowser, seoptimizeForBrowser) + } + if m.RelyOnVML != nil { + serelyOnVML := xml.StartElement{Name: xml.Name{Local: "w:relyOnVML"}} + e.EncodeElement(m.RelyOnVML, serelyOnVML) + } + if m.AllowPNG != nil { + seallowPNG := xml.StartElement{Name: xml.Name{Local: "w:allowPNG"}} + e.EncodeElement(m.AllowPNG, seallowPNG) + } + if m.DoNotRelyOnCSS != nil { + sedoNotRelyOnCSS := xml.StartElement{Name: xml.Name{Local: "w:doNotRelyOnCSS"}} + e.EncodeElement(m.DoNotRelyOnCSS, sedoNotRelyOnCSS) + } + if m.DoNotSaveAsSingleFile != nil { + sedoNotSaveAsSingleFile := xml.StartElement{Name: xml.Name{Local: "w:doNotSaveAsSingleFile"}} + e.EncodeElement(m.DoNotSaveAsSingleFile, sedoNotSaveAsSingleFile) + } + if m.DoNotOrganizeInFolder != nil { + sedoNotOrganizeInFolder := xml.StartElement{Name: xml.Name{Local: "w:doNotOrganizeInFolder"}} + e.EncodeElement(m.DoNotOrganizeInFolder, sedoNotOrganizeInFolder) + } + if m.DoNotUseLongFileNames != nil { + sedoNotUseLongFileNames := xml.StartElement{Name: xml.Name{Local: "w:doNotUseLongFileNames"}} + e.EncodeElement(m.DoNotUseLongFileNames, sedoNotUseLongFileNames) + } + if m.PixelsPerInch != nil { + sepixelsPerInch := xml.StartElement{Name: xml.Name{Local: "w:pixelsPerInch"}} + e.EncodeElement(m.PixelsPerInch, sepixelsPerInch) + } + if m.TargetScreenSz != nil { + setargetScreenSz := xml.StartElement{Name: xml.Name{Local: "w:targetScreenSz"}} + e.EncodeElement(m.TargetScreenSz, setargetScreenSz) + } + if m.SaveSmartTagsAsXml != nil { + sesaveSmartTagsAsXml := xml.StartElement{Name: xml.Name{Local: "w:saveSmartTagsAsXml"}} + e.EncodeElement(m.SaveSmartTagsAsXml, sesaveSmartTagsAsXml) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_WebSettings) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lCT_WebSettings: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "frameset"}: + m.Frameset = NewCT_Frameset() + if err := d.DecodeElement(m.Frameset, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "divs"}: + m.Divs = NewCT_Divs() + if err := d.DecodeElement(m.Divs, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "encoding"}: + m.Encoding = NewCT_String() + if err := d.DecodeElement(m.Encoding, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "optimizeForBrowser"}: + m.OptimizeForBrowser = NewCT_OptimizeForBrowser() + if err := d.DecodeElement(m.OptimizeForBrowser, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "relyOnVML"}: + m.RelyOnVML = NewCT_OnOff() + if err := d.DecodeElement(m.RelyOnVML, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "allowPNG"}: + m.AllowPNG = NewCT_OnOff() + if err := d.DecodeElement(m.AllowPNG, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotRelyOnCSS"}: + m.DoNotRelyOnCSS = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotRelyOnCSS, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotSaveAsSingleFile"}: + m.DoNotSaveAsSingleFile = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotSaveAsSingleFile, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotOrganizeInFolder"}: + m.DoNotOrganizeInFolder = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotOrganizeInFolder, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotUseLongFileNames"}: + m.DoNotUseLongFileNames = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotUseLongFileNames, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pixelsPerInch"}: + m.PixelsPerInch = NewCT_DecimalNumber() + if err := d.DecodeElement(m.PixelsPerInch, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "targetScreenSz"}: + m.TargetScreenSz = NewCT_TargetScreenSz() + if err := d.DecodeElement(m.TargetScreenSz, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "saveSmartTagsAsXml"}: + m.SaveSmartTagsAsXml = NewCT_OnOff() + if err := d.DecodeElement(m.SaveSmartTagsAsXml, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on CT_WebSettings %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lCT_WebSettings + case xml.CharData: + } + } + return nil +} + +// Validate validates the CT_WebSettings and its children +func (m *CT_WebSettings) Validate() error { + return m.ValidateWithPath("CT_WebSettings") +} + +// ValidateWithPath validates the CT_WebSettings and its children, prefixing error messages with path +func (m *CT_WebSettings) ValidateWithPath(path string) error { + if m.Frameset != nil { + if err := m.Frameset.ValidateWithPath(path + "/Frameset"); err != nil { + return err + } + } + if m.Divs != nil { + if err := m.Divs.ValidateWithPath(path + "/Divs"); err != nil { + return err + } + } + if m.Encoding != nil { + if err := m.Encoding.ValidateWithPath(path + "/Encoding"); err != nil { + return err + } + } + if m.OptimizeForBrowser != nil { + if err := m.OptimizeForBrowser.ValidateWithPath(path + "/OptimizeForBrowser"); err != nil { + return err + } + } + if m.RelyOnVML != nil { + if err := m.RelyOnVML.ValidateWithPath(path + "/RelyOnVML"); err != nil { + return err + } + } + if m.AllowPNG != nil { + if err := m.AllowPNG.ValidateWithPath(path + "/AllowPNG"); err != nil { + return err + } + } + if m.DoNotRelyOnCSS != nil { + if err := m.DoNotRelyOnCSS.ValidateWithPath(path + "/DoNotRelyOnCSS"); err != nil { + return err + } + } + if m.DoNotSaveAsSingleFile != nil { + if err := m.DoNotSaveAsSingleFile.ValidateWithPath(path + "/DoNotSaveAsSingleFile"); err != nil { + return err + } + } + if m.DoNotOrganizeInFolder != nil { + if err := m.DoNotOrganizeInFolder.ValidateWithPath(path + "/DoNotOrganizeInFolder"); err != nil { + return err + } + } + if m.DoNotUseLongFileNames != nil { + if err := m.DoNotUseLongFileNames.ValidateWithPath(path + "/DoNotUseLongFileNames"); err != nil { + return err + } + } + if m.PixelsPerInch != nil { + if err := m.PixelsPerInch.ValidateWithPath(path + "/PixelsPerInch"); err != nil { + return err + } + } + if m.TargetScreenSz != nil { + if err := m.TargetScreenSz.ValidateWithPath(path + "/TargetScreenSz"); err != nil { + return err + } + } + if m.SaveSmartTagsAsXml != nil { + if err := m.SaveSmartTagsAsXml.ValidateWithPath(path + "/SaveSmartTagsAsXml"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_WriteProtection.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_WriteProtection.go new file mode 100644 index 00000000..1fa1429d --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_WriteProtection.go @@ -0,0 +1,292 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_WriteProtection struct { + // Recommend Write Protection in User Interface + RecommendedAttr *sharedTypes.ST_OnOff + AlgorithmNameAttr *string + HashValueAttr *string + SaltValueAttr *string + SpinCountAttr *int64 + CryptProviderTypeAttr sharedTypes.ST_CryptProv + CryptAlgorithmClassAttr sharedTypes.ST_AlgClass + CryptAlgorithmTypeAttr sharedTypes.ST_AlgType + CryptAlgorithmSidAttr *int64 + CryptSpinCountAttr *int64 + CryptProviderAttr *string + AlgIdExtAttr *string + AlgIdExtSourceAttr *string + CryptProviderTypeExtAttr *string + CryptProviderTypeExtSourceAttr *string + HashAttr *string + SaltAttr *string +} + +func NewCT_WriteProtection() *CT_WriteProtection { + ret := &CT_WriteProtection{} + return ret +} + +func (m *CT_WriteProtection) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.RecommendedAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:recommended"}, + Value: fmt.Sprintf("%v", *m.RecommendedAttr)}) + } + if m.AlgorithmNameAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:algorithmName"}, + Value: fmt.Sprintf("%v", *m.AlgorithmNameAttr)}) + } + if m.HashValueAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:hashValue"}, + Value: fmt.Sprintf("%v", *m.HashValueAttr)}) + } + if m.SaltValueAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:saltValue"}, + Value: fmt.Sprintf("%v", *m.SaltValueAttr)}) + } + if m.SpinCountAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:spinCount"}, + Value: fmt.Sprintf("%v", *m.SpinCountAttr)}) + } + if m.CryptProviderTypeAttr != sharedTypes.ST_CryptProvUnset { + attr, err := m.CryptProviderTypeAttr.MarshalXMLAttr(xml.Name{Local: "w:cryptProviderType"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.CryptAlgorithmClassAttr != sharedTypes.ST_AlgClassUnset { + attr, err := m.CryptAlgorithmClassAttr.MarshalXMLAttr(xml.Name{Local: "w:cryptAlgorithmClass"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.CryptAlgorithmTypeAttr != sharedTypes.ST_AlgTypeUnset { + attr, err := m.CryptAlgorithmTypeAttr.MarshalXMLAttr(xml.Name{Local: "w:cryptAlgorithmType"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + if m.CryptAlgorithmSidAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:cryptAlgorithmSid"}, + Value: fmt.Sprintf("%v", *m.CryptAlgorithmSidAttr)}) + } + if m.CryptSpinCountAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:cryptSpinCount"}, + Value: fmt.Sprintf("%v", *m.CryptSpinCountAttr)}) + } + if m.CryptProviderAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:cryptProvider"}, + Value: fmt.Sprintf("%v", *m.CryptProviderAttr)}) + } + if m.AlgIdExtAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:algIdExt"}, + Value: fmt.Sprintf("%v", *m.AlgIdExtAttr)}) + } + if m.AlgIdExtSourceAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:algIdExtSource"}, + Value: fmt.Sprintf("%v", *m.AlgIdExtSourceAttr)}) + } + if m.CryptProviderTypeExtAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:cryptProviderTypeExt"}, + Value: fmt.Sprintf("%v", *m.CryptProviderTypeExtAttr)}) + } + if m.CryptProviderTypeExtSourceAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:cryptProviderTypeExtSource"}, + Value: fmt.Sprintf("%v", *m.CryptProviderTypeExtSourceAttr)}) + } + if m.HashAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:hash"}, + Value: fmt.Sprintf("%v", *m.HashAttr)}) + } + if m.SaltAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:salt"}, + Value: fmt.Sprintf("%v", *m.SaltAttr)}) + } + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_WriteProtection) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "cryptAlgorithmSid" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.CryptAlgorithmSidAttr = &parsed + continue + } + if attr.Name.Local == "cryptSpinCount" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.CryptSpinCountAttr = &parsed + continue + } + if attr.Name.Local == "algorithmName" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.AlgorithmNameAttr = &parsed + continue + } + if attr.Name.Local == "cryptProvider" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.CryptProviderAttr = &parsed + continue + } + if attr.Name.Local == "saltValue" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.SaltValueAttr = &parsed + continue + } + if attr.Name.Local == "cryptProviderType" { + m.CryptProviderTypeAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "cryptAlgorithmClass" { + m.CryptAlgorithmClassAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "cryptAlgorithmType" { + m.CryptAlgorithmTypeAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "recommended" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.RecommendedAttr = &parsed + continue + } + if attr.Name.Local == "hashValue" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.HashValueAttr = &parsed + continue + } + if attr.Name.Local == "spinCount" { + parsed, err := strconv.ParseInt(attr.Value, 10, 64) + if err != nil { + return err + } + m.SpinCountAttr = &parsed + continue + } + if attr.Name.Local == "algIdExt" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.AlgIdExtAttr = &parsed + continue + } + if attr.Name.Local == "algIdExtSource" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.AlgIdExtSourceAttr = &parsed + continue + } + if attr.Name.Local == "cryptProviderTypeExt" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.CryptProviderTypeExtAttr = &parsed + continue + } + if attr.Name.Local == "cryptProviderTypeExtSource" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.CryptProviderTypeExtSourceAttr = &parsed + continue + } + if attr.Name.Local == "hash" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.HashAttr = &parsed + continue + } + if attr.Name.Local == "salt" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.SaltAttr = &parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_WriteProtection: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_WriteProtection and its children +func (m *CT_WriteProtection) Validate() error { + return m.ValidateWithPath("CT_WriteProtection") +} + +// ValidateWithPath validates the CT_WriteProtection and its children, prefixing error messages with path +func (m *CT_WriteProtection) ValidateWithPath(path string) error { + if m.RecommendedAttr != nil { + if err := m.RecommendedAttr.ValidateWithPath(path + "/RecommendedAttr"); err != nil { + return err + } + } + if err := m.CryptProviderTypeAttr.ValidateWithPath(path + "/CryptProviderTypeAttr"); err != nil { + return err + } + if err := m.CryptAlgorithmClassAttr.ValidateWithPath(path + "/CryptAlgorithmClassAttr"); err != nil { + return err + } + if err := m.CryptAlgorithmTypeAttr.ValidateWithPath(path + "/CryptAlgorithmTypeAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_WritingStyle.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_WritingStyle.go new file mode 100644 index 00000000..713179b2 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_WritingStyle.go @@ -0,0 +1,140 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +type CT_WritingStyle struct { + // Writing Style Language + LangAttr string + // Grammatical Engine ID + VendorIDAttr string + // Grammatical Check Engine Version + DllVersionAttr string + // Natural Language Grammar Check + NlCheckAttr *sharedTypes.ST_OnOff + // Check Stylistic Rules With Grammar + CheckStyleAttr sharedTypes.ST_OnOff + // Application Name + AppNameAttr string +} + +func NewCT_WritingStyle() *CT_WritingStyle { + ret := &CT_WritingStyle{} + return ret +} + +func (m *CT_WritingStyle) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:lang"}, + Value: fmt.Sprintf("%v", m.LangAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:vendorID"}, + Value: fmt.Sprintf("%v", m.VendorIDAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:dllVersion"}, + Value: fmt.Sprintf("%v", m.DllVersionAttr)}) + if m.NlCheckAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:nlCheck"}, + Value: fmt.Sprintf("%v", *m.NlCheckAttr)}) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:checkStyle"}, + Value: fmt.Sprintf("%v", m.CheckStyleAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:appName"}, + Value: fmt.Sprintf("%v", m.AppNameAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_WritingStyle) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "lang" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.LangAttr = parsed + continue + } + if attr.Name.Local == "vendorID" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.VendorIDAttr = parsed + continue + } + if attr.Name.Local == "dllVersion" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.DllVersionAttr = parsed + continue + } + if attr.Name.Local == "nlCheck" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.NlCheckAttr = &parsed + continue + } + if attr.Name.Local == "checkStyle" { + parsed, err := ParseUnionST_OnOff(attr.Value) + if err != nil { + return err + } + m.CheckStyleAttr = parsed + continue + } + if attr.Name.Local == "appName" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.AppNameAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_WritingStyle: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_WritingStyle and its children +func (m *CT_WritingStyle) Validate() error { + return m.ValidateWithPath("CT_WritingStyle") +} + +// ValidateWithPath validates the CT_WritingStyle and its children, prefixing error messages with path +func (m *CT_WritingStyle) ValidateWithPath(path string) error { + if m.NlCheckAttr != nil { + if err := m.NlCheckAttr.ValidateWithPath(path + "/NlCheckAttr"); err != nil { + return err + } + } + if err := m.CheckStyleAttr.ValidateWithPath(path + "/CheckStyleAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Zoom.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Zoom.go new file mode 100644 index 00000000..06181e49 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/CT_Zoom.go @@ -0,0 +1,87 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type CT_Zoom struct { + // Zoom Type + ValAttr ST_Zoom + // Zoom Percentage + PercentAttr ST_DecimalNumberOrPercent +} + +func NewCT_Zoom() *CT_Zoom { + ret := &CT_Zoom{} + return ret +} + +func (m *CT_Zoom) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.ValAttr != ST_ZoomUnset { + attr, err := m.ValAttr.MarshalXMLAttr(xml.Name{Local: "w:val"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "w:percent"}, + Value: fmt.Sprintf("%v", m.PercentAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *CT_Zoom) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "val" { + m.ValAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "percent" { + parsed, err := ParseUnionST_DecimalNumberOrPercent(attr.Value) + if err != nil { + return err + } + m.PercentAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing CT_Zoom: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the CT_Zoom and its children +func (m *CT_Zoom) Validate() error { + return m.ValidateWithPath("CT_Zoom") +} + +// ValidateWithPath validates the CT_Zoom and its children, prefixing error messages with path +func (m *CT_Zoom) ValidateWithPath(path string) error { + if err := m.ValAttr.ValidateWithPath(path + "/ValAttr"); err != nil { + return err + } + if err := m.PercentAttr.ValidateWithPath(path + "/PercentAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/Comments.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/Comments.go new file mode 100644 index 00000000..c0db6f28 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/Comments.go @@ -0,0 +1,86 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type Comments struct { + CT_Comments +} + +func NewComments() *Comments { + ret := &Comments{} + ret.CT_Comments = *NewCT_Comments() + return ret +} + +func (m *Comments) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns"}, Value: "http://schemas.openxmlformats.org/wordprocessingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:a"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:m"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/math"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:ma"}, Value: "http://schemas.openxmlformats.org/schemaLibrary/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:pic"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/picture"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:r"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/relationships"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:s"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/sharedTypes"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:w"}, Value: "http://schemas.openxmlformats.org/wordprocessingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:wp"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:xml"}, Value: "http://www.w3.org/XML/1998/namespace"}) + start.Name.Local = "w:comments" + return m.CT_Comments.MarshalXML(e, start) +} + +func (m *Comments) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CT_Comments = *NewCT_Comments() +lComments: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "comment"}: + tmp := NewCT_Comment() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Comment = append(m.Comment, tmp) + default: + gooxml.Log("skipping unsupported element on Comments %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lComments + case xml.CharData: + } + } + return nil +} + +// Validate validates the Comments and its children +func (m *Comments) Validate() error { + return m.ValidateWithPath("Comments") +} + +// ValidateWithPath validates the Comments and its children, prefixing error messages with path +func (m *Comments) ValidateWithPath(path string) error { + if err := m.CT_Comments.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/Document.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/Document.go new file mode 100644 index 00000000..32f1a0d6 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/Document.go @@ -0,0 +1,96 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type Document struct { + CT_Document +} + +func NewDocument() *Document { + ret := &Document{} + ret.CT_Document = *NewCT_Document() + return ret +} + +func (m *Document) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns"}, Value: "http://schemas.openxmlformats.org/wordprocessingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:a"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:m"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/math"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:ma"}, Value: "http://schemas.openxmlformats.org/schemaLibrary/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:pic"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/picture"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:r"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/relationships"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:s"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/sharedTypes"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:w"}, Value: "http://schemas.openxmlformats.org/wordprocessingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:wp"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:xml"}, Value: "http://www.w3.org/XML/1998/namespace"}) + start.Name.Local = "w:document" + return m.CT_Document.MarshalXML(e, start) +} + +func (m *Document) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CT_Document = *NewCT_Document() + for _, attr := range start.Attr { + if attr.Name.Local == "conformance" { + m.ConformanceAttr.UnmarshalXMLAttr(attr) + continue + } + } +lDocument: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "background"}: + m.Background = NewCT_Background() + if err := d.DecodeElement(m.Background, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "body"}: + m.Body = NewCT_Body() + if err := d.DecodeElement(m.Body, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on Document %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lDocument + case xml.CharData: + } + } + return nil +} + +// Validate validates the Document and its children +func (m *Document) Validate() error { + return m.ValidateWithPath("Document") +} + +// ValidateWithPath validates the Document and its children, prefixing error messages with path +func (m *Document) ValidateWithPath(path string) error { + if err := m.CT_Document.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_BlockLevelChunkElts.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_BlockLevelChunkElts.go new file mode 100644 index 00000000..d584a2ef --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_BlockLevelChunkElts.go @@ -0,0 +1,367 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/math" +) + +type EG_BlockLevelChunkElts struct { + EG_ContentBlockContent []*EG_ContentBlockContent +} + +func NewEG_BlockLevelChunkElts() *EG_BlockLevelChunkElts { + ret := &EG_BlockLevelChunkElts{} + return ret +} + +func (m *EG_BlockLevelChunkElts) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.EG_ContentBlockContent != nil { + for _, c := range m.EG_ContentBlockContent { + c.MarshalXML(e, xml.StartElement{}) + } + } + return nil +} + +func (m *EG_BlockLevelChunkElts) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_BlockLevelChunkElts: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXml"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmpcontentblockcontent.CustomXml = NewCT_CustomXmlBlock() + if err := d.DecodeElement(tmpcontentblockcontent.CustomXml, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdt"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmpcontentblockcontent.Sdt = NewCT_SdtBlock() + if err := d.DecodeElement(tmpcontentblockcontent.Sdt, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "p"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmp := NewCT_P() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + tmpcontentblockcontent.P = append(tmpcontentblockcontent.P, tmp) + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tbl"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmp := NewCT_Tbl() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + tmpcontentblockcontent.Tbl = append(tmpcontentblockcontent.Tbl, tmp) + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "proofErr"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.ProofErr = NewCT_ProofErr() + if err := d.DecodeElement(tmprunlevelelts.ProofErr, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermStart = NewCT_PermStart() + if err := d.DecodeElement(tmprunlevelelts.PermStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermEnd = NewCT_Perm() + if err := d.DecodeElement(tmprunlevelelts.PermEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Ins = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Ins, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Del = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Del, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFrom"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveFrom = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveFrom, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveTo"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveTo = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveTo, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkStart = NewCT_Bookmark() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeStart = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMathPara"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMathPara = math.NewOMathPara() + if err := d.DecodeElement(tmpmathcontent.OMathPara, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMath"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMath = math.NewOMath() + if err := d.DecodeElement(tmpmathcontent.OMath, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + default: + gooxml.Log("skipping unsupported element on EG_BlockLevelChunkElts %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_BlockLevelChunkElts + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_BlockLevelChunkElts and its children +func (m *EG_BlockLevelChunkElts) Validate() error { + return m.ValidateWithPath("EG_BlockLevelChunkElts") +} + +// ValidateWithPath validates the EG_BlockLevelChunkElts and its children, prefixing error messages with path +func (m *EG_BlockLevelChunkElts) ValidateWithPath(path string) error { + for i, v := range m.EG_ContentBlockContent { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_ContentBlockContent[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_BlockLevelElts.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_BlockLevelElts.go new file mode 100644 index 00000000..ef0300a6 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_BlockLevelElts.go @@ -0,0 +1,386 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/math" +) + +type EG_BlockLevelElts struct { + // Anchor for Imported External Content + AltChunk []*CT_AltChunk + EG_ContentBlockContent []*EG_ContentBlockContent +} + +func NewEG_BlockLevelElts() *EG_BlockLevelElts { + ret := &EG_BlockLevelElts{} + return ret +} + +func (m *EG_BlockLevelElts) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.AltChunk != nil { + sealtChunk := xml.StartElement{Name: xml.Name{Local: "w:altChunk"}} + for _, c := range m.AltChunk { + e.EncodeElement(c, sealtChunk) + } + } + if m.EG_ContentBlockContent != nil { + for _, c := range m.EG_ContentBlockContent { + c.MarshalXML(e, xml.StartElement{}) + } + } + return nil +} + +func (m *EG_BlockLevelElts) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_BlockLevelElts: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "altChunk"}: + tmp := NewCT_AltChunk() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.AltChunk = append(m.AltChunk, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXml"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmpcontentblockcontent.CustomXml = NewCT_CustomXmlBlock() + if err := d.DecodeElement(tmpcontentblockcontent.CustomXml, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdt"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmpcontentblockcontent.Sdt = NewCT_SdtBlock() + if err := d.DecodeElement(tmpcontentblockcontent.Sdt, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "p"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmp := NewCT_P() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + tmpcontentblockcontent.P = append(tmpcontentblockcontent.P, tmp) + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tbl"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmp := NewCT_Tbl() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + tmpcontentblockcontent.Tbl = append(tmpcontentblockcontent.Tbl, tmp) + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "proofErr"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.ProofErr = NewCT_ProofErr() + if err := d.DecodeElement(tmprunlevelelts.ProofErr, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermStart = NewCT_PermStart() + if err := d.DecodeElement(tmprunlevelelts.PermStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermEnd = NewCT_Perm() + if err := d.DecodeElement(tmprunlevelelts.PermEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Ins = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Ins, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Del = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Del, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFrom"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveFrom = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveFrom, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveTo"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveTo = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveTo, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkStart = NewCT_Bookmark() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeStart = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMathPara"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMathPara = math.NewOMathPara() + if err := d.DecodeElement(tmpmathcontent.OMathPara, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMath"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMath = math.NewOMath() + if err := d.DecodeElement(tmpmathcontent.OMath, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + default: + gooxml.Log("skipping unsupported element on EG_BlockLevelElts %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_BlockLevelElts + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_BlockLevelElts and its children +func (m *EG_BlockLevelElts) Validate() error { + return m.ValidateWithPath("EG_BlockLevelElts") +} + +// ValidateWithPath validates the EG_BlockLevelElts and its children, prefixing error messages with path +func (m *EG_BlockLevelElts) ValidateWithPath(path string) error { + for i, v := range m.AltChunk { + if err := v.ValidateWithPath(fmt.Sprintf("%s/AltChunk[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.EG_ContentBlockContent { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_ContentBlockContent[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_CellMarkupElements.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_CellMarkupElements.go new file mode 100644 index 00000000..c56dab3b --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_CellMarkupElements.go @@ -0,0 +1,111 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type EG_CellMarkupElements struct { + // Table Cell Insertion + CellIns *CT_TrackChange + // Table Cell Deletion + CellDel *CT_TrackChange + // Vertically Merged/Split Table Cells + CellMerge *CT_CellMergeTrackChange +} + +func NewEG_CellMarkupElements() *EG_CellMarkupElements { + ret := &EG_CellMarkupElements{} + return ret +} + +func (m *EG_CellMarkupElements) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.CellIns != nil { + secellIns := xml.StartElement{Name: xml.Name{Local: "w:cellIns"}} + e.EncodeElement(m.CellIns, secellIns) + } + if m.CellDel != nil { + secellDel := xml.StartElement{Name: xml.Name{Local: "w:cellDel"}} + e.EncodeElement(m.CellDel, secellDel) + } + if m.CellMerge != nil { + secellMerge := xml.StartElement{Name: xml.Name{Local: "w:cellMerge"}} + e.EncodeElement(m.CellMerge, secellMerge) + } + return nil +} + +func (m *EG_CellMarkupElements) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_CellMarkupElements: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "cellIns"}: + m.CellIns = NewCT_TrackChange() + if err := d.DecodeElement(m.CellIns, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "cellDel"}: + m.CellDel = NewCT_TrackChange() + if err := d.DecodeElement(m.CellDel, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "cellMerge"}: + m.CellMerge = NewCT_CellMergeTrackChange() + if err := d.DecodeElement(m.CellMerge, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on EG_CellMarkupElements %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_CellMarkupElements + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_CellMarkupElements and its children +func (m *EG_CellMarkupElements) Validate() error { + return m.ValidateWithPath("EG_CellMarkupElements") +} + +// ValidateWithPath validates the EG_CellMarkupElements and its children, prefixing error messages with path +func (m *EG_CellMarkupElements) ValidateWithPath(path string) error { + if m.CellIns != nil { + if err := m.CellIns.ValidateWithPath(path + "/CellIns"); err != nil { + return err + } + } + if m.CellDel != nil { + if err := m.CellDel.ValidateWithPath(path + "/CellDel"); err != nil { + return err + } + } + if m.CellMerge != nil { + if err := m.CellMerge.ValidateWithPath(path + "/CellMerge"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_ContentBlockContent.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_ContentBlockContent.go new file mode 100644 index 00000000..444cbc4d --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_ContentBlockContent.go @@ -0,0 +1,357 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/math" +) + +type EG_ContentBlockContent struct { + // Block-Level Custom XML Element + CustomXml *CT_CustomXmlBlock + // Block-Level Structured Document Tag + Sdt *CT_SdtBlock + // Paragraph + P []*CT_P + // Table + Tbl []*CT_Tbl + EG_RunLevelElts []*EG_RunLevelElts +} + +func NewEG_ContentBlockContent() *EG_ContentBlockContent { + ret := &EG_ContentBlockContent{} + return ret +} + +func (m *EG_ContentBlockContent) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.CustomXml != nil { + secustomXml := xml.StartElement{Name: xml.Name{Local: "w:customXml"}} + e.EncodeElement(m.CustomXml, secustomXml) + } + if m.Sdt != nil { + sesdt := xml.StartElement{Name: xml.Name{Local: "w:sdt"}} + e.EncodeElement(m.Sdt, sesdt) + } + if m.P != nil { + sep := xml.StartElement{Name: xml.Name{Local: "w:p"}} + for _, c := range m.P { + e.EncodeElement(c, sep) + } + } + if m.Tbl != nil { + setbl := xml.StartElement{Name: xml.Name{Local: "w:tbl"}} + for _, c := range m.Tbl { + e.EncodeElement(c, setbl) + } + } + if m.EG_RunLevelElts != nil { + for _, c := range m.EG_RunLevelElts { + c.MarshalXML(e, xml.StartElement{}) + } + } + return nil +} + +func (m *EG_ContentBlockContent) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_ContentBlockContent: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXml"}: + m.CustomXml = NewCT_CustomXmlBlock() + if err := d.DecodeElement(m.CustomXml, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdt"}: + m.Sdt = NewCT_SdtBlock() + if err := d.DecodeElement(m.Sdt, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "p"}: + tmp := NewCT_P() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.P = append(m.P, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tbl"}: + tmp := NewCT_Tbl() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Tbl = append(m.Tbl, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "proofErr"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.ProofErr = NewCT_ProofErr() + if err := d.DecodeElement(tmprunlevelelts.ProofErr, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermStart = NewCT_PermStart() + if err := d.DecodeElement(tmprunlevelelts.PermStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermEnd = NewCT_Perm() + if err := d.DecodeElement(tmprunlevelelts.PermEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Ins = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Ins, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Del = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Del, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFrom"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveFrom = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveFrom, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveTo"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveTo = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveTo, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkStart = NewCT_Bookmark() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeStart = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMathPara"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMathPara = math.NewOMathPara() + if err := d.DecodeElement(tmpmathcontent.OMathPara, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMath"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMath = math.NewOMath() + if err := d.DecodeElement(tmpmathcontent.OMath, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + default: + gooxml.Log("skipping unsupported element on EG_ContentBlockContent %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_ContentBlockContent + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_ContentBlockContent and its children +func (m *EG_ContentBlockContent) Validate() error { + return m.ValidateWithPath("EG_ContentBlockContent") +} + +// ValidateWithPath validates the EG_ContentBlockContent and its children, prefixing error messages with path +func (m *EG_ContentBlockContent) ValidateWithPath(path string) error { + if m.CustomXml != nil { + if err := m.CustomXml.ValidateWithPath(path + "/CustomXml"); err != nil { + return err + } + } + if m.Sdt != nil { + if err := m.Sdt.ValidateWithPath(path + "/Sdt"); err != nil { + return err + } + } + for i, v := range m.P { + if err := v.ValidateWithPath(fmt.Sprintf("%s/P[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.Tbl { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Tbl[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.EG_RunLevelElts { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_RunLevelElts[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_ContentCellContent.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_ContentCellContent.go new file mode 100644 index 00000000..da37c656 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_ContentCellContent.go @@ -0,0 +1,338 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/math" +) + +type EG_ContentCellContent struct { + // Table Cell + Tc []*CT_Tc + // Cell-Level Custom XML Element + CustomXml *CT_CustomXmlCell + // Cell-Level Structured Document Tag + Sdt *CT_SdtCell + EG_RunLevelElts []*EG_RunLevelElts +} + +func NewEG_ContentCellContent() *EG_ContentCellContent { + ret := &EG_ContentCellContent{} + return ret +} + +func (m *EG_ContentCellContent) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.Tc != nil { + setc := xml.StartElement{Name: xml.Name{Local: "w:tc"}} + for _, c := range m.Tc { + e.EncodeElement(c, setc) + } + } + if m.CustomXml != nil { + secustomXml := xml.StartElement{Name: xml.Name{Local: "w:customXml"}} + e.EncodeElement(m.CustomXml, secustomXml) + } + if m.Sdt != nil { + sesdt := xml.StartElement{Name: xml.Name{Local: "w:sdt"}} + e.EncodeElement(m.Sdt, sesdt) + } + if m.EG_RunLevelElts != nil { + for _, c := range m.EG_RunLevelElts { + c.MarshalXML(e, xml.StartElement{}) + } + } + return nil +} + +func (m *EG_ContentCellContent) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_ContentCellContent: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tc"}: + tmp := NewCT_Tc() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Tc = append(m.Tc, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXml"}: + m.CustomXml = NewCT_CustomXmlCell() + if err := d.DecodeElement(m.CustomXml, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdt"}: + m.Sdt = NewCT_SdtCell() + if err := d.DecodeElement(m.Sdt, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "proofErr"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.ProofErr = NewCT_ProofErr() + if err := d.DecodeElement(tmprunlevelelts.ProofErr, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermStart = NewCT_PermStart() + if err := d.DecodeElement(tmprunlevelelts.PermStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermEnd = NewCT_Perm() + if err := d.DecodeElement(tmprunlevelelts.PermEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Ins = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Ins, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Del = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Del, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFrom"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveFrom = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveFrom, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveTo"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveTo = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveTo, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkStart = NewCT_Bookmark() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeStart = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMathPara"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMathPara = math.NewOMathPara() + if err := d.DecodeElement(tmpmathcontent.OMathPara, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMath"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMath = math.NewOMath() + if err := d.DecodeElement(tmpmathcontent.OMath, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + default: + gooxml.Log("skipping unsupported element on EG_ContentCellContent %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_ContentCellContent + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_ContentCellContent and its children +func (m *EG_ContentCellContent) Validate() error { + return m.ValidateWithPath("EG_ContentCellContent") +} + +// ValidateWithPath validates the EG_ContentCellContent and its children, prefixing error messages with path +func (m *EG_ContentCellContent) ValidateWithPath(path string) error { + for i, v := range m.Tc { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Tc[%d]", path, i)); err != nil { + return err + } + } + if m.CustomXml != nil { + if err := m.CustomXml.ValidateWithPath(path + "/CustomXml"); err != nil { + return err + } + } + if m.Sdt != nil { + if err := m.Sdt.ValidateWithPath(path + "/Sdt"); err != nil { + return err + } + } + for i, v := range m.EG_RunLevelElts { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_RunLevelElts[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_ContentRowContent.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_ContentRowContent.go new file mode 100644 index 00000000..cbdf6881 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_ContentRowContent.go @@ -0,0 +1,338 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/math" +) + +type EG_ContentRowContent struct { + // Table Row + Tr []*CT_Row + // Row-Level Custom XML Element + CustomXml *CT_CustomXmlRow + // Row-Level Structured Document Tag + Sdt *CT_SdtRow + EG_RunLevelElts []*EG_RunLevelElts +} + +func NewEG_ContentRowContent() *EG_ContentRowContent { + ret := &EG_ContentRowContent{} + return ret +} + +func (m *EG_ContentRowContent) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.Tr != nil { + setr := xml.StartElement{Name: xml.Name{Local: "w:tr"}} + for _, c := range m.Tr { + e.EncodeElement(c, setr) + } + } + if m.CustomXml != nil { + secustomXml := xml.StartElement{Name: xml.Name{Local: "w:customXml"}} + e.EncodeElement(m.CustomXml, secustomXml) + } + if m.Sdt != nil { + sesdt := xml.StartElement{Name: xml.Name{Local: "w:sdt"}} + e.EncodeElement(m.Sdt, sesdt) + } + if m.EG_RunLevelElts != nil { + for _, c := range m.EG_RunLevelElts { + c.MarshalXML(e, xml.StartElement{}) + } + } + return nil +} + +func (m *EG_ContentRowContent) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_ContentRowContent: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tr"}: + tmp := NewCT_Row() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Tr = append(m.Tr, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXml"}: + m.CustomXml = NewCT_CustomXmlRow() + if err := d.DecodeElement(m.CustomXml, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdt"}: + m.Sdt = NewCT_SdtRow() + if err := d.DecodeElement(m.Sdt, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "proofErr"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.ProofErr = NewCT_ProofErr() + if err := d.DecodeElement(tmprunlevelelts.ProofErr, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermStart = NewCT_PermStart() + if err := d.DecodeElement(tmprunlevelelts.PermStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermEnd = NewCT_Perm() + if err := d.DecodeElement(tmprunlevelelts.PermEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Ins = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Ins, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Del = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Del, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFrom"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveFrom = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveFrom, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveTo"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveTo = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveTo, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkStart = NewCT_Bookmark() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeStart = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMathPara"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMathPara = math.NewOMathPara() + if err := d.DecodeElement(tmpmathcontent.OMathPara, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMath"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMath = math.NewOMath() + if err := d.DecodeElement(tmpmathcontent.OMath, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + default: + gooxml.Log("skipping unsupported element on EG_ContentRowContent %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_ContentRowContent + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_ContentRowContent and its children +func (m *EG_ContentRowContent) Validate() error { + return m.ValidateWithPath("EG_ContentRowContent") +} + +// ValidateWithPath validates the EG_ContentRowContent and its children, prefixing error messages with path +func (m *EG_ContentRowContent) ValidateWithPath(path string) error { + for i, v := range m.Tr { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Tr[%d]", path, i)); err != nil { + return err + } + } + if m.CustomXml != nil { + if err := m.CustomXml.ValidateWithPath(path + "/CustomXml"); err != nil { + return err + } + } + if m.Sdt != nil { + if err := m.Sdt.ValidateWithPath(path + "/Sdt"); err != nil { + return err + } + } + for i, v := range m.EG_RunLevelElts { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_RunLevelElts[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_ContentRunContent.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_ContentRunContent.go new file mode 100644 index 00000000..4a5196c0 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_ContentRunContent.go @@ -0,0 +1,383 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/math" +) + +type EG_ContentRunContent struct { + // Inline-Level Custom XML Element + CustomXml *CT_CustomXmlRun + // Inline-Level Smart Tag + SmartTag *CT_SmartTagRun + // Inline-Level Structured Document Tag + Sdt *CT_SdtRun + // Bidirectional Embedding Level + Dir *CT_DirContentRun + // Bidirectional Override + Bdo *CT_BdoContentRun + // Text Run + R *CT_R + EG_RunLevelElts []*EG_RunLevelElts +} + +func NewEG_ContentRunContent() *EG_ContentRunContent { + ret := &EG_ContentRunContent{} + return ret +} + +func (m *EG_ContentRunContent) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.CustomXml != nil { + secustomXml := xml.StartElement{Name: xml.Name{Local: "w:customXml"}} + e.EncodeElement(m.CustomXml, secustomXml) + } + if m.SmartTag != nil { + sesmartTag := xml.StartElement{Name: xml.Name{Local: "w:smartTag"}} + e.EncodeElement(m.SmartTag, sesmartTag) + } + if m.Sdt != nil { + sesdt := xml.StartElement{Name: xml.Name{Local: "w:sdt"}} + e.EncodeElement(m.Sdt, sesdt) + } + if m.Dir != nil { + sedir := xml.StartElement{Name: xml.Name{Local: "w:dir"}} + e.EncodeElement(m.Dir, sedir) + } + if m.Bdo != nil { + sebdo := xml.StartElement{Name: xml.Name{Local: "w:bdo"}} + e.EncodeElement(m.Bdo, sebdo) + } + if m.R != nil { + ser := xml.StartElement{Name: xml.Name{Local: "w:r"}} + e.EncodeElement(m.R, ser) + } + if m.EG_RunLevelElts != nil { + for _, c := range m.EG_RunLevelElts { + c.MarshalXML(e, xml.StartElement{}) + } + } + return nil +} + +func (m *EG_ContentRunContent) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_ContentRunContent: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXml"}: + m.CustomXml = NewCT_CustomXmlRun() + if err := d.DecodeElement(m.CustomXml, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "smartTag"}: + m.SmartTag = NewCT_SmartTagRun() + if err := d.DecodeElement(m.SmartTag, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdt"}: + m.Sdt = NewCT_SdtRun() + if err := d.DecodeElement(m.Sdt, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "dir"}: + m.Dir = NewCT_DirContentRun() + if err := d.DecodeElement(m.Dir, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bdo"}: + m.Bdo = NewCT_BdoContentRun() + if err := d.DecodeElement(m.Bdo, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "r"}: + m.R = NewCT_R() + if err := d.DecodeElement(m.R, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "proofErr"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.ProofErr = NewCT_ProofErr() + if err := d.DecodeElement(tmprunlevelelts.ProofErr, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermStart = NewCT_PermStart() + if err := d.DecodeElement(tmprunlevelelts.PermStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermEnd = NewCT_Perm() + if err := d.DecodeElement(tmprunlevelelts.PermEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Ins = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Ins, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Del = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Del, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFrom"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveFrom = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveFrom, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveTo"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveTo = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveTo, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkStart = NewCT_Bookmark() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeStart = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMathPara"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMathPara = math.NewOMathPara() + if err := d.DecodeElement(tmpmathcontent.OMathPara, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMath"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMath = math.NewOMath() + if err := d.DecodeElement(tmpmathcontent.OMath, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + default: + gooxml.Log("skipping unsupported element on EG_ContentRunContent %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_ContentRunContent + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_ContentRunContent and its children +func (m *EG_ContentRunContent) Validate() error { + return m.ValidateWithPath("EG_ContentRunContent") +} + +// ValidateWithPath validates the EG_ContentRunContent and its children, prefixing error messages with path +func (m *EG_ContentRunContent) ValidateWithPath(path string) error { + if m.CustomXml != nil { + if err := m.CustomXml.ValidateWithPath(path + "/CustomXml"); err != nil { + return err + } + } + if m.SmartTag != nil { + if err := m.SmartTag.ValidateWithPath(path + "/SmartTag"); err != nil { + return err + } + } + if m.Sdt != nil { + if err := m.Sdt.ValidateWithPath(path + "/Sdt"); err != nil { + return err + } + } + if m.Dir != nil { + if err := m.Dir.ValidateWithPath(path + "/Dir"); err != nil { + return err + } + } + if m.Bdo != nil { + if err := m.Bdo.ValidateWithPath(path + "/Bdo"); err != nil { + return err + } + } + if m.R != nil { + if err := m.R.ValidateWithPath(path + "/R"); err != nil { + return err + } + } + for i, v := range m.EG_RunLevelElts { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_RunLevelElts[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_ContentRunContentBase.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_ContentRunContentBase.go new file mode 100644 index 00000000..888be9ef --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_ContentRunContentBase.go @@ -0,0 +1,317 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/math" +) + +type EG_ContentRunContentBase struct { + SmartTag *CT_SmartTagRun + Sdt *CT_SdtRun + EG_RunLevelElts []*EG_RunLevelElts +} + +func NewEG_ContentRunContentBase() *EG_ContentRunContentBase { + ret := &EG_ContentRunContentBase{} + return ret +} + +func (m *EG_ContentRunContentBase) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.SmartTag != nil { + sesmartTag := xml.StartElement{Name: xml.Name{Local: "w:smartTag"}} + e.EncodeElement(m.SmartTag, sesmartTag) + } + if m.Sdt != nil { + sesdt := xml.StartElement{Name: xml.Name{Local: "w:sdt"}} + e.EncodeElement(m.Sdt, sesdt) + } + if m.EG_RunLevelElts != nil { + for _, c := range m.EG_RunLevelElts { + c.MarshalXML(e, xml.StartElement{}) + } + } + return nil +} + +func (m *EG_ContentRunContentBase) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_ContentRunContentBase: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "smartTag"}: + m.SmartTag = NewCT_SmartTagRun() + if err := d.DecodeElement(m.SmartTag, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdt"}: + m.Sdt = NewCT_SdtRun() + if err := d.DecodeElement(m.Sdt, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "proofErr"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.ProofErr = NewCT_ProofErr() + if err := d.DecodeElement(tmprunlevelelts.ProofErr, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermStart = NewCT_PermStart() + if err := d.DecodeElement(tmprunlevelelts.PermStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermEnd = NewCT_Perm() + if err := d.DecodeElement(tmprunlevelelts.PermEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Ins = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Ins, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Del = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Del, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFrom"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveFrom = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveFrom, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveTo"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveTo = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveTo, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkStart = NewCT_Bookmark() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeStart = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMathPara"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMathPara = math.NewOMathPara() + if err := d.DecodeElement(tmpmathcontent.OMathPara, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMath"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMath = math.NewOMath() + if err := d.DecodeElement(tmpmathcontent.OMath, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + default: + gooxml.Log("skipping unsupported element on EG_ContentRunContentBase %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_ContentRunContentBase + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_ContentRunContentBase and its children +func (m *EG_ContentRunContentBase) Validate() error { + return m.ValidateWithPath("EG_ContentRunContentBase") +} + +// ValidateWithPath validates the EG_ContentRunContentBase and its children, prefixing error messages with path +func (m *EG_ContentRunContentBase) ValidateWithPath(path string) error { + if m.SmartTag != nil { + if err := m.SmartTag.ValidateWithPath(path + "/SmartTag"); err != nil { + return err + } + } + if m.Sdt != nil { + if err := m.Sdt.ValidateWithPath(path + "/Sdt"); err != nil { + return err + } + } + for i, v := range m.EG_RunLevelElts { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_RunLevelElts[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_FtnEdnNumProps.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_FtnEdnNumProps.go new file mode 100644 index 00000000..26c765b6 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_FtnEdnNumProps.go @@ -0,0 +1,95 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type EG_FtnEdnNumProps struct { + // Footnote and Endnote Numbering Starting Value + NumStart *CT_DecimalNumber + // Footnote and Endnote Numbering Restart Location + NumRestart *CT_NumRestart +} + +func NewEG_FtnEdnNumProps() *EG_FtnEdnNumProps { + ret := &EG_FtnEdnNumProps{} + return ret +} + +func (m *EG_FtnEdnNumProps) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.NumStart != nil { + senumStart := xml.StartElement{Name: xml.Name{Local: "w:numStart"}} + e.EncodeElement(m.NumStart, senumStart) + } + if m.NumRestart != nil { + senumRestart := xml.StartElement{Name: xml.Name{Local: "w:numRestart"}} + e.EncodeElement(m.NumRestart, senumRestart) + } + return nil +} + +func (m *EG_FtnEdnNumProps) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_FtnEdnNumProps: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "numStart"}: + m.NumStart = NewCT_DecimalNumber() + if err := d.DecodeElement(m.NumStart, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "numRestart"}: + m.NumRestart = NewCT_NumRestart() + if err := d.DecodeElement(m.NumRestart, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on EG_FtnEdnNumProps %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_FtnEdnNumProps + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_FtnEdnNumProps and its children +func (m *EG_FtnEdnNumProps) Validate() error { + return m.ValidateWithPath("EG_FtnEdnNumProps") +} + +// ValidateWithPath validates the EG_FtnEdnNumProps and its children, prefixing error messages with path +func (m *EG_FtnEdnNumProps) ValidateWithPath(path string) error { + if m.NumStart != nil { + if err := m.NumStart.ValidateWithPath(path + "/NumStart"); err != nil { + return err + } + } + if m.NumRestart != nil { + if err := m.NumRestart.ValidateWithPath(path + "/NumRestart"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_HdrFtrReferences.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_HdrFtrReferences.go new file mode 100644 index 00000000..baea3338 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_HdrFtrReferences.go @@ -0,0 +1,95 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type EG_HdrFtrReferences struct { + // Header Reference + HeaderReference *CT_HdrFtrRef + // Footer Reference + FooterReference *CT_HdrFtrRef +} + +func NewEG_HdrFtrReferences() *EG_HdrFtrReferences { + ret := &EG_HdrFtrReferences{} + return ret +} + +func (m *EG_HdrFtrReferences) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.HeaderReference != nil { + seheaderReference := xml.StartElement{Name: xml.Name{Local: "w:headerReference"}} + e.EncodeElement(m.HeaderReference, seheaderReference) + } + if m.FooterReference != nil { + sefooterReference := xml.StartElement{Name: xml.Name{Local: "w:footerReference"}} + e.EncodeElement(m.FooterReference, sefooterReference) + } + return nil +} + +func (m *EG_HdrFtrReferences) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_HdrFtrReferences: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "headerReference"}: + m.HeaderReference = NewCT_HdrFtrRef() + if err := d.DecodeElement(m.HeaderReference, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "footerReference"}: + m.FooterReference = NewCT_HdrFtrRef() + if err := d.DecodeElement(m.FooterReference, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on EG_HdrFtrReferences %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_HdrFtrReferences + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_HdrFtrReferences and its children +func (m *EG_HdrFtrReferences) Validate() error { + return m.ValidateWithPath("EG_HdrFtrReferences") +} + +// ValidateWithPath validates the EG_HdrFtrReferences and its children, prefixing error messages with path +func (m *EG_HdrFtrReferences) ValidateWithPath(path string) error { + if m.HeaderReference != nil { + if err := m.HeaderReference.ValidateWithPath(path + "/HeaderReference"); err != nil { + return err + } + } + if m.FooterReference != nil { + if err := m.FooterReference.ValidateWithPath(path + "/FooterReference"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_MathContent.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_MathContent.go new file mode 100644 index 00000000..90f46d90 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_MathContent.go @@ -0,0 +1,94 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/math" +) + +type EG_MathContent struct { + OMathPara *math.OMathPara + OMath *math.OMath +} + +func NewEG_MathContent() *EG_MathContent { + ret := &EG_MathContent{} + return ret +} + +func (m *EG_MathContent) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.OMathPara != nil { + seoMathPara := xml.StartElement{Name: xml.Name{Local: "m:oMathPara"}} + e.EncodeElement(m.OMathPara, seoMathPara) + } + if m.OMath != nil { + seoMath := xml.StartElement{Name: xml.Name{Local: "m:oMath"}} + e.EncodeElement(m.OMath, seoMath) + } + return nil +} + +func (m *EG_MathContent) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_MathContent: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMathPara"}: + m.OMathPara = math.NewOMathPara() + if err := d.DecodeElement(m.OMathPara, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMath"}: + m.OMath = math.NewOMath() + if err := d.DecodeElement(m.OMath, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on EG_MathContent %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_MathContent + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_MathContent and its children +func (m *EG_MathContent) Validate() error { + return m.ValidateWithPath("EG_MathContent") +} + +// ValidateWithPath validates the EG_MathContent and its children, prefixing error messages with path +func (m *EG_MathContent) ValidateWithPath(path string) error { + if m.OMathPara != nil { + if err := m.OMathPara.ValidateWithPath(path + "/OMathPara"); err != nil { + return err + } + } + if m.OMath != nil { + if err := m.OMath.ValidateWithPath(path + "/OMath"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_PContent.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_PContent.go new file mode 100644 index 00000000..0664f085 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_PContent.go @@ -0,0 +1,430 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/math" +) + +type EG_PContent struct { + // Simple Field + FldSimple []*CT_SimpleField + // Hyperlink + Hyperlink *CT_Hyperlink + // Anchor for Subdocument Location + SubDoc *CT_Rel + EG_ContentRunContent []*EG_ContentRunContent +} + +func NewEG_PContent() *EG_PContent { + ret := &EG_PContent{} + return ret +} + +func (m *EG_PContent) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.FldSimple != nil { + sefldSimple := xml.StartElement{Name: xml.Name{Local: "w:fldSimple"}} + for _, c := range m.FldSimple { + e.EncodeElement(c, sefldSimple) + } + } + if m.Hyperlink != nil { + sehyperlink := xml.StartElement{Name: xml.Name{Local: "w:hyperlink"}} + e.EncodeElement(m.Hyperlink, sehyperlink) + } + if m.SubDoc != nil { + sesubDoc := xml.StartElement{Name: xml.Name{Local: "w:subDoc"}} + e.EncodeElement(m.SubDoc, sesubDoc) + } + if m.EG_ContentRunContent != nil { + for _, c := range m.EG_ContentRunContent { + c.MarshalXML(e, xml.StartElement{}) + } + } + return nil +} + +func (m *EG_PContent) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_PContent: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "fldSimple"}: + tmp := NewCT_SimpleField() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.FldSimple = append(m.FldSimple, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "hyperlink"}: + m.Hyperlink = NewCT_Hyperlink() + if err := d.DecodeElement(m.Hyperlink, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "subDoc"}: + m.SubDoc = NewCT_Rel() + if err := d.DecodeElement(m.SubDoc, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXml"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.CustomXml = NewCT_CustomXmlRun() + if err := d.DecodeElement(tmpcontentruncontent.CustomXml, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "smartTag"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.SmartTag = NewCT_SmartTagRun() + if err := d.DecodeElement(tmpcontentruncontent.SmartTag, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdt"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.Sdt = NewCT_SdtRun() + if err := d.DecodeElement(tmpcontentruncontent.Sdt, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "dir"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.Dir = NewCT_DirContentRun() + if err := d.DecodeElement(tmpcontentruncontent.Dir, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bdo"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.Bdo = NewCT_BdoContentRun() + if err := d.DecodeElement(tmpcontentruncontent.Bdo, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "r"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmpcontentruncontent.R = NewCT_R() + if err := d.DecodeElement(tmpcontentruncontent.R, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "proofErr"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.ProofErr = NewCT_ProofErr() + if err := d.DecodeElement(tmprunlevelelts.ProofErr, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermStart = NewCT_PermStart() + if err := d.DecodeElement(tmprunlevelelts.PermStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermEnd = NewCT_Perm() + if err := d.DecodeElement(tmprunlevelelts.PermEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Ins = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Ins, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Del = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Del, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFrom"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveFrom = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveFrom, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveTo"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveTo = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveTo, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkStart = NewCT_Bookmark() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeStart = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeStart"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeEnd"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMathPara"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMathPara = math.NewOMathPara() + if err := d.DecodeElement(tmpmathcontent.OMathPara, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMath"}: + tmpcontentruncontent := NewEG_ContentRunContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMath = math.NewOMath() + if err := d.DecodeElement(tmpmathcontent.OMath, &el); err != nil { + return err + } + m.EG_ContentRunContent = append(m.EG_ContentRunContent, tmpcontentruncontent) + tmpcontentruncontent.EG_RunLevelElts = append(tmpcontentruncontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + default: + gooxml.Log("skipping unsupported element on EG_PContent %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_PContent + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_PContent and its children +func (m *EG_PContent) Validate() error { + return m.ValidateWithPath("EG_PContent") +} + +// ValidateWithPath validates the EG_PContent and its children, prefixing error messages with path +func (m *EG_PContent) ValidateWithPath(path string) error { + for i, v := range m.FldSimple { + if err := v.ValidateWithPath(fmt.Sprintf("%s/FldSimple[%d]", path, i)); err != nil { + return err + } + } + if m.Hyperlink != nil { + if err := m.Hyperlink.ValidateWithPath(path + "/Hyperlink"); err != nil { + return err + } + } + if m.SubDoc != nil { + if err := m.SubDoc.ValidateWithPath(path + "/SubDoc"); err != nil { + return err + } + } + for i, v := range m.EG_ContentRunContent { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_ContentRunContent[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_PContentBase.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_PContentBase.go new file mode 100644 index 00000000..10445721 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_PContentBase.go @@ -0,0 +1,112 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type EG_PContentBase struct { + CustomXml *CT_CustomXmlRun + FldSimple []*CT_SimpleField + Hyperlink *CT_Hyperlink +} + +func NewEG_PContentBase() *EG_PContentBase { + ret := &EG_PContentBase{} + return ret +} + +func (m *EG_PContentBase) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.CustomXml != nil { + secustomXml := xml.StartElement{Name: xml.Name{Local: "w:customXml"}} + e.EncodeElement(m.CustomXml, secustomXml) + } + if m.FldSimple != nil { + sefldSimple := xml.StartElement{Name: xml.Name{Local: "w:fldSimple"}} + for _, c := range m.FldSimple { + e.EncodeElement(c, sefldSimple) + } + } + if m.Hyperlink != nil { + sehyperlink := xml.StartElement{Name: xml.Name{Local: "w:hyperlink"}} + e.EncodeElement(m.Hyperlink, sehyperlink) + } + return nil +} + +func (m *EG_PContentBase) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_PContentBase: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXml"}: + m.CustomXml = NewCT_CustomXmlRun() + if err := d.DecodeElement(m.CustomXml, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "fldSimple"}: + tmp := NewCT_SimpleField() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.FldSimple = append(m.FldSimple, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "hyperlink"}: + m.Hyperlink = NewCT_Hyperlink() + if err := d.DecodeElement(m.Hyperlink, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on EG_PContentBase %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_PContentBase + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_PContentBase and its children +func (m *EG_PContentBase) Validate() error { + return m.ValidateWithPath("EG_PContentBase") +} + +// ValidateWithPath validates the EG_PContentBase and its children, prefixing error messages with path +func (m *EG_PContentBase) ValidateWithPath(path string) error { + if m.CustomXml != nil { + if err := m.CustomXml.ValidateWithPath(path + "/CustomXml"); err != nil { + return err + } + } + for i, v := range m.FldSimple { + if err := v.ValidateWithPath(fmt.Sprintf("%s/FldSimple[%d]", path, i)); err != nil { + return err + } + } + if m.Hyperlink != nil { + if err := m.Hyperlink.ValidateWithPath(path + "/Hyperlink"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_PContentMath.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_PContentMath.go new file mode 100644 index 00000000..7bc018e6 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_PContentMath.go @@ -0,0 +1,385 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/math" +) + +type EG_PContentMath struct { + EG_PContentBase []*EG_PContentBase + EG_ContentRunContentBase []*EG_ContentRunContentBase +} + +func NewEG_PContentMath() *EG_PContentMath { + ret := &EG_PContentMath{} + return ret +} + +func (m *EG_PContentMath) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Name.Local = "w:EG_PContentMath" + if m.EG_PContentBase != nil { + for _, c := range m.EG_PContentBase { + c.MarshalXML(e, xml.StartElement{}) + } + } + if m.EG_ContentRunContentBase != nil { + for _, c := range m.EG_ContentRunContentBase { + c.MarshalXML(e, xml.StartElement{}) + } + } + return nil +} + +func (m *EG_PContentMath) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_PContentMath: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXml"}: + tmppcontentbase := NewEG_PContentBase() + tmppcontentbase.CustomXml = NewCT_CustomXmlRun() + if err := d.DecodeElement(tmppcontentbase.CustomXml, &el); err != nil { + return err + } + m.EG_PContentBase = append(m.EG_PContentBase, tmppcontentbase) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "fldSimple"}: + tmppcontentbase := NewEG_PContentBase() + tmp := NewCT_SimpleField() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + tmppcontentbase.FldSimple = append(tmppcontentbase.FldSimple, tmp) + m.EG_PContentBase = append(m.EG_PContentBase, tmppcontentbase) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "hyperlink"}: + tmppcontentbase := NewEG_PContentBase() + tmppcontentbase.Hyperlink = NewCT_Hyperlink() + if err := d.DecodeElement(tmppcontentbase.Hyperlink, &el); err != nil { + return err + } + m.EG_PContentBase = append(m.EG_PContentBase, tmppcontentbase) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "smartTag"}: + tmpcontentruncontentbase := NewEG_ContentRunContentBase() + tmpcontentruncontentbase.SmartTag = NewCT_SmartTagRun() + if err := d.DecodeElement(tmpcontentruncontentbase.SmartTag, &el); err != nil { + return err + } + m.EG_ContentRunContentBase = append(m.EG_ContentRunContentBase, tmpcontentruncontentbase) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdt"}: + tmpcontentruncontentbase := NewEG_ContentRunContentBase() + tmpcontentruncontentbase.Sdt = NewCT_SdtRun() + if err := d.DecodeElement(tmpcontentruncontentbase.Sdt, &el); err != nil { + return err + } + m.EG_ContentRunContentBase = append(m.EG_ContentRunContentBase, tmpcontentruncontentbase) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "proofErr"}: + tmpcontentruncontentbase := NewEG_ContentRunContentBase() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.ProofErr = NewCT_ProofErr() + if err := d.DecodeElement(tmprunlevelelts.ProofErr, &el); err != nil { + return err + } + m.EG_ContentRunContentBase = append(m.EG_ContentRunContentBase, tmpcontentruncontentbase) + tmpcontentruncontentbase.EG_RunLevelElts = append(tmpcontentruncontentbase.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permStart"}: + tmpcontentruncontentbase := NewEG_ContentRunContentBase() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermStart = NewCT_PermStart() + if err := d.DecodeElement(tmprunlevelelts.PermStart, &el); err != nil { + return err + } + m.EG_ContentRunContentBase = append(m.EG_ContentRunContentBase, tmpcontentruncontentbase) + tmpcontentruncontentbase.EG_RunLevelElts = append(tmpcontentruncontentbase.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permEnd"}: + tmpcontentruncontentbase := NewEG_ContentRunContentBase() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermEnd = NewCT_Perm() + if err := d.DecodeElement(tmprunlevelelts.PermEnd, &el); err != nil { + return err + } + m.EG_ContentRunContentBase = append(m.EG_ContentRunContentBase, tmpcontentruncontentbase) + tmpcontentruncontentbase.EG_RunLevelElts = append(tmpcontentruncontentbase.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + tmpcontentruncontentbase := NewEG_ContentRunContentBase() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Ins = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Ins, &el); err != nil { + return err + } + m.EG_ContentRunContentBase = append(m.EG_ContentRunContentBase, tmpcontentruncontentbase) + tmpcontentruncontentbase.EG_RunLevelElts = append(tmpcontentruncontentbase.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + tmpcontentruncontentbase := NewEG_ContentRunContentBase() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Del = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Del, &el); err != nil { + return err + } + m.EG_ContentRunContentBase = append(m.EG_ContentRunContentBase, tmpcontentruncontentbase) + tmpcontentruncontentbase.EG_RunLevelElts = append(tmpcontentruncontentbase.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFrom"}: + tmpcontentruncontentbase := NewEG_ContentRunContentBase() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveFrom = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveFrom, &el); err != nil { + return err + } + m.EG_ContentRunContentBase = append(m.EG_ContentRunContentBase, tmpcontentruncontentbase) + tmpcontentruncontentbase.EG_RunLevelElts = append(tmpcontentruncontentbase.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveTo"}: + tmpcontentruncontentbase := NewEG_ContentRunContentBase() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveTo = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveTo, &el); err != nil { + return err + } + m.EG_ContentRunContentBase = append(m.EG_ContentRunContentBase, tmpcontentruncontentbase) + tmpcontentruncontentbase.EG_RunLevelElts = append(tmpcontentruncontentbase.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkStart"}: + tmpcontentruncontentbase := NewEG_ContentRunContentBase() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkStart = NewCT_Bookmark() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkStart, &el); err != nil { + return err + } + m.EG_ContentRunContentBase = append(m.EG_ContentRunContentBase, tmpcontentruncontentbase) + tmpcontentruncontentbase.EG_RunLevelElts = append(tmpcontentruncontentbase.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkEnd"}: + tmpcontentruncontentbase := NewEG_ContentRunContentBase() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkEnd, &el); err != nil { + return err + } + m.EG_ContentRunContentBase = append(m.EG_ContentRunContentBase, tmpcontentruncontentbase) + tmpcontentruncontentbase.EG_RunLevelElts = append(tmpcontentruncontentbase.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeStart"}: + tmpcontentruncontentbase := NewEG_ContentRunContentBase() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContentBase = append(m.EG_ContentRunContentBase, tmpcontentruncontentbase) + tmpcontentruncontentbase.EG_RunLevelElts = append(tmpcontentruncontentbase.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeEnd"}: + tmpcontentruncontentbase := NewEG_ContentRunContentBase() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContentBase = append(m.EG_ContentRunContentBase, tmpcontentruncontentbase) + tmpcontentruncontentbase.EG_RunLevelElts = append(tmpcontentruncontentbase.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeStart"}: + tmpcontentruncontentbase := NewEG_ContentRunContentBase() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContentBase = append(m.EG_ContentRunContentBase, tmpcontentruncontentbase) + tmpcontentruncontentbase.EG_RunLevelElts = append(tmpcontentruncontentbase.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeEnd"}: + tmpcontentruncontentbase := NewEG_ContentRunContentBase() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContentBase = append(m.EG_ContentRunContentBase, tmpcontentruncontentbase) + tmpcontentruncontentbase.EG_RunLevelElts = append(tmpcontentruncontentbase.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeStart"}: + tmpcontentruncontentbase := NewEG_ContentRunContentBase() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeStart = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContentBase = append(m.EG_ContentRunContentBase, tmpcontentruncontentbase) + tmpcontentruncontentbase.EG_RunLevelElts = append(tmpcontentruncontentbase.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeEnd"}: + tmpcontentruncontentbase := NewEG_ContentRunContentBase() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContentBase = append(m.EG_ContentRunContentBase, tmpcontentruncontentbase) + tmpcontentruncontentbase.EG_RunLevelElts = append(tmpcontentruncontentbase.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeStart"}: + tmpcontentruncontentbase := NewEG_ContentRunContentBase() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContentBase = append(m.EG_ContentRunContentBase, tmpcontentruncontentbase) + tmpcontentruncontentbase.EG_RunLevelElts = append(tmpcontentruncontentbase.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeEnd"}: + tmpcontentruncontentbase := NewEG_ContentRunContentBase() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContentBase = append(m.EG_ContentRunContentBase, tmpcontentruncontentbase) + tmpcontentruncontentbase.EG_RunLevelElts = append(tmpcontentruncontentbase.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeStart"}: + tmpcontentruncontentbase := NewEG_ContentRunContentBase() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContentBase = append(m.EG_ContentRunContentBase, tmpcontentruncontentbase) + tmpcontentruncontentbase.EG_RunLevelElts = append(tmpcontentruncontentbase.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeEnd"}: + tmpcontentruncontentbase := NewEG_ContentRunContentBase() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContentBase = append(m.EG_ContentRunContentBase, tmpcontentruncontentbase) + tmpcontentruncontentbase.EG_RunLevelElts = append(tmpcontentruncontentbase.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeStart"}: + tmpcontentruncontentbase := NewEG_ContentRunContentBase() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContentBase = append(m.EG_ContentRunContentBase, tmpcontentruncontentbase) + tmpcontentruncontentbase.EG_RunLevelElts = append(tmpcontentruncontentbase.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeEnd"}: + tmpcontentruncontentbase := NewEG_ContentRunContentBase() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContentBase = append(m.EG_ContentRunContentBase, tmpcontentruncontentbase) + tmpcontentruncontentbase.EG_RunLevelElts = append(tmpcontentruncontentbase.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeStart"}: + tmpcontentruncontentbase := NewEG_ContentRunContentBase() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeStart, &el); err != nil { + return err + } + m.EG_ContentRunContentBase = append(m.EG_ContentRunContentBase, tmpcontentruncontentbase) + tmpcontentruncontentbase.EG_RunLevelElts = append(tmpcontentruncontentbase.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeEnd"}: + tmpcontentruncontentbase := NewEG_ContentRunContentBase() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeEnd, &el); err != nil { + return err + } + m.EG_ContentRunContentBase = append(m.EG_ContentRunContentBase, tmpcontentruncontentbase) + tmpcontentruncontentbase.EG_RunLevelElts = append(tmpcontentruncontentbase.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMathPara"}: + tmpcontentruncontentbase := NewEG_ContentRunContentBase() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMathPara = math.NewOMathPara() + if err := d.DecodeElement(tmpmathcontent.OMathPara, &el); err != nil { + return err + } + m.EG_ContentRunContentBase = append(m.EG_ContentRunContentBase, tmpcontentruncontentbase) + tmpcontentruncontentbase.EG_RunLevelElts = append(tmpcontentruncontentbase.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMath"}: + tmpcontentruncontentbase := NewEG_ContentRunContentBase() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMath = math.NewOMath() + if err := d.DecodeElement(tmpmathcontent.OMath, &el); err != nil { + return err + } + m.EG_ContentRunContentBase = append(m.EG_ContentRunContentBase, tmpcontentruncontentbase) + tmpcontentruncontentbase.EG_RunLevelElts = append(tmpcontentruncontentbase.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + default: + gooxml.Log("skipping unsupported element on EG_PContentMath %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_PContentMath + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_PContentMath and its children +func (m *EG_PContentMath) Validate() error { + return m.ValidateWithPath("EG_PContentMath") +} + +// ValidateWithPath validates the EG_PContentMath and its children, prefixing error messages with path +func (m *EG_PContentMath) ValidateWithPath(path string) error { + for i, v := range m.EG_PContentBase { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_PContentBase[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.EG_ContentRunContentBase { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_ContentRunContentBase[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_ParaRPrTrackChanges.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_ParaRPrTrackChanges.go new file mode 100644 index 00000000..6fb915dc --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_ParaRPrTrackChanges.go @@ -0,0 +1,127 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type EG_ParaRPrTrackChanges struct { + // Inserted Paragraph + Ins *CT_TrackChange + // Deleted Paragraph + Del *CT_TrackChange + // Move Source Paragraph + MoveFrom *CT_TrackChange + // Move Destination Paragraph + MoveTo *CT_TrackChange +} + +func NewEG_ParaRPrTrackChanges() *EG_ParaRPrTrackChanges { + ret := &EG_ParaRPrTrackChanges{} + return ret +} + +func (m *EG_ParaRPrTrackChanges) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.Ins != nil { + seins := xml.StartElement{Name: xml.Name{Local: "w:ins"}} + e.EncodeElement(m.Ins, seins) + } + if m.Del != nil { + sedel := xml.StartElement{Name: xml.Name{Local: "w:del"}} + e.EncodeElement(m.Del, sedel) + } + if m.MoveFrom != nil { + semoveFrom := xml.StartElement{Name: xml.Name{Local: "w:moveFrom"}} + e.EncodeElement(m.MoveFrom, semoveFrom) + } + if m.MoveTo != nil { + semoveTo := xml.StartElement{Name: xml.Name{Local: "w:moveTo"}} + e.EncodeElement(m.MoveTo, semoveTo) + } + return nil +} + +func (m *EG_ParaRPrTrackChanges) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_ParaRPrTrackChanges: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + m.Ins = NewCT_TrackChange() + if err := d.DecodeElement(m.Ins, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + m.Del = NewCT_TrackChange() + if err := d.DecodeElement(m.Del, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFrom"}: + m.MoveFrom = NewCT_TrackChange() + if err := d.DecodeElement(m.MoveFrom, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveTo"}: + m.MoveTo = NewCT_TrackChange() + if err := d.DecodeElement(m.MoveTo, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on EG_ParaRPrTrackChanges %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_ParaRPrTrackChanges + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_ParaRPrTrackChanges and its children +func (m *EG_ParaRPrTrackChanges) Validate() error { + return m.ValidateWithPath("EG_ParaRPrTrackChanges") +} + +// ValidateWithPath validates the EG_ParaRPrTrackChanges and its children, prefixing error messages with path +func (m *EG_ParaRPrTrackChanges) ValidateWithPath(path string) error { + if m.Ins != nil { + if err := m.Ins.ValidateWithPath(path + "/Ins"); err != nil { + return err + } + } + if m.Del != nil { + if err := m.Del.ValidateWithPath(path + "/Del"); err != nil { + return err + } + } + if m.MoveFrom != nil { + if err := m.MoveFrom.ValidateWithPath(path + "/MoveFrom"); err != nil { + return err + } + } + if m.MoveTo != nil { + if err := m.MoveTo.ValidateWithPath(path + "/MoveTo"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_RPr.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_RPr.go new file mode 100644 index 00000000..ab0fa2c8 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_RPr.go @@ -0,0 +1,79 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type EG_RPr struct { + // Run Properties + RPr *CT_RPr +} + +func NewEG_RPr() *EG_RPr { + ret := &EG_RPr{} + return ret +} + +func (m *EG_RPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.RPr != nil { + serPr := xml.StartElement{Name: xml.Name{Local: "w:rPr"}} + e.EncodeElement(m.RPr, serPr) + } + return nil +} + +func (m *EG_RPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_RPr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rPr"}: + m.RPr = NewCT_RPr() + if err := d.DecodeElement(m.RPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on EG_RPr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_RPr + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_RPr and its children +func (m *EG_RPr) Validate() error { + return m.ValidateWithPath("EG_RPr") +} + +// ValidateWithPath validates the EG_RPr and its children, prefixing error messages with path +func (m *EG_RPr) ValidateWithPath(path string) error { + if m.RPr != nil { + if err := m.RPr.ValidateWithPath(path + "/RPr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_RPrBase.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_RPrBase.go new file mode 100644 index 00000000..ca734bc2 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_RPrBase.go @@ -0,0 +1,687 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type EG_RPrBase struct { + // Referenced Character Style + RStyle *CT_String + // Run Fonts + RFonts *CT_Fonts + // Bold + B *CT_OnOff + // Complex Script Bold + BCs *CT_OnOff + // Italics + I *CT_OnOff + // Complex Script Italics + ICs *CT_OnOff + // Display All Characters As Capital Letters + Caps *CT_OnOff + // Small Caps + SmallCaps *CT_OnOff + // Single Strikethrough + Strike *CT_OnOff + // Double Strikethrough + Dstrike *CT_OnOff + // Display Character Outline + Outline *CT_OnOff + // Shadow + Shadow *CT_OnOff + // Embossing + Emboss *CT_OnOff + // Imprinting + Imprint *CT_OnOff + // Do Not Check Spelling or Grammar + NoProof *CT_OnOff + // Use Document Grid Settings For Inter-Character Spacing + SnapToGrid *CT_OnOff + // Hidden Text + Vanish *CT_OnOff + // Web Hidden Text + WebHidden *CT_OnOff + // Run Content Color + Color *CT_Color + // Character Spacing Adjustment + Spacing *CT_SignedTwipsMeasure + // Expanded/Compressed Text + W *CT_TextScale + // Font Kerning + Kern *CT_HpsMeasure + // Vertically Raised or Lowered Text + Position *CT_SignedHpsMeasure + // Non-Complex Script Font Size + Sz *CT_HpsMeasure + // Complex Script Font Size + SzCs *CT_HpsMeasure + // Text Highlighting + Highlight *CT_Highlight + // Underline + U *CT_Underline + // Animated Text Effect + Effect *CT_TextEffect + // Text Border + Bdr *CT_Border + // Run Shading + Shd *CT_Shd + // Manual Run Width + FitText *CT_FitText + // Subscript/Superscript Text + VertAlign *CT_VerticalAlignRun + // Right To Left Text + Rtl *CT_OnOff + // Use Complex Script Formatting on Run + Cs *CT_OnOff + // Emphasis Mark + Em *CT_Em + // Languages for Run Content + Lang *CT_Language + // East Asian Typography Settings + EastAsianLayout *CT_EastAsianLayout + // Paragraph Mark Is Always Hidden + SpecVanish *CT_OnOff + // Office Open XML Math + OMath *CT_OnOff +} + +func NewEG_RPrBase() *EG_RPrBase { + ret := &EG_RPrBase{} + return ret +} + +func (m *EG_RPrBase) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.RStyle != nil { + serStyle := xml.StartElement{Name: xml.Name{Local: "w:rStyle"}} + e.EncodeElement(m.RStyle, serStyle) + } + if m.RFonts != nil { + serFonts := xml.StartElement{Name: xml.Name{Local: "w:rFonts"}} + e.EncodeElement(m.RFonts, serFonts) + } + if m.B != nil { + seb := xml.StartElement{Name: xml.Name{Local: "w:b"}} + e.EncodeElement(m.B, seb) + } + if m.BCs != nil { + sebCs := xml.StartElement{Name: xml.Name{Local: "w:bCs"}} + e.EncodeElement(m.BCs, sebCs) + } + if m.I != nil { + sei := xml.StartElement{Name: xml.Name{Local: "w:i"}} + e.EncodeElement(m.I, sei) + } + if m.ICs != nil { + seiCs := xml.StartElement{Name: xml.Name{Local: "w:iCs"}} + e.EncodeElement(m.ICs, seiCs) + } + if m.Caps != nil { + secaps := xml.StartElement{Name: xml.Name{Local: "w:caps"}} + e.EncodeElement(m.Caps, secaps) + } + if m.SmallCaps != nil { + sesmallCaps := xml.StartElement{Name: xml.Name{Local: "w:smallCaps"}} + e.EncodeElement(m.SmallCaps, sesmallCaps) + } + if m.Strike != nil { + sestrike := xml.StartElement{Name: xml.Name{Local: "w:strike"}} + e.EncodeElement(m.Strike, sestrike) + } + if m.Dstrike != nil { + sedstrike := xml.StartElement{Name: xml.Name{Local: "w:dstrike"}} + e.EncodeElement(m.Dstrike, sedstrike) + } + if m.Outline != nil { + seoutline := xml.StartElement{Name: xml.Name{Local: "w:outline"}} + e.EncodeElement(m.Outline, seoutline) + } + if m.Shadow != nil { + seshadow := xml.StartElement{Name: xml.Name{Local: "w:shadow"}} + e.EncodeElement(m.Shadow, seshadow) + } + if m.Emboss != nil { + seemboss := xml.StartElement{Name: xml.Name{Local: "w:emboss"}} + e.EncodeElement(m.Emboss, seemboss) + } + if m.Imprint != nil { + seimprint := xml.StartElement{Name: xml.Name{Local: "w:imprint"}} + e.EncodeElement(m.Imprint, seimprint) + } + if m.NoProof != nil { + senoProof := xml.StartElement{Name: xml.Name{Local: "w:noProof"}} + e.EncodeElement(m.NoProof, senoProof) + } + if m.SnapToGrid != nil { + sesnapToGrid := xml.StartElement{Name: xml.Name{Local: "w:snapToGrid"}} + e.EncodeElement(m.SnapToGrid, sesnapToGrid) + } + if m.Vanish != nil { + sevanish := xml.StartElement{Name: xml.Name{Local: "w:vanish"}} + e.EncodeElement(m.Vanish, sevanish) + } + if m.WebHidden != nil { + sewebHidden := xml.StartElement{Name: xml.Name{Local: "w:webHidden"}} + e.EncodeElement(m.WebHidden, sewebHidden) + } + if m.Color != nil { + secolor := xml.StartElement{Name: xml.Name{Local: "w:color"}} + e.EncodeElement(m.Color, secolor) + } + if m.Spacing != nil { + sespacing := xml.StartElement{Name: xml.Name{Local: "w:spacing"}} + e.EncodeElement(m.Spacing, sespacing) + } + if m.W != nil { + sew := xml.StartElement{Name: xml.Name{Local: "w:w"}} + e.EncodeElement(m.W, sew) + } + if m.Kern != nil { + sekern := xml.StartElement{Name: xml.Name{Local: "w:kern"}} + e.EncodeElement(m.Kern, sekern) + } + if m.Position != nil { + seposition := xml.StartElement{Name: xml.Name{Local: "w:position"}} + e.EncodeElement(m.Position, seposition) + } + if m.Sz != nil { + sesz := xml.StartElement{Name: xml.Name{Local: "w:sz"}} + e.EncodeElement(m.Sz, sesz) + } + if m.SzCs != nil { + seszCs := xml.StartElement{Name: xml.Name{Local: "w:szCs"}} + e.EncodeElement(m.SzCs, seszCs) + } + if m.Highlight != nil { + sehighlight := xml.StartElement{Name: xml.Name{Local: "w:highlight"}} + e.EncodeElement(m.Highlight, sehighlight) + } + if m.U != nil { + seu := xml.StartElement{Name: xml.Name{Local: "w:u"}} + e.EncodeElement(m.U, seu) + } + if m.Effect != nil { + seeffect := xml.StartElement{Name: xml.Name{Local: "w:effect"}} + e.EncodeElement(m.Effect, seeffect) + } + if m.Bdr != nil { + sebdr := xml.StartElement{Name: xml.Name{Local: "w:bdr"}} + e.EncodeElement(m.Bdr, sebdr) + } + if m.Shd != nil { + seshd := xml.StartElement{Name: xml.Name{Local: "w:shd"}} + e.EncodeElement(m.Shd, seshd) + } + if m.FitText != nil { + sefitText := xml.StartElement{Name: xml.Name{Local: "w:fitText"}} + e.EncodeElement(m.FitText, sefitText) + } + if m.VertAlign != nil { + severtAlign := xml.StartElement{Name: xml.Name{Local: "w:vertAlign"}} + e.EncodeElement(m.VertAlign, severtAlign) + } + if m.Rtl != nil { + sertl := xml.StartElement{Name: xml.Name{Local: "w:rtl"}} + e.EncodeElement(m.Rtl, sertl) + } + if m.Cs != nil { + secs := xml.StartElement{Name: xml.Name{Local: "w:cs"}} + e.EncodeElement(m.Cs, secs) + } + if m.Em != nil { + seem := xml.StartElement{Name: xml.Name{Local: "w:em"}} + e.EncodeElement(m.Em, seem) + } + if m.Lang != nil { + selang := xml.StartElement{Name: xml.Name{Local: "w:lang"}} + e.EncodeElement(m.Lang, selang) + } + if m.EastAsianLayout != nil { + seeastAsianLayout := xml.StartElement{Name: xml.Name{Local: "w:eastAsianLayout"}} + e.EncodeElement(m.EastAsianLayout, seeastAsianLayout) + } + if m.SpecVanish != nil { + sespecVanish := xml.StartElement{Name: xml.Name{Local: "w:specVanish"}} + e.EncodeElement(m.SpecVanish, sespecVanish) + } + if m.OMath != nil { + seoMath := xml.StartElement{Name: xml.Name{Local: "w:oMath"}} + e.EncodeElement(m.OMath, seoMath) + } + return nil +} + +func (m *EG_RPrBase) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_RPrBase: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rStyle"}: + m.RStyle = NewCT_String() + if err := d.DecodeElement(m.RStyle, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rFonts"}: + m.RFonts = NewCT_Fonts() + if err := d.DecodeElement(m.RFonts, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "b"}: + m.B = NewCT_OnOff() + if err := d.DecodeElement(m.B, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bCs"}: + m.BCs = NewCT_OnOff() + if err := d.DecodeElement(m.BCs, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "i"}: + m.I = NewCT_OnOff() + if err := d.DecodeElement(m.I, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "iCs"}: + m.ICs = NewCT_OnOff() + if err := d.DecodeElement(m.ICs, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "caps"}: + m.Caps = NewCT_OnOff() + if err := d.DecodeElement(m.Caps, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "smallCaps"}: + m.SmallCaps = NewCT_OnOff() + if err := d.DecodeElement(m.SmallCaps, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "strike"}: + m.Strike = NewCT_OnOff() + if err := d.DecodeElement(m.Strike, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "dstrike"}: + m.Dstrike = NewCT_OnOff() + if err := d.DecodeElement(m.Dstrike, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "outline"}: + m.Outline = NewCT_OnOff() + if err := d.DecodeElement(m.Outline, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "shadow"}: + m.Shadow = NewCT_OnOff() + if err := d.DecodeElement(m.Shadow, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "emboss"}: + m.Emboss = NewCT_OnOff() + if err := d.DecodeElement(m.Emboss, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "imprint"}: + m.Imprint = NewCT_OnOff() + if err := d.DecodeElement(m.Imprint, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "noProof"}: + m.NoProof = NewCT_OnOff() + if err := d.DecodeElement(m.NoProof, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "snapToGrid"}: + m.SnapToGrid = NewCT_OnOff() + if err := d.DecodeElement(m.SnapToGrid, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "vanish"}: + m.Vanish = NewCT_OnOff() + if err := d.DecodeElement(m.Vanish, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "webHidden"}: + m.WebHidden = NewCT_OnOff() + if err := d.DecodeElement(m.WebHidden, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "color"}: + m.Color = NewCT_Color() + if err := d.DecodeElement(m.Color, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "spacing"}: + m.Spacing = NewCT_SignedTwipsMeasure() + if err := d.DecodeElement(m.Spacing, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "w"}: + m.W = NewCT_TextScale() + if err := d.DecodeElement(m.W, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "kern"}: + m.Kern = NewCT_HpsMeasure() + if err := d.DecodeElement(m.Kern, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "position"}: + m.Position = NewCT_SignedHpsMeasure() + if err := d.DecodeElement(m.Position, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sz"}: + m.Sz = NewCT_HpsMeasure() + if err := d.DecodeElement(m.Sz, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "szCs"}: + m.SzCs = NewCT_HpsMeasure() + if err := d.DecodeElement(m.SzCs, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "highlight"}: + m.Highlight = NewCT_Highlight() + if err := d.DecodeElement(m.Highlight, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "u"}: + m.U = NewCT_Underline() + if err := d.DecodeElement(m.U, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "effect"}: + m.Effect = NewCT_TextEffect() + if err := d.DecodeElement(m.Effect, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bdr"}: + m.Bdr = NewCT_Border() + if err := d.DecodeElement(m.Bdr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "shd"}: + m.Shd = NewCT_Shd() + if err := d.DecodeElement(m.Shd, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "fitText"}: + m.FitText = NewCT_FitText() + if err := d.DecodeElement(m.FitText, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "vertAlign"}: + m.VertAlign = NewCT_VerticalAlignRun() + if err := d.DecodeElement(m.VertAlign, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rtl"}: + m.Rtl = NewCT_OnOff() + if err := d.DecodeElement(m.Rtl, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "cs"}: + m.Cs = NewCT_OnOff() + if err := d.DecodeElement(m.Cs, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "em"}: + m.Em = NewCT_Em() + if err := d.DecodeElement(m.Em, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "lang"}: + m.Lang = NewCT_Language() + if err := d.DecodeElement(m.Lang, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "eastAsianLayout"}: + m.EastAsianLayout = NewCT_EastAsianLayout() + if err := d.DecodeElement(m.EastAsianLayout, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "specVanish"}: + m.SpecVanish = NewCT_OnOff() + if err := d.DecodeElement(m.SpecVanish, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "oMath"}: + m.OMath = NewCT_OnOff() + if err := d.DecodeElement(m.OMath, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on EG_RPrBase %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_RPrBase + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_RPrBase and its children +func (m *EG_RPrBase) Validate() error { + return m.ValidateWithPath("EG_RPrBase") +} + +// ValidateWithPath validates the EG_RPrBase and its children, prefixing error messages with path +func (m *EG_RPrBase) ValidateWithPath(path string) error { + if m.RStyle != nil { + if err := m.RStyle.ValidateWithPath(path + "/RStyle"); err != nil { + return err + } + } + if m.RFonts != nil { + if err := m.RFonts.ValidateWithPath(path + "/RFonts"); err != nil { + return err + } + } + if m.B != nil { + if err := m.B.ValidateWithPath(path + "/B"); err != nil { + return err + } + } + if m.BCs != nil { + if err := m.BCs.ValidateWithPath(path + "/BCs"); err != nil { + return err + } + } + if m.I != nil { + if err := m.I.ValidateWithPath(path + "/I"); err != nil { + return err + } + } + if m.ICs != nil { + if err := m.ICs.ValidateWithPath(path + "/ICs"); err != nil { + return err + } + } + if m.Caps != nil { + if err := m.Caps.ValidateWithPath(path + "/Caps"); err != nil { + return err + } + } + if m.SmallCaps != nil { + if err := m.SmallCaps.ValidateWithPath(path + "/SmallCaps"); err != nil { + return err + } + } + if m.Strike != nil { + if err := m.Strike.ValidateWithPath(path + "/Strike"); err != nil { + return err + } + } + if m.Dstrike != nil { + if err := m.Dstrike.ValidateWithPath(path + "/Dstrike"); err != nil { + return err + } + } + if m.Outline != nil { + if err := m.Outline.ValidateWithPath(path + "/Outline"); err != nil { + return err + } + } + if m.Shadow != nil { + if err := m.Shadow.ValidateWithPath(path + "/Shadow"); err != nil { + return err + } + } + if m.Emboss != nil { + if err := m.Emboss.ValidateWithPath(path + "/Emboss"); err != nil { + return err + } + } + if m.Imprint != nil { + if err := m.Imprint.ValidateWithPath(path + "/Imprint"); err != nil { + return err + } + } + if m.NoProof != nil { + if err := m.NoProof.ValidateWithPath(path + "/NoProof"); err != nil { + return err + } + } + if m.SnapToGrid != nil { + if err := m.SnapToGrid.ValidateWithPath(path + "/SnapToGrid"); err != nil { + return err + } + } + if m.Vanish != nil { + if err := m.Vanish.ValidateWithPath(path + "/Vanish"); err != nil { + return err + } + } + if m.WebHidden != nil { + if err := m.WebHidden.ValidateWithPath(path + "/WebHidden"); err != nil { + return err + } + } + if m.Color != nil { + if err := m.Color.ValidateWithPath(path + "/Color"); err != nil { + return err + } + } + if m.Spacing != nil { + if err := m.Spacing.ValidateWithPath(path + "/Spacing"); err != nil { + return err + } + } + if m.W != nil { + if err := m.W.ValidateWithPath(path + "/W"); err != nil { + return err + } + } + if m.Kern != nil { + if err := m.Kern.ValidateWithPath(path + "/Kern"); err != nil { + return err + } + } + if m.Position != nil { + if err := m.Position.ValidateWithPath(path + "/Position"); err != nil { + return err + } + } + if m.Sz != nil { + if err := m.Sz.ValidateWithPath(path + "/Sz"); err != nil { + return err + } + } + if m.SzCs != nil { + if err := m.SzCs.ValidateWithPath(path + "/SzCs"); err != nil { + return err + } + } + if m.Highlight != nil { + if err := m.Highlight.ValidateWithPath(path + "/Highlight"); err != nil { + return err + } + } + if m.U != nil { + if err := m.U.ValidateWithPath(path + "/U"); err != nil { + return err + } + } + if m.Effect != nil { + if err := m.Effect.ValidateWithPath(path + "/Effect"); err != nil { + return err + } + } + if m.Bdr != nil { + if err := m.Bdr.ValidateWithPath(path + "/Bdr"); err != nil { + return err + } + } + if m.Shd != nil { + if err := m.Shd.ValidateWithPath(path + "/Shd"); err != nil { + return err + } + } + if m.FitText != nil { + if err := m.FitText.ValidateWithPath(path + "/FitText"); err != nil { + return err + } + } + if m.VertAlign != nil { + if err := m.VertAlign.ValidateWithPath(path + "/VertAlign"); err != nil { + return err + } + } + if m.Rtl != nil { + if err := m.Rtl.ValidateWithPath(path + "/Rtl"); err != nil { + return err + } + } + if m.Cs != nil { + if err := m.Cs.ValidateWithPath(path + "/Cs"); err != nil { + return err + } + } + if m.Em != nil { + if err := m.Em.ValidateWithPath(path + "/Em"); err != nil { + return err + } + } + if m.Lang != nil { + if err := m.Lang.ValidateWithPath(path + "/Lang"); err != nil { + return err + } + } + if m.EastAsianLayout != nil { + if err := m.EastAsianLayout.ValidateWithPath(path + "/EastAsianLayout"); err != nil { + return err + } + } + if m.SpecVanish != nil { + if err := m.SpecVanish.ValidateWithPath(path + "/SpecVanish"); err != nil { + return err + } + } + if m.OMath != nil { + if err := m.OMath.ValidateWithPath(path + "/OMath"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_RPrContent.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_RPrContent.go new file mode 100644 index 00000000..43819488 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_RPrContent.go @@ -0,0 +1,703 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type EG_RPrContent struct { + // Referenced Character Style + RStyle *CT_String + // Run Fonts + RFonts *CT_Fonts + // Bold + B *CT_OnOff + // Complex Script Bold + BCs *CT_OnOff + // Italics + I *CT_OnOff + // Complex Script Italics + ICs *CT_OnOff + // Display All Characters As Capital Letters + Caps *CT_OnOff + // Small Caps + SmallCaps *CT_OnOff + // Single Strikethrough + Strike *CT_OnOff + // Double Strikethrough + Dstrike *CT_OnOff + // Display Character Outline + Outline *CT_OnOff + // Shadow + Shadow *CT_OnOff + // Embossing + Emboss *CT_OnOff + // Imprinting + Imprint *CT_OnOff + // Do Not Check Spelling or Grammar + NoProof *CT_OnOff + // Use Document Grid Settings For Inter-Character Spacing + SnapToGrid *CT_OnOff + // Hidden Text + Vanish *CT_OnOff + // Web Hidden Text + WebHidden *CT_OnOff + // Run Content Color + Color *CT_Color + // Character Spacing Adjustment + Spacing *CT_SignedTwipsMeasure + // Expanded/Compressed Text + W *CT_TextScale + // Font Kerning + Kern *CT_HpsMeasure + // Vertically Raised or Lowered Text + Position *CT_SignedHpsMeasure + // Non-Complex Script Font Size + Sz *CT_HpsMeasure + // Complex Script Font Size + SzCs *CT_HpsMeasure + // Text Highlighting + Highlight *CT_Highlight + // Underline + U *CT_Underline + // Animated Text Effect + Effect *CT_TextEffect + // Text Border + Bdr *CT_Border + // Run Shading + Shd *CT_Shd + // Manual Run Width + FitText *CT_FitText + // Subscript/Superscript Text + VertAlign *CT_VerticalAlignRun + // Right To Left Text + Rtl *CT_OnOff + // Use Complex Script Formatting on Run + Cs *CT_OnOff + // Emphasis Mark + Em *CT_Em + // Languages for Run Content + Lang *CT_Language + // East Asian Typography Settings + EastAsianLayout *CT_EastAsianLayout + // Paragraph Mark Is Always Hidden + SpecVanish *CT_OnOff + // Office Open XML Math + OMath *CT_OnOff + // Revision Information for Run Properties + RPrChange *CT_RPrChange +} + +func NewEG_RPrContent() *EG_RPrContent { + ret := &EG_RPrContent{} + return ret +} + +func (m *EG_RPrContent) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.RStyle != nil { + serStyle := xml.StartElement{Name: xml.Name{Local: "w:rStyle"}} + e.EncodeElement(m.RStyle, serStyle) + } + if m.RFonts != nil { + serFonts := xml.StartElement{Name: xml.Name{Local: "w:rFonts"}} + e.EncodeElement(m.RFonts, serFonts) + } + if m.B != nil { + seb := xml.StartElement{Name: xml.Name{Local: "w:b"}} + e.EncodeElement(m.B, seb) + } + if m.BCs != nil { + sebCs := xml.StartElement{Name: xml.Name{Local: "w:bCs"}} + e.EncodeElement(m.BCs, sebCs) + } + if m.I != nil { + sei := xml.StartElement{Name: xml.Name{Local: "w:i"}} + e.EncodeElement(m.I, sei) + } + if m.ICs != nil { + seiCs := xml.StartElement{Name: xml.Name{Local: "w:iCs"}} + e.EncodeElement(m.ICs, seiCs) + } + if m.Caps != nil { + secaps := xml.StartElement{Name: xml.Name{Local: "w:caps"}} + e.EncodeElement(m.Caps, secaps) + } + if m.SmallCaps != nil { + sesmallCaps := xml.StartElement{Name: xml.Name{Local: "w:smallCaps"}} + e.EncodeElement(m.SmallCaps, sesmallCaps) + } + if m.Strike != nil { + sestrike := xml.StartElement{Name: xml.Name{Local: "w:strike"}} + e.EncodeElement(m.Strike, sestrike) + } + if m.Dstrike != nil { + sedstrike := xml.StartElement{Name: xml.Name{Local: "w:dstrike"}} + e.EncodeElement(m.Dstrike, sedstrike) + } + if m.Outline != nil { + seoutline := xml.StartElement{Name: xml.Name{Local: "w:outline"}} + e.EncodeElement(m.Outline, seoutline) + } + if m.Shadow != nil { + seshadow := xml.StartElement{Name: xml.Name{Local: "w:shadow"}} + e.EncodeElement(m.Shadow, seshadow) + } + if m.Emboss != nil { + seemboss := xml.StartElement{Name: xml.Name{Local: "w:emboss"}} + e.EncodeElement(m.Emboss, seemboss) + } + if m.Imprint != nil { + seimprint := xml.StartElement{Name: xml.Name{Local: "w:imprint"}} + e.EncodeElement(m.Imprint, seimprint) + } + if m.NoProof != nil { + senoProof := xml.StartElement{Name: xml.Name{Local: "w:noProof"}} + e.EncodeElement(m.NoProof, senoProof) + } + if m.SnapToGrid != nil { + sesnapToGrid := xml.StartElement{Name: xml.Name{Local: "w:snapToGrid"}} + e.EncodeElement(m.SnapToGrid, sesnapToGrid) + } + if m.Vanish != nil { + sevanish := xml.StartElement{Name: xml.Name{Local: "w:vanish"}} + e.EncodeElement(m.Vanish, sevanish) + } + if m.WebHidden != nil { + sewebHidden := xml.StartElement{Name: xml.Name{Local: "w:webHidden"}} + e.EncodeElement(m.WebHidden, sewebHidden) + } + if m.Color != nil { + secolor := xml.StartElement{Name: xml.Name{Local: "w:color"}} + e.EncodeElement(m.Color, secolor) + } + if m.Spacing != nil { + sespacing := xml.StartElement{Name: xml.Name{Local: "w:spacing"}} + e.EncodeElement(m.Spacing, sespacing) + } + if m.W != nil { + sew := xml.StartElement{Name: xml.Name{Local: "w:w"}} + e.EncodeElement(m.W, sew) + } + if m.Kern != nil { + sekern := xml.StartElement{Name: xml.Name{Local: "w:kern"}} + e.EncodeElement(m.Kern, sekern) + } + if m.Position != nil { + seposition := xml.StartElement{Name: xml.Name{Local: "w:position"}} + e.EncodeElement(m.Position, seposition) + } + if m.Sz != nil { + sesz := xml.StartElement{Name: xml.Name{Local: "w:sz"}} + e.EncodeElement(m.Sz, sesz) + } + if m.SzCs != nil { + seszCs := xml.StartElement{Name: xml.Name{Local: "w:szCs"}} + e.EncodeElement(m.SzCs, seszCs) + } + if m.Highlight != nil { + sehighlight := xml.StartElement{Name: xml.Name{Local: "w:highlight"}} + e.EncodeElement(m.Highlight, sehighlight) + } + if m.U != nil { + seu := xml.StartElement{Name: xml.Name{Local: "w:u"}} + e.EncodeElement(m.U, seu) + } + if m.Effect != nil { + seeffect := xml.StartElement{Name: xml.Name{Local: "w:effect"}} + e.EncodeElement(m.Effect, seeffect) + } + if m.Bdr != nil { + sebdr := xml.StartElement{Name: xml.Name{Local: "w:bdr"}} + e.EncodeElement(m.Bdr, sebdr) + } + if m.Shd != nil { + seshd := xml.StartElement{Name: xml.Name{Local: "w:shd"}} + e.EncodeElement(m.Shd, seshd) + } + if m.FitText != nil { + sefitText := xml.StartElement{Name: xml.Name{Local: "w:fitText"}} + e.EncodeElement(m.FitText, sefitText) + } + if m.VertAlign != nil { + severtAlign := xml.StartElement{Name: xml.Name{Local: "w:vertAlign"}} + e.EncodeElement(m.VertAlign, severtAlign) + } + if m.Rtl != nil { + sertl := xml.StartElement{Name: xml.Name{Local: "w:rtl"}} + e.EncodeElement(m.Rtl, sertl) + } + if m.Cs != nil { + secs := xml.StartElement{Name: xml.Name{Local: "w:cs"}} + e.EncodeElement(m.Cs, secs) + } + if m.Em != nil { + seem := xml.StartElement{Name: xml.Name{Local: "w:em"}} + e.EncodeElement(m.Em, seem) + } + if m.Lang != nil { + selang := xml.StartElement{Name: xml.Name{Local: "w:lang"}} + e.EncodeElement(m.Lang, selang) + } + if m.EastAsianLayout != nil { + seeastAsianLayout := xml.StartElement{Name: xml.Name{Local: "w:eastAsianLayout"}} + e.EncodeElement(m.EastAsianLayout, seeastAsianLayout) + } + if m.SpecVanish != nil { + sespecVanish := xml.StartElement{Name: xml.Name{Local: "w:specVanish"}} + e.EncodeElement(m.SpecVanish, sespecVanish) + } + if m.OMath != nil { + seoMath := xml.StartElement{Name: xml.Name{Local: "w:oMath"}} + e.EncodeElement(m.OMath, seoMath) + } + if m.RPrChange != nil { + serPrChange := xml.StartElement{Name: xml.Name{Local: "w:rPrChange"}} + e.EncodeElement(m.RPrChange, serPrChange) + } + return nil +} + +func (m *EG_RPrContent) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_RPrContent: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rStyle"}: + m.RStyle = NewCT_String() + if err := d.DecodeElement(m.RStyle, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rFonts"}: + m.RFonts = NewCT_Fonts() + if err := d.DecodeElement(m.RFonts, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "b"}: + m.B = NewCT_OnOff() + if err := d.DecodeElement(m.B, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bCs"}: + m.BCs = NewCT_OnOff() + if err := d.DecodeElement(m.BCs, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "i"}: + m.I = NewCT_OnOff() + if err := d.DecodeElement(m.I, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "iCs"}: + m.ICs = NewCT_OnOff() + if err := d.DecodeElement(m.ICs, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "caps"}: + m.Caps = NewCT_OnOff() + if err := d.DecodeElement(m.Caps, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "smallCaps"}: + m.SmallCaps = NewCT_OnOff() + if err := d.DecodeElement(m.SmallCaps, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "strike"}: + m.Strike = NewCT_OnOff() + if err := d.DecodeElement(m.Strike, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "dstrike"}: + m.Dstrike = NewCT_OnOff() + if err := d.DecodeElement(m.Dstrike, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "outline"}: + m.Outline = NewCT_OnOff() + if err := d.DecodeElement(m.Outline, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "shadow"}: + m.Shadow = NewCT_OnOff() + if err := d.DecodeElement(m.Shadow, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "emboss"}: + m.Emboss = NewCT_OnOff() + if err := d.DecodeElement(m.Emboss, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "imprint"}: + m.Imprint = NewCT_OnOff() + if err := d.DecodeElement(m.Imprint, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "noProof"}: + m.NoProof = NewCT_OnOff() + if err := d.DecodeElement(m.NoProof, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "snapToGrid"}: + m.SnapToGrid = NewCT_OnOff() + if err := d.DecodeElement(m.SnapToGrid, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "vanish"}: + m.Vanish = NewCT_OnOff() + if err := d.DecodeElement(m.Vanish, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "webHidden"}: + m.WebHidden = NewCT_OnOff() + if err := d.DecodeElement(m.WebHidden, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "color"}: + m.Color = NewCT_Color() + if err := d.DecodeElement(m.Color, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "spacing"}: + m.Spacing = NewCT_SignedTwipsMeasure() + if err := d.DecodeElement(m.Spacing, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "w"}: + m.W = NewCT_TextScale() + if err := d.DecodeElement(m.W, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "kern"}: + m.Kern = NewCT_HpsMeasure() + if err := d.DecodeElement(m.Kern, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "position"}: + m.Position = NewCT_SignedHpsMeasure() + if err := d.DecodeElement(m.Position, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sz"}: + m.Sz = NewCT_HpsMeasure() + if err := d.DecodeElement(m.Sz, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "szCs"}: + m.SzCs = NewCT_HpsMeasure() + if err := d.DecodeElement(m.SzCs, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "highlight"}: + m.Highlight = NewCT_Highlight() + if err := d.DecodeElement(m.Highlight, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "u"}: + m.U = NewCT_Underline() + if err := d.DecodeElement(m.U, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "effect"}: + m.Effect = NewCT_TextEffect() + if err := d.DecodeElement(m.Effect, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bdr"}: + m.Bdr = NewCT_Border() + if err := d.DecodeElement(m.Bdr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "shd"}: + m.Shd = NewCT_Shd() + if err := d.DecodeElement(m.Shd, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "fitText"}: + m.FitText = NewCT_FitText() + if err := d.DecodeElement(m.FitText, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "vertAlign"}: + m.VertAlign = NewCT_VerticalAlignRun() + if err := d.DecodeElement(m.VertAlign, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rtl"}: + m.Rtl = NewCT_OnOff() + if err := d.DecodeElement(m.Rtl, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "cs"}: + m.Cs = NewCT_OnOff() + if err := d.DecodeElement(m.Cs, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "em"}: + m.Em = NewCT_Em() + if err := d.DecodeElement(m.Em, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "lang"}: + m.Lang = NewCT_Language() + if err := d.DecodeElement(m.Lang, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "eastAsianLayout"}: + m.EastAsianLayout = NewCT_EastAsianLayout() + if err := d.DecodeElement(m.EastAsianLayout, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "specVanish"}: + m.SpecVanish = NewCT_OnOff() + if err := d.DecodeElement(m.SpecVanish, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "oMath"}: + m.OMath = NewCT_OnOff() + if err := d.DecodeElement(m.OMath, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rPrChange"}: + m.RPrChange = NewCT_RPrChange() + if err := d.DecodeElement(m.RPrChange, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on EG_RPrContent %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_RPrContent + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_RPrContent and its children +func (m *EG_RPrContent) Validate() error { + return m.ValidateWithPath("EG_RPrContent") +} + +// ValidateWithPath validates the EG_RPrContent and its children, prefixing error messages with path +func (m *EG_RPrContent) ValidateWithPath(path string) error { + if m.RStyle != nil { + if err := m.RStyle.ValidateWithPath(path + "/RStyle"); err != nil { + return err + } + } + if m.RFonts != nil { + if err := m.RFonts.ValidateWithPath(path + "/RFonts"); err != nil { + return err + } + } + if m.B != nil { + if err := m.B.ValidateWithPath(path + "/B"); err != nil { + return err + } + } + if m.BCs != nil { + if err := m.BCs.ValidateWithPath(path + "/BCs"); err != nil { + return err + } + } + if m.I != nil { + if err := m.I.ValidateWithPath(path + "/I"); err != nil { + return err + } + } + if m.ICs != nil { + if err := m.ICs.ValidateWithPath(path + "/ICs"); err != nil { + return err + } + } + if m.Caps != nil { + if err := m.Caps.ValidateWithPath(path + "/Caps"); err != nil { + return err + } + } + if m.SmallCaps != nil { + if err := m.SmallCaps.ValidateWithPath(path + "/SmallCaps"); err != nil { + return err + } + } + if m.Strike != nil { + if err := m.Strike.ValidateWithPath(path + "/Strike"); err != nil { + return err + } + } + if m.Dstrike != nil { + if err := m.Dstrike.ValidateWithPath(path + "/Dstrike"); err != nil { + return err + } + } + if m.Outline != nil { + if err := m.Outline.ValidateWithPath(path + "/Outline"); err != nil { + return err + } + } + if m.Shadow != nil { + if err := m.Shadow.ValidateWithPath(path + "/Shadow"); err != nil { + return err + } + } + if m.Emboss != nil { + if err := m.Emboss.ValidateWithPath(path + "/Emboss"); err != nil { + return err + } + } + if m.Imprint != nil { + if err := m.Imprint.ValidateWithPath(path + "/Imprint"); err != nil { + return err + } + } + if m.NoProof != nil { + if err := m.NoProof.ValidateWithPath(path + "/NoProof"); err != nil { + return err + } + } + if m.SnapToGrid != nil { + if err := m.SnapToGrid.ValidateWithPath(path + "/SnapToGrid"); err != nil { + return err + } + } + if m.Vanish != nil { + if err := m.Vanish.ValidateWithPath(path + "/Vanish"); err != nil { + return err + } + } + if m.WebHidden != nil { + if err := m.WebHidden.ValidateWithPath(path + "/WebHidden"); err != nil { + return err + } + } + if m.Color != nil { + if err := m.Color.ValidateWithPath(path + "/Color"); err != nil { + return err + } + } + if m.Spacing != nil { + if err := m.Spacing.ValidateWithPath(path + "/Spacing"); err != nil { + return err + } + } + if m.W != nil { + if err := m.W.ValidateWithPath(path + "/W"); err != nil { + return err + } + } + if m.Kern != nil { + if err := m.Kern.ValidateWithPath(path + "/Kern"); err != nil { + return err + } + } + if m.Position != nil { + if err := m.Position.ValidateWithPath(path + "/Position"); err != nil { + return err + } + } + if m.Sz != nil { + if err := m.Sz.ValidateWithPath(path + "/Sz"); err != nil { + return err + } + } + if m.SzCs != nil { + if err := m.SzCs.ValidateWithPath(path + "/SzCs"); err != nil { + return err + } + } + if m.Highlight != nil { + if err := m.Highlight.ValidateWithPath(path + "/Highlight"); err != nil { + return err + } + } + if m.U != nil { + if err := m.U.ValidateWithPath(path + "/U"); err != nil { + return err + } + } + if m.Effect != nil { + if err := m.Effect.ValidateWithPath(path + "/Effect"); err != nil { + return err + } + } + if m.Bdr != nil { + if err := m.Bdr.ValidateWithPath(path + "/Bdr"); err != nil { + return err + } + } + if m.Shd != nil { + if err := m.Shd.ValidateWithPath(path + "/Shd"); err != nil { + return err + } + } + if m.FitText != nil { + if err := m.FitText.ValidateWithPath(path + "/FitText"); err != nil { + return err + } + } + if m.VertAlign != nil { + if err := m.VertAlign.ValidateWithPath(path + "/VertAlign"); err != nil { + return err + } + } + if m.Rtl != nil { + if err := m.Rtl.ValidateWithPath(path + "/Rtl"); err != nil { + return err + } + } + if m.Cs != nil { + if err := m.Cs.ValidateWithPath(path + "/Cs"); err != nil { + return err + } + } + if m.Em != nil { + if err := m.Em.ValidateWithPath(path + "/Em"); err != nil { + return err + } + } + if m.Lang != nil { + if err := m.Lang.ValidateWithPath(path + "/Lang"); err != nil { + return err + } + } + if m.EastAsianLayout != nil { + if err := m.EastAsianLayout.ValidateWithPath(path + "/EastAsianLayout"); err != nil { + return err + } + } + if m.SpecVanish != nil { + if err := m.SpecVanish.ValidateWithPath(path + "/SpecVanish"); err != nil { + return err + } + } + if m.OMath != nil { + if err := m.OMath.ValidateWithPath(path + "/OMath"); err != nil { + return err + } + } + if m.RPrChange != nil { + if err := m.RPrChange.ValidateWithPath(path + "/RPrChange"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_RPrMath.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_RPrMath.go new file mode 100644 index 00000000..7b627728 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_RPrMath.go @@ -0,0 +1,112 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type EG_RPrMath struct { + // Inserted Math Control Character + Ins *CT_MathCtrlIns + // Deleted Math Control Character + Del *CT_MathCtrlDel + // Run Properties + RPr *CT_RPr +} + +func NewEG_RPrMath() *EG_RPrMath { + ret := &EG_RPrMath{} + return ret +} + +func (m *EG_RPrMath) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Name.Local = "w:EG_RPrMath" + if m.Ins != nil { + seins := xml.StartElement{Name: xml.Name{Local: "w:ins"}} + e.EncodeElement(m.Ins, seins) + } + if m.Del != nil { + sedel := xml.StartElement{Name: xml.Name{Local: "w:del"}} + e.EncodeElement(m.Del, sedel) + } + if m.RPr != nil { + serPr := xml.StartElement{Name: xml.Name{Local: "w:rPr"}} + e.EncodeElement(m.RPr, serPr) + } + return nil +} + +func (m *EG_RPrMath) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_RPrMath: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + m.Ins = NewCT_MathCtrlIns() + if err := d.DecodeElement(m.Ins, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + m.Del = NewCT_MathCtrlDel() + if err := d.DecodeElement(m.Del, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rPr"}: + m.RPr = NewCT_RPr() + if err := d.DecodeElement(m.RPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on EG_RPrMath %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_RPrMath + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_RPrMath and its children +func (m *EG_RPrMath) Validate() error { + return m.ValidateWithPath("EG_RPrMath") +} + +// ValidateWithPath validates the EG_RPrMath and its children, prefixing error messages with path +func (m *EG_RPrMath) ValidateWithPath(path string) error { + if m.Ins != nil { + if err := m.Ins.ValidateWithPath(path + "/Ins"); err != nil { + return err + } + } + if m.Del != nil { + if err := m.Del.ValidateWithPath(path + "/Del"); err != nil { + return err + } + } + if m.RPr != nil { + if err := m.RPr.ValidateWithPath(path + "/RPr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_RangeMarkupElements.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_RangeMarkupElements.go new file mode 100644 index 00000000..2b5d42f4 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_RangeMarkupElements.go @@ -0,0 +1,319 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type EG_RangeMarkupElements struct { + // Bookmark Start + BookmarkStart *CT_Bookmark + // Bookmark End + BookmarkEnd *CT_MarkupRange + // Move Source Location Container - Start + MoveFromRangeStart *CT_MoveBookmark + // Move Source Location Container - End + MoveFromRangeEnd *CT_MarkupRange + // Move Destination Location Container - Start + MoveToRangeStart *CT_MoveBookmark + // Move Destination Location Container - End + MoveToRangeEnd *CT_MarkupRange + // Comment Anchor Range Start + CommentRangeStart *CT_MarkupRange + // Comment Anchor Range End + CommentRangeEnd *CT_MarkupRange + // Custom XML Markup Insertion Start + CustomXmlInsRangeStart *CT_TrackChange + // Custom XML Markup Insertion End + CustomXmlInsRangeEnd *CT_Markup + // Custom XML Markup Deletion Start + CustomXmlDelRangeStart *CT_TrackChange + // Custom XML Markup Deletion End + CustomXmlDelRangeEnd *CT_Markup + // Custom XML Markup Move Source Start + CustomXmlMoveFromRangeStart *CT_TrackChange + // Custom XML Markup Move Source End + CustomXmlMoveFromRangeEnd *CT_Markup + // Custom XML Markup Move Destination Location Start + CustomXmlMoveToRangeStart *CT_TrackChange + // Custom XML Markup Move Destination Location End + CustomXmlMoveToRangeEnd *CT_Markup +} + +func NewEG_RangeMarkupElements() *EG_RangeMarkupElements { + ret := &EG_RangeMarkupElements{} + return ret +} + +func (m *EG_RangeMarkupElements) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.BookmarkStart != nil { + sebookmarkStart := xml.StartElement{Name: xml.Name{Local: "w:bookmarkStart"}} + e.EncodeElement(m.BookmarkStart, sebookmarkStart) + } + if m.BookmarkEnd != nil { + sebookmarkEnd := xml.StartElement{Name: xml.Name{Local: "w:bookmarkEnd"}} + e.EncodeElement(m.BookmarkEnd, sebookmarkEnd) + } + if m.MoveFromRangeStart != nil { + semoveFromRangeStart := xml.StartElement{Name: xml.Name{Local: "w:moveFromRangeStart"}} + e.EncodeElement(m.MoveFromRangeStart, semoveFromRangeStart) + } + if m.MoveFromRangeEnd != nil { + semoveFromRangeEnd := xml.StartElement{Name: xml.Name{Local: "w:moveFromRangeEnd"}} + e.EncodeElement(m.MoveFromRangeEnd, semoveFromRangeEnd) + } + if m.MoveToRangeStart != nil { + semoveToRangeStart := xml.StartElement{Name: xml.Name{Local: "w:moveToRangeStart"}} + e.EncodeElement(m.MoveToRangeStart, semoveToRangeStart) + } + if m.MoveToRangeEnd != nil { + semoveToRangeEnd := xml.StartElement{Name: xml.Name{Local: "w:moveToRangeEnd"}} + e.EncodeElement(m.MoveToRangeEnd, semoveToRangeEnd) + } + if m.CommentRangeStart != nil { + secommentRangeStart := xml.StartElement{Name: xml.Name{Local: "w:commentRangeStart"}} + e.EncodeElement(m.CommentRangeStart, secommentRangeStart) + } + if m.CommentRangeEnd != nil { + secommentRangeEnd := xml.StartElement{Name: xml.Name{Local: "w:commentRangeEnd"}} + e.EncodeElement(m.CommentRangeEnd, secommentRangeEnd) + } + if m.CustomXmlInsRangeStart != nil { + secustomXmlInsRangeStart := xml.StartElement{Name: xml.Name{Local: "w:customXmlInsRangeStart"}} + e.EncodeElement(m.CustomXmlInsRangeStart, secustomXmlInsRangeStart) + } + if m.CustomXmlInsRangeEnd != nil { + secustomXmlInsRangeEnd := xml.StartElement{Name: xml.Name{Local: "w:customXmlInsRangeEnd"}} + e.EncodeElement(m.CustomXmlInsRangeEnd, secustomXmlInsRangeEnd) + } + if m.CustomXmlDelRangeStart != nil { + secustomXmlDelRangeStart := xml.StartElement{Name: xml.Name{Local: "w:customXmlDelRangeStart"}} + e.EncodeElement(m.CustomXmlDelRangeStart, secustomXmlDelRangeStart) + } + if m.CustomXmlDelRangeEnd != nil { + secustomXmlDelRangeEnd := xml.StartElement{Name: xml.Name{Local: "w:customXmlDelRangeEnd"}} + e.EncodeElement(m.CustomXmlDelRangeEnd, secustomXmlDelRangeEnd) + } + if m.CustomXmlMoveFromRangeStart != nil { + secustomXmlMoveFromRangeStart := xml.StartElement{Name: xml.Name{Local: "w:customXmlMoveFromRangeStart"}} + e.EncodeElement(m.CustomXmlMoveFromRangeStart, secustomXmlMoveFromRangeStart) + } + if m.CustomXmlMoveFromRangeEnd != nil { + secustomXmlMoveFromRangeEnd := xml.StartElement{Name: xml.Name{Local: "w:customXmlMoveFromRangeEnd"}} + e.EncodeElement(m.CustomXmlMoveFromRangeEnd, secustomXmlMoveFromRangeEnd) + } + if m.CustomXmlMoveToRangeStart != nil { + secustomXmlMoveToRangeStart := xml.StartElement{Name: xml.Name{Local: "w:customXmlMoveToRangeStart"}} + e.EncodeElement(m.CustomXmlMoveToRangeStart, secustomXmlMoveToRangeStart) + } + if m.CustomXmlMoveToRangeEnd != nil { + secustomXmlMoveToRangeEnd := xml.StartElement{Name: xml.Name{Local: "w:customXmlMoveToRangeEnd"}} + e.EncodeElement(m.CustomXmlMoveToRangeEnd, secustomXmlMoveToRangeEnd) + } + return nil +} + +func (m *EG_RangeMarkupElements) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_RangeMarkupElements: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkStart"}: + m.BookmarkStart = NewCT_Bookmark() + if err := d.DecodeElement(m.BookmarkStart, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkEnd"}: + m.BookmarkEnd = NewCT_MarkupRange() + if err := d.DecodeElement(m.BookmarkEnd, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeStart"}: + m.MoveFromRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(m.MoveFromRangeStart, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeEnd"}: + m.MoveFromRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(m.MoveFromRangeEnd, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeStart"}: + m.MoveToRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(m.MoveToRangeStart, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeEnd"}: + m.MoveToRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(m.MoveToRangeEnd, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeStart"}: + m.CommentRangeStart = NewCT_MarkupRange() + if err := d.DecodeElement(m.CommentRangeStart, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeEnd"}: + m.CommentRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(m.CommentRangeEnd, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeStart"}: + m.CustomXmlInsRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(m.CustomXmlInsRangeStart, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeEnd"}: + m.CustomXmlInsRangeEnd = NewCT_Markup() + if err := d.DecodeElement(m.CustomXmlInsRangeEnd, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeStart"}: + m.CustomXmlDelRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(m.CustomXmlDelRangeStart, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeEnd"}: + m.CustomXmlDelRangeEnd = NewCT_Markup() + if err := d.DecodeElement(m.CustomXmlDelRangeEnd, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeStart"}: + m.CustomXmlMoveFromRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(m.CustomXmlMoveFromRangeStart, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeEnd"}: + m.CustomXmlMoveFromRangeEnd = NewCT_Markup() + if err := d.DecodeElement(m.CustomXmlMoveFromRangeEnd, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeStart"}: + m.CustomXmlMoveToRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(m.CustomXmlMoveToRangeStart, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeEnd"}: + m.CustomXmlMoveToRangeEnd = NewCT_Markup() + if err := d.DecodeElement(m.CustomXmlMoveToRangeEnd, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on EG_RangeMarkupElements %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_RangeMarkupElements + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_RangeMarkupElements and its children +func (m *EG_RangeMarkupElements) Validate() error { + return m.ValidateWithPath("EG_RangeMarkupElements") +} + +// ValidateWithPath validates the EG_RangeMarkupElements and its children, prefixing error messages with path +func (m *EG_RangeMarkupElements) ValidateWithPath(path string) error { + if m.BookmarkStart != nil { + if err := m.BookmarkStart.ValidateWithPath(path + "/BookmarkStart"); err != nil { + return err + } + } + if m.BookmarkEnd != nil { + if err := m.BookmarkEnd.ValidateWithPath(path + "/BookmarkEnd"); err != nil { + return err + } + } + if m.MoveFromRangeStart != nil { + if err := m.MoveFromRangeStart.ValidateWithPath(path + "/MoveFromRangeStart"); err != nil { + return err + } + } + if m.MoveFromRangeEnd != nil { + if err := m.MoveFromRangeEnd.ValidateWithPath(path + "/MoveFromRangeEnd"); err != nil { + return err + } + } + if m.MoveToRangeStart != nil { + if err := m.MoveToRangeStart.ValidateWithPath(path + "/MoveToRangeStart"); err != nil { + return err + } + } + if m.MoveToRangeEnd != nil { + if err := m.MoveToRangeEnd.ValidateWithPath(path + "/MoveToRangeEnd"); err != nil { + return err + } + } + if m.CommentRangeStart != nil { + if err := m.CommentRangeStart.ValidateWithPath(path + "/CommentRangeStart"); err != nil { + return err + } + } + if m.CommentRangeEnd != nil { + if err := m.CommentRangeEnd.ValidateWithPath(path + "/CommentRangeEnd"); err != nil { + return err + } + } + if m.CustomXmlInsRangeStart != nil { + if err := m.CustomXmlInsRangeStart.ValidateWithPath(path + "/CustomXmlInsRangeStart"); err != nil { + return err + } + } + if m.CustomXmlInsRangeEnd != nil { + if err := m.CustomXmlInsRangeEnd.ValidateWithPath(path + "/CustomXmlInsRangeEnd"); err != nil { + return err + } + } + if m.CustomXmlDelRangeStart != nil { + if err := m.CustomXmlDelRangeStart.ValidateWithPath(path + "/CustomXmlDelRangeStart"); err != nil { + return err + } + } + if m.CustomXmlDelRangeEnd != nil { + if err := m.CustomXmlDelRangeEnd.ValidateWithPath(path + "/CustomXmlDelRangeEnd"); err != nil { + return err + } + } + if m.CustomXmlMoveFromRangeStart != nil { + if err := m.CustomXmlMoveFromRangeStart.ValidateWithPath(path + "/CustomXmlMoveFromRangeStart"); err != nil { + return err + } + } + if m.CustomXmlMoveFromRangeEnd != nil { + if err := m.CustomXmlMoveFromRangeEnd.ValidateWithPath(path + "/CustomXmlMoveFromRangeEnd"); err != nil { + return err + } + } + if m.CustomXmlMoveToRangeStart != nil { + if err := m.CustomXmlMoveToRangeStart.ValidateWithPath(path + "/CustomXmlMoveToRangeStart"); err != nil { + return err + } + } + if m.CustomXmlMoveToRangeEnd != nil { + if err := m.CustomXmlMoveToRangeEnd.ValidateWithPath(path + "/CustomXmlMoveToRangeEnd"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_RubyContent.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_RubyContent.go new file mode 100644 index 00000000..5c308612 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_RubyContent.go @@ -0,0 +1,303 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/math" +) + +type EG_RubyContent struct { + // Phonetic Guide Text Run + R *CT_R + EG_RunLevelElts []*EG_RunLevelElts +} + +func NewEG_RubyContent() *EG_RubyContent { + ret := &EG_RubyContent{} + return ret +} + +func (m *EG_RubyContent) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.R != nil { + ser := xml.StartElement{Name: xml.Name{Local: "w:r"}} + e.EncodeElement(m.R, ser) + } + if m.EG_RunLevelElts != nil { + for _, c := range m.EG_RunLevelElts { + c.MarshalXML(e, xml.StartElement{}) + } + } + return nil +} + +func (m *EG_RubyContent) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_RubyContent: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "r"}: + m.R = NewCT_R() + if err := d.DecodeElement(m.R, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "proofErr"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.ProofErr = NewCT_ProofErr() + if err := d.DecodeElement(tmprunlevelelts.ProofErr, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermStart = NewCT_PermStart() + if err := d.DecodeElement(tmprunlevelelts.PermStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermEnd = NewCT_Perm() + if err := d.DecodeElement(tmprunlevelelts.PermEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Ins = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Ins, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Del = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Del, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFrom"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveFrom = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveFrom, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveTo"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveTo = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveTo, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkStart = NewCT_Bookmark() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeStart = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeStart"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeStart, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeEnd"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeEnd, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMathPara"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMathPara = math.NewOMathPara() + if err := d.DecodeElement(tmpmathcontent.OMathPara, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMath"}: + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMath = math.NewOMath() + if err := d.DecodeElement(tmpmathcontent.OMath, &el); err != nil { + return err + } + m.EG_RunLevelElts = append(m.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + default: + gooxml.Log("skipping unsupported element on EG_RubyContent %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_RubyContent + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_RubyContent and its children +func (m *EG_RubyContent) Validate() error { + return m.ValidateWithPath("EG_RubyContent") +} + +// ValidateWithPath validates the EG_RubyContent and its children, prefixing error messages with path +func (m *EG_RubyContent) ValidateWithPath(path string) error { + if m.R != nil { + if err := m.R.ValidateWithPath(path + "/R"); err != nil { + return err + } + } + for i, v := range m.EG_RunLevelElts { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_RunLevelElts[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_RunInnerContent.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_RunInnerContent.go new file mode 100644 index 00000000..82d085a5 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_RunInnerContent.go @@ -0,0 +1,591 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type EG_RunInnerContent struct { + // Break + Br *CT_Br + // Text + T *CT_Text + // Content Part + ContentPart *CT_Rel + // Deleted Text + DelText *CT_Text + // Field Code + InstrText *CT_Text + // Deleted Field Code + DelInstrText *CT_Text + // Non Breaking Hyphen Character + NoBreakHyphen *CT_Empty + // Optional Hyphen Character + SoftHyphen *CT_Empty + // Date Block - Short Day Format + DayShort *CT_Empty + // Date Block - Short Month Format + MonthShort *CT_Empty + // Date Block - Short Year Format + YearShort *CT_Empty + // Date Block - Long Day Format + DayLong *CT_Empty + // Date Block - Long Month Format + MonthLong *CT_Empty + // Date Block - Long Year Format + YearLong *CT_Empty + // Comment Information Block + AnnotationRef *CT_Empty + // Footnote Reference Mark + FootnoteRef *CT_Empty + // Endnote Reference Mark + EndnoteRef *CT_Empty + // Footnote/Endnote Separator Mark + Separator *CT_Empty + // Continuation Separator Mark + ContinuationSeparator *CT_Empty + // Symbol Character + Sym *CT_Sym + // Page Number Block + PgNum *CT_Empty + // Carriage Return + Cr *CT_Empty + // Tab Character + Tab *CT_Empty + // Embedded Object + Object *CT_Object + // VML Object + Pict *CT_Picture + // Complex Field Character + FldChar *CT_FldChar + // Phonetic Guide + Ruby *CT_Ruby + // Footnote Reference + FootnoteReference *CT_FtnEdnRef + // Endnote Reference + EndnoteReference *CT_FtnEdnRef + // Comment Content Reference Mark + CommentReference *CT_Markup + // DrawingML Object + Drawing *CT_Drawing + // Absolute Position Tab Character + Ptab *CT_PTab + // Position of Last Calculated Page Break + LastRenderedPageBreak *CT_Empty +} + +func NewEG_RunInnerContent() *EG_RunInnerContent { + ret := &EG_RunInnerContent{} + return ret +} + +func (m *EG_RunInnerContent) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.Br != nil { + sebr := xml.StartElement{Name: xml.Name{Local: "w:br"}} + e.EncodeElement(m.Br, sebr) + } + if m.T != nil { + set := xml.StartElement{Name: xml.Name{Local: "w:t"}} + e.EncodeElement(m.T, set) + } + if m.ContentPart != nil { + secontentPart := xml.StartElement{Name: xml.Name{Local: "w:contentPart"}} + e.EncodeElement(m.ContentPart, secontentPart) + } + if m.DelText != nil { + sedelText := xml.StartElement{Name: xml.Name{Local: "w:delText"}} + e.EncodeElement(m.DelText, sedelText) + } + if m.InstrText != nil { + seinstrText := xml.StartElement{Name: xml.Name{Local: "w:instrText"}} + e.EncodeElement(m.InstrText, seinstrText) + } + if m.DelInstrText != nil { + sedelInstrText := xml.StartElement{Name: xml.Name{Local: "w:delInstrText"}} + e.EncodeElement(m.DelInstrText, sedelInstrText) + } + if m.NoBreakHyphen != nil { + senoBreakHyphen := xml.StartElement{Name: xml.Name{Local: "w:noBreakHyphen"}} + e.EncodeElement(m.NoBreakHyphen, senoBreakHyphen) + } + if m.SoftHyphen != nil { + sesoftHyphen := xml.StartElement{Name: xml.Name{Local: "w:softHyphen"}} + e.EncodeElement(m.SoftHyphen, sesoftHyphen) + } + if m.DayShort != nil { + sedayShort := xml.StartElement{Name: xml.Name{Local: "w:dayShort"}} + e.EncodeElement(m.DayShort, sedayShort) + } + if m.MonthShort != nil { + semonthShort := xml.StartElement{Name: xml.Name{Local: "w:monthShort"}} + e.EncodeElement(m.MonthShort, semonthShort) + } + if m.YearShort != nil { + seyearShort := xml.StartElement{Name: xml.Name{Local: "w:yearShort"}} + e.EncodeElement(m.YearShort, seyearShort) + } + if m.DayLong != nil { + sedayLong := xml.StartElement{Name: xml.Name{Local: "w:dayLong"}} + e.EncodeElement(m.DayLong, sedayLong) + } + if m.MonthLong != nil { + semonthLong := xml.StartElement{Name: xml.Name{Local: "w:monthLong"}} + e.EncodeElement(m.MonthLong, semonthLong) + } + if m.YearLong != nil { + seyearLong := xml.StartElement{Name: xml.Name{Local: "w:yearLong"}} + e.EncodeElement(m.YearLong, seyearLong) + } + if m.AnnotationRef != nil { + seannotationRef := xml.StartElement{Name: xml.Name{Local: "w:annotationRef"}} + e.EncodeElement(m.AnnotationRef, seannotationRef) + } + if m.FootnoteRef != nil { + sefootnoteRef := xml.StartElement{Name: xml.Name{Local: "w:footnoteRef"}} + e.EncodeElement(m.FootnoteRef, sefootnoteRef) + } + if m.EndnoteRef != nil { + seendnoteRef := xml.StartElement{Name: xml.Name{Local: "w:endnoteRef"}} + e.EncodeElement(m.EndnoteRef, seendnoteRef) + } + if m.Separator != nil { + seseparator := xml.StartElement{Name: xml.Name{Local: "w:separator"}} + e.EncodeElement(m.Separator, seseparator) + } + if m.ContinuationSeparator != nil { + secontinuationSeparator := xml.StartElement{Name: xml.Name{Local: "w:continuationSeparator"}} + e.EncodeElement(m.ContinuationSeparator, secontinuationSeparator) + } + if m.Sym != nil { + sesym := xml.StartElement{Name: xml.Name{Local: "w:sym"}} + e.EncodeElement(m.Sym, sesym) + } + if m.PgNum != nil { + sepgNum := xml.StartElement{Name: xml.Name{Local: "w:pgNum"}} + e.EncodeElement(m.PgNum, sepgNum) + } + if m.Cr != nil { + secr := xml.StartElement{Name: xml.Name{Local: "w:cr"}} + e.EncodeElement(m.Cr, secr) + } + if m.Tab != nil { + setab := xml.StartElement{Name: xml.Name{Local: "w:tab"}} + e.EncodeElement(m.Tab, setab) + } + if m.Object != nil { + seobject := xml.StartElement{Name: xml.Name{Local: "w:object"}} + e.EncodeElement(m.Object, seobject) + } + if m.Pict != nil { + sepict := xml.StartElement{Name: xml.Name{Local: "w:pict"}} + e.EncodeElement(m.Pict, sepict) + } + if m.FldChar != nil { + sefldChar := xml.StartElement{Name: xml.Name{Local: "w:fldChar"}} + e.EncodeElement(m.FldChar, sefldChar) + } + if m.Ruby != nil { + seruby := xml.StartElement{Name: xml.Name{Local: "w:ruby"}} + e.EncodeElement(m.Ruby, seruby) + } + if m.FootnoteReference != nil { + sefootnoteReference := xml.StartElement{Name: xml.Name{Local: "w:footnoteReference"}} + e.EncodeElement(m.FootnoteReference, sefootnoteReference) + } + if m.EndnoteReference != nil { + seendnoteReference := xml.StartElement{Name: xml.Name{Local: "w:endnoteReference"}} + e.EncodeElement(m.EndnoteReference, seendnoteReference) + } + if m.CommentReference != nil { + secommentReference := xml.StartElement{Name: xml.Name{Local: "w:commentReference"}} + e.EncodeElement(m.CommentReference, secommentReference) + } + if m.Drawing != nil { + sedrawing := xml.StartElement{Name: xml.Name{Local: "w:drawing"}} + e.EncodeElement(m.Drawing, sedrawing) + } + if m.Ptab != nil { + septab := xml.StartElement{Name: xml.Name{Local: "w:ptab"}} + e.EncodeElement(m.Ptab, septab) + } + if m.LastRenderedPageBreak != nil { + selastRenderedPageBreak := xml.StartElement{Name: xml.Name{Local: "w:lastRenderedPageBreak"}} + e.EncodeElement(m.LastRenderedPageBreak, selastRenderedPageBreak) + } + return nil +} + +func (m *EG_RunInnerContent) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_RunInnerContent: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "br"}: + m.Br = NewCT_Br() + if err := d.DecodeElement(m.Br, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "t"}: + m.T = NewCT_Text() + if err := d.DecodeElement(m.T, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "contentPart"}: + m.ContentPart = NewCT_Rel() + if err := d.DecodeElement(m.ContentPart, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "delText"}: + m.DelText = NewCT_Text() + if err := d.DecodeElement(m.DelText, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "instrText"}: + m.InstrText = NewCT_Text() + if err := d.DecodeElement(m.InstrText, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "delInstrText"}: + m.DelInstrText = NewCT_Text() + if err := d.DecodeElement(m.DelInstrText, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "noBreakHyphen"}: + m.NoBreakHyphen = NewCT_Empty() + if err := d.DecodeElement(m.NoBreakHyphen, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "softHyphen"}: + m.SoftHyphen = NewCT_Empty() + if err := d.DecodeElement(m.SoftHyphen, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "dayShort"}: + m.DayShort = NewCT_Empty() + if err := d.DecodeElement(m.DayShort, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "monthShort"}: + m.MonthShort = NewCT_Empty() + if err := d.DecodeElement(m.MonthShort, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "yearShort"}: + m.YearShort = NewCT_Empty() + if err := d.DecodeElement(m.YearShort, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "dayLong"}: + m.DayLong = NewCT_Empty() + if err := d.DecodeElement(m.DayLong, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "monthLong"}: + m.MonthLong = NewCT_Empty() + if err := d.DecodeElement(m.MonthLong, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "yearLong"}: + m.YearLong = NewCT_Empty() + if err := d.DecodeElement(m.YearLong, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "annotationRef"}: + m.AnnotationRef = NewCT_Empty() + if err := d.DecodeElement(m.AnnotationRef, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "footnoteRef"}: + m.FootnoteRef = NewCT_Empty() + if err := d.DecodeElement(m.FootnoteRef, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "endnoteRef"}: + m.EndnoteRef = NewCT_Empty() + if err := d.DecodeElement(m.EndnoteRef, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "separator"}: + m.Separator = NewCT_Empty() + if err := d.DecodeElement(m.Separator, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "continuationSeparator"}: + m.ContinuationSeparator = NewCT_Empty() + if err := d.DecodeElement(m.ContinuationSeparator, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sym"}: + m.Sym = NewCT_Sym() + if err := d.DecodeElement(m.Sym, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pgNum"}: + m.PgNum = NewCT_Empty() + if err := d.DecodeElement(m.PgNum, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "cr"}: + m.Cr = NewCT_Empty() + if err := d.DecodeElement(m.Cr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tab"}: + m.Tab = NewCT_Empty() + if err := d.DecodeElement(m.Tab, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "object"}: + m.Object = NewCT_Object() + if err := d.DecodeElement(m.Object, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pict"}: + m.Pict = NewCT_Picture() + if err := d.DecodeElement(m.Pict, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "fldChar"}: + m.FldChar = NewCT_FldChar() + if err := d.DecodeElement(m.FldChar, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ruby"}: + m.Ruby = NewCT_Ruby() + if err := d.DecodeElement(m.Ruby, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "footnoteReference"}: + m.FootnoteReference = NewCT_FtnEdnRef() + if err := d.DecodeElement(m.FootnoteReference, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "endnoteReference"}: + m.EndnoteReference = NewCT_FtnEdnRef() + if err := d.DecodeElement(m.EndnoteReference, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentReference"}: + m.CommentReference = NewCT_Markup() + if err := d.DecodeElement(m.CommentReference, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "drawing"}: + m.Drawing = NewCT_Drawing() + if err := d.DecodeElement(m.Drawing, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ptab"}: + m.Ptab = NewCT_PTab() + if err := d.DecodeElement(m.Ptab, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "lastRenderedPageBreak"}: + m.LastRenderedPageBreak = NewCT_Empty() + if err := d.DecodeElement(m.LastRenderedPageBreak, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on EG_RunInnerContent %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_RunInnerContent + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_RunInnerContent and its children +func (m *EG_RunInnerContent) Validate() error { + return m.ValidateWithPath("EG_RunInnerContent") +} + +// ValidateWithPath validates the EG_RunInnerContent and its children, prefixing error messages with path +func (m *EG_RunInnerContent) ValidateWithPath(path string) error { + if m.Br != nil { + if err := m.Br.ValidateWithPath(path + "/Br"); err != nil { + return err + } + } + if m.T != nil { + if err := m.T.ValidateWithPath(path + "/T"); err != nil { + return err + } + } + if m.ContentPart != nil { + if err := m.ContentPart.ValidateWithPath(path + "/ContentPart"); err != nil { + return err + } + } + if m.DelText != nil { + if err := m.DelText.ValidateWithPath(path + "/DelText"); err != nil { + return err + } + } + if m.InstrText != nil { + if err := m.InstrText.ValidateWithPath(path + "/InstrText"); err != nil { + return err + } + } + if m.DelInstrText != nil { + if err := m.DelInstrText.ValidateWithPath(path + "/DelInstrText"); err != nil { + return err + } + } + if m.NoBreakHyphen != nil { + if err := m.NoBreakHyphen.ValidateWithPath(path + "/NoBreakHyphen"); err != nil { + return err + } + } + if m.SoftHyphen != nil { + if err := m.SoftHyphen.ValidateWithPath(path + "/SoftHyphen"); err != nil { + return err + } + } + if m.DayShort != nil { + if err := m.DayShort.ValidateWithPath(path + "/DayShort"); err != nil { + return err + } + } + if m.MonthShort != nil { + if err := m.MonthShort.ValidateWithPath(path + "/MonthShort"); err != nil { + return err + } + } + if m.YearShort != nil { + if err := m.YearShort.ValidateWithPath(path + "/YearShort"); err != nil { + return err + } + } + if m.DayLong != nil { + if err := m.DayLong.ValidateWithPath(path + "/DayLong"); err != nil { + return err + } + } + if m.MonthLong != nil { + if err := m.MonthLong.ValidateWithPath(path + "/MonthLong"); err != nil { + return err + } + } + if m.YearLong != nil { + if err := m.YearLong.ValidateWithPath(path + "/YearLong"); err != nil { + return err + } + } + if m.AnnotationRef != nil { + if err := m.AnnotationRef.ValidateWithPath(path + "/AnnotationRef"); err != nil { + return err + } + } + if m.FootnoteRef != nil { + if err := m.FootnoteRef.ValidateWithPath(path + "/FootnoteRef"); err != nil { + return err + } + } + if m.EndnoteRef != nil { + if err := m.EndnoteRef.ValidateWithPath(path + "/EndnoteRef"); err != nil { + return err + } + } + if m.Separator != nil { + if err := m.Separator.ValidateWithPath(path + "/Separator"); err != nil { + return err + } + } + if m.ContinuationSeparator != nil { + if err := m.ContinuationSeparator.ValidateWithPath(path + "/ContinuationSeparator"); err != nil { + return err + } + } + if m.Sym != nil { + if err := m.Sym.ValidateWithPath(path + "/Sym"); err != nil { + return err + } + } + if m.PgNum != nil { + if err := m.PgNum.ValidateWithPath(path + "/PgNum"); err != nil { + return err + } + } + if m.Cr != nil { + if err := m.Cr.ValidateWithPath(path + "/Cr"); err != nil { + return err + } + } + if m.Tab != nil { + if err := m.Tab.ValidateWithPath(path + "/Tab"); err != nil { + return err + } + } + if m.Object != nil { + if err := m.Object.ValidateWithPath(path + "/Object"); err != nil { + return err + } + } + if m.Pict != nil { + if err := m.Pict.ValidateWithPath(path + "/Pict"); err != nil { + return err + } + } + if m.FldChar != nil { + if err := m.FldChar.ValidateWithPath(path + "/FldChar"); err != nil { + return err + } + } + if m.Ruby != nil { + if err := m.Ruby.ValidateWithPath(path + "/Ruby"); err != nil { + return err + } + } + if m.FootnoteReference != nil { + if err := m.FootnoteReference.ValidateWithPath(path + "/FootnoteReference"); err != nil { + return err + } + } + if m.EndnoteReference != nil { + if err := m.EndnoteReference.ValidateWithPath(path + "/EndnoteReference"); err != nil { + return err + } + } + if m.CommentReference != nil { + if err := m.CommentReference.ValidateWithPath(path + "/CommentReference"); err != nil { + return err + } + } + if m.Drawing != nil { + if err := m.Drawing.ValidateWithPath(path + "/Drawing"); err != nil { + return err + } + } + if m.Ptab != nil { + if err := m.Ptab.ValidateWithPath(path + "/Ptab"); err != nil { + return err + } + } + if m.LastRenderedPageBreak != nil { + if err := m.LastRenderedPageBreak.ValidateWithPath(path + "/LastRenderedPageBreak"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_RunLevelElts.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_RunLevelElts.go new file mode 100644 index 00000000..90792fc0 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_RunLevelElts.go @@ -0,0 +1,325 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/math" +) + +type EG_RunLevelElts struct { + // Proofing Error Anchor + ProofErr *CT_ProofErr + // Range Permission Start + PermStart *CT_PermStart + // Range Permission End + PermEnd *CT_Perm + // Inserted Run Content + Ins *CT_RunTrackChange + // Deleted Run Content + Del *CT_RunTrackChange + // Move Source Run Content + MoveFrom *CT_RunTrackChange + // Move Destination Run Content + MoveTo *CT_RunTrackChange + EG_RangeMarkupElements []*EG_RangeMarkupElements + EG_MathContent []*EG_MathContent +} + +func NewEG_RunLevelElts() *EG_RunLevelElts { + ret := &EG_RunLevelElts{} + return ret +} + +func (m *EG_RunLevelElts) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.ProofErr != nil { + seproofErr := xml.StartElement{Name: xml.Name{Local: "w:proofErr"}} + e.EncodeElement(m.ProofErr, seproofErr) + } + if m.PermStart != nil { + sepermStart := xml.StartElement{Name: xml.Name{Local: "w:permStart"}} + e.EncodeElement(m.PermStart, sepermStart) + } + if m.PermEnd != nil { + sepermEnd := xml.StartElement{Name: xml.Name{Local: "w:permEnd"}} + e.EncodeElement(m.PermEnd, sepermEnd) + } + if m.Ins != nil { + seins := xml.StartElement{Name: xml.Name{Local: "w:ins"}} + e.EncodeElement(m.Ins, seins) + } + if m.Del != nil { + sedel := xml.StartElement{Name: xml.Name{Local: "w:del"}} + e.EncodeElement(m.Del, sedel) + } + if m.MoveFrom != nil { + semoveFrom := xml.StartElement{Name: xml.Name{Local: "w:moveFrom"}} + e.EncodeElement(m.MoveFrom, semoveFrom) + } + if m.MoveTo != nil { + semoveTo := xml.StartElement{Name: xml.Name{Local: "w:moveTo"}} + e.EncodeElement(m.MoveTo, semoveTo) + } + if m.EG_RangeMarkupElements != nil { + for _, c := range m.EG_RangeMarkupElements { + c.MarshalXML(e, xml.StartElement{}) + } + } + if m.EG_MathContent != nil { + for _, c := range m.EG_MathContent { + c.MarshalXML(e, xml.StartElement{}) + } + } + return nil +} + +func (m *EG_RunLevelElts) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_RunLevelElts: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "proofErr"}: + m.ProofErr = NewCT_ProofErr() + if err := d.DecodeElement(m.ProofErr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permStart"}: + m.PermStart = NewCT_PermStart() + if err := d.DecodeElement(m.PermStart, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permEnd"}: + m.PermEnd = NewCT_Perm() + if err := d.DecodeElement(m.PermEnd, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + m.Ins = NewCT_RunTrackChange() + if err := d.DecodeElement(m.Ins, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + m.Del = NewCT_RunTrackChange() + if err := d.DecodeElement(m.Del, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFrom"}: + m.MoveFrom = NewCT_RunTrackChange() + if err := d.DecodeElement(m.MoveFrom, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveTo"}: + m.MoveTo = NewCT_RunTrackChange() + if err := d.DecodeElement(m.MoveTo, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkStart"}: + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkStart = NewCT_Bookmark() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkStart, &el); err != nil { + return err + } + m.EG_RangeMarkupElements = append(m.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkEnd"}: + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkEnd, &el); err != nil { + return err + } + m.EG_RangeMarkupElements = append(m.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeStart"}: + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeStart, &el); err != nil { + return err + } + m.EG_RangeMarkupElements = append(m.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeEnd"}: + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_RangeMarkupElements = append(m.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeStart"}: + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeStart, &el); err != nil { + return err + } + m.EG_RangeMarkupElements = append(m.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeEnd"}: + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeEnd, &el); err != nil { + return err + } + m.EG_RangeMarkupElements = append(m.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeStart"}: + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeStart = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeStart, &el); err != nil { + return err + } + m.EG_RangeMarkupElements = append(m.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeEnd"}: + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeEnd, &el); err != nil { + return err + } + m.EG_RangeMarkupElements = append(m.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeStart"}: + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeStart, &el); err != nil { + return err + } + m.EG_RangeMarkupElements = append(m.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeEnd"}: + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeEnd, &el); err != nil { + return err + } + m.EG_RangeMarkupElements = append(m.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeStart"}: + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeStart, &el); err != nil { + return err + } + m.EG_RangeMarkupElements = append(m.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeEnd"}: + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeEnd, &el); err != nil { + return err + } + m.EG_RangeMarkupElements = append(m.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeStart"}: + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeStart, &el); err != nil { + return err + } + m.EG_RangeMarkupElements = append(m.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeEnd"}: + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_RangeMarkupElements = append(m.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeStart"}: + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeStart, &el); err != nil { + return err + } + m.EG_RangeMarkupElements = append(m.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeEnd"}: + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeEnd, &el); err != nil { + return err + } + m.EG_RangeMarkupElements = append(m.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMathPara"}: + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMathPara = math.NewOMathPara() + if err := d.DecodeElement(tmpmathcontent.OMathPara, &el); err != nil { + return err + } + m.EG_MathContent = append(m.EG_MathContent, tmpmathcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMath"}: + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMath = math.NewOMath() + if err := d.DecodeElement(tmpmathcontent.OMath, &el); err != nil { + return err + } + m.EG_MathContent = append(m.EG_MathContent, tmpmathcontent) + default: + gooxml.Log("skipping unsupported element on EG_RunLevelElts %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_RunLevelElts + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_RunLevelElts and its children +func (m *EG_RunLevelElts) Validate() error { + return m.ValidateWithPath("EG_RunLevelElts") +} + +// ValidateWithPath validates the EG_RunLevelElts and its children, prefixing error messages with path +func (m *EG_RunLevelElts) ValidateWithPath(path string) error { + if m.ProofErr != nil { + if err := m.ProofErr.ValidateWithPath(path + "/ProofErr"); err != nil { + return err + } + } + if m.PermStart != nil { + if err := m.PermStart.ValidateWithPath(path + "/PermStart"); err != nil { + return err + } + } + if m.PermEnd != nil { + if err := m.PermEnd.ValidateWithPath(path + "/PermEnd"); err != nil { + return err + } + } + if m.Ins != nil { + if err := m.Ins.ValidateWithPath(path + "/Ins"); err != nil { + return err + } + } + if m.Del != nil { + if err := m.Del.ValidateWithPath(path + "/Del"); err != nil { + return err + } + } + if m.MoveFrom != nil { + if err := m.MoveFrom.ValidateWithPath(path + "/MoveFrom"); err != nil { + return err + } + } + if m.MoveTo != nil { + if err := m.MoveTo.ValidateWithPath(path + "/MoveTo"); err != nil { + return err + } + } + for i, v := range m.EG_RangeMarkupElements { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_RangeMarkupElements[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.EG_MathContent { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_MathContent[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_SectPrContents.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_SectPrContents.go new file mode 100644 index 00000000..65d8cf68 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/EG_SectPrContents.go @@ -0,0 +1,367 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type EG_SectPrContents struct { + // Section-Wide Footnote Properties + FootnotePr *CT_FtnProps + // Section-Wide Endnote Properties + EndnotePr *CT_EdnProps + // Section Type + Type *CT_SectType + // Page Size + PgSz *CT_PageSz + // Page Margins + PgMar *CT_PageMar + // Paper Source Information + PaperSrc *CT_PaperSource + // Page Borders + PgBorders *CT_PageBorders + // Line Numbering Settings + LnNumType *CT_LineNumber + // Page Numbering Settings + PgNumType *CT_PageNumber + // Column Definitions + Cols *CT_Columns + // Only Allow Editing of Form Fields + FormProt *CT_OnOff + // Vertical Text Alignment on Page + VAlign *CT_VerticalJc + // Suppress Endnotes In Document + NoEndnote *CT_OnOff + // Different First Page Headers and Footers + TitlePg *CT_OnOff + // Text Flow Direction + TextDirection *CT_TextDirection + // Right to Left Section Layout + Bidi *CT_OnOff + // Gutter on Right Side of Page + RtlGutter *CT_OnOff + // Document Grid + DocGrid *CT_DocGrid + // Reference to Printer Settings Data + PrinterSettings *CT_Rel +} + +func NewEG_SectPrContents() *EG_SectPrContents { + ret := &EG_SectPrContents{} + return ret +} + +func (m *EG_SectPrContents) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.FootnotePr != nil { + sefootnotePr := xml.StartElement{Name: xml.Name{Local: "w:footnotePr"}} + e.EncodeElement(m.FootnotePr, sefootnotePr) + } + if m.EndnotePr != nil { + seendnotePr := xml.StartElement{Name: xml.Name{Local: "w:endnotePr"}} + e.EncodeElement(m.EndnotePr, seendnotePr) + } + if m.Type != nil { + setype := xml.StartElement{Name: xml.Name{Local: "w:type"}} + e.EncodeElement(m.Type, setype) + } + if m.PgSz != nil { + sepgSz := xml.StartElement{Name: xml.Name{Local: "w:pgSz"}} + e.EncodeElement(m.PgSz, sepgSz) + } + if m.PgMar != nil { + sepgMar := xml.StartElement{Name: xml.Name{Local: "w:pgMar"}} + e.EncodeElement(m.PgMar, sepgMar) + } + if m.PaperSrc != nil { + sepaperSrc := xml.StartElement{Name: xml.Name{Local: "w:paperSrc"}} + e.EncodeElement(m.PaperSrc, sepaperSrc) + } + if m.PgBorders != nil { + sepgBorders := xml.StartElement{Name: xml.Name{Local: "w:pgBorders"}} + e.EncodeElement(m.PgBorders, sepgBorders) + } + if m.LnNumType != nil { + selnNumType := xml.StartElement{Name: xml.Name{Local: "w:lnNumType"}} + e.EncodeElement(m.LnNumType, selnNumType) + } + if m.PgNumType != nil { + sepgNumType := xml.StartElement{Name: xml.Name{Local: "w:pgNumType"}} + e.EncodeElement(m.PgNumType, sepgNumType) + } + if m.Cols != nil { + secols := xml.StartElement{Name: xml.Name{Local: "w:cols"}} + e.EncodeElement(m.Cols, secols) + } + if m.FormProt != nil { + seformProt := xml.StartElement{Name: xml.Name{Local: "w:formProt"}} + e.EncodeElement(m.FormProt, seformProt) + } + if m.VAlign != nil { + sevAlign := xml.StartElement{Name: xml.Name{Local: "w:vAlign"}} + e.EncodeElement(m.VAlign, sevAlign) + } + if m.NoEndnote != nil { + senoEndnote := xml.StartElement{Name: xml.Name{Local: "w:noEndnote"}} + e.EncodeElement(m.NoEndnote, senoEndnote) + } + if m.TitlePg != nil { + setitlePg := xml.StartElement{Name: xml.Name{Local: "w:titlePg"}} + e.EncodeElement(m.TitlePg, setitlePg) + } + if m.TextDirection != nil { + setextDirection := xml.StartElement{Name: xml.Name{Local: "w:textDirection"}} + e.EncodeElement(m.TextDirection, setextDirection) + } + if m.Bidi != nil { + sebidi := xml.StartElement{Name: xml.Name{Local: "w:bidi"}} + e.EncodeElement(m.Bidi, sebidi) + } + if m.RtlGutter != nil { + sertlGutter := xml.StartElement{Name: xml.Name{Local: "w:rtlGutter"}} + e.EncodeElement(m.RtlGutter, sertlGutter) + } + if m.DocGrid != nil { + sedocGrid := xml.StartElement{Name: xml.Name{Local: "w:docGrid"}} + e.EncodeElement(m.DocGrid, sedocGrid) + } + if m.PrinterSettings != nil { + seprinterSettings := xml.StartElement{Name: xml.Name{Local: "w:printerSettings"}} + e.EncodeElement(m.PrinterSettings, seprinterSettings) + } + return nil +} + +func (m *EG_SectPrContents) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lEG_SectPrContents: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "footnotePr"}: + m.FootnotePr = NewCT_FtnProps() + if err := d.DecodeElement(m.FootnotePr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "endnotePr"}: + m.EndnotePr = NewCT_EdnProps() + if err := d.DecodeElement(m.EndnotePr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "type"}: + m.Type = NewCT_SectType() + if err := d.DecodeElement(m.Type, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pgSz"}: + m.PgSz = NewCT_PageSz() + if err := d.DecodeElement(m.PgSz, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pgMar"}: + m.PgMar = NewCT_PageMar() + if err := d.DecodeElement(m.PgMar, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "paperSrc"}: + m.PaperSrc = NewCT_PaperSource() + if err := d.DecodeElement(m.PaperSrc, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pgBorders"}: + m.PgBorders = NewCT_PageBorders() + if err := d.DecodeElement(m.PgBorders, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "lnNumType"}: + m.LnNumType = NewCT_LineNumber() + if err := d.DecodeElement(m.LnNumType, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pgNumType"}: + m.PgNumType = NewCT_PageNumber() + if err := d.DecodeElement(m.PgNumType, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "cols"}: + m.Cols = NewCT_Columns() + if err := d.DecodeElement(m.Cols, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "formProt"}: + m.FormProt = NewCT_OnOff() + if err := d.DecodeElement(m.FormProt, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "vAlign"}: + m.VAlign = NewCT_VerticalJc() + if err := d.DecodeElement(m.VAlign, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "noEndnote"}: + m.NoEndnote = NewCT_OnOff() + if err := d.DecodeElement(m.NoEndnote, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "titlePg"}: + m.TitlePg = NewCT_OnOff() + if err := d.DecodeElement(m.TitlePg, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "textDirection"}: + m.TextDirection = NewCT_TextDirection() + if err := d.DecodeElement(m.TextDirection, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bidi"}: + m.Bidi = NewCT_OnOff() + if err := d.DecodeElement(m.Bidi, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rtlGutter"}: + m.RtlGutter = NewCT_OnOff() + if err := d.DecodeElement(m.RtlGutter, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "docGrid"}: + m.DocGrid = NewCT_DocGrid() + if err := d.DecodeElement(m.DocGrid, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "printerSettings"}: + m.PrinterSettings = NewCT_Rel() + if err := d.DecodeElement(m.PrinterSettings, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on EG_SectPrContents %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEG_SectPrContents + case xml.CharData: + } + } + return nil +} + +// Validate validates the EG_SectPrContents and its children +func (m *EG_SectPrContents) Validate() error { + return m.ValidateWithPath("EG_SectPrContents") +} + +// ValidateWithPath validates the EG_SectPrContents and its children, prefixing error messages with path +func (m *EG_SectPrContents) ValidateWithPath(path string) error { + if m.FootnotePr != nil { + if err := m.FootnotePr.ValidateWithPath(path + "/FootnotePr"); err != nil { + return err + } + } + if m.EndnotePr != nil { + if err := m.EndnotePr.ValidateWithPath(path + "/EndnotePr"); err != nil { + return err + } + } + if m.Type != nil { + if err := m.Type.ValidateWithPath(path + "/Type"); err != nil { + return err + } + } + if m.PgSz != nil { + if err := m.PgSz.ValidateWithPath(path + "/PgSz"); err != nil { + return err + } + } + if m.PgMar != nil { + if err := m.PgMar.ValidateWithPath(path + "/PgMar"); err != nil { + return err + } + } + if m.PaperSrc != nil { + if err := m.PaperSrc.ValidateWithPath(path + "/PaperSrc"); err != nil { + return err + } + } + if m.PgBorders != nil { + if err := m.PgBorders.ValidateWithPath(path + "/PgBorders"); err != nil { + return err + } + } + if m.LnNumType != nil { + if err := m.LnNumType.ValidateWithPath(path + "/LnNumType"); err != nil { + return err + } + } + if m.PgNumType != nil { + if err := m.PgNumType.ValidateWithPath(path + "/PgNumType"); err != nil { + return err + } + } + if m.Cols != nil { + if err := m.Cols.ValidateWithPath(path + "/Cols"); err != nil { + return err + } + } + if m.FormProt != nil { + if err := m.FormProt.ValidateWithPath(path + "/FormProt"); err != nil { + return err + } + } + if m.VAlign != nil { + if err := m.VAlign.ValidateWithPath(path + "/VAlign"); err != nil { + return err + } + } + if m.NoEndnote != nil { + if err := m.NoEndnote.ValidateWithPath(path + "/NoEndnote"); err != nil { + return err + } + } + if m.TitlePg != nil { + if err := m.TitlePg.ValidateWithPath(path + "/TitlePg"); err != nil { + return err + } + } + if m.TextDirection != nil { + if err := m.TextDirection.ValidateWithPath(path + "/TextDirection"); err != nil { + return err + } + } + if m.Bidi != nil { + if err := m.Bidi.ValidateWithPath(path + "/Bidi"); err != nil { + return err + } + } + if m.RtlGutter != nil { + if err := m.RtlGutter.ValidateWithPath(path + "/RtlGutter"); err != nil { + return err + } + } + if m.DocGrid != nil { + if err := m.DocGrid.ValidateWithPath(path + "/DocGrid"); err != nil { + return err + } + } + if m.PrinterSettings != nil { + if err := m.PrinterSettings.ValidateWithPath(path + "/PrinterSettings"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/Endnotes.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/Endnotes.go new file mode 100644 index 00000000..4a53571a --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/Endnotes.go @@ -0,0 +1,86 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type Endnotes struct { + CT_Endnotes +} + +func NewEndnotes() *Endnotes { + ret := &Endnotes{} + ret.CT_Endnotes = *NewCT_Endnotes() + return ret +} + +func (m *Endnotes) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns"}, Value: "http://schemas.openxmlformats.org/wordprocessingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:a"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:m"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/math"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:ma"}, Value: "http://schemas.openxmlformats.org/schemaLibrary/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:pic"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/picture"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:r"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/relationships"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:s"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/sharedTypes"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:w"}, Value: "http://schemas.openxmlformats.org/wordprocessingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:wp"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:xml"}, Value: "http://www.w3.org/XML/1998/namespace"}) + start.Name.Local = "w:endnotes" + return m.CT_Endnotes.MarshalXML(e, start) +} + +func (m *Endnotes) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CT_Endnotes = *NewCT_Endnotes() +lEndnotes: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "endnote"}: + tmp := NewCT_FtnEdn() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Endnote = append(m.Endnote, tmp) + default: + gooxml.Log("skipping unsupported element on Endnotes %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lEndnotes + case xml.CharData: + } + } + return nil +} + +// Validate validates the Endnotes and its children +func (m *Endnotes) Validate() error { + return m.ValidateWithPath("Endnotes") +} + +// ValidateWithPath validates the Endnotes and its children, prefixing error messages with path +func (m *Endnotes) ValidateWithPath(path string) error { + if err := m.CT_Endnotes.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/Fonts.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/Fonts.go new file mode 100644 index 00000000..cf11d7eb --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/Fonts.go @@ -0,0 +1,86 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type Fonts struct { + CT_FontsList +} + +func NewFonts() *Fonts { + ret := &Fonts{} + ret.CT_FontsList = *NewCT_FontsList() + return ret +} + +func (m *Fonts) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns"}, Value: "http://schemas.openxmlformats.org/wordprocessingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:a"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:m"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/math"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:ma"}, Value: "http://schemas.openxmlformats.org/schemaLibrary/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:pic"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/picture"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:r"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/relationships"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:s"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/sharedTypes"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:w"}, Value: "http://schemas.openxmlformats.org/wordprocessingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:wp"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:xml"}, Value: "http://www.w3.org/XML/1998/namespace"}) + start.Name.Local = "w:fonts" + return m.CT_FontsList.MarshalXML(e, start) +} + +func (m *Fonts) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CT_FontsList = *NewCT_FontsList() +lFonts: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "font"}: + tmp := NewCT_Font() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Font = append(m.Font, tmp) + default: + gooxml.Log("skipping unsupported element on Fonts %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lFonts + case xml.CharData: + } + } + return nil +} + +// Validate validates the Fonts and its children +func (m *Fonts) Validate() error { + return m.ValidateWithPath("Fonts") +} + +// ValidateWithPath validates the Fonts and its children, prefixing error messages with path +func (m *Fonts) ValidateWithPath(path string) error { + if err := m.CT_FontsList.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/Footnotes.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/Footnotes.go new file mode 100644 index 00000000..69f53044 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/Footnotes.go @@ -0,0 +1,86 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type Footnotes struct { + CT_Footnotes +} + +func NewFootnotes() *Footnotes { + ret := &Footnotes{} + ret.CT_Footnotes = *NewCT_Footnotes() + return ret +} + +func (m *Footnotes) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns"}, Value: "http://schemas.openxmlformats.org/wordprocessingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:a"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:m"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/math"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:ma"}, Value: "http://schemas.openxmlformats.org/schemaLibrary/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:pic"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/picture"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:r"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/relationships"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:s"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/sharedTypes"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:w"}, Value: "http://schemas.openxmlformats.org/wordprocessingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:wp"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:xml"}, Value: "http://www.w3.org/XML/1998/namespace"}) + start.Name.Local = "w:footnotes" + return m.CT_Footnotes.MarshalXML(e, start) +} + +func (m *Footnotes) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CT_Footnotes = *NewCT_Footnotes() +lFootnotes: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "footnote"}: + tmp := NewCT_FtnEdn() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Footnote = append(m.Footnote, tmp) + default: + gooxml.Log("skipping unsupported element on Footnotes %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lFootnotes + case xml.CharData: + } + } + return nil +} + +// Validate validates the Footnotes and its children +func (m *Footnotes) Validate() error { + return m.ValidateWithPath("Footnotes") +} + +// ValidateWithPath validates the Footnotes and its children, prefixing error messages with path +func (m *Footnotes) ValidateWithPath(path string) error { + if err := m.CT_Footnotes.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/Ftr.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/Ftr.go new file mode 100644 index 00000000..16131bd9 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/Ftr.go @@ -0,0 +1,378 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/math" +) + +type Ftr struct { + CT_HdrFtr +} + +func NewFtr() *Ftr { + ret := &Ftr{} + ret.CT_HdrFtr = *NewCT_HdrFtr() + return ret +} + +func (m *Ftr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns"}, Value: "http://schemas.openxmlformats.org/wordprocessingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:a"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:m"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/math"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:ma"}, Value: "http://schemas.openxmlformats.org/schemaLibrary/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:pic"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/picture"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:r"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/relationships"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:s"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/sharedTypes"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:w"}, Value: "http://schemas.openxmlformats.org/wordprocessingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:wp"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:xml"}, Value: "http://www.w3.org/XML/1998/namespace"}) + start.Name.Local = "w:ftr" + return m.CT_HdrFtr.MarshalXML(e, start) +} + +func (m *Ftr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CT_HdrFtr = *NewCT_HdrFtr() +lFtr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "altChunk"}: + tmp := NewCT_AltChunk() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.AltChunk = append(m.AltChunk, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXml"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmpcontentblockcontent.CustomXml = NewCT_CustomXmlBlock() + if err := d.DecodeElement(tmpcontentblockcontent.CustomXml, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdt"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmpcontentblockcontent.Sdt = NewCT_SdtBlock() + if err := d.DecodeElement(tmpcontentblockcontent.Sdt, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "p"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmp := NewCT_P() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + tmpcontentblockcontent.P = append(tmpcontentblockcontent.P, tmp) + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tbl"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmp := NewCT_Tbl() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + tmpcontentblockcontent.Tbl = append(tmpcontentblockcontent.Tbl, tmp) + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "proofErr"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.ProofErr = NewCT_ProofErr() + if err := d.DecodeElement(tmprunlevelelts.ProofErr, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermStart = NewCT_PermStart() + if err := d.DecodeElement(tmprunlevelelts.PermStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermEnd = NewCT_Perm() + if err := d.DecodeElement(tmprunlevelelts.PermEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Ins = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Ins, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Del = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Del, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFrom"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveFrom = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveFrom, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveTo"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveTo = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveTo, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkStart = NewCT_Bookmark() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeStart = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMathPara"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMathPara = math.NewOMathPara() + if err := d.DecodeElement(tmpmathcontent.OMathPara, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMath"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMath = math.NewOMath() + if err := d.DecodeElement(tmpmathcontent.OMath, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + default: + gooxml.Log("skipping unsupported element on Ftr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lFtr + case xml.CharData: + } + } + return nil +} + +// Validate validates the Ftr and its children +func (m *Ftr) Validate() error { + return m.ValidateWithPath("Ftr") +} + +// ValidateWithPath validates the Ftr and its children, prefixing error messages with path +func (m *Ftr) ValidateWithPath(path string) error { + if err := m.CT_HdrFtr.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/GlossaryDocument.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/GlossaryDocument.go new file mode 100644 index 00000000..8ef4c163 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/GlossaryDocument.go @@ -0,0 +1,90 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type GlossaryDocument struct { + CT_GlossaryDocument +} + +func NewGlossaryDocument() *GlossaryDocument { + ret := &GlossaryDocument{} + ret.CT_GlossaryDocument = *NewCT_GlossaryDocument() + return ret +} + +func (m *GlossaryDocument) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns"}, Value: "http://schemas.openxmlformats.org/wordprocessingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:a"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:m"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/math"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:ma"}, Value: "http://schemas.openxmlformats.org/schemaLibrary/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:pic"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/picture"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:r"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/relationships"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:s"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/sharedTypes"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:w"}, Value: "http://schemas.openxmlformats.org/wordprocessingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:wp"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:xml"}, Value: "http://www.w3.org/XML/1998/namespace"}) + start.Name.Local = "w:glossaryDocument" + return m.CT_GlossaryDocument.MarshalXML(e, start) +} + +func (m *GlossaryDocument) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CT_GlossaryDocument = *NewCT_GlossaryDocument() +lGlossaryDocument: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "background"}: + m.Background = NewCT_Background() + if err := d.DecodeElement(m.Background, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "docParts"}: + m.DocParts = NewCT_DocParts() + if err := d.DecodeElement(m.DocParts, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on GlossaryDocument %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lGlossaryDocument + case xml.CharData: + } + } + return nil +} + +// Validate validates the GlossaryDocument and its children +func (m *GlossaryDocument) Validate() error { + return m.ValidateWithPath("GlossaryDocument") +} + +// ValidateWithPath validates the GlossaryDocument and its children, prefixing error messages with path +func (m *GlossaryDocument) ValidateWithPath(path string) error { + if err := m.CT_GlossaryDocument.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/Hdr.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/Hdr.go new file mode 100644 index 00000000..4b7d7db5 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/Hdr.go @@ -0,0 +1,378 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/math" +) + +type Hdr struct { + CT_HdrFtr +} + +func NewHdr() *Hdr { + ret := &Hdr{} + ret.CT_HdrFtr = *NewCT_HdrFtr() + return ret +} + +func (m *Hdr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns"}, Value: "http://schemas.openxmlformats.org/wordprocessingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:a"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:m"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/math"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:ma"}, Value: "http://schemas.openxmlformats.org/schemaLibrary/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:pic"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/picture"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:r"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/relationships"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:s"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/sharedTypes"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:w"}, Value: "http://schemas.openxmlformats.org/wordprocessingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:wp"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:xml"}, Value: "http://www.w3.org/XML/1998/namespace"}) + start.Name.Local = "w:hdr" + return m.CT_HdrFtr.MarshalXML(e, start) +} + +func (m *Hdr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CT_HdrFtr = *NewCT_HdrFtr() +lHdr: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "altChunk"}: + tmp := NewCT_AltChunk() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.AltChunk = append(m.AltChunk, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXml"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmpcontentblockcontent.CustomXml = NewCT_CustomXmlBlock() + if err := d.DecodeElement(tmpcontentblockcontent.CustomXml, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdt"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmpcontentblockcontent.Sdt = NewCT_SdtBlock() + if err := d.DecodeElement(tmpcontentblockcontent.Sdt, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "p"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmp := NewCT_P() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + tmpcontentblockcontent.P = append(tmpcontentblockcontent.P, tmp) + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tbl"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmp := NewCT_Tbl() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + tmpcontentblockcontent.Tbl = append(tmpcontentblockcontent.Tbl, tmp) + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "proofErr"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.ProofErr = NewCT_ProofErr() + if err := d.DecodeElement(tmprunlevelelts.ProofErr, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermStart = NewCT_PermStart() + if err := d.DecodeElement(tmprunlevelelts.PermStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermEnd = NewCT_Perm() + if err := d.DecodeElement(tmprunlevelelts.PermEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Ins = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Ins, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Del = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Del, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFrom"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveFrom = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveFrom, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveTo"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveTo = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveTo, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkStart = NewCT_Bookmark() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeStart = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMathPara"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMathPara = math.NewOMathPara() + if err := d.DecodeElement(tmpmathcontent.OMathPara, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMath"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMath = math.NewOMath() + if err := d.DecodeElement(tmpmathcontent.OMath, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + default: + gooxml.Log("skipping unsupported element on Hdr %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lHdr + case xml.CharData: + } + } + return nil +} + +// Validate validates the Hdr and its children +func (m *Hdr) Validate() error { + return m.ValidateWithPath("Hdr") +} + +// ValidateWithPath validates the Hdr and its children, prefixing error messages with path +func (m *Hdr) ValidateWithPath(path string) error { + if err := m.CT_HdrFtr.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/Numbering.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/Numbering.go new file mode 100644 index 00000000..ac163c21 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/Numbering.go @@ -0,0 +1,103 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type Numbering struct { + CT_Numbering +} + +func NewNumbering() *Numbering { + ret := &Numbering{} + ret.CT_Numbering = *NewCT_Numbering() + return ret +} + +func (m *Numbering) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns"}, Value: "http://schemas.openxmlformats.org/wordprocessingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:a"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:m"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/math"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:ma"}, Value: "http://schemas.openxmlformats.org/schemaLibrary/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:pic"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/picture"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:r"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/relationships"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:s"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/sharedTypes"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:w"}, Value: "http://schemas.openxmlformats.org/wordprocessingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:wp"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:xml"}, Value: "http://www.w3.org/XML/1998/namespace"}) + start.Name.Local = "w:numbering" + return m.CT_Numbering.MarshalXML(e, start) +} + +func (m *Numbering) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CT_Numbering = *NewCT_Numbering() +lNumbering: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "numPicBullet"}: + tmp := NewCT_NumPicBullet() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.NumPicBullet = append(m.NumPicBullet, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "abstractNum"}: + tmp := NewCT_AbstractNum() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.AbstractNum = append(m.AbstractNum, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "num"}: + tmp := NewCT_Num() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Num = append(m.Num, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "numIdMacAtCleanup"}: + m.NumIdMacAtCleanup = NewCT_DecimalNumber() + if err := d.DecodeElement(m.NumIdMacAtCleanup, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on Numbering %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lNumbering + case xml.CharData: + } + } + return nil +} + +// Validate validates the Numbering and its children +func (m *Numbering) Validate() error { + return m.ValidateWithPath("Numbering") +} + +// ValidateWithPath validates the Numbering and its children, prefixing error messages with path +func (m *Numbering) ValidateWithPath(path string) error { + if err := m.CT_Numbering.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/Recipients.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/Recipients.go new file mode 100644 index 00000000..f3db58c5 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/Recipients.go @@ -0,0 +1,86 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type Recipients struct { + CT_Recipients +} + +func NewRecipients() *Recipients { + ret := &Recipients{} + ret.CT_Recipients = *NewCT_Recipients() + return ret +} + +func (m *Recipients) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns"}, Value: "http://schemas.openxmlformats.org/wordprocessingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:a"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:m"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/math"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:ma"}, Value: "http://schemas.openxmlformats.org/schemaLibrary/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:pic"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/picture"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:r"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/relationships"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:s"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/sharedTypes"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:w"}, Value: "http://schemas.openxmlformats.org/wordprocessingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:wp"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:xml"}, Value: "http://www.w3.org/XML/1998/namespace"}) + start.Name.Local = "w:recipients" + return m.CT_Recipients.MarshalXML(e, start) +} + +func (m *Recipients) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CT_Recipients = *NewCT_Recipients() +lRecipients: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "recipientData"}: + tmp := NewCT_RecipientData() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.RecipientData = append(m.RecipientData, tmp) + default: + gooxml.Log("skipping unsupported element on Recipients %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lRecipients + case xml.CharData: + } + } + return nil +} + +// Validate validates the Recipients and its children +func (m *Recipients) Validate() error { + return m.ValidateWithPath("Recipients") +} + +// ValidateWithPath validates the Recipients and its children, prefixing error messages with path +func (m *Recipients) ValidateWithPath(path string) error { + if err := m.CT_Recipients.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/ST_DecimalNumberOrPercent.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/ST_DecimalNumberOrPercent.go new file mode 100644 index 00000000..a273891d --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/ST_DecimalNumberOrPercent.go @@ -0,0 +1,60 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +// ST_DecimalNumberOrPercent is a union type +type ST_DecimalNumberOrPercent struct { + ST_UnqualifiedPercentage *int64 + ST_Percentage *string +} + +func (m *ST_DecimalNumberOrPercent) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_DecimalNumberOrPercent) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.ST_UnqualifiedPercentage != nil { + e.EncodeToken(xml.CharData(fmt.Sprintf("%d", *m.ST_UnqualifiedPercentage))) + } + if m.ST_Percentage != nil { + e.EncodeToken(xml.CharData(*m.ST_Percentage)) + } + return e.EncodeToken(xml.EndElement{Name: start.Name}) +} + +func (m *ST_DecimalNumberOrPercent) ValidateWithPath(path string) error { + mems := []string{} + if m.ST_UnqualifiedPercentage != nil { + mems = append(mems, "ST_UnqualifiedPercentage") + } + if m.ST_Percentage != nil { + mems = append(mems, "ST_Percentage") + } + if len(mems) > 1 { + return fmt.Errorf("%s too many members set: %v", path, mems) + } + return nil +} + +func (m ST_DecimalNumberOrPercent) String() string { + if m.ST_UnqualifiedPercentage != nil { + return fmt.Sprintf("%v", *m.ST_UnqualifiedPercentage) + } + if m.ST_Percentage != nil { + return fmt.Sprintf("%v", *m.ST_Percentage) + } + return "" +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/ST_HexColor.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/ST_HexColor.go new file mode 100644 index 00000000..15bca56c --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/ST_HexColor.go @@ -0,0 +1,60 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +// ST_HexColor is a union type +type ST_HexColor struct { + ST_HexColorAuto ST_HexColorAuto + ST_HexColorRGB *string +} + +func (m *ST_HexColor) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_HexColor) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.ST_HexColorAuto != ST_HexColorAutoUnset { + e.EncodeToken(xml.CharData(m.ST_HexColorAuto.String())) + } + if m.ST_HexColorRGB != nil { + e.EncodeToken(xml.CharData(*m.ST_HexColorRGB)) + } + return e.EncodeToken(xml.EndElement{Name: start.Name}) +} + +func (m *ST_HexColor) ValidateWithPath(path string) error { + mems := []string{} + if m.ST_HexColorAuto != ST_HexColorAutoUnset { + mems = append(mems, "ST_HexColorAuto") + } + if m.ST_HexColorRGB != nil { + mems = append(mems, "ST_HexColorRGB") + } + if len(mems) > 1 { + return fmt.Errorf("%s too many members set: %v", path, mems) + } + return nil +} + +func (m ST_HexColor) String() string { + if m.ST_HexColorAuto != ST_HexColorAutoUnset { + return m.ST_HexColorAuto.String() + } + if m.ST_HexColorRGB != nil { + return fmt.Sprintf("%v", *m.ST_HexColorRGB) + } + return "" +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/ST_HpsMeasure.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/ST_HpsMeasure.go new file mode 100644 index 00000000..35d8369b --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/ST_HpsMeasure.go @@ -0,0 +1,60 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +// ST_HpsMeasure is a union type +type ST_HpsMeasure struct { + ST_UnsignedDecimalNumber *uint64 + ST_PositiveUniversalMeasure *string +} + +func (m *ST_HpsMeasure) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_HpsMeasure) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.ST_UnsignedDecimalNumber != nil { + e.EncodeToken(xml.CharData(fmt.Sprintf("%d", *m.ST_UnsignedDecimalNumber))) + } + if m.ST_PositiveUniversalMeasure != nil { + e.EncodeToken(xml.CharData(*m.ST_PositiveUniversalMeasure)) + } + return e.EncodeToken(xml.EndElement{Name: start.Name}) +} + +func (m *ST_HpsMeasure) ValidateWithPath(path string) error { + mems := []string{} + if m.ST_UnsignedDecimalNumber != nil { + mems = append(mems, "ST_UnsignedDecimalNumber") + } + if m.ST_PositiveUniversalMeasure != nil { + mems = append(mems, "ST_PositiveUniversalMeasure") + } + if len(mems) > 1 { + return fmt.Errorf("%s too many members set: %v", path, mems) + } + return nil +} + +func (m ST_HpsMeasure) String() string { + if m.ST_UnsignedDecimalNumber != nil { + return fmt.Sprintf("%v", *m.ST_UnsignedDecimalNumber) + } + if m.ST_PositiveUniversalMeasure != nil { + return fmt.Sprintf("%v", *m.ST_PositiveUniversalMeasure) + } + return "" +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/ST_MeasurementOrPercent.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/ST_MeasurementOrPercent.go new file mode 100644 index 00000000..c1a28bf4 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/ST_MeasurementOrPercent.go @@ -0,0 +1,63 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +// ST_MeasurementOrPercent is a union type +type ST_MeasurementOrPercent struct { + ST_DecimalNumberOrPercent *ST_DecimalNumberOrPercent + ST_UniversalMeasure *string +} + +func (m *ST_MeasurementOrPercent) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_MeasurementOrPercent) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.ST_DecimalNumberOrPercent != nil { + e.Encode(m.ST_DecimalNumberOrPercent) + } + if m.ST_UniversalMeasure != nil { + e.EncodeToken(xml.CharData(*m.ST_UniversalMeasure)) + } + return e.EncodeToken(xml.EndElement{Name: start.Name}) +} + +func (m *ST_MeasurementOrPercent) ValidateWithPath(path string) error { + mems := []string{} + if m.ST_DecimalNumberOrPercent != nil { + if err := m.ST_DecimalNumberOrPercent.ValidateWithPath(path + "/ST_DecimalNumberOrPercent"); err != nil { + return err + } + mems = append(mems, "ST_DecimalNumberOrPercent") + } + if m.ST_UniversalMeasure != nil { + mems = append(mems, "ST_UniversalMeasure") + } + if len(mems) > 1 { + return fmt.Errorf("%s too many members set: %v", path, mems) + } + return nil +} + +func (m ST_MeasurementOrPercent) String() string { + if m.ST_DecimalNumberOrPercent != nil { + return m.ST_DecimalNumberOrPercent.String() + } + if m.ST_UniversalMeasure != nil { + return fmt.Sprintf("%v", *m.ST_UniversalMeasure) + } + return "" +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/ST_SignedHpsMeasure.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/ST_SignedHpsMeasure.go new file mode 100644 index 00000000..587af515 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/ST_SignedHpsMeasure.go @@ -0,0 +1,60 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +// ST_SignedHpsMeasure is a union type +type ST_SignedHpsMeasure struct { + Int64 *int64 + ST_UniversalMeasure *string +} + +func (m *ST_SignedHpsMeasure) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_SignedHpsMeasure) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Int64 != nil { + e.EncodeToken(xml.CharData(fmt.Sprintf("%d", *m.Int64))) + } + if m.ST_UniversalMeasure != nil { + e.EncodeToken(xml.CharData(*m.ST_UniversalMeasure)) + } + return e.EncodeToken(xml.EndElement{Name: start.Name}) +} + +func (m *ST_SignedHpsMeasure) ValidateWithPath(path string) error { + mems := []string{} + if m.Int64 != nil { + mems = append(mems, "Int64") + } + if m.ST_UniversalMeasure != nil { + mems = append(mems, "ST_UniversalMeasure") + } + if len(mems) > 1 { + return fmt.Errorf("%s too many members set: %v", path, mems) + } + return nil +} + +func (m ST_SignedHpsMeasure) String() string { + if m.Int64 != nil { + return fmt.Sprintf("%v", *m.Int64) + } + if m.ST_UniversalMeasure != nil { + return fmt.Sprintf("%v", *m.ST_UniversalMeasure) + } + return "" +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/ST_SignedTwipsMeasure.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/ST_SignedTwipsMeasure.go new file mode 100644 index 00000000..b2131b69 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/ST_SignedTwipsMeasure.go @@ -0,0 +1,60 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +// ST_SignedTwipsMeasure is a union type +type ST_SignedTwipsMeasure struct { + Int64 *int64 + ST_UniversalMeasure *string +} + +func (m *ST_SignedTwipsMeasure) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_SignedTwipsMeasure) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Int64 != nil { + e.EncodeToken(xml.CharData(fmt.Sprintf("%d", *m.Int64))) + } + if m.ST_UniversalMeasure != nil { + e.EncodeToken(xml.CharData(*m.ST_UniversalMeasure)) + } + return e.EncodeToken(xml.EndElement{Name: start.Name}) +} + +func (m *ST_SignedTwipsMeasure) ValidateWithPath(path string) error { + mems := []string{} + if m.Int64 != nil { + mems = append(mems, "Int64") + } + if m.ST_UniversalMeasure != nil { + mems = append(mems, "ST_UniversalMeasure") + } + if len(mems) > 1 { + return fmt.Errorf("%s too many members set: %v", path, mems) + } + return nil +} + +func (m ST_SignedTwipsMeasure) String() string { + if m.Int64 != nil { + return fmt.Sprintf("%v", *m.Int64) + } + if m.ST_UniversalMeasure != nil { + return fmt.Sprintf("%v", *m.ST_UniversalMeasure) + } + return "" +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/ST_TextScale.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/ST_TextScale.go new file mode 100644 index 00000000..9dea54d6 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/ST_TextScale.go @@ -0,0 +1,60 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +// ST_TextScale is a union type +type ST_TextScale struct { + ST_TextScalePercent *string + ST_TextScaleDecimal *int64 +} + +func (m *ST_TextScale) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_TextScale) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.ST_TextScalePercent != nil { + e.EncodeToken(xml.CharData(*m.ST_TextScalePercent)) + } + if m.ST_TextScaleDecimal != nil { + e.EncodeToken(xml.CharData(fmt.Sprintf("%d", *m.ST_TextScaleDecimal))) + } + return e.EncodeToken(xml.EndElement{Name: start.Name}) +} + +func (m *ST_TextScale) ValidateWithPath(path string) error { + mems := []string{} + if m.ST_TextScalePercent != nil { + mems = append(mems, "ST_TextScalePercent") + } + if m.ST_TextScaleDecimal != nil { + mems = append(mems, "ST_TextScaleDecimal") + } + if len(mems) > 1 { + return fmt.Errorf("%s too many members set: %v", path, mems) + } + return nil +} + +func (m ST_TextScale) String() string { + if m.ST_TextScalePercent != nil { + return fmt.Sprintf("%v", *m.ST_TextScalePercent) + } + if m.ST_TextScaleDecimal != nil { + return fmt.Sprintf("%v", *m.ST_TextScaleDecimal) + } + return "" +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/Settings.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/Settings.go new file mode 100644 index 00000000..40d753ed --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/Settings.go @@ -0,0 +1,576 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/math" + "baliance.com/gooxml/schema/soo/schemaLibrary" +) + +type Settings struct { + CT_Settings +} + +func NewSettings() *Settings { + ret := &Settings{} + ret.CT_Settings = *NewCT_Settings() + return ret +} + +func (m *Settings) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns"}, Value: "http://schemas.openxmlformats.org/wordprocessingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:a"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:m"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/math"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:ma"}, Value: "http://schemas.openxmlformats.org/schemaLibrary/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:pic"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/picture"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:r"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/relationships"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:s"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/sharedTypes"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:w"}, Value: "http://schemas.openxmlformats.org/wordprocessingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:wp"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:xml"}, Value: "http://www.w3.org/XML/1998/namespace"}) + start.Name.Local = "w:settings" + return m.CT_Settings.MarshalXML(e, start) +} + +func (m *Settings) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CT_Settings = *NewCT_Settings() +lSettings: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "writeProtection"}: + m.WriteProtection = NewCT_WriteProtection() + if err := d.DecodeElement(m.WriteProtection, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "view"}: + m.View = NewCT_View() + if err := d.DecodeElement(m.View, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "zoom"}: + m.Zoom = NewCT_Zoom() + if err := d.DecodeElement(m.Zoom, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "removePersonalInformation"}: + m.RemovePersonalInformation = NewCT_OnOff() + if err := d.DecodeElement(m.RemovePersonalInformation, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "removeDateAndTime"}: + m.RemoveDateAndTime = NewCT_OnOff() + if err := d.DecodeElement(m.RemoveDateAndTime, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotDisplayPageBoundaries"}: + m.DoNotDisplayPageBoundaries = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotDisplayPageBoundaries, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "displayBackgroundShape"}: + m.DisplayBackgroundShape = NewCT_OnOff() + if err := d.DecodeElement(m.DisplayBackgroundShape, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "printPostScriptOverText"}: + m.PrintPostScriptOverText = NewCT_OnOff() + if err := d.DecodeElement(m.PrintPostScriptOverText, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "printFractionalCharacterWidth"}: + m.PrintFractionalCharacterWidth = NewCT_OnOff() + if err := d.DecodeElement(m.PrintFractionalCharacterWidth, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "printFormsData"}: + m.PrintFormsData = NewCT_OnOff() + if err := d.DecodeElement(m.PrintFormsData, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "embedTrueTypeFonts"}: + m.EmbedTrueTypeFonts = NewCT_OnOff() + if err := d.DecodeElement(m.EmbedTrueTypeFonts, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "embedSystemFonts"}: + m.EmbedSystemFonts = NewCT_OnOff() + if err := d.DecodeElement(m.EmbedSystemFonts, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "saveSubsetFonts"}: + m.SaveSubsetFonts = NewCT_OnOff() + if err := d.DecodeElement(m.SaveSubsetFonts, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "saveFormsData"}: + m.SaveFormsData = NewCT_OnOff() + if err := d.DecodeElement(m.SaveFormsData, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "mirrorMargins"}: + m.MirrorMargins = NewCT_OnOff() + if err := d.DecodeElement(m.MirrorMargins, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "alignBordersAndEdges"}: + m.AlignBordersAndEdges = NewCT_OnOff() + if err := d.DecodeElement(m.AlignBordersAndEdges, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bordersDoNotSurroundHeader"}: + m.BordersDoNotSurroundHeader = NewCT_OnOff() + if err := d.DecodeElement(m.BordersDoNotSurroundHeader, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bordersDoNotSurroundFooter"}: + m.BordersDoNotSurroundFooter = NewCT_OnOff() + if err := d.DecodeElement(m.BordersDoNotSurroundFooter, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "gutterAtTop"}: + m.GutterAtTop = NewCT_OnOff() + if err := d.DecodeElement(m.GutterAtTop, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "hideSpellingErrors"}: + m.HideSpellingErrors = NewCT_OnOff() + if err := d.DecodeElement(m.HideSpellingErrors, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "hideGrammaticalErrors"}: + m.HideGrammaticalErrors = NewCT_OnOff() + if err := d.DecodeElement(m.HideGrammaticalErrors, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "activeWritingStyle"}: + tmp := NewCT_WritingStyle() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.ActiveWritingStyle = append(m.ActiveWritingStyle, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "proofState"}: + m.ProofState = NewCT_Proof() + if err := d.DecodeElement(m.ProofState, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "formsDesign"}: + m.FormsDesign = NewCT_OnOff() + if err := d.DecodeElement(m.FormsDesign, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "attachedTemplate"}: + m.AttachedTemplate = NewCT_Rel() + if err := d.DecodeElement(m.AttachedTemplate, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "linkStyles"}: + m.LinkStyles = NewCT_OnOff() + if err := d.DecodeElement(m.LinkStyles, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "stylePaneFormatFilter"}: + m.StylePaneFormatFilter = NewCT_StylePaneFilter() + if err := d.DecodeElement(m.StylePaneFormatFilter, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "stylePaneSortMethod"}: + m.StylePaneSortMethod = NewCT_StyleSort() + if err := d.DecodeElement(m.StylePaneSortMethod, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "documentType"}: + m.DocumentType = NewCT_DocType() + if err := d.DecodeElement(m.DocumentType, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "mailMerge"}: + m.MailMerge = NewCT_MailMerge() + if err := d.DecodeElement(m.MailMerge, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "revisionView"}: + m.RevisionView = NewCT_TrackChangesView() + if err := d.DecodeElement(m.RevisionView, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "trackRevisions"}: + m.TrackRevisions = NewCT_OnOff() + if err := d.DecodeElement(m.TrackRevisions, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotTrackMoves"}: + m.DoNotTrackMoves = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotTrackMoves, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotTrackFormatting"}: + m.DoNotTrackFormatting = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotTrackFormatting, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "documentProtection"}: + m.DocumentProtection = NewCT_DocProtect() + if err := d.DecodeElement(m.DocumentProtection, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "autoFormatOverride"}: + m.AutoFormatOverride = NewCT_OnOff() + if err := d.DecodeElement(m.AutoFormatOverride, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "styleLockTheme"}: + m.StyleLockTheme = NewCT_OnOff() + if err := d.DecodeElement(m.StyleLockTheme, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "styleLockQFSet"}: + m.StyleLockQFSet = NewCT_OnOff() + if err := d.DecodeElement(m.StyleLockQFSet, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "defaultTabStop"}: + m.DefaultTabStop = NewCT_TwipsMeasure() + if err := d.DecodeElement(m.DefaultTabStop, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "autoHyphenation"}: + m.AutoHyphenation = NewCT_OnOff() + if err := d.DecodeElement(m.AutoHyphenation, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "consecutiveHyphenLimit"}: + m.ConsecutiveHyphenLimit = NewCT_DecimalNumber() + if err := d.DecodeElement(m.ConsecutiveHyphenLimit, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "hyphenationZone"}: + m.HyphenationZone = NewCT_TwipsMeasure() + if err := d.DecodeElement(m.HyphenationZone, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotHyphenateCaps"}: + m.DoNotHyphenateCaps = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotHyphenateCaps, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "showEnvelope"}: + m.ShowEnvelope = NewCT_OnOff() + if err := d.DecodeElement(m.ShowEnvelope, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "summaryLength"}: + m.SummaryLength = NewCT_DecimalNumberOrPrecent() + if err := d.DecodeElement(m.SummaryLength, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "clickAndTypeStyle"}: + m.ClickAndTypeStyle = NewCT_String() + if err := d.DecodeElement(m.ClickAndTypeStyle, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "defaultTableStyle"}: + m.DefaultTableStyle = NewCT_String() + if err := d.DecodeElement(m.DefaultTableStyle, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "evenAndOddHeaders"}: + m.EvenAndOddHeaders = NewCT_OnOff() + if err := d.DecodeElement(m.EvenAndOddHeaders, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookFoldRevPrinting"}: + m.BookFoldRevPrinting = NewCT_OnOff() + if err := d.DecodeElement(m.BookFoldRevPrinting, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookFoldPrinting"}: + m.BookFoldPrinting = NewCT_OnOff() + if err := d.DecodeElement(m.BookFoldPrinting, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookFoldPrintingSheets"}: + m.BookFoldPrintingSheets = NewCT_DecimalNumber() + if err := d.DecodeElement(m.BookFoldPrintingSheets, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "drawingGridHorizontalSpacing"}: + m.DrawingGridHorizontalSpacing = NewCT_TwipsMeasure() + if err := d.DecodeElement(m.DrawingGridHorizontalSpacing, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "drawingGridVerticalSpacing"}: + m.DrawingGridVerticalSpacing = NewCT_TwipsMeasure() + if err := d.DecodeElement(m.DrawingGridVerticalSpacing, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "displayHorizontalDrawingGridEvery"}: + m.DisplayHorizontalDrawingGridEvery = NewCT_DecimalNumber() + if err := d.DecodeElement(m.DisplayHorizontalDrawingGridEvery, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "displayVerticalDrawingGridEvery"}: + m.DisplayVerticalDrawingGridEvery = NewCT_DecimalNumber() + if err := d.DecodeElement(m.DisplayVerticalDrawingGridEvery, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotUseMarginsForDrawingGridOrigin"}: + m.DoNotUseMarginsForDrawingGridOrigin = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotUseMarginsForDrawingGridOrigin, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "drawingGridHorizontalOrigin"}: + m.DrawingGridHorizontalOrigin = NewCT_TwipsMeasure() + if err := d.DecodeElement(m.DrawingGridHorizontalOrigin, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "drawingGridVerticalOrigin"}: + m.DrawingGridVerticalOrigin = NewCT_TwipsMeasure() + if err := d.DecodeElement(m.DrawingGridVerticalOrigin, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotShadeFormData"}: + m.DoNotShadeFormData = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotShadeFormData, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "noPunctuationKerning"}: + m.NoPunctuationKerning = NewCT_OnOff() + if err := d.DecodeElement(m.NoPunctuationKerning, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "characterSpacingControl"}: + m.CharacterSpacingControl = NewCT_CharacterSpacing() + if err := d.DecodeElement(m.CharacterSpacingControl, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "printTwoOnOne"}: + m.PrintTwoOnOne = NewCT_OnOff() + if err := d.DecodeElement(m.PrintTwoOnOne, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "strictFirstAndLastChars"}: + m.StrictFirstAndLastChars = NewCT_OnOff() + if err := d.DecodeElement(m.StrictFirstAndLastChars, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "noLineBreaksAfter"}: + m.NoLineBreaksAfter = NewCT_Kinsoku() + if err := d.DecodeElement(m.NoLineBreaksAfter, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "noLineBreaksBefore"}: + m.NoLineBreaksBefore = NewCT_Kinsoku() + if err := d.DecodeElement(m.NoLineBreaksBefore, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "savePreviewPicture"}: + m.SavePreviewPicture = NewCT_OnOff() + if err := d.DecodeElement(m.SavePreviewPicture, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotValidateAgainstSchema"}: + m.DoNotValidateAgainstSchema = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotValidateAgainstSchema, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "saveInvalidXml"}: + m.SaveInvalidXml = NewCT_OnOff() + if err := d.DecodeElement(m.SaveInvalidXml, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ignoreMixedContent"}: + m.IgnoreMixedContent = NewCT_OnOff() + if err := d.DecodeElement(m.IgnoreMixedContent, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "alwaysShowPlaceholderText"}: + m.AlwaysShowPlaceholderText = NewCT_OnOff() + if err := d.DecodeElement(m.AlwaysShowPlaceholderText, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotDemarcateInvalidXml"}: + m.DoNotDemarcateInvalidXml = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotDemarcateInvalidXml, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "saveXmlDataOnly"}: + m.SaveXmlDataOnly = NewCT_OnOff() + if err := d.DecodeElement(m.SaveXmlDataOnly, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "useXSLTWhenSaving"}: + m.UseXSLTWhenSaving = NewCT_OnOff() + if err := d.DecodeElement(m.UseXSLTWhenSaving, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "saveThroughXslt"}: + m.SaveThroughXslt = NewCT_SaveThroughXslt() + if err := d.DecodeElement(m.SaveThroughXslt, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "showXMLTags"}: + m.ShowXMLTags = NewCT_OnOff() + if err := d.DecodeElement(m.ShowXMLTags, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "alwaysMergeEmptyNamespace"}: + m.AlwaysMergeEmptyNamespace = NewCT_OnOff() + if err := d.DecodeElement(m.AlwaysMergeEmptyNamespace, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "updateFields"}: + m.UpdateFields = NewCT_OnOff() + if err := d.DecodeElement(m.UpdateFields, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "hdrShapeDefaults"}: + m.HdrShapeDefaults = NewCT_ShapeDefaults() + if err := d.DecodeElement(m.HdrShapeDefaults, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "footnotePr"}: + m.FootnotePr = NewCT_FtnDocProps() + if err := d.DecodeElement(m.FootnotePr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "endnotePr"}: + m.EndnotePr = NewCT_EdnDocProps() + if err := d.DecodeElement(m.EndnotePr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "compat"}: + m.Compat = NewCT_Compat() + if err := d.DecodeElement(m.Compat, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "docVars"}: + m.DocVars = NewCT_DocVars() + if err := d.DecodeElement(m.DocVars, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "rsids"}: + m.Rsids = NewCT_DocRsids() + if err := d.DecodeElement(m.Rsids, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "mathPr"}: + m.MathPr = math.NewMathPr() + if err := d.DecodeElement(m.MathPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "attachedSchema"}: + tmp := NewCT_String() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.AttachedSchema = append(m.AttachedSchema, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "themeFontLang"}: + m.ThemeFontLang = NewCT_Language() + if err := d.DecodeElement(m.ThemeFontLang, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "clrSchemeMapping"}: + m.ClrSchemeMapping = NewCT_ColorSchemeMapping() + if err := d.DecodeElement(m.ClrSchemeMapping, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotIncludeSubdocsInStats"}: + m.DoNotIncludeSubdocsInStats = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotIncludeSubdocsInStats, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotAutoCompressPictures"}: + m.DoNotAutoCompressPictures = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotAutoCompressPictures, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "forceUpgrade"}: + m.ForceUpgrade = NewCT_Empty() + if err := d.DecodeElement(m.ForceUpgrade, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "captions"}: + m.Captions = NewCT_Captions() + if err := d.DecodeElement(m.Captions, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "readModeInkLockDown"}: + m.ReadModeInkLockDown = NewCT_ReadingModeInkLockDown() + if err := d.DecodeElement(m.ReadModeInkLockDown, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "smartTagType"}: + tmp := NewCT_SmartTagType() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.SmartTagType = append(m.SmartTagType, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/schemaLibrary/2006/main", Local: "schemaLibrary"}: + m.SchemaLibrary = schemaLibrary.NewSchemaLibrary() + if err := d.DecodeElement(m.SchemaLibrary, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "shapeDefaults"}: + m.ShapeDefaults = NewCT_ShapeDefaults() + if err := d.DecodeElement(m.ShapeDefaults, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotEmbedSmartTags"}: + m.DoNotEmbedSmartTags = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotEmbedSmartTags, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "decimalSymbol"}: + m.DecimalSymbol = NewCT_String() + if err := d.DecodeElement(m.DecimalSymbol, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "listSeparator"}: + m.ListSeparator = NewCT_String() + if err := d.DecodeElement(m.ListSeparator, &el); err != nil { + return err + } + default: + any := &gooxml.XSDAny{} + if err := d.DecodeElement(any, &el); err != nil { + return err + } + m.Extra = append(m.Extra, any) + } + case xml.EndElement: + break lSettings + case xml.CharData: + } + } + return nil +} + +// Validate validates the Settings and its children +func (m *Settings) Validate() error { + return m.ValidateWithPath("Settings") +} + +// ValidateWithPath validates the Settings and its children, prefixing error messages with path +func (m *Settings) ValidateWithPath(path string) error { + if err := m.CT_Settings.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/Styles.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/Styles.go new file mode 100644 index 00000000..34676a6e --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/Styles.go @@ -0,0 +1,96 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type Styles struct { + CT_Styles +} + +func NewStyles() *Styles { + ret := &Styles{} + ret.CT_Styles = *NewCT_Styles() + return ret +} + +func (m *Styles) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns"}, Value: "http://schemas.openxmlformats.org/wordprocessingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:a"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:m"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/math"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:ma"}, Value: "http://schemas.openxmlformats.org/schemaLibrary/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:pic"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/picture"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:r"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/relationships"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:s"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/sharedTypes"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:w"}, Value: "http://schemas.openxmlformats.org/wordprocessingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:wp"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:xml"}, Value: "http://www.w3.org/XML/1998/namespace"}) + start.Name.Local = "w:styles" + return m.CT_Styles.MarshalXML(e, start) +} + +func (m *Styles) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CT_Styles = *NewCT_Styles() +lStyles: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "docDefaults"}: + m.DocDefaults = NewCT_DocDefaults() + if err := d.DecodeElement(m.DocDefaults, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "latentStyles"}: + m.LatentStyles = NewCT_LatentStyles() + if err := d.DecodeElement(m.LatentStyles, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "style"}: + tmp := NewCT_Style() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Style = append(m.Style, tmp) + default: + gooxml.Log("skipping unsupported element on Styles %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lStyles + case xml.CharData: + } + } + return nil +} + +// Validate validates the Styles and its children +func (m *Styles) Validate() error { + return m.ValidateWithPath("Styles") +} + +// ValidateWithPath validates the Styles and its children, prefixing error messages with path +func (m *Styles) ValidateWithPath(path string) error { + if err := m.CT_Styles.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/TxbxContent.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/TxbxContent.go new file mode 100644 index 00000000..674105b7 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/TxbxContent.go @@ -0,0 +1,378 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/ofc/math" +) + +type TxbxContent struct { + CT_TxbxContent +} + +func NewTxbxContent() *TxbxContent { + ret := &TxbxContent{} + ret.CT_TxbxContent = *NewCT_TxbxContent() + return ret +} + +func (m *TxbxContent) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns"}, Value: "http://schemas.openxmlformats.org/wordprocessingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:a"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:m"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/math"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:ma"}, Value: "http://schemas.openxmlformats.org/schemaLibrary/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:pic"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/picture"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:r"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/relationships"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:s"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/sharedTypes"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:w"}, Value: "http://schemas.openxmlformats.org/wordprocessingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:wp"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:xml"}, Value: "http://www.w3.org/XML/1998/namespace"}) + start.Name.Local = "w:txbxContent" + return m.CT_TxbxContent.MarshalXML(e, start) +} + +func (m *TxbxContent) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CT_TxbxContent = *NewCT_TxbxContent() +lTxbxContent: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "altChunk"}: + tmp := NewCT_AltChunk() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.AltChunk = append(m.AltChunk, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXml"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmpcontentblockcontent.CustomXml = NewCT_CustomXmlBlock() + if err := d.DecodeElement(tmpcontentblockcontent.CustomXml, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "sdt"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmpcontentblockcontent.Sdt = NewCT_SdtBlock() + if err := d.DecodeElement(tmpcontentblockcontent.Sdt, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "p"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmp := NewCT_P() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + tmpcontentblockcontent.P = append(tmpcontentblockcontent.P, tmp) + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "tbl"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmp := NewCT_Tbl() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + tmpcontentblockcontent.Tbl = append(tmpcontentblockcontent.Tbl, tmp) + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "proofErr"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.ProofErr = NewCT_ProofErr() + if err := d.DecodeElement(tmprunlevelelts.ProofErr, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermStart = NewCT_PermStart() + if err := d.DecodeElement(tmprunlevelelts.PermStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "permEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.PermEnd = NewCT_Perm() + if err := d.DecodeElement(tmprunlevelelts.PermEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "ins"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Ins = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Ins, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "del"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.Del = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.Del, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFrom"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveFrom = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveFrom, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveTo"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprunlevelelts.MoveTo = NewCT_RunTrackChange() + if err := d.DecodeElement(tmprunlevelelts.MoveTo, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkStart = NewCT_Bookmark() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "bookmarkEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.BookmarkEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.BookmarkEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveFromRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveFromRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeStart = NewCT_MoveBookmark() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "moveToRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.MoveToRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.MoveToRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeStart = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "commentRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CommentRangeEnd = NewCT_MarkupRange() + if err := d.DecodeElement(tmprangemarkupelements.CommentRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlInsRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlInsRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlInsRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlDelRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlDelRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlDelRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveFromRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveFromRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveFromRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeStart"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeStart = NewCT_TrackChange() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeStart, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "customXmlMoveToRangeEnd"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmprangemarkupelements := NewEG_RangeMarkupElements() + tmprangemarkupelements.CustomXmlMoveToRangeEnd = NewCT_Markup() + if err := d.DecodeElement(tmprangemarkupelements.CustomXmlMoveToRangeEnd, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_RangeMarkupElements = append(tmprunlevelelts.EG_RangeMarkupElements, tmprangemarkupelements) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMathPara"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMathPara = math.NewOMathPara() + if err := d.DecodeElement(tmpmathcontent.OMathPara, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + case xml.Name{Space: "http://schemas.openxmlformats.org/officeDocument/2006/math", Local: "oMath"}: + tmpcontentblockcontent := NewEG_ContentBlockContent() + tmprunlevelelts := NewEG_RunLevelElts() + tmpmathcontent := NewEG_MathContent() + tmpmathcontent.OMath = math.NewOMath() + if err := d.DecodeElement(tmpmathcontent.OMath, &el); err != nil { + return err + } + m.EG_ContentBlockContent = append(m.EG_ContentBlockContent, tmpcontentblockcontent) + tmpcontentblockcontent.EG_RunLevelElts = append(tmpcontentblockcontent.EG_RunLevelElts, tmprunlevelelts) + tmprunlevelelts.EG_MathContent = append(tmprunlevelelts.EG_MathContent, tmpmathcontent) + default: + gooxml.Log("skipping unsupported element on TxbxContent %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lTxbxContent + case xml.CharData: + } + } + return nil +} + +// Validate validates the TxbxContent and its children +func (m *TxbxContent) Validate() error { + return m.ValidateWithPath("TxbxContent") +} + +// ValidateWithPath validates the TxbxContent and its children, prefixing error messages with path +func (m *TxbxContent) ValidateWithPath(path string) error { + if err := m.CT_TxbxContent.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdAnchor.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdAnchor.go new file mode 100644 index 00000000..d7d38115 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdAnchor.go @@ -0,0 +1,232 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "strconv" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/dml" +) + +type WdAnchor struct { + WdCT_Anchor +} + +func NewWdAnchor() *WdAnchor { + ret := &WdAnchor{} + ret.WdCT_Anchor = *NewWdCT_Anchor() + return ret +} + +func (m *WdAnchor) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:a"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:pic"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/picture"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:r"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/relationships"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:w"}, Value: "http://schemas.openxmlformats.org/wordprocessingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:wp"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:xml"}, Value: "http://www.w3.org/XML/1998/namespace"}) + start.Name.Local = "wp:anchor" + return m.WdCT_Anchor.MarshalXML(e, start) +} + +func (m *WdAnchor) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.WdCT_Anchor = *NewWdCT_Anchor() + for _, attr := range start.Attr { + if attr.Name.Local == "distT" { + parsed, err := strconv.ParseUint(attr.Value, 10, 32) + if err != nil { + return err + } + pt := uint32(parsed) + m.DistTAttr = &pt + continue + } + if attr.Name.Local == "distL" { + parsed, err := strconv.ParseUint(attr.Value, 10, 32) + if err != nil { + return err + } + pt := uint32(parsed) + m.DistLAttr = &pt + continue + } + if attr.Name.Local == "simplePos" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.SimplePosAttr = &parsed + continue + } + if attr.Name.Local == "behindDoc" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.BehindDocAttr = parsed + continue + } + if attr.Name.Local == "layoutInCell" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.LayoutInCellAttr = parsed + continue + } + if attr.Name.Local == "hidden" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.HiddenAttr = &parsed + continue + } + if attr.Name.Local == "distB" { + parsed, err := strconv.ParseUint(attr.Value, 10, 32) + if err != nil { + return err + } + pt := uint32(parsed) + m.DistBAttr = &pt + continue + } + if attr.Name.Local == "distR" { + parsed, err := strconv.ParseUint(attr.Value, 10, 32) + if err != nil { + return err + } + pt := uint32(parsed) + m.DistRAttr = &pt + continue + } + if attr.Name.Local == "relativeHeight" { + parsed, err := strconv.ParseUint(attr.Value, 10, 32) + if err != nil { + return err + } + m.RelativeHeightAttr = uint32(parsed) + continue + } + if attr.Name.Local == "locked" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.LockedAttr = parsed + continue + } + if attr.Name.Local == "allowOverlap" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.AllowOverlapAttr = parsed + continue + } + } +lWdAnchor: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "simplePos"}: + if err := d.DecodeElement(m.SimplePos, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "positionH"}: + if err := d.DecodeElement(m.PositionH, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "positionV"}: + if err := d.DecodeElement(m.PositionV, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "extent"}: + if err := d.DecodeElement(m.Extent, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "effectExtent"}: + m.EffectExtent = NewWdCT_EffectExtent() + if err := d.DecodeElement(m.EffectExtent, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "wrapNone"}: + m.Choice = NewWdEG_WrapTypeChoice() + if err := d.DecodeElement(&m.Choice.WrapNone, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "wrapSquare"}: + m.Choice = NewWdEG_WrapTypeChoice() + if err := d.DecodeElement(&m.Choice.WrapSquare, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "wrapTight"}: + m.Choice = NewWdEG_WrapTypeChoice() + if err := d.DecodeElement(&m.Choice.WrapTight, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "wrapThrough"}: + m.Choice = NewWdEG_WrapTypeChoice() + if err := d.DecodeElement(&m.Choice.WrapThrough, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "wrapTopAndBottom"}: + m.Choice = NewWdEG_WrapTypeChoice() + if err := d.DecodeElement(&m.Choice.WrapTopAndBottom, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "docPr"}: + if err := d.DecodeElement(m.DocPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "cNvGraphicFramePr"}: + m.CNvGraphicFramePr = dml.NewCT_NonVisualGraphicFrameProperties() + if err := d.DecodeElement(m.CNvGraphicFramePr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "graphic"}: + if err := d.DecodeElement(m.Graphic, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on WdAnchor %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lWdAnchor + case xml.CharData: + } + } + return nil +} + +// Validate validates the WdAnchor and its children +func (m *WdAnchor) Validate() error { + return m.ValidateWithPath("WdAnchor") +} + +// ValidateWithPath validates the WdAnchor and its children, prefixing error messages with path +func (m *WdAnchor) ValidateWithPath(path string) error { + if err := m.WdCT_Anchor.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_Anchor.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_Anchor.go new file mode 100644 index 00000000..a20d4747 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_Anchor.go @@ -0,0 +1,343 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/dml" +) + +type WdCT_Anchor struct { + DistTAttr *uint32 + DistBAttr *uint32 + DistLAttr *uint32 + DistRAttr *uint32 + SimplePosAttr *bool + RelativeHeightAttr uint32 + BehindDocAttr bool + LockedAttr bool + LayoutInCellAttr bool + HiddenAttr *bool + AllowOverlapAttr bool + SimplePos *dml.CT_Point2D + PositionH *WdCT_PosH + PositionV *WdCT_PosV + Extent *dml.CT_PositiveSize2D + EffectExtent *WdCT_EffectExtent + Choice *WdEG_WrapTypeChoice + DocPr *dml.CT_NonVisualDrawingProps + CNvGraphicFramePr *dml.CT_NonVisualGraphicFrameProperties + Graphic *dml.Graphic +} + +func NewWdCT_Anchor() *WdCT_Anchor { + ret := &WdCT_Anchor{} + ret.SimplePos = dml.NewCT_Point2D() + ret.PositionH = NewWdCT_PosH() + ret.PositionV = NewWdCT_PosV() + ret.Extent = dml.NewCT_PositiveSize2D() + ret.DocPr = dml.NewCT_NonVisualDrawingProps() + ret.Graphic = dml.NewGraphic() + return ret +} + +func (m *WdCT_Anchor) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.DistTAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "distT"}, + Value: fmt.Sprintf("%v", *m.DistTAttr)}) + } + if m.DistBAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "distB"}, + Value: fmt.Sprintf("%v", *m.DistBAttr)}) + } + if m.DistLAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "distL"}, + Value: fmt.Sprintf("%v", *m.DistLAttr)}) + } + if m.DistRAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "distR"}, + Value: fmt.Sprintf("%v", *m.DistRAttr)}) + } + if m.SimplePosAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "simplePos"}, + Value: fmt.Sprintf("%d", b2i(*m.SimplePosAttr))}) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "relativeHeight"}, + Value: fmt.Sprintf("%v", m.RelativeHeightAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "behindDoc"}, + Value: fmt.Sprintf("%d", b2i(m.BehindDocAttr))}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "locked"}, + Value: fmt.Sprintf("%d", b2i(m.LockedAttr))}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "layoutInCell"}, + Value: fmt.Sprintf("%d", b2i(m.LayoutInCellAttr))}) + if m.HiddenAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "hidden"}, + Value: fmt.Sprintf("%d", b2i(*m.HiddenAttr))}) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "allowOverlap"}, + Value: fmt.Sprintf("%d", b2i(m.AllowOverlapAttr))}) + e.EncodeToken(start) + sesimplePos := xml.StartElement{Name: xml.Name{Local: "wp:simplePos"}} + e.EncodeElement(m.SimplePos, sesimplePos) + sepositionH := xml.StartElement{Name: xml.Name{Local: "wp:positionH"}} + e.EncodeElement(m.PositionH, sepositionH) + sepositionV := xml.StartElement{Name: xml.Name{Local: "wp:positionV"}} + e.EncodeElement(m.PositionV, sepositionV) + seextent := xml.StartElement{Name: xml.Name{Local: "wp:extent"}} + e.EncodeElement(m.Extent, seextent) + if m.EffectExtent != nil { + seeffectExtent := xml.StartElement{Name: xml.Name{Local: "wp:effectExtent"}} + e.EncodeElement(m.EffectExtent, seeffectExtent) + } + if m.Choice != nil { + m.Choice.MarshalXML(e, xml.StartElement{}) + } + sedocPr := xml.StartElement{Name: xml.Name{Local: "wp:docPr"}} + e.EncodeElement(m.DocPr, sedocPr) + if m.CNvGraphicFramePr != nil { + secNvGraphicFramePr := xml.StartElement{Name: xml.Name{Local: "wp:cNvGraphicFramePr"}} + e.EncodeElement(m.CNvGraphicFramePr, secNvGraphicFramePr) + } + segraphic := xml.StartElement{Name: xml.Name{Local: "a:graphic"}} + e.EncodeElement(m.Graphic, segraphic) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *WdCT_Anchor) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.SimplePos = dml.NewCT_Point2D() + m.PositionH = NewWdCT_PosH() + m.PositionV = NewWdCT_PosV() + m.Extent = dml.NewCT_PositiveSize2D() + m.DocPr = dml.NewCT_NonVisualDrawingProps() + m.Graphic = dml.NewGraphic() + for _, attr := range start.Attr { + if attr.Name.Local == "distT" { + parsed, err := strconv.ParseUint(attr.Value, 10, 32) + if err != nil { + return err + } + pt := uint32(parsed) + m.DistTAttr = &pt + continue + } + if attr.Name.Local == "distL" { + parsed, err := strconv.ParseUint(attr.Value, 10, 32) + if err != nil { + return err + } + pt := uint32(parsed) + m.DistLAttr = &pt + continue + } + if attr.Name.Local == "simplePos" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.SimplePosAttr = &parsed + continue + } + if attr.Name.Local == "behindDoc" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.BehindDocAttr = parsed + continue + } + if attr.Name.Local == "layoutInCell" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.LayoutInCellAttr = parsed + continue + } + if attr.Name.Local == "hidden" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.HiddenAttr = &parsed + continue + } + if attr.Name.Local == "distB" { + parsed, err := strconv.ParseUint(attr.Value, 10, 32) + if err != nil { + return err + } + pt := uint32(parsed) + m.DistBAttr = &pt + continue + } + if attr.Name.Local == "distR" { + parsed, err := strconv.ParseUint(attr.Value, 10, 32) + if err != nil { + return err + } + pt := uint32(parsed) + m.DistRAttr = &pt + continue + } + if attr.Name.Local == "relativeHeight" { + parsed, err := strconv.ParseUint(attr.Value, 10, 32) + if err != nil { + return err + } + m.RelativeHeightAttr = uint32(parsed) + continue + } + if attr.Name.Local == "locked" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.LockedAttr = parsed + continue + } + if attr.Name.Local == "allowOverlap" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.AllowOverlapAttr = parsed + continue + } + } +lWdCT_Anchor: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "simplePos"}: + if err := d.DecodeElement(m.SimplePos, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "positionH"}: + if err := d.DecodeElement(m.PositionH, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "positionV"}: + if err := d.DecodeElement(m.PositionV, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "extent"}: + if err := d.DecodeElement(m.Extent, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "effectExtent"}: + m.EffectExtent = NewWdCT_EffectExtent() + if err := d.DecodeElement(m.EffectExtent, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "wrapNone"}: + m.Choice = NewWdEG_WrapTypeChoice() + if err := d.DecodeElement(&m.Choice.WrapNone, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "wrapSquare"}: + m.Choice = NewWdEG_WrapTypeChoice() + if err := d.DecodeElement(&m.Choice.WrapSquare, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "wrapTight"}: + m.Choice = NewWdEG_WrapTypeChoice() + if err := d.DecodeElement(&m.Choice.WrapTight, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "wrapThrough"}: + m.Choice = NewWdEG_WrapTypeChoice() + if err := d.DecodeElement(&m.Choice.WrapThrough, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "wrapTopAndBottom"}: + m.Choice = NewWdEG_WrapTypeChoice() + if err := d.DecodeElement(&m.Choice.WrapTopAndBottom, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "docPr"}: + if err := d.DecodeElement(m.DocPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "cNvGraphicFramePr"}: + m.CNvGraphicFramePr = dml.NewCT_NonVisualGraphicFrameProperties() + if err := d.DecodeElement(m.CNvGraphicFramePr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "graphic"}: + if err := d.DecodeElement(m.Graphic, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on WdCT_Anchor %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lWdCT_Anchor + case xml.CharData: + } + } + return nil +} + +// Validate validates the WdCT_Anchor and its children +func (m *WdCT_Anchor) Validate() error { + return m.ValidateWithPath("WdCT_Anchor") +} + +// ValidateWithPath validates the WdCT_Anchor and its children, prefixing error messages with path +func (m *WdCT_Anchor) ValidateWithPath(path string) error { + if err := m.SimplePos.ValidateWithPath(path + "/SimplePos"); err != nil { + return err + } + if err := m.PositionH.ValidateWithPath(path + "/PositionH"); err != nil { + return err + } + if err := m.PositionV.ValidateWithPath(path + "/PositionV"); err != nil { + return err + } + if err := m.Extent.ValidateWithPath(path + "/Extent"); err != nil { + return err + } + if m.EffectExtent != nil { + if err := m.EffectExtent.ValidateWithPath(path + "/EffectExtent"); err != nil { + return err + } + } + if m.Choice != nil { + if err := m.Choice.ValidateWithPath(path + "/Choice"); err != nil { + return err + } + } + if err := m.DocPr.ValidateWithPath(path + "/DocPr"); err != nil { + return err + } + if m.CNvGraphicFramePr != nil { + if err := m.CNvGraphicFramePr.ValidateWithPath(path + "/CNvGraphicFramePr"); err != nil { + return err + } + } + if err := m.Graphic.ValidateWithPath(path + "/Graphic"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_EffectExtent.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_EffectExtent.go new file mode 100644 index 00000000..09a634dd --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_EffectExtent.go @@ -0,0 +1,114 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml/schema/soo/dml" +) + +type WdCT_EffectExtent struct { + LAttr dml.ST_Coordinate + TAttr dml.ST_Coordinate + RAttr dml.ST_Coordinate + BAttr dml.ST_Coordinate +} + +func NewWdCT_EffectExtent() *WdCT_EffectExtent { + ret := &WdCT_EffectExtent{} + return ret +} + +func (m *WdCT_EffectExtent) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "l"}, + Value: fmt.Sprintf("%v", m.LAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "t"}, + Value: fmt.Sprintf("%v", m.TAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "r"}, + Value: fmt.Sprintf("%v", m.RAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "b"}, + Value: fmt.Sprintf("%v", m.BAttr)}) + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *WdCT_EffectExtent) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "l" { + parsed, err := ParseUnionST_Coordinate(attr.Value) + if err != nil { + return err + } + m.LAttr = parsed + continue + } + if attr.Name.Local == "t" { + parsed, err := ParseUnionST_Coordinate(attr.Value) + if err != nil { + return err + } + m.TAttr = parsed + continue + } + if attr.Name.Local == "r" { + parsed, err := ParseUnionST_Coordinate(attr.Value) + if err != nil { + return err + } + m.RAttr = parsed + continue + } + if attr.Name.Local == "b" { + parsed, err := ParseUnionST_Coordinate(attr.Value) + if err != nil { + return err + } + m.BAttr = parsed + continue + } + } + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing WdCT_EffectExtent: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the WdCT_EffectExtent and its children +func (m *WdCT_EffectExtent) Validate() error { + return m.ValidateWithPath("WdCT_EffectExtent") +} + +// ValidateWithPath validates the WdCT_EffectExtent and its children, prefixing error messages with path +func (m *WdCT_EffectExtent) ValidateWithPath(path string) error { + if err := m.LAttr.ValidateWithPath(path + "/LAttr"); err != nil { + return err + } + if err := m.TAttr.ValidateWithPath(path + "/TAttr"); err != nil { + return err + } + if err := m.RAttr.ValidateWithPath(path + "/RAttr"); err != nil { + return err + } + if err := m.BAttr.ValidateWithPath(path + "/BAttr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_GraphicFrame.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_GraphicFrame.go new file mode 100644 index 00000000..662493a7 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_GraphicFrame.go @@ -0,0 +1,129 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/dml" +) + +type WdCT_GraphicFrame struct { + CNvPr *dml.CT_NonVisualDrawingProps + CNvFrPr *dml.CT_NonVisualGraphicFrameProperties + Xfrm *dml.CT_Transform2D + Graphic *dml.Graphic + ExtLst *dml.CT_OfficeArtExtensionList +} + +func NewWdCT_GraphicFrame() *WdCT_GraphicFrame { + ret := &WdCT_GraphicFrame{} + ret.CNvPr = dml.NewCT_NonVisualDrawingProps() + ret.CNvFrPr = dml.NewCT_NonVisualGraphicFrameProperties() + ret.Xfrm = dml.NewCT_Transform2D() + ret.Graphic = dml.NewGraphic() + return ret +} + +func (m *WdCT_GraphicFrame) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + secNvPr := xml.StartElement{Name: xml.Name{Local: "wp:cNvPr"}} + e.EncodeElement(m.CNvPr, secNvPr) + secNvFrPr := xml.StartElement{Name: xml.Name{Local: "wp:cNvFrPr"}} + e.EncodeElement(m.CNvFrPr, secNvFrPr) + sexfrm := xml.StartElement{Name: xml.Name{Local: "wp:xfrm"}} + e.EncodeElement(m.Xfrm, sexfrm) + segraphic := xml.StartElement{Name: xml.Name{Local: "a:graphic"}} + e.EncodeElement(m.Graphic, segraphic) + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "wp:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *WdCT_GraphicFrame) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CNvPr = dml.NewCT_NonVisualDrawingProps() + m.CNvFrPr = dml.NewCT_NonVisualGraphicFrameProperties() + m.Xfrm = dml.NewCT_Transform2D() + m.Graphic = dml.NewGraphic() +lWdCT_GraphicFrame: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "cNvPr"}: + if err := d.DecodeElement(m.CNvPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "cNvFrPr"}: + if err := d.DecodeElement(m.CNvFrPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "xfrm"}: + if err := d.DecodeElement(m.Xfrm, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "graphic"}: + if err := d.DecodeElement(m.Graphic, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "extLst"}: + m.ExtLst = dml.NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on WdCT_GraphicFrame %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lWdCT_GraphicFrame + case xml.CharData: + } + } + return nil +} + +// Validate validates the WdCT_GraphicFrame and its children +func (m *WdCT_GraphicFrame) Validate() error { + return m.ValidateWithPath("WdCT_GraphicFrame") +} + +// ValidateWithPath validates the WdCT_GraphicFrame and its children, prefixing error messages with path +func (m *WdCT_GraphicFrame) ValidateWithPath(path string) error { + if err := m.CNvPr.ValidateWithPath(path + "/CNvPr"); err != nil { + return err + } + if err := m.CNvFrPr.ValidateWithPath(path + "/CNvFrPr"); err != nil { + return err + } + if err := m.Xfrm.ValidateWithPath(path + "/Xfrm"); err != nil { + return err + } + if err := m.Graphic.ValidateWithPath(path + "/Graphic"); err != nil { + return err + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_Inline.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_Inline.go new file mode 100644 index 00000000..12a97bbe --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_Inline.go @@ -0,0 +1,192 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/dml" +) + +type WdCT_Inline struct { + DistTAttr *uint32 + DistBAttr *uint32 + DistLAttr *uint32 + DistRAttr *uint32 + Extent *dml.CT_PositiveSize2D + EffectExtent *WdCT_EffectExtent + DocPr *dml.CT_NonVisualDrawingProps + CNvGraphicFramePr *dml.CT_NonVisualGraphicFrameProperties + Graphic *dml.Graphic +} + +func NewWdCT_Inline() *WdCT_Inline { + ret := &WdCT_Inline{} + ret.Extent = dml.NewCT_PositiveSize2D() + ret.DocPr = dml.NewCT_NonVisualDrawingProps() + ret.Graphic = dml.NewGraphic() + return ret +} + +func (m *WdCT_Inline) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.DistTAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "distT"}, + Value: fmt.Sprintf("%v", *m.DistTAttr)}) + } + if m.DistBAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "distB"}, + Value: fmt.Sprintf("%v", *m.DistBAttr)}) + } + if m.DistLAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "distL"}, + Value: fmt.Sprintf("%v", *m.DistLAttr)}) + } + if m.DistRAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "distR"}, + Value: fmt.Sprintf("%v", *m.DistRAttr)}) + } + e.EncodeToken(start) + seextent := xml.StartElement{Name: xml.Name{Local: "wp:extent"}} + e.EncodeElement(m.Extent, seextent) + if m.EffectExtent != nil { + seeffectExtent := xml.StartElement{Name: xml.Name{Local: "wp:effectExtent"}} + e.EncodeElement(m.EffectExtent, seeffectExtent) + } + sedocPr := xml.StartElement{Name: xml.Name{Local: "wp:docPr"}} + e.EncodeElement(m.DocPr, sedocPr) + if m.CNvGraphicFramePr != nil { + secNvGraphicFramePr := xml.StartElement{Name: xml.Name{Local: "wp:cNvGraphicFramePr"}} + e.EncodeElement(m.CNvGraphicFramePr, secNvGraphicFramePr) + } + segraphic := xml.StartElement{Name: xml.Name{Local: "a:graphic"}} + e.EncodeElement(m.Graphic, segraphic) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *WdCT_Inline) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.Extent = dml.NewCT_PositiveSize2D() + m.DocPr = dml.NewCT_NonVisualDrawingProps() + m.Graphic = dml.NewGraphic() + for _, attr := range start.Attr { + if attr.Name.Local == "distT" { + parsed, err := strconv.ParseUint(attr.Value, 10, 32) + if err != nil { + return err + } + pt := uint32(parsed) + m.DistTAttr = &pt + continue + } + if attr.Name.Local == "distB" { + parsed, err := strconv.ParseUint(attr.Value, 10, 32) + if err != nil { + return err + } + pt := uint32(parsed) + m.DistBAttr = &pt + continue + } + if attr.Name.Local == "distR" { + parsed, err := strconv.ParseUint(attr.Value, 10, 32) + if err != nil { + return err + } + pt := uint32(parsed) + m.DistRAttr = &pt + continue + } + if attr.Name.Local == "distL" { + parsed, err := strconv.ParseUint(attr.Value, 10, 32) + if err != nil { + return err + } + pt := uint32(parsed) + m.DistLAttr = &pt + continue + } + } +lWdCT_Inline: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "extent"}: + if err := d.DecodeElement(m.Extent, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "effectExtent"}: + m.EffectExtent = NewWdCT_EffectExtent() + if err := d.DecodeElement(m.EffectExtent, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "docPr"}: + if err := d.DecodeElement(m.DocPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "cNvGraphicFramePr"}: + m.CNvGraphicFramePr = dml.NewCT_NonVisualGraphicFrameProperties() + if err := d.DecodeElement(m.CNvGraphicFramePr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "graphic"}: + if err := d.DecodeElement(m.Graphic, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on WdCT_Inline %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lWdCT_Inline + case xml.CharData: + } + } + return nil +} + +// Validate validates the WdCT_Inline and its children +func (m *WdCT_Inline) Validate() error { + return m.ValidateWithPath("WdCT_Inline") +} + +// ValidateWithPath validates the WdCT_Inline and its children, prefixing error messages with path +func (m *WdCT_Inline) ValidateWithPath(path string) error { + if err := m.Extent.ValidateWithPath(path + "/Extent"); err != nil { + return err + } + if m.EffectExtent != nil { + if err := m.EffectExtent.ValidateWithPath(path + "/EffectExtent"); err != nil { + return err + } + } + if err := m.DocPr.ValidateWithPath(path + "/DocPr"); err != nil { + return err + } + if m.CNvGraphicFramePr != nil { + if err := m.CNvGraphicFramePr.ValidateWithPath(path + "/CNvGraphicFramePr"); err != nil { + return err + } + } + if err := m.Graphic.ValidateWithPath(path + "/Graphic"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_LinkedTextboxInformation.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_LinkedTextboxInformation.go new file mode 100644 index 00000000..14d6d541 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_LinkedTextboxInformation.go @@ -0,0 +1,107 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/dml" +) + +type WdCT_LinkedTextboxInformation struct { + IdAttr uint16 + SeqAttr uint16 + ExtLst *dml.CT_OfficeArtExtensionList +} + +func NewWdCT_LinkedTextboxInformation() *WdCT_LinkedTextboxInformation { + ret := &WdCT_LinkedTextboxInformation{} + return ret +} + +func (m *WdCT_LinkedTextboxInformation) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "id"}, + Value: fmt.Sprintf("%v", m.IdAttr)}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "seq"}, + Value: fmt.Sprintf("%v", m.SeqAttr)}) + e.EncodeToken(start) + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "wp:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *WdCT_LinkedTextboxInformation) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "id" { + parsed, err := strconv.ParseUint(attr.Value, 10, 16) + if err != nil { + return err + } + m.IdAttr = uint16(parsed) + continue + } + if attr.Name.Local == "seq" { + parsed, err := strconv.ParseUint(attr.Value, 10, 16) + if err != nil { + return err + } + m.SeqAttr = uint16(parsed) + continue + } + } +lWdCT_LinkedTextboxInformation: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "extLst"}: + m.ExtLst = dml.NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on WdCT_LinkedTextboxInformation %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lWdCT_LinkedTextboxInformation + case xml.CharData: + } + } + return nil +} + +// Validate validates the WdCT_LinkedTextboxInformation and its children +func (m *WdCT_LinkedTextboxInformation) Validate() error { + return m.ValidateWithPath("WdCT_LinkedTextboxInformation") +} + +// ValidateWithPath validates the WdCT_LinkedTextboxInformation and its children, prefixing error messages with path +func (m *WdCT_LinkedTextboxInformation) ValidateWithPath(path string) error { + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_PosH.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_PosH.go new file mode 100644 index 00000000..d9a925bd --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_PosH.go @@ -0,0 +1,103 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type WdCT_PosH struct { + RelativeFromAttr WdST_RelFromH + Choice *WdCT_PosHChoice +} + +func NewWdCT_PosH() *WdCT_PosH { + ret := &WdCT_PosH{} + ret.RelativeFromAttr = WdST_RelFromH(1) + ret.Choice = NewWdCT_PosHChoice() + return ret +} + +func (m *WdCT_PosH) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.RelativeFromAttr.MarshalXMLAttr(xml.Name{Local: "relativeFrom"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + m.Choice.MarshalXML(e, xml.StartElement{}) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *WdCT_PosH) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.RelativeFromAttr = WdST_RelFromH(1) + m.Choice = NewWdCT_PosHChoice() + for _, attr := range start.Attr { + if attr.Name.Local == "relativeFrom" { + m.RelativeFromAttr.UnmarshalXMLAttr(attr) + continue + } + } +lWdCT_PosH: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "align"}: + m.Choice = NewWdCT_PosHChoice() + if err := d.DecodeElement(&m.Choice.Align, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "posOffset"}: + m.Choice = NewWdCT_PosHChoice() + if err := d.DecodeElement(&m.Choice.PosOffset, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on WdCT_PosH %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lWdCT_PosH + case xml.CharData: + } + } + return nil +} + +// Validate validates the WdCT_PosH and its children +func (m *WdCT_PosH) Validate() error { + return m.ValidateWithPath("WdCT_PosH") +} + +// ValidateWithPath validates the WdCT_PosH and its children, prefixing error messages with path +func (m *WdCT_PosH) ValidateWithPath(path string) error { + if m.RelativeFromAttr == WdST_RelFromHUnset { + return fmt.Errorf("%s/RelativeFromAttr is a mandatory field", path) + } + if err := m.RelativeFromAttr.ValidateWithPath(path + "/RelativeFromAttr"); err != nil { + return err + } + if err := m.Choice.ValidateWithPath(path + "/Choice"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_PosHChoice.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_PosHChoice.go new file mode 100644 index 00000000..809e2043 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_PosHChoice.go @@ -0,0 +1,86 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type WdCT_PosHChoice struct { + Align WdST_AlignH + PosOffset *int32 +} + +func NewWdCT_PosHChoice() *WdCT_PosHChoice { + ret := &WdCT_PosHChoice{} + return ret +} + +func (m *WdCT_PosHChoice) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.Align != WdST_AlignHUnset { + sealign := xml.StartElement{Name: xml.Name{Local: "wp:align"}} + e.EncodeElement(m.Align, sealign) + } + if m.PosOffset != nil { + seposOffset := xml.StartElement{Name: xml.Name{Local: "wp:posOffset"}} + e.EncodeElement(m.PosOffset, seposOffset) + } + return nil +} + +func (m *WdCT_PosHChoice) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lWdCT_PosHChoice: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "align"}: + m.Align = WdST_AlignHUnset + if err := d.DecodeElement(&m.Align, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "posOffset"}: + m.PosOffset = new(int32) + if err := d.DecodeElement(m.PosOffset, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on WdCT_PosHChoice %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lWdCT_PosHChoice + case xml.CharData: + } + } + return nil +} + +// Validate validates the WdCT_PosHChoice and its children +func (m *WdCT_PosHChoice) Validate() error { + return m.ValidateWithPath("WdCT_PosHChoice") +} + +// ValidateWithPath validates the WdCT_PosHChoice and its children, prefixing error messages with path +func (m *WdCT_PosHChoice) ValidateWithPath(path string) error { + if err := m.Align.ValidateWithPath(path + "/Align"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_PosV.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_PosV.go new file mode 100644 index 00000000..e21ac88f --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_PosV.go @@ -0,0 +1,103 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type WdCT_PosV struct { + RelativeFromAttr WdST_RelFromV + Choice *WdCT_PosVChoice +} + +func NewWdCT_PosV() *WdCT_PosV { + ret := &WdCT_PosV{} + ret.RelativeFromAttr = WdST_RelFromV(1) + ret.Choice = NewWdCT_PosVChoice() + return ret +} + +func (m *WdCT_PosV) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.RelativeFromAttr.MarshalXMLAttr(xml.Name{Local: "relativeFrom"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + e.EncodeToken(start) + m.Choice.MarshalXML(e, xml.StartElement{}) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *WdCT_PosV) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.RelativeFromAttr = WdST_RelFromV(1) + m.Choice = NewWdCT_PosVChoice() + for _, attr := range start.Attr { + if attr.Name.Local == "relativeFrom" { + m.RelativeFromAttr.UnmarshalXMLAttr(attr) + continue + } + } +lWdCT_PosV: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "align"}: + m.Choice = NewWdCT_PosVChoice() + if err := d.DecodeElement(&m.Choice.Align, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "posOffset"}: + m.Choice = NewWdCT_PosVChoice() + if err := d.DecodeElement(&m.Choice.PosOffset, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on WdCT_PosV %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lWdCT_PosV + case xml.CharData: + } + } + return nil +} + +// Validate validates the WdCT_PosV and its children +func (m *WdCT_PosV) Validate() error { + return m.ValidateWithPath("WdCT_PosV") +} + +// ValidateWithPath validates the WdCT_PosV and its children, prefixing error messages with path +func (m *WdCT_PosV) ValidateWithPath(path string) error { + if m.RelativeFromAttr == WdST_RelFromVUnset { + return fmt.Errorf("%s/RelativeFromAttr is a mandatory field", path) + } + if err := m.RelativeFromAttr.ValidateWithPath(path + "/RelativeFromAttr"); err != nil { + return err + } + if err := m.Choice.ValidateWithPath(path + "/Choice"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_PosVChoice.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_PosVChoice.go new file mode 100644 index 00000000..d82d3bce --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_PosVChoice.go @@ -0,0 +1,86 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type WdCT_PosVChoice struct { + Align WdST_AlignV + PosOffset *int32 +} + +func NewWdCT_PosVChoice() *WdCT_PosVChoice { + ret := &WdCT_PosVChoice{} + return ret +} + +func (m *WdCT_PosVChoice) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.Align != WdST_AlignVUnset { + sealign := xml.StartElement{Name: xml.Name{Local: "wp:align"}} + e.EncodeElement(m.Align, sealign) + } + if m.PosOffset != nil { + seposOffset := xml.StartElement{Name: xml.Name{Local: "wp:posOffset"}} + e.EncodeElement(m.PosOffset, seposOffset) + } + return nil +} + +func (m *WdCT_PosVChoice) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lWdCT_PosVChoice: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "align"}: + m.Align = WdST_AlignVUnset + if err := d.DecodeElement(&m.Align, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "posOffset"}: + m.PosOffset = new(int32) + if err := d.DecodeElement(m.PosOffset, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on WdCT_PosVChoice %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lWdCT_PosVChoice + case xml.CharData: + } + } + return nil +} + +// Validate validates the WdCT_PosVChoice and its children +func (m *WdCT_PosVChoice) Validate() error { + return m.ValidateWithPath("WdCT_PosVChoice") +} + +// ValidateWithPath validates the WdCT_PosVChoice and its children, prefixing error messages with path +func (m *WdCT_PosVChoice) ValidateWithPath(path string) error { + if err := m.Align.ValidateWithPath(path + "/Align"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_TextboxInfo.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_TextboxInfo.go new file mode 100644 index 00000000..0e8b108c --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_TextboxInfo.go @@ -0,0 +1,111 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/dml" +) + +type WdCT_TextboxInfo struct { + IdAttr *uint16 + TxbxContent *WdCT_TxbxContent + ExtLst *dml.CT_OfficeArtExtensionList +} + +func NewWdCT_TextboxInfo() *WdCT_TextboxInfo { + ret := &WdCT_TextboxInfo{} + ret.TxbxContent = NewWdCT_TxbxContent() + return ret +} + +func (m *WdCT_TextboxInfo) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.IdAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "id"}, + Value: fmt.Sprintf("%v", *m.IdAttr)}) + } + e.EncodeToken(start) + setxbxContent := xml.StartElement{Name: xml.Name{Local: "wp:txbxContent"}} + e.EncodeElement(m.TxbxContent, setxbxContent) + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "wp:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *WdCT_TextboxInfo) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.TxbxContent = NewWdCT_TxbxContent() + for _, attr := range start.Attr { + if attr.Name.Local == "id" { + parsed, err := strconv.ParseUint(attr.Value, 10, 16) + if err != nil { + return err + } + pt := uint16(parsed) + m.IdAttr = &pt + continue + } + } +lWdCT_TextboxInfo: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "txbxContent"}: + if err := d.DecodeElement(m.TxbxContent, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "extLst"}: + m.ExtLst = dml.NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on WdCT_TextboxInfo %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lWdCT_TextboxInfo + case xml.CharData: + } + } + return nil +} + +// Validate validates the WdCT_TextboxInfo and its children +func (m *WdCT_TextboxInfo) Validate() error { + return m.ValidateWithPath("WdCT_TextboxInfo") +} + +// ValidateWithPath validates the WdCT_TextboxInfo and its children, prefixing error messages with path +func (m *WdCT_TextboxInfo) ValidateWithPath(path string) error { + if err := m.TxbxContent.ValidateWithPath(path + "/TxbxContent"); err != nil { + return err + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_TxbxContent.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_TxbxContent.go new file mode 100644 index 00000000..1ce5f647 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_TxbxContent.go @@ -0,0 +1,96 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" +) + +type WdCT_TxbxContent struct { + // Anchor for Imported External Content + AltChunk []*CT_AltChunk + EG_ContentBlockContent []*EG_ContentBlockContent +} + +func NewWdCT_TxbxContent() *WdCT_TxbxContent { + ret := &WdCT_TxbxContent{} + return ret +} + +func (m *WdCT_TxbxContent) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.AltChunk != nil { + sealtChunk := xml.StartElement{Name: xml.Name{Local: "wp:altChunk"}} + for _, c := range m.AltChunk { + e.EncodeElement(c, sealtChunk) + } + } + if m.EG_ContentBlockContent != nil { + for _, c := range m.EG_ContentBlockContent { + c.MarshalXML(e, xml.StartElement{}) + } + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *WdCT_TxbxContent) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lWdCT_TxbxContent: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "altChunk"}: + tmp := NewCT_AltChunk() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.AltChunk = append(m.AltChunk, tmp) + default: + gooxml.Log("skipping unsupported element on WdCT_TxbxContent %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lWdCT_TxbxContent + case xml.CharData: + } + } + return nil +} + +// Validate validates the WdCT_TxbxContent and its children +func (m *WdCT_TxbxContent) Validate() error { + return m.ValidateWithPath("WdCT_TxbxContent") +} + +// ValidateWithPath validates the WdCT_TxbxContent and its children, prefixing error messages with path +func (m *WdCT_TxbxContent) ValidateWithPath(path string) error { + for i, v := range m.AltChunk { + if err := v.ValidateWithPath(fmt.Sprintf("%s/AltChunk[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.EG_ContentBlockContent { + if err := v.ValidateWithPath(fmt.Sprintf("%s/EG_ContentBlockContent[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WordprocessingCanvas.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WordprocessingCanvas.go new file mode 100644 index 00000000..04ea190f --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WordprocessingCanvas.go @@ -0,0 +1,153 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/dml" +) + +type WdCT_WordprocessingCanvas struct { + Bg *dml.CT_BackgroundFormatting + Whole *dml.CT_WholeE2oFormatting + Choice []*WdCT_WordprocessingCanvasChoice + ExtLst *dml.CT_OfficeArtExtensionList +} + +func NewWdCT_WordprocessingCanvas() *WdCT_WordprocessingCanvas { + ret := &WdCT_WordprocessingCanvas{} + return ret +} + +func (m *WdCT_WordprocessingCanvas) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.Bg != nil { + sebg := xml.StartElement{Name: xml.Name{Local: "wp:bg"}} + e.EncodeElement(m.Bg, sebg) + } + if m.Whole != nil { + sewhole := xml.StartElement{Name: xml.Name{Local: "wp:whole"}} + e.EncodeElement(m.Whole, sewhole) + } + if m.Choice != nil { + for _, c := range m.Choice { + c.MarshalXML(e, xml.StartElement{}) + } + } + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "wp:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *WdCT_WordprocessingCanvas) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lWdCT_WordprocessingCanvas: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "bg"}: + m.Bg = dml.NewCT_BackgroundFormatting() + if err := d.DecodeElement(m.Bg, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "whole"}: + m.Whole = dml.NewCT_WholeE2oFormatting() + if err := d.DecodeElement(m.Whole, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "wsp"}: + tmp := NewWdCT_WordprocessingCanvasChoice() + if err := d.DecodeElement(&tmp.Wsp, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/picture", Local: "pic"}: + tmp := NewWdCT_WordprocessingCanvasChoice() + if err := d.DecodeElement(&tmp.Pic, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "contentPart"}: + tmp := NewWdCT_WordprocessingCanvasChoice() + if err := d.DecodeElement(&tmp.ContentPart, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "wgp"}: + tmp := NewWdCT_WordprocessingCanvasChoice() + if err := d.DecodeElement(&tmp.Wgp, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "graphicFrame"}: + tmp := NewWdCT_WordprocessingCanvasChoice() + if err := d.DecodeElement(&tmp.GraphicFrame, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "extLst"}: + m.ExtLst = dml.NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on WdCT_WordprocessingCanvas %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lWdCT_WordprocessingCanvas + case xml.CharData: + } + } + return nil +} + +// Validate validates the WdCT_WordprocessingCanvas and its children +func (m *WdCT_WordprocessingCanvas) Validate() error { + return m.ValidateWithPath("WdCT_WordprocessingCanvas") +} + +// ValidateWithPath validates the WdCT_WordprocessingCanvas and its children, prefixing error messages with path +func (m *WdCT_WordprocessingCanvas) ValidateWithPath(path string) error { + if m.Bg != nil { + if err := m.Bg.ValidateWithPath(path + "/Bg"); err != nil { + return err + } + } + if m.Whole != nil { + if err := m.Whole.ValidateWithPath(path + "/Whole"); err != nil { + return err + } + } + for i, v := range m.Choice { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Choice[%d]", path, i)); err != nil { + return err + } + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WordprocessingCanvasChoice.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WordprocessingCanvasChoice.go new file mode 100644 index 00000000..e1da8ee6 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WordprocessingCanvasChoice.go @@ -0,0 +1,155 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/dml/picture" +) + +type WdCT_WordprocessingCanvasChoice struct { + Wsp []*WdWsp + Pic []*picture.Pic + ContentPart []*WdCT_WordprocessingContentPart + Wgp []*WdWgp + GraphicFrame []*WdCT_GraphicFrame +} + +func NewWdCT_WordprocessingCanvasChoice() *WdCT_WordprocessingCanvasChoice { + ret := &WdCT_WordprocessingCanvasChoice{} + return ret +} + +func (m *WdCT_WordprocessingCanvasChoice) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.Wsp != nil { + sewsp := xml.StartElement{Name: xml.Name{Local: "wp:wsp"}} + for _, c := range m.Wsp { + e.EncodeElement(c, sewsp) + } + } + if m.Pic != nil { + sepic := xml.StartElement{Name: xml.Name{Local: "pic:pic"}} + for _, c := range m.Pic { + e.EncodeElement(c, sepic) + } + } + if m.ContentPart != nil { + secontentPart := xml.StartElement{Name: xml.Name{Local: "wp:contentPart"}} + for _, c := range m.ContentPart { + e.EncodeElement(c, secontentPart) + } + } + if m.Wgp != nil { + sewgp := xml.StartElement{Name: xml.Name{Local: "wp:wgp"}} + for _, c := range m.Wgp { + e.EncodeElement(c, sewgp) + } + } + if m.GraphicFrame != nil { + segraphicFrame := xml.StartElement{Name: xml.Name{Local: "wp:graphicFrame"}} + for _, c := range m.GraphicFrame { + e.EncodeElement(c, segraphicFrame) + } + } + return nil +} + +func (m *WdCT_WordprocessingCanvasChoice) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lWdCT_WordprocessingCanvasChoice: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "wsp"}: + tmp := NewWdWsp() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Wsp = append(m.Wsp, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/picture", Local: "pic"}: + tmp := picture.NewPic() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Pic = append(m.Pic, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "contentPart"}: + tmp := NewWdCT_WordprocessingContentPart() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.ContentPart = append(m.ContentPart, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "wgp"}: + tmp := NewWdWgp() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Wgp = append(m.Wgp, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "graphicFrame"}: + tmp := NewWdCT_GraphicFrame() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.GraphicFrame = append(m.GraphicFrame, tmp) + default: + gooxml.Log("skipping unsupported element on WdCT_WordprocessingCanvasChoice %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lWdCT_WordprocessingCanvasChoice + case xml.CharData: + } + } + return nil +} + +// Validate validates the WdCT_WordprocessingCanvasChoice and its children +func (m *WdCT_WordprocessingCanvasChoice) Validate() error { + return m.ValidateWithPath("WdCT_WordprocessingCanvasChoice") +} + +// ValidateWithPath validates the WdCT_WordprocessingCanvasChoice and its children, prefixing error messages with path +func (m *WdCT_WordprocessingCanvasChoice) ValidateWithPath(path string) error { + for i, v := range m.Wsp { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Wsp[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.Pic { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Pic[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.ContentPart { + if err := v.ValidateWithPath(fmt.Sprintf("%s/ContentPart[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.Wgp { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Wgp[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.GraphicFrame { + if err := v.ValidateWithPath(fmt.Sprintf("%s/GraphicFrame[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WordprocessingContentPart.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WordprocessingContentPart.go new file mode 100644 index 00000000..2874491c --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WordprocessingContentPart.go @@ -0,0 +1,140 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/dml" +) + +type WdCT_WordprocessingContentPart struct { + BwModeAttr dml.ST_BlackWhiteMode + IdAttr string + NvContentPartPr *WdCT_WordprocessingContentPartNonVisual + Xfrm *dml.CT_Transform2D + ExtLst *dml.CT_OfficeArtExtensionList +} + +func NewWdCT_WordprocessingContentPart() *WdCT_WordprocessingContentPart { + ret := &WdCT_WordprocessingContentPart{} + return ret +} + +func (m *WdCT_WordprocessingContentPart) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.BwModeAttr != dml.ST_BlackWhiteModeUnset { + attr, err := m.BwModeAttr.MarshalXMLAttr(xml.Name{Local: "bwMode"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + } + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "r:id"}, + Value: fmt.Sprintf("%v", m.IdAttr)}) + e.EncodeToken(start) + if m.NvContentPartPr != nil { + senvContentPartPr := xml.StartElement{Name: xml.Name{Local: "wp:nvContentPartPr"}} + e.EncodeElement(m.NvContentPartPr, senvContentPartPr) + } + if m.Xfrm != nil { + sexfrm := xml.StartElement{Name: xml.Name{Local: "wp:xfrm"}} + e.EncodeElement(m.Xfrm, sexfrm) + } + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "wp:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *WdCT_WordprocessingContentPart) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Space == "http://schemas.openxmlformats.org/officeDocument/2006/relationships" && attr.Name.Local == "id" { + parsed, err := attr.Value, error(nil) + if err != nil { + return err + } + m.IdAttr = parsed + continue + } + if attr.Name.Local == "bwMode" { + m.BwModeAttr.UnmarshalXMLAttr(attr) + continue + } + } +lWdCT_WordprocessingContentPart: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "nvContentPartPr"}: + m.NvContentPartPr = NewWdCT_WordprocessingContentPartNonVisual() + if err := d.DecodeElement(m.NvContentPartPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "xfrm"}: + m.Xfrm = dml.NewCT_Transform2D() + if err := d.DecodeElement(m.Xfrm, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "extLst"}: + m.ExtLst = dml.NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on WdCT_WordprocessingContentPart %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lWdCT_WordprocessingContentPart + case xml.CharData: + } + } + return nil +} + +// Validate validates the WdCT_WordprocessingContentPart and its children +func (m *WdCT_WordprocessingContentPart) Validate() error { + return m.ValidateWithPath("WdCT_WordprocessingContentPart") +} + +// ValidateWithPath validates the WdCT_WordprocessingContentPart and its children, prefixing error messages with path +func (m *WdCT_WordprocessingContentPart) ValidateWithPath(path string) error { + if err := m.BwModeAttr.ValidateWithPath(path + "/BwModeAttr"); err != nil { + return err + } + if m.NvContentPartPr != nil { + if err := m.NvContentPartPr.ValidateWithPath(path + "/NvContentPartPr"); err != nil { + return err + } + } + if m.Xfrm != nil { + if err := m.Xfrm.ValidateWithPath(path + "/Xfrm"); err != nil { + return err + } + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WordprocessingContentPartNonVisual.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WordprocessingContentPartNonVisual.go new file mode 100644 index 00000000..307ab0da --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WordprocessingContentPartNonVisual.go @@ -0,0 +1,96 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/dml" +) + +type WdCT_WordprocessingContentPartNonVisual struct { + CNvPr *dml.CT_NonVisualDrawingProps + CNvContentPartPr *dml.CT_NonVisualContentPartProperties +} + +func NewWdCT_WordprocessingContentPartNonVisual() *WdCT_WordprocessingContentPartNonVisual { + ret := &WdCT_WordprocessingContentPartNonVisual{} + return ret +} + +func (m *WdCT_WordprocessingContentPartNonVisual) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.CNvPr != nil { + secNvPr := xml.StartElement{Name: xml.Name{Local: "wp:cNvPr"}} + e.EncodeElement(m.CNvPr, secNvPr) + } + if m.CNvContentPartPr != nil { + secNvContentPartPr := xml.StartElement{Name: xml.Name{Local: "wp:cNvContentPartPr"}} + e.EncodeElement(m.CNvContentPartPr, secNvContentPartPr) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *WdCT_WordprocessingContentPartNonVisual) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lWdCT_WordprocessingContentPartNonVisual: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "cNvPr"}: + m.CNvPr = dml.NewCT_NonVisualDrawingProps() + if err := d.DecodeElement(m.CNvPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "cNvContentPartPr"}: + m.CNvContentPartPr = dml.NewCT_NonVisualContentPartProperties() + if err := d.DecodeElement(m.CNvContentPartPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on WdCT_WordprocessingContentPartNonVisual %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lWdCT_WordprocessingContentPartNonVisual + case xml.CharData: + } + } + return nil +} + +// Validate validates the WdCT_WordprocessingContentPartNonVisual and its children +func (m *WdCT_WordprocessingContentPartNonVisual) Validate() error { + return m.ValidateWithPath("WdCT_WordprocessingContentPartNonVisual") +} + +// ValidateWithPath validates the WdCT_WordprocessingContentPartNonVisual and its children, prefixing error messages with path +func (m *WdCT_WordprocessingContentPartNonVisual) ValidateWithPath(path string) error { + if m.CNvPr != nil { + if err := m.CNvPr.ValidateWithPath(path + "/CNvPr"); err != nil { + return err + } + } + if m.CNvContentPartPr != nil { + if err := m.CNvContentPartPr.ValidateWithPath(path + "/CNvContentPartPr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WordprocessingGroup.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WordprocessingGroup.go new file mode 100644 index 00000000..c8f88acf --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WordprocessingGroup.go @@ -0,0 +1,162 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/dml" +) + +type WdCT_WordprocessingGroup struct { + CNvPr *dml.CT_NonVisualDrawingProps + CNvGrpSpPr *dml.CT_NonVisualGroupDrawingShapeProps + GrpSpPr *dml.CT_GroupShapeProperties + Choice []*WdCT_WordprocessingGroupChoice + ExtLst *dml.CT_OfficeArtExtensionList +} + +func NewWdCT_WordprocessingGroup() *WdCT_WordprocessingGroup { + ret := &WdCT_WordprocessingGroup{} + ret.CNvGrpSpPr = dml.NewCT_NonVisualGroupDrawingShapeProps() + ret.GrpSpPr = dml.NewCT_GroupShapeProperties() + return ret +} + +func (m *WdCT_WordprocessingGroup) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + if m.CNvPr != nil { + secNvPr := xml.StartElement{Name: xml.Name{Local: "wp:cNvPr"}} + e.EncodeElement(m.CNvPr, secNvPr) + } + secNvGrpSpPr := xml.StartElement{Name: xml.Name{Local: "wp:cNvGrpSpPr"}} + e.EncodeElement(m.CNvGrpSpPr, secNvGrpSpPr) + segrpSpPr := xml.StartElement{Name: xml.Name{Local: "wp:grpSpPr"}} + e.EncodeElement(m.GrpSpPr, segrpSpPr) + if m.Choice != nil { + for _, c := range m.Choice { + c.MarshalXML(e, xml.StartElement{}) + } + } + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "wp:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *WdCT_WordprocessingGroup) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CNvGrpSpPr = dml.NewCT_NonVisualGroupDrawingShapeProps() + m.GrpSpPr = dml.NewCT_GroupShapeProperties() +lWdCT_WordprocessingGroup: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "cNvPr"}: + m.CNvPr = dml.NewCT_NonVisualDrawingProps() + if err := d.DecodeElement(m.CNvPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "cNvGrpSpPr"}: + if err := d.DecodeElement(m.CNvGrpSpPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "grpSpPr"}: + if err := d.DecodeElement(m.GrpSpPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "wsp"}: + tmp := NewWdCT_WordprocessingGroupChoice() + if err := d.DecodeElement(&tmp.Wsp, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "grpSp"}: + tmp := NewWdCT_WordprocessingGroupChoice() + if err := d.DecodeElement(&tmp.GrpSp, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "graphicFrame"}: + tmp := NewWdCT_WordprocessingGroupChoice() + if err := d.DecodeElement(&tmp.GraphicFrame, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/picture", Local: "pic"}: + tmp := NewWdCT_WordprocessingGroupChoice() + if err := d.DecodeElement(&tmp.Pic, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "contentPart"}: + tmp := NewWdCT_WordprocessingGroupChoice() + if err := d.DecodeElement(&tmp.ContentPart, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "extLst"}: + m.ExtLst = dml.NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on WdCT_WordprocessingGroup %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lWdCT_WordprocessingGroup + case xml.CharData: + } + } + return nil +} + +// Validate validates the WdCT_WordprocessingGroup and its children +func (m *WdCT_WordprocessingGroup) Validate() error { + return m.ValidateWithPath("WdCT_WordprocessingGroup") +} + +// ValidateWithPath validates the WdCT_WordprocessingGroup and its children, prefixing error messages with path +func (m *WdCT_WordprocessingGroup) ValidateWithPath(path string) error { + if m.CNvPr != nil { + if err := m.CNvPr.ValidateWithPath(path + "/CNvPr"); err != nil { + return err + } + } + if err := m.CNvGrpSpPr.ValidateWithPath(path + "/CNvGrpSpPr"); err != nil { + return err + } + if err := m.GrpSpPr.ValidateWithPath(path + "/GrpSpPr"); err != nil { + return err + } + for i, v := range m.Choice { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Choice[%d]", path, i)); err != nil { + return err + } + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WordprocessingGroupChoice.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WordprocessingGroupChoice.go new file mode 100644 index 00000000..deafb9c0 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WordprocessingGroupChoice.go @@ -0,0 +1,155 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/dml/picture" +) + +type WdCT_WordprocessingGroupChoice struct { + Wsp []*WdWsp + GrpSp []*WdCT_WordprocessingGroup + GraphicFrame []*WdCT_GraphicFrame + Pic []*picture.Pic + ContentPart []*WdCT_WordprocessingContentPart +} + +func NewWdCT_WordprocessingGroupChoice() *WdCT_WordprocessingGroupChoice { + ret := &WdCT_WordprocessingGroupChoice{} + return ret +} + +func (m *WdCT_WordprocessingGroupChoice) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.Wsp != nil { + sewsp := xml.StartElement{Name: xml.Name{Local: "wp:wsp"}} + for _, c := range m.Wsp { + e.EncodeElement(c, sewsp) + } + } + if m.GrpSp != nil { + segrpSp := xml.StartElement{Name: xml.Name{Local: "wp:grpSp"}} + for _, c := range m.GrpSp { + e.EncodeElement(c, segrpSp) + } + } + if m.GraphicFrame != nil { + segraphicFrame := xml.StartElement{Name: xml.Name{Local: "wp:graphicFrame"}} + for _, c := range m.GraphicFrame { + e.EncodeElement(c, segraphicFrame) + } + } + if m.Pic != nil { + sepic := xml.StartElement{Name: xml.Name{Local: "pic:pic"}} + for _, c := range m.Pic { + e.EncodeElement(c, sepic) + } + } + if m.ContentPart != nil { + secontentPart := xml.StartElement{Name: xml.Name{Local: "wp:contentPart"}} + for _, c := range m.ContentPart { + e.EncodeElement(c, secontentPart) + } + } + return nil +} + +func (m *WdCT_WordprocessingGroupChoice) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lWdCT_WordprocessingGroupChoice: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "wsp"}: + tmp := NewWdWsp() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Wsp = append(m.Wsp, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "grpSp"}: + tmp := NewWdCT_WordprocessingGroup() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.GrpSp = append(m.GrpSp, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "graphicFrame"}: + tmp := NewWdCT_GraphicFrame() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.GraphicFrame = append(m.GraphicFrame, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/picture", Local: "pic"}: + tmp := picture.NewPic() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.Pic = append(m.Pic, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "contentPart"}: + tmp := NewWdCT_WordprocessingContentPart() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.ContentPart = append(m.ContentPart, tmp) + default: + gooxml.Log("skipping unsupported element on WdCT_WordprocessingGroupChoice %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lWdCT_WordprocessingGroupChoice + case xml.CharData: + } + } + return nil +} + +// Validate validates the WdCT_WordprocessingGroupChoice and its children +func (m *WdCT_WordprocessingGroupChoice) Validate() error { + return m.ValidateWithPath("WdCT_WordprocessingGroupChoice") +} + +// ValidateWithPath validates the WdCT_WordprocessingGroupChoice and its children, prefixing error messages with path +func (m *WdCT_WordprocessingGroupChoice) ValidateWithPath(path string) error { + for i, v := range m.Wsp { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Wsp[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.GrpSp { + if err := v.ValidateWithPath(fmt.Sprintf("%s/GrpSp[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.GraphicFrame { + if err := v.ValidateWithPath(fmt.Sprintf("%s/GraphicFrame[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.Pic { + if err := v.ValidateWithPath(fmt.Sprintf("%s/Pic[%d]", path, i)); err != nil { + return err + } + } + for i, v := range m.ContentPart { + if err := v.ValidateWithPath(fmt.Sprintf("%s/ContentPart[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WordprocessingShape.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WordprocessingShape.go new file mode 100644 index 00000000..0a6e8a2e --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WordprocessingShape.go @@ -0,0 +1,188 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/dml" +) + +type WdCT_WordprocessingShape struct { + NormalEastAsianFlowAttr *bool + CNvPr *dml.CT_NonVisualDrawingProps + Choice *WdCT_WordprocessingShapeChoice + SpPr *dml.CT_ShapeProperties + Style *dml.CT_ShapeStyle + ExtLst *dml.CT_OfficeArtExtensionList + WChoice *WdCT_WordprocessingShapeChoice1 + BodyPr *dml.CT_TextBodyProperties +} + +func NewWdCT_WordprocessingShape() *WdCT_WordprocessingShape { + ret := &WdCT_WordprocessingShape{} + ret.Choice = NewWdCT_WordprocessingShapeChoice() + ret.SpPr = dml.NewCT_ShapeProperties() + ret.BodyPr = dml.NewCT_TextBodyProperties() + return ret +} + +func (m *WdCT_WordprocessingShape) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.NormalEastAsianFlowAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "normalEastAsianFlow"}, + Value: fmt.Sprintf("%d", b2i(*m.NormalEastAsianFlowAttr))}) + } + e.EncodeToken(start) + if m.CNvPr != nil { + secNvPr := xml.StartElement{Name: xml.Name{Local: "wp:cNvPr"}} + e.EncodeElement(m.CNvPr, secNvPr) + } + m.Choice.MarshalXML(e, xml.StartElement{}) + sespPr := xml.StartElement{Name: xml.Name{Local: "wp:spPr"}} + e.EncodeElement(m.SpPr, sespPr) + if m.Style != nil { + sestyle := xml.StartElement{Name: xml.Name{Local: "wp:style"}} + e.EncodeElement(m.Style, sestyle) + } + if m.ExtLst != nil { + seextLst := xml.StartElement{Name: xml.Name{Local: "wp:extLst"}} + e.EncodeElement(m.ExtLst, seextLst) + } + if m.WChoice != nil { + m.WChoice.MarshalXML(e, xml.StartElement{}) + } + sebodyPr := xml.StartElement{Name: xml.Name{Local: "wp:bodyPr"}} + e.EncodeElement(m.BodyPr, sebodyPr) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *WdCT_WordprocessingShape) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.Choice = NewWdCT_WordprocessingShapeChoice() + m.SpPr = dml.NewCT_ShapeProperties() + m.BodyPr = dml.NewCT_TextBodyProperties() + for _, attr := range start.Attr { + if attr.Name.Local == "normalEastAsianFlow" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NormalEastAsianFlowAttr = &parsed + continue + } + } +lWdCT_WordprocessingShape: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "cNvPr"}: + m.CNvPr = dml.NewCT_NonVisualDrawingProps() + if err := d.DecodeElement(m.CNvPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "cNvSpPr"}: + m.Choice = NewWdCT_WordprocessingShapeChoice() + if err := d.DecodeElement(&m.Choice.CNvSpPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "cNvCnPr"}: + m.Choice = NewWdCT_WordprocessingShapeChoice() + if err := d.DecodeElement(&m.Choice.CNvCnPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "spPr"}: + if err := d.DecodeElement(m.SpPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "style"}: + m.Style = dml.NewCT_ShapeStyle() + if err := d.DecodeElement(m.Style, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "extLst"}: + m.ExtLst = dml.NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "txbx"}: + m.WChoice = NewWdCT_WordprocessingShapeChoice1() + if err := d.DecodeElement(&m.WChoice.Txbx, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "linkedTxbx"}: + m.WChoice = NewWdCT_WordprocessingShapeChoice1() + if err := d.DecodeElement(&m.WChoice.LinkedTxbx, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "bodyPr"}: + if err := d.DecodeElement(m.BodyPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on WdCT_WordprocessingShape %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lWdCT_WordprocessingShape + case xml.CharData: + } + } + return nil +} + +// Validate validates the WdCT_WordprocessingShape and its children +func (m *WdCT_WordprocessingShape) Validate() error { + return m.ValidateWithPath("WdCT_WordprocessingShape") +} + +// ValidateWithPath validates the WdCT_WordprocessingShape and its children, prefixing error messages with path +func (m *WdCT_WordprocessingShape) ValidateWithPath(path string) error { + if m.CNvPr != nil { + if err := m.CNvPr.ValidateWithPath(path + "/CNvPr"); err != nil { + return err + } + } + if err := m.Choice.ValidateWithPath(path + "/Choice"); err != nil { + return err + } + if err := m.SpPr.ValidateWithPath(path + "/SpPr"); err != nil { + return err + } + if m.Style != nil { + if err := m.Style.ValidateWithPath(path + "/Style"); err != nil { + return err + } + } + if m.ExtLst != nil { + if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil { + return err + } + } + if m.WChoice != nil { + if err := m.WChoice.ValidateWithPath(path + "/WChoice"); err != nil { + return err + } + } + if err := m.BodyPr.ValidateWithPath(path + "/BodyPr"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WordprocessingShapeChoice.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WordprocessingShapeChoice.go new file mode 100644 index 00000000..5f04ad2a --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WordprocessingShapeChoice.go @@ -0,0 +1,94 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/dml" +) + +type WdCT_WordprocessingShapeChoice struct { + CNvSpPr *dml.CT_NonVisualDrawingShapeProps + CNvCnPr *dml.CT_NonVisualConnectorProperties +} + +func NewWdCT_WordprocessingShapeChoice() *WdCT_WordprocessingShapeChoice { + ret := &WdCT_WordprocessingShapeChoice{} + return ret +} + +func (m *WdCT_WordprocessingShapeChoice) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.CNvSpPr != nil { + secNvSpPr := xml.StartElement{Name: xml.Name{Local: "wp:cNvSpPr"}} + e.EncodeElement(m.CNvSpPr, secNvSpPr) + } + if m.CNvCnPr != nil { + secNvCnPr := xml.StartElement{Name: xml.Name{Local: "wp:cNvCnPr"}} + e.EncodeElement(m.CNvCnPr, secNvCnPr) + } + return nil +} + +func (m *WdCT_WordprocessingShapeChoice) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lWdCT_WordprocessingShapeChoice: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "cNvSpPr"}: + m.CNvSpPr = dml.NewCT_NonVisualDrawingShapeProps() + if err := d.DecodeElement(m.CNvSpPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "cNvCnPr"}: + m.CNvCnPr = dml.NewCT_NonVisualConnectorProperties() + if err := d.DecodeElement(m.CNvCnPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on WdCT_WordprocessingShapeChoice %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lWdCT_WordprocessingShapeChoice + case xml.CharData: + } + } + return nil +} + +// Validate validates the WdCT_WordprocessingShapeChoice and its children +func (m *WdCT_WordprocessingShapeChoice) Validate() error { + return m.ValidateWithPath("WdCT_WordprocessingShapeChoice") +} + +// ValidateWithPath validates the WdCT_WordprocessingShapeChoice and its children, prefixing error messages with path +func (m *WdCT_WordprocessingShapeChoice) ValidateWithPath(path string) error { + if m.CNvSpPr != nil { + if err := m.CNvSpPr.ValidateWithPath(path + "/CNvSpPr"); err != nil { + return err + } + } + if m.CNvCnPr != nil { + if err := m.CNvCnPr.ValidateWithPath(path + "/CNvCnPr"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WordprocessingShapeChoice1.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WordprocessingShapeChoice1.go new file mode 100644 index 00000000..67c4f353 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WordprocessingShapeChoice1.go @@ -0,0 +1,93 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type WdCT_WordprocessingShapeChoice1 struct { + Txbx *WdCT_TextboxInfo + LinkedTxbx *WdCT_LinkedTextboxInformation +} + +func NewWdCT_WordprocessingShapeChoice1() *WdCT_WordprocessingShapeChoice1 { + ret := &WdCT_WordprocessingShapeChoice1{} + return ret +} + +func (m *WdCT_WordprocessingShapeChoice1) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.Txbx != nil { + setxbx := xml.StartElement{Name: xml.Name{Local: "wp:txbx"}} + e.EncodeElement(m.Txbx, setxbx) + } + if m.LinkedTxbx != nil { + selinkedTxbx := xml.StartElement{Name: xml.Name{Local: "wp:linkedTxbx"}} + e.EncodeElement(m.LinkedTxbx, selinkedTxbx) + } + return nil +} + +func (m *WdCT_WordprocessingShapeChoice1) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lWdCT_WordprocessingShapeChoice1: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "txbx"}: + m.Txbx = NewWdCT_TextboxInfo() + if err := d.DecodeElement(m.Txbx, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "linkedTxbx"}: + m.LinkedTxbx = NewWdCT_LinkedTextboxInformation() + if err := d.DecodeElement(m.LinkedTxbx, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on WdCT_WordprocessingShapeChoice1 %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lWdCT_WordprocessingShapeChoice1 + case xml.CharData: + } + } + return nil +} + +// Validate validates the WdCT_WordprocessingShapeChoice1 and its children +func (m *WdCT_WordprocessingShapeChoice1) Validate() error { + return m.ValidateWithPath("WdCT_WordprocessingShapeChoice1") +} + +// ValidateWithPath validates the WdCT_WordprocessingShapeChoice1 and its children, prefixing error messages with path +func (m *WdCT_WordprocessingShapeChoice1) ValidateWithPath(path string) error { + if m.Txbx != nil { + if err := m.Txbx.ValidateWithPath(path + "/Txbx"); err != nil { + return err + } + } + if m.LinkedTxbx != nil { + if err := m.LinkedTxbx.ValidateWithPath(path + "/LinkedTxbx"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WrapNone.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WrapNone.go new file mode 100644 index 00000000..c9ca05b5 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WrapNone.go @@ -0,0 +1,54 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" +) + +type WdCT_WrapNone struct { +} + +func NewWdCT_WrapNone() *WdCT_WrapNone { + ret := &WdCT_WrapNone{} + return ret +} + +func (m *WdCT_WrapNone) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *WdCT_WrapNone) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + // skip any extensions we may find, but don't support + for { + tok, err := d.Token() + if err != nil { + return fmt.Errorf("parsing WdCT_WrapNone: %s", err) + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + break + } + } + return nil +} + +// Validate validates the WdCT_WrapNone and its children +func (m *WdCT_WrapNone) Validate() error { + return m.ValidateWithPath("WdCT_WrapNone") +} + +// ValidateWithPath validates the WdCT_WrapNone and its children, prefixing error messages with path +func (m *WdCT_WrapNone) ValidateWithPath(path string) error { + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WrapPath.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WrapPath.go new file mode 100644 index 00000000..036b2027 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WrapPath.go @@ -0,0 +1,111 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/dml" +) + +type WdCT_WrapPath struct { + EditedAttr *bool + Start *dml.CT_Point2D + LineTo []*dml.CT_Point2D +} + +func NewWdCT_WrapPath() *WdCT_WrapPath { + ret := &WdCT_WrapPath{} + ret.Start = dml.NewCT_Point2D() + return ret +} + +func (m *WdCT_WrapPath) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.EditedAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "edited"}, + Value: fmt.Sprintf("%d", b2i(*m.EditedAttr))}) + } + e.EncodeToken(start) + sestart := xml.StartElement{Name: xml.Name{Local: "wp:start"}} + e.EncodeElement(m.Start, sestart) + selineTo := xml.StartElement{Name: xml.Name{Local: "wp:lineTo"}} + for _, c := range m.LineTo { + e.EncodeElement(c, selineTo) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *WdCT_WrapPath) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.Start = dml.NewCT_Point2D() + for _, attr := range start.Attr { + if attr.Name.Local == "edited" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.EditedAttr = &parsed + continue + } + } +lWdCT_WrapPath: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "start"}: + if err := d.DecodeElement(m.Start, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "lineTo"}: + tmp := dml.NewCT_Point2D() + if err := d.DecodeElement(tmp, &el); err != nil { + return err + } + m.LineTo = append(m.LineTo, tmp) + default: + gooxml.Log("skipping unsupported element on WdCT_WrapPath %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lWdCT_WrapPath + case xml.CharData: + } + } + return nil +} + +// Validate validates the WdCT_WrapPath and its children +func (m *WdCT_WrapPath) Validate() error { + return m.ValidateWithPath("WdCT_WrapPath") +} + +// ValidateWithPath validates the WdCT_WrapPath and its children, prefixing error messages with path +func (m *WdCT_WrapPath) ValidateWithPath(path string) error { + if err := m.Start.ValidateWithPath(path + "/Start"); err != nil { + return err + } + for i, v := range m.LineTo { + if err := v.ValidateWithPath(fmt.Sprintf("%s/LineTo[%d]", path, i)); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WrapSquare.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WrapSquare.go new file mode 100644 index 00000000..6e88a38b --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WrapSquare.go @@ -0,0 +1,158 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type WdCT_WrapSquare struct { + WrapTextAttr WdST_WrapText + DistTAttr *uint32 + DistBAttr *uint32 + DistLAttr *uint32 + DistRAttr *uint32 + EffectExtent *WdCT_EffectExtent +} + +func NewWdCT_WrapSquare() *WdCT_WrapSquare { + ret := &WdCT_WrapSquare{} + ret.WrapTextAttr = WdST_WrapText(1) + return ret +} + +func (m *WdCT_WrapSquare) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.WrapTextAttr.MarshalXMLAttr(xml.Name{Local: "wrapText"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + if m.DistTAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "distT"}, + Value: fmt.Sprintf("%v", *m.DistTAttr)}) + } + if m.DistBAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "distB"}, + Value: fmt.Sprintf("%v", *m.DistBAttr)}) + } + if m.DistLAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "distL"}, + Value: fmt.Sprintf("%v", *m.DistLAttr)}) + } + if m.DistRAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "distR"}, + Value: fmt.Sprintf("%v", *m.DistRAttr)}) + } + e.EncodeToken(start) + if m.EffectExtent != nil { + seeffectExtent := xml.StartElement{Name: xml.Name{Local: "wp:effectExtent"}} + e.EncodeElement(m.EffectExtent, seeffectExtent) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *WdCT_WrapSquare) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.WrapTextAttr = WdST_WrapText(1) + for _, attr := range start.Attr { + if attr.Name.Local == "wrapText" { + m.WrapTextAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "distT" { + parsed, err := strconv.ParseUint(attr.Value, 10, 32) + if err != nil { + return err + } + pt := uint32(parsed) + m.DistTAttr = &pt + continue + } + if attr.Name.Local == "distB" { + parsed, err := strconv.ParseUint(attr.Value, 10, 32) + if err != nil { + return err + } + pt := uint32(parsed) + m.DistBAttr = &pt + continue + } + if attr.Name.Local == "distL" { + parsed, err := strconv.ParseUint(attr.Value, 10, 32) + if err != nil { + return err + } + pt := uint32(parsed) + m.DistLAttr = &pt + continue + } + if attr.Name.Local == "distR" { + parsed, err := strconv.ParseUint(attr.Value, 10, 32) + if err != nil { + return err + } + pt := uint32(parsed) + m.DistRAttr = &pt + continue + } + } +lWdCT_WrapSquare: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "effectExtent"}: + m.EffectExtent = NewWdCT_EffectExtent() + if err := d.DecodeElement(m.EffectExtent, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on WdCT_WrapSquare %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lWdCT_WrapSquare + case xml.CharData: + } + } + return nil +} + +// Validate validates the WdCT_WrapSquare and its children +func (m *WdCT_WrapSquare) Validate() error { + return m.ValidateWithPath("WdCT_WrapSquare") +} + +// ValidateWithPath validates the WdCT_WrapSquare and its children, prefixing error messages with path +func (m *WdCT_WrapSquare) ValidateWithPath(path string) error { + if m.WrapTextAttr == WdST_WrapTextUnset { + return fmt.Errorf("%s/WrapTextAttr is a mandatory field", path) + } + if err := m.WrapTextAttr.ValidateWithPath(path + "/WrapTextAttr"); err != nil { + return err + } + if m.EffectExtent != nil { + if err := m.EffectExtent.ValidateWithPath(path + "/EffectExtent"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WrapThrough.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WrapThrough.go new file mode 100644 index 00000000..ce9b5182 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WrapThrough.go @@ -0,0 +1,127 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type WdCT_WrapThrough struct { + WrapTextAttr WdST_WrapText + DistLAttr *uint32 + DistRAttr *uint32 + WrapPolygon *WdCT_WrapPath +} + +func NewWdCT_WrapThrough() *WdCT_WrapThrough { + ret := &WdCT_WrapThrough{} + ret.WrapTextAttr = WdST_WrapText(1) + ret.WrapPolygon = NewWdCT_WrapPath() + return ret +} + +func (m *WdCT_WrapThrough) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.WrapTextAttr.MarshalXMLAttr(xml.Name{Local: "wrapText"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + if m.DistLAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "distL"}, + Value: fmt.Sprintf("%v", *m.DistLAttr)}) + } + if m.DistRAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "distR"}, + Value: fmt.Sprintf("%v", *m.DistRAttr)}) + } + e.EncodeToken(start) + sewrapPolygon := xml.StartElement{Name: xml.Name{Local: "wp:wrapPolygon"}} + e.EncodeElement(m.WrapPolygon, sewrapPolygon) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *WdCT_WrapThrough) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.WrapTextAttr = WdST_WrapText(1) + m.WrapPolygon = NewWdCT_WrapPath() + for _, attr := range start.Attr { + if attr.Name.Local == "wrapText" { + m.WrapTextAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "distL" { + parsed, err := strconv.ParseUint(attr.Value, 10, 32) + if err != nil { + return err + } + pt := uint32(parsed) + m.DistLAttr = &pt + continue + } + if attr.Name.Local == "distR" { + parsed, err := strconv.ParseUint(attr.Value, 10, 32) + if err != nil { + return err + } + pt := uint32(parsed) + m.DistRAttr = &pt + continue + } + } +lWdCT_WrapThrough: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "wrapPolygon"}: + if err := d.DecodeElement(m.WrapPolygon, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on WdCT_WrapThrough %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lWdCT_WrapThrough + case xml.CharData: + } + } + return nil +} + +// Validate validates the WdCT_WrapThrough and its children +func (m *WdCT_WrapThrough) Validate() error { + return m.ValidateWithPath("WdCT_WrapThrough") +} + +// ValidateWithPath validates the WdCT_WrapThrough and its children, prefixing error messages with path +func (m *WdCT_WrapThrough) ValidateWithPath(path string) error { + if m.WrapTextAttr == WdST_WrapTextUnset { + return fmt.Errorf("%s/WrapTextAttr is a mandatory field", path) + } + if err := m.WrapTextAttr.ValidateWithPath(path + "/WrapTextAttr"); err != nil { + return err + } + if err := m.WrapPolygon.ValidateWithPath(path + "/WrapPolygon"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WrapTight.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WrapTight.go new file mode 100644 index 00000000..19b3f79d --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WrapTight.go @@ -0,0 +1,127 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type WdCT_WrapTight struct { + WrapTextAttr WdST_WrapText + DistLAttr *uint32 + DistRAttr *uint32 + WrapPolygon *WdCT_WrapPath +} + +func NewWdCT_WrapTight() *WdCT_WrapTight { + ret := &WdCT_WrapTight{} + ret.WrapTextAttr = WdST_WrapText(1) + ret.WrapPolygon = NewWdCT_WrapPath() + return ret +} + +func (m *WdCT_WrapTight) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + attr, err := m.WrapTextAttr.MarshalXMLAttr(xml.Name{Local: "wrapText"}) + if err != nil { + return err + } + start.Attr = append(start.Attr, attr) + if m.DistLAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "distL"}, + Value: fmt.Sprintf("%v", *m.DistLAttr)}) + } + if m.DistRAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "distR"}, + Value: fmt.Sprintf("%v", *m.DistRAttr)}) + } + e.EncodeToken(start) + sewrapPolygon := xml.StartElement{Name: xml.Name{Local: "wp:wrapPolygon"}} + e.EncodeElement(m.WrapPolygon, sewrapPolygon) + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *WdCT_WrapTight) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.WrapTextAttr = WdST_WrapText(1) + m.WrapPolygon = NewWdCT_WrapPath() + for _, attr := range start.Attr { + if attr.Name.Local == "wrapText" { + m.WrapTextAttr.UnmarshalXMLAttr(attr) + continue + } + if attr.Name.Local == "distL" { + parsed, err := strconv.ParseUint(attr.Value, 10, 32) + if err != nil { + return err + } + pt := uint32(parsed) + m.DistLAttr = &pt + continue + } + if attr.Name.Local == "distR" { + parsed, err := strconv.ParseUint(attr.Value, 10, 32) + if err != nil { + return err + } + pt := uint32(parsed) + m.DistRAttr = &pt + continue + } + } +lWdCT_WrapTight: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "wrapPolygon"}: + if err := d.DecodeElement(m.WrapPolygon, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on WdCT_WrapTight %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lWdCT_WrapTight + case xml.CharData: + } + } + return nil +} + +// Validate validates the WdCT_WrapTight and its children +func (m *WdCT_WrapTight) Validate() error { + return m.ValidateWithPath("WdCT_WrapTight") +} + +// ValidateWithPath validates the WdCT_WrapTight and its children, prefixing error messages with path +func (m *WdCT_WrapTight) ValidateWithPath(path string) error { + if m.WrapTextAttr == WdST_WrapTextUnset { + return fmt.Errorf("%s/WrapTextAttr is a mandatory field", path) + } + if err := m.WrapTextAttr.ValidateWithPath(path + "/WrapTextAttr"); err != nil { + return err + } + if err := m.WrapPolygon.ValidateWithPath(path + "/WrapPolygon"); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WrapTopBottom.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WrapTopBottom.go new file mode 100644 index 00000000..d559fb6f --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdCT_WrapTopBottom.go @@ -0,0 +1,112 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "strconv" + + "baliance.com/gooxml" +) + +type WdCT_WrapTopBottom struct { + DistTAttr *uint32 + DistBAttr *uint32 + EffectExtent *WdCT_EffectExtent +} + +func NewWdCT_WrapTopBottom() *WdCT_WrapTopBottom { + ret := &WdCT_WrapTopBottom{} + return ret +} + +func (m *WdCT_WrapTopBottom) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.DistTAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "distT"}, + Value: fmt.Sprintf("%v", *m.DistTAttr)}) + } + if m.DistBAttr != nil { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "distB"}, + Value: fmt.Sprintf("%v", *m.DistBAttr)}) + } + e.EncodeToken(start) + if m.EffectExtent != nil { + seeffectExtent := xml.StartElement{Name: xml.Name{Local: "wp:effectExtent"}} + e.EncodeElement(m.EffectExtent, seeffectExtent) + } + e.EncodeToken(xml.EndElement{Name: start.Name}) + return nil +} + +func (m *WdCT_WrapTopBottom) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + for _, attr := range start.Attr { + if attr.Name.Local == "distT" { + parsed, err := strconv.ParseUint(attr.Value, 10, 32) + if err != nil { + return err + } + pt := uint32(parsed) + m.DistTAttr = &pt + continue + } + if attr.Name.Local == "distB" { + parsed, err := strconv.ParseUint(attr.Value, 10, 32) + if err != nil { + return err + } + pt := uint32(parsed) + m.DistBAttr = &pt + continue + } + } +lWdCT_WrapTopBottom: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "effectExtent"}: + m.EffectExtent = NewWdCT_EffectExtent() + if err := d.DecodeElement(m.EffectExtent, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on WdCT_WrapTopBottom %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lWdCT_WrapTopBottom + case xml.CharData: + } + } + return nil +} + +// Validate validates the WdCT_WrapTopBottom and its children +func (m *WdCT_WrapTopBottom) Validate() error { + return m.ValidateWithPath("WdCT_WrapTopBottom") +} + +// ValidateWithPath validates the WdCT_WrapTopBottom and its children, prefixing error messages with path +func (m *WdCT_WrapTopBottom) ValidateWithPath(path string) error { + if m.EffectExtent != nil { + if err := m.EffectExtent.ValidateWithPath(path + "/EffectExtent"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdEG_WrapType.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdEG_WrapType.go new file mode 100644 index 00000000..09f8f940 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdEG_WrapType.go @@ -0,0 +1,97 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type WdEG_WrapType struct { + Choice *WdEG_WrapTypeChoice +} + +func NewWdEG_WrapType() *WdEG_WrapType { + ret := &WdEG_WrapType{} + return ret +} + +func (m *WdEG_WrapType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.Choice != nil { + m.Choice.MarshalXML(e, xml.StartElement{}) + } + return nil +} + +func (m *WdEG_WrapType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lWdEG_WrapType: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "wrapNone"}: + m.Choice = NewWdEG_WrapTypeChoice() + if err := d.DecodeElement(&m.Choice.WrapNone, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "wrapSquare"}: + m.Choice = NewWdEG_WrapTypeChoice() + if err := d.DecodeElement(&m.Choice.WrapSquare, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "wrapTight"}: + m.Choice = NewWdEG_WrapTypeChoice() + if err := d.DecodeElement(&m.Choice.WrapTight, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "wrapThrough"}: + m.Choice = NewWdEG_WrapTypeChoice() + if err := d.DecodeElement(&m.Choice.WrapThrough, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "wrapTopAndBottom"}: + m.Choice = NewWdEG_WrapTypeChoice() + if err := d.DecodeElement(&m.Choice.WrapTopAndBottom, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on WdEG_WrapType %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lWdEG_WrapType + case xml.CharData: + } + } + return nil +} + +// Validate validates the WdEG_WrapType and its children +func (m *WdEG_WrapType) Validate() error { + return m.ValidateWithPath("WdEG_WrapType") +} + +// ValidateWithPath validates the WdEG_WrapType and its children, prefixing error messages with path +func (m *WdEG_WrapType) ValidateWithPath(path string) error { + if m.Choice != nil { + if err := m.Choice.ValidateWithPath(path + "/Choice"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdEG_WrapTypeChoice.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdEG_WrapTypeChoice.go new file mode 100644 index 00000000..ed604df2 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdEG_WrapTypeChoice.go @@ -0,0 +1,138 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type WdEG_WrapTypeChoice struct { + WrapNone *WdCT_WrapNone + WrapSquare *WdCT_WrapSquare + WrapTight *WdCT_WrapTight + WrapThrough *WdCT_WrapThrough + WrapTopAndBottom *WdCT_WrapTopBottom +} + +func NewWdEG_WrapTypeChoice() *WdEG_WrapTypeChoice { + ret := &WdEG_WrapTypeChoice{} + return ret +} + +func (m *WdEG_WrapTypeChoice) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if m.WrapNone != nil { + sewrapNone := xml.StartElement{Name: xml.Name{Local: "wp:wrapNone"}} + e.EncodeElement(m.WrapNone, sewrapNone) + } + if m.WrapSquare != nil { + sewrapSquare := xml.StartElement{Name: xml.Name{Local: "wp:wrapSquare"}} + e.EncodeElement(m.WrapSquare, sewrapSquare) + } + if m.WrapTight != nil { + sewrapTight := xml.StartElement{Name: xml.Name{Local: "wp:wrapTight"}} + e.EncodeElement(m.WrapTight, sewrapTight) + } + if m.WrapThrough != nil { + sewrapThrough := xml.StartElement{Name: xml.Name{Local: "wp:wrapThrough"}} + e.EncodeElement(m.WrapThrough, sewrapThrough) + } + if m.WrapTopAndBottom != nil { + sewrapTopAndBottom := xml.StartElement{Name: xml.Name{Local: "wp:wrapTopAndBottom"}} + e.EncodeElement(m.WrapTopAndBottom, sewrapTopAndBottom) + } + return nil +} + +func (m *WdEG_WrapTypeChoice) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default +lWdEG_WrapTypeChoice: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "wrapNone"}: + m.WrapNone = NewWdCT_WrapNone() + if err := d.DecodeElement(m.WrapNone, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "wrapSquare"}: + m.WrapSquare = NewWdCT_WrapSquare() + if err := d.DecodeElement(m.WrapSquare, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "wrapTight"}: + m.WrapTight = NewWdCT_WrapTight() + if err := d.DecodeElement(m.WrapTight, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "wrapThrough"}: + m.WrapThrough = NewWdCT_WrapThrough() + if err := d.DecodeElement(m.WrapThrough, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "wrapTopAndBottom"}: + m.WrapTopAndBottom = NewWdCT_WrapTopBottom() + if err := d.DecodeElement(m.WrapTopAndBottom, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on WdEG_WrapTypeChoice %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lWdEG_WrapTypeChoice + case xml.CharData: + } + } + return nil +} + +// Validate validates the WdEG_WrapTypeChoice and its children +func (m *WdEG_WrapTypeChoice) Validate() error { + return m.ValidateWithPath("WdEG_WrapTypeChoice") +} + +// ValidateWithPath validates the WdEG_WrapTypeChoice and its children, prefixing error messages with path +func (m *WdEG_WrapTypeChoice) ValidateWithPath(path string) error { + if m.WrapNone != nil { + if err := m.WrapNone.ValidateWithPath(path + "/WrapNone"); err != nil { + return err + } + } + if m.WrapSquare != nil { + if err := m.WrapSquare.ValidateWithPath(path + "/WrapSquare"); err != nil { + return err + } + } + if m.WrapTight != nil { + if err := m.WrapTight.ValidateWithPath(path + "/WrapTight"); err != nil { + return err + } + } + if m.WrapThrough != nil { + if err := m.WrapThrough.ValidateWithPath(path + "/WrapThrough"); err != nil { + return err + } + } + if m.WrapTopAndBottom != nil { + if err := m.WrapTopAndBottom.ValidateWithPath(path + "/WrapTopAndBottom"); err != nil { + return err + } + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdInline.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdInline.go new file mode 100644 index 00000000..13e7e00d --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdInline.go @@ -0,0 +1,139 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "strconv" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/dml" +) + +type WdInline struct { + WdCT_Inline +} + +func NewWdInline() *WdInline { + ret := &WdInline{} + ret.WdCT_Inline = *NewWdCT_Inline() + return ret +} + +func (m *WdInline) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:a"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:pic"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/picture"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:r"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/relationships"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:w"}, Value: "http://schemas.openxmlformats.org/wordprocessingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:wp"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:xml"}, Value: "http://www.w3.org/XML/1998/namespace"}) + start.Name.Local = "wp:inline" + return m.WdCT_Inline.MarshalXML(e, start) +} + +func (m *WdInline) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.WdCT_Inline = *NewWdCT_Inline() + for _, attr := range start.Attr { + if attr.Name.Local == "distT" { + parsed, err := strconv.ParseUint(attr.Value, 10, 32) + if err != nil { + return err + } + pt := uint32(parsed) + m.DistTAttr = &pt + continue + } + if attr.Name.Local == "distB" { + parsed, err := strconv.ParseUint(attr.Value, 10, 32) + if err != nil { + return err + } + pt := uint32(parsed) + m.DistBAttr = &pt + continue + } + if attr.Name.Local == "distR" { + parsed, err := strconv.ParseUint(attr.Value, 10, 32) + if err != nil { + return err + } + pt := uint32(parsed) + m.DistRAttr = &pt + continue + } + if attr.Name.Local == "distL" { + parsed, err := strconv.ParseUint(attr.Value, 10, 32) + if err != nil { + return err + } + pt := uint32(parsed) + m.DistLAttr = &pt + continue + } + } +lWdInline: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "extent"}: + if err := d.DecodeElement(m.Extent, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "effectExtent"}: + m.EffectExtent = NewWdCT_EffectExtent() + if err := d.DecodeElement(m.EffectExtent, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "docPr"}: + if err := d.DecodeElement(m.DocPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "cNvGraphicFramePr"}: + m.CNvGraphicFramePr = dml.NewCT_NonVisualGraphicFrameProperties() + if err := d.DecodeElement(m.CNvGraphicFramePr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/main", Local: "graphic"}: + if err := d.DecodeElement(m.Graphic, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on WdInline %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lWdInline + case xml.CharData: + } + } + return nil +} + +// Validate validates the WdInline and its children +func (m *WdInline) Validate() error { + return m.ValidateWithPath("WdInline") +} + +// ValidateWithPath validates the WdInline and its children, prefixing error messages with path +func (m *WdInline) ValidateWithPath(path string) error { + if err := m.WdCT_Inline.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdWgp.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdWgp.go new file mode 100644 index 00000000..10fc98c6 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdWgp.go @@ -0,0 +1,118 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/dml" +) + +type WdWgp struct { + WdCT_WordprocessingGroup +} + +func NewWdWgp() *WdWgp { + ret := &WdWgp{} + ret.WdCT_WordprocessingGroup = *NewWdCT_WordprocessingGroup() + return ret +} + +func (m *WdWgp) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return m.WdCT_WordprocessingGroup.MarshalXML(e, start) +} + +func (m *WdWgp) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.WdCT_WordprocessingGroup = *NewWdCT_WordprocessingGroup() +lWdWgp: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "cNvPr"}: + m.CNvPr = dml.NewCT_NonVisualDrawingProps() + if err := d.DecodeElement(m.CNvPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "cNvGrpSpPr"}: + if err := d.DecodeElement(m.CNvGrpSpPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "grpSpPr"}: + if err := d.DecodeElement(m.GrpSpPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "wsp"}: + tmp := NewWdCT_WordprocessingGroupChoice() + if err := d.DecodeElement(&tmp.Wsp, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "grpSp"}: + tmp := NewWdCT_WordprocessingGroupChoice() + if err := d.DecodeElement(&tmp.GrpSp, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "graphicFrame"}: + tmp := NewWdCT_WordprocessingGroupChoice() + if err := d.DecodeElement(&tmp.GraphicFrame, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/picture", Local: "pic"}: + tmp := NewWdCT_WordprocessingGroupChoice() + if err := d.DecodeElement(&tmp.Pic, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "contentPart"}: + tmp := NewWdCT_WordprocessingGroupChoice() + if err := d.DecodeElement(&tmp.ContentPart, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "extLst"}: + m.ExtLst = dml.NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on WdWgp %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lWdWgp + case xml.CharData: + } + } + return nil +} + +// Validate validates the WdWgp and its children +func (m *WdWgp) Validate() error { + return m.ValidateWithPath("WdWgp") +} + +// ValidateWithPath validates the WdWgp and its children, prefixing error messages with path +func (m *WdWgp) ValidateWithPath(path string) error { + if err := m.WdCT_WordprocessingGroup.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdWpc.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdWpc.go new file mode 100644 index 00000000..b5ef2407 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdWpc.go @@ -0,0 +1,123 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/dml" +) + +type WdWpc struct { + WdCT_WordprocessingCanvas +} + +func NewWdWpc() *WdWpc { + ret := &WdWpc{} + ret.WdCT_WordprocessingCanvas = *NewWdCT_WordprocessingCanvas() + return ret +} + +func (m *WdWpc) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:a"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:pic"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/picture"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:r"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/relationships"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:w"}, Value: "http://schemas.openxmlformats.org/wordprocessingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:wp"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:xml"}, Value: "http://www.w3.org/XML/1998/namespace"}) + start.Name.Local = "wp:wpc" + return m.WdCT_WordprocessingCanvas.MarshalXML(e, start) +} + +func (m *WdWpc) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.WdCT_WordprocessingCanvas = *NewWdCT_WordprocessingCanvas() +lWdWpc: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "bg"}: + m.Bg = dml.NewCT_BackgroundFormatting() + if err := d.DecodeElement(m.Bg, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "whole"}: + m.Whole = dml.NewCT_WholeE2oFormatting() + if err := d.DecodeElement(m.Whole, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "wsp"}: + tmp := NewWdCT_WordprocessingCanvasChoice() + if err := d.DecodeElement(&tmp.Wsp, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/picture", Local: "pic"}: + tmp := NewWdCT_WordprocessingCanvasChoice() + if err := d.DecodeElement(&tmp.Pic, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "contentPart"}: + tmp := NewWdCT_WordprocessingCanvasChoice() + if err := d.DecodeElement(&tmp.ContentPart, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "wgp"}: + tmp := NewWdCT_WordprocessingCanvasChoice() + if err := d.DecodeElement(&tmp.Wgp, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "graphicFrame"}: + tmp := NewWdCT_WordprocessingCanvasChoice() + if err := d.DecodeElement(&tmp.GraphicFrame, &el); err != nil { + return err + } + m.Choice = append(m.Choice, tmp) + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "extLst"}: + m.ExtLst = dml.NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on WdWpc %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lWdWpc + case xml.CharData: + } + } + return nil +} + +// Validate validates the WdWpc and its children +func (m *WdWpc) Validate() error { + return m.ValidateWithPath("WdWpc") +} + +// ValidateWithPath validates the WdWpc and its children, prefixing error messages with path +func (m *WdWpc) ValidateWithPath(path string) error { + if err := m.WdCT_WordprocessingCanvas.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdWsp.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdWsp.go new file mode 100644 index 00000000..0a24c0bc --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WdWsp.go @@ -0,0 +1,124 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "strconv" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/dml" +) + +type WdWsp struct { + WdCT_WordprocessingShape +} + +func NewWdWsp() *WdWsp { + ret := &WdWsp{} + ret.WdCT_WordprocessingShape = *NewWdCT_WordprocessingShape() + return ret +} + +func (m *WdWsp) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return m.WdCT_WordprocessingShape.MarshalXML(e, start) +} + +func (m *WdWsp) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.WdCT_WordprocessingShape = *NewWdCT_WordprocessingShape() + for _, attr := range start.Attr { + if attr.Name.Local == "normalEastAsianFlow" { + parsed, err := strconv.ParseBool(attr.Value) + if err != nil { + return err + } + m.NormalEastAsianFlowAttr = &parsed + continue + } + } +lWdWsp: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "cNvPr"}: + m.CNvPr = dml.NewCT_NonVisualDrawingProps() + if err := d.DecodeElement(m.CNvPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "cNvSpPr"}: + m.Choice = NewWdCT_WordprocessingShapeChoice() + if err := d.DecodeElement(&m.Choice.CNvSpPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "cNvCnPr"}: + m.Choice = NewWdCT_WordprocessingShapeChoice() + if err := d.DecodeElement(&m.Choice.CNvCnPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "spPr"}: + if err := d.DecodeElement(m.SpPr, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "style"}: + m.Style = dml.NewCT_ShapeStyle() + if err := d.DecodeElement(m.Style, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "extLst"}: + m.ExtLst = dml.NewCT_OfficeArtExtensionList() + if err := d.DecodeElement(m.ExtLst, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "txbx"}: + m.WChoice = NewWdCT_WordprocessingShapeChoice1() + if err := d.DecodeElement(&m.WChoice.Txbx, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "linkedTxbx"}: + m.WChoice = NewWdCT_WordprocessingShapeChoice1() + if err := d.DecodeElement(&m.WChoice.LinkedTxbx, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", Local: "bodyPr"}: + if err := d.DecodeElement(m.BodyPr, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on WdWsp %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lWdWsp + case xml.CharData: + } + } + return nil +} + +// Validate validates the WdWsp and its children +func (m *WdWsp) Validate() error { + return m.ValidateWithPath("WdWsp") +} + +// ValidateWithPath validates the WdWsp and its children, prefixing error messages with path +func (m *WdWsp) ValidateWithPath(path string) error { + if err := m.WdCT_WordprocessingShape.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/WebSettings.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WebSettings.go new file mode 100644 index 00000000..077c84bc --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/WebSettings.go @@ -0,0 +1,145 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + + "baliance.com/gooxml" +) + +type WebSettings struct { + CT_WebSettings +} + +func NewWebSettings() *WebSettings { + ret := &WebSettings{} + ret.CT_WebSettings = *NewCT_WebSettings() + return ret +} + +func (m *WebSettings) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns"}, Value: "http://schemas.openxmlformats.org/wordprocessingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:a"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:m"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/math"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:ma"}, Value: "http://schemas.openxmlformats.org/schemaLibrary/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:pic"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/picture"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:r"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/relationships"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:s"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/sharedTypes"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:w"}, Value: "http://schemas.openxmlformats.org/wordprocessingml/2006/main"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:wp"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"}) + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:xml"}, Value: "http://www.w3.org/XML/1998/namespace"}) + start.Name.Local = "w:webSettings" + return m.CT_WebSettings.MarshalXML(e, start) +} + +func (m *WebSettings) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + // initialize to default + m.CT_WebSettings = *NewCT_WebSettings() +lWebSettings: + for { + tok, err := d.Token() + if err != nil { + return err + } + switch el := tok.(type) { + case xml.StartElement: + switch el.Name { + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "frameset"}: + m.Frameset = NewCT_Frameset() + if err := d.DecodeElement(m.Frameset, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "divs"}: + m.Divs = NewCT_Divs() + if err := d.DecodeElement(m.Divs, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "encoding"}: + m.Encoding = NewCT_String() + if err := d.DecodeElement(m.Encoding, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "optimizeForBrowser"}: + m.OptimizeForBrowser = NewCT_OptimizeForBrowser() + if err := d.DecodeElement(m.OptimizeForBrowser, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "relyOnVML"}: + m.RelyOnVML = NewCT_OnOff() + if err := d.DecodeElement(m.RelyOnVML, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "allowPNG"}: + m.AllowPNG = NewCT_OnOff() + if err := d.DecodeElement(m.AllowPNG, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotRelyOnCSS"}: + m.DoNotRelyOnCSS = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotRelyOnCSS, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotSaveAsSingleFile"}: + m.DoNotSaveAsSingleFile = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotSaveAsSingleFile, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotOrganizeInFolder"}: + m.DoNotOrganizeInFolder = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotOrganizeInFolder, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "doNotUseLongFileNames"}: + m.DoNotUseLongFileNames = NewCT_OnOff() + if err := d.DecodeElement(m.DoNotUseLongFileNames, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "pixelsPerInch"}: + m.PixelsPerInch = NewCT_DecimalNumber() + if err := d.DecodeElement(m.PixelsPerInch, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "targetScreenSz"}: + m.TargetScreenSz = NewCT_TargetScreenSz() + if err := d.DecodeElement(m.TargetScreenSz, &el); err != nil { + return err + } + case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "saveSmartTagsAsXml"}: + m.SaveSmartTagsAsXml = NewCT_OnOff() + if err := d.DecodeElement(m.SaveSmartTagsAsXml, &el); err != nil { + return err + } + default: + gooxml.Log("skipping unsupported element on WebSettings %v", el.Name) + if err := d.Skip(); err != nil { + return err + } + } + case xml.EndElement: + break lWebSettings + case xml.CharData: + } + } + return nil +} + +// Validate validates the WebSettings and its children +func (m *WebSettings) Validate() error { + return m.ValidateWithPath("WebSettings") +} + +// ValidateWithPath validates the WebSettings and its children, prefixing error messages with path +func (m *WebSettings) ValidateWithPath(path string) error { + if err := m.CT_WebSettings.ValidateWithPath(path); err != nil { + return err + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/schema/soo/wml/common.go b/backend/vendor/baliance.com/gooxml/schema/soo/wml/common.go new file mode 100644 index 00000000..df7dd5ca --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schema/soo/wml/common.go @@ -0,0 +1,14230 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// DO NOT EDIT: generated by gooxml ECMA-376 generator +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package wml + +import ( + "encoding/xml" + "fmt" + "regexp" + "strconv" + "time" + + "baliance.com/gooxml" + "baliance.com/gooxml/schema/soo/dml" + "baliance.com/gooxml/schema/soo/ofc/sharedTypes" +) + +const ST_TextScalePercentPattern = `0*(600|([0-5]?[0-9]?[0-9]))%` + +var ST_TextScalePercentPatternRe = regexp.MustCompile(ST_TextScalePercentPattern) + +const ST_CnfPattern = `[01]*` + +var ST_CnfPatternRe = regexp.MustCompile(ST_CnfPattern) + +func ParseUnionST_SignedTwipsMeasure(s string) (ST_SignedTwipsMeasure, error) { + r := ST_SignedTwipsMeasure{} + if sharedTypes.ST_UniversalMeasurePatternRe.MatchString(s) { + r.ST_UniversalMeasure = &s + } else { + v, err := strconv.ParseFloat(s, 64) + if err != nil { + return r, fmt.Errorf("parsing %s as int: %s", s, err) + } + r.Int64 = gooxml.Int64(int64(v)) + } + return r, nil +} + +func ParseUnionST_TwipsMeasure(s string) (sharedTypes.ST_TwipsMeasure, error) { + ret := sharedTypes.ST_TwipsMeasure{} + if sharedTypes.ST_PositiveUniversalMeasurePatternRe.MatchString(s) { + ret.ST_PositiveUniversalMeasure = &s + } else { + v, err := strconv.ParseFloat(s, 64) + if err != nil { + return ret, fmt.Errorf("parsing %s as uint: %s", s, err) + } + ret.ST_UnsignedDecimalNumber = gooxml.Uint64(uint64(v)) + } + return ret, nil +} + +func ParseUnionST_OnOff(s string) (sharedTypes.ST_OnOff, error) { + return sharedTypes.ParseUnionST_OnOff(s) +} + +func ParseUnionST_HexColor(s string) (ST_HexColor, error) { + r := ST_HexColor{} + if s == "auto" { + r.ST_HexColorAuto = ST_HexColorAutoAuto + } else { + r.ST_HexColorRGB = &s + } + return r, nil +} + +func ParseStdlibTime(s string) (time.Time, error) { + return time.Time{}, nil +} + +func ParseUnionST_DecimalNumberOrPercent(s string) (ST_DecimalNumberOrPercent, error) { + ret := ST_DecimalNumberOrPercent{} + if sharedTypes.ST_PercentagePatternRe.MatchString(s) { + ret.ST_Percentage = &s + } else { + v, err := strconv.ParseFloat(s, 64) + if err != nil { + return ret, fmt.Errorf("parsing %s as int: %s", s, err) + } + ret.ST_UnqualifiedPercentage = gooxml.Int64(int64(v)) + } + return ret, nil +} + +func ParseUnionST_MeasurementOrPercent(s string) (ST_MeasurementOrPercent, error) { + r := ST_MeasurementOrPercent{} + if sharedTypes.ST_UniversalMeasurePatternRe.MatchString(s) { + r.ST_UniversalMeasure = &s + } else { + r.ST_DecimalNumberOrPercent = &ST_DecimalNumberOrPercent{} + if sharedTypes.ST_PercentagePatternRe.MatchString(s) { + r.ST_DecimalNumberOrPercent.ST_Percentage = &s + } else { + v, err := strconv.ParseFloat(s, 64) + if err != nil { + return r, fmt.Errorf("parsing %s as int: %s", s, err) + } + r.ST_DecimalNumberOrPercent.ST_UnqualifiedPercentage = gooxml.Int64(int64(v)) + } + } + return r, nil +} + +func ParseUnionST_HpsMeasure(s string) (ST_HpsMeasure, error) { + r := ST_HpsMeasure{} + + if sharedTypes.ST_PositiveUniversalMeasurePatternRe.MatchString(s) { + r.ST_PositiveUniversalMeasure = &s + } else { + v, err := strconv.ParseFloat(s, 64) + if err != nil { + return r, fmt.Errorf("parsing %s as uint: %s", s, err) + } + r.ST_UnsignedDecimalNumber = gooxml.Uint64(uint64(v)) + } + return r, nil +} + +func ParseUnionST_SignedHpsMeasure(s string) (ST_SignedHpsMeasure, error) { + r := ST_SignedHpsMeasure{} + if sharedTypes.ST_UniversalMeasurePatternRe.MatchString(s) { + r.ST_UniversalMeasure = &s + } else { + v, err := strconv.ParseFloat(s, 64) + if err != nil { + return r, fmt.Errorf("parsing %s as int: %s", s, err) + } + r.Int64 = gooxml.Int64(int64(v)) + } + return r, nil +} + +func ParseUnionST_TextScale(s string) (ST_TextScale, error) { + r := ST_TextScale{} + if ST_TextScalePercentPatternRe.MatchString(s) { + r.ST_TextScalePercent = &s + } else { + v, err := strconv.ParseFloat(s, 64) + if err != nil { + return r, fmt.Errorf("parsing %s as int: %s", s, err) + } + r.ST_TextScaleDecimal = gooxml.Int64(int64(v)) + } + return r, nil +} + +func ParseUnionST_Coordinate(s string) (dml.ST_Coordinate, error) { + return dml.ParseUnionST_Coordinate(s) +} + +func b2i(b bool) uint8 { + if b { + return 1 + } + return 0 +} + +type ST_HighlightColor byte + +const ( + ST_HighlightColorUnset ST_HighlightColor = 0 + ST_HighlightColorBlack ST_HighlightColor = 1 + ST_HighlightColorBlue ST_HighlightColor = 2 + ST_HighlightColorCyan ST_HighlightColor = 3 + ST_HighlightColorGreen ST_HighlightColor = 4 + ST_HighlightColorMagenta ST_HighlightColor = 5 + ST_HighlightColorRed ST_HighlightColor = 6 + ST_HighlightColorYellow ST_HighlightColor = 7 + ST_HighlightColorWhite ST_HighlightColor = 8 + ST_HighlightColorDarkBlue ST_HighlightColor = 9 + ST_HighlightColorDarkCyan ST_HighlightColor = 10 + ST_HighlightColorDarkGreen ST_HighlightColor = 11 + ST_HighlightColorDarkMagenta ST_HighlightColor = 12 + ST_HighlightColorDarkRed ST_HighlightColor = 13 + ST_HighlightColorDarkYellow ST_HighlightColor = 14 + ST_HighlightColorDarkGray ST_HighlightColor = 15 + ST_HighlightColorLightGray ST_HighlightColor = 16 + ST_HighlightColorNone ST_HighlightColor = 17 +) + +func (e ST_HighlightColor) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_HighlightColorUnset: + attr.Value = "" + case ST_HighlightColorBlack: + attr.Value = "black" + case ST_HighlightColorBlue: + attr.Value = "blue" + case ST_HighlightColorCyan: + attr.Value = "cyan" + case ST_HighlightColorGreen: + attr.Value = "green" + case ST_HighlightColorMagenta: + attr.Value = "magenta" + case ST_HighlightColorRed: + attr.Value = "red" + case ST_HighlightColorYellow: + attr.Value = "yellow" + case ST_HighlightColorWhite: + attr.Value = "white" + case ST_HighlightColorDarkBlue: + attr.Value = "darkBlue" + case ST_HighlightColorDarkCyan: + attr.Value = "darkCyan" + case ST_HighlightColorDarkGreen: + attr.Value = "darkGreen" + case ST_HighlightColorDarkMagenta: + attr.Value = "darkMagenta" + case ST_HighlightColorDarkRed: + attr.Value = "darkRed" + case ST_HighlightColorDarkYellow: + attr.Value = "darkYellow" + case ST_HighlightColorDarkGray: + attr.Value = "darkGray" + case ST_HighlightColorLightGray: + attr.Value = "lightGray" + case ST_HighlightColorNone: + attr.Value = "none" + } + return attr, nil +} + +func (e *ST_HighlightColor) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "black": + *e = 1 + case "blue": + *e = 2 + case "cyan": + *e = 3 + case "green": + *e = 4 + case "magenta": + *e = 5 + case "red": + *e = 6 + case "yellow": + *e = 7 + case "white": + *e = 8 + case "darkBlue": + *e = 9 + case "darkCyan": + *e = 10 + case "darkGreen": + *e = 11 + case "darkMagenta": + *e = 12 + case "darkRed": + *e = 13 + case "darkYellow": + *e = 14 + case "darkGray": + *e = 15 + case "lightGray": + *e = 16 + case "none": + *e = 17 + } + return nil +} + +func (m ST_HighlightColor) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_HighlightColor) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "black": + *m = 1 + case "blue": + *m = 2 + case "cyan": + *m = 3 + case "green": + *m = 4 + case "magenta": + *m = 5 + case "red": + *m = 6 + case "yellow": + *m = 7 + case "white": + *m = 8 + case "darkBlue": + *m = 9 + case "darkCyan": + *m = 10 + case "darkGreen": + *m = 11 + case "darkMagenta": + *m = 12 + case "darkRed": + *m = 13 + case "darkYellow": + *m = 14 + case "darkGray": + *m = 15 + case "lightGray": + *m = 16 + case "none": + *m = 17 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_HighlightColor) String() string { + switch m { + case 0: + return "" + case 1: + return "black" + case 2: + return "blue" + case 3: + return "cyan" + case 4: + return "green" + case 5: + return "magenta" + case 6: + return "red" + case 7: + return "yellow" + case 8: + return "white" + case 9: + return "darkBlue" + case 10: + return "darkCyan" + case 11: + return "darkGreen" + case 12: + return "darkMagenta" + case 13: + return "darkRed" + case 14: + return "darkYellow" + case 15: + return "darkGray" + case 16: + return "lightGray" + case 17: + return "none" + } + return "" +} + +func (m ST_HighlightColor) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_HighlightColor) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_HexColorAuto byte + +const ( + ST_HexColorAutoUnset ST_HexColorAuto = 0 + ST_HexColorAutoAuto ST_HexColorAuto = 1 +) + +func (e ST_HexColorAuto) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_HexColorAutoUnset: + attr.Value = "" + case ST_HexColorAutoAuto: + attr.Value = "auto" + } + return attr, nil +} + +func (e *ST_HexColorAuto) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "auto": + *e = 1 + } + return nil +} + +func (m ST_HexColorAuto) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_HexColorAuto) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "auto": + *m = 1 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_HexColorAuto) String() string { + switch m { + case 0: + return "" + case 1: + return "auto" + } + return "" +} + +func (m ST_HexColorAuto) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_HexColorAuto) ValidateWithPath(path string) error { + switch m { + case 0, 1: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_Underline byte + +const ( + ST_UnderlineUnset ST_Underline = 0 + ST_UnderlineSingle ST_Underline = 1 + ST_UnderlineWords ST_Underline = 2 + ST_UnderlineDouble ST_Underline = 3 + ST_UnderlineThick ST_Underline = 4 + ST_UnderlineDotted ST_Underline = 5 + ST_UnderlineDottedHeavy ST_Underline = 6 + ST_UnderlineDash ST_Underline = 7 + ST_UnderlineDashedHeavy ST_Underline = 8 + ST_UnderlineDashLong ST_Underline = 9 + ST_UnderlineDashLongHeavy ST_Underline = 10 + ST_UnderlineDotDash ST_Underline = 11 + ST_UnderlineDashDotHeavy ST_Underline = 12 + ST_UnderlineDotDotDash ST_Underline = 13 + ST_UnderlineDashDotDotHeavy ST_Underline = 14 + ST_UnderlineWave ST_Underline = 15 + ST_UnderlineWavyHeavy ST_Underline = 16 + ST_UnderlineWavyDouble ST_Underline = 17 + ST_UnderlineNone ST_Underline = 18 +) + +func (e ST_Underline) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_UnderlineUnset: + attr.Value = "" + case ST_UnderlineSingle: + attr.Value = "single" + case ST_UnderlineWords: + attr.Value = "words" + case ST_UnderlineDouble: + attr.Value = "double" + case ST_UnderlineThick: + attr.Value = "thick" + case ST_UnderlineDotted: + attr.Value = "dotted" + case ST_UnderlineDottedHeavy: + attr.Value = "dottedHeavy" + case ST_UnderlineDash: + attr.Value = "dash" + case ST_UnderlineDashedHeavy: + attr.Value = "dashedHeavy" + case ST_UnderlineDashLong: + attr.Value = "dashLong" + case ST_UnderlineDashLongHeavy: + attr.Value = "dashLongHeavy" + case ST_UnderlineDotDash: + attr.Value = "dotDash" + case ST_UnderlineDashDotHeavy: + attr.Value = "dashDotHeavy" + case ST_UnderlineDotDotDash: + attr.Value = "dotDotDash" + case ST_UnderlineDashDotDotHeavy: + attr.Value = "dashDotDotHeavy" + case ST_UnderlineWave: + attr.Value = "wave" + case ST_UnderlineWavyHeavy: + attr.Value = "wavyHeavy" + case ST_UnderlineWavyDouble: + attr.Value = "wavyDouble" + case ST_UnderlineNone: + attr.Value = "none" + } + return attr, nil +} + +func (e *ST_Underline) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "single": + *e = 1 + case "words": + *e = 2 + case "double": + *e = 3 + case "thick": + *e = 4 + case "dotted": + *e = 5 + case "dottedHeavy": + *e = 6 + case "dash": + *e = 7 + case "dashedHeavy": + *e = 8 + case "dashLong": + *e = 9 + case "dashLongHeavy": + *e = 10 + case "dotDash": + *e = 11 + case "dashDotHeavy": + *e = 12 + case "dotDotDash": + *e = 13 + case "dashDotDotHeavy": + *e = 14 + case "wave": + *e = 15 + case "wavyHeavy": + *e = 16 + case "wavyDouble": + *e = 17 + case "none": + *e = 18 + } + return nil +} + +func (m ST_Underline) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_Underline) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "single": + *m = 1 + case "words": + *m = 2 + case "double": + *m = 3 + case "thick": + *m = 4 + case "dotted": + *m = 5 + case "dottedHeavy": + *m = 6 + case "dash": + *m = 7 + case "dashedHeavy": + *m = 8 + case "dashLong": + *m = 9 + case "dashLongHeavy": + *m = 10 + case "dotDash": + *m = 11 + case "dashDotHeavy": + *m = 12 + case "dotDotDash": + *m = 13 + case "dashDotDotHeavy": + *m = 14 + case "wave": + *m = 15 + case "wavyHeavy": + *m = 16 + case "wavyDouble": + *m = 17 + case "none": + *m = 18 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_Underline) String() string { + switch m { + case 0: + return "" + case 1: + return "single" + case 2: + return "words" + case 3: + return "double" + case 4: + return "thick" + case 5: + return "dotted" + case 6: + return "dottedHeavy" + case 7: + return "dash" + case 8: + return "dashedHeavy" + case 9: + return "dashLong" + case 10: + return "dashLongHeavy" + case 11: + return "dotDash" + case 12: + return "dashDotHeavy" + case 13: + return "dotDotDash" + case 14: + return "dashDotDotHeavy" + case 15: + return "wave" + case 16: + return "wavyHeavy" + case 17: + return "wavyDouble" + case 18: + return "none" + } + return "" +} + +func (m ST_Underline) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_Underline) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_TextEffect byte + +const ( + ST_TextEffectUnset ST_TextEffect = 0 + ST_TextEffectBlinkBackground ST_TextEffect = 1 + ST_TextEffectLights ST_TextEffect = 2 + ST_TextEffectAntsBlack ST_TextEffect = 3 + ST_TextEffectAntsRed ST_TextEffect = 4 + ST_TextEffectShimmer ST_TextEffect = 5 + ST_TextEffectSparkle ST_TextEffect = 6 + ST_TextEffectNone ST_TextEffect = 7 +) + +func (e ST_TextEffect) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_TextEffectUnset: + attr.Value = "" + case ST_TextEffectBlinkBackground: + attr.Value = "blinkBackground" + case ST_TextEffectLights: + attr.Value = "lights" + case ST_TextEffectAntsBlack: + attr.Value = "antsBlack" + case ST_TextEffectAntsRed: + attr.Value = "antsRed" + case ST_TextEffectShimmer: + attr.Value = "shimmer" + case ST_TextEffectSparkle: + attr.Value = "sparkle" + case ST_TextEffectNone: + attr.Value = "none" + } + return attr, nil +} + +func (e *ST_TextEffect) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "blinkBackground": + *e = 1 + case "lights": + *e = 2 + case "antsBlack": + *e = 3 + case "antsRed": + *e = 4 + case "shimmer": + *e = 5 + case "sparkle": + *e = 6 + case "none": + *e = 7 + } + return nil +} + +func (m ST_TextEffect) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_TextEffect) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "blinkBackground": + *m = 1 + case "lights": + *m = 2 + case "antsBlack": + *m = 3 + case "antsRed": + *m = 4 + case "shimmer": + *m = 5 + case "sparkle": + *m = 6 + case "none": + *m = 7 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_TextEffect) String() string { + switch m { + case 0: + return "" + case 1: + return "blinkBackground" + case 2: + return "lights" + case 3: + return "antsBlack" + case 4: + return "antsRed" + case 5: + return "shimmer" + case 6: + return "sparkle" + case 7: + return "none" + } + return "" +} + +func (m ST_TextEffect) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_TextEffect) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_Border byte + +const ( + ST_BorderUnset ST_Border = 0 + ST_BorderNil ST_Border = 1 + ST_BorderNone ST_Border = 2 + ST_BorderSingle ST_Border = 3 + ST_BorderThick ST_Border = 4 + ST_BorderDouble ST_Border = 5 + ST_BorderDotted ST_Border = 6 + ST_BorderDashed ST_Border = 7 + ST_BorderDotDash ST_Border = 8 + ST_BorderDotDotDash ST_Border = 9 + ST_BorderTriple ST_Border = 10 + ST_BorderThinThickSmallGap ST_Border = 11 + ST_BorderThickThinSmallGap ST_Border = 12 + ST_BorderThinThickThinSmallGap ST_Border = 13 + ST_BorderThinThickMediumGap ST_Border = 14 + ST_BorderThickThinMediumGap ST_Border = 15 + ST_BorderThinThickThinMediumGap ST_Border = 16 + ST_BorderThinThickLargeGap ST_Border = 17 + ST_BorderThickThinLargeGap ST_Border = 18 + ST_BorderThinThickThinLargeGap ST_Border = 19 + ST_BorderWave ST_Border = 20 + ST_BorderDoubleWave ST_Border = 21 + ST_BorderDashSmallGap ST_Border = 22 + ST_BorderDashDotStroked ST_Border = 23 + ST_BorderThreeDEmboss ST_Border = 24 + ST_BorderThreeDEngrave ST_Border = 25 + ST_BorderOutset ST_Border = 26 + ST_BorderInset ST_Border = 27 + ST_BorderApples ST_Border = 28 + ST_BorderArchedScallops ST_Border = 29 + ST_BorderBabyPacifier ST_Border = 30 + ST_BorderBabyRattle ST_Border = 31 + ST_BorderBalloons3Colors ST_Border = 32 + ST_BorderBalloonsHotAir ST_Border = 33 + ST_BorderBasicBlackDashes ST_Border = 34 + ST_BorderBasicBlackDots ST_Border = 35 + ST_BorderBasicBlackSquares ST_Border = 36 + ST_BorderBasicThinLines ST_Border = 37 + ST_BorderBasicWhiteDashes ST_Border = 38 + ST_BorderBasicWhiteDots ST_Border = 39 + ST_BorderBasicWhiteSquares ST_Border = 40 + ST_BorderBasicWideInline ST_Border = 41 + ST_BorderBasicWideMidline ST_Border = 42 + ST_BorderBasicWideOutline ST_Border = 43 + ST_BorderBats ST_Border = 44 + ST_BorderBirds ST_Border = 45 + ST_BorderBirdsFlight ST_Border = 46 + ST_BorderCabins ST_Border = 47 + ST_BorderCakeSlice ST_Border = 48 + ST_BorderCandyCorn ST_Border = 49 + ST_BorderCelticKnotwork ST_Border = 50 + ST_BorderCertificateBanner ST_Border = 51 + ST_BorderChainLink ST_Border = 52 + ST_BorderChampagneBottle ST_Border = 53 + ST_BorderCheckedBarBlack ST_Border = 54 + ST_BorderCheckedBarColor ST_Border = 55 + ST_BorderCheckered ST_Border = 56 + ST_BorderChristmasTree ST_Border = 57 + ST_BorderCirclesLines ST_Border = 58 + ST_BorderCirclesRectangles ST_Border = 59 + ST_BorderClassicalWave ST_Border = 60 + ST_BorderClocks ST_Border = 61 + ST_BorderCompass ST_Border = 62 + ST_BorderConfetti ST_Border = 63 + ST_BorderConfettiGrays ST_Border = 64 + ST_BorderConfettiOutline ST_Border = 65 + ST_BorderConfettiStreamers ST_Border = 66 + ST_BorderConfettiWhite ST_Border = 67 + ST_BorderCornerTriangles ST_Border = 68 + ST_BorderCouponCutoutDashes ST_Border = 69 + ST_BorderCouponCutoutDots ST_Border = 70 + ST_BorderCrazyMaze ST_Border = 71 + ST_BorderCreaturesButterfly ST_Border = 72 + ST_BorderCreaturesFish ST_Border = 73 + ST_BorderCreaturesInsects ST_Border = 74 + ST_BorderCreaturesLadyBug ST_Border = 75 + ST_BorderCrossStitch ST_Border = 76 + ST_BorderCup ST_Border = 77 + ST_BorderDecoArch ST_Border = 78 + ST_BorderDecoArchColor ST_Border = 79 + ST_BorderDecoBlocks ST_Border = 80 + ST_BorderDiamondsGray ST_Border = 81 + ST_BorderDoubleD ST_Border = 82 + ST_BorderDoubleDiamonds ST_Border = 83 + ST_BorderEarth1 ST_Border = 84 + ST_BorderEarth2 ST_Border = 85 + ST_BorderEarth3 ST_Border = 86 + ST_BorderEclipsingSquares1 ST_Border = 87 + ST_BorderEclipsingSquares2 ST_Border = 88 + ST_BorderEggsBlack ST_Border = 89 + ST_BorderFans ST_Border = 90 + ST_BorderFilm ST_Border = 91 + ST_BorderFirecrackers ST_Border = 92 + ST_BorderFlowersBlockPrint ST_Border = 93 + ST_BorderFlowersDaisies ST_Border = 94 + ST_BorderFlowersModern1 ST_Border = 95 + ST_BorderFlowersModern2 ST_Border = 96 + ST_BorderFlowersPansy ST_Border = 97 + ST_BorderFlowersRedRose ST_Border = 98 + ST_BorderFlowersRoses ST_Border = 99 + ST_BorderFlowersTeacup ST_Border = 100 + ST_BorderFlowersTiny ST_Border = 101 + ST_BorderGems ST_Border = 102 + ST_BorderGingerbreadMan ST_Border = 103 + ST_BorderGradient ST_Border = 104 + ST_BorderHandmade1 ST_Border = 105 + ST_BorderHandmade2 ST_Border = 106 + ST_BorderHeartBalloon ST_Border = 107 + ST_BorderHeartGray ST_Border = 108 + ST_BorderHearts ST_Border = 109 + ST_BorderHeebieJeebies ST_Border = 110 + ST_BorderHolly ST_Border = 111 + ST_BorderHouseFunky ST_Border = 112 + ST_BorderHypnotic ST_Border = 113 + ST_BorderIceCreamCones ST_Border = 114 + ST_BorderLightBulb ST_Border = 115 + ST_BorderLightning1 ST_Border = 116 + ST_BorderLightning2 ST_Border = 117 + ST_BorderMapPins ST_Border = 118 + ST_BorderMapleLeaf ST_Border = 119 + ST_BorderMapleMuffins ST_Border = 120 + ST_BorderMarquee ST_Border = 121 + ST_BorderMarqueeToothed ST_Border = 122 + ST_BorderMoons ST_Border = 123 + ST_BorderMosaic ST_Border = 124 + ST_BorderMusicNotes ST_Border = 125 + ST_BorderNorthwest ST_Border = 126 + ST_BorderOvals ST_Border = 127 + ST_BorderPackages ST_Border = 128 + ST_BorderPalmsBlack ST_Border = 129 + ST_BorderPalmsColor ST_Border = 130 + ST_BorderPaperClips ST_Border = 131 + ST_BorderPapyrus ST_Border = 132 + ST_BorderPartyFavor ST_Border = 133 + ST_BorderPartyGlass ST_Border = 134 + ST_BorderPencils ST_Border = 135 + ST_BorderPeople ST_Border = 136 + ST_BorderPeopleWaving ST_Border = 137 + ST_BorderPeopleHats ST_Border = 138 + ST_BorderPoinsettias ST_Border = 139 + ST_BorderPostageStamp ST_Border = 140 + ST_BorderPumpkin1 ST_Border = 141 + ST_BorderPushPinNote2 ST_Border = 142 + ST_BorderPushPinNote1 ST_Border = 143 + ST_BorderPyramids ST_Border = 144 + ST_BorderPyramidsAbove ST_Border = 145 + ST_BorderQuadrants ST_Border = 146 + ST_BorderRings ST_Border = 147 + ST_BorderSafari ST_Border = 148 + ST_BorderSawtooth ST_Border = 149 + ST_BorderSawtoothGray ST_Border = 150 + ST_BorderScaredCat ST_Border = 151 + ST_BorderSeattle ST_Border = 152 + ST_BorderShadowedSquares ST_Border = 153 + ST_BorderSharksTeeth ST_Border = 154 + ST_BorderShorebirdTracks ST_Border = 155 + ST_BorderSkyrocket ST_Border = 156 + ST_BorderSnowflakeFancy ST_Border = 157 + ST_BorderSnowflakes ST_Border = 158 + ST_BorderSombrero ST_Border = 159 + ST_BorderSouthwest ST_Border = 160 + ST_BorderStars ST_Border = 161 + ST_BorderStarsTop ST_Border = 162 + ST_BorderStars3d ST_Border = 163 + ST_BorderStarsBlack ST_Border = 164 + ST_BorderStarsShadowed ST_Border = 165 + ST_BorderSun ST_Border = 166 + ST_BorderSwirligig ST_Border = 167 + ST_BorderTornPaper ST_Border = 168 + ST_BorderTornPaperBlack ST_Border = 169 + ST_BorderTrees ST_Border = 170 + ST_BorderTriangleParty ST_Border = 171 + ST_BorderTriangles ST_Border = 172 + ST_BorderTriangle1 ST_Border = 173 + ST_BorderTriangle2 ST_Border = 174 + ST_BorderTriangleCircle1 ST_Border = 175 + ST_BorderTriangleCircle2 ST_Border = 176 + ST_BorderShapes1 ST_Border = 177 + ST_BorderShapes2 ST_Border = 178 + ST_BorderTwistedLines1 ST_Border = 179 + ST_BorderTwistedLines2 ST_Border = 180 + ST_BorderVine ST_Border = 181 + ST_BorderWaveline ST_Border = 182 + ST_BorderWeavingAngles ST_Border = 183 + ST_BorderWeavingBraid ST_Border = 184 + ST_BorderWeavingRibbon ST_Border = 185 + ST_BorderWeavingStrips ST_Border = 186 + ST_BorderWhiteFlowers ST_Border = 187 + ST_BorderWoodwork ST_Border = 188 + ST_BorderXIllusions ST_Border = 189 + ST_BorderZanyTriangles ST_Border = 190 + ST_BorderZigZag ST_Border = 191 + ST_BorderZigZagStitch ST_Border = 192 + ST_BorderCustom ST_Border = 193 +) + +func (e ST_Border) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_BorderUnset: + attr.Value = "" + case ST_BorderNil: + attr.Value = "nil" + case ST_BorderNone: + attr.Value = "none" + case ST_BorderSingle: + attr.Value = "single" + case ST_BorderThick: + attr.Value = "thick" + case ST_BorderDouble: + attr.Value = "double" + case ST_BorderDotted: + attr.Value = "dotted" + case ST_BorderDashed: + attr.Value = "dashed" + case ST_BorderDotDash: + attr.Value = "dotDash" + case ST_BorderDotDotDash: + attr.Value = "dotDotDash" + case ST_BorderTriple: + attr.Value = "triple" + case ST_BorderThinThickSmallGap: + attr.Value = "thinThickSmallGap" + case ST_BorderThickThinSmallGap: + attr.Value = "thickThinSmallGap" + case ST_BorderThinThickThinSmallGap: + attr.Value = "thinThickThinSmallGap" + case ST_BorderThinThickMediumGap: + attr.Value = "thinThickMediumGap" + case ST_BorderThickThinMediumGap: + attr.Value = "thickThinMediumGap" + case ST_BorderThinThickThinMediumGap: + attr.Value = "thinThickThinMediumGap" + case ST_BorderThinThickLargeGap: + attr.Value = "thinThickLargeGap" + case ST_BorderThickThinLargeGap: + attr.Value = "thickThinLargeGap" + case ST_BorderThinThickThinLargeGap: + attr.Value = "thinThickThinLargeGap" + case ST_BorderWave: + attr.Value = "wave" + case ST_BorderDoubleWave: + attr.Value = "doubleWave" + case ST_BorderDashSmallGap: + attr.Value = "dashSmallGap" + case ST_BorderDashDotStroked: + attr.Value = "dashDotStroked" + case ST_BorderThreeDEmboss: + attr.Value = "threeDEmboss" + case ST_BorderThreeDEngrave: + attr.Value = "threeDEngrave" + case ST_BorderOutset: + attr.Value = "outset" + case ST_BorderInset: + attr.Value = "inset" + case ST_BorderApples: + attr.Value = "apples" + case ST_BorderArchedScallops: + attr.Value = "archedScallops" + case ST_BorderBabyPacifier: + attr.Value = "babyPacifier" + case ST_BorderBabyRattle: + attr.Value = "babyRattle" + case ST_BorderBalloons3Colors: + attr.Value = "balloons3Colors" + case ST_BorderBalloonsHotAir: + attr.Value = "balloonsHotAir" + case ST_BorderBasicBlackDashes: + attr.Value = "basicBlackDashes" + case ST_BorderBasicBlackDots: + attr.Value = "basicBlackDots" + case ST_BorderBasicBlackSquares: + attr.Value = "basicBlackSquares" + case ST_BorderBasicThinLines: + attr.Value = "basicThinLines" + case ST_BorderBasicWhiteDashes: + attr.Value = "basicWhiteDashes" + case ST_BorderBasicWhiteDots: + attr.Value = "basicWhiteDots" + case ST_BorderBasicWhiteSquares: + attr.Value = "basicWhiteSquares" + case ST_BorderBasicWideInline: + attr.Value = "basicWideInline" + case ST_BorderBasicWideMidline: + attr.Value = "basicWideMidline" + case ST_BorderBasicWideOutline: + attr.Value = "basicWideOutline" + case ST_BorderBats: + attr.Value = "bats" + case ST_BorderBirds: + attr.Value = "birds" + case ST_BorderBirdsFlight: + attr.Value = "birdsFlight" + case ST_BorderCabins: + attr.Value = "cabins" + case ST_BorderCakeSlice: + attr.Value = "cakeSlice" + case ST_BorderCandyCorn: + attr.Value = "candyCorn" + case ST_BorderCelticKnotwork: + attr.Value = "celticKnotwork" + case ST_BorderCertificateBanner: + attr.Value = "certificateBanner" + case ST_BorderChainLink: + attr.Value = "chainLink" + case ST_BorderChampagneBottle: + attr.Value = "champagneBottle" + case ST_BorderCheckedBarBlack: + attr.Value = "checkedBarBlack" + case ST_BorderCheckedBarColor: + attr.Value = "checkedBarColor" + case ST_BorderCheckered: + attr.Value = "checkered" + case ST_BorderChristmasTree: + attr.Value = "christmasTree" + case ST_BorderCirclesLines: + attr.Value = "circlesLines" + case ST_BorderCirclesRectangles: + attr.Value = "circlesRectangles" + case ST_BorderClassicalWave: + attr.Value = "classicalWave" + case ST_BorderClocks: + attr.Value = "clocks" + case ST_BorderCompass: + attr.Value = "compass" + case ST_BorderConfetti: + attr.Value = "confetti" + case ST_BorderConfettiGrays: + attr.Value = "confettiGrays" + case ST_BorderConfettiOutline: + attr.Value = "confettiOutline" + case ST_BorderConfettiStreamers: + attr.Value = "confettiStreamers" + case ST_BorderConfettiWhite: + attr.Value = "confettiWhite" + case ST_BorderCornerTriangles: + attr.Value = "cornerTriangles" + case ST_BorderCouponCutoutDashes: + attr.Value = "couponCutoutDashes" + case ST_BorderCouponCutoutDots: + attr.Value = "couponCutoutDots" + case ST_BorderCrazyMaze: + attr.Value = "crazyMaze" + case ST_BorderCreaturesButterfly: + attr.Value = "creaturesButterfly" + case ST_BorderCreaturesFish: + attr.Value = "creaturesFish" + case ST_BorderCreaturesInsects: + attr.Value = "creaturesInsects" + case ST_BorderCreaturesLadyBug: + attr.Value = "creaturesLadyBug" + case ST_BorderCrossStitch: + attr.Value = "crossStitch" + case ST_BorderCup: + attr.Value = "cup" + case ST_BorderDecoArch: + attr.Value = "decoArch" + case ST_BorderDecoArchColor: + attr.Value = "decoArchColor" + case ST_BorderDecoBlocks: + attr.Value = "decoBlocks" + case ST_BorderDiamondsGray: + attr.Value = "diamondsGray" + case ST_BorderDoubleD: + attr.Value = "doubleD" + case ST_BorderDoubleDiamonds: + attr.Value = "doubleDiamonds" + case ST_BorderEarth1: + attr.Value = "earth1" + case ST_BorderEarth2: + attr.Value = "earth2" + case ST_BorderEarth3: + attr.Value = "earth3" + case ST_BorderEclipsingSquares1: + attr.Value = "eclipsingSquares1" + case ST_BorderEclipsingSquares2: + attr.Value = "eclipsingSquares2" + case ST_BorderEggsBlack: + attr.Value = "eggsBlack" + case ST_BorderFans: + attr.Value = "fans" + case ST_BorderFilm: + attr.Value = "film" + case ST_BorderFirecrackers: + attr.Value = "firecrackers" + case ST_BorderFlowersBlockPrint: + attr.Value = "flowersBlockPrint" + case ST_BorderFlowersDaisies: + attr.Value = "flowersDaisies" + case ST_BorderFlowersModern1: + attr.Value = "flowersModern1" + case ST_BorderFlowersModern2: + attr.Value = "flowersModern2" + case ST_BorderFlowersPansy: + attr.Value = "flowersPansy" + case ST_BorderFlowersRedRose: + attr.Value = "flowersRedRose" + case ST_BorderFlowersRoses: + attr.Value = "flowersRoses" + case ST_BorderFlowersTeacup: + attr.Value = "flowersTeacup" + case ST_BorderFlowersTiny: + attr.Value = "flowersTiny" + case ST_BorderGems: + attr.Value = "gems" + case ST_BorderGingerbreadMan: + attr.Value = "gingerbreadMan" + case ST_BorderGradient: + attr.Value = "gradient" + case ST_BorderHandmade1: + attr.Value = "handmade1" + case ST_BorderHandmade2: + attr.Value = "handmade2" + case ST_BorderHeartBalloon: + attr.Value = "heartBalloon" + case ST_BorderHeartGray: + attr.Value = "heartGray" + case ST_BorderHearts: + attr.Value = "hearts" + case ST_BorderHeebieJeebies: + attr.Value = "heebieJeebies" + case ST_BorderHolly: + attr.Value = "holly" + case ST_BorderHouseFunky: + attr.Value = "houseFunky" + case ST_BorderHypnotic: + attr.Value = "hypnotic" + case ST_BorderIceCreamCones: + attr.Value = "iceCreamCones" + case ST_BorderLightBulb: + attr.Value = "lightBulb" + case ST_BorderLightning1: + attr.Value = "lightning1" + case ST_BorderLightning2: + attr.Value = "lightning2" + case ST_BorderMapPins: + attr.Value = "mapPins" + case ST_BorderMapleLeaf: + attr.Value = "mapleLeaf" + case ST_BorderMapleMuffins: + attr.Value = "mapleMuffins" + case ST_BorderMarquee: + attr.Value = "marquee" + case ST_BorderMarqueeToothed: + attr.Value = "marqueeToothed" + case ST_BorderMoons: + attr.Value = "moons" + case ST_BorderMosaic: + attr.Value = "mosaic" + case ST_BorderMusicNotes: + attr.Value = "musicNotes" + case ST_BorderNorthwest: + attr.Value = "northwest" + case ST_BorderOvals: + attr.Value = "ovals" + case ST_BorderPackages: + attr.Value = "packages" + case ST_BorderPalmsBlack: + attr.Value = "palmsBlack" + case ST_BorderPalmsColor: + attr.Value = "palmsColor" + case ST_BorderPaperClips: + attr.Value = "paperClips" + case ST_BorderPapyrus: + attr.Value = "papyrus" + case ST_BorderPartyFavor: + attr.Value = "partyFavor" + case ST_BorderPartyGlass: + attr.Value = "partyGlass" + case ST_BorderPencils: + attr.Value = "pencils" + case ST_BorderPeople: + attr.Value = "people" + case ST_BorderPeopleWaving: + attr.Value = "peopleWaving" + case ST_BorderPeopleHats: + attr.Value = "peopleHats" + case ST_BorderPoinsettias: + attr.Value = "poinsettias" + case ST_BorderPostageStamp: + attr.Value = "postageStamp" + case ST_BorderPumpkin1: + attr.Value = "pumpkin1" + case ST_BorderPushPinNote2: + attr.Value = "pushPinNote2" + case ST_BorderPushPinNote1: + attr.Value = "pushPinNote1" + case ST_BorderPyramids: + attr.Value = "pyramids" + case ST_BorderPyramidsAbove: + attr.Value = "pyramidsAbove" + case ST_BorderQuadrants: + attr.Value = "quadrants" + case ST_BorderRings: + attr.Value = "rings" + case ST_BorderSafari: + attr.Value = "safari" + case ST_BorderSawtooth: + attr.Value = "sawtooth" + case ST_BorderSawtoothGray: + attr.Value = "sawtoothGray" + case ST_BorderScaredCat: + attr.Value = "scaredCat" + case ST_BorderSeattle: + attr.Value = "seattle" + case ST_BorderShadowedSquares: + attr.Value = "shadowedSquares" + case ST_BorderSharksTeeth: + attr.Value = "sharksTeeth" + case ST_BorderShorebirdTracks: + attr.Value = "shorebirdTracks" + case ST_BorderSkyrocket: + attr.Value = "skyrocket" + case ST_BorderSnowflakeFancy: + attr.Value = "snowflakeFancy" + case ST_BorderSnowflakes: + attr.Value = "snowflakes" + case ST_BorderSombrero: + attr.Value = "sombrero" + case ST_BorderSouthwest: + attr.Value = "southwest" + case ST_BorderStars: + attr.Value = "stars" + case ST_BorderStarsTop: + attr.Value = "starsTop" + case ST_BorderStars3d: + attr.Value = "stars3d" + case ST_BorderStarsBlack: + attr.Value = "starsBlack" + case ST_BorderStarsShadowed: + attr.Value = "starsShadowed" + case ST_BorderSun: + attr.Value = "sun" + case ST_BorderSwirligig: + attr.Value = "swirligig" + case ST_BorderTornPaper: + attr.Value = "tornPaper" + case ST_BorderTornPaperBlack: + attr.Value = "tornPaperBlack" + case ST_BorderTrees: + attr.Value = "trees" + case ST_BorderTriangleParty: + attr.Value = "triangleParty" + case ST_BorderTriangles: + attr.Value = "triangles" + case ST_BorderTriangle1: + attr.Value = "triangle1" + case ST_BorderTriangle2: + attr.Value = "triangle2" + case ST_BorderTriangleCircle1: + attr.Value = "triangleCircle1" + case ST_BorderTriangleCircle2: + attr.Value = "triangleCircle2" + case ST_BorderShapes1: + attr.Value = "shapes1" + case ST_BorderShapes2: + attr.Value = "shapes2" + case ST_BorderTwistedLines1: + attr.Value = "twistedLines1" + case ST_BorderTwistedLines2: + attr.Value = "twistedLines2" + case ST_BorderVine: + attr.Value = "vine" + case ST_BorderWaveline: + attr.Value = "waveline" + case ST_BorderWeavingAngles: + attr.Value = "weavingAngles" + case ST_BorderWeavingBraid: + attr.Value = "weavingBraid" + case ST_BorderWeavingRibbon: + attr.Value = "weavingRibbon" + case ST_BorderWeavingStrips: + attr.Value = "weavingStrips" + case ST_BorderWhiteFlowers: + attr.Value = "whiteFlowers" + case ST_BorderWoodwork: + attr.Value = "woodwork" + case ST_BorderXIllusions: + attr.Value = "xIllusions" + case ST_BorderZanyTriangles: + attr.Value = "zanyTriangles" + case ST_BorderZigZag: + attr.Value = "zigZag" + case ST_BorderZigZagStitch: + attr.Value = "zigZagStitch" + case ST_BorderCustom: + attr.Value = "custom" + } + return attr, nil +} + +func (e *ST_Border) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "nil": + *e = 1 + case "none": + *e = 2 + case "single": + *e = 3 + case "thick": + *e = 4 + case "double": + *e = 5 + case "dotted": + *e = 6 + case "dashed": + *e = 7 + case "dotDash": + *e = 8 + case "dotDotDash": + *e = 9 + case "triple": + *e = 10 + case "thinThickSmallGap": + *e = 11 + case "thickThinSmallGap": + *e = 12 + case "thinThickThinSmallGap": + *e = 13 + case "thinThickMediumGap": + *e = 14 + case "thickThinMediumGap": + *e = 15 + case "thinThickThinMediumGap": + *e = 16 + case "thinThickLargeGap": + *e = 17 + case "thickThinLargeGap": + *e = 18 + case "thinThickThinLargeGap": + *e = 19 + case "wave": + *e = 20 + case "doubleWave": + *e = 21 + case "dashSmallGap": + *e = 22 + case "dashDotStroked": + *e = 23 + case "threeDEmboss": + *e = 24 + case "threeDEngrave": + *e = 25 + case "outset": + *e = 26 + case "inset": + *e = 27 + case "apples": + *e = 28 + case "archedScallops": + *e = 29 + case "babyPacifier": + *e = 30 + case "babyRattle": + *e = 31 + case "balloons3Colors": + *e = 32 + case "balloonsHotAir": + *e = 33 + case "basicBlackDashes": + *e = 34 + case "basicBlackDots": + *e = 35 + case "basicBlackSquares": + *e = 36 + case "basicThinLines": + *e = 37 + case "basicWhiteDashes": + *e = 38 + case "basicWhiteDots": + *e = 39 + case "basicWhiteSquares": + *e = 40 + case "basicWideInline": + *e = 41 + case "basicWideMidline": + *e = 42 + case "basicWideOutline": + *e = 43 + case "bats": + *e = 44 + case "birds": + *e = 45 + case "birdsFlight": + *e = 46 + case "cabins": + *e = 47 + case "cakeSlice": + *e = 48 + case "candyCorn": + *e = 49 + case "celticKnotwork": + *e = 50 + case "certificateBanner": + *e = 51 + case "chainLink": + *e = 52 + case "champagneBottle": + *e = 53 + case "checkedBarBlack": + *e = 54 + case "checkedBarColor": + *e = 55 + case "checkered": + *e = 56 + case "christmasTree": + *e = 57 + case "circlesLines": + *e = 58 + case "circlesRectangles": + *e = 59 + case "classicalWave": + *e = 60 + case "clocks": + *e = 61 + case "compass": + *e = 62 + case "confetti": + *e = 63 + case "confettiGrays": + *e = 64 + case "confettiOutline": + *e = 65 + case "confettiStreamers": + *e = 66 + case "confettiWhite": + *e = 67 + case "cornerTriangles": + *e = 68 + case "couponCutoutDashes": + *e = 69 + case "couponCutoutDots": + *e = 70 + case "crazyMaze": + *e = 71 + case "creaturesButterfly": + *e = 72 + case "creaturesFish": + *e = 73 + case "creaturesInsects": + *e = 74 + case "creaturesLadyBug": + *e = 75 + case "crossStitch": + *e = 76 + case "cup": + *e = 77 + case "decoArch": + *e = 78 + case "decoArchColor": + *e = 79 + case "decoBlocks": + *e = 80 + case "diamondsGray": + *e = 81 + case "doubleD": + *e = 82 + case "doubleDiamonds": + *e = 83 + case "earth1": + *e = 84 + case "earth2": + *e = 85 + case "earth3": + *e = 86 + case "eclipsingSquares1": + *e = 87 + case "eclipsingSquares2": + *e = 88 + case "eggsBlack": + *e = 89 + case "fans": + *e = 90 + case "film": + *e = 91 + case "firecrackers": + *e = 92 + case "flowersBlockPrint": + *e = 93 + case "flowersDaisies": + *e = 94 + case "flowersModern1": + *e = 95 + case "flowersModern2": + *e = 96 + case "flowersPansy": + *e = 97 + case "flowersRedRose": + *e = 98 + case "flowersRoses": + *e = 99 + case "flowersTeacup": + *e = 100 + case "flowersTiny": + *e = 101 + case "gems": + *e = 102 + case "gingerbreadMan": + *e = 103 + case "gradient": + *e = 104 + case "handmade1": + *e = 105 + case "handmade2": + *e = 106 + case "heartBalloon": + *e = 107 + case "heartGray": + *e = 108 + case "hearts": + *e = 109 + case "heebieJeebies": + *e = 110 + case "holly": + *e = 111 + case "houseFunky": + *e = 112 + case "hypnotic": + *e = 113 + case "iceCreamCones": + *e = 114 + case "lightBulb": + *e = 115 + case "lightning1": + *e = 116 + case "lightning2": + *e = 117 + case "mapPins": + *e = 118 + case "mapleLeaf": + *e = 119 + case "mapleMuffins": + *e = 120 + case "marquee": + *e = 121 + case "marqueeToothed": + *e = 122 + case "moons": + *e = 123 + case "mosaic": + *e = 124 + case "musicNotes": + *e = 125 + case "northwest": + *e = 126 + case "ovals": + *e = 127 + case "packages": + *e = 128 + case "palmsBlack": + *e = 129 + case "palmsColor": + *e = 130 + case "paperClips": + *e = 131 + case "papyrus": + *e = 132 + case "partyFavor": + *e = 133 + case "partyGlass": + *e = 134 + case "pencils": + *e = 135 + case "people": + *e = 136 + case "peopleWaving": + *e = 137 + case "peopleHats": + *e = 138 + case "poinsettias": + *e = 139 + case "postageStamp": + *e = 140 + case "pumpkin1": + *e = 141 + case "pushPinNote2": + *e = 142 + case "pushPinNote1": + *e = 143 + case "pyramids": + *e = 144 + case "pyramidsAbove": + *e = 145 + case "quadrants": + *e = 146 + case "rings": + *e = 147 + case "safari": + *e = 148 + case "sawtooth": + *e = 149 + case "sawtoothGray": + *e = 150 + case "scaredCat": + *e = 151 + case "seattle": + *e = 152 + case "shadowedSquares": + *e = 153 + case "sharksTeeth": + *e = 154 + case "shorebirdTracks": + *e = 155 + case "skyrocket": + *e = 156 + case "snowflakeFancy": + *e = 157 + case "snowflakes": + *e = 158 + case "sombrero": + *e = 159 + case "southwest": + *e = 160 + case "stars": + *e = 161 + case "starsTop": + *e = 162 + case "stars3d": + *e = 163 + case "starsBlack": + *e = 164 + case "starsShadowed": + *e = 165 + case "sun": + *e = 166 + case "swirligig": + *e = 167 + case "tornPaper": + *e = 168 + case "tornPaperBlack": + *e = 169 + case "trees": + *e = 170 + case "triangleParty": + *e = 171 + case "triangles": + *e = 172 + case "triangle1": + *e = 173 + case "triangle2": + *e = 174 + case "triangleCircle1": + *e = 175 + case "triangleCircle2": + *e = 176 + case "shapes1": + *e = 177 + case "shapes2": + *e = 178 + case "twistedLines1": + *e = 179 + case "twistedLines2": + *e = 180 + case "vine": + *e = 181 + case "waveline": + *e = 182 + case "weavingAngles": + *e = 183 + case "weavingBraid": + *e = 184 + case "weavingRibbon": + *e = 185 + case "weavingStrips": + *e = 186 + case "whiteFlowers": + *e = 187 + case "woodwork": + *e = 188 + case "xIllusions": + *e = 189 + case "zanyTriangles": + *e = 190 + case "zigZag": + *e = 191 + case "zigZagStitch": + *e = 192 + case "custom": + *e = 193 + } + return nil +} + +func (m ST_Border) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_Border) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "nil": + *m = 1 + case "none": + *m = 2 + case "single": + *m = 3 + case "thick": + *m = 4 + case "double": + *m = 5 + case "dotted": + *m = 6 + case "dashed": + *m = 7 + case "dotDash": + *m = 8 + case "dotDotDash": + *m = 9 + case "triple": + *m = 10 + case "thinThickSmallGap": + *m = 11 + case "thickThinSmallGap": + *m = 12 + case "thinThickThinSmallGap": + *m = 13 + case "thinThickMediumGap": + *m = 14 + case "thickThinMediumGap": + *m = 15 + case "thinThickThinMediumGap": + *m = 16 + case "thinThickLargeGap": + *m = 17 + case "thickThinLargeGap": + *m = 18 + case "thinThickThinLargeGap": + *m = 19 + case "wave": + *m = 20 + case "doubleWave": + *m = 21 + case "dashSmallGap": + *m = 22 + case "dashDotStroked": + *m = 23 + case "threeDEmboss": + *m = 24 + case "threeDEngrave": + *m = 25 + case "outset": + *m = 26 + case "inset": + *m = 27 + case "apples": + *m = 28 + case "archedScallops": + *m = 29 + case "babyPacifier": + *m = 30 + case "babyRattle": + *m = 31 + case "balloons3Colors": + *m = 32 + case "balloonsHotAir": + *m = 33 + case "basicBlackDashes": + *m = 34 + case "basicBlackDots": + *m = 35 + case "basicBlackSquares": + *m = 36 + case "basicThinLines": + *m = 37 + case "basicWhiteDashes": + *m = 38 + case "basicWhiteDots": + *m = 39 + case "basicWhiteSquares": + *m = 40 + case "basicWideInline": + *m = 41 + case "basicWideMidline": + *m = 42 + case "basicWideOutline": + *m = 43 + case "bats": + *m = 44 + case "birds": + *m = 45 + case "birdsFlight": + *m = 46 + case "cabins": + *m = 47 + case "cakeSlice": + *m = 48 + case "candyCorn": + *m = 49 + case "celticKnotwork": + *m = 50 + case "certificateBanner": + *m = 51 + case "chainLink": + *m = 52 + case "champagneBottle": + *m = 53 + case "checkedBarBlack": + *m = 54 + case "checkedBarColor": + *m = 55 + case "checkered": + *m = 56 + case "christmasTree": + *m = 57 + case "circlesLines": + *m = 58 + case "circlesRectangles": + *m = 59 + case "classicalWave": + *m = 60 + case "clocks": + *m = 61 + case "compass": + *m = 62 + case "confetti": + *m = 63 + case "confettiGrays": + *m = 64 + case "confettiOutline": + *m = 65 + case "confettiStreamers": + *m = 66 + case "confettiWhite": + *m = 67 + case "cornerTriangles": + *m = 68 + case "couponCutoutDashes": + *m = 69 + case "couponCutoutDots": + *m = 70 + case "crazyMaze": + *m = 71 + case "creaturesButterfly": + *m = 72 + case "creaturesFish": + *m = 73 + case "creaturesInsects": + *m = 74 + case "creaturesLadyBug": + *m = 75 + case "crossStitch": + *m = 76 + case "cup": + *m = 77 + case "decoArch": + *m = 78 + case "decoArchColor": + *m = 79 + case "decoBlocks": + *m = 80 + case "diamondsGray": + *m = 81 + case "doubleD": + *m = 82 + case "doubleDiamonds": + *m = 83 + case "earth1": + *m = 84 + case "earth2": + *m = 85 + case "earth3": + *m = 86 + case "eclipsingSquares1": + *m = 87 + case "eclipsingSquares2": + *m = 88 + case "eggsBlack": + *m = 89 + case "fans": + *m = 90 + case "film": + *m = 91 + case "firecrackers": + *m = 92 + case "flowersBlockPrint": + *m = 93 + case "flowersDaisies": + *m = 94 + case "flowersModern1": + *m = 95 + case "flowersModern2": + *m = 96 + case "flowersPansy": + *m = 97 + case "flowersRedRose": + *m = 98 + case "flowersRoses": + *m = 99 + case "flowersTeacup": + *m = 100 + case "flowersTiny": + *m = 101 + case "gems": + *m = 102 + case "gingerbreadMan": + *m = 103 + case "gradient": + *m = 104 + case "handmade1": + *m = 105 + case "handmade2": + *m = 106 + case "heartBalloon": + *m = 107 + case "heartGray": + *m = 108 + case "hearts": + *m = 109 + case "heebieJeebies": + *m = 110 + case "holly": + *m = 111 + case "houseFunky": + *m = 112 + case "hypnotic": + *m = 113 + case "iceCreamCones": + *m = 114 + case "lightBulb": + *m = 115 + case "lightning1": + *m = 116 + case "lightning2": + *m = 117 + case "mapPins": + *m = 118 + case "mapleLeaf": + *m = 119 + case "mapleMuffins": + *m = 120 + case "marquee": + *m = 121 + case "marqueeToothed": + *m = 122 + case "moons": + *m = 123 + case "mosaic": + *m = 124 + case "musicNotes": + *m = 125 + case "northwest": + *m = 126 + case "ovals": + *m = 127 + case "packages": + *m = 128 + case "palmsBlack": + *m = 129 + case "palmsColor": + *m = 130 + case "paperClips": + *m = 131 + case "papyrus": + *m = 132 + case "partyFavor": + *m = 133 + case "partyGlass": + *m = 134 + case "pencils": + *m = 135 + case "people": + *m = 136 + case "peopleWaving": + *m = 137 + case "peopleHats": + *m = 138 + case "poinsettias": + *m = 139 + case "postageStamp": + *m = 140 + case "pumpkin1": + *m = 141 + case "pushPinNote2": + *m = 142 + case "pushPinNote1": + *m = 143 + case "pyramids": + *m = 144 + case "pyramidsAbove": + *m = 145 + case "quadrants": + *m = 146 + case "rings": + *m = 147 + case "safari": + *m = 148 + case "sawtooth": + *m = 149 + case "sawtoothGray": + *m = 150 + case "scaredCat": + *m = 151 + case "seattle": + *m = 152 + case "shadowedSquares": + *m = 153 + case "sharksTeeth": + *m = 154 + case "shorebirdTracks": + *m = 155 + case "skyrocket": + *m = 156 + case "snowflakeFancy": + *m = 157 + case "snowflakes": + *m = 158 + case "sombrero": + *m = 159 + case "southwest": + *m = 160 + case "stars": + *m = 161 + case "starsTop": + *m = 162 + case "stars3d": + *m = 163 + case "starsBlack": + *m = 164 + case "starsShadowed": + *m = 165 + case "sun": + *m = 166 + case "swirligig": + *m = 167 + case "tornPaper": + *m = 168 + case "tornPaperBlack": + *m = 169 + case "trees": + *m = 170 + case "triangleParty": + *m = 171 + case "triangles": + *m = 172 + case "triangle1": + *m = 173 + case "triangle2": + *m = 174 + case "triangleCircle1": + *m = 175 + case "triangleCircle2": + *m = 176 + case "shapes1": + *m = 177 + case "shapes2": + *m = 178 + case "twistedLines1": + *m = 179 + case "twistedLines2": + *m = 180 + case "vine": + *m = 181 + case "waveline": + *m = 182 + case "weavingAngles": + *m = 183 + case "weavingBraid": + *m = 184 + case "weavingRibbon": + *m = 185 + case "weavingStrips": + *m = 186 + case "whiteFlowers": + *m = 187 + case "woodwork": + *m = 188 + case "xIllusions": + *m = 189 + case "zanyTriangles": + *m = 190 + case "zigZag": + *m = 191 + case "zigZagStitch": + *m = 192 + case "custom": + *m = 193 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_Border) String() string { + switch m { + case 0: + return "" + case 1: + return "nil" + case 2: + return "none" + case 3: + return "single" + case 4: + return "thick" + case 5: + return "double" + case 6: + return "dotted" + case 7: + return "dashed" + case 8: + return "dotDash" + case 9: + return "dotDotDash" + case 10: + return "triple" + case 11: + return "thinThickSmallGap" + case 12: + return "thickThinSmallGap" + case 13: + return "thinThickThinSmallGap" + case 14: + return "thinThickMediumGap" + case 15: + return "thickThinMediumGap" + case 16: + return "thinThickThinMediumGap" + case 17: + return "thinThickLargeGap" + case 18: + return "thickThinLargeGap" + case 19: + return "thinThickThinLargeGap" + case 20: + return "wave" + case 21: + return "doubleWave" + case 22: + return "dashSmallGap" + case 23: + return "dashDotStroked" + case 24: + return "threeDEmboss" + case 25: + return "threeDEngrave" + case 26: + return "outset" + case 27: + return "inset" + case 28: + return "apples" + case 29: + return "archedScallops" + case 30: + return "babyPacifier" + case 31: + return "babyRattle" + case 32: + return "balloons3Colors" + case 33: + return "balloonsHotAir" + case 34: + return "basicBlackDashes" + case 35: + return "basicBlackDots" + case 36: + return "basicBlackSquares" + case 37: + return "basicThinLines" + case 38: + return "basicWhiteDashes" + case 39: + return "basicWhiteDots" + case 40: + return "basicWhiteSquares" + case 41: + return "basicWideInline" + case 42: + return "basicWideMidline" + case 43: + return "basicWideOutline" + case 44: + return "bats" + case 45: + return "birds" + case 46: + return "birdsFlight" + case 47: + return "cabins" + case 48: + return "cakeSlice" + case 49: + return "candyCorn" + case 50: + return "celticKnotwork" + case 51: + return "certificateBanner" + case 52: + return "chainLink" + case 53: + return "champagneBottle" + case 54: + return "checkedBarBlack" + case 55: + return "checkedBarColor" + case 56: + return "checkered" + case 57: + return "christmasTree" + case 58: + return "circlesLines" + case 59: + return "circlesRectangles" + case 60: + return "classicalWave" + case 61: + return "clocks" + case 62: + return "compass" + case 63: + return "confetti" + case 64: + return "confettiGrays" + case 65: + return "confettiOutline" + case 66: + return "confettiStreamers" + case 67: + return "confettiWhite" + case 68: + return "cornerTriangles" + case 69: + return "couponCutoutDashes" + case 70: + return "couponCutoutDots" + case 71: + return "crazyMaze" + case 72: + return "creaturesButterfly" + case 73: + return "creaturesFish" + case 74: + return "creaturesInsects" + case 75: + return "creaturesLadyBug" + case 76: + return "crossStitch" + case 77: + return "cup" + case 78: + return "decoArch" + case 79: + return "decoArchColor" + case 80: + return "decoBlocks" + case 81: + return "diamondsGray" + case 82: + return "doubleD" + case 83: + return "doubleDiamonds" + case 84: + return "earth1" + case 85: + return "earth2" + case 86: + return "earth3" + case 87: + return "eclipsingSquares1" + case 88: + return "eclipsingSquares2" + case 89: + return "eggsBlack" + case 90: + return "fans" + case 91: + return "film" + case 92: + return "firecrackers" + case 93: + return "flowersBlockPrint" + case 94: + return "flowersDaisies" + case 95: + return "flowersModern1" + case 96: + return "flowersModern2" + case 97: + return "flowersPansy" + case 98: + return "flowersRedRose" + case 99: + return "flowersRoses" + case 100: + return "flowersTeacup" + case 101: + return "flowersTiny" + case 102: + return "gems" + case 103: + return "gingerbreadMan" + case 104: + return "gradient" + case 105: + return "handmade1" + case 106: + return "handmade2" + case 107: + return "heartBalloon" + case 108: + return "heartGray" + case 109: + return "hearts" + case 110: + return "heebieJeebies" + case 111: + return "holly" + case 112: + return "houseFunky" + case 113: + return "hypnotic" + case 114: + return "iceCreamCones" + case 115: + return "lightBulb" + case 116: + return "lightning1" + case 117: + return "lightning2" + case 118: + return "mapPins" + case 119: + return "mapleLeaf" + case 120: + return "mapleMuffins" + case 121: + return "marquee" + case 122: + return "marqueeToothed" + case 123: + return "moons" + case 124: + return "mosaic" + case 125: + return "musicNotes" + case 126: + return "northwest" + case 127: + return "ovals" + case 128: + return "packages" + case 129: + return "palmsBlack" + case 130: + return "palmsColor" + case 131: + return "paperClips" + case 132: + return "papyrus" + case 133: + return "partyFavor" + case 134: + return "partyGlass" + case 135: + return "pencils" + case 136: + return "people" + case 137: + return "peopleWaving" + case 138: + return "peopleHats" + case 139: + return "poinsettias" + case 140: + return "postageStamp" + case 141: + return "pumpkin1" + case 142: + return "pushPinNote2" + case 143: + return "pushPinNote1" + case 144: + return "pyramids" + case 145: + return "pyramidsAbove" + case 146: + return "quadrants" + case 147: + return "rings" + case 148: + return "safari" + case 149: + return "sawtooth" + case 150: + return "sawtoothGray" + case 151: + return "scaredCat" + case 152: + return "seattle" + case 153: + return "shadowedSquares" + case 154: + return "sharksTeeth" + case 155: + return "shorebirdTracks" + case 156: + return "skyrocket" + case 157: + return "snowflakeFancy" + case 158: + return "snowflakes" + case 159: + return "sombrero" + case 160: + return "southwest" + case 161: + return "stars" + case 162: + return "starsTop" + case 163: + return "stars3d" + case 164: + return "starsBlack" + case 165: + return "starsShadowed" + case 166: + return "sun" + case 167: + return "swirligig" + case 168: + return "tornPaper" + case 169: + return "tornPaperBlack" + case 170: + return "trees" + case 171: + return "triangleParty" + case 172: + return "triangles" + case 173: + return "triangle1" + case 174: + return "triangle2" + case 175: + return "triangleCircle1" + case 176: + return "triangleCircle2" + case 177: + return "shapes1" + case 178: + return "shapes2" + case 179: + return "twistedLines1" + case 180: + return "twistedLines2" + case 181: + return "vine" + case 182: + return "waveline" + case 183: + return "weavingAngles" + case 184: + return "weavingBraid" + case 185: + return "weavingRibbon" + case 186: + return "weavingStrips" + case 187: + return "whiteFlowers" + case 188: + return "woodwork" + case 189: + return "xIllusions" + case 190: + return "zanyTriangles" + case 191: + return "zigZag" + case 192: + return "zigZagStitch" + case 193: + return "custom" + } + return "" +} + +func (m ST_Border) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_Border) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_Shd byte + +const ( + ST_ShdUnset ST_Shd = 0 + ST_ShdNil ST_Shd = 1 + ST_ShdClear ST_Shd = 2 + ST_ShdSolid ST_Shd = 3 + ST_ShdHorzStripe ST_Shd = 4 + ST_ShdVertStripe ST_Shd = 5 + ST_ShdReverseDiagStripe ST_Shd = 6 + ST_ShdDiagStripe ST_Shd = 7 + ST_ShdHorzCross ST_Shd = 8 + ST_ShdDiagCross ST_Shd = 9 + ST_ShdThinHorzStripe ST_Shd = 10 + ST_ShdThinVertStripe ST_Shd = 11 + ST_ShdThinReverseDiagStripe ST_Shd = 12 + ST_ShdThinDiagStripe ST_Shd = 13 + ST_ShdThinHorzCross ST_Shd = 14 + ST_ShdThinDiagCross ST_Shd = 15 + ST_ShdPct5 ST_Shd = 16 + ST_ShdPct10 ST_Shd = 17 + ST_ShdPct12 ST_Shd = 18 + ST_ShdPct15 ST_Shd = 19 + ST_ShdPct20 ST_Shd = 20 + ST_ShdPct25 ST_Shd = 21 + ST_ShdPct30 ST_Shd = 22 + ST_ShdPct35 ST_Shd = 23 + ST_ShdPct37 ST_Shd = 24 + ST_ShdPct40 ST_Shd = 25 + ST_ShdPct45 ST_Shd = 26 + ST_ShdPct50 ST_Shd = 27 + ST_ShdPct55 ST_Shd = 28 + ST_ShdPct60 ST_Shd = 29 + ST_ShdPct62 ST_Shd = 30 + ST_ShdPct65 ST_Shd = 31 + ST_ShdPct70 ST_Shd = 32 + ST_ShdPct75 ST_Shd = 33 + ST_ShdPct80 ST_Shd = 34 + ST_ShdPct85 ST_Shd = 35 + ST_ShdPct87 ST_Shd = 36 + ST_ShdPct90 ST_Shd = 37 + ST_ShdPct95 ST_Shd = 38 +) + +func (e ST_Shd) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_ShdUnset: + attr.Value = "" + case ST_ShdNil: + attr.Value = "nil" + case ST_ShdClear: + attr.Value = "clear" + case ST_ShdSolid: + attr.Value = "solid" + case ST_ShdHorzStripe: + attr.Value = "horzStripe" + case ST_ShdVertStripe: + attr.Value = "vertStripe" + case ST_ShdReverseDiagStripe: + attr.Value = "reverseDiagStripe" + case ST_ShdDiagStripe: + attr.Value = "diagStripe" + case ST_ShdHorzCross: + attr.Value = "horzCross" + case ST_ShdDiagCross: + attr.Value = "diagCross" + case ST_ShdThinHorzStripe: + attr.Value = "thinHorzStripe" + case ST_ShdThinVertStripe: + attr.Value = "thinVertStripe" + case ST_ShdThinReverseDiagStripe: + attr.Value = "thinReverseDiagStripe" + case ST_ShdThinDiagStripe: + attr.Value = "thinDiagStripe" + case ST_ShdThinHorzCross: + attr.Value = "thinHorzCross" + case ST_ShdThinDiagCross: + attr.Value = "thinDiagCross" + case ST_ShdPct5: + attr.Value = "pct5" + case ST_ShdPct10: + attr.Value = "pct10" + case ST_ShdPct12: + attr.Value = "pct12" + case ST_ShdPct15: + attr.Value = "pct15" + case ST_ShdPct20: + attr.Value = "pct20" + case ST_ShdPct25: + attr.Value = "pct25" + case ST_ShdPct30: + attr.Value = "pct30" + case ST_ShdPct35: + attr.Value = "pct35" + case ST_ShdPct37: + attr.Value = "pct37" + case ST_ShdPct40: + attr.Value = "pct40" + case ST_ShdPct45: + attr.Value = "pct45" + case ST_ShdPct50: + attr.Value = "pct50" + case ST_ShdPct55: + attr.Value = "pct55" + case ST_ShdPct60: + attr.Value = "pct60" + case ST_ShdPct62: + attr.Value = "pct62" + case ST_ShdPct65: + attr.Value = "pct65" + case ST_ShdPct70: + attr.Value = "pct70" + case ST_ShdPct75: + attr.Value = "pct75" + case ST_ShdPct80: + attr.Value = "pct80" + case ST_ShdPct85: + attr.Value = "pct85" + case ST_ShdPct87: + attr.Value = "pct87" + case ST_ShdPct90: + attr.Value = "pct90" + case ST_ShdPct95: + attr.Value = "pct95" + } + return attr, nil +} + +func (e *ST_Shd) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "nil": + *e = 1 + case "clear": + *e = 2 + case "solid": + *e = 3 + case "horzStripe": + *e = 4 + case "vertStripe": + *e = 5 + case "reverseDiagStripe": + *e = 6 + case "diagStripe": + *e = 7 + case "horzCross": + *e = 8 + case "diagCross": + *e = 9 + case "thinHorzStripe": + *e = 10 + case "thinVertStripe": + *e = 11 + case "thinReverseDiagStripe": + *e = 12 + case "thinDiagStripe": + *e = 13 + case "thinHorzCross": + *e = 14 + case "thinDiagCross": + *e = 15 + case "pct5": + *e = 16 + case "pct10": + *e = 17 + case "pct12": + *e = 18 + case "pct15": + *e = 19 + case "pct20": + *e = 20 + case "pct25": + *e = 21 + case "pct30": + *e = 22 + case "pct35": + *e = 23 + case "pct37": + *e = 24 + case "pct40": + *e = 25 + case "pct45": + *e = 26 + case "pct50": + *e = 27 + case "pct55": + *e = 28 + case "pct60": + *e = 29 + case "pct62": + *e = 30 + case "pct65": + *e = 31 + case "pct70": + *e = 32 + case "pct75": + *e = 33 + case "pct80": + *e = 34 + case "pct85": + *e = 35 + case "pct87": + *e = 36 + case "pct90": + *e = 37 + case "pct95": + *e = 38 + } + return nil +} + +func (m ST_Shd) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_Shd) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "nil": + *m = 1 + case "clear": + *m = 2 + case "solid": + *m = 3 + case "horzStripe": + *m = 4 + case "vertStripe": + *m = 5 + case "reverseDiagStripe": + *m = 6 + case "diagStripe": + *m = 7 + case "horzCross": + *m = 8 + case "diagCross": + *m = 9 + case "thinHorzStripe": + *m = 10 + case "thinVertStripe": + *m = 11 + case "thinReverseDiagStripe": + *m = 12 + case "thinDiagStripe": + *m = 13 + case "thinHorzCross": + *m = 14 + case "thinDiagCross": + *m = 15 + case "pct5": + *m = 16 + case "pct10": + *m = 17 + case "pct12": + *m = 18 + case "pct15": + *m = 19 + case "pct20": + *m = 20 + case "pct25": + *m = 21 + case "pct30": + *m = 22 + case "pct35": + *m = 23 + case "pct37": + *m = 24 + case "pct40": + *m = 25 + case "pct45": + *m = 26 + case "pct50": + *m = 27 + case "pct55": + *m = 28 + case "pct60": + *m = 29 + case "pct62": + *m = 30 + case "pct65": + *m = 31 + case "pct70": + *m = 32 + case "pct75": + *m = 33 + case "pct80": + *m = 34 + case "pct85": + *m = 35 + case "pct87": + *m = 36 + case "pct90": + *m = 37 + case "pct95": + *m = 38 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_Shd) String() string { + switch m { + case 0: + return "" + case 1: + return "nil" + case 2: + return "clear" + case 3: + return "solid" + case 4: + return "horzStripe" + case 5: + return "vertStripe" + case 6: + return "reverseDiagStripe" + case 7: + return "diagStripe" + case 8: + return "horzCross" + case 9: + return "diagCross" + case 10: + return "thinHorzStripe" + case 11: + return "thinVertStripe" + case 12: + return "thinReverseDiagStripe" + case 13: + return "thinDiagStripe" + case 14: + return "thinHorzCross" + case 15: + return "thinDiagCross" + case 16: + return "pct5" + case 17: + return "pct10" + case 18: + return "pct12" + case 19: + return "pct15" + case 20: + return "pct20" + case 21: + return "pct25" + case 22: + return "pct30" + case 23: + return "pct35" + case 24: + return "pct37" + case 25: + return "pct40" + case 26: + return "pct45" + case 27: + return "pct50" + case 28: + return "pct55" + case 29: + return "pct60" + case 30: + return "pct62" + case 31: + return "pct65" + case 32: + return "pct70" + case 33: + return "pct75" + case 34: + return "pct80" + case 35: + return "pct85" + case 36: + return "pct87" + case 37: + return "pct90" + case 38: + return "pct95" + } + return "" +} + +func (m ST_Shd) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_Shd) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_Em byte + +const ( + ST_EmUnset ST_Em = 0 + ST_EmNone ST_Em = 1 + ST_EmDot ST_Em = 2 + ST_EmComma ST_Em = 3 + ST_EmCircle ST_Em = 4 + ST_EmUnderDot ST_Em = 5 +) + +func (e ST_Em) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_EmUnset: + attr.Value = "" + case ST_EmNone: + attr.Value = "none" + case ST_EmDot: + attr.Value = "dot" + case ST_EmComma: + attr.Value = "comma" + case ST_EmCircle: + attr.Value = "circle" + case ST_EmUnderDot: + attr.Value = "underDot" + } + return attr, nil +} + +func (e *ST_Em) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "none": + *e = 1 + case "dot": + *e = 2 + case "comma": + *e = 3 + case "circle": + *e = 4 + case "underDot": + *e = 5 + } + return nil +} + +func (m ST_Em) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_Em) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "none": + *m = 1 + case "dot": + *m = 2 + case "comma": + *m = 3 + case "circle": + *m = 4 + case "underDot": + *m = 5 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_Em) String() string { + switch m { + case 0: + return "" + case 1: + return "none" + case 2: + return "dot" + case 3: + return "comma" + case 4: + return "circle" + case 5: + return "underDot" + } + return "" +} + +func (m ST_Em) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_Em) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_CombineBrackets byte + +const ( + ST_CombineBracketsUnset ST_CombineBrackets = 0 + ST_CombineBracketsNone ST_CombineBrackets = 1 + ST_CombineBracketsRound ST_CombineBrackets = 2 + ST_CombineBracketsSquare ST_CombineBrackets = 3 + ST_CombineBracketsAngle ST_CombineBrackets = 4 + ST_CombineBracketsCurly ST_CombineBrackets = 5 +) + +func (e ST_CombineBrackets) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_CombineBracketsUnset: + attr.Value = "" + case ST_CombineBracketsNone: + attr.Value = "none" + case ST_CombineBracketsRound: + attr.Value = "round" + case ST_CombineBracketsSquare: + attr.Value = "square" + case ST_CombineBracketsAngle: + attr.Value = "angle" + case ST_CombineBracketsCurly: + attr.Value = "curly" + } + return attr, nil +} + +func (e *ST_CombineBrackets) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "none": + *e = 1 + case "round": + *e = 2 + case "square": + *e = 3 + case "angle": + *e = 4 + case "curly": + *e = 5 + } + return nil +} + +func (m ST_CombineBrackets) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_CombineBrackets) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "none": + *m = 1 + case "round": + *m = 2 + case "square": + *m = 3 + case "angle": + *m = 4 + case "curly": + *m = 5 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_CombineBrackets) String() string { + switch m { + case 0: + return "" + case 1: + return "none" + case 2: + return "round" + case 3: + return "square" + case 4: + return "angle" + case 5: + return "curly" + } + return "" +} + +func (m ST_CombineBrackets) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_CombineBrackets) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_HeightRule byte + +const ( + ST_HeightRuleUnset ST_HeightRule = 0 + ST_HeightRuleAuto ST_HeightRule = 1 + ST_HeightRuleExact ST_HeightRule = 2 + ST_HeightRuleAtLeast ST_HeightRule = 3 +) + +func (e ST_HeightRule) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_HeightRuleUnset: + attr.Value = "" + case ST_HeightRuleAuto: + attr.Value = "auto" + case ST_HeightRuleExact: + attr.Value = "exact" + case ST_HeightRuleAtLeast: + attr.Value = "atLeast" + } + return attr, nil +} + +func (e *ST_HeightRule) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "auto": + *e = 1 + case "exact": + *e = 2 + case "atLeast": + *e = 3 + } + return nil +} + +func (m ST_HeightRule) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_HeightRule) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "auto": + *m = 1 + case "exact": + *m = 2 + case "atLeast": + *m = 3 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_HeightRule) String() string { + switch m { + case 0: + return "" + case 1: + return "auto" + case 2: + return "exact" + case 3: + return "atLeast" + } + return "" +} + +func (m ST_HeightRule) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_HeightRule) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_Wrap byte + +const ( + ST_WrapUnset ST_Wrap = 0 + ST_WrapAuto ST_Wrap = 1 + ST_WrapNotBeside ST_Wrap = 2 + ST_WrapAround ST_Wrap = 3 + ST_WrapTight ST_Wrap = 4 + ST_WrapThrough ST_Wrap = 5 + ST_WrapNone ST_Wrap = 6 +) + +func (e ST_Wrap) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_WrapUnset: + attr.Value = "" + case ST_WrapAuto: + attr.Value = "auto" + case ST_WrapNotBeside: + attr.Value = "notBeside" + case ST_WrapAround: + attr.Value = "around" + case ST_WrapTight: + attr.Value = "tight" + case ST_WrapThrough: + attr.Value = "through" + case ST_WrapNone: + attr.Value = "none" + } + return attr, nil +} + +func (e *ST_Wrap) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "auto": + *e = 1 + case "notBeside": + *e = 2 + case "around": + *e = 3 + case "tight": + *e = 4 + case "through": + *e = 5 + case "none": + *e = 6 + } + return nil +} + +func (m ST_Wrap) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_Wrap) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "auto": + *m = 1 + case "notBeside": + *m = 2 + case "around": + *m = 3 + case "tight": + *m = 4 + case "through": + *m = 5 + case "none": + *m = 6 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_Wrap) String() string { + switch m { + case 0: + return "" + case 1: + return "auto" + case 2: + return "notBeside" + case 3: + return "around" + case 4: + return "tight" + case 5: + return "through" + case 6: + return "none" + } + return "" +} + +func (m ST_Wrap) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_Wrap) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_VAnchor byte + +const ( + ST_VAnchorUnset ST_VAnchor = 0 + ST_VAnchorText ST_VAnchor = 1 + ST_VAnchorMargin ST_VAnchor = 2 + ST_VAnchorPage ST_VAnchor = 3 +) + +func (e ST_VAnchor) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_VAnchorUnset: + attr.Value = "" + case ST_VAnchorText: + attr.Value = "text" + case ST_VAnchorMargin: + attr.Value = "margin" + case ST_VAnchorPage: + attr.Value = "page" + } + return attr, nil +} + +func (e *ST_VAnchor) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "text": + *e = 1 + case "margin": + *e = 2 + case "page": + *e = 3 + } + return nil +} + +func (m ST_VAnchor) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_VAnchor) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "text": + *m = 1 + case "margin": + *m = 2 + case "page": + *m = 3 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_VAnchor) String() string { + switch m { + case 0: + return "" + case 1: + return "text" + case 2: + return "margin" + case 3: + return "page" + } + return "" +} + +func (m ST_VAnchor) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_VAnchor) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_HAnchor byte + +const ( + ST_HAnchorUnset ST_HAnchor = 0 + ST_HAnchorText ST_HAnchor = 1 + ST_HAnchorMargin ST_HAnchor = 2 + ST_HAnchorPage ST_HAnchor = 3 +) + +func (e ST_HAnchor) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_HAnchorUnset: + attr.Value = "" + case ST_HAnchorText: + attr.Value = "text" + case ST_HAnchorMargin: + attr.Value = "margin" + case ST_HAnchorPage: + attr.Value = "page" + } + return attr, nil +} + +func (e *ST_HAnchor) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "text": + *e = 1 + case "margin": + *e = 2 + case "page": + *e = 3 + } + return nil +} + +func (m ST_HAnchor) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_HAnchor) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "text": + *m = 1 + case "margin": + *m = 2 + case "page": + *m = 3 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_HAnchor) String() string { + switch m { + case 0: + return "" + case 1: + return "text" + case 2: + return "margin" + case 3: + return "page" + } + return "" +} + +func (m ST_HAnchor) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_HAnchor) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_DropCap byte + +const ( + ST_DropCapUnset ST_DropCap = 0 + ST_DropCapNone ST_DropCap = 1 + ST_DropCapDrop ST_DropCap = 2 + ST_DropCapMargin ST_DropCap = 3 +) + +func (e ST_DropCap) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_DropCapUnset: + attr.Value = "" + case ST_DropCapNone: + attr.Value = "none" + case ST_DropCapDrop: + attr.Value = "drop" + case ST_DropCapMargin: + attr.Value = "margin" + } + return attr, nil +} + +func (e *ST_DropCap) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "none": + *e = 1 + case "drop": + *e = 2 + case "margin": + *e = 3 + } + return nil +} + +func (m ST_DropCap) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_DropCap) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "none": + *m = 1 + case "drop": + *m = 2 + case "margin": + *m = 3 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_DropCap) String() string { + switch m { + case 0: + return "" + case 1: + return "none" + case 2: + return "drop" + case 3: + return "margin" + } + return "" +} + +func (m ST_DropCap) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_DropCap) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_TabJc byte + +const ( + ST_TabJcUnset ST_TabJc = 0 + ST_TabJcClear ST_TabJc = 1 + ST_TabJcStart ST_TabJc = 2 + ST_TabJcCenter ST_TabJc = 3 + ST_TabJcEnd ST_TabJc = 4 + ST_TabJcDecimal ST_TabJc = 5 + ST_TabJcBar ST_TabJc = 6 + ST_TabJcNum ST_TabJc = 7 + ST_TabJcLeft ST_TabJc = 8 + ST_TabJcRight ST_TabJc = 9 +) + +func (e ST_TabJc) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_TabJcUnset: + attr.Value = "" + case ST_TabJcClear: + attr.Value = "clear" + case ST_TabJcStart: + attr.Value = "start" + case ST_TabJcCenter: + attr.Value = "center" + case ST_TabJcEnd: + attr.Value = "end" + case ST_TabJcDecimal: + attr.Value = "decimal" + case ST_TabJcBar: + attr.Value = "bar" + case ST_TabJcNum: + attr.Value = "num" + case ST_TabJcLeft: + attr.Value = "left" + case ST_TabJcRight: + attr.Value = "right" + } + return attr, nil +} + +func (e *ST_TabJc) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "clear": + *e = 1 + case "start": + *e = 2 + case "center": + *e = 3 + case "end": + *e = 4 + case "decimal": + *e = 5 + case "bar": + *e = 6 + case "num": + *e = 7 + case "left": + *e = 8 + case "right": + *e = 9 + } + return nil +} + +func (m ST_TabJc) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_TabJc) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "clear": + *m = 1 + case "start": + *m = 2 + case "center": + *m = 3 + case "end": + *m = 4 + case "decimal": + *m = 5 + case "bar": + *m = 6 + case "num": + *m = 7 + case "left": + *m = 8 + case "right": + *m = 9 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_TabJc) String() string { + switch m { + case 0: + return "" + case 1: + return "clear" + case 2: + return "start" + case 3: + return "center" + case 4: + return "end" + case 5: + return "decimal" + case 6: + return "bar" + case 7: + return "num" + case 8: + return "left" + case 9: + return "right" + } + return "" +} + +func (m ST_TabJc) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_TabJc) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_TabTlc byte + +const ( + ST_TabTlcUnset ST_TabTlc = 0 + ST_TabTlcNone ST_TabTlc = 1 + ST_TabTlcDot ST_TabTlc = 2 + ST_TabTlcHyphen ST_TabTlc = 3 + ST_TabTlcUnderscore ST_TabTlc = 4 + ST_TabTlcHeavy ST_TabTlc = 5 + ST_TabTlcMiddleDot ST_TabTlc = 6 +) + +func (e ST_TabTlc) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_TabTlcUnset: + attr.Value = "" + case ST_TabTlcNone: + attr.Value = "none" + case ST_TabTlcDot: + attr.Value = "dot" + case ST_TabTlcHyphen: + attr.Value = "hyphen" + case ST_TabTlcUnderscore: + attr.Value = "underscore" + case ST_TabTlcHeavy: + attr.Value = "heavy" + case ST_TabTlcMiddleDot: + attr.Value = "middleDot" + } + return attr, nil +} + +func (e *ST_TabTlc) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "none": + *e = 1 + case "dot": + *e = 2 + case "hyphen": + *e = 3 + case "underscore": + *e = 4 + case "heavy": + *e = 5 + case "middleDot": + *e = 6 + } + return nil +} + +func (m ST_TabTlc) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_TabTlc) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "none": + *m = 1 + case "dot": + *m = 2 + case "hyphen": + *m = 3 + case "underscore": + *m = 4 + case "heavy": + *m = 5 + case "middleDot": + *m = 6 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_TabTlc) String() string { + switch m { + case 0: + return "" + case 1: + return "none" + case 2: + return "dot" + case 3: + return "hyphen" + case 4: + return "underscore" + case 5: + return "heavy" + case 6: + return "middleDot" + } + return "" +} + +func (m ST_TabTlc) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_TabTlc) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_LineSpacingRule byte + +const ( + ST_LineSpacingRuleUnset ST_LineSpacingRule = 0 + ST_LineSpacingRuleAuto ST_LineSpacingRule = 1 + ST_LineSpacingRuleExact ST_LineSpacingRule = 2 + ST_LineSpacingRuleAtLeast ST_LineSpacingRule = 3 +) + +func (e ST_LineSpacingRule) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_LineSpacingRuleUnset: + attr.Value = "" + case ST_LineSpacingRuleAuto: + attr.Value = "auto" + case ST_LineSpacingRuleExact: + attr.Value = "exact" + case ST_LineSpacingRuleAtLeast: + attr.Value = "atLeast" + } + return attr, nil +} + +func (e *ST_LineSpacingRule) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "auto": + *e = 1 + case "exact": + *e = 2 + case "atLeast": + *e = 3 + } + return nil +} + +func (m ST_LineSpacingRule) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_LineSpacingRule) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "auto": + *m = 1 + case "exact": + *m = 2 + case "atLeast": + *m = 3 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_LineSpacingRule) String() string { + switch m { + case 0: + return "" + case 1: + return "auto" + case 2: + return "exact" + case 3: + return "atLeast" + } + return "" +} + +func (m ST_LineSpacingRule) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_LineSpacingRule) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_Jc byte + +const ( + ST_JcUnset ST_Jc = 0 + ST_JcStart ST_Jc = 1 + ST_JcCenter ST_Jc = 2 + ST_JcEnd ST_Jc = 3 + ST_JcBoth ST_Jc = 4 + ST_JcMediumKashida ST_Jc = 5 + ST_JcDistribute ST_Jc = 6 + ST_JcNumTab ST_Jc = 7 + ST_JcHighKashida ST_Jc = 8 + ST_JcLowKashida ST_Jc = 9 + ST_JcThaiDistribute ST_Jc = 10 + ST_JcLeft ST_Jc = 11 + ST_JcRight ST_Jc = 12 +) + +func (e ST_Jc) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_JcUnset: + attr.Value = "" + case ST_JcStart: + attr.Value = "start" + case ST_JcCenter: + attr.Value = "center" + case ST_JcEnd: + attr.Value = "end" + case ST_JcBoth: + attr.Value = "both" + case ST_JcMediumKashida: + attr.Value = "mediumKashida" + case ST_JcDistribute: + attr.Value = "distribute" + case ST_JcNumTab: + attr.Value = "numTab" + case ST_JcHighKashida: + attr.Value = "highKashida" + case ST_JcLowKashida: + attr.Value = "lowKashida" + case ST_JcThaiDistribute: + attr.Value = "thaiDistribute" + case ST_JcLeft: + attr.Value = "left" + case ST_JcRight: + attr.Value = "right" + } + return attr, nil +} + +func (e *ST_Jc) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "start": + *e = 1 + case "center": + *e = 2 + case "end": + *e = 3 + case "both": + *e = 4 + case "mediumKashida": + *e = 5 + case "distribute": + *e = 6 + case "numTab": + *e = 7 + case "highKashida": + *e = 8 + case "lowKashida": + *e = 9 + case "thaiDistribute": + *e = 10 + case "left": + *e = 11 + case "right": + *e = 12 + } + return nil +} + +func (m ST_Jc) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_Jc) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "start": + *m = 1 + case "center": + *m = 2 + case "end": + *m = 3 + case "both": + *m = 4 + case "mediumKashida": + *m = 5 + case "distribute": + *m = 6 + case "numTab": + *m = 7 + case "highKashida": + *m = 8 + case "lowKashida": + *m = 9 + case "thaiDistribute": + *m = 10 + case "left": + *m = 11 + case "right": + *m = 12 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_Jc) String() string { + switch m { + case 0: + return "" + case 1: + return "start" + case 2: + return "center" + case 3: + return "end" + case 4: + return "both" + case 5: + return "mediumKashida" + case 6: + return "distribute" + case 7: + return "numTab" + case 8: + return "highKashida" + case 9: + return "lowKashida" + case 10: + return "thaiDistribute" + case 11: + return "left" + case 12: + return "right" + } + return "" +} + +func (m ST_Jc) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_Jc) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_JcTable byte + +const ( + ST_JcTableUnset ST_JcTable = 0 + ST_JcTableCenter ST_JcTable = 1 + ST_JcTableEnd ST_JcTable = 2 + ST_JcTableLeft ST_JcTable = 3 + ST_JcTableRight ST_JcTable = 4 + ST_JcTableStart ST_JcTable = 5 +) + +func (e ST_JcTable) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_JcTableUnset: + attr.Value = "" + case ST_JcTableCenter: + attr.Value = "center" + case ST_JcTableEnd: + attr.Value = "end" + case ST_JcTableLeft: + attr.Value = "left" + case ST_JcTableRight: + attr.Value = "right" + case ST_JcTableStart: + attr.Value = "start" + } + return attr, nil +} + +func (e *ST_JcTable) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "center": + *e = 1 + case "end": + *e = 2 + case "left": + *e = 3 + case "right": + *e = 4 + case "start": + *e = 5 + } + return nil +} + +func (m ST_JcTable) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_JcTable) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "center": + *m = 1 + case "end": + *m = 2 + case "left": + *m = 3 + case "right": + *m = 4 + case "start": + *m = 5 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_JcTable) String() string { + switch m { + case 0: + return "" + case 1: + return "center" + case 2: + return "end" + case 3: + return "left" + case 4: + return "right" + case 5: + return "start" + } + return "" +} + +func (m ST_JcTable) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_JcTable) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_View byte + +const ( + ST_ViewUnset ST_View = 0 + ST_ViewNone ST_View = 1 + ST_ViewPrint ST_View = 2 + ST_ViewOutline ST_View = 3 + ST_ViewMasterPages ST_View = 4 + ST_ViewNormal ST_View = 5 + ST_ViewWeb ST_View = 6 +) + +func (e ST_View) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_ViewUnset: + attr.Value = "" + case ST_ViewNone: + attr.Value = "none" + case ST_ViewPrint: + attr.Value = "print" + case ST_ViewOutline: + attr.Value = "outline" + case ST_ViewMasterPages: + attr.Value = "masterPages" + case ST_ViewNormal: + attr.Value = "normal" + case ST_ViewWeb: + attr.Value = "web" + } + return attr, nil +} + +func (e *ST_View) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "none": + *e = 1 + case "print": + *e = 2 + case "outline": + *e = 3 + case "masterPages": + *e = 4 + case "normal": + *e = 5 + case "web": + *e = 6 + } + return nil +} + +func (m ST_View) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_View) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "none": + *m = 1 + case "print": + *m = 2 + case "outline": + *m = 3 + case "masterPages": + *m = 4 + case "normal": + *m = 5 + case "web": + *m = 6 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_View) String() string { + switch m { + case 0: + return "" + case 1: + return "none" + case 2: + return "print" + case 3: + return "outline" + case 4: + return "masterPages" + case 5: + return "normal" + case 6: + return "web" + } + return "" +} + +func (m ST_View) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_View) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_Zoom byte + +const ( + ST_ZoomUnset ST_Zoom = 0 + ST_ZoomNone ST_Zoom = 1 + ST_ZoomFullPage ST_Zoom = 2 + ST_ZoomBestFit ST_Zoom = 3 + ST_ZoomTextFit ST_Zoom = 4 +) + +func (e ST_Zoom) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_ZoomUnset: + attr.Value = "" + case ST_ZoomNone: + attr.Value = "none" + case ST_ZoomFullPage: + attr.Value = "fullPage" + case ST_ZoomBestFit: + attr.Value = "bestFit" + case ST_ZoomTextFit: + attr.Value = "textFit" + } + return attr, nil +} + +func (e *ST_Zoom) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "none": + *e = 1 + case "fullPage": + *e = 2 + case "bestFit": + *e = 3 + case "textFit": + *e = 4 + } + return nil +} + +func (m ST_Zoom) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_Zoom) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "none": + *m = 1 + case "fullPage": + *m = 2 + case "bestFit": + *m = 3 + case "textFit": + *m = 4 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_Zoom) String() string { + switch m { + case 0: + return "" + case 1: + return "none" + case 2: + return "fullPage" + case 3: + return "bestFit" + case 4: + return "textFit" + } + return "" +} + +func (m ST_Zoom) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_Zoom) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_Proof byte + +const ( + ST_ProofUnset ST_Proof = 0 + ST_ProofClean ST_Proof = 1 + ST_ProofDirty ST_Proof = 2 +) + +func (e ST_Proof) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_ProofUnset: + attr.Value = "" + case ST_ProofClean: + attr.Value = "clean" + case ST_ProofDirty: + attr.Value = "dirty" + } + return attr, nil +} + +func (e *ST_Proof) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "clean": + *e = 1 + case "dirty": + *e = 2 + } + return nil +} + +func (m ST_Proof) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_Proof) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "clean": + *m = 1 + case "dirty": + *m = 2 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_Proof) String() string { + switch m { + case 0: + return "" + case 1: + return "clean" + case 2: + return "dirty" + } + return "" +} + +func (m ST_Proof) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_Proof) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_DocProtect byte + +const ( + ST_DocProtectUnset ST_DocProtect = 0 + ST_DocProtectNone ST_DocProtect = 1 + ST_DocProtectReadOnly ST_DocProtect = 2 + ST_DocProtectComments ST_DocProtect = 3 + ST_DocProtectTrackedChanges ST_DocProtect = 4 + ST_DocProtectForms ST_DocProtect = 5 +) + +func (e ST_DocProtect) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_DocProtectUnset: + attr.Value = "" + case ST_DocProtectNone: + attr.Value = "none" + case ST_DocProtectReadOnly: + attr.Value = "readOnly" + case ST_DocProtectComments: + attr.Value = "comments" + case ST_DocProtectTrackedChanges: + attr.Value = "trackedChanges" + case ST_DocProtectForms: + attr.Value = "forms" + } + return attr, nil +} + +func (e *ST_DocProtect) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "none": + *e = 1 + case "readOnly": + *e = 2 + case "comments": + *e = 3 + case "trackedChanges": + *e = 4 + case "forms": + *e = 5 + } + return nil +} + +func (m ST_DocProtect) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_DocProtect) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "none": + *m = 1 + case "readOnly": + *m = 2 + case "comments": + *m = 3 + case "trackedChanges": + *m = 4 + case "forms": + *m = 5 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_DocProtect) String() string { + switch m { + case 0: + return "" + case 1: + return "none" + case 2: + return "readOnly" + case 3: + return "comments" + case 4: + return "trackedChanges" + case 5: + return "forms" + } + return "" +} + +func (m ST_DocProtect) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_DocProtect) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_MailMergeDocType byte + +const ( + ST_MailMergeDocTypeUnset ST_MailMergeDocType = 0 + ST_MailMergeDocTypeCatalog ST_MailMergeDocType = 1 + ST_MailMergeDocTypeEnvelopes ST_MailMergeDocType = 2 + ST_MailMergeDocTypeMailingLabels ST_MailMergeDocType = 3 + ST_MailMergeDocTypeFormLetters ST_MailMergeDocType = 4 + ST_MailMergeDocTypeEmail ST_MailMergeDocType = 5 + ST_MailMergeDocTypeFax ST_MailMergeDocType = 6 +) + +func (e ST_MailMergeDocType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_MailMergeDocTypeUnset: + attr.Value = "" + case ST_MailMergeDocTypeCatalog: + attr.Value = "catalog" + case ST_MailMergeDocTypeEnvelopes: + attr.Value = "envelopes" + case ST_MailMergeDocTypeMailingLabels: + attr.Value = "mailingLabels" + case ST_MailMergeDocTypeFormLetters: + attr.Value = "formLetters" + case ST_MailMergeDocTypeEmail: + attr.Value = "email" + case ST_MailMergeDocTypeFax: + attr.Value = "fax" + } + return attr, nil +} + +func (e *ST_MailMergeDocType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "catalog": + *e = 1 + case "envelopes": + *e = 2 + case "mailingLabels": + *e = 3 + case "formLetters": + *e = 4 + case "email": + *e = 5 + case "fax": + *e = 6 + } + return nil +} + +func (m ST_MailMergeDocType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_MailMergeDocType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "catalog": + *m = 1 + case "envelopes": + *m = 2 + case "mailingLabels": + *m = 3 + case "formLetters": + *m = 4 + case "email": + *m = 5 + case "fax": + *m = 6 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_MailMergeDocType) String() string { + switch m { + case 0: + return "" + case 1: + return "catalog" + case 2: + return "envelopes" + case 3: + return "mailingLabels" + case 4: + return "formLetters" + case 5: + return "email" + case 6: + return "fax" + } + return "" +} + +func (m ST_MailMergeDocType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_MailMergeDocType) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_MailMergeDest byte + +const ( + ST_MailMergeDestUnset ST_MailMergeDest = 0 + ST_MailMergeDestNewDocument ST_MailMergeDest = 1 + ST_MailMergeDestPrinter ST_MailMergeDest = 2 + ST_MailMergeDestEmail ST_MailMergeDest = 3 + ST_MailMergeDestFax ST_MailMergeDest = 4 +) + +func (e ST_MailMergeDest) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_MailMergeDestUnset: + attr.Value = "" + case ST_MailMergeDestNewDocument: + attr.Value = "newDocument" + case ST_MailMergeDestPrinter: + attr.Value = "printer" + case ST_MailMergeDestEmail: + attr.Value = "email" + case ST_MailMergeDestFax: + attr.Value = "fax" + } + return attr, nil +} + +func (e *ST_MailMergeDest) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "newDocument": + *e = 1 + case "printer": + *e = 2 + case "email": + *e = 3 + case "fax": + *e = 4 + } + return nil +} + +func (m ST_MailMergeDest) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_MailMergeDest) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "newDocument": + *m = 1 + case "printer": + *m = 2 + case "email": + *m = 3 + case "fax": + *m = 4 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_MailMergeDest) String() string { + switch m { + case 0: + return "" + case 1: + return "newDocument" + case 2: + return "printer" + case 3: + return "email" + case 4: + return "fax" + } + return "" +} + +func (m ST_MailMergeDest) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_MailMergeDest) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_MailMergeOdsoFMDFieldType byte + +const ( + ST_MailMergeOdsoFMDFieldTypeUnset ST_MailMergeOdsoFMDFieldType = 0 + ST_MailMergeOdsoFMDFieldTypeNull ST_MailMergeOdsoFMDFieldType = 1 + ST_MailMergeOdsoFMDFieldTypeDbColumn ST_MailMergeOdsoFMDFieldType = 2 +) + +func (e ST_MailMergeOdsoFMDFieldType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_MailMergeOdsoFMDFieldTypeUnset: + attr.Value = "" + case ST_MailMergeOdsoFMDFieldTypeNull: + attr.Value = "null" + case ST_MailMergeOdsoFMDFieldTypeDbColumn: + attr.Value = "dbColumn" + } + return attr, nil +} + +func (e *ST_MailMergeOdsoFMDFieldType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "null": + *e = 1 + case "dbColumn": + *e = 2 + } + return nil +} + +func (m ST_MailMergeOdsoFMDFieldType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_MailMergeOdsoFMDFieldType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "null": + *m = 1 + case "dbColumn": + *m = 2 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_MailMergeOdsoFMDFieldType) String() string { + switch m { + case 0: + return "" + case 1: + return "null" + case 2: + return "dbColumn" + } + return "" +} + +func (m ST_MailMergeOdsoFMDFieldType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_MailMergeOdsoFMDFieldType) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_TextDirection byte + +const ( + ST_TextDirectionUnset ST_TextDirection = 0 + ST_TextDirectionTb ST_TextDirection = 1 + ST_TextDirectionRl ST_TextDirection = 2 + ST_TextDirectionLr ST_TextDirection = 3 + ST_TextDirectionTbV ST_TextDirection = 4 + ST_TextDirectionRlV ST_TextDirection = 5 + ST_TextDirectionLrV ST_TextDirection = 6 + ST_TextDirectionBtLr ST_TextDirection = 7 + ST_TextDirectionLrTb ST_TextDirection = 8 + ST_TextDirectionLrTbV ST_TextDirection = 9 + ST_TextDirectionTbLrV ST_TextDirection = 10 + ST_TextDirectionTbRl ST_TextDirection = 11 + ST_TextDirectionTbRlV ST_TextDirection = 12 +) + +func (e ST_TextDirection) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_TextDirectionUnset: + attr.Value = "" + case ST_TextDirectionTb: + attr.Value = "tb" + case ST_TextDirectionRl: + attr.Value = "rl" + case ST_TextDirectionLr: + attr.Value = "lr" + case ST_TextDirectionTbV: + attr.Value = "tbV" + case ST_TextDirectionRlV: + attr.Value = "rlV" + case ST_TextDirectionLrV: + attr.Value = "lrV" + case ST_TextDirectionBtLr: + attr.Value = "btLr" + case ST_TextDirectionLrTb: + attr.Value = "lrTb" + case ST_TextDirectionLrTbV: + attr.Value = "lrTbV" + case ST_TextDirectionTbLrV: + attr.Value = "tbLrV" + case ST_TextDirectionTbRl: + attr.Value = "tbRl" + case ST_TextDirectionTbRlV: + attr.Value = "tbRlV" + } + return attr, nil +} + +func (e *ST_TextDirection) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "tb": + *e = 1 + case "rl": + *e = 2 + case "lr": + *e = 3 + case "tbV": + *e = 4 + case "rlV": + *e = 5 + case "lrV": + *e = 6 + case "btLr": + *e = 7 + case "lrTb": + *e = 8 + case "lrTbV": + *e = 9 + case "tbLrV": + *e = 10 + case "tbRl": + *e = 11 + case "tbRlV": + *e = 12 + } + return nil +} + +func (m ST_TextDirection) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_TextDirection) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "tb": + *m = 1 + case "rl": + *m = 2 + case "lr": + *m = 3 + case "tbV": + *m = 4 + case "rlV": + *m = 5 + case "lrV": + *m = 6 + case "btLr": + *m = 7 + case "lrTb": + *m = 8 + case "lrTbV": + *m = 9 + case "tbLrV": + *m = 10 + case "tbRl": + *m = 11 + case "tbRlV": + *m = 12 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_TextDirection) String() string { + switch m { + case 0: + return "" + case 1: + return "tb" + case 2: + return "rl" + case 3: + return "lr" + case 4: + return "tbV" + case 5: + return "rlV" + case 6: + return "lrV" + case 7: + return "btLr" + case 8: + return "lrTb" + case 9: + return "lrTbV" + case 10: + return "tbLrV" + case 11: + return "tbRl" + case 12: + return "tbRlV" + } + return "" +} + +func (m ST_TextDirection) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_TextDirection) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_TextAlignment byte + +const ( + ST_TextAlignmentUnset ST_TextAlignment = 0 + ST_TextAlignmentTop ST_TextAlignment = 1 + ST_TextAlignmentCenter ST_TextAlignment = 2 + ST_TextAlignmentBaseline ST_TextAlignment = 3 + ST_TextAlignmentBottom ST_TextAlignment = 4 + ST_TextAlignmentAuto ST_TextAlignment = 5 +) + +func (e ST_TextAlignment) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_TextAlignmentUnset: + attr.Value = "" + case ST_TextAlignmentTop: + attr.Value = "top" + case ST_TextAlignmentCenter: + attr.Value = "center" + case ST_TextAlignmentBaseline: + attr.Value = "baseline" + case ST_TextAlignmentBottom: + attr.Value = "bottom" + case ST_TextAlignmentAuto: + attr.Value = "auto" + } + return attr, nil +} + +func (e *ST_TextAlignment) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "top": + *e = 1 + case "center": + *e = 2 + case "baseline": + *e = 3 + case "bottom": + *e = 4 + case "auto": + *e = 5 + } + return nil +} + +func (m ST_TextAlignment) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_TextAlignment) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "top": + *m = 1 + case "center": + *m = 2 + case "baseline": + *m = 3 + case "bottom": + *m = 4 + case "auto": + *m = 5 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_TextAlignment) String() string { + switch m { + case 0: + return "" + case 1: + return "top" + case 2: + return "center" + case 3: + return "baseline" + case 4: + return "bottom" + case 5: + return "auto" + } + return "" +} + +func (m ST_TextAlignment) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_TextAlignment) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_DisplacedByCustomXml byte + +const ( + ST_DisplacedByCustomXmlUnset ST_DisplacedByCustomXml = 0 + ST_DisplacedByCustomXmlNext ST_DisplacedByCustomXml = 1 + ST_DisplacedByCustomXmlPrev ST_DisplacedByCustomXml = 2 +) + +func (e ST_DisplacedByCustomXml) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_DisplacedByCustomXmlUnset: + attr.Value = "" + case ST_DisplacedByCustomXmlNext: + attr.Value = "next" + case ST_DisplacedByCustomXmlPrev: + attr.Value = "prev" + } + return attr, nil +} + +func (e *ST_DisplacedByCustomXml) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "next": + *e = 1 + case "prev": + *e = 2 + } + return nil +} + +func (m ST_DisplacedByCustomXml) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_DisplacedByCustomXml) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "next": + *m = 1 + case "prev": + *m = 2 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_DisplacedByCustomXml) String() string { + switch m { + case 0: + return "" + case 1: + return "next" + case 2: + return "prev" + } + return "" +} + +func (m ST_DisplacedByCustomXml) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_DisplacedByCustomXml) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_AnnotationVMerge byte + +const ( + ST_AnnotationVMergeUnset ST_AnnotationVMerge = 0 + ST_AnnotationVMergeCont ST_AnnotationVMerge = 1 + ST_AnnotationVMergeRest ST_AnnotationVMerge = 2 +) + +func (e ST_AnnotationVMerge) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_AnnotationVMergeUnset: + attr.Value = "" + case ST_AnnotationVMergeCont: + attr.Value = "cont" + case ST_AnnotationVMergeRest: + attr.Value = "rest" + } + return attr, nil +} + +func (e *ST_AnnotationVMerge) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "cont": + *e = 1 + case "rest": + *e = 2 + } + return nil +} + +func (m ST_AnnotationVMerge) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_AnnotationVMerge) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "cont": + *m = 1 + case "rest": + *m = 2 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_AnnotationVMerge) String() string { + switch m { + case 0: + return "" + case 1: + return "cont" + case 2: + return "rest" + } + return "" +} + +func (m ST_AnnotationVMerge) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_AnnotationVMerge) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_TextboxTightWrap byte + +const ( + ST_TextboxTightWrapUnset ST_TextboxTightWrap = 0 + ST_TextboxTightWrapNone ST_TextboxTightWrap = 1 + ST_TextboxTightWrapAllLines ST_TextboxTightWrap = 2 + ST_TextboxTightWrapFirstAndLastLine ST_TextboxTightWrap = 3 + ST_TextboxTightWrapFirstLineOnly ST_TextboxTightWrap = 4 + ST_TextboxTightWrapLastLineOnly ST_TextboxTightWrap = 5 +) + +func (e ST_TextboxTightWrap) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_TextboxTightWrapUnset: + attr.Value = "" + case ST_TextboxTightWrapNone: + attr.Value = "none" + case ST_TextboxTightWrapAllLines: + attr.Value = "allLines" + case ST_TextboxTightWrapFirstAndLastLine: + attr.Value = "firstAndLastLine" + case ST_TextboxTightWrapFirstLineOnly: + attr.Value = "firstLineOnly" + case ST_TextboxTightWrapLastLineOnly: + attr.Value = "lastLineOnly" + } + return attr, nil +} + +func (e *ST_TextboxTightWrap) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "none": + *e = 1 + case "allLines": + *e = 2 + case "firstAndLastLine": + *e = 3 + case "firstLineOnly": + *e = 4 + case "lastLineOnly": + *e = 5 + } + return nil +} + +func (m ST_TextboxTightWrap) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_TextboxTightWrap) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "none": + *m = 1 + case "allLines": + *m = 2 + case "firstAndLastLine": + *m = 3 + case "firstLineOnly": + *m = 4 + case "lastLineOnly": + *m = 5 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_TextboxTightWrap) String() string { + switch m { + case 0: + return "" + case 1: + return "none" + case 2: + return "allLines" + case 3: + return "firstAndLastLine" + case 4: + return "firstLineOnly" + case 5: + return "lastLineOnly" + } + return "" +} + +func (m ST_TextboxTightWrap) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_TextboxTightWrap) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_ObjectDrawAspect byte + +const ( + ST_ObjectDrawAspectUnset ST_ObjectDrawAspect = 0 + ST_ObjectDrawAspectContent ST_ObjectDrawAspect = 1 + ST_ObjectDrawAspectIcon ST_ObjectDrawAspect = 2 +) + +func (e ST_ObjectDrawAspect) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_ObjectDrawAspectUnset: + attr.Value = "" + case ST_ObjectDrawAspectContent: + attr.Value = "content" + case ST_ObjectDrawAspectIcon: + attr.Value = "icon" + } + return attr, nil +} + +func (e *ST_ObjectDrawAspect) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "content": + *e = 1 + case "icon": + *e = 2 + } + return nil +} + +func (m ST_ObjectDrawAspect) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_ObjectDrawAspect) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "content": + *m = 1 + case "icon": + *m = 2 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_ObjectDrawAspect) String() string { + switch m { + case 0: + return "" + case 1: + return "content" + case 2: + return "icon" + } + return "" +} + +func (m ST_ObjectDrawAspect) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_ObjectDrawAspect) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_ObjectUpdateMode byte + +const ( + ST_ObjectUpdateModeUnset ST_ObjectUpdateMode = 0 + ST_ObjectUpdateModeAlways ST_ObjectUpdateMode = 1 + ST_ObjectUpdateModeOnCall ST_ObjectUpdateMode = 2 +) + +func (e ST_ObjectUpdateMode) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_ObjectUpdateModeUnset: + attr.Value = "" + case ST_ObjectUpdateModeAlways: + attr.Value = "always" + case ST_ObjectUpdateModeOnCall: + attr.Value = "onCall" + } + return attr, nil +} + +func (e *ST_ObjectUpdateMode) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "always": + *e = 1 + case "onCall": + *e = 2 + } + return nil +} + +func (m ST_ObjectUpdateMode) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_ObjectUpdateMode) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "always": + *m = 1 + case "onCall": + *m = 2 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_ObjectUpdateMode) String() string { + switch m { + case 0: + return "" + case 1: + return "always" + case 2: + return "onCall" + } + return "" +} + +func (m ST_ObjectUpdateMode) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_ObjectUpdateMode) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_FldCharType byte + +const ( + ST_FldCharTypeUnset ST_FldCharType = 0 + ST_FldCharTypeBegin ST_FldCharType = 1 + ST_FldCharTypeSeparate ST_FldCharType = 2 + ST_FldCharTypeEnd ST_FldCharType = 3 +) + +func (e ST_FldCharType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_FldCharTypeUnset: + attr.Value = "" + case ST_FldCharTypeBegin: + attr.Value = "begin" + case ST_FldCharTypeSeparate: + attr.Value = "separate" + case ST_FldCharTypeEnd: + attr.Value = "end" + } + return attr, nil +} + +func (e *ST_FldCharType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "begin": + *e = 1 + case "separate": + *e = 2 + case "end": + *e = 3 + } + return nil +} + +func (m ST_FldCharType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_FldCharType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "begin": + *m = 1 + case "separate": + *m = 2 + case "end": + *m = 3 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_FldCharType) String() string { + switch m { + case 0: + return "" + case 1: + return "begin" + case 2: + return "separate" + case 3: + return "end" + } + return "" +} + +func (m ST_FldCharType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_FldCharType) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_InfoTextType byte + +const ( + ST_InfoTextTypeUnset ST_InfoTextType = 0 + ST_InfoTextTypeText ST_InfoTextType = 1 + ST_InfoTextTypeAutoText ST_InfoTextType = 2 +) + +func (e ST_InfoTextType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_InfoTextTypeUnset: + attr.Value = "" + case ST_InfoTextTypeText: + attr.Value = "text" + case ST_InfoTextTypeAutoText: + attr.Value = "autoText" + } + return attr, nil +} + +func (e *ST_InfoTextType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "text": + *e = 1 + case "autoText": + *e = 2 + } + return nil +} + +func (m ST_InfoTextType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_InfoTextType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "text": + *m = 1 + case "autoText": + *m = 2 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_InfoTextType) String() string { + switch m { + case 0: + return "" + case 1: + return "text" + case 2: + return "autoText" + } + return "" +} + +func (m ST_InfoTextType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_InfoTextType) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_FFTextType byte + +const ( + ST_FFTextTypeUnset ST_FFTextType = 0 + ST_FFTextTypeRegular ST_FFTextType = 1 + ST_FFTextTypeNumber ST_FFTextType = 2 + ST_FFTextTypeDate ST_FFTextType = 3 + ST_FFTextTypeCurrentTime ST_FFTextType = 4 + ST_FFTextTypeCurrentDate ST_FFTextType = 5 + ST_FFTextTypeCalculated ST_FFTextType = 6 +) + +func (e ST_FFTextType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_FFTextTypeUnset: + attr.Value = "" + case ST_FFTextTypeRegular: + attr.Value = "regular" + case ST_FFTextTypeNumber: + attr.Value = "number" + case ST_FFTextTypeDate: + attr.Value = "date" + case ST_FFTextTypeCurrentTime: + attr.Value = "currentTime" + case ST_FFTextTypeCurrentDate: + attr.Value = "currentDate" + case ST_FFTextTypeCalculated: + attr.Value = "calculated" + } + return attr, nil +} + +func (e *ST_FFTextType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "regular": + *e = 1 + case "number": + *e = 2 + case "date": + *e = 3 + case "currentTime": + *e = 4 + case "currentDate": + *e = 5 + case "calculated": + *e = 6 + } + return nil +} + +func (m ST_FFTextType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_FFTextType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "regular": + *m = 1 + case "number": + *m = 2 + case "date": + *m = 3 + case "currentTime": + *m = 4 + case "currentDate": + *m = 5 + case "calculated": + *m = 6 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_FFTextType) String() string { + switch m { + case 0: + return "" + case 1: + return "regular" + case 2: + return "number" + case 3: + return "date" + case 4: + return "currentTime" + case 5: + return "currentDate" + case 6: + return "calculated" + } + return "" +} + +func (m ST_FFTextType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_FFTextType) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_SectionMark byte + +const ( + ST_SectionMarkUnset ST_SectionMark = 0 + ST_SectionMarkNextPage ST_SectionMark = 1 + ST_SectionMarkNextColumn ST_SectionMark = 2 + ST_SectionMarkContinuous ST_SectionMark = 3 + ST_SectionMarkEvenPage ST_SectionMark = 4 + ST_SectionMarkOddPage ST_SectionMark = 5 +) + +func (e ST_SectionMark) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_SectionMarkUnset: + attr.Value = "" + case ST_SectionMarkNextPage: + attr.Value = "nextPage" + case ST_SectionMarkNextColumn: + attr.Value = "nextColumn" + case ST_SectionMarkContinuous: + attr.Value = "continuous" + case ST_SectionMarkEvenPage: + attr.Value = "evenPage" + case ST_SectionMarkOddPage: + attr.Value = "oddPage" + } + return attr, nil +} + +func (e *ST_SectionMark) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "nextPage": + *e = 1 + case "nextColumn": + *e = 2 + case "continuous": + *e = 3 + case "evenPage": + *e = 4 + case "oddPage": + *e = 5 + } + return nil +} + +func (m ST_SectionMark) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_SectionMark) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "nextPage": + *m = 1 + case "nextColumn": + *m = 2 + case "continuous": + *m = 3 + case "evenPage": + *m = 4 + case "oddPage": + *m = 5 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_SectionMark) String() string { + switch m { + case 0: + return "" + case 1: + return "nextPage" + case 2: + return "nextColumn" + case 3: + return "continuous" + case 4: + return "evenPage" + case 5: + return "oddPage" + } + return "" +} + +func (m ST_SectionMark) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_SectionMark) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_NumberFormat byte + +const ( + ST_NumberFormatUnset ST_NumberFormat = 0 + ST_NumberFormatDecimal ST_NumberFormat = 1 + ST_NumberFormatUpperRoman ST_NumberFormat = 2 + ST_NumberFormatLowerRoman ST_NumberFormat = 3 + ST_NumberFormatUpperLetter ST_NumberFormat = 4 + ST_NumberFormatLowerLetter ST_NumberFormat = 5 + ST_NumberFormatOrdinal ST_NumberFormat = 6 + ST_NumberFormatCardinalText ST_NumberFormat = 7 + ST_NumberFormatOrdinalText ST_NumberFormat = 8 + ST_NumberFormatHex ST_NumberFormat = 9 + ST_NumberFormatChicago ST_NumberFormat = 10 + ST_NumberFormatIdeographDigital ST_NumberFormat = 11 + ST_NumberFormatJapaneseCounting ST_NumberFormat = 12 + ST_NumberFormatAiueo ST_NumberFormat = 13 + ST_NumberFormatIroha ST_NumberFormat = 14 + ST_NumberFormatDecimalFullWidth ST_NumberFormat = 15 + ST_NumberFormatDecimalHalfWidth ST_NumberFormat = 16 + ST_NumberFormatJapaneseLegal ST_NumberFormat = 17 + ST_NumberFormatJapaneseDigitalTenThousand ST_NumberFormat = 18 + ST_NumberFormatDecimalEnclosedCircle ST_NumberFormat = 19 + ST_NumberFormatDecimalFullWidth2 ST_NumberFormat = 20 + ST_NumberFormatAiueoFullWidth ST_NumberFormat = 21 + ST_NumberFormatIrohaFullWidth ST_NumberFormat = 22 + ST_NumberFormatDecimalZero ST_NumberFormat = 23 + ST_NumberFormatBullet ST_NumberFormat = 24 + ST_NumberFormatGanada ST_NumberFormat = 25 + ST_NumberFormatChosung ST_NumberFormat = 26 + ST_NumberFormatDecimalEnclosedFullstop ST_NumberFormat = 27 + ST_NumberFormatDecimalEnclosedParen ST_NumberFormat = 28 + ST_NumberFormatDecimalEnclosedCircleChinese ST_NumberFormat = 29 + ST_NumberFormatIdeographEnclosedCircle ST_NumberFormat = 30 + ST_NumberFormatIdeographTraditional ST_NumberFormat = 31 + ST_NumberFormatIdeographZodiac ST_NumberFormat = 32 + ST_NumberFormatIdeographZodiacTraditional ST_NumberFormat = 33 + ST_NumberFormatTaiwaneseCounting ST_NumberFormat = 34 + ST_NumberFormatIdeographLegalTraditional ST_NumberFormat = 35 + ST_NumberFormatTaiwaneseCountingThousand ST_NumberFormat = 36 + ST_NumberFormatTaiwaneseDigital ST_NumberFormat = 37 + ST_NumberFormatChineseCounting ST_NumberFormat = 38 + ST_NumberFormatChineseLegalSimplified ST_NumberFormat = 39 + ST_NumberFormatChineseCountingThousand ST_NumberFormat = 40 + ST_NumberFormatKoreanDigital ST_NumberFormat = 41 + ST_NumberFormatKoreanCounting ST_NumberFormat = 42 + ST_NumberFormatKoreanLegal ST_NumberFormat = 43 + ST_NumberFormatKoreanDigital2 ST_NumberFormat = 44 + ST_NumberFormatVietnameseCounting ST_NumberFormat = 45 + ST_NumberFormatRussianLower ST_NumberFormat = 46 + ST_NumberFormatRussianUpper ST_NumberFormat = 47 + ST_NumberFormatNone ST_NumberFormat = 48 + ST_NumberFormatNumberInDash ST_NumberFormat = 49 + ST_NumberFormatHebrew1 ST_NumberFormat = 50 + ST_NumberFormatHebrew2 ST_NumberFormat = 51 + ST_NumberFormatArabicAlpha ST_NumberFormat = 52 + ST_NumberFormatArabicAbjad ST_NumberFormat = 53 + ST_NumberFormatHindiVowels ST_NumberFormat = 54 + ST_NumberFormatHindiConsonants ST_NumberFormat = 55 + ST_NumberFormatHindiNumbers ST_NumberFormat = 56 + ST_NumberFormatHindiCounting ST_NumberFormat = 57 + ST_NumberFormatThaiLetters ST_NumberFormat = 58 + ST_NumberFormatThaiNumbers ST_NumberFormat = 59 + ST_NumberFormatThaiCounting ST_NumberFormat = 60 + ST_NumberFormatBahtText ST_NumberFormat = 61 + ST_NumberFormatDollarText ST_NumberFormat = 62 + ST_NumberFormatCustom ST_NumberFormat = 63 +) + +func (e ST_NumberFormat) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_NumberFormatUnset: + attr.Value = "" + case ST_NumberFormatDecimal: + attr.Value = "decimal" + case ST_NumberFormatUpperRoman: + attr.Value = "upperRoman" + case ST_NumberFormatLowerRoman: + attr.Value = "lowerRoman" + case ST_NumberFormatUpperLetter: + attr.Value = "upperLetter" + case ST_NumberFormatLowerLetter: + attr.Value = "lowerLetter" + case ST_NumberFormatOrdinal: + attr.Value = "ordinal" + case ST_NumberFormatCardinalText: + attr.Value = "cardinalText" + case ST_NumberFormatOrdinalText: + attr.Value = "ordinalText" + case ST_NumberFormatHex: + attr.Value = "hex" + case ST_NumberFormatChicago: + attr.Value = "chicago" + case ST_NumberFormatIdeographDigital: + attr.Value = "ideographDigital" + case ST_NumberFormatJapaneseCounting: + attr.Value = "japaneseCounting" + case ST_NumberFormatAiueo: + attr.Value = "aiueo" + case ST_NumberFormatIroha: + attr.Value = "iroha" + case ST_NumberFormatDecimalFullWidth: + attr.Value = "decimalFullWidth" + case ST_NumberFormatDecimalHalfWidth: + attr.Value = "decimalHalfWidth" + case ST_NumberFormatJapaneseLegal: + attr.Value = "japaneseLegal" + case ST_NumberFormatJapaneseDigitalTenThousand: + attr.Value = "japaneseDigitalTenThousand" + case ST_NumberFormatDecimalEnclosedCircle: + attr.Value = "decimalEnclosedCircle" + case ST_NumberFormatDecimalFullWidth2: + attr.Value = "decimalFullWidth2" + case ST_NumberFormatAiueoFullWidth: + attr.Value = "aiueoFullWidth" + case ST_NumberFormatIrohaFullWidth: + attr.Value = "irohaFullWidth" + case ST_NumberFormatDecimalZero: + attr.Value = "decimalZero" + case ST_NumberFormatBullet: + attr.Value = "bullet" + case ST_NumberFormatGanada: + attr.Value = "ganada" + case ST_NumberFormatChosung: + attr.Value = "chosung" + case ST_NumberFormatDecimalEnclosedFullstop: + attr.Value = "decimalEnclosedFullstop" + case ST_NumberFormatDecimalEnclosedParen: + attr.Value = "decimalEnclosedParen" + case ST_NumberFormatDecimalEnclosedCircleChinese: + attr.Value = "decimalEnclosedCircleChinese" + case ST_NumberFormatIdeographEnclosedCircle: + attr.Value = "ideographEnclosedCircle" + case ST_NumberFormatIdeographTraditional: + attr.Value = "ideographTraditional" + case ST_NumberFormatIdeographZodiac: + attr.Value = "ideographZodiac" + case ST_NumberFormatIdeographZodiacTraditional: + attr.Value = "ideographZodiacTraditional" + case ST_NumberFormatTaiwaneseCounting: + attr.Value = "taiwaneseCounting" + case ST_NumberFormatIdeographLegalTraditional: + attr.Value = "ideographLegalTraditional" + case ST_NumberFormatTaiwaneseCountingThousand: + attr.Value = "taiwaneseCountingThousand" + case ST_NumberFormatTaiwaneseDigital: + attr.Value = "taiwaneseDigital" + case ST_NumberFormatChineseCounting: + attr.Value = "chineseCounting" + case ST_NumberFormatChineseLegalSimplified: + attr.Value = "chineseLegalSimplified" + case ST_NumberFormatChineseCountingThousand: + attr.Value = "chineseCountingThousand" + case ST_NumberFormatKoreanDigital: + attr.Value = "koreanDigital" + case ST_NumberFormatKoreanCounting: + attr.Value = "koreanCounting" + case ST_NumberFormatKoreanLegal: + attr.Value = "koreanLegal" + case ST_NumberFormatKoreanDigital2: + attr.Value = "koreanDigital2" + case ST_NumberFormatVietnameseCounting: + attr.Value = "vietnameseCounting" + case ST_NumberFormatRussianLower: + attr.Value = "russianLower" + case ST_NumberFormatRussianUpper: + attr.Value = "russianUpper" + case ST_NumberFormatNone: + attr.Value = "none" + case ST_NumberFormatNumberInDash: + attr.Value = "numberInDash" + case ST_NumberFormatHebrew1: + attr.Value = "hebrew1" + case ST_NumberFormatHebrew2: + attr.Value = "hebrew2" + case ST_NumberFormatArabicAlpha: + attr.Value = "arabicAlpha" + case ST_NumberFormatArabicAbjad: + attr.Value = "arabicAbjad" + case ST_NumberFormatHindiVowels: + attr.Value = "hindiVowels" + case ST_NumberFormatHindiConsonants: + attr.Value = "hindiConsonants" + case ST_NumberFormatHindiNumbers: + attr.Value = "hindiNumbers" + case ST_NumberFormatHindiCounting: + attr.Value = "hindiCounting" + case ST_NumberFormatThaiLetters: + attr.Value = "thaiLetters" + case ST_NumberFormatThaiNumbers: + attr.Value = "thaiNumbers" + case ST_NumberFormatThaiCounting: + attr.Value = "thaiCounting" + case ST_NumberFormatBahtText: + attr.Value = "bahtText" + case ST_NumberFormatDollarText: + attr.Value = "dollarText" + case ST_NumberFormatCustom: + attr.Value = "custom" + } + return attr, nil +} + +func (e *ST_NumberFormat) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "decimal": + *e = 1 + case "upperRoman": + *e = 2 + case "lowerRoman": + *e = 3 + case "upperLetter": + *e = 4 + case "lowerLetter": + *e = 5 + case "ordinal": + *e = 6 + case "cardinalText": + *e = 7 + case "ordinalText": + *e = 8 + case "hex": + *e = 9 + case "chicago": + *e = 10 + case "ideographDigital": + *e = 11 + case "japaneseCounting": + *e = 12 + case "aiueo": + *e = 13 + case "iroha": + *e = 14 + case "decimalFullWidth": + *e = 15 + case "decimalHalfWidth": + *e = 16 + case "japaneseLegal": + *e = 17 + case "japaneseDigitalTenThousand": + *e = 18 + case "decimalEnclosedCircle": + *e = 19 + case "decimalFullWidth2": + *e = 20 + case "aiueoFullWidth": + *e = 21 + case "irohaFullWidth": + *e = 22 + case "decimalZero": + *e = 23 + case "bullet": + *e = 24 + case "ganada": + *e = 25 + case "chosung": + *e = 26 + case "decimalEnclosedFullstop": + *e = 27 + case "decimalEnclosedParen": + *e = 28 + case "decimalEnclosedCircleChinese": + *e = 29 + case "ideographEnclosedCircle": + *e = 30 + case "ideographTraditional": + *e = 31 + case "ideographZodiac": + *e = 32 + case "ideographZodiacTraditional": + *e = 33 + case "taiwaneseCounting": + *e = 34 + case "ideographLegalTraditional": + *e = 35 + case "taiwaneseCountingThousand": + *e = 36 + case "taiwaneseDigital": + *e = 37 + case "chineseCounting": + *e = 38 + case "chineseLegalSimplified": + *e = 39 + case "chineseCountingThousand": + *e = 40 + case "koreanDigital": + *e = 41 + case "koreanCounting": + *e = 42 + case "koreanLegal": + *e = 43 + case "koreanDigital2": + *e = 44 + case "vietnameseCounting": + *e = 45 + case "russianLower": + *e = 46 + case "russianUpper": + *e = 47 + case "none": + *e = 48 + case "numberInDash": + *e = 49 + case "hebrew1": + *e = 50 + case "hebrew2": + *e = 51 + case "arabicAlpha": + *e = 52 + case "arabicAbjad": + *e = 53 + case "hindiVowels": + *e = 54 + case "hindiConsonants": + *e = 55 + case "hindiNumbers": + *e = 56 + case "hindiCounting": + *e = 57 + case "thaiLetters": + *e = 58 + case "thaiNumbers": + *e = 59 + case "thaiCounting": + *e = 60 + case "bahtText": + *e = 61 + case "dollarText": + *e = 62 + case "custom": + *e = 63 + } + return nil +} + +func (m ST_NumberFormat) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_NumberFormat) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "decimal": + *m = 1 + case "upperRoman": + *m = 2 + case "lowerRoman": + *m = 3 + case "upperLetter": + *m = 4 + case "lowerLetter": + *m = 5 + case "ordinal": + *m = 6 + case "cardinalText": + *m = 7 + case "ordinalText": + *m = 8 + case "hex": + *m = 9 + case "chicago": + *m = 10 + case "ideographDigital": + *m = 11 + case "japaneseCounting": + *m = 12 + case "aiueo": + *m = 13 + case "iroha": + *m = 14 + case "decimalFullWidth": + *m = 15 + case "decimalHalfWidth": + *m = 16 + case "japaneseLegal": + *m = 17 + case "japaneseDigitalTenThousand": + *m = 18 + case "decimalEnclosedCircle": + *m = 19 + case "decimalFullWidth2": + *m = 20 + case "aiueoFullWidth": + *m = 21 + case "irohaFullWidth": + *m = 22 + case "decimalZero": + *m = 23 + case "bullet": + *m = 24 + case "ganada": + *m = 25 + case "chosung": + *m = 26 + case "decimalEnclosedFullstop": + *m = 27 + case "decimalEnclosedParen": + *m = 28 + case "decimalEnclosedCircleChinese": + *m = 29 + case "ideographEnclosedCircle": + *m = 30 + case "ideographTraditional": + *m = 31 + case "ideographZodiac": + *m = 32 + case "ideographZodiacTraditional": + *m = 33 + case "taiwaneseCounting": + *m = 34 + case "ideographLegalTraditional": + *m = 35 + case "taiwaneseCountingThousand": + *m = 36 + case "taiwaneseDigital": + *m = 37 + case "chineseCounting": + *m = 38 + case "chineseLegalSimplified": + *m = 39 + case "chineseCountingThousand": + *m = 40 + case "koreanDigital": + *m = 41 + case "koreanCounting": + *m = 42 + case "koreanLegal": + *m = 43 + case "koreanDigital2": + *m = 44 + case "vietnameseCounting": + *m = 45 + case "russianLower": + *m = 46 + case "russianUpper": + *m = 47 + case "none": + *m = 48 + case "numberInDash": + *m = 49 + case "hebrew1": + *m = 50 + case "hebrew2": + *m = 51 + case "arabicAlpha": + *m = 52 + case "arabicAbjad": + *m = 53 + case "hindiVowels": + *m = 54 + case "hindiConsonants": + *m = 55 + case "hindiNumbers": + *m = 56 + case "hindiCounting": + *m = 57 + case "thaiLetters": + *m = 58 + case "thaiNumbers": + *m = 59 + case "thaiCounting": + *m = 60 + case "bahtText": + *m = 61 + case "dollarText": + *m = 62 + case "custom": + *m = 63 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_NumberFormat) String() string { + switch m { + case 0: + return "" + case 1: + return "decimal" + case 2: + return "upperRoman" + case 3: + return "lowerRoman" + case 4: + return "upperLetter" + case 5: + return "lowerLetter" + case 6: + return "ordinal" + case 7: + return "cardinalText" + case 8: + return "ordinalText" + case 9: + return "hex" + case 10: + return "chicago" + case 11: + return "ideographDigital" + case 12: + return "japaneseCounting" + case 13: + return "aiueo" + case 14: + return "iroha" + case 15: + return "decimalFullWidth" + case 16: + return "decimalHalfWidth" + case 17: + return "japaneseLegal" + case 18: + return "japaneseDigitalTenThousand" + case 19: + return "decimalEnclosedCircle" + case 20: + return "decimalFullWidth2" + case 21: + return "aiueoFullWidth" + case 22: + return "irohaFullWidth" + case 23: + return "decimalZero" + case 24: + return "bullet" + case 25: + return "ganada" + case 26: + return "chosung" + case 27: + return "decimalEnclosedFullstop" + case 28: + return "decimalEnclosedParen" + case 29: + return "decimalEnclosedCircleChinese" + case 30: + return "ideographEnclosedCircle" + case 31: + return "ideographTraditional" + case 32: + return "ideographZodiac" + case 33: + return "ideographZodiacTraditional" + case 34: + return "taiwaneseCounting" + case 35: + return "ideographLegalTraditional" + case 36: + return "taiwaneseCountingThousand" + case 37: + return "taiwaneseDigital" + case 38: + return "chineseCounting" + case 39: + return "chineseLegalSimplified" + case 40: + return "chineseCountingThousand" + case 41: + return "koreanDigital" + case 42: + return "koreanCounting" + case 43: + return "koreanLegal" + case 44: + return "koreanDigital2" + case 45: + return "vietnameseCounting" + case 46: + return "russianLower" + case 47: + return "russianUpper" + case 48: + return "none" + case 49: + return "numberInDash" + case 50: + return "hebrew1" + case 51: + return "hebrew2" + case 52: + return "arabicAlpha" + case 53: + return "arabicAbjad" + case 54: + return "hindiVowels" + case 55: + return "hindiConsonants" + case 56: + return "hindiNumbers" + case 57: + return "hindiCounting" + case 58: + return "thaiLetters" + case 59: + return "thaiNumbers" + case 60: + return "thaiCounting" + case 61: + return "bahtText" + case 62: + return "dollarText" + case 63: + return "custom" + } + return "" +} + +func (m ST_NumberFormat) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_NumberFormat) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_PageOrientation byte + +const ( + ST_PageOrientationUnset ST_PageOrientation = 0 + ST_PageOrientationPortrait ST_PageOrientation = 1 + ST_PageOrientationLandscape ST_PageOrientation = 2 +) + +func (e ST_PageOrientation) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_PageOrientationUnset: + attr.Value = "" + case ST_PageOrientationPortrait: + attr.Value = "portrait" + case ST_PageOrientationLandscape: + attr.Value = "landscape" + } + return attr, nil +} + +func (e *ST_PageOrientation) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "portrait": + *e = 1 + case "landscape": + *e = 2 + } + return nil +} + +func (m ST_PageOrientation) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_PageOrientation) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "portrait": + *m = 1 + case "landscape": + *m = 2 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_PageOrientation) String() string { + switch m { + case 0: + return "" + case 1: + return "portrait" + case 2: + return "landscape" + } + return "" +} + +func (m ST_PageOrientation) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_PageOrientation) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_PageBorderZOrder byte + +const ( + ST_PageBorderZOrderUnset ST_PageBorderZOrder = 0 + ST_PageBorderZOrderFront ST_PageBorderZOrder = 1 + ST_PageBorderZOrderBack ST_PageBorderZOrder = 2 +) + +func (e ST_PageBorderZOrder) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_PageBorderZOrderUnset: + attr.Value = "" + case ST_PageBorderZOrderFront: + attr.Value = "front" + case ST_PageBorderZOrderBack: + attr.Value = "back" + } + return attr, nil +} + +func (e *ST_PageBorderZOrder) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "front": + *e = 1 + case "back": + *e = 2 + } + return nil +} + +func (m ST_PageBorderZOrder) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_PageBorderZOrder) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "front": + *m = 1 + case "back": + *m = 2 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_PageBorderZOrder) String() string { + switch m { + case 0: + return "" + case 1: + return "front" + case 2: + return "back" + } + return "" +} + +func (m ST_PageBorderZOrder) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_PageBorderZOrder) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_PageBorderDisplay byte + +const ( + ST_PageBorderDisplayUnset ST_PageBorderDisplay = 0 + ST_PageBorderDisplayAllPages ST_PageBorderDisplay = 1 + ST_PageBorderDisplayFirstPage ST_PageBorderDisplay = 2 + ST_PageBorderDisplayNotFirstPage ST_PageBorderDisplay = 3 +) + +func (e ST_PageBorderDisplay) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_PageBorderDisplayUnset: + attr.Value = "" + case ST_PageBorderDisplayAllPages: + attr.Value = "allPages" + case ST_PageBorderDisplayFirstPage: + attr.Value = "firstPage" + case ST_PageBorderDisplayNotFirstPage: + attr.Value = "notFirstPage" + } + return attr, nil +} + +func (e *ST_PageBorderDisplay) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "allPages": + *e = 1 + case "firstPage": + *e = 2 + case "notFirstPage": + *e = 3 + } + return nil +} + +func (m ST_PageBorderDisplay) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_PageBorderDisplay) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "allPages": + *m = 1 + case "firstPage": + *m = 2 + case "notFirstPage": + *m = 3 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_PageBorderDisplay) String() string { + switch m { + case 0: + return "" + case 1: + return "allPages" + case 2: + return "firstPage" + case 3: + return "notFirstPage" + } + return "" +} + +func (m ST_PageBorderDisplay) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_PageBorderDisplay) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_PageBorderOffset byte + +const ( + ST_PageBorderOffsetUnset ST_PageBorderOffset = 0 + ST_PageBorderOffsetPage ST_PageBorderOffset = 1 + ST_PageBorderOffsetText ST_PageBorderOffset = 2 +) + +func (e ST_PageBorderOffset) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_PageBorderOffsetUnset: + attr.Value = "" + case ST_PageBorderOffsetPage: + attr.Value = "page" + case ST_PageBorderOffsetText: + attr.Value = "text" + } + return attr, nil +} + +func (e *ST_PageBorderOffset) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "page": + *e = 1 + case "text": + *e = 2 + } + return nil +} + +func (m ST_PageBorderOffset) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_PageBorderOffset) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "page": + *m = 1 + case "text": + *m = 2 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_PageBorderOffset) String() string { + switch m { + case 0: + return "" + case 1: + return "page" + case 2: + return "text" + } + return "" +} + +func (m ST_PageBorderOffset) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_PageBorderOffset) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_ChapterSep byte + +const ( + ST_ChapterSepUnset ST_ChapterSep = 0 + ST_ChapterSepHyphen ST_ChapterSep = 1 + ST_ChapterSepPeriod ST_ChapterSep = 2 + ST_ChapterSepColon ST_ChapterSep = 3 + ST_ChapterSepEmDash ST_ChapterSep = 4 + ST_ChapterSepEnDash ST_ChapterSep = 5 +) + +func (e ST_ChapterSep) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_ChapterSepUnset: + attr.Value = "" + case ST_ChapterSepHyphen: + attr.Value = "hyphen" + case ST_ChapterSepPeriod: + attr.Value = "period" + case ST_ChapterSepColon: + attr.Value = "colon" + case ST_ChapterSepEmDash: + attr.Value = "emDash" + case ST_ChapterSepEnDash: + attr.Value = "enDash" + } + return attr, nil +} + +func (e *ST_ChapterSep) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "hyphen": + *e = 1 + case "period": + *e = 2 + case "colon": + *e = 3 + case "emDash": + *e = 4 + case "enDash": + *e = 5 + } + return nil +} + +func (m ST_ChapterSep) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_ChapterSep) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "hyphen": + *m = 1 + case "period": + *m = 2 + case "colon": + *m = 3 + case "emDash": + *m = 4 + case "enDash": + *m = 5 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_ChapterSep) String() string { + switch m { + case 0: + return "" + case 1: + return "hyphen" + case 2: + return "period" + case 3: + return "colon" + case 4: + return "emDash" + case 5: + return "enDash" + } + return "" +} + +func (m ST_ChapterSep) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_ChapterSep) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_LineNumberRestart byte + +const ( + ST_LineNumberRestartUnset ST_LineNumberRestart = 0 + ST_LineNumberRestartNewPage ST_LineNumberRestart = 1 + ST_LineNumberRestartNewSection ST_LineNumberRestart = 2 + ST_LineNumberRestartContinuous ST_LineNumberRestart = 3 +) + +func (e ST_LineNumberRestart) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_LineNumberRestartUnset: + attr.Value = "" + case ST_LineNumberRestartNewPage: + attr.Value = "newPage" + case ST_LineNumberRestartNewSection: + attr.Value = "newSection" + case ST_LineNumberRestartContinuous: + attr.Value = "continuous" + } + return attr, nil +} + +func (e *ST_LineNumberRestart) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "newPage": + *e = 1 + case "newSection": + *e = 2 + case "continuous": + *e = 3 + } + return nil +} + +func (m ST_LineNumberRestart) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_LineNumberRestart) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "newPage": + *m = 1 + case "newSection": + *m = 2 + case "continuous": + *m = 3 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_LineNumberRestart) String() string { + switch m { + case 0: + return "" + case 1: + return "newPage" + case 2: + return "newSection" + case 3: + return "continuous" + } + return "" +} + +func (m ST_LineNumberRestart) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_LineNumberRestart) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_VerticalJc byte + +const ( + ST_VerticalJcUnset ST_VerticalJc = 0 + ST_VerticalJcTop ST_VerticalJc = 1 + ST_VerticalJcCenter ST_VerticalJc = 2 + ST_VerticalJcBoth ST_VerticalJc = 3 + ST_VerticalJcBottom ST_VerticalJc = 4 +) + +func (e ST_VerticalJc) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_VerticalJcUnset: + attr.Value = "" + case ST_VerticalJcTop: + attr.Value = "top" + case ST_VerticalJcCenter: + attr.Value = "center" + case ST_VerticalJcBoth: + attr.Value = "both" + case ST_VerticalJcBottom: + attr.Value = "bottom" + } + return attr, nil +} + +func (e *ST_VerticalJc) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "top": + *e = 1 + case "center": + *e = 2 + case "both": + *e = 3 + case "bottom": + *e = 4 + } + return nil +} + +func (m ST_VerticalJc) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_VerticalJc) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "top": + *m = 1 + case "center": + *m = 2 + case "both": + *m = 3 + case "bottom": + *m = 4 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_VerticalJc) String() string { + switch m { + case 0: + return "" + case 1: + return "top" + case 2: + return "center" + case 3: + return "both" + case 4: + return "bottom" + } + return "" +} + +func (m ST_VerticalJc) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_VerticalJc) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_DocGrid byte + +const ( + ST_DocGridUnset ST_DocGrid = 0 + ST_DocGridDefault ST_DocGrid = 1 + ST_DocGridLines ST_DocGrid = 2 + ST_DocGridLinesAndChars ST_DocGrid = 3 + ST_DocGridSnapToChars ST_DocGrid = 4 +) + +func (e ST_DocGrid) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_DocGridUnset: + attr.Value = "" + case ST_DocGridDefault: + attr.Value = "default" + case ST_DocGridLines: + attr.Value = "lines" + case ST_DocGridLinesAndChars: + attr.Value = "linesAndChars" + case ST_DocGridSnapToChars: + attr.Value = "snapToChars" + } + return attr, nil +} + +func (e *ST_DocGrid) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "default": + *e = 1 + case "lines": + *e = 2 + case "linesAndChars": + *e = 3 + case "snapToChars": + *e = 4 + } + return nil +} + +func (m ST_DocGrid) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_DocGrid) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "default": + *m = 1 + case "lines": + *m = 2 + case "linesAndChars": + *m = 3 + case "snapToChars": + *m = 4 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_DocGrid) String() string { + switch m { + case 0: + return "" + case 1: + return "default" + case 2: + return "lines" + case 3: + return "linesAndChars" + case 4: + return "snapToChars" + } + return "" +} + +func (m ST_DocGrid) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_DocGrid) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_HdrFtr byte + +const ( + ST_HdrFtrUnset ST_HdrFtr = 0 + ST_HdrFtrEven ST_HdrFtr = 1 + ST_HdrFtrDefault ST_HdrFtr = 2 + ST_HdrFtrFirst ST_HdrFtr = 3 +) + +func (e ST_HdrFtr) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_HdrFtrUnset: + attr.Value = "" + case ST_HdrFtrEven: + attr.Value = "even" + case ST_HdrFtrDefault: + attr.Value = "default" + case ST_HdrFtrFirst: + attr.Value = "first" + } + return attr, nil +} + +func (e *ST_HdrFtr) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "even": + *e = 1 + case "default": + *e = 2 + case "first": + *e = 3 + } + return nil +} + +func (m ST_HdrFtr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_HdrFtr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "even": + *m = 1 + case "default": + *m = 2 + case "first": + *m = 3 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_HdrFtr) String() string { + switch m { + case 0: + return "" + case 1: + return "even" + case 2: + return "default" + case 3: + return "first" + } + return "" +} + +func (m ST_HdrFtr) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_HdrFtr) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_FtnEdn byte + +const ( + ST_FtnEdnUnset ST_FtnEdn = 0 + ST_FtnEdnNormal ST_FtnEdn = 1 + ST_FtnEdnSeparator ST_FtnEdn = 2 + ST_FtnEdnContinuationSeparator ST_FtnEdn = 3 + ST_FtnEdnContinuationNotice ST_FtnEdn = 4 +) + +func (e ST_FtnEdn) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_FtnEdnUnset: + attr.Value = "" + case ST_FtnEdnNormal: + attr.Value = "normal" + case ST_FtnEdnSeparator: + attr.Value = "separator" + case ST_FtnEdnContinuationSeparator: + attr.Value = "continuationSeparator" + case ST_FtnEdnContinuationNotice: + attr.Value = "continuationNotice" + } + return attr, nil +} + +func (e *ST_FtnEdn) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "normal": + *e = 1 + case "separator": + *e = 2 + case "continuationSeparator": + *e = 3 + case "continuationNotice": + *e = 4 + } + return nil +} + +func (m ST_FtnEdn) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_FtnEdn) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "normal": + *m = 1 + case "separator": + *m = 2 + case "continuationSeparator": + *m = 3 + case "continuationNotice": + *m = 4 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_FtnEdn) String() string { + switch m { + case 0: + return "" + case 1: + return "normal" + case 2: + return "separator" + case 3: + return "continuationSeparator" + case 4: + return "continuationNotice" + } + return "" +} + +func (m ST_FtnEdn) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_FtnEdn) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_BrType byte + +const ( + ST_BrTypeUnset ST_BrType = 0 + ST_BrTypePage ST_BrType = 1 + ST_BrTypeColumn ST_BrType = 2 + ST_BrTypeTextWrapping ST_BrType = 3 +) + +func (e ST_BrType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_BrTypeUnset: + attr.Value = "" + case ST_BrTypePage: + attr.Value = "page" + case ST_BrTypeColumn: + attr.Value = "column" + case ST_BrTypeTextWrapping: + attr.Value = "textWrapping" + } + return attr, nil +} + +func (e *ST_BrType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "page": + *e = 1 + case "column": + *e = 2 + case "textWrapping": + *e = 3 + } + return nil +} + +func (m ST_BrType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_BrType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "page": + *m = 1 + case "column": + *m = 2 + case "textWrapping": + *m = 3 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_BrType) String() string { + switch m { + case 0: + return "" + case 1: + return "page" + case 2: + return "column" + case 3: + return "textWrapping" + } + return "" +} + +func (m ST_BrType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_BrType) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_BrClear byte + +const ( + ST_BrClearUnset ST_BrClear = 0 + ST_BrClearNone ST_BrClear = 1 + ST_BrClearLeft ST_BrClear = 2 + ST_BrClearRight ST_BrClear = 3 + ST_BrClearAll ST_BrClear = 4 +) + +func (e ST_BrClear) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_BrClearUnset: + attr.Value = "" + case ST_BrClearNone: + attr.Value = "none" + case ST_BrClearLeft: + attr.Value = "left" + case ST_BrClearRight: + attr.Value = "right" + case ST_BrClearAll: + attr.Value = "all" + } + return attr, nil +} + +func (e *ST_BrClear) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "none": + *e = 1 + case "left": + *e = 2 + case "right": + *e = 3 + case "all": + *e = 4 + } + return nil +} + +func (m ST_BrClear) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_BrClear) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "none": + *m = 1 + case "left": + *m = 2 + case "right": + *m = 3 + case "all": + *m = 4 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_BrClear) String() string { + switch m { + case 0: + return "" + case 1: + return "none" + case 2: + return "left" + case 3: + return "right" + case 4: + return "all" + } + return "" +} + +func (m ST_BrClear) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_BrClear) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_PTabAlignment byte + +const ( + ST_PTabAlignmentUnset ST_PTabAlignment = 0 + ST_PTabAlignmentLeft ST_PTabAlignment = 1 + ST_PTabAlignmentCenter ST_PTabAlignment = 2 + ST_PTabAlignmentRight ST_PTabAlignment = 3 +) + +func (e ST_PTabAlignment) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_PTabAlignmentUnset: + attr.Value = "" + case ST_PTabAlignmentLeft: + attr.Value = "left" + case ST_PTabAlignmentCenter: + attr.Value = "center" + case ST_PTabAlignmentRight: + attr.Value = "right" + } + return attr, nil +} + +func (e *ST_PTabAlignment) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "left": + *e = 1 + case "center": + *e = 2 + case "right": + *e = 3 + } + return nil +} + +func (m ST_PTabAlignment) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_PTabAlignment) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "left": + *m = 1 + case "center": + *m = 2 + case "right": + *m = 3 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_PTabAlignment) String() string { + switch m { + case 0: + return "" + case 1: + return "left" + case 2: + return "center" + case 3: + return "right" + } + return "" +} + +func (m ST_PTabAlignment) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_PTabAlignment) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_PTabRelativeTo byte + +const ( + ST_PTabRelativeToUnset ST_PTabRelativeTo = 0 + ST_PTabRelativeToMargin ST_PTabRelativeTo = 1 + ST_PTabRelativeToIndent ST_PTabRelativeTo = 2 +) + +func (e ST_PTabRelativeTo) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_PTabRelativeToUnset: + attr.Value = "" + case ST_PTabRelativeToMargin: + attr.Value = "margin" + case ST_PTabRelativeToIndent: + attr.Value = "indent" + } + return attr, nil +} + +func (e *ST_PTabRelativeTo) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "margin": + *e = 1 + case "indent": + *e = 2 + } + return nil +} + +func (m ST_PTabRelativeTo) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_PTabRelativeTo) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "margin": + *m = 1 + case "indent": + *m = 2 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_PTabRelativeTo) String() string { + switch m { + case 0: + return "" + case 1: + return "margin" + case 2: + return "indent" + } + return "" +} + +func (m ST_PTabRelativeTo) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_PTabRelativeTo) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_PTabLeader byte + +const ( + ST_PTabLeaderUnset ST_PTabLeader = 0 + ST_PTabLeaderNone ST_PTabLeader = 1 + ST_PTabLeaderDot ST_PTabLeader = 2 + ST_PTabLeaderHyphen ST_PTabLeader = 3 + ST_PTabLeaderUnderscore ST_PTabLeader = 4 + ST_PTabLeaderMiddleDot ST_PTabLeader = 5 +) + +func (e ST_PTabLeader) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_PTabLeaderUnset: + attr.Value = "" + case ST_PTabLeaderNone: + attr.Value = "none" + case ST_PTabLeaderDot: + attr.Value = "dot" + case ST_PTabLeaderHyphen: + attr.Value = "hyphen" + case ST_PTabLeaderUnderscore: + attr.Value = "underscore" + case ST_PTabLeaderMiddleDot: + attr.Value = "middleDot" + } + return attr, nil +} + +func (e *ST_PTabLeader) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "none": + *e = 1 + case "dot": + *e = 2 + case "hyphen": + *e = 3 + case "underscore": + *e = 4 + case "middleDot": + *e = 5 + } + return nil +} + +func (m ST_PTabLeader) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_PTabLeader) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "none": + *m = 1 + case "dot": + *m = 2 + case "hyphen": + *m = 3 + case "underscore": + *m = 4 + case "middleDot": + *m = 5 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_PTabLeader) String() string { + switch m { + case 0: + return "" + case 1: + return "none" + case 2: + return "dot" + case 3: + return "hyphen" + case 4: + return "underscore" + case 5: + return "middleDot" + } + return "" +} + +func (m ST_PTabLeader) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_PTabLeader) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_ProofErr byte + +const ( + ST_ProofErrUnset ST_ProofErr = 0 + ST_ProofErrSpellStart ST_ProofErr = 1 + ST_ProofErrSpellEnd ST_ProofErr = 2 + ST_ProofErrGramStart ST_ProofErr = 3 + ST_ProofErrGramEnd ST_ProofErr = 4 +) + +func (e ST_ProofErr) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_ProofErrUnset: + attr.Value = "" + case ST_ProofErrSpellStart: + attr.Value = "spellStart" + case ST_ProofErrSpellEnd: + attr.Value = "spellEnd" + case ST_ProofErrGramStart: + attr.Value = "gramStart" + case ST_ProofErrGramEnd: + attr.Value = "gramEnd" + } + return attr, nil +} + +func (e *ST_ProofErr) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "spellStart": + *e = 1 + case "spellEnd": + *e = 2 + case "gramStart": + *e = 3 + case "gramEnd": + *e = 4 + } + return nil +} + +func (m ST_ProofErr) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_ProofErr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "spellStart": + *m = 1 + case "spellEnd": + *m = 2 + case "gramStart": + *m = 3 + case "gramEnd": + *m = 4 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_ProofErr) String() string { + switch m { + case 0: + return "" + case 1: + return "spellStart" + case 2: + return "spellEnd" + case 3: + return "gramStart" + case 4: + return "gramEnd" + } + return "" +} + +func (m ST_ProofErr) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_ProofErr) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_EdGrp byte + +const ( + ST_EdGrpUnset ST_EdGrp = 0 + ST_EdGrpNone ST_EdGrp = 1 + ST_EdGrpEveryone ST_EdGrp = 2 + ST_EdGrpAdministrators ST_EdGrp = 3 + ST_EdGrpContributors ST_EdGrp = 4 + ST_EdGrpEditors ST_EdGrp = 5 + ST_EdGrpOwners ST_EdGrp = 6 + ST_EdGrpCurrent ST_EdGrp = 7 +) + +func (e ST_EdGrp) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_EdGrpUnset: + attr.Value = "" + case ST_EdGrpNone: + attr.Value = "none" + case ST_EdGrpEveryone: + attr.Value = "everyone" + case ST_EdGrpAdministrators: + attr.Value = "administrators" + case ST_EdGrpContributors: + attr.Value = "contributors" + case ST_EdGrpEditors: + attr.Value = "editors" + case ST_EdGrpOwners: + attr.Value = "owners" + case ST_EdGrpCurrent: + attr.Value = "current" + } + return attr, nil +} + +func (e *ST_EdGrp) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "none": + *e = 1 + case "everyone": + *e = 2 + case "administrators": + *e = 3 + case "contributors": + *e = 4 + case "editors": + *e = 5 + case "owners": + *e = 6 + case "current": + *e = 7 + } + return nil +} + +func (m ST_EdGrp) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_EdGrp) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "none": + *m = 1 + case "everyone": + *m = 2 + case "administrators": + *m = 3 + case "contributors": + *m = 4 + case "editors": + *m = 5 + case "owners": + *m = 6 + case "current": + *m = 7 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_EdGrp) String() string { + switch m { + case 0: + return "" + case 1: + return "none" + case 2: + return "everyone" + case 3: + return "administrators" + case 4: + return "contributors" + case 5: + return "editors" + case 6: + return "owners" + case 7: + return "current" + } + return "" +} + +func (m ST_EdGrp) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_EdGrp) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_Hint byte + +const ( + ST_HintUnset ST_Hint = 0 + ST_HintDefault ST_Hint = 1 + ST_HintEastAsia ST_Hint = 2 +) + +func (e ST_Hint) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_HintUnset: + attr.Value = "" + case ST_HintDefault: + attr.Value = "default" + case ST_HintEastAsia: + attr.Value = "eastAsia" + } + return attr, nil +} + +func (e *ST_Hint) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "default": + *e = 1 + case "eastAsia": + *e = 2 + } + return nil +} + +func (m ST_Hint) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_Hint) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "default": + *m = 1 + case "eastAsia": + *m = 2 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_Hint) String() string { + switch m { + case 0: + return "" + case 1: + return "default" + case 2: + return "eastAsia" + } + return "" +} + +func (m ST_Hint) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_Hint) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_Theme byte + +const ( + ST_ThemeUnset ST_Theme = 0 + ST_ThemeMajorEastAsia ST_Theme = 1 + ST_ThemeMajorBidi ST_Theme = 2 + ST_ThemeMajorAscii ST_Theme = 3 + ST_ThemeMajorHAnsi ST_Theme = 4 + ST_ThemeMinorEastAsia ST_Theme = 5 + ST_ThemeMinorBidi ST_Theme = 6 + ST_ThemeMinorAscii ST_Theme = 7 + ST_ThemeMinorHAnsi ST_Theme = 8 +) + +func (e ST_Theme) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_ThemeUnset: + attr.Value = "" + case ST_ThemeMajorEastAsia: + attr.Value = "majorEastAsia" + case ST_ThemeMajorBidi: + attr.Value = "majorBidi" + case ST_ThemeMajorAscii: + attr.Value = "majorAscii" + case ST_ThemeMajorHAnsi: + attr.Value = "majorHAnsi" + case ST_ThemeMinorEastAsia: + attr.Value = "minorEastAsia" + case ST_ThemeMinorBidi: + attr.Value = "minorBidi" + case ST_ThemeMinorAscii: + attr.Value = "minorAscii" + case ST_ThemeMinorHAnsi: + attr.Value = "minorHAnsi" + } + return attr, nil +} + +func (e *ST_Theme) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "majorEastAsia": + *e = 1 + case "majorBidi": + *e = 2 + case "majorAscii": + *e = 3 + case "majorHAnsi": + *e = 4 + case "minorEastAsia": + *e = 5 + case "minorBidi": + *e = 6 + case "minorAscii": + *e = 7 + case "minorHAnsi": + *e = 8 + } + return nil +} + +func (m ST_Theme) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_Theme) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "majorEastAsia": + *m = 1 + case "majorBidi": + *m = 2 + case "majorAscii": + *m = 3 + case "majorHAnsi": + *m = 4 + case "minorEastAsia": + *m = 5 + case "minorBidi": + *m = 6 + case "minorAscii": + *m = 7 + case "minorHAnsi": + *m = 8 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_Theme) String() string { + switch m { + case 0: + return "" + case 1: + return "majorEastAsia" + case 2: + return "majorBidi" + case 3: + return "majorAscii" + case 4: + return "majorHAnsi" + case 5: + return "minorEastAsia" + case 6: + return "minorBidi" + case 7: + return "minorAscii" + case 8: + return "minorHAnsi" + } + return "" +} + +func (m ST_Theme) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_Theme) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7, 8: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_RubyAlign byte + +const ( + ST_RubyAlignUnset ST_RubyAlign = 0 + ST_RubyAlignCenter ST_RubyAlign = 1 + ST_RubyAlignDistributeLetter ST_RubyAlign = 2 + ST_RubyAlignDistributeSpace ST_RubyAlign = 3 + ST_RubyAlignLeft ST_RubyAlign = 4 + ST_RubyAlignRight ST_RubyAlign = 5 + ST_RubyAlignRightVertical ST_RubyAlign = 6 +) + +func (e ST_RubyAlign) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_RubyAlignUnset: + attr.Value = "" + case ST_RubyAlignCenter: + attr.Value = "center" + case ST_RubyAlignDistributeLetter: + attr.Value = "distributeLetter" + case ST_RubyAlignDistributeSpace: + attr.Value = "distributeSpace" + case ST_RubyAlignLeft: + attr.Value = "left" + case ST_RubyAlignRight: + attr.Value = "right" + case ST_RubyAlignRightVertical: + attr.Value = "rightVertical" + } + return attr, nil +} + +func (e *ST_RubyAlign) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "center": + *e = 1 + case "distributeLetter": + *e = 2 + case "distributeSpace": + *e = 3 + case "left": + *e = 4 + case "right": + *e = 5 + case "rightVertical": + *e = 6 + } + return nil +} + +func (m ST_RubyAlign) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_RubyAlign) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "center": + *m = 1 + case "distributeLetter": + *m = 2 + case "distributeSpace": + *m = 3 + case "left": + *m = 4 + case "right": + *m = 5 + case "rightVertical": + *m = 6 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_RubyAlign) String() string { + switch m { + case 0: + return "" + case 1: + return "center" + case 2: + return "distributeLetter" + case 3: + return "distributeSpace" + case 4: + return "left" + case 5: + return "right" + case 6: + return "rightVertical" + } + return "" +} + +func (m ST_RubyAlign) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_RubyAlign) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_Lock byte + +const ( + ST_LockUnset ST_Lock = 0 + ST_LockSdtLocked ST_Lock = 1 + ST_LockContentLocked ST_Lock = 2 + ST_LockUnlocked ST_Lock = 3 + ST_LockSdtContentLocked ST_Lock = 4 +) + +func (e ST_Lock) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_LockUnset: + attr.Value = "" + case ST_LockSdtLocked: + attr.Value = "sdtLocked" + case ST_LockContentLocked: + attr.Value = "contentLocked" + case ST_LockUnlocked: + attr.Value = "unlocked" + case ST_LockSdtContentLocked: + attr.Value = "sdtContentLocked" + } + return attr, nil +} + +func (e *ST_Lock) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "sdtLocked": + *e = 1 + case "contentLocked": + *e = 2 + case "unlocked": + *e = 3 + case "sdtContentLocked": + *e = 4 + } + return nil +} + +func (m ST_Lock) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_Lock) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "sdtLocked": + *m = 1 + case "contentLocked": + *m = 2 + case "unlocked": + *m = 3 + case "sdtContentLocked": + *m = 4 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_Lock) String() string { + switch m { + case 0: + return "" + case 1: + return "sdtLocked" + case 2: + return "contentLocked" + case 3: + return "unlocked" + case 4: + return "sdtContentLocked" + } + return "" +} + +func (m ST_Lock) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_Lock) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_SdtDateMappingType byte + +const ( + ST_SdtDateMappingTypeUnset ST_SdtDateMappingType = 0 + ST_SdtDateMappingTypeText ST_SdtDateMappingType = 1 + ST_SdtDateMappingTypeDate ST_SdtDateMappingType = 2 + ST_SdtDateMappingTypeDateTime ST_SdtDateMappingType = 3 +) + +func (e ST_SdtDateMappingType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_SdtDateMappingTypeUnset: + attr.Value = "" + case ST_SdtDateMappingTypeText: + attr.Value = "text" + case ST_SdtDateMappingTypeDate: + attr.Value = "date" + case ST_SdtDateMappingTypeDateTime: + attr.Value = "dateTime" + } + return attr, nil +} + +func (e *ST_SdtDateMappingType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "text": + *e = 1 + case "date": + *e = 2 + case "dateTime": + *e = 3 + } + return nil +} + +func (m ST_SdtDateMappingType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_SdtDateMappingType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "text": + *m = 1 + case "date": + *m = 2 + case "dateTime": + *m = 3 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_SdtDateMappingType) String() string { + switch m { + case 0: + return "" + case 1: + return "text" + case 2: + return "date" + case 3: + return "dateTime" + } + return "" +} + +func (m ST_SdtDateMappingType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_SdtDateMappingType) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_Direction byte + +const ( + ST_DirectionUnset ST_Direction = 0 + ST_DirectionLtr ST_Direction = 1 + ST_DirectionRtl ST_Direction = 2 +) + +func (e ST_Direction) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_DirectionUnset: + attr.Value = "" + case ST_DirectionLtr: + attr.Value = "ltr" + case ST_DirectionRtl: + attr.Value = "rtl" + } + return attr, nil +} + +func (e *ST_Direction) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "ltr": + *e = 1 + case "rtl": + *e = 2 + } + return nil +} + +func (m ST_Direction) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_Direction) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "ltr": + *m = 1 + case "rtl": + *m = 2 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_Direction) String() string { + switch m { + case 0: + return "" + case 1: + return "ltr" + case 2: + return "rtl" + } + return "" +} + +func (m ST_Direction) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_Direction) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_TblWidth byte + +const ( + ST_TblWidthUnset ST_TblWidth = 0 + ST_TblWidthNil ST_TblWidth = 1 + ST_TblWidthPct ST_TblWidth = 2 + ST_TblWidthDxa ST_TblWidth = 3 + ST_TblWidthAuto ST_TblWidth = 4 +) + +func (e ST_TblWidth) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_TblWidthUnset: + attr.Value = "" + case ST_TblWidthNil: + attr.Value = "nil" + case ST_TblWidthPct: + attr.Value = "pct" + case ST_TblWidthDxa: + attr.Value = "dxa" + case ST_TblWidthAuto: + attr.Value = "auto" + } + return attr, nil +} + +func (e *ST_TblWidth) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "nil": + *e = 1 + case "pct": + *e = 2 + case "dxa": + *e = 3 + case "auto": + *e = 4 + } + return nil +} + +func (m ST_TblWidth) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_TblWidth) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "nil": + *m = 1 + case "pct": + *m = 2 + case "dxa": + *m = 3 + case "auto": + *m = 4 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_TblWidth) String() string { + switch m { + case 0: + return "" + case 1: + return "nil" + case 2: + return "pct" + case 3: + return "dxa" + case 4: + return "auto" + } + return "" +} + +func (m ST_TblWidth) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_TblWidth) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_Merge byte + +const ( + ST_MergeUnset ST_Merge = 0 + ST_MergeContinue ST_Merge = 1 + ST_MergeRestart ST_Merge = 2 +) + +func (e ST_Merge) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_MergeUnset: + attr.Value = "" + case ST_MergeContinue: + attr.Value = "continue" + case ST_MergeRestart: + attr.Value = "restart" + } + return attr, nil +} + +func (e *ST_Merge) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "continue": + *e = 1 + case "restart": + *e = 2 + } + return nil +} + +func (m ST_Merge) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_Merge) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "continue": + *m = 1 + case "restart": + *m = 2 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_Merge) String() string { + switch m { + case 0: + return "" + case 1: + return "continue" + case 2: + return "restart" + } + return "" +} + +func (m ST_Merge) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_Merge) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_TblLayoutType byte + +const ( + ST_TblLayoutTypeUnset ST_TblLayoutType = 0 + ST_TblLayoutTypeFixed ST_TblLayoutType = 1 + ST_TblLayoutTypeAutofit ST_TblLayoutType = 2 +) + +func (e ST_TblLayoutType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_TblLayoutTypeUnset: + attr.Value = "" + case ST_TblLayoutTypeFixed: + attr.Value = "fixed" + case ST_TblLayoutTypeAutofit: + attr.Value = "autofit" + } + return attr, nil +} + +func (e *ST_TblLayoutType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "fixed": + *e = 1 + case "autofit": + *e = 2 + } + return nil +} + +func (m ST_TblLayoutType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_TblLayoutType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "fixed": + *m = 1 + case "autofit": + *m = 2 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_TblLayoutType) String() string { + switch m { + case 0: + return "" + case 1: + return "fixed" + case 2: + return "autofit" + } + return "" +} + +func (m ST_TblLayoutType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_TblLayoutType) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_TblOverlap byte + +const ( + ST_TblOverlapUnset ST_TblOverlap = 0 + ST_TblOverlapNever ST_TblOverlap = 1 + ST_TblOverlapOverlap ST_TblOverlap = 2 +) + +func (e ST_TblOverlap) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_TblOverlapUnset: + attr.Value = "" + case ST_TblOverlapNever: + attr.Value = "never" + case ST_TblOverlapOverlap: + attr.Value = "overlap" + } + return attr, nil +} + +func (e *ST_TblOverlap) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "never": + *e = 1 + case "overlap": + *e = 2 + } + return nil +} + +func (m ST_TblOverlap) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_TblOverlap) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "never": + *m = 1 + case "overlap": + *m = 2 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_TblOverlap) String() string { + switch m { + case 0: + return "" + case 1: + return "never" + case 2: + return "overlap" + } + return "" +} + +func (m ST_TblOverlap) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_TblOverlap) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_FtnPos byte + +const ( + ST_FtnPosUnset ST_FtnPos = 0 + ST_FtnPosPageBottom ST_FtnPos = 1 + ST_FtnPosBeneathText ST_FtnPos = 2 + ST_FtnPosSectEnd ST_FtnPos = 3 + ST_FtnPosDocEnd ST_FtnPos = 4 +) + +func (e ST_FtnPos) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_FtnPosUnset: + attr.Value = "" + case ST_FtnPosPageBottom: + attr.Value = "pageBottom" + case ST_FtnPosBeneathText: + attr.Value = "beneathText" + case ST_FtnPosSectEnd: + attr.Value = "sectEnd" + case ST_FtnPosDocEnd: + attr.Value = "docEnd" + } + return attr, nil +} + +func (e *ST_FtnPos) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "pageBottom": + *e = 1 + case "beneathText": + *e = 2 + case "sectEnd": + *e = 3 + case "docEnd": + *e = 4 + } + return nil +} + +func (m ST_FtnPos) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_FtnPos) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "pageBottom": + *m = 1 + case "beneathText": + *m = 2 + case "sectEnd": + *m = 3 + case "docEnd": + *m = 4 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_FtnPos) String() string { + switch m { + case 0: + return "" + case 1: + return "pageBottom" + case 2: + return "beneathText" + case 3: + return "sectEnd" + case 4: + return "docEnd" + } + return "" +} + +func (m ST_FtnPos) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_FtnPos) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_EdnPos byte + +const ( + ST_EdnPosUnset ST_EdnPos = 0 + ST_EdnPosSectEnd ST_EdnPos = 1 + ST_EdnPosDocEnd ST_EdnPos = 2 +) + +func (e ST_EdnPos) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_EdnPosUnset: + attr.Value = "" + case ST_EdnPosSectEnd: + attr.Value = "sectEnd" + case ST_EdnPosDocEnd: + attr.Value = "docEnd" + } + return attr, nil +} + +func (e *ST_EdnPos) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "sectEnd": + *e = 1 + case "docEnd": + *e = 2 + } + return nil +} + +func (m ST_EdnPos) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_EdnPos) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "sectEnd": + *m = 1 + case "docEnd": + *m = 2 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_EdnPos) String() string { + switch m { + case 0: + return "" + case 1: + return "sectEnd" + case 2: + return "docEnd" + } + return "" +} + +func (m ST_EdnPos) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_EdnPos) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_RestartNumber byte + +const ( + ST_RestartNumberUnset ST_RestartNumber = 0 + ST_RestartNumberContinuous ST_RestartNumber = 1 + ST_RestartNumberEachSect ST_RestartNumber = 2 + ST_RestartNumberEachPage ST_RestartNumber = 3 +) + +func (e ST_RestartNumber) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_RestartNumberUnset: + attr.Value = "" + case ST_RestartNumberContinuous: + attr.Value = "continuous" + case ST_RestartNumberEachSect: + attr.Value = "eachSect" + case ST_RestartNumberEachPage: + attr.Value = "eachPage" + } + return attr, nil +} + +func (e *ST_RestartNumber) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "continuous": + *e = 1 + case "eachSect": + *e = 2 + case "eachPage": + *e = 3 + } + return nil +} + +func (m ST_RestartNumber) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_RestartNumber) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "continuous": + *m = 1 + case "eachSect": + *m = 2 + case "eachPage": + *m = 3 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_RestartNumber) String() string { + switch m { + case 0: + return "" + case 1: + return "continuous" + case 2: + return "eachSect" + case 3: + return "eachPage" + } + return "" +} + +func (m ST_RestartNumber) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_RestartNumber) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_MailMergeSourceType byte + +const ( + ST_MailMergeSourceTypeUnset ST_MailMergeSourceType = 0 + ST_MailMergeSourceTypeDatabase ST_MailMergeSourceType = 1 + ST_MailMergeSourceTypeAddressBook ST_MailMergeSourceType = 2 + ST_MailMergeSourceTypeDocument1 ST_MailMergeSourceType = 3 + ST_MailMergeSourceTypeDocument2 ST_MailMergeSourceType = 4 + ST_MailMergeSourceTypeText ST_MailMergeSourceType = 5 + ST_MailMergeSourceTypeEmail ST_MailMergeSourceType = 6 + ST_MailMergeSourceTypeNative ST_MailMergeSourceType = 7 + ST_MailMergeSourceTypeLegacy ST_MailMergeSourceType = 8 + ST_MailMergeSourceTypeMaster ST_MailMergeSourceType = 9 +) + +func (e ST_MailMergeSourceType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_MailMergeSourceTypeUnset: + attr.Value = "" + case ST_MailMergeSourceTypeDatabase: + attr.Value = "database" + case ST_MailMergeSourceTypeAddressBook: + attr.Value = "addressBook" + case ST_MailMergeSourceTypeDocument1: + attr.Value = "document1" + case ST_MailMergeSourceTypeDocument2: + attr.Value = "document2" + case ST_MailMergeSourceTypeText: + attr.Value = "text" + case ST_MailMergeSourceTypeEmail: + attr.Value = "email" + case ST_MailMergeSourceTypeNative: + attr.Value = "native" + case ST_MailMergeSourceTypeLegacy: + attr.Value = "legacy" + case ST_MailMergeSourceTypeMaster: + attr.Value = "master" + } + return attr, nil +} + +func (e *ST_MailMergeSourceType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "database": + *e = 1 + case "addressBook": + *e = 2 + case "document1": + *e = 3 + case "document2": + *e = 4 + case "text": + *e = 5 + case "email": + *e = 6 + case "native": + *e = 7 + case "legacy": + *e = 8 + case "master": + *e = 9 + } + return nil +} + +func (m ST_MailMergeSourceType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_MailMergeSourceType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "database": + *m = 1 + case "addressBook": + *m = 2 + case "document1": + *m = 3 + case "document2": + *m = 4 + case "text": + *m = 5 + case "email": + *m = 6 + case "native": + *m = 7 + case "legacy": + *m = 8 + case "master": + *m = 9 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_MailMergeSourceType) String() string { + switch m { + case 0: + return "" + case 1: + return "database" + case 2: + return "addressBook" + case 3: + return "document1" + case 4: + return "document2" + case 5: + return "text" + case 6: + return "email" + case 7: + return "native" + case 8: + return "legacy" + case 9: + return "master" + } + return "" +} + +func (m ST_MailMergeSourceType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_MailMergeSourceType) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_TargetScreenSz byte + +const ( + ST_TargetScreenSzUnset ST_TargetScreenSz = 0 + ST_TargetScreenSz544x376 ST_TargetScreenSz = 1 + ST_TargetScreenSz640x480 ST_TargetScreenSz = 2 + ST_TargetScreenSz720x512 ST_TargetScreenSz = 3 + ST_TargetScreenSz800x600 ST_TargetScreenSz = 4 + ST_TargetScreenSz1024x768 ST_TargetScreenSz = 5 + ST_TargetScreenSz1152x882 ST_TargetScreenSz = 6 + ST_TargetScreenSz1152x900 ST_TargetScreenSz = 7 + ST_TargetScreenSz1280x1024 ST_TargetScreenSz = 8 + ST_TargetScreenSz1600x1200 ST_TargetScreenSz = 9 + ST_TargetScreenSz1800x1440 ST_TargetScreenSz = 10 + ST_TargetScreenSz1920x1200 ST_TargetScreenSz = 11 +) + +func (e ST_TargetScreenSz) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_TargetScreenSzUnset: + attr.Value = "" + case ST_TargetScreenSz544x376: + attr.Value = "544x376" + case ST_TargetScreenSz640x480: + attr.Value = "640x480" + case ST_TargetScreenSz720x512: + attr.Value = "720x512" + case ST_TargetScreenSz800x600: + attr.Value = "800x600" + case ST_TargetScreenSz1024x768: + attr.Value = "1024x768" + case ST_TargetScreenSz1152x882: + attr.Value = "1152x882" + case ST_TargetScreenSz1152x900: + attr.Value = "1152x900" + case ST_TargetScreenSz1280x1024: + attr.Value = "1280x1024" + case ST_TargetScreenSz1600x1200: + attr.Value = "1600x1200" + case ST_TargetScreenSz1800x1440: + attr.Value = "1800x1440" + case ST_TargetScreenSz1920x1200: + attr.Value = "1920x1200" + } + return attr, nil +} + +func (e *ST_TargetScreenSz) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "544x376": + *e = 1 + case "640x480": + *e = 2 + case "720x512": + *e = 3 + case "800x600": + *e = 4 + case "1024x768": + *e = 5 + case "1152x882": + *e = 6 + case "1152x900": + *e = 7 + case "1280x1024": + *e = 8 + case "1600x1200": + *e = 9 + case "1800x1440": + *e = 10 + case "1920x1200": + *e = 11 + } + return nil +} + +func (m ST_TargetScreenSz) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_TargetScreenSz) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "544x376": + *m = 1 + case "640x480": + *m = 2 + case "720x512": + *m = 3 + case "800x600": + *m = 4 + case "1024x768": + *m = 5 + case "1152x882": + *m = 6 + case "1152x900": + *m = 7 + case "1280x1024": + *m = 8 + case "1600x1200": + *m = 9 + case "1800x1440": + *m = 10 + case "1920x1200": + *m = 11 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_TargetScreenSz) String() string { + switch m { + case 0: + return "" + case 1: + return "544x376" + case 2: + return "640x480" + case 3: + return "720x512" + case 4: + return "800x600" + case 5: + return "1024x768" + case 6: + return "1152x882" + case 7: + return "1152x900" + case 8: + return "1280x1024" + case 9: + return "1600x1200" + case 10: + return "1800x1440" + case 11: + return "1920x1200" + } + return "" +} + +func (m ST_TargetScreenSz) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_TargetScreenSz) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_CharacterSpacing byte + +const ( + ST_CharacterSpacingUnset ST_CharacterSpacing = 0 + ST_CharacterSpacingDoNotCompress ST_CharacterSpacing = 1 + ST_CharacterSpacingCompressPunctuation ST_CharacterSpacing = 2 + ST_CharacterSpacingCompressPunctuationAndJapaneseKana ST_CharacterSpacing = 3 +) + +func (e ST_CharacterSpacing) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_CharacterSpacingUnset: + attr.Value = "" + case ST_CharacterSpacingDoNotCompress: + attr.Value = "doNotCompress" + case ST_CharacterSpacingCompressPunctuation: + attr.Value = "compressPunctuation" + case ST_CharacterSpacingCompressPunctuationAndJapaneseKana: + attr.Value = "compressPunctuationAndJapaneseKana" + } + return attr, nil +} + +func (e *ST_CharacterSpacing) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "doNotCompress": + *e = 1 + case "compressPunctuation": + *e = 2 + case "compressPunctuationAndJapaneseKana": + *e = 3 + } + return nil +} + +func (m ST_CharacterSpacing) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_CharacterSpacing) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "doNotCompress": + *m = 1 + case "compressPunctuation": + *m = 2 + case "compressPunctuationAndJapaneseKana": + *m = 3 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_CharacterSpacing) String() string { + switch m { + case 0: + return "" + case 1: + return "doNotCompress" + case 2: + return "compressPunctuation" + case 3: + return "compressPunctuationAndJapaneseKana" + } + return "" +} + +func (m ST_CharacterSpacing) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_CharacterSpacing) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_WmlColorSchemeIndex byte + +const ( + ST_WmlColorSchemeIndexUnset ST_WmlColorSchemeIndex = 0 + ST_WmlColorSchemeIndexDark1 ST_WmlColorSchemeIndex = 1 + ST_WmlColorSchemeIndexLight1 ST_WmlColorSchemeIndex = 2 + ST_WmlColorSchemeIndexDark2 ST_WmlColorSchemeIndex = 3 + ST_WmlColorSchemeIndexLight2 ST_WmlColorSchemeIndex = 4 + ST_WmlColorSchemeIndexAccent1 ST_WmlColorSchemeIndex = 5 + ST_WmlColorSchemeIndexAccent2 ST_WmlColorSchemeIndex = 6 + ST_WmlColorSchemeIndexAccent3 ST_WmlColorSchemeIndex = 7 + ST_WmlColorSchemeIndexAccent4 ST_WmlColorSchemeIndex = 8 + ST_WmlColorSchemeIndexAccent5 ST_WmlColorSchemeIndex = 9 + ST_WmlColorSchemeIndexAccent6 ST_WmlColorSchemeIndex = 10 + ST_WmlColorSchemeIndexHyperlink ST_WmlColorSchemeIndex = 11 + ST_WmlColorSchemeIndexFollowedHyperlink ST_WmlColorSchemeIndex = 12 +) + +func (e ST_WmlColorSchemeIndex) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_WmlColorSchemeIndexUnset: + attr.Value = "" + case ST_WmlColorSchemeIndexDark1: + attr.Value = "dark1" + case ST_WmlColorSchemeIndexLight1: + attr.Value = "light1" + case ST_WmlColorSchemeIndexDark2: + attr.Value = "dark2" + case ST_WmlColorSchemeIndexLight2: + attr.Value = "light2" + case ST_WmlColorSchemeIndexAccent1: + attr.Value = "accent1" + case ST_WmlColorSchemeIndexAccent2: + attr.Value = "accent2" + case ST_WmlColorSchemeIndexAccent3: + attr.Value = "accent3" + case ST_WmlColorSchemeIndexAccent4: + attr.Value = "accent4" + case ST_WmlColorSchemeIndexAccent5: + attr.Value = "accent5" + case ST_WmlColorSchemeIndexAccent6: + attr.Value = "accent6" + case ST_WmlColorSchemeIndexHyperlink: + attr.Value = "hyperlink" + case ST_WmlColorSchemeIndexFollowedHyperlink: + attr.Value = "followedHyperlink" + } + return attr, nil +} + +func (e *ST_WmlColorSchemeIndex) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "dark1": + *e = 1 + case "light1": + *e = 2 + case "dark2": + *e = 3 + case "light2": + *e = 4 + case "accent1": + *e = 5 + case "accent2": + *e = 6 + case "accent3": + *e = 7 + case "accent4": + *e = 8 + case "accent5": + *e = 9 + case "accent6": + *e = 10 + case "hyperlink": + *e = 11 + case "followedHyperlink": + *e = 12 + } + return nil +} + +func (m ST_WmlColorSchemeIndex) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_WmlColorSchemeIndex) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "dark1": + *m = 1 + case "light1": + *m = 2 + case "dark2": + *m = 3 + case "light2": + *m = 4 + case "accent1": + *m = 5 + case "accent2": + *m = 6 + case "accent3": + *m = 7 + case "accent4": + *m = 8 + case "accent5": + *m = 9 + case "accent6": + *m = 10 + case "hyperlink": + *m = 11 + case "followedHyperlink": + *m = 12 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_WmlColorSchemeIndex) String() string { + switch m { + case 0: + return "" + case 1: + return "dark1" + case 2: + return "light1" + case 3: + return "dark2" + case 4: + return "light2" + case 5: + return "accent1" + case 6: + return "accent2" + case 7: + return "accent3" + case 8: + return "accent4" + case 9: + return "accent5" + case 10: + return "accent6" + case 11: + return "hyperlink" + case 12: + return "followedHyperlink" + } + return "" +} + +func (m ST_WmlColorSchemeIndex) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_WmlColorSchemeIndex) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_StyleSort byte + +const ( + ST_StyleSortUnset ST_StyleSort = 0 + ST_StyleSortName ST_StyleSort = 1 + ST_StyleSortPriority ST_StyleSort = 2 + ST_StyleSortDefault ST_StyleSort = 3 + ST_StyleSortFont ST_StyleSort = 4 + ST_StyleSortBasedOn ST_StyleSort = 5 + ST_StyleSortType ST_StyleSort = 6 + ST_StyleSort0000 ST_StyleSort = 7 + ST_StyleSort0001 ST_StyleSort = 8 + ST_StyleSort0002 ST_StyleSort = 9 + ST_StyleSort0003 ST_StyleSort = 10 + ST_StyleSort0004 ST_StyleSort = 11 + ST_StyleSort0005 ST_StyleSort = 12 +) + +func (e ST_StyleSort) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_StyleSortUnset: + attr.Value = "" + case ST_StyleSortName: + attr.Value = "name" + case ST_StyleSortPriority: + attr.Value = "priority" + case ST_StyleSortDefault: + attr.Value = "default" + case ST_StyleSortFont: + attr.Value = "font" + case ST_StyleSortBasedOn: + attr.Value = "basedOn" + case ST_StyleSortType: + attr.Value = "type" + case ST_StyleSort0000: + attr.Value = "0000" + case ST_StyleSort0001: + attr.Value = "0001" + case ST_StyleSort0002: + attr.Value = "0002" + case ST_StyleSort0003: + attr.Value = "0003" + case ST_StyleSort0004: + attr.Value = "0004" + case ST_StyleSort0005: + attr.Value = "0005" + } + return attr, nil +} + +func (e *ST_StyleSort) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "name": + *e = 1 + case "priority": + *e = 2 + case "default": + *e = 3 + case "font": + *e = 4 + case "basedOn": + *e = 5 + case "type": + *e = 6 + case "0000": + *e = 7 + case "0001": + *e = 8 + case "0002": + *e = 9 + case "0003": + *e = 10 + case "0004": + *e = 11 + case "0005": + *e = 12 + } + return nil +} + +func (m ST_StyleSort) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_StyleSort) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "name": + *m = 1 + case "priority": + *m = 2 + case "default": + *m = 3 + case "font": + *m = 4 + case "basedOn": + *m = 5 + case "type": + *m = 6 + case "0000": + *m = 7 + case "0001": + *m = 8 + case "0002": + *m = 9 + case "0003": + *m = 10 + case "0004": + *m = 11 + case "0005": + *m = 12 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_StyleSort) String() string { + switch m { + case 0: + return "" + case 1: + return "name" + case 2: + return "priority" + case 3: + return "default" + case 4: + return "font" + case 5: + return "basedOn" + case 6: + return "type" + case 7: + return "0000" + case 8: + return "0001" + case 9: + return "0002" + case 10: + return "0003" + case 11: + return "0004" + case 12: + return "0005" + } + return "" +} + +func (m ST_StyleSort) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_StyleSort) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_FrameScrollbar byte + +const ( + ST_FrameScrollbarUnset ST_FrameScrollbar = 0 + ST_FrameScrollbarOn ST_FrameScrollbar = 1 + ST_FrameScrollbarOff ST_FrameScrollbar = 2 + ST_FrameScrollbarAuto ST_FrameScrollbar = 3 +) + +func (e ST_FrameScrollbar) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_FrameScrollbarUnset: + attr.Value = "" + case ST_FrameScrollbarOn: + attr.Value = "on" + case ST_FrameScrollbarOff: + attr.Value = "off" + case ST_FrameScrollbarAuto: + attr.Value = "auto" + } + return attr, nil +} + +func (e *ST_FrameScrollbar) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "on": + *e = 1 + case "off": + *e = 2 + case "auto": + *e = 3 + } + return nil +} + +func (m ST_FrameScrollbar) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_FrameScrollbar) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "on": + *m = 1 + case "off": + *m = 2 + case "auto": + *m = 3 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_FrameScrollbar) String() string { + switch m { + case 0: + return "" + case 1: + return "on" + case 2: + return "off" + case 3: + return "auto" + } + return "" +} + +func (m ST_FrameScrollbar) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_FrameScrollbar) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_FrameLayout byte + +const ( + ST_FrameLayoutUnset ST_FrameLayout = 0 + ST_FrameLayoutRows ST_FrameLayout = 1 + ST_FrameLayoutCols ST_FrameLayout = 2 + ST_FrameLayoutNone ST_FrameLayout = 3 +) + +func (e ST_FrameLayout) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_FrameLayoutUnset: + attr.Value = "" + case ST_FrameLayoutRows: + attr.Value = "rows" + case ST_FrameLayoutCols: + attr.Value = "cols" + case ST_FrameLayoutNone: + attr.Value = "none" + } + return attr, nil +} + +func (e *ST_FrameLayout) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "rows": + *e = 1 + case "cols": + *e = 2 + case "none": + *e = 3 + } + return nil +} + +func (m ST_FrameLayout) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_FrameLayout) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "rows": + *m = 1 + case "cols": + *m = 2 + case "none": + *m = 3 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_FrameLayout) String() string { + switch m { + case 0: + return "" + case 1: + return "rows" + case 2: + return "cols" + case 3: + return "none" + } + return "" +} + +func (m ST_FrameLayout) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_FrameLayout) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_LevelSuffix byte + +const ( + ST_LevelSuffixUnset ST_LevelSuffix = 0 + ST_LevelSuffixTab ST_LevelSuffix = 1 + ST_LevelSuffixSpace ST_LevelSuffix = 2 + ST_LevelSuffixNothing ST_LevelSuffix = 3 +) + +func (e ST_LevelSuffix) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_LevelSuffixUnset: + attr.Value = "" + case ST_LevelSuffixTab: + attr.Value = "tab" + case ST_LevelSuffixSpace: + attr.Value = "space" + case ST_LevelSuffixNothing: + attr.Value = "nothing" + } + return attr, nil +} + +func (e *ST_LevelSuffix) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "tab": + *e = 1 + case "space": + *e = 2 + case "nothing": + *e = 3 + } + return nil +} + +func (m ST_LevelSuffix) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_LevelSuffix) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "tab": + *m = 1 + case "space": + *m = 2 + case "nothing": + *m = 3 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_LevelSuffix) String() string { + switch m { + case 0: + return "" + case 1: + return "tab" + case 2: + return "space" + case 3: + return "nothing" + } + return "" +} + +func (m ST_LevelSuffix) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_LevelSuffix) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_MultiLevelType byte + +const ( + ST_MultiLevelTypeUnset ST_MultiLevelType = 0 + ST_MultiLevelTypeSingleLevel ST_MultiLevelType = 1 + ST_MultiLevelTypeMultilevel ST_MultiLevelType = 2 + ST_MultiLevelTypeHybridMultilevel ST_MultiLevelType = 3 +) + +func (e ST_MultiLevelType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_MultiLevelTypeUnset: + attr.Value = "" + case ST_MultiLevelTypeSingleLevel: + attr.Value = "singleLevel" + case ST_MultiLevelTypeMultilevel: + attr.Value = "multilevel" + case ST_MultiLevelTypeHybridMultilevel: + attr.Value = "hybridMultilevel" + } + return attr, nil +} + +func (e *ST_MultiLevelType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "singleLevel": + *e = 1 + case "multilevel": + *e = 2 + case "hybridMultilevel": + *e = 3 + } + return nil +} + +func (m ST_MultiLevelType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_MultiLevelType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "singleLevel": + *m = 1 + case "multilevel": + *m = 2 + case "hybridMultilevel": + *m = 3 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_MultiLevelType) String() string { + switch m { + case 0: + return "" + case 1: + return "singleLevel" + case 2: + return "multilevel" + case 3: + return "hybridMultilevel" + } + return "" +} + +func (m ST_MultiLevelType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_MultiLevelType) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_TblStyleOverrideType byte + +const ( + ST_TblStyleOverrideTypeUnset ST_TblStyleOverrideType = 0 + ST_TblStyleOverrideTypeWholeTable ST_TblStyleOverrideType = 1 + ST_TblStyleOverrideTypeFirstRow ST_TblStyleOverrideType = 2 + ST_TblStyleOverrideTypeLastRow ST_TblStyleOverrideType = 3 + ST_TblStyleOverrideTypeFirstCol ST_TblStyleOverrideType = 4 + ST_TblStyleOverrideTypeLastCol ST_TblStyleOverrideType = 5 + ST_TblStyleOverrideTypeBand1Vert ST_TblStyleOverrideType = 6 + ST_TblStyleOverrideTypeBand2Vert ST_TblStyleOverrideType = 7 + ST_TblStyleOverrideTypeBand1Horz ST_TblStyleOverrideType = 8 + ST_TblStyleOverrideTypeBand2Horz ST_TblStyleOverrideType = 9 + ST_TblStyleOverrideTypeNeCell ST_TblStyleOverrideType = 10 + ST_TblStyleOverrideTypeNwCell ST_TblStyleOverrideType = 11 + ST_TblStyleOverrideTypeSeCell ST_TblStyleOverrideType = 12 + ST_TblStyleOverrideTypeSwCell ST_TblStyleOverrideType = 13 +) + +func (e ST_TblStyleOverrideType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_TblStyleOverrideTypeUnset: + attr.Value = "" + case ST_TblStyleOverrideTypeWholeTable: + attr.Value = "wholeTable" + case ST_TblStyleOverrideTypeFirstRow: + attr.Value = "firstRow" + case ST_TblStyleOverrideTypeLastRow: + attr.Value = "lastRow" + case ST_TblStyleOverrideTypeFirstCol: + attr.Value = "firstCol" + case ST_TblStyleOverrideTypeLastCol: + attr.Value = "lastCol" + case ST_TblStyleOverrideTypeBand1Vert: + attr.Value = "band1Vert" + case ST_TblStyleOverrideTypeBand2Vert: + attr.Value = "band2Vert" + case ST_TblStyleOverrideTypeBand1Horz: + attr.Value = "band1Horz" + case ST_TblStyleOverrideTypeBand2Horz: + attr.Value = "band2Horz" + case ST_TblStyleOverrideTypeNeCell: + attr.Value = "neCell" + case ST_TblStyleOverrideTypeNwCell: + attr.Value = "nwCell" + case ST_TblStyleOverrideTypeSeCell: + attr.Value = "seCell" + case ST_TblStyleOverrideTypeSwCell: + attr.Value = "swCell" + } + return attr, nil +} + +func (e *ST_TblStyleOverrideType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "wholeTable": + *e = 1 + case "firstRow": + *e = 2 + case "lastRow": + *e = 3 + case "firstCol": + *e = 4 + case "lastCol": + *e = 5 + case "band1Vert": + *e = 6 + case "band2Vert": + *e = 7 + case "band1Horz": + *e = 8 + case "band2Horz": + *e = 9 + case "neCell": + *e = 10 + case "nwCell": + *e = 11 + case "seCell": + *e = 12 + case "swCell": + *e = 13 + } + return nil +} + +func (m ST_TblStyleOverrideType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_TblStyleOverrideType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "wholeTable": + *m = 1 + case "firstRow": + *m = 2 + case "lastRow": + *m = 3 + case "firstCol": + *m = 4 + case "lastCol": + *m = 5 + case "band1Vert": + *m = 6 + case "band2Vert": + *m = 7 + case "band1Horz": + *m = 8 + case "band2Horz": + *m = 9 + case "neCell": + *m = 10 + case "nwCell": + *m = 11 + case "seCell": + *m = 12 + case "swCell": + *m = 13 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_TblStyleOverrideType) String() string { + switch m { + case 0: + return "" + case 1: + return "wholeTable" + case 2: + return "firstRow" + case 3: + return "lastRow" + case 4: + return "firstCol" + case 5: + return "lastCol" + case 6: + return "band1Vert" + case 7: + return "band2Vert" + case 8: + return "band1Horz" + case 9: + return "band2Horz" + case 10: + return "neCell" + case 11: + return "nwCell" + case 12: + return "seCell" + case 13: + return "swCell" + } + return "" +} + +func (m ST_TblStyleOverrideType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_TblStyleOverrideType) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_StyleType byte + +const ( + ST_StyleTypeUnset ST_StyleType = 0 + ST_StyleTypeParagraph ST_StyleType = 1 + ST_StyleTypeCharacter ST_StyleType = 2 + ST_StyleTypeTable ST_StyleType = 3 + ST_StyleTypeNumbering ST_StyleType = 4 +) + +func (e ST_StyleType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_StyleTypeUnset: + attr.Value = "" + case ST_StyleTypeParagraph: + attr.Value = "paragraph" + case ST_StyleTypeCharacter: + attr.Value = "character" + case ST_StyleTypeTable: + attr.Value = "table" + case ST_StyleTypeNumbering: + attr.Value = "numbering" + } + return attr, nil +} + +func (e *ST_StyleType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "paragraph": + *e = 1 + case "character": + *e = 2 + case "table": + *e = 3 + case "numbering": + *e = 4 + } + return nil +} + +func (m ST_StyleType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_StyleType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "paragraph": + *m = 1 + case "character": + *m = 2 + case "table": + *m = 3 + case "numbering": + *m = 4 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_StyleType) String() string { + switch m { + case 0: + return "" + case 1: + return "paragraph" + case 2: + return "character" + case 3: + return "table" + case 4: + return "numbering" + } + return "" +} + +func (m ST_StyleType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_StyleType) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_FontFamily byte + +const ( + ST_FontFamilyUnset ST_FontFamily = 0 + ST_FontFamilyDecorative ST_FontFamily = 1 + ST_FontFamilyModern ST_FontFamily = 2 + ST_FontFamilyRoman ST_FontFamily = 3 + ST_FontFamilyScript ST_FontFamily = 4 + ST_FontFamilySwiss ST_FontFamily = 5 + ST_FontFamilyAuto ST_FontFamily = 6 +) + +func (e ST_FontFamily) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_FontFamilyUnset: + attr.Value = "" + case ST_FontFamilyDecorative: + attr.Value = "decorative" + case ST_FontFamilyModern: + attr.Value = "modern" + case ST_FontFamilyRoman: + attr.Value = "roman" + case ST_FontFamilyScript: + attr.Value = "script" + case ST_FontFamilySwiss: + attr.Value = "swiss" + case ST_FontFamilyAuto: + attr.Value = "auto" + } + return attr, nil +} + +func (e *ST_FontFamily) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "decorative": + *e = 1 + case "modern": + *e = 2 + case "roman": + *e = 3 + case "script": + *e = 4 + case "swiss": + *e = 5 + case "auto": + *e = 6 + } + return nil +} + +func (m ST_FontFamily) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_FontFamily) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "decorative": + *m = 1 + case "modern": + *m = 2 + case "roman": + *m = 3 + case "script": + *m = 4 + case "swiss": + *m = 5 + case "auto": + *m = 6 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_FontFamily) String() string { + switch m { + case 0: + return "" + case 1: + return "decorative" + case 2: + return "modern" + case 3: + return "roman" + case 4: + return "script" + case 5: + return "swiss" + case 6: + return "auto" + } + return "" +} + +func (m ST_FontFamily) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_FontFamily) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_Pitch byte + +const ( + ST_PitchUnset ST_Pitch = 0 + ST_PitchFixed ST_Pitch = 1 + ST_PitchVariable ST_Pitch = 2 + ST_PitchDefault ST_Pitch = 3 +) + +func (e ST_Pitch) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_PitchUnset: + attr.Value = "" + case ST_PitchFixed: + attr.Value = "fixed" + case ST_PitchVariable: + attr.Value = "variable" + case ST_PitchDefault: + attr.Value = "default" + } + return attr, nil +} + +func (e *ST_Pitch) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "fixed": + *e = 1 + case "variable": + *e = 2 + case "default": + *e = 3 + } + return nil +} + +func (m ST_Pitch) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_Pitch) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "fixed": + *m = 1 + case "variable": + *m = 2 + case "default": + *m = 3 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_Pitch) String() string { + switch m { + case 0: + return "" + case 1: + return "fixed" + case 2: + return "variable" + case 3: + return "default" + } + return "" +} + +func (m ST_Pitch) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_Pitch) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_ThemeColor byte + +const ( + ST_ThemeColorUnset ST_ThemeColor = 0 + ST_ThemeColorDark1 ST_ThemeColor = 1 + ST_ThemeColorLight1 ST_ThemeColor = 2 + ST_ThemeColorDark2 ST_ThemeColor = 3 + ST_ThemeColorLight2 ST_ThemeColor = 4 + ST_ThemeColorAccent1 ST_ThemeColor = 5 + ST_ThemeColorAccent2 ST_ThemeColor = 6 + ST_ThemeColorAccent3 ST_ThemeColor = 7 + ST_ThemeColorAccent4 ST_ThemeColor = 8 + ST_ThemeColorAccent5 ST_ThemeColor = 9 + ST_ThemeColorAccent6 ST_ThemeColor = 10 + ST_ThemeColorHyperlink ST_ThemeColor = 11 + ST_ThemeColorFollowedHyperlink ST_ThemeColor = 12 + ST_ThemeColorNone ST_ThemeColor = 13 + ST_ThemeColorBackground1 ST_ThemeColor = 14 + ST_ThemeColorText1 ST_ThemeColor = 15 + ST_ThemeColorBackground2 ST_ThemeColor = 16 + ST_ThemeColorText2 ST_ThemeColor = 17 +) + +func (e ST_ThemeColor) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_ThemeColorUnset: + attr.Value = "" + case ST_ThemeColorDark1: + attr.Value = "dark1" + case ST_ThemeColorLight1: + attr.Value = "light1" + case ST_ThemeColorDark2: + attr.Value = "dark2" + case ST_ThemeColorLight2: + attr.Value = "light2" + case ST_ThemeColorAccent1: + attr.Value = "accent1" + case ST_ThemeColorAccent2: + attr.Value = "accent2" + case ST_ThemeColorAccent3: + attr.Value = "accent3" + case ST_ThemeColorAccent4: + attr.Value = "accent4" + case ST_ThemeColorAccent5: + attr.Value = "accent5" + case ST_ThemeColorAccent6: + attr.Value = "accent6" + case ST_ThemeColorHyperlink: + attr.Value = "hyperlink" + case ST_ThemeColorFollowedHyperlink: + attr.Value = "followedHyperlink" + case ST_ThemeColorNone: + attr.Value = "none" + case ST_ThemeColorBackground1: + attr.Value = "background1" + case ST_ThemeColorText1: + attr.Value = "text1" + case ST_ThemeColorBackground2: + attr.Value = "background2" + case ST_ThemeColorText2: + attr.Value = "text2" + } + return attr, nil +} + +func (e *ST_ThemeColor) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "dark1": + *e = 1 + case "light1": + *e = 2 + case "dark2": + *e = 3 + case "light2": + *e = 4 + case "accent1": + *e = 5 + case "accent2": + *e = 6 + case "accent3": + *e = 7 + case "accent4": + *e = 8 + case "accent5": + *e = 9 + case "accent6": + *e = 10 + case "hyperlink": + *e = 11 + case "followedHyperlink": + *e = 12 + case "none": + *e = 13 + case "background1": + *e = 14 + case "text1": + *e = 15 + case "background2": + *e = 16 + case "text2": + *e = 17 + } + return nil +} + +func (m ST_ThemeColor) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_ThemeColor) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "dark1": + *m = 1 + case "light1": + *m = 2 + case "dark2": + *m = 3 + case "light2": + *m = 4 + case "accent1": + *m = 5 + case "accent2": + *m = 6 + case "accent3": + *m = 7 + case "accent4": + *m = 8 + case "accent5": + *m = 9 + case "accent6": + *m = 10 + case "hyperlink": + *m = 11 + case "followedHyperlink": + *m = 12 + case "none": + *m = 13 + case "background1": + *m = 14 + case "text1": + *m = 15 + case "background2": + *m = 16 + case "text2": + *m = 17 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_ThemeColor) String() string { + switch m { + case 0: + return "" + case 1: + return "dark1" + case 2: + return "light1" + case 3: + return "dark2" + case 4: + return "light2" + case 5: + return "accent1" + case 6: + return "accent2" + case 7: + return "accent3" + case 8: + return "accent4" + case 9: + return "accent5" + case 10: + return "accent6" + case 11: + return "hyperlink" + case 12: + return "followedHyperlink" + case 13: + return "none" + case 14: + return "background1" + case 15: + return "text1" + case 16: + return "background2" + case 17: + return "text2" + } + return "" +} + +func (m ST_ThemeColor) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_ThemeColor) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_DocPartBehavior byte + +const ( + ST_DocPartBehaviorUnset ST_DocPartBehavior = 0 + ST_DocPartBehaviorContent ST_DocPartBehavior = 1 + ST_DocPartBehaviorP ST_DocPartBehavior = 2 + ST_DocPartBehaviorPg ST_DocPartBehavior = 3 +) + +func (e ST_DocPartBehavior) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_DocPartBehaviorUnset: + attr.Value = "" + case ST_DocPartBehaviorContent: + attr.Value = "content" + case ST_DocPartBehaviorP: + attr.Value = "p" + case ST_DocPartBehaviorPg: + attr.Value = "pg" + } + return attr, nil +} + +func (e *ST_DocPartBehavior) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "content": + *e = 1 + case "p": + *e = 2 + case "pg": + *e = 3 + } + return nil +} + +func (m ST_DocPartBehavior) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_DocPartBehavior) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "content": + *m = 1 + case "p": + *m = 2 + case "pg": + *m = 3 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_DocPartBehavior) String() string { + switch m { + case 0: + return "" + case 1: + return "content" + case 2: + return "p" + case 3: + return "pg" + } + return "" +} + +func (m ST_DocPartBehavior) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_DocPartBehavior) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_DocPartType byte + +const ( + ST_DocPartTypeUnset ST_DocPartType = 0 + ST_DocPartTypeNone ST_DocPartType = 1 + ST_DocPartTypeNormal ST_DocPartType = 2 + ST_DocPartTypeAutoExp ST_DocPartType = 3 + ST_DocPartTypeToolbar ST_DocPartType = 4 + ST_DocPartTypeSpeller ST_DocPartType = 5 + ST_DocPartTypeFormFld ST_DocPartType = 6 + ST_DocPartTypeBbPlcHdr ST_DocPartType = 7 +) + +func (e ST_DocPartType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_DocPartTypeUnset: + attr.Value = "" + case ST_DocPartTypeNone: + attr.Value = "none" + case ST_DocPartTypeNormal: + attr.Value = "normal" + case ST_DocPartTypeAutoExp: + attr.Value = "autoExp" + case ST_DocPartTypeToolbar: + attr.Value = "toolbar" + case ST_DocPartTypeSpeller: + attr.Value = "speller" + case ST_DocPartTypeFormFld: + attr.Value = "formFld" + case ST_DocPartTypeBbPlcHdr: + attr.Value = "bbPlcHdr" + } + return attr, nil +} + +func (e *ST_DocPartType) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "none": + *e = 1 + case "normal": + *e = 2 + case "autoExp": + *e = 3 + case "toolbar": + *e = 4 + case "speller": + *e = 5 + case "formFld": + *e = 6 + case "bbPlcHdr": + *e = 7 + } + return nil +} + +func (m ST_DocPartType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_DocPartType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "none": + *m = 1 + case "normal": + *m = 2 + case "autoExp": + *m = 3 + case "toolbar": + *m = 4 + case "speller": + *m = 5 + case "formFld": + *m = 6 + case "bbPlcHdr": + *m = 7 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_DocPartType) String() string { + switch m { + case 0: + return "" + case 1: + return "none" + case 2: + return "normal" + case 3: + return "autoExp" + case 4: + return "toolbar" + case 5: + return "speller" + case 6: + return "formFld" + case 7: + return "bbPlcHdr" + } + return "" +} + +func (m ST_DocPartType) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_DocPartType) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_DocPartGallery byte + +const ( + ST_DocPartGalleryUnset ST_DocPartGallery = 0 + ST_DocPartGalleryPlaceholder ST_DocPartGallery = 1 + ST_DocPartGalleryAny ST_DocPartGallery = 2 + ST_DocPartGalleryDefault ST_DocPartGallery = 3 + ST_DocPartGalleryDocParts ST_DocPartGallery = 4 + ST_DocPartGalleryCoverPg ST_DocPartGallery = 5 + ST_DocPartGalleryEq ST_DocPartGallery = 6 + ST_DocPartGalleryFtrs ST_DocPartGallery = 7 + ST_DocPartGalleryHdrs ST_DocPartGallery = 8 + ST_DocPartGalleryPgNum ST_DocPartGallery = 9 + ST_DocPartGalleryTbls ST_DocPartGallery = 10 + ST_DocPartGalleryWatermarks ST_DocPartGallery = 11 + ST_DocPartGalleryAutoTxt ST_DocPartGallery = 12 + ST_DocPartGalleryTxtBox ST_DocPartGallery = 13 + ST_DocPartGalleryPgNumT ST_DocPartGallery = 14 + ST_DocPartGalleryPgNumB ST_DocPartGallery = 15 + ST_DocPartGalleryPgNumMargins ST_DocPartGallery = 16 + ST_DocPartGalleryTblOfContents ST_DocPartGallery = 17 + ST_DocPartGalleryBib ST_DocPartGallery = 18 + ST_DocPartGalleryCustQuickParts ST_DocPartGallery = 19 + ST_DocPartGalleryCustCoverPg ST_DocPartGallery = 20 + ST_DocPartGalleryCustEq ST_DocPartGallery = 21 + ST_DocPartGalleryCustFtrs ST_DocPartGallery = 22 + ST_DocPartGalleryCustHdrs ST_DocPartGallery = 23 + ST_DocPartGalleryCustPgNum ST_DocPartGallery = 24 + ST_DocPartGalleryCustTbls ST_DocPartGallery = 25 + ST_DocPartGalleryCustWatermarks ST_DocPartGallery = 26 + ST_DocPartGalleryCustAutoTxt ST_DocPartGallery = 27 + ST_DocPartGalleryCustTxtBox ST_DocPartGallery = 28 + ST_DocPartGalleryCustPgNumT ST_DocPartGallery = 29 + ST_DocPartGalleryCustPgNumB ST_DocPartGallery = 30 + ST_DocPartGalleryCustPgNumMargins ST_DocPartGallery = 31 + ST_DocPartGalleryCustTblOfContents ST_DocPartGallery = 32 + ST_DocPartGalleryCustBib ST_DocPartGallery = 33 + ST_DocPartGalleryCustom1 ST_DocPartGallery = 34 + ST_DocPartGalleryCustom2 ST_DocPartGallery = 35 + ST_DocPartGalleryCustom3 ST_DocPartGallery = 36 + ST_DocPartGalleryCustom4 ST_DocPartGallery = 37 + ST_DocPartGalleryCustom5 ST_DocPartGallery = 38 +) + +func (e ST_DocPartGallery) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_DocPartGalleryUnset: + attr.Value = "" + case ST_DocPartGalleryPlaceholder: + attr.Value = "placeholder" + case ST_DocPartGalleryAny: + attr.Value = "any" + case ST_DocPartGalleryDefault: + attr.Value = "default" + case ST_DocPartGalleryDocParts: + attr.Value = "docParts" + case ST_DocPartGalleryCoverPg: + attr.Value = "coverPg" + case ST_DocPartGalleryEq: + attr.Value = "eq" + case ST_DocPartGalleryFtrs: + attr.Value = "ftrs" + case ST_DocPartGalleryHdrs: + attr.Value = "hdrs" + case ST_DocPartGalleryPgNum: + attr.Value = "pgNum" + case ST_DocPartGalleryTbls: + attr.Value = "tbls" + case ST_DocPartGalleryWatermarks: + attr.Value = "watermarks" + case ST_DocPartGalleryAutoTxt: + attr.Value = "autoTxt" + case ST_DocPartGalleryTxtBox: + attr.Value = "txtBox" + case ST_DocPartGalleryPgNumT: + attr.Value = "pgNumT" + case ST_DocPartGalleryPgNumB: + attr.Value = "pgNumB" + case ST_DocPartGalleryPgNumMargins: + attr.Value = "pgNumMargins" + case ST_DocPartGalleryTblOfContents: + attr.Value = "tblOfContents" + case ST_DocPartGalleryBib: + attr.Value = "bib" + case ST_DocPartGalleryCustQuickParts: + attr.Value = "custQuickParts" + case ST_DocPartGalleryCustCoverPg: + attr.Value = "custCoverPg" + case ST_DocPartGalleryCustEq: + attr.Value = "custEq" + case ST_DocPartGalleryCustFtrs: + attr.Value = "custFtrs" + case ST_DocPartGalleryCustHdrs: + attr.Value = "custHdrs" + case ST_DocPartGalleryCustPgNum: + attr.Value = "custPgNum" + case ST_DocPartGalleryCustTbls: + attr.Value = "custTbls" + case ST_DocPartGalleryCustWatermarks: + attr.Value = "custWatermarks" + case ST_DocPartGalleryCustAutoTxt: + attr.Value = "custAutoTxt" + case ST_DocPartGalleryCustTxtBox: + attr.Value = "custTxtBox" + case ST_DocPartGalleryCustPgNumT: + attr.Value = "custPgNumT" + case ST_DocPartGalleryCustPgNumB: + attr.Value = "custPgNumB" + case ST_DocPartGalleryCustPgNumMargins: + attr.Value = "custPgNumMargins" + case ST_DocPartGalleryCustTblOfContents: + attr.Value = "custTblOfContents" + case ST_DocPartGalleryCustBib: + attr.Value = "custBib" + case ST_DocPartGalleryCustom1: + attr.Value = "custom1" + case ST_DocPartGalleryCustom2: + attr.Value = "custom2" + case ST_DocPartGalleryCustom3: + attr.Value = "custom3" + case ST_DocPartGalleryCustom4: + attr.Value = "custom4" + case ST_DocPartGalleryCustom5: + attr.Value = "custom5" + } + return attr, nil +} + +func (e *ST_DocPartGallery) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "placeholder": + *e = 1 + case "any": + *e = 2 + case "default": + *e = 3 + case "docParts": + *e = 4 + case "coverPg": + *e = 5 + case "eq": + *e = 6 + case "ftrs": + *e = 7 + case "hdrs": + *e = 8 + case "pgNum": + *e = 9 + case "tbls": + *e = 10 + case "watermarks": + *e = 11 + case "autoTxt": + *e = 12 + case "txtBox": + *e = 13 + case "pgNumT": + *e = 14 + case "pgNumB": + *e = 15 + case "pgNumMargins": + *e = 16 + case "tblOfContents": + *e = 17 + case "bib": + *e = 18 + case "custQuickParts": + *e = 19 + case "custCoverPg": + *e = 20 + case "custEq": + *e = 21 + case "custFtrs": + *e = 22 + case "custHdrs": + *e = 23 + case "custPgNum": + *e = 24 + case "custTbls": + *e = 25 + case "custWatermarks": + *e = 26 + case "custAutoTxt": + *e = 27 + case "custTxtBox": + *e = 28 + case "custPgNumT": + *e = 29 + case "custPgNumB": + *e = 30 + case "custPgNumMargins": + *e = 31 + case "custTblOfContents": + *e = 32 + case "custBib": + *e = 33 + case "custom1": + *e = 34 + case "custom2": + *e = 35 + case "custom3": + *e = 36 + case "custom4": + *e = 37 + case "custom5": + *e = 38 + } + return nil +} + +func (m ST_DocPartGallery) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_DocPartGallery) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "placeholder": + *m = 1 + case "any": + *m = 2 + case "default": + *m = 3 + case "docParts": + *m = 4 + case "coverPg": + *m = 5 + case "eq": + *m = 6 + case "ftrs": + *m = 7 + case "hdrs": + *m = 8 + case "pgNum": + *m = 9 + case "tbls": + *m = 10 + case "watermarks": + *m = 11 + case "autoTxt": + *m = 12 + case "txtBox": + *m = 13 + case "pgNumT": + *m = 14 + case "pgNumB": + *m = 15 + case "pgNumMargins": + *m = 16 + case "tblOfContents": + *m = 17 + case "bib": + *m = 18 + case "custQuickParts": + *m = 19 + case "custCoverPg": + *m = 20 + case "custEq": + *m = 21 + case "custFtrs": + *m = 22 + case "custHdrs": + *m = 23 + case "custPgNum": + *m = 24 + case "custTbls": + *m = 25 + case "custWatermarks": + *m = 26 + case "custAutoTxt": + *m = 27 + case "custTxtBox": + *m = 28 + case "custPgNumT": + *m = 29 + case "custPgNumB": + *m = 30 + case "custPgNumMargins": + *m = 31 + case "custTblOfContents": + *m = 32 + case "custBib": + *m = 33 + case "custom1": + *m = 34 + case "custom2": + *m = 35 + case "custom3": + *m = 36 + case "custom4": + *m = 37 + case "custom5": + *m = 38 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_DocPartGallery) String() string { + switch m { + case 0: + return "" + case 1: + return "placeholder" + case 2: + return "any" + case 3: + return "default" + case 4: + return "docParts" + case 5: + return "coverPg" + case 6: + return "eq" + case 7: + return "ftrs" + case 8: + return "hdrs" + case 9: + return "pgNum" + case 10: + return "tbls" + case 11: + return "watermarks" + case 12: + return "autoTxt" + case 13: + return "txtBox" + case 14: + return "pgNumT" + case 15: + return "pgNumB" + case 16: + return "pgNumMargins" + case 17: + return "tblOfContents" + case 18: + return "bib" + case 19: + return "custQuickParts" + case 20: + return "custCoverPg" + case 21: + return "custEq" + case 22: + return "custFtrs" + case 23: + return "custHdrs" + case 24: + return "custPgNum" + case 25: + return "custTbls" + case 26: + return "custWatermarks" + case 27: + return "custAutoTxt" + case 28: + return "custTxtBox" + case 29: + return "custPgNumT" + case 30: + return "custPgNumB" + case 31: + return "custPgNumMargins" + case 32: + return "custTblOfContents" + case 33: + return "custBib" + case 34: + return "custom1" + case 35: + return "custom2" + case 36: + return "custom3" + case 37: + return "custom4" + case 38: + return "custom5" + } + return "" +} + +func (m ST_DocPartGallery) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_DocPartGallery) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type ST_CaptionPos byte + +const ( + ST_CaptionPosUnset ST_CaptionPos = 0 + ST_CaptionPosAbove ST_CaptionPos = 1 + ST_CaptionPosBelow ST_CaptionPos = 2 + ST_CaptionPosLeft ST_CaptionPos = 3 + ST_CaptionPosRight ST_CaptionPos = 4 +) + +func (e ST_CaptionPos) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case ST_CaptionPosUnset: + attr.Value = "" + case ST_CaptionPosAbove: + attr.Value = "above" + case ST_CaptionPosBelow: + attr.Value = "below" + case ST_CaptionPosLeft: + attr.Value = "left" + case ST_CaptionPosRight: + attr.Value = "right" + } + return attr, nil +} + +func (e *ST_CaptionPos) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "above": + *e = 1 + case "below": + *e = 2 + case "left": + *e = 3 + case "right": + *e = 4 + } + return nil +} + +func (m ST_CaptionPos) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *ST_CaptionPos) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "above": + *m = 1 + case "below": + *m = 2 + case "left": + *m = 3 + case "right": + *m = 4 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m ST_CaptionPos) String() string { + switch m { + case 0: + return "" + case 1: + return "above" + case 2: + return "below" + case 3: + return "left" + case 4: + return "right" + } + return "" +} + +func (m ST_CaptionPos) Validate() error { + return m.ValidateWithPath("") +} + +func (m ST_CaptionPos) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +// init registers constructor functions for dynamically creating elements based off the XML namespace and name +func init() { + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Empty", NewCT_Empty) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_OnOff", NewCT_OnOff) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_LongHexNumber", NewCT_LongHexNumber) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Charset", NewCT_Charset) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_DecimalNumber", NewCT_DecimalNumber) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_UnsignedDecimalNumber", NewCT_UnsignedDecimalNumber) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_DecimalNumberOrPrecent", NewCT_DecimalNumberOrPrecent) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_TwipsMeasure", NewCT_TwipsMeasure) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_SignedTwipsMeasure", NewCT_SignedTwipsMeasure) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_PixelsMeasure", NewCT_PixelsMeasure) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_HpsMeasure", NewCT_HpsMeasure) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_SignedHpsMeasure", NewCT_SignedHpsMeasure) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_MacroName", NewCT_MacroName) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_String", NewCT_String) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_TextScale", NewCT_TextScale) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Highlight", NewCT_Highlight) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Color", NewCT_Color) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Lang", NewCT_Lang) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Guid", NewCT_Guid) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Underline", NewCT_Underline) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_TextEffect", NewCT_TextEffect) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Border", NewCT_Border) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Shd", NewCT_Shd) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_VerticalAlignRun", NewCT_VerticalAlignRun) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_FitText", NewCT_FitText) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Em", NewCT_Em) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Language", NewCT_Language) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_EastAsianLayout", NewCT_EastAsianLayout) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_FramePr", NewCT_FramePr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_TabStop", NewCT_TabStop) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Spacing", NewCT_Spacing) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Ind", NewCT_Ind) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Jc", NewCT_Jc) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_JcTable", NewCT_JcTable) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_View", NewCT_View) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Zoom", NewCT_Zoom) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_WritingStyle", NewCT_WritingStyle) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Proof", NewCT_Proof) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_DocType", NewCT_DocType) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_DocProtect", NewCT_DocProtect) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_MailMergeDocType", NewCT_MailMergeDocType) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_MailMergeDataType", NewCT_MailMergeDataType) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_MailMergeDest", NewCT_MailMergeDest) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_MailMergeOdsoFMDFieldType", NewCT_MailMergeOdsoFMDFieldType) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_TrackChangesView", NewCT_TrackChangesView) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Kinsoku", NewCT_Kinsoku) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_TextDirection", NewCT_TextDirection) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_TextAlignment", NewCT_TextAlignment) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Markup", NewCT_Markup) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_TrackChange", NewCT_TrackChange) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_CellMergeTrackChange", NewCT_CellMergeTrackChange) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_TrackChangeRange", NewCT_TrackChangeRange) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_MarkupRange", NewCT_MarkupRange) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_BookmarkRange", NewCT_BookmarkRange) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Bookmark", NewCT_Bookmark) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_MoveBookmark", NewCT_MoveBookmark) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Comment", NewCT_Comment) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_TrackChangeNumbering", NewCT_TrackChangeNumbering) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_TblPrExChange", NewCT_TblPrExChange) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_TcPrChange", NewCT_TcPrChange) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_TrPrChange", NewCT_TrPrChange) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_TblGridChange", NewCT_TblGridChange) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_TblPrChange", NewCT_TblPrChange) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_SectPrChange", NewCT_SectPrChange) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_PPrChange", NewCT_PPrChange) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_RPrChange", NewCT_RPrChange) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_ParaRPrChange", NewCT_ParaRPrChange) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_RunTrackChange", NewCT_RunTrackChange) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_NumPr", NewCT_NumPr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_PBdr", NewCT_PBdr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Tabs", NewCT_Tabs) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_TextboxTightWrap", NewCT_TextboxTightWrap) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_PPr", NewCT_PPr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_PPrBase", NewCT_PPrBase) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_PPrGeneral", NewCT_PPrGeneral) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Control", NewCT_Control) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Background", NewCT_Background) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Rel", NewCT_Rel) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Object", NewCT_Object) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Picture", NewCT_Picture) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_ObjectEmbed", NewCT_ObjectEmbed) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_ObjectLink", NewCT_ObjectLink) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Drawing", NewCT_Drawing) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_SimpleField", NewCT_SimpleField) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_FFTextType", NewCT_FFTextType) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_FFName", NewCT_FFName) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_FldChar", NewCT_FldChar) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Hyperlink", NewCT_Hyperlink) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_FFData", NewCT_FFData) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_FFHelpText", NewCT_FFHelpText) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_FFStatusText", NewCT_FFStatusText) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_FFCheckBox", NewCT_FFCheckBox) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_FFDDList", NewCT_FFDDList) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_FFTextInput", NewCT_FFTextInput) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_SectType", NewCT_SectType) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_PaperSource", NewCT_PaperSource) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_PageSz", NewCT_PageSz) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_PageMar", NewCT_PageMar) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_PageBorders", NewCT_PageBorders) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_PageBorder", NewCT_PageBorder) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_BottomPageBorder", NewCT_BottomPageBorder) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_TopPageBorder", NewCT_TopPageBorder) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_LineNumber", NewCT_LineNumber) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_PageNumber", NewCT_PageNumber) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Column", NewCT_Column) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Columns", NewCT_Columns) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_VerticalJc", NewCT_VerticalJc) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_DocGrid", NewCT_DocGrid) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_HdrFtrRef", NewCT_HdrFtrRef) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_HdrFtr", NewCT_HdrFtr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_SectPrBase", NewCT_SectPrBase) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_SectPr", NewCT_SectPr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Br", NewCT_Br) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_PTab", NewCT_PTab) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Sym", NewCT_Sym) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_ProofErr", NewCT_ProofErr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Perm", NewCT_Perm) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_PermStart", NewCT_PermStart) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Text", NewCT_Text) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_R", NewCT_R) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Fonts", NewCT_Fonts) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_RPr", NewCT_RPr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_MathCtrlIns", NewCT_MathCtrlIns) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_MathCtrlDel", NewCT_MathCtrlDel) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_RPrOriginal", NewCT_RPrOriginal) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_ParaRPrOriginal", NewCT_ParaRPrOriginal) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_ParaRPr", NewCT_ParaRPr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_AltChunk", NewCT_AltChunk) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_AltChunkPr", NewCT_AltChunkPr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_RubyAlign", NewCT_RubyAlign) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_RubyPr", NewCT_RubyPr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_RubyContent", NewCT_RubyContent) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Ruby", NewCT_Ruby) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Lock", NewCT_Lock) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_SdtListItem", NewCT_SdtListItem) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_SdtDateMappingType", NewCT_SdtDateMappingType) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_CalendarType", NewCT_CalendarType) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_SdtDate", NewCT_SdtDate) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_SdtComboBox", NewCT_SdtComboBox) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_SdtDocPart", NewCT_SdtDocPart) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_SdtDropDownList", NewCT_SdtDropDownList) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Placeholder", NewCT_Placeholder) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_SdtText", NewCT_SdtText) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_DataBinding", NewCT_DataBinding) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_SdtPr", NewCT_SdtPr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_SdtEndPr", NewCT_SdtEndPr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_DirContentRun", NewCT_DirContentRun) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_BdoContentRun", NewCT_BdoContentRun) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_SdtContentRun", NewCT_SdtContentRun) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_SdtContentBlock", NewCT_SdtContentBlock) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_SdtContentRow", NewCT_SdtContentRow) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_SdtContentCell", NewCT_SdtContentCell) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_SdtBlock", NewCT_SdtBlock) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_SdtRun", NewCT_SdtRun) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_SdtCell", NewCT_SdtCell) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_SdtRow", NewCT_SdtRow) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Attr", NewCT_Attr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_CustomXmlRun", NewCT_CustomXmlRun) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_SmartTagRun", NewCT_SmartTagRun) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_CustomXmlBlock", NewCT_CustomXmlBlock) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_CustomXmlPr", NewCT_CustomXmlPr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_CustomXmlRow", NewCT_CustomXmlRow) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_CustomXmlCell", NewCT_CustomXmlCell) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_SmartTagPr", NewCT_SmartTagPr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_P", NewCT_P) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Height", NewCT_Height) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_TblWidth", NewCT_TblWidth) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_TblGridCol", NewCT_TblGridCol) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_TblGridBase", NewCT_TblGridBase) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_TblGrid", NewCT_TblGrid) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_TcBorders", NewCT_TcBorders) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_TcMar", NewCT_TcMar) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_VMerge", NewCT_VMerge) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_HMerge", NewCT_HMerge) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_TcPrBase", NewCT_TcPrBase) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_TcPr", NewCT_TcPr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_TcPrInner", NewCT_TcPrInner) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Tc", NewCT_Tc) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Cnf", NewCT_Cnf) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Headers", NewCT_Headers) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_TrPrBase", NewCT_TrPrBase) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_TrPr", NewCT_TrPr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Row", NewCT_Row) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_TblLayoutType", NewCT_TblLayoutType) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_TblOverlap", NewCT_TblOverlap) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_TblPPr", NewCT_TblPPr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_TblCellMar", NewCT_TblCellMar) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_TblBorders", NewCT_TblBorders) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_TblPrBase", NewCT_TblPrBase) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_TblPr", NewCT_TblPr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_TblPrExBase", NewCT_TblPrExBase) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_TblPrEx", NewCT_TblPrEx) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Tbl", NewCT_Tbl) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_TblLook", NewCT_TblLook) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_FtnPos", NewCT_FtnPos) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_EdnPos", NewCT_EdnPos) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_NumFmt", NewCT_NumFmt) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_NumRestart", NewCT_NumRestart) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_FtnEdnRef", NewCT_FtnEdnRef) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_FtnEdnSepRef", NewCT_FtnEdnSepRef) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_FtnEdn", NewCT_FtnEdn) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_FtnProps", NewCT_FtnProps) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_EdnProps", NewCT_EdnProps) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_FtnDocProps", NewCT_FtnDocProps) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_EdnDocProps", NewCT_EdnDocProps) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_RecipientData", NewCT_RecipientData) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Base64Binary", NewCT_Base64Binary) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Recipients", NewCT_Recipients) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_OdsoFieldMapData", NewCT_OdsoFieldMapData) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_MailMergeSourceType", NewCT_MailMergeSourceType) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Odso", NewCT_Odso) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_MailMerge", NewCT_MailMerge) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_TargetScreenSz", NewCT_TargetScreenSz) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Compat", NewCT_Compat) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_CompatSetting", NewCT_CompatSetting) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_DocVar", NewCT_DocVar) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_DocVars", NewCT_DocVars) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_DocRsids", NewCT_DocRsids) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_CharacterSpacing", NewCT_CharacterSpacing) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_SaveThroughXslt", NewCT_SaveThroughXslt) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_RPrDefault", NewCT_RPrDefault) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_PPrDefault", NewCT_PPrDefault) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_DocDefaults", NewCT_DocDefaults) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_ColorSchemeMapping", NewCT_ColorSchemeMapping) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_ReadingModeInkLockDown", NewCT_ReadingModeInkLockDown) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_WriteProtection", NewCT_WriteProtection) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Settings", NewCT_Settings) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_StyleSort", NewCT_StyleSort) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_StylePaneFilter", NewCT_StylePaneFilter) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_WebSettings", NewCT_WebSettings) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_FrameScrollbar", NewCT_FrameScrollbar) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_OptimizeForBrowser", NewCT_OptimizeForBrowser) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Frame", NewCT_Frame) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_FrameLayout", NewCT_FrameLayout) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_FramesetSplitbar", NewCT_FramesetSplitbar) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Frameset", NewCT_Frameset) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_NumPicBullet", NewCT_NumPicBullet) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_LevelSuffix", NewCT_LevelSuffix) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_LevelText", NewCT_LevelText) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_LvlLegacy", NewCT_LvlLegacy) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Lvl", NewCT_Lvl) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_MultiLevelType", NewCT_MultiLevelType) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_AbstractNum", NewCT_AbstractNum) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_NumLvl", NewCT_NumLvl) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Num", NewCT_Num) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Numbering", NewCT_Numbering) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_TblStylePr", NewCT_TblStylePr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Style", NewCT_Style) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_LsdException", NewCT_LsdException) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_LatentStyles", NewCT_LatentStyles) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Styles", NewCT_Styles) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Panose", NewCT_Panose) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_FontFamily", NewCT_FontFamily) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Pitch", NewCT_Pitch) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_FontSig", NewCT_FontSig) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_FontRel", NewCT_FontRel) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Font", NewCT_Font) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_FontsList", NewCT_FontsList) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_DivBdr", NewCT_DivBdr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Div", NewCT_Div) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Divs", NewCT_Divs) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_TxbxContent", NewCT_TxbxContent) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Body", NewCT_Body) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_ShapeDefaults", NewCT_ShapeDefaults) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Comments", NewCT_Comments) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Footnotes", NewCT_Footnotes) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Endnotes", NewCT_Endnotes) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_SmartTagType", NewCT_SmartTagType) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_DocPartBehavior", NewCT_DocPartBehavior) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_DocPartBehaviors", NewCT_DocPartBehaviors) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_DocPartType", NewCT_DocPartType) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_DocPartTypes", NewCT_DocPartTypes) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_DocPartGallery", NewCT_DocPartGallery) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_DocPartCategory", NewCT_DocPartCategory) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_DocPartName", NewCT_DocPartName) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_DocPartPr", NewCT_DocPartPr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_DocPart", NewCT_DocPart) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_DocParts", NewCT_DocParts) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Caption", NewCT_Caption) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_AutoCaption", NewCT_AutoCaption) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_AutoCaptions", NewCT_AutoCaptions) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Captions", NewCT_Captions) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_DocumentBase", NewCT_DocumentBase) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_Document", NewCT_Document) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "CT_GlossaryDocument", NewCT_GlossaryDocument) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "recipients", NewRecipients) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "txbxContent", NewTxbxContent) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "comments", NewComments) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "footnotes", NewFootnotes) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "endnotes", NewEndnotes) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "hdr", NewHdr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "ftr", NewFtr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "settings", NewSettings) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "webSettings", NewWebSettings) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "fonts", NewFonts) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "numbering", NewNumbering) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "styles", NewStyles) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "document", NewDocument) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "glossaryDocument", NewGlossaryDocument) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "EG_PContentMath", NewEG_PContentMath) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "EG_PContentBase", NewEG_PContentBase) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "EG_ContentRunContentBase", NewEG_ContentRunContentBase) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "EG_CellMarkupElements", NewEG_CellMarkupElements) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "EG_RangeMarkupElements", NewEG_RangeMarkupElements) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "EG_HdrFtrReferences", NewEG_HdrFtrReferences) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "EG_SectPrContents", NewEG_SectPrContents) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "EG_RunInnerContent", NewEG_RunInnerContent) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "EG_RPrBase", NewEG_RPrBase) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "EG_RPrContent", NewEG_RPrContent) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "EG_RPr", NewEG_RPr) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "EG_RPrMath", NewEG_RPrMath) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "EG_ParaRPrTrackChanges", NewEG_ParaRPrTrackChanges) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "EG_RubyContent", NewEG_RubyContent) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "EG_ContentRunContent", NewEG_ContentRunContent) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "EG_ContentBlockContent", NewEG_ContentBlockContent) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "EG_ContentRowContent", NewEG_ContentRowContent) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "EG_ContentCellContent", NewEG_ContentCellContent) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "EG_PContent", NewEG_PContent) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "EG_FtnEdnNumProps", NewEG_FtnEdnNumProps) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "EG_MathContent", NewEG_MathContent) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "EG_BlockLevelChunkElts", NewEG_BlockLevelChunkElts) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "EG_BlockLevelElts", NewEG_BlockLevelElts) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "EG_RunLevelElts", NewEG_RunLevelElts) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "AG_Password", NewAG_Password) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "AG_TransitionalPassword", NewAG_TransitionalPassword) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "AG_SectPrAttributes", NewAG_SectPrAttributes) +} + +type WdST_WrapText byte + +const ( + WdST_WrapTextUnset WdST_WrapText = 0 + WdST_WrapTextBothSides WdST_WrapText = 1 + WdST_WrapTextLeft WdST_WrapText = 2 + WdST_WrapTextRight WdST_WrapText = 3 + WdST_WrapTextLargest WdST_WrapText = 4 +) + +func (e WdST_WrapText) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case WdST_WrapTextUnset: + attr.Value = "" + case WdST_WrapTextBothSides: + attr.Value = "bothSides" + case WdST_WrapTextLeft: + attr.Value = "left" + case WdST_WrapTextRight: + attr.Value = "right" + case WdST_WrapTextLargest: + attr.Value = "largest" + } + return attr, nil +} + +func (e *WdST_WrapText) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "bothSides": + *e = 1 + case "left": + *e = 2 + case "right": + *e = 3 + case "largest": + *e = 4 + } + return nil +} + +func (m WdST_WrapText) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *WdST_WrapText) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "bothSides": + *m = 1 + case "left": + *m = 2 + case "right": + *m = 3 + case "largest": + *m = 4 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m WdST_WrapText) String() string { + switch m { + case 0: + return "" + case 1: + return "bothSides" + case 2: + return "left" + case 3: + return "right" + case 4: + return "largest" + } + return "" +} + +func (m WdST_WrapText) Validate() error { + return m.ValidateWithPath("") +} + +func (m WdST_WrapText) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type WdST_AlignH byte + +const ( + WdST_AlignHUnset WdST_AlignH = 0 + WdST_AlignHLeft WdST_AlignH = 1 + WdST_AlignHRight WdST_AlignH = 2 + WdST_AlignHCenter WdST_AlignH = 3 + WdST_AlignHInside WdST_AlignH = 4 + WdST_AlignHOutside WdST_AlignH = 5 +) + +func (e WdST_AlignH) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case WdST_AlignHUnset: + attr.Value = "" + case WdST_AlignHLeft: + attr.Value = "left" + case WdST_AlignHRight: + attr.Value = "right" + case WdST_AlignHCenter: + attr.Value = "center" + case WdST_AlignHInside: + attr.Value = "inside" + case WdST_AlignHOutside: + attr.Value = "outside" + } + return attr, nil +} + +func (e *WdST_AlignH) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "left": + *e = 1 + case "right": + *e = 2 + case "center": + *e = 3 + case "inside": + *e = 4 + case "outside": + *e = 5 + } + return nil +} + +func (m WdST_AlignH) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *WdST_AlignH) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "left": + *m = 1 + case "right": + *m = 2 + case "center": + *m = 3 + case "inside": + *m = 4 + case "outside": + *m = 5 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m WdST_AlignH) String() string { + switch m { + case 0: + return "" + case 1: + return "left" + case 2: + return "right" + case 3: + return "center" + case 4: + return "inside" + case 5: + return "outside" + } + return "" +} + +func (m WdST_AlignH) Validate() error { + return m.ValidateWithPath("") +} + +func (m WdST_AlignH) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type WdST_RelFromH byte + +const ( + WdST_RelFromHUnset WdST_RelFromH = 0 + WdST_RelFromHMargin WdST_RelFromH = 1 + WdST_RelFromHPage WdST_RelFromH = 2 + WdST_RelFromHColumn WdST_RelFromH = 3 + WdST_RelFromHCharacter WdST_RelFromH = 4 + WdST_RelFromHLeftMargin WdST_RelFromH = 5 + WdST_RelFromHRightMargin WdST_RelFromH = 6 + WdST_RelFromHInsideMargin WdST_RelFromH = 7 + WdST_RelFromHOutsideMargin WdST_RelFromH = 8 +) + +func (e WdST_RelFromH) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case WdST_RelFromHUnset: + attr.Value = "" + case WdST_RelFromHMargin: + attr.Value = "margin" + case WdST_RelFromHPage: + attr.Value = "page" + case WdST_RelFromHColumn: + attr.Value = "column" + case WdST_RelFromHCharacter: + attr.Value = "character" + case WdST_RelFromHLeftMargin: + attr.Value = "leftMargin" + case WdST_RelFromHRightMargin: + attr.Value = "rightMargin" + case WdST_RelFromHInsideMargin: + attr.Value = "insideMargin" + case WdST_RelFromHOutsideMargin: + attr.Value = "outsideMargin" + } + return attr, nil +} + +func (e *WdST_RelFromH) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "margin": + *e = 1 + case "page": + *e = 2 + case "column": + *e = 3 + case "character": + *e = 4 + case "leftMargin": + *e = 5 + case "rightMargin": + *e = 6 + case "insideMargin": + *e = 7 + case "outsideMargin": + *e = 8 + } + return nil +} + +func (m WdST_RelFromH) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *WdST_RelFromH) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "margin": + *m = 1 + case "page": + *m = 2 + case "column": + *m = 3 + case "character": + *m = 4 + case "leftMargin": + *m = 5 + case "rightMargin": + *m = 6 + case "insideMargin": + *m = 7 + case "outsideMargin": + *m = 8 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m WdST_RelFromH) String() string { + switch m { + case 0: + return "" + case 1: + return "margin" + case 2: + return "page" + case 3: + return "column" + case 4: + return "character" + case 5: + return "leftMargin" + case 6: + return "rightMargin" + case 7: + return "insideMargin" + case 8: + return "outsideMargin" + } + return "" +} + +func (m WdST_RelFromH) Validate() error { + return m.ValidateWithPath("") +} + +func (m WdST_RelFromH) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7, 8: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type WdST_AlignV byte + +const ( + WdST_AlignVUnset WdST_AlignV = 0 + WdST_AlignVTop WdST_AlignV = 1 + WdST_AlignVBottom WdST_AlignV = 2 + WdST_AlignVCenter WdST_AlignV = 3 + WdST_AlignVInside WdST_AlignV = 4 + WdST_AlignVOutside WdST_AlignV = 5 +) + +func (e WdST_AlignV) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case WdST_AlignVUnset: + attr.Value = "" + case WdST_AlignVTop: + attr.Value = "top" + case WdST_AlignVBottom: + attr.Value = "bottom" + case WdST_AlignVCenter: + attr.Value = "center" + case WdST_AlignVInside: + attr.Value = "inside" + case WdST_AlignVOutside: + attr.Value = "outside" + } + return attr, nil +} + +func (e *WdST_AlignV) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "top": + *e = 1 + case "bottom": + *e = 2 + case "center": + *e = 3 + case "inside": + *e = 4 + case "outside": + *e = 5 + } + return nil +} + +func (m WdST_AlignV) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *WdST_AlignV) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "top": + *m = 1 + case "bottom": + *m = 2 + case "center": + *m = 3 + case "inside": + *m = 4 + case "outside": + *m = 5 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m WdST_AlignV) String() string { + switch m { + case 0: + return "" + case 1: + return "top" + case 2: + return "bottom" + case 3: + return "center" + case 4: + return "inside" + case 5: + return "outside" + } + return "" +} + +func (m WdST_AlignV) Validate() error { + return m.ValidateWithPath("") +} + +func (m WdST_AlignV) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +type WdST_RelFromV byte + +const ( + WdST_RelFromVUnset WdST_RelFromV = 0 + WdST_RelFromVMargin WdST_RelFromV = 1 + WdST_RelFromVPage WdST_RelFromV = 2 + WdST_RelFromVParagraph WdST_RelFromV = 3 + WdST_RelFromVLine WdST_RelFromV = 4 + WdST_RelFromVTopMargin WdST_RelFromV = 5 + WdST_RelFromVBottomMargin WdST_RelFromV = 6 + WdST_RelFromVInsideMargin WdST_RelFromV = 7 + WdST_RelFromVOutsideMargin WdST_RelFromV = 8 +) + +func (e WdST_RelFromV) MarshalXMLAttr(name xml.Name) (xml.Attr, error) { + attr := xml.Attr{} + attr.Name = name + switch e { + case WdST_RelFromVUnset: + attr.Value = "" + case WdST_RelFromVMargin: + attr.Value = "margin" + case WdST_RelFromVPage: + attr.Value = "page" + case WdST_RelFromVParagraph: + attr.Value = "paragraph" + case WdST_RelFromVLine: + attr.Value = "line" + case WdST_RelFromVTopMargin: + attr.Value = "topMargin" + case WdST_RelFromVBottomMargin: + attr.Value = "bottomMargin" + case WdST_RelFromVInsideMargin: + attr.Value = "insideMargin" + case WdST_RelFromVOutsideMargin: + attr.Value = "outsideMargin" + } + return attr, nil +} + +func (e *WdST_RelFromV) UnmarshalXMLAttr(attr xml.Attr) error { + switch attr.Value { + case "": + *e = 0 + case "margin": + *e = 1 + case "page": + *e = 2 + case "paragraph": + *e = 3 + case "line": + *e = 4 + case "topMargin": + *e = 5 + case "bottomMargin": + *e = 6 + case "insideMargin": + *e = 7 + case "outsideMargin": + *e = 8 + } + return nil +} + +func (m WdST_RelFromV) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(m.String(), start) +} + +func (m *WdST_RelFromV) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + tok, err := d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + *m = 1 + return nil + } + if cd, ok := tok.(xml.CharData); !ok { + return fmt.Errorf("expected char data, got %T", tok) + } else { + switch string(cd) { + case "": + *m = 0 + case "margin": + *m = 1 + case "page": + *m = 2 + case "paragraph": + *m = 3 + case "line": + *m = 4 + case "topMargin": + *m = 5 + case "bottomMargin": + *m = 6 + case "insideMargin": + *m = 7 + case "outsideMargin": + *m = 8 + } + } + tok, err = d.Token() + if err != nil { + return err + } + if el, ok := tok.(xml.EndElement); ok && el.Name == start.Name { + return nil + } + return fmt.Errorf("expected end element, got %v", tok) +} + +func (m WdST_RelFromV) String() string { + switch m { + case 0: + return "" + case 1: + return "margin" + case 2: + return "page" + case 3: + return "paragraph" + case 4: + return "line" + case 5: + return "topMargin" + case 6: + return "bottomMargin" + case 7: + return "insideMargin" + case 8: + return "outsideMargin" + } + return "" +} + +func (m WdST_RelFromV) Validate() error { + return m.ValidateWithPath("") +} + +func (m WdST_RelFromV) ValidateWithPath(path string) error { + switch m { + case 0, 1, 2, 3, 4, 5, 6, 7, 8: + default: + return fmt.Errorf("%s: out of range value %d", path, int(m)) + } + return nil +} + +// init registers constructor functions for dynamically creating elements based off the XML namespace and name +func init() { + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", "CT_EffectExtent", NewWdCT_EffectExtent) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", "CT_Inline", NewWdCT_Inline) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", "CT_WrapPath", NewWdCT_WrapPath) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", "CT_WrapNone", NewWdCT_WrapNone) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", "CT_WrapSquare", NewWdCT_WrapSquare) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", "CT_WrapTight", NewWdCT_WrapTight) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", "CT_WrapThrough", NewWdCT_WrapThrough) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", "CT_WrapTopBottom", NewWdCT_WrapTopBottom) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", "CT_PosH", NewWdCT_PosH) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", "CT_PosV", NewWdCT_PosV) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", "CT_Anchor", NewWdCT_Anchor) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", "CT_TxbxContent", NewWdCT_TxbxContent) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", "CT_TextboxInfo", NewWdCT_TextboxInfo) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", "CT_LinkedTextboxInformation", NewWdCT_LinkedTextboxInformation) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", "CT_WordprocessingShape", NewWdCT_WordprocessingShape) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", "CT_GraphicFrame", NewWdCT_GraphicFrame) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", "CT_WordprocessingContentPartNonVisual", NewWdCT_WordprocessingContentPartNonVisual) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", "CT_WordprocessingContentPart", NewWdCT_WordprocessingContentPart) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", "CT_WordprocessingGroup", NewWdCT_WordprocessingGroup) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", "CT_WordprocessingCanvas", NewWdCT_WordprocessingCanvas) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", "wpc", NewWdWpc) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", "wgp", NewWdWgp) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", "wsp", NewWdWsp) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", "inline", NewWdInline) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", "anchor", NewWdAnchor) + gooxml.RegisterConstructor("http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", "EG_WrapType", NewWdEG_WrapType) +} diff --git a/backend/vendor/baliance.com/gooxml/schemas.go b/backend/vendor/baliance.com/gooxml/schemas.go new file mode 100644 index 00000000..4d0219d6 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/schemas.go @@ -0,0 +1,62 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package gooxml + +// Consts for content types used throughout the package +const ( + // Common + OfficeDocumentType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" + StylesType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" + ThemeType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" + ThemeContentType = "application/vnd.openxmlformats-officedocument.theme+xml" + SettingsType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings" + ImageType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" + CommentsType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments" + CommentsContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml" + ThumbnailType = "http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail" + DrawingType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing" + DrawingContentType = "application/vnd.openxmlformats-officedocument.drawing+xml" + ChartType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart" + ChartContentType = "application/vnd.openxmlformats-officedocument.drawingml.chart+xml" + HyperLinkType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" + ExtendedPropertiesType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" + CorePropertiesType = "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" + + // SML + WorksheetType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" + WorksheetContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml" + SharedStingsType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" + SharedStringsContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml" + SMLStyleSheetContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml" + TableType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/table" + TableContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml" + ViewPropertiesType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/viewProps" + TableStylesType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/tableStyles" + + // WML + HeaderType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header" + FooterType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer" + NumberingType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering" + FontTableType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable" + WebSettingsType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings" + FootNotesType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes" + EndNotesType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes" + + // PML + SlideType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide" + SlideContentType = "application/vnd.openxmlformats-officedocument.presentationml.slide+xml" + SlideMasterType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster" + SlideMasterContentType = "application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml" + SlideLayoutType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout" + SlideLayoutContentType = "application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml" + PresentationPropertiesType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/presProps" + + // VML + VMLDrawingType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing" + VMLDrawingContentType = "application/vnd.openxmlformats-officedocument.vmlDrawing" +) diff --git a/backend/vendor/baliance.com/gooxml/test-coverage.sh b/backend/vendor/baliance.com/gooxml/test-coverage.sh new file mode 100644 index 00000000..f1af3f09 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/test-coverage.sh @@ -0,0 +1,21 @@ +#!/bin/bash +PKG=baliance.com/gooxml +ALLPKGS=`go list $PKG/... | grep -iv schema` + +cd $GOPATH/src/$PKG +echo "Prebuilding" +go build -i $PKG/... +go test -i $PKG/... + +echo -e "mode: atomic" > coverage.txt +echo "Running tests" +for pkg in $ALLPKGS; do + echo $pkg + go test -coverprofile=coverprofile -covermode=atomic $pkg + if [ -f coverprofile ]; then + tail -n+2 coverprofile >> coverage.txt + rm coverprofile + fi +done +rm coverage.out coverage.txte +bash <(curl -s https://codecov.io/bash) diff --git a/backend/vendor/baliance.com/gooxml/update-godoc.sh b/backend/vendor/baliance.com/gooxml/update-godoc.sh new file mode 100644 index 00000000..a311fb8e --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/update-godoc.sh @@ -0,0 +1,7 @@ +#!/bin/bash +for file in `find . -type d -not -ipath "*git*" -print`; do + url=`echo $file | sed 's#^.#https://godoc.org/baliance.com/gooxml#'` + echo $url + curl -s $url -o /dev/null + sleep 10 +done \ No newline at end of file diff --git a/backend/vendor/baliance.com/gooxml/update-version.sh b/backend/vendor/baliance.com/gooxml/update-version.sh new file mode 100644 index 00000000..9ffcf329 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/update-version.sh @@ -0,0 +1,23 @@ +#!/bin/bash + + +cat << __EOF > version.go +// Copyright `date +%Y` Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package gooxml + +import "time" + +// Release is the last release version of the software. +var ReleaseVersion = "v0.8000" + +// ReleaseDate is the release date of the source code for licensing purposes. +var ReleaseDate = time.Date(`date +%Y`,`date +%_m`,`date +%_d`,0,0,0,0,time.UTC) + +__EOF +goimports -w version.go diff --git a/backend/vendor/baliance.com/gooxml/version.go b/backend/vendor/baliance.com/gooxml/version.go new file mode 100644 index 00000000..bc495a55 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/version.go @@ -0,0 +1,16 @@ +// Copyright 2018 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package gooxml + +import "time" + +// Release is the last release version of the software. +var ReleaseVersion = "v0.8000" + +// ReleaseDate is the release date of the source code for licensing purposes. +var ReleaseDate = time.Date(2018, 9, 14, 0, 0, 0, 0, time.UTC) diff --git a/backend/vendor/baliance.com/gooxml/xml.go b/backend/vendor/baliance.com/gooxml/xml.go new file mode 100644 index 00000000..651c7054 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/xml.go @@ -0,0 +1,34 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package gooxml + +import "encoding/xml" + +// NeedsSpacePreserve returns true if the string has leading or trailing space. +func NeedsSpacePreserve(s string) bool { + if len(s) == 0 { + return false + } + switch s[0] { + case '\t', '\n', '\v', '\f', '\r', ' ', 0x85, 0xA0: + return true + } + switch s[len(s)-1] { + case '\t', '\n', '\v', '\f', '\r', ' ', 0x85, 0xA0: + return true + } + return false +} + +// AddPreserveSpaceAttr adds an xml:space="preserve" attribute to a start +// element if it is required for the string s. +func AddPreserveSpaceAttr(se *xml.StartElement, s string) { + if NeedsSpacePreserve(s) { + se.Attr = append(se.Attr, xml.Attr{Name: xml.Name{Local: "xml:space"}, Value: "preserve"}) + } +} diff --git a/backend/vendor/baliance.com/gooxml/xsdany.go b/backend/vendor/baliance.com/gooxml/xsdany.go new file mode 100644 index 00000000..848aae0d --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/xsdany.go @@ -0,0 +1,233 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package gooxml + +import ( + "encoding/xml" + "strings" + "unicode" +) + +// XSDAny is used to marshal/unmarshal xsd:any types in the OOXML schema. +type XSDAny struct { + XMLName xml.Name + Attrs []xml.Attr + Data []byte + Nodes []*XSDAny +} + +var wellKnownSchemas = map[string]string{ + "a": "http://schemas.openxmlformats.org/drawingml/2006/main", + "dc": "http://purl.org/dc/elements/1.1/", + "dcterms": "http://purl.org/dc/terms/", + "mc": "http://schemas.openxmlformats.org/markup-compatibility/2006", + "mo": "http://schemas.microsoft.com/office/mac/office/2008/main", + "w": "http://schemas.openxmlformats.org/wordprocessingml/2006/main", + "w10": "urn:schemas-microsoft-com:office:word", + "w14": "http://schemas.microsoft.com/office/word/2010/wordml", + "w15": "http://schemas.microsoft.com/office/word/2012/wordml", + "wne": "http://schemas.microsoft.com/office/word/2006/wordml", + "wp": "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", + "wp14": "http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing", + "wpc": "http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas", + "wpg": "http://schemas.microsoft.com/office/word/2010/wordprocessingGroup", + "wpi": "http://schemas.microsoft.com/office/word/2010/wordprocessingInk", + "wps": "http://schemas.microsoft.com/office/word/2010/wordprocessingShape", + "xsi": "http://www.w3.org/2001/XMLSchema-instance", + "x15ac": "http://schemas.microsoft.com/office/spreadsheetml/2010/11/ac", +} + +var wellKnownSchemasInv = func() map[string]string { + r := map[string]string{} + for pfx, ns := range wellKnownSchemas { + r[ns] = pfx + } + return r +}() + +type any struct { + XMLName xml.Name + Attrs []xml.Attr `xml:",any,attr"` + Nodes []*any `xml:",any"` + Data []byte `xml:",chardata"` +} + +func dd(a *any) { + for _, n := range a.Nodes { + dd(n) + } +} + +// UnmarshalXML implements the xml.Unmarshaler interface. +func (x *XSDAny) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + a := any{} + if err := d.DecodeElement(&a, &start); err != nil { + return err + } + dd(&a) + x.XMLName = a.XMLName + x.Attrs = a.Attrs + x.Data = a.Data + x.Nodes = convertToXNodes(a.Nodes) + return nil +} + +type nsSet struct { + urlToPrefix map[string]string + prefixToURL map[string]string + prefixes []string //required for deterministic output +} + +func (n *nsSet) getPrefix(ns string) string { + // Common namespaces are used in these 'any' elements and some versions + // of Word really want to the prefix to match what they write out. This + // occurred primarily with docProps/core.xml + if pfx, ok := wellKnownSchemasInv[ns]; ok { + if _, ok := n.prefixToURL[pfx]; !ok { + n.prefixToURL[pfx] = ns + n.urlToPrefix[ns] = pfx + n.prefixes = append(n.prefixes, pfx) + } + return pfx + } + + // trying to construct a decent looking valid prefix + ns = strings.TrimFunc(ns, func(r rune) bool { + return !unicode.IsLetter(r) + }) + + // do we have a prefix for this ns? + if sc, ok := n.urlToPrefix[ns]; ok { + return sc + } + + // determine the last path portion of the namespace + // "urn:schemas-microsoft-com:office:office" = "office" + // "http://schemas.microsoft.com/office/word/2012/wordml" = "wordml" + split := strings.Split(ns, "/") + split = strings.Split(split[len(split)-1], ":") + // last segment of the namesapce + last := split[len(split)-1] + lng := 0 + pfx := []byte{} + for { + if lng < len(last) { + pfx = append(pfx, last[lng]) + } else { + pfx = append(pfx, '_') + } + lng++ + // is this prefix unused? + if _, ok := n.prefixToURL[string(pfx)]; !ok { + n.prefixToURL[string(pfx)] = ns + n.urlToPrefix[ns] = string(pfx) + n.prefixes = append(n.prefixes, string(pfx)) + return string(pfx) + } + } +} + +func (n nsSet) applyToNode(a *any) { + if a.XMLName.Space == "" { + return + } + pfx := n.getPrefix(a.XMLName.Space) + a.XMLName.Space = "" + a.XMLName.Local = pfx + ":" + a.XMLName.Local + tmpAttr := a.Attrs + a.Attrs = nil + for _, attr := range tmpAttr { + // skip namespace prefix declaration atributes as we create them later + if attr.Name.Space == "xmlns" { + continue + } + if attr.Name.Space != "" { + pfx := n.getPrefix(attr.Name.Space) + attr.Name.Space = "" + attr.Name.Local = pfx + ":" + attr.Name.Local + } + a.Attrs = append(a.Attrs, attr) + } + for _, cn := range a.Nodes { + n.applyToNode(cn) + } +} + +// collectNS walks a tree of nodes finding any non-default namespace being used +func (x *XSDAny) collectNS(ns *nsSet) { + if x.XMLName.Space != "" { + ns.getPrefix(x.XMLName.Space) + } + for _, attr := range x.Attrs { + if attr.Name.Space != "" && attr.Name.Space != "xmlns" { + ns.getPrefix(attr.Name.Space) + } + } + for _, n := range x.Nodes { + n.collectNS(ns) + } +} + +func convertToXNodes(an []*any) []*XSDAny { + ret := []*XSDAny{} + for _, a := range an { + x := &XSDAny{} + x.XMLName = a.XMLName + x.Attrs = a.Attrs + x.Data = a.Data + x.Nodes = convertToXNodes(a.Nodes) + ret = append(ret, x) + } + return ret +} +func convertToNodes(xn []*XSDAny) []*any { + ret := []*any{} + for _, x := range xn { + a := &any{} + a.XMLName = x.XMLName + a.Attrs = x.Attrs + a.Data = x.Data + a.Nodes = convertToNodes(x.Nodes) + ret = append(ret, a) + } + return ret +} + +// MarshalXML implements the xml.Marshaler interface. +func (x *XSDAny) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Name = x.XMLName + start.Attr = x.Attrs + a := any{} + a.XMLName = x.XMLName + a.Attrs = x.Attrs + a.Data = x.Data + a.Nodes = convertToNodes(x.Nodes) + + ns := nsSet{ + urlToPrefix: map[string]string{}, + prefixToURL: map[string]string{}, + } + + // collect any namespaces in use in the node tree + x.collectNS(&ns) + + // apply our new namespaces to the node and its children + ns.applyToNode(&a) + + // add our prefixes and namespaces to root element + for _, pfx := range ns.prefixes { + ns := ns.prefixToURL[pfx] + a.Attrs = append(a.Attrs, xml.Attr{ + Name: xml.Name{Local: "xmlns:" + pfx}, + Value: ns, + }) + } + + // finally write out our new element + return e.Encode(&a) +} diff --git a/backend/vendor/baliance.com/gooxml/zippkg/decodemap.go b/backend/vendor/baliance.com/gooxml/zippkg/decodemap.go new file mode 100644 index 00000000..327cc825 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/zippkg/decodemap.go @@ -0,0 +1,136 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package zippkg + +import ( + "archive/zip" + "path" + + "baliance.com/gooxml/schema/soo/pkg/relationships" +) + +// OnNewRelationshipFunc is called when a new relationship has been discovered. +// +// target is a resolved path that takes into account the location of the +// relationships file source and should be the path in the zip file. +// +// files are passed so non-XML files that can't be handled by AddTarget can be +// decoded directly (e.g. images) +// +// rel is the actual relationship so its target can be modified if the source +// target doesn't match where gooxml will write the file (e.g. read in +// 'xl/worksheets/MyWorksheet.xml' and we'll write out +// 'xl/worksheets/sheet1.xml') +type OnNewRelationshipFunc func(decMap *DecodeMap, target, typ string, files []*zip.File, rel *relationships.Relationship, src Target) error + +// DecodeMap is used to walk a tree of relationships, decoding files and passing +// control back to the document. +type DecodeMap struct { + pathsToIfcs map[string]Target + basePaths map[*relationships.Relationships]string + rels []Target + decodeFunc OnNewRelationshipFunc + decoded map[string]struct{} + indices map[string]int +} + +// SetOnNewRelationshipFunc sets the function to be called when a new +// relationship has been discovered. +func (d *DecodeMap) SetOnNewRelationshipFunc(fn OnNewRelationshipFunc) { + d.decodeFunc = fn +} + +type Target struct { + Path string + Typ string + Ifc interface{} + Index uint32 +} + +// AddTarget allows documents to register decode targets. Path is a path that +// will be found in the zip file and ifc is an XML element that the file will be +// unmarshaled to. filePath is the absolute path to the target, ifc is the +// object to decode into, sourceFileType is the type of file that the reference +// was discovered in, and index is the index of the source file type. +func (d *DecodeMap) AddTarget(filePath string, ifc interface{}, sourceFileType string, idx uint32) bool { + if d.pathsToIfcs == nil { + d.pathsToIfcs = make(map[string]Target) + d.basePaths = make(map[*relationships.Relationships]string) + d.decoded = make(map[string]struct{}) + d.indices = make(map[string]int) + } + + // we use path.Clean instead of filepath.Clean to ensure we + // end up with forward separators + fn := path.Clean(filePath) + if _, ok := d.decoded[fn]; ok { + // already decoded this file + return false + } + d.decoded[fn] = struct{}{} + d.pathsToIfcs[fn] = Target{Path: filePath, Typ: sourceFileType, Ifc: ifc, Index: idx} + return true +} +func (d *DecodeMap) RecordIndex(path string, idx int) { + d.indices[path] = idx +} +func (d *DecodeMap) IndexFor(path string) int { + return d.indices[path] +} + +// Decode loops decoding targets registered with AddTarget and calling th +func (d *DecodeMap) Decode(files []*zip.File) error { + pass := 1 + for pass > 0 { + + // if we've loaded any relationships files, notify the document so it + // can create elements to receive the decoded version + for len(d.rels) > 0 { + relSource := d.rels[len(d.rels)-1] + d.rels = d.rels[0 : len(d.rels)-1] + relRaw := relSource.Ifc.(*relationships.Relationships) + for _, r := range relRaw.Relationship { + bp, _ := d.basePaths[relRaw] + d.decodeFunc(d, bp+r.TargetAttr, r.TypeAttr, files, r, relSource) + } + } + + for i, f := range files { + if f == nil { + continue + } + + // if there is a registered target for the file + if dest, ok := d.pathsToIfcs[f.Name]; ok { + delete(d.pathsToIfcs, f.Name) + // decode to the target and mark the file as nil so we'll skip + // it later + if err := Decode(f, dest.Ifc); err != nil { + return err + } + files[i] = nil + + // we decoded a relationships file, so we need to traverse it + if drel, ok := dest.Ifc.(*relationships.Relationships); ok { + d.rels = append(d.rels, dest) + // find the path that any files mentioned in the + // relationships file are relative to + + // we use path.Clean instead of filepath.Clean to ensure we + // end up with forward separators + basePath, _ := path.Split(path.Clean(f.Name + "/../")) + d.basePaths[drel] = basePath + // ensure we make another decode pass + pass++ + } + } + } + pass-- + } + return nil +} diff --git a/backend/vendor/baliance.com/gooxml/zippkg/helpers.go b/backend/vendor/baliance.com/gooxml/zippkg/helpers.go new file mode 100644 index 00000000..e104f114 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/zippkg/helpers.go @@ -0,0 +1,90 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package zippkg + +import ( + "archive/zip" + "encoding/xml" + "fmt" + "io" + "io/ioutil" + "os" + "sort" + "strings" + + "baliance.com/gooxml/algo" + "baliance.com/gooxml/schema/soo/pkg/relationships" +) + +// RelationsPathFor returns the relations path for a given filename. +func RelationsPathFor(path string) string { + sp := strings.Split(path, "/") + pathPortion := strings.Join(sp[0:len(sp)-1], "/") + filePortion := sp[len(sp)-1] + pathPortion += "/_rels/" + filePortion += ".rels" + return pathPortion + filePortion +} + +// Decode unmarshals the content of a *zip.File as XML to a given destination. +func Decode(f *zip.File, dest interface{}) error { + rc, err := f.Open() + if err != nil { + return fmt.Errorf("error reading %s: %s", f.Name, err) + } + defer rc.Close() + dec := xml.NewDecoder(rc) + if err := dec.Decode(dest); err != nil { + return fmt.Errorf("error decoding %s: %s", f.Name, err) + } + + // this ensures that relationship ID is increasing, which we apparently rely + // on.... + if ds, ok := dest.(*relationships.Relationships); ok { + sort.Slice(ds.Relationship, func(i, j int) bool { + lhs := ds.Relationship[i] + rhs := ds.Relationship[j] + return algo.NaturalLess(lhs.IdAttr, rhs.IdAttr) + }) + } + return nil +} + +// AddFileFromDisk reads a file from disk and adds it at a given path to a zip file. +func AddFileFromDisk(z *zip.Writer, zipPath, diskPath string) error { + w, err := z.Create(zipPath) + if err != nil { + return fmt.Errorf("error creating %s: %s", zipPath, err) + } + f, err := os.Open(diskPath) + if err != nil { + return fmt.Errorf("error opening %s: %s", diskPath, err) + } + _, err = io.Copy(w, f) + return err +} + +// ExtractToDiskTmp extracts a zip file to a temporary file in a given path, +// returning the name of the file. +func ExtractToDiskTmp(f *zip.File, path string) (string, error) { + tmpFile, err := ioutil.TempFile(path, "zz") + if err != nil { + return "", err + } + defer tmpFile.Close() + rc, err := f.Open() + if err != nil { + return "", err + } + defer rc.Close() + _, err = io.Copy(tmpFile, rc) + if err != nil { + return "", err + } + return tmpFile.Name(), nil +} diff --git a/backend/vendor/baliance.com/gooxml/zippkg/marshal.go b/backend/vendor/baliance.com/gooxml/zippkg/marshal.go new file mode 100644 index 00000000..98aa2426 --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/zippkg/marshal.go @@ -0,0 +1,55 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package zippkg + +import ( + "archive/zip" + "encoding/xml" + "fmt" + "time" + + "baliance.com/gooxml" +) + +// XMLHeader is a header that MarshalXML uses to prefix the XML files it creates. +const XMLHeader = `` + "\n" + +var nl = []byte{'\r', '\n'} + +func MarshalXMLByTypeIndex(z *zip.Writer, dt gooxml.DocType, typ string, idx int, v interface{}) error { + fn := gooxml.AbsoluteFilename(dt, typ, idx) + return MarshalXML(z, fn, v) +} + +func MarshalXMLByType(z *zip.Writer, dt gooxml.DocType, typ string, v interface{}) error { + fn := gooxml.AbsoluteFilename(dt, typ, 0) + return MarshalXML(z, fn, v) +} + +// MarshalXML creates a file inside of a zip and marshals an object as xml, prefixing it +// with a standard XML header. +func MarshalXML(z *zip.Writer, filename string, v interface{}) error { + fh := &zip.FileHeader{} + fh.Method = zip.Deflate + fh.Name = filename + fh.SetModTime(time.Now()) + + w, err := z.CreateHeader(fh) + if err != nil { + return fmt.Errorf("creating %s in zip: %s", filename, err) + } + _, err = w.Write([]byte(XMLHeader)) + if err != nil { + return fmt.Errorf("creating xml header to %s: %s", filename, err) + } + if err = xml.NewEncoder(SelfClosingWriter{w}).Encode(v); err != nil { + return fmt.Errorf("marshaling %s: %s", filename, err) + } + _, err = w.Write(nl) + return err +} diff --git a/backend/vendor/baliance.com/gooxml/zippkg/selfclosingwriter.go b/backend/vendor/baliance.com/gooxml/zippkg/selfclosingwriter.go new file mode 100644 index 00000000..75a4ba1b --- /dev/null +++ b/backend/vendor/baliance.com/gooxml/zippkg/selfclosingwriter.go @@ -0,0 +1,80 @@ +// Copyright 2017 Baliance. All rights reserved. +// +// Use of this source code is governed by the terms of the Affero GNU General +// Public License version 3.0 as published by the Free Software Foundation and +// appearing in the file LICENSE included in the packaging of this file. A +// commercial license can be purchased by contacting sales@baliance.com. + +package zippkg + +import ( + "bytes" + "io" +) + +// SelfClosingWriter wraps a writer and replaces XML tags of the +// type with +type SelfClosingWriter struct { + W io.Writer +} + +var closeTag = []byte{'/', '>'} + +func (s SelfClosingWriter) Write(b []byte) (int, error) { + writeStart := 0 + n := 0 + for i := 0; i < len(b)-2; i++ { + // found an empty tag ">" + + // find the previous tag 'FOO' of '' + if b[i] == '>' && b[i+1] == '<' && b[i+2] == '/' { + prevTag := []byte{} + et := i + for j := i; j >= 0; j-- { + if b[j] == ' ' { + et = j + } else if b[j] == '<' { + prevTag = b[j+1 : et] + break + } + } + nextTag := []byte{} + for j := i + 3; j < len(b); j++ { + if b[j] == '>' { + nextTag = b[i+3 : j] + break + } + } + + // if previous and next tag are equal which catches cases of + // foo + if !bytes.Equal(prevTag, nextTag) { + continue + } + + // write up to the start of the tag + c, err := s.W.Write(b[writeStart:i]) + if err != nil { + return n + c, err + } + n += c + + _, err = s.W.Write(closeTag) + if err != nil { + return n, err + } + + // pretend we wrote close tag + n += 3 + + // skip over the remaining close tag + for j := i + 2; j < len(b) && b[j] != '>'; j++ { + n++ + writeStart = j + 2 + i = writeStart + } + } + } + c, err := s.W.Write(b[writeStart:]) + return c + n, err +} diff --git a/backend/vendor/github.com/nguyenthenguyen/docx/.gitignore b/backend/vendor/github.com/nguyenthenguyen/docx/.gitignore new file mode 100644 index 00000000..075e069a --- /dev/null +++ b/backend/vendor/github.com/nguyenthenguyen/docx/.gitignore @@ -0,0 +1,2 @@ +TestDocumentResult.docx +.idea/ diff --git a/backend/vendor/github.com/nguyenthenguyen/docx/LICENSE b/backend/vendor/github.com/nguyenthenguyen/docx/LICENSE new file mode 100644 index 00000000..b3b62ec5 --- /dev/null +++ b/backend/vendor/github.com/nguyenthenguyen/docx/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Nguyen The Nguyen + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/vendor/github.com/nguyenthenguyen/docx/README.md b/backend/vendor/github.com/nguyenthenguyen/docx/README.md new file mode 100644 index 00000000..c58d7b18 --- /dev/null +++ b/backend/vendor/github.com/nguyenthenguyen/docx/README.md @@ -0,0 +1,55 @@ +## Simple Google Go (Golang) library for replacing text in Microsoft Word (.docx) file + +The following constitutes the bare minimum required to replace text in DOCX document. +``` go + +package main + +import ( + "strconv" + + "github.com/nguyenthenguyen/docx" +) + +func main() { + // Read from docx file + r, err := docx.ReadDocxFile("./TestDocument.docx") + // Or read from memory + // r, err := docx.ReadDocxFromMemory(data io.ReaderAt, size int64) + + // Or read from a filesystem object: + // r, err := docx.ReadDocxFromFS(file string, fs fs.FS) + + if err != nil { + panic(err) + } + docx1 := r.Editable() + // Replace like https://golang.org/pkg/strings/#Replace + docx1.Replace("old_1_1", "new_1_1", -1) + docx1.Replace("old_1_2", "new_1_2", -1) + docx1.ReplaceLink("http://example.com/", "https://github.com/nguyenthenguyen/docx", 1) + docx1.ReplaceHeader("out with the old", "in with the new") + docx1.ReplaceFooter("Change This Footer", "new footer") + docx1.WriteToFile("./new_result_1.docx") + + docx2 := r.Editable() + docx2.Replace("old_2_1", "new_2_1", -1) + docx2.Replace("old_2_2", "new_2_2", -1) + docx2.WriteToFile("./new_result_2.docx") + + // Or write to ioWriter + // docx2.Write(ioWriter io.Writer) + + docx3 := r.Editable() + //Currently only swaps apples for apples i.e. png to png, and not png to jpeg etc. + docx3.ReplaceImage("word/media/image1.png", "./new.png") + + // replace the last image + imageIndex := docx3.ImagesLen() + docx3.ReplaceImage("word/media/image"+strconv.Itoa(imageIndex)+".png", "./new.png") + docx3.WriteToFile("./new_result_3.docx") + + r.Close() +} + +``` diff --git a/backend/vendor/github.com/nguyenthenguyen/docx/TestDocument.docx b/backend/vendor/github.com/nguyenthenguyen/docx/TestDocument.docx new file mode 100644 index 00000000..225acd04 Binary files /dev/null and b/backend/vendor/github.com/nguyenthenguyen/docx/TestDocument.docx differ diff --git a/backend/vendor/github.com/nguyenthenguyen/docx/docx.go b/backend/vendor/github.com/nguyenthenguyen/docx/docx.go new file mode 100644 index 00000000..3b87bb5a --- /dev/null +++ b/backend/vendor/github.com/nguyenthenguyen/docx/docx.go @@ -0,0 +1,415 @@ +package docx + +import ( + "archive/zip" + "bufio" + "bytes" + "encoding/xml" + "errors" + "fmt" + "io" + "io/fs" + "io/ioutil" + "os" + "strings" +) + +//Contains functions to work with data from a zip file +type ZipData interface { + files() []*zip.File + close() error +} + +//Type for in memory zip files +type ZipInMemory struct { + data *zip.Reader +} + +func (d ZipInMemory) files() []*zip.File { + return d.data.File +} + +//Since there is nothing to close for in memory, just nil the data and return nil +func (d ZipInMemory) close() error { + d.data = nil + return nil +} + +//Type for zip files read from disk +type ZipFile struct { + data *zip.ReadCloser +} + +func (d ZipFile) files() []*zip.File { + return d.data.File +} + +func (d ZipFile) close() error { + return d.data.Close() +} + +type ReplaceDocx struct { + zipReader ZipData + content string + links string + headers map[string]string + footers map[string]string + images map[string]string +} + +func (r *ReplaceDocx) Editable() *Docx { + return &Docx{ + files: r.zipReader.files(), + content: r.content, + links: r.links, + headers: r.headers, + footers: r.footers, + images: r.images, + } +} + +func (r *ReplaceDocx) Close() error { + return r.zipReader.close() +} + +type Docx struct { + files []*zip.File + content string + links string + headers map[string]string + footers map[string]string + images map[string]string +} + +func (d *Docx) GetContent() string { + return d.content +} + +func (d *Docx) SetContent(content string) { + d.content = content +} + +func (d *Docx) ReplaceRaw(oldString string, newString string, num int) { + d.content = strings.Replace(d.content, oldString, newString, num) +} + +func (d *Docx) Replace(oldString string, newString string, num int) (err error) { + oldString, err = encode(oldString) + if err != nil { + return err + } + newString, err = encode(newString) + if err != nil { + return err + } + d.content = strings.Replace(d.content, oldString, newString, num) + + return nil +} + +func (d *Docx) ReplaceLink(oldString string, newString string, num int) (err error) { + oldString, err = encode(oldString) + if err != nil { + return err + } + newString, err = encode(newString) + if err != nil { + return err + } + d.links = strings.Replace(d.links, oldString, newString, num) + + return nil +} + +func (d *Docx) ReplaceHeader(oldString string, newString string) (err error) { + return replaceHeaderFooter(d.headers, oldString, newString) +} + +func (d *Docx) ReplaceFooter(oldString string, newString string) (err error) { + return replaceHeaderFooter(d.footers, oldString, newString) +} + +func (d *Docx) WriteToFile(path string) (err error) { + var target *os.File + target, err = os.Create(path) + if err != nil { + return + } + defer target.Close() + err = d.Write(target) + return +} + +func (d *Docx) Write(ioWriter io.Writer) (err error) { + w := zip.NewWriter(ioWriter) + for _, file := range d.files { + var writer io.Writer + var readCloser io.ReadCloser + + writer, err = w.Create(file.Name) + if err != nil { + return err + } + readCloser, err = file.Open() + if err != nil { + return err + } + if file.Name == "word/document.xml" { + writer.Write([]byte(d.content)) + } else if file.Name == "word/_rels/document.xml.rels" { + writer.Write([]byte(d.links)) + } else if strings.Contains(file.Name, "header") && d.headers[file.Name] != "" { + writer.Write([]byte(d.headers[file.Name])) + } else if strings.Contains(file.Name, "footer") && d.footers[file.Name] != "" { + writer.Write([]byte(d.footers[file.Name])) + } else if strings.HasPrefix(file.Name, "word/media/") && d.images[file.Name] != "" { + newImage, err := os.Open(d.images[file.Name]) + if err != nil { + return err + } + writer.Write(streamToByte(newImage)) + newImage.Close() + } else { + writer.Write(streamToByte(readCloser)) + } + } + w.Close() + return +} + +func replaceHeaderFooter(headerFooter map[string]string, oldString string, newString string) (err error) { + oldString, err = encode(oldString) + if err != nil { + return err + } + newString, err = encode(newString) + if err != nil { + return err + } + + for k := range headerFooter { + headerFooter[k] = strings.Replace(headerFooter[k], oldString, newString, -1) + } + + return nil +} + +//ReadDocxFromFS opens a docx file from the file system +func ReadDocxFromFS(file string, fs fs.FS) (*ReplaceDocx, error) { + f, err := fs.Open(file) + if err != nil { + return nil, err + } + buff := bytes.NewBuffer([]byte{}) + size, err := io.Copy(buff, f) + if err != nil { + return nil, err + } + reader := bytes.NewReader(buff.Bytes()) + return ReadDocxFromMemory(reader, size) +} + +func ReadDocxFromMemory(data io.ReaderAt, size int64) (*ReplaceDocx, error) { + reader, err := zip.NewReader(data, size) + if err != nil { + return nil, err + } + zipData := ZipInMemory{data: reader} + return ReadDocx(zipData) +} + +func ReadDocxFile(path string) (*ReplaceDocx, error) { + reader, err := zip.OpenReader(path) + if err != nil { + return nil, err + } + zipData := ZipFile{data: reader} + return ReadDocx(zipData) +} + +func ReadDocx(reader ZipData) (*ReplaceDocx, error) { + content, err := readText(reader.files()) + if err != nil { + return nil, err + } + + links, err := readLinks(reader.files()) + if err != nil { + return nil, err + } + + headers, footers, _ := readHeaderFooter(reader.files()) + images, _ := retrieveImageFilenames(reader.files()) + return &ReplaceDocx{zipReader: reader, content: content, links: links, headers: headers, footers: footers, images: images}, nil +} + +func retrieveImageFilenames(files []*zip.File) (map[string]string, error) { + images := make(map[string]string) + for _, f := range files { + if strings.HasPrefix(f.Name, "word/media/") { + images[f.Name] = "" + } + } + return images, nil +} + +func readHeaderFooter(files []*zip.File) (headerText map[string]string, footerText map[string]string, err error) { + + h, f, err := retrieveHeaderFooterDoc(files) + + if err != nil { + return map[string]string{}, map[string]string{}, err + } + + headerText, err = buildHeaderFooter(h) + if err != nil { + return map[string]string{}, map[string]string{}, err + } + + footerText, err = buildHeaderFooter(f) + if err != nil { + return map[string]string{}, map[string]string{}, err + } + + return headerText, footerText, err +} + +func buildHeaderFooter(headerFooter []*zip.File) (map[string]string, error) { + + headerFooterText := make(map[string]string) + for _, element := range headerFooter { + documentReader, err := element.Open() + if err != nil { + return map[string]string{}, err + } + + text, err := wordDocToString(documentReader) + if err != nil { + return map[string]string{}, err + } + + headerFooterText[element.Name] = text + } + + return headerFooterText, nil +} + +func readText(files []*zip.File) (text string, err error) { + var documentFile *zip.File + documentFile, err = retrieveWordDoc(files) + if err != nil { + return text, err + } + var documentReader io.ReadCloser + documentReader, err = documentFile.Open() + if err != nil { + return text, err + } + + text, err = wordDocToString(documentReader) + return +} + +func readLinks(files []*zip.File) (text string, err error) { + var documentFile *zip.File + documentFile, err = retrieveLinkDoc(files) + if err != nil { + return text, err + } + var documentReader io.ReadCloser + documentReader, err = documentFile.Open() + if err != nil { + return text, err + } + + text, err = wordDocToString(documentReader) + return +} + +func wordDocToString(reader io.Reader) (string, error) { + b, err := ioutil.ReadAll(reader) + if err != nil { + return "", err + } + return string(b), nil +} + +func retrieveWordDoc(files []*zip.File) (file *zip.File, err error) { + for _, f := range files { + if f.Name == "word/document.xml" { + file = f + } + } + if file == nil { + err = errors.New("document.xml file not found") + } + return +} + +func retrieveLinkDoc(files []*zip.File) (file *zip.File, err error) { + for _, f := range files { + if f.Name == "word/_rels/document.xml.rels" { + file = f + } + } + if file == nil { + err = errors.New("document.xml.rels file not found") + } + return +} + +func retrieveHeaderFooterDoc(files []*zip.File) (headers []*zip.File, footers []*zip.File, err error) { + for _, f := range files { + + if strings.Contains(f.Name, "header") { + headers = append(headers, f) + } + if strings.Contains(f.Name, "footer") { + footers = append(footers, f) + } + } + if len(headers) == 0 && len(footers) == 0 { + err = errors.New("headers[1-3].xml file not found and footers[1-3].xml file not found") + } + return +} + +func streamToByte(stream io.Reader) []byte { + buf := new(bytes.Buffer) + buf.ReadFrom(stream) + return buf.Bytes() +} + +// To get Word to recognize a tab character, we have to first close off the previous +// text element. This means if there are multiple consecutive tabs, there are empty +// in between but it still seems to work correctly in the output document, certainly better +// than other combinations I tried. +const TAB = "" +const NEWLINE = "" + +func encode(s string) (string, error) { + var b bytes.Buffer + enc := xml.NewEncoder(bufio.NewWriter(&b)) + if err := enc.Encode(s); err != nil { + return s, err + } + output := strings.Replace(b.String(), "", "", 1) // remove string tag + output = strings.Replace(output, "", "", 1) + output = strings.Replace(output, " ", NEWLINE, -1) // \r\n (Windows newline) + output = strings.Replace(output, " ", NEWLINE, -1) // \r (earlier Mac newline) + output = strings.Replace(output, " ", NEWLINE, -1) // \n (unix/linux/OS X newline) + output = strings.Replace(output, " ", TAB, -1) // \t (tab) + return output, nil +} + +func (d *Docx) ReplaceImage(oldImage string, newImage string) (err error) { + if _, ok := d.images[oldImage]; ok { + d.images[oldImage] = newImage + return nil + } + return fmt.Errorf("old image: %q, file not found", oldImage) +} + +func (d *Docx) ImagesLen() int { + return len(d.images) +} diff --git a/backend/vendor/github.com/nguyenthenguyen/docx/new.png b/backend/vendor/github.com/nguyenthenguyen/docx/new.png new file mode 100644 index 00000000..378dc361 Binary files /dev/null and b/backend/vendor/github.com/nguyenthenguyen/docx/new.png differ diff --git a/backend/vendor/github.com/phpdave11/gofpdf/.gitattribute b/backend/vendor/github.com/phpdave11/gofpdf/.gitattribute new file mode 100644 index 00000000..d72fd520 --- /dev/null +++ b/backend/vendor/github.com/phpdave11/gofpdf/.gitattribute @@ -0,0 +1 @@ +*.pdf binary diff --git a/backend/vendor/github.com/phpdave11/gofpdf/.gitignore b/backend/vendor/github.com/phpdave11/gofpdf/.gitignore new file mode 100644 index 00000000..1fae316a --- /dev/null +++ b/backend/vendor/github.com/phpdave11/gofpdf/.gitignore @@ -0,0 +1,25 @@ +*.0 +coverage +font/CalligrapherRegular.json +font/CalligrapherRegular.z +font/Ubuntu-* +internal/files/bin/bin +look +makefont/makefont +open +**/*.out +pdf/*.pdf +pdf.txt +private +*.sublime* +*.swp +**/*.test +.idea/ +doc/body.html +doc/body.md +doc/index.html +doc/index.html.ok +coverage.html + +# macOS +.DS_Store \ No newline at end of file diff --git a/backend/vendor/github.com/phpdave11/gofpdf/.travis.yml b/backend/vendor/github.com/phpdave11/gofpdf/.travis.yml new file mode 100644 index 00000000..32bd6fde --- /dev/null +++ b/backend/vendor/github.com/phpdave11/gofpdf/.travis.yml @@ -0,0 +1,14 @@ +language: go + +sudo: false + +go: + - master + +os: + - linux + +script: go test -v + +notifications: + email: false diff --git a/backend/vendor/github.com/phpdave11/gofpdf/LICENSE b/backend/vendor/github.com/phpdave11/gofpdf/LICENSE new file mode 100644 index 00000000..776d371f --- /dev/null +++ b/backend/vendor/github.com/phpdave11/gofpdf/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2020 David Barnes +Copyright (c) 2017 Kurt Jung and contributors acknowledged in the documentation + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/vendor/github.com/phpdave11/gofpdf/Makefile b/backend/vendor/github.com/phpdave11/gofpdf/Makefile new file mode 100644 index 00000000..90624c5c --- /dev/null +++ b/backend/vendor/github.com/phpdave11/gofpdf/Makefile @@ -0,0 +1,29 @@ +all : documentation + +documentation : doc/index.html doc.go README.md + +cov : all + go test -v -coverprofile=coverage && go tool cover -html=coverage -o=coverage.html + +check : + golint . + go vet -all . + gofmt -s -l . + goreportcard-cli -v | grep -v cyclomatic + +README.md : doc/document.md + pandoc --read=markdown --write=gfm < $< > $@ + +doc/index.html : doc/document.md doc/html.txt + pandoc --read=markdown --write=html --template=doc/html.txt \ + --metadata pagetitle="GoFPDF Document Generator" < $< > $@ + +doc.go : doc/document.md doc/go.awk + pandoc --read=markdown --write=plain $< | awk --assign=package_name=gofpdf --file=doc/go.awk > $@ + gofmt -s -w $@ + +build : + go build -v + +clean : + rm -f coverage.html coverage doc/index.html doc.go README.md diff --git a/backend/vendor/github.com/phpdave11/gofpdf/README.md b/backend/vendor/github.com/phpdave11/gofpdf/README.md new file mode 100644 index 00000000..b931383d --- /dev/null +++ b/backend/vendor/github.com/phpdave11/gofpdf/README.md @@ -0,0 +1,261 @@ +# GoFPDF document generator + +[](https://raw.githubusercontent.com/phpdave11/gofpdf/master/LICENSE) +[](https://goreportcard.com/report/github.com/phpdave11/gofpdf) +[](https://godoc.org/github.com/phpdave11/gofpdf) + + + +Package gofpdf implements a PDF document generator with high level +support for text, drawing and images. + +## Features + + - UTF-8 support + - Choice of measurement unit, page format and margins + - Page header and footer management + - Automatic page breaks, line breaks, and text justification + - Inclusion of JPEG, PNG, GIF, TIFF and basic path-only SVG images + - Colors, gradients and alpha channel transparency + - Outline bookmarks + - Internal and external links + - TrueType, Type1 and encoding support + - Page compression + - Lines, Bézier curves, arcs, and ellipses + - Rotation, scaling, skewing, translation, and mirroring + - Clipping + - Document protection + - Layers + - Templates + - Barcodes + - Charting facility + - Import PDFs as templates + +gofpdf has no dependencies other than the Go standard library. All tests +pass on Linux, Mac and Windows platforms. + +gofpdf supports UTF-8 TrueType fonts and “right-to-left” languages. Note +that Chinese, Japanese, and Korean characters may not be included in +many general purpose fonts. For these languages, a specialized font (for +example, +[NotoSansSC](https://github.com/jsntn/webfonts/blob/master/NotoSansSC-Regular.ttf) +for simplified Chinese) can be used. + +Also, support is provided to automatically translate UTF-8 runes to code +page encodings for languages that have fewer than 256 glyphs. + +## Installation + +To install the package on your system, run + +``` shell +go get github.com/phpdave11/gofpdf +``` + +Later, to receive updates, run + +``` shell +go get -u -v github.com/phpdave11/gofpdf/... +``` + +## Quick Start + +The following Go code generates a simple PDF file. + +``` go +pdf := gofpdf.New("P", "mm", "A4", "") +pdf.AddPage() +pdf.SetFont("Arial", "B", 16) +pdf.Cell(40, 10, "Hello, world") +err := pdf.OutputFileAndClose("hello.pdf") +``` + +See the functions in the +[fpdf\_test.go](https://github.com/phpdave11/gofpdf/blob/master/fpdf_test.go) +file (shown as examples in this documentation) for more advanced PDF +examples. + +## Errors + +If an error occurs in an Fpdf method, an internal error field is set. +After this occurs, Fpdf method calls typically return without performing +any operations and the error state is retained. This error management +scheme facilitates PDF generation since individual method calls do not +need to be examined for failure; it is generally sufficient to wait +until after `Output()` is called. For the same reason, if an error +occurs in the calling application during PDF generation, it may be +desirable for the application to transfer the error to the Fpdf instance +by calling the `SetError()` method or the `SetErrorf()` method. At any +time during the life cycle of the Fpdf instance, the error state can be +determined with a call to `Ok()` or `Err()`. The error itself can be +retrieved with a call to `Error()`. + +## Conversion Notes + +This package is a relatively straightforward translation from the +original [FPDF](http://www.fpdf.org/) library written in PHP (despite +the caveat in the introduction to [Effective +Go](https://golang.org/doc/effective_go.html)). The API names have been +retained even though the Go idiom would suggest otherwise (for example, +`pdf.GetX()` is used rather than simply `pdf.X()`). The similarity of +the two libraries makes the original FPDF website a good source of +information. It includes a forum and FAQ. + +However, some internal changes have been made. Page content is built up +using buffers (of type bytes.Buffer) rather than repeated string +concatenation. Errors are handled as explained above rather than +panicking. Output is generated through an interface of type io.Writer or +io.WriteCloser. A number of the original PHP methods behave differently +based on the type of the arguments that are passed to them; in these +cases additional methods have been exported to provide similar +functionality. Font definition files are produced in JSON rather than +PHP. + +## Example PDFs + +A side effect of running `go test ./...` is the production of a number +of example PDFs. These can be found in the gofpdf/pdf directory after +the tests complete. + +Please note that these examples run in the context of a test. In order +run an example as a standalone application, you’ll need to examine +[fpdf\_test.go](https://github.com/phpdave11/gofpdf/blob/master/fpdf_test.go) +for some helper routines, for example `exampleFilename()` and +`summary()`. + +Example PDFs can be compared with reference copies in order to verify +that they have been generated as expected. This comparison will be +performed if a PDF with the same name as the example PDF is placed in +the gofpdf/pdf/reference directory and if the third argument to +`ComparePDFFiles()` in internal/example/example.go is true. (By default +it is false.) The routine that summarizes an example will look for this +file and, if found, will call `ComparePDFFiles()` to check the example +PDF for equality with its reference PDF. If differences exist between +the two files they will be printed to standard output and the test will +fail. If the reference file is missing, the comparison is considered to +succeed. In order to successfully compare two PDFs, the placement of +internal resources must be consistent and the internal creation +timestamps must be the same. To do this, the methods `SetCatalogSort()` +and `SetCreationDate()` need to be called for both files. This is done +automatically for all examples. + +## Nonstandard Fonts + +Nothing special is required to use the standard PDF fonts (courier, +helvetica, times, zapfdingbats) in your documents other than calling +`SetFont()`. + +You should use `AddUTF8Font()` or `AddUTF8FontFromBytes()` to add a +TrueType UTF-8 encoded font. Use `RTL()` and `LTR()` methods switch +between “right-to-left” and “left-to-right” mode. + +In order to use a different non-UTF-8 TrueType or Type1 font, you will +need to generate a font definition file and, if the font will be +embedded into PDFs, a compressed version of the font file. This is done +by calling the MakeFont function or using the included makefont command +line utility. To create the utility, cd into the makefont subdirectory +and run “go build”. This will produce a standalone executable named +makefont. Select the appropriate encoding file from the font +subdirectory and run the command as in the following example. + +``` shell +./makefont --embed --enc=../font/cp1252.map --dst=../font ../font/calligra.ttf +``` + +In your PDF generation code, call `AddFont()` to load the font and, as +with the standard fonts, SetFont() to begin using it. Most examples, +including the package example, demonstrate this method. Good sources of +free, open-source fonts include [Google +Fonts](https://fonts.google.com/) and [DejaVu +Fonts](http://dejavu-fonts.org/). + +## Related Packages + +The [draw2d](https://github.com/llgcode/draw2d) package is a two +dimensional vector graphics library that can generate output in +different forms. It uses gofpdf for its document production mode. + +## Contributing Changes + +gofpdf is a global community effort and you are invited to make it even +better. If you have implemented a new feature or corrected a problem, +please consider contributing your change to the project. A contribution +that does not directly pertain to the core functionality of gofpdf +should be placed in its own directory directly beneath the `contrib` +directory. + +Here are guidelines for making submissions. Your change should + + - be compatible with the MIT License + - be properly documented + - be formatted with `go fmt` + - include an example in + [fpdf\_test.go](https://github.com/phpdave11/gofpdf/blob/master/fpdf_test.go) + if appropriate + - conform to the standards of [golint](https://github.com/golang/lint) + and [go vet](https://golang.org/cmd/vet/), that is, `golint .` and + `go vet .` should not generate any warnings + - not diminish [test coverage](https://blog.golang.org/cover) + +[Pull requests](https://help.github.com/articles/using-pull-requests/) +are the preferred means of accepting your changes. + +## License + +gofpdf is released under the MIT License. It is copyrighted by Dave Barnes +and the contributors acknowledged below. + +## Acknowledgments + +Thank you to Kurt Jung who originally wrote gofpdf in 2013 - 2019. +This package’s code and documentation are closely derived from the +[FPDF](http://www.fpdf.org/) library created by Olivier Plathey, and a +number of font and image resources are copied directly from it. Bruno +Michel has provided valuable assistance with the code. Drawing support +is adapted from the FPDF geometric figures script by David Hernández +Sanz. Transparency support is adapted from the FPDF transparency script +by Martin Hall-May. Support for gradients and clipping is adapted from +FPDF scripts by Andreas Würmser. Support for outline bookmarks is +adapted from Olivier Plathey by Manuel Cornes. Layer support is adapted +from Olivier Plathey. Support for transformations is adapted from the +FPDF transformation script by Moritz Wagner and Andreas Würmser. PDF +protection is adapted from the work of Klemen Vodopivec for the FPDF +product. Lawrence Kesteloot provided code to allow an image’s extent to +be determined prior to placement. Support for vertical alignment within +a cell was provided by Stefan Schroeder. Ivan Daniluk generalized the +font and image loading code to use the Reader interface while +maintaining backward compatibility. Anthony Starks provided code for the +Polygon function. Robert Lillack provided the Beziergon function and +corrected some naming issues with the internal curve function. Claudio +Felber provided implementations for dashed line drawing and generalized +font loading. Stani Michiels provided support for multi-segment path +drawing with smooth line joins, line join styles, enhanced fill modes, +and has helped greatly with package presentation and tests. Templating +is adapted by Marcus Downing from the FPDF\_Tpl library created by Jan +Slabon and Setasign. Jelmer Snoeck contributed packages that generate a +variety of barcodes and help with registering images on the web. Jelmer +Snoek and Guillermo Pascual augmented the basic HTML functionality with +aligned text. Kent Quirk implemented backwards-compatible support for +reading DPI from images that support it, and for setting DPI manually +and then having it properly taken into account when calculating image +size. Paulo Coutinho provided support for static embedded fonts. Dan +Meyers added support for embedded JavaScript. David Fish added a generic +alias-replacement function to enable, among other things, table of +contents functionality. Andy Bakun identified and corrected a problem in +which the internal catalogs were not sorted stably. Paul Montag added +encoding and decoding functionality for templates, including images that +are embedded in templates; this allows templates to be stored +independently of gofpdf. Paul also added support for page boxes used in +printing PDF documents. Wojciech Matusiak added supported for word +spacing. Artem Korotkiy added support of UTF-8 fonts. Dave Barnes added +support for imported objects and templates. Brigham Thompson added +support for rounded rectangles. Joe Westcott added underline +functionality and optimized image storage. Benoit KUGLER contributed +support for rectangles with corners of unequal radius, modification +times, and for file attachments and annotations. + +## Roadmap + + - Remove all legacy code page font support; use UTF-8 exclusively + - Improve test coverage as reported by the coverage tool. diff --git a/backend/vendor/github.com/phpdave11/gofpdf/attachments.go b/backend/vendor/github.com/phpdave11/gofpdf/attachments.go new file mode 100644 index 00000000..6e397b73 --- /dev/null +++ b/backend/vendor/github.com/phpdave11/gofpdf/attachments.go @@ -0,0 +1,157 @@ +package gofpdf + +import ( + "crypto/md5" + "encoding/hex" + "fmt" + "strings" +) + +// Attachment defines a content to be included in the pdf, in one +// of the following ways : +// - associated with the document as a whole : see SetAttachments() +// - accessible via a link localized on a page : see AddAttachmentAnnotation() +type Attachment struct { + Content []byte + + // Filename is the displayed name of the attachment + Filename string + + // Description is only displayed when using AddAttachmentAnnotation(), + // and might be modified by the pdf reader. + Description string + + objectNumber int // filled when content is included +} + +// return the hex encoded checksum of `data` +func checksum(data []byte) string { + tmp := md5.Sum(data) + sl := make([]byte, len(tmp)) + for i, v := range tmp { + sl[i] = v + } + return hex.EncodeToString(sl) +} + +// Writes a compressed file like object as ``/EmbeddedFile``. Compressing is +// done with deflate. Includes length, compressed length and MD5 checksum. +func (f *Fpdf) writeCompressedFileObject(content []byte) { + lenUncompressed := len(content) + sum := checksum(content) + compressed := sliceCompress(content) + lenCompressed := len(compressed) + f.newobj() + f.outf("<< /Type /EmbeddedFile /Length %d /Filter /FlateDecode /Params << /CheckSum <%s> /Size %d >> >>\n", + lenCompressed, sum, lenUncompressed) + f.putstream(compressed) + f.out("endobj") +} + +// Embed includes the content of `a`, and update its internal reference. +func (f *Fpdf) embed(a *Attachment) { + if a.objectNumber != 0 { // already embedded (objectNumber start at 2) + return + } + oldState := f.state + f.state = 1 // we write file content in the main buffer + f.writeCompressedFileObject(a.Content) + streamID := f.n + f.newobj() + f.outf("<< /Type /Filespec /F () /UF %s /EF << /F %d 0 R >> /Desc %s\n>>", + f.textstring(utf8toutf16(a.Filename)), + streamID, + f.textstring(utf8toutf16(a.Description))) + f.out("endobj") + a.objectNumber = f.n + f.state = oldState +} + +// SetAttachments writes attachments as embedded files (document attachment). +// These attachments are global, see AddAttachmentAnnotation() for a link +// anchored in a page. Note that only the last call of SetAttachments is +// useful, previous calls are discarded. Be aware that not all PDF readers +// support document attachments. See the SetAttachment example for a +// demonstration of this method. +func (f *Fpdf) SetAttachments(as []Attachment) { + f.attachments = as +} + +// embed current attachments. store object numbers +// for later use by getEmbeddedFiles() +func (f *Fpdf) putAttachments() { + for i, a := range f.attachments { + f.embed(&a) + f.attachments[i] = a + } +} + +// return /EmbeddedFiles tree name catalog entry. +func (f Fpdf) getEmbeddedFiles() string { + names := make([]string, len(f.attachments)) + for i, as := range f.attachments { + names[i] = fmt.Sprintf("(Attachement%d) %d 0 R ", i+1, as.objectNumber) + } + nameTree := fmt.Sprintf("<< /Names [\n %s \n] >>", strings.Join(names, "\n")) + return nameTree +} + +// ---------------------------------- Annotations ---------------------------------- + +type annotationAttach struct { + *Attachment + + x, y, w, h float64 // fpdf coordinates (y diff and scaling done) +} + +// AddAttachmentAnnotation puts a link on the current page, on the rectangle +// defined by `x`, `y`, `w`, `h`. This link points towards the content defined +// in `a`, which is embedded in the document. Note than no drawing is done by +// this method : a method like `Cell()` or `Rect()` should be called to +// indicate to the reader that there is a link here. Requiring a pointer to an +// Attachment avoids useless copies in the resulting pdf: attachment pointing +// to the same data will have their content only be included once, and be +// shared amongst all links. Be aware that not all PDF readers support +// annotated attachments. See the AddAttachmentAnnotation example for a +// demonstration of this method. +func (f *Fpdf) AddAttachmentAnnotation(a *Attachment, x, y, w, h float64) { + if a == nil { + return + } + f.pageAttachments[f.page] = append(f.pageAttachments[f.page], annotationAttach{ + Attachment: a, + x: x * f.k, y: f.hPt - y*f.k, w: w * f.k, h: h * f.k, + }) +} + +// embed current annotations attachments. store object numbers +// for later use by putAttachmentAnnotationLinks(), which is +// called for each page. +func (f *Fpdf) putAnnotationsAttachments() { + // avoid duplication + m := map[*Attachment]bool{} + for _, l := range f.pageAttachments { + for _, an := range l { + if m[an.Attachment] { // already embedded + continue + } + f.embed(an.Attachment) + } + } +} + +func (f *Fpdf) putAttachmentAnnotationLinks(out *fmtBuffer, page int) { + for _, an := range f.pageAttachments[page] { + x1, y1, x2, y2 := an.x, an.y, an.x+an.w, an.y-an.h + as := fmt.Sprintf("<< /Type /XObject /Subtype /Form /BBox [%.2f %.2f %.2f %.2f] /Length 0 >>", + x1, y1, x2, y2) + as += "\nstream\nendstream" + + out.printf("<< /Type /Annot /Subtype /FileAttachment /Rect [%.2f %.2f %.2f %.2f] /Border [0 0 0]\n", + x1, y1, x2, y2) + out.printf("/Contents %s ", f.textstring(utf8toutf16(an.Description))) + out.printf("/T %s ", f.textstring(utf8toutf16(an.Filename))) + out.printf("/AP << /N %s>>", as) + out.printf("/FS %d 0 R >>\n", an.objectNumber) + } +} diff --git a/backend/vendor/github.com/phpdave11/gofpdf/compare.go b/backend/vendor/github.com/phpdave11/gofpdf/compare.go new file mode 100644 index 00000000..f0c286e4 --- /dev/null +++ b/backend/vendor/github.com/phpdave11/gofpdf/compare.go @@ -0,0 +1,146 @@ +/* + * Copyright (c) 2015 Kurt Jung (Gmail: kurt.w.jung) + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package gofpdf + +import ( + "bytes" + "fmt" + "io" + "io/ioutil" + "sort" +) + +type sortType struct { + length int + less func(int, int) bool + swap func(int, int) +} + +func (s *sortType) Len() int { + return s.length +} + +func (s *sortType) Less(i, j int) bool { + return s.less(i, j) +} + +func (s *sortType) Swap(i, j int) { + s.swap(i, j) +} + +func gensort(Len int, Less func(int, int) bool, Swap func(int, int)) { + sort.Sort(&sortType{length: Len, less: Less, swap: Swap}) +} + +func writeBytes(leadStr string, startPos int, sl []byte) { + var pos, max int + var b byte + fmt.Printf("%s %07x", leadStr, startPos) + max = len(sl) + for pos < max { + fmt.Printf(" ") + for k := 0; k < 8; k++ { + if pos < max { + fmt.Printf(" %02x", sl[pos]) + } else { + fmt.Printf(" ") + } + pos++ + } + } + fmt.Printf(" |") + pos = 0 + for pos < max { + b = sl[pos] + if b < 32 || b >= 128 { + b = '.' + } + fmt.Printf("%c", b) + pos++ + } + fmt.Printf("|\n") +} + +func checkBytes(pos int, sl1, sl2 []byte, printDiff bool) (eq bool) { + eq = bytes.Equal(sl1, sl2) + if !eq && printDiff { + writeBytes("<", pos, sl1) + writeBytes(">", pos, sl2) + } + return +} + +// CompareBytes compares the bytes referred to by sl1 with those referred to by +// sl2. Nil is returned if the buffers are equal, otherwise an error. +func CompareBytes(sl1, sl2 []byte, printDiff bool) (err error) { + var posStart, posEnd, len1, len2, length int + var diffs bool + + len1 = len(sl1) + len2 = len(sl2) + length = len1 + if length > len2 { + length = len2 + } + for posStart < length-1 { + posEnd = posStart + 16 + if posEnd > length { + posEnd = length + } + if !checkBytes(posStart, sl1[posStart:posEnd], sl2[posStart:posEnd], printDiff) { + diffs = true + } + posStart = posEnd + } + if diffs { + err = fmt.Errorf("documents are different") + } + return +} + +// ComparePDFs reads and compares the full contents of the two specified +// readers byte-for-byte. Nil is returned if the buffers are equal, otherwise +// an error. +func ComparePDFs(rdr1, rdr2 io.Reader, printDiff bool) (err error) { + var b1, b2 *bytes.Buffer + _, err = b1.ReadFrom(rdr1) + if err == nil { + _, err = b2.ReadFrom(rdr2) + if err == nil { + err = CompareBytes(b1.Bytes(), b2.Bytes(), printDiff) + } + } + return +} + +// ComparePDFFiles reads and compares the full contents of the two specified +// files byte-for-byte. Nil is returned if the file contents are equal, or if +// the second file is missing, otherwise an error. +func ComparePDFFiles(file1Str, file2Str string, printDiff bool) (err error) { + var sl1, sl2 []byte + sl1, err = ioutil.ReadFile(file1Str) + if err == nil { + sl2, err = ioutil.ReadFile(file2Str) + if err == nil { + err = CompareBytes(sl1, sl2, printDiff) + } else { + // Second file is missing; treat this as success + err = nil + } + } + return +} diff --git a/backend/vendor/github.com/phpdave11/gofpdf/def.go b/backend/vendor/github.com/phpdave11/gofpdf/def.go new file mode 100644 index 00000000..6a7030f9 --- /dev/null +++ b/backend/vendor/github.com/phpdave11/gofpdf/def.go @@ -0,0 +1,738 @@ +/* + * Copyright (c) 2013-2014 Kurt Jung (Gmail: kurt.w.jung) + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package gofpdf + +import ( + "bytes" + "crypto/sha1" + "encoding/gob" + "encoding/json" + "fmt" + "io" + "time" +) + +// Version of FPDF from which this package is derived +const ( + cnFpdfVersion = "1.7" +) + +type blendModeType struct { + strokeStr, fillStr, modeStr string + objNum int +} + +type gradientType struct { + tp int // 2: linear, 3: radial + clr1Str, clr2Str string + x1, y1, x2, y2, r float64 + objNum int +} + +const ( + // OrientationPortrait represents the portrait orientation. + OrientationPortrait = "portrait" + + // OrientationLandscape represents the landscape orientation. + OrientationLandscape = "landscape" +) + +const ( + // UnitPoint represents the size unit point + UnitPoint = "pt" + // UnitMillimeter represents the size unit millimeter + UnitMillimeter = "mm" + // UnitCentimeter represents the size unit centimeter + UnitCentimeter = "cm" + // UnitInch represents the size unit inch + UnitInch = "inch" +) + +const ( + // PageSizeA3 represents DIN/ISO A3 page size + PageSizeA3 = "A3" + // PageSizeA4 represents DIN/ISO A4 page size + PageSizeA4 = "A4" + // PageSizeA5 represents DIN/ISO A5 page size + PageSizeA5 = "A5" + // PageSizeLetter represents US Letter page size + PageSizeLetter = "Letter" + // PageSizeLegal represents US Legal page size + PageSizeLegal = "Legal" +) + +const ( + // BorderNone set no border + BorderNone = "" + // BorderFull sets a full border + BorderFull = "1" + // BorderLeft sets the border on the left side + BorderLeft = "L" + // BorderTop sets the border at the top + BorderTop = "T" + // BorderRight sets the border on the right side + BorderRight = "R" + // BorderBottom sets the border on the bottom + BorderBottom = "B" +) + +const ( + // LineBreakNone disables linebreak + LineBreakNone = 0 + // LineBreakNormal enables normal linebreak + LineBreakNormal = 1 + // LineBreakBelow enables linebreak below + LineBreakBelow = 2 +) + +const ( + // AlignLeft left aligns the cell + AlignLeft = "L" + // AlignRight right aligns the cell + AlignRight = "R" + // AlignCenter centers the cell + AlignCenter = "C" + // AlignTop aligns the cell to the top + AlignTop = "T" + // AlignBottom aligns the cell to the bottom + AlignBottom = "B" + // AlignMiddle aligns the cell to the middle + AlignMiddle = "M" + // AlignBaseline aligns the cell to the baseline + AlignBaseline = "B" +) + +type colorMode int + +const ( + colorModeRGB colorMode = iota + colorModeSpot + colorModeCMYK +) + +type colorType struct { + r, g, b float64 + ir, ig, ib int + mode colorMode + spotStr string // name of current spot color + gray bool + str string +} + +// SpotColorType specifies a named spot color value +type spotColorType struct { + id, objID int + val cmykColorType +} + +// CMYKColorType specifies an ink-based CMYK color value +type cmykColorType struct { + c, m, y, k byte // 0% to 100% +} + +// SizeType fields Wd and Ht specify the horizontal and vertical extents of a +// document element such as a page. +type SizeType struct { + Wd, Ht float64 +} + +// PointType fields X and Y specify the horizontal and vertical coordinates of +// a point, typically used in drawing. +type PointType struct { + X, Y float64 +} + +// XY returns the X and Y components of the receiver point. +func (p PointType) XY() (float64, float64) { + return p.X, p.Y +} + +// ImageInfoType contains size, color and other information about an image. +// Changes to this structure should be reflected in its GobEncode and GobDecode +// methods. +type ImageInfoType struct { + data []byte // Raw image data + smask []byte // Soft Mask, an 8bit per-pixel transparency mask + n int // Image object number + w float64 // Width + h float64 // Height + cs string // Color space + pal []byte // Image color palette + bpc int // Bits Per Component + f string // Image filter + dp string // DecodeParms + trns []int // Transparency mask + scale float64 // Document scale factor + dpi float64 // Dots-per-inch found from image file (png only) + i string // SHA-1 checksum of the above values. +} + +func generateImageID(info *ImageInfoType) (string, error) { + b, err := info.GobEncode() + return fmt.Sprintf("%x", sha1.Sum(b)), err +} + +// GobEncode encodes the receiving image to a byte slice. +func (info *ImageInfoType) GobEncode() (buf []byte, err error) { + fields := []interface{}{info.data, info.smask, info.n, info.w, info.h, info.cs, + info.pal, info.bpc, info.f, info.dp, info.trns, info.scale, info.dpi} + w := new(bytes.Buffer) + encoder := gob.NewEncoder(w) + for j := 0; j < len(fields) && err == nil; j++ { + err = encoder.Encode(fields[j]) + } + if err == nil { + buf = w.Bytes() + } + return +} + +// GobDecode decodes the specified byte buffer (generated by GobEncode) into +// the receiving image. +func (info *ImageInfoType) GobDecode(buf []byte) (err error) { + fields := []interface{}{&info.data, &info.smask, &info.n, &info.w, &info.h, + &info.cs, &info.pal, &info.bpc, &info.f, &info.dp, &info.trns, &info.scale, &info.dpi} + r := bytes.NewBuffer(buf) + decoder := gob.NewDecoder(r) + for j := 0; j < len(fields) && err == nil; j++ { + err = decoder.Decode(fields[j]) + } + + info.i, err = generateImageID(info) + return +} + +// PointConvert returns the value of pt, expressed in points (1/72 inch), as a +// value expressed in the unit of measure specified in New(). Since font +// management in Fpdf uses points, this method can help with line height +// calculations and other methods that require user units. +func (f *Fpdf) PointConvert(pt float64) (u float64) { + return pt / f.k +} + +// PointToUnitConvert is an alias for PointConvert. +func (f *Fpdf) PointToUnitConvert(pt float64) (u float64) { + return pt / f.k +} + +// UnitToPointConvert returns the value of u, expressed in the unit of measure +// specified in New(), as a value expressed in points (1/72 inch). Since font +// management in Fpdf uses points, this method can help with setting font sizes +// based on the sizes of other non-font page elements. +func (f *Fpdf) UnitToPointConvert(u float64) (pt float64) { + return u * f.k +} + +// Extent returns the width and height of the image in the units of the Fpdf +// object. +func (info *ImageInfoType) Extent() (wd, ht float64) { + return info.Width(), info.Height() +} + +// Width returns the width of the image in the units of the Fpdf object. +func (info *ImageInfoType) Width() float64 { + return info.w / (info.scale * info.dpi / 72) +} + +// Height returns the height of the image in the units of the Fpdf object. +func (info *ImageInfoType) Height() float64 { + return info.h / (info.scale * info.dpi / 72) +} + +// SetDpi sets the dots per inch for an image. PNG images MAY have their dpi +// set automatically, if the image specifies it. DPI information is not +// currently available automatically for JPG and GIF images, so if it's +// important to you, you can set it here. It defaults to 72 dpi. +func (info *ImageInfoType) SetDpi(dpi float64) { + info.dpi = dpi +} + +type fontFileType struct { + length1, length2 int64 + n int + embedded bool + content []byte + fontType string +} + +type linkType struct { + x, y, wd, ht float64 + link int // Auto-generated internal link ID or... + linkStr string // ...application-provided external link string +} + +type intLinkType struct { + page int + y float64 +} + +// outlineType is used for a sidebar outline of bookmarks +type outlineType struct { + text string + level, parent, first, last, next, prev int + y float64 + p int +} + +// InitType is used with NewCustom() to customize an Fpdf instance. +// OrientationStr, UnitStr, SizeStr and FontDirStr correspond to the arguments +// accepted by New(). If the Wd and Ht fields of Size are each greater than +// zero, Size will be used to set the default page size rather than SizeStr. Wd +// and Ht are specified in the units of measure indicated by UnitStr. +type InitType struct { + OrientationStr string + UnitStr string + SizeStr string + Size SizeType + FontDirStr string +} + +// FontLoader is used to read fonts (JSON font specification and zlib compressed font binaries) +// from arbitrary locations (e.g. files, zip files, embedded font resources). +// +// Open provides an io.Reader for the specified font file (.json or .z). The file name +// never includes a path. Open returns an error if the specified file cannot be opened. +type FontLoader interface { + Open(name string) (io.Reader, error) +} + +// Pdf defines the interface used for various methods. It is implemented by the +// main FPDF instance as well as templates. +type Pdf interface { + AddFont(familyStr, styleStr, fileStr string) + AddFontFromBytes(familyStr, styleStr string, jsonFileBytes, zFileBytes []byte) + AddFontFromReader(familyStr, styleStr string, r io.Reader) + AddLayer(name string, visible bool) (layerID int) + AddLink() int + AddPage() + AddPageFormat(orientationStr string, size SizeType) + AddSpotColor(nameStr string, c, m, y, k byte) + AliasNbPages(aliasStr string) + ArcTo(x, y, rx, ry, degRotate, degStart, degEnd float64) + Arc(x, y, rx, ry, degRotate, degStart, degEnd float64, styleStr string) + BeginLayer(id int) + Beziergon(points []PointType, styleStr string) + Bookmark(txtStr string, level int, y float64) + CellFormat(w, h float64, txtStr, borderStr string, ln int, alignStr string, fill bool, link int, linkStr string) + Cellf(w, h float64, fmtStr string, args ...interface{}) + Cell(w, h float64, txtStr string) + Circle(x, y, r float64, styleStr string) + ClearError() + ClipCircle(x, y, r float64, outline bool) + ClipEllipse(x, y, rx, ry float64, outline bool) + ClipEnd() + ClipPolygon(points []PointType, outline bool) + ClipRect(x, y, w, h float64, outline bool) + ClipRoundedRect(x, y, w, h, r float64, outline bool) + ClipText(x, y float64, txtStr string, outline bool) + Close() + ClosePath() + CreateTemplateCustom(corner PointType, size SizeType, fn func(*Tpl)) Template + CreateTemplate(fn func(*Tpl)) Template + CurveBezierCubicTo(cx0, cy0, cx1, cy1, x, y float64) + CurveBezierCubic(x0, y0, cx0, cy0, cx1, cy1, x1, y1 float64, styleStr string) + CurveCubic(x0, y0, cx0, cy0, x1, y1, cx1, cy1 float64, styleStr string) + CurveTo(cx, cy, x, y float64) + Curve(x0, y0, cx, cy, x1, y1 float64, styleStr string) + DrawPath(styleStr string) + Ellipse(x, y, rx, ry, degRotate float64, styleStr string) + EndLayer() + Err() bool + Error() error + GetAlpha() (alpha float64, blendModeStr string) + GetAutoPageBreak() (auto bool, margin float64) + GetCellMargin() float64 + GetConversionRatio() float64 + GetDrawColor() (int, int, int) + GetDrawSpotColor() (name string, c, m, y, k byte) + GetFillColor() (int, int, int) + GetFillSpotColor() (name string, c, m, y, k byte) + GetFontDesc(familyStr, styleStr string) FontDescType + GetFontSize() (ptSize, unitSize float64) + GetImageInfo(imageStr string) (info *ImageInfoType) + GetLineWidth() float64 + GetMargins() (left, top, right, bottom float64) + GetPageSizeStr(sizeStr string) (size SizeType) + GetPageSize() (width, height float64) + GetStringWidth(s string) float64 + GetTextColor() (int, int, int) + GetTextSpotColor() (name string, c, m, y, k byte) + GetX() float64 + GetXY() (float64, float64) + GetY() float64 + HTMLBasicNew() (html HTMLBasicType) + Image(imageNameStr string, x, y, w, h float64, flow bool, tp string, link int, linkStr string) + ImageOptions(imageNameStr string, x, y, w, h float64, flow bool, options ImageOptions, link int, linkStr string) + ImageTypeFromMime(mimeStr string) (tp string) + LinearGradient(x, y, w, h float64, r1, g1, b1, r2, g2, b2 int, x1, y1, x2, y2 float64) + LineTo(x, y float64) + Line(x1, y1, x2, y2 float64) + LinkString(x, y, w, h float64, linkStr string) + Link(x, y, w, h float64, link int) + Ln(h float64) + MoveTo(x, y float64) + MultiCell(w, h float64, txtStr, borderStr, alignStr string, fill bool) + Ok() bool + OpenLayerPane() + OutputAndClose(w io.WriteCloser) error + OutputFileAndClose(fileStr string) error + Output(w io.Writer) error + PageCount() int + PageNo() int + PageSize(pageNum int) (wd, ht float64, unitStr string) + PointConvert(pt float64) (u float64) + PointToUnitConvert(pt float64) (u float64) + Polygon(points []PointType, styleStr string) + RadialGradient(x, y, w, h float64, r1, g1, b1, r2, g2, b2 int, x1, y1, x2, y2, r float64) + RawWriteBuf(r io.Reader) + RawWriteStr(str string) + Rect(x, y, w, h float64, styleStr string) + RegisterAlias(alias, replacement string) + RegisterImage(fileStr, tp string) (info *ImageInfoType) + RegisterImageOptions(fileStr string, options ImageOptions) (info *ImageInfoType) + RegisterImageOptionsReader(imgName string, options ImageOptions, r io.Reader) (info *ImageInfoType) + RegisterImageReader(imgName, tp string, r io.Reader) (info *ImageInfoType) + SetAcceptPageBreakFunc(fnc func() bool) + SetAlpha(alpha float64, blendModeStr string) + SetAuthor(authorStr string, isUTF8 bool) + SetAutoPageBreak(auto bool, margin float64) + SetCatalogSort(flag bool) + SetCellMargin(margin float64) + SetCompression(compress bool) + SetCreationDate(tm time.Time) + SetCreator(creatorStr string, isUTF8 bool) + SetDashPattern(dashArray []float64, dashPhase float64) + SetDisplayMode(zoomStr, layoutStr string) + SetDrawColor(r, g, b int) + SetDrawSpotColor(nameStr string, tint byte) + SetError(err error) + SetErrorf(fmtStr string, args ...interface{}) + SetFillColor(r, g, b int) + SetFillSpotColor(nameStr string, tint byte) + SetFont(familyStr, styleStr string, size float64) + SetFontLoader(loader FontLoader) + SetFontLocation(fontDirStr string) + SetFontSize(size float64) + SetFontStyle(styleStr string) + SetFontUnitSize(size float64) + SetFooterFunc(fnc func()) + SetFooterFuncLpi(fnc func(lastPage bool)) + SetHeaderFunc(fnc func()) + SetHeaderFuncMode(fnc func(), homeMode bool) + SetHomeXY() + SetJavascript(script string) + SetKeywords(keywordsStr string, isUTF8 bool) + SetLeftMargin(margin float64) + SetLineCapStyle(styleStr string) + SetLineJoinStyle(styleStr string) + SetLineWidth(width float64) + SetLink(link int, y float64, page int) + SetMargins(left, top, right float64) + SetPageBoxRec(t string, pb PageBox) + SetPageBox(t string, x, y, wd, ht float64) + SetPage(pageNum int) + SetProtection(actionFlag byte, userPassStr, ownerPassStr string) + SetRightMargin(margin float64) + SetSubject(subjectStr string, isUTF8 bool) + SetTextColor(r, g, b int) + SetTextSpotColor(nameStr string, tint byte) + SetTitle(titleStr string, isUTF8 bool) + SetTopMargin(margin float64) + SetUnderlineThickness(thickness float64) + SetXmpMetadata(xmpStream []byte) + SetX(x float64) + SetXY(x, y float64) + SetY(y float64) + SplitLines(txt []byte, w float64) [][]byte + String() string + SVGBasicWrite(sb *SVGBasicType, scale float64) + Text(x, y float64, txtStr string) + TransformBegin() + TransformEnd() + TransformMirrorHorizontal(x float64) + TransformMirrorLine(angle, x, y float64) + TransformMirrorPoint(x, y float64) + TransformMirrorVertical(y float64) + TransformRotate(angle, x, y float64) + TransformScale(scaleWd, scaleHt, x, y float64) + TransformScaleX(scaleWd, x, y float64) + TransformScaleXY(s, x, y float64) + TransformScaleY(scaleHt, x, y float64) + TransformSkew(angleX, angleY, x, y float64) + TransformSkewX(angleX, x, y float64) + TransformSkewY(angleY, x, y float64) + Transform(tm TransformMatrix) + TransformTranslate(tx, ty float64) + TransformTranslateX(tx float64) + TransformTranslateY(ty float64) + UnicodeTranslatorFromDescriptor(cpStr string) (rep func(string) string) + UnitToPointConvert(u float64) (pt float64) + UseTemplateScaled(t Template, corner PointType, size SizeType) + UseTemplate(t Template) + WriteAligned(width, lineHeight float64, textStr, alignStr string) + Writef(h float64, fmtStr string, args ...interface{}) + Write(h float64, txtStr string) + WriteLinkID(h float64, displayStr string, linkID int) + WriteLinkString(h float64, displayStr, targetStr string) +} + +// PageBox defines the coordinates and extent of the various page box types +type PageBox struct { + SizeType + PointType +} + +// Fpdf is the principal structure for creating a single PDF document +type Fpdf struct { + isCurrentUTF8 bool // is current font used in utf-8 mode + isRTL bool // is is right to left mode enabled + page int // current page number + n int // current object number + offsets []int // array of object offsets + templates map[string]Template // templates used in this document + templateObjects map[string]int // template object IDs within this document + importedObjs map[string][]byte // imported template objects (gofpdi) + importedObjPos map[string]map[int]string // imported template objects hashes and their positions (gofpdi) + importedTplObjs map[string]string // imported template names and IDs (hashed) (gofpdi) + importedTplIDs map[string]int // imported template ids hash to object id int (gofpdi) + buffer fmtBuffer // buffer holding in-memory PDF + pages []*bytes.Buffer // slice[page] of page content; 1-based + state int // current document state + compress bool // compression flag + k float64 // scale factor (number of points in user unit) + defOrientation string // default orientation + curOrientation string // current orientation + stdPageSizes map[string]SizeType // standard page sizes + defPageSize SizeType // default page size + defPageBoxes map[string]PageBox // default page size + curPageSize SizeType // current page size + pageSizes map[int]SizeType // used for pages with non default sizes or orientations + pageBoxes map[int]map[string]PageBox // used to define the crop, trim, bleed and art boxes + unitStr string // unit of measure for all rendered objects except fonts + wPt, hPt float64 // dimensions of current page in points + w, h float64 // dimensions of current page in user unit + lMargin float64 // left margin + tMargin float64 // top margin + rMargin float64 // right margin + bMargin float64 // page break margin + cMargin float64 // cell margin + x, y float64 // current position in user unit + lasth float64 // height of last printed cell + lineWidth float64 // line width in user unit + fontpath string // path containing fonts + fontLoader FontLoader // used to load font files from arbitrary locations + coreFonts map[string]bool // array of core font names + fonts map[string]fontDefType // array of used fonts + fontFiles map[string]fontFileType // array of font files + diffs []string // array of encoding differences + fontFamily string // current font family + fontStyle string // current font style + underline bool // underlining flag + strikeout bool // strike out flag + currentFont fontDefType // current font info + fontSizePt float64 // current font size in points + fontSize float64 // current font size in user unit + ws float64 // word spacing + images map[string]*ImageInfoType // array of used images + aliasMap map[string]string // map of alias->replacement + pageLinks [][]linkType // pageLinks[page][link], both 1-based + links []intLinkType // array of internal links + attachments []Attachment // slice of content to embed globally + pageAttachments [][]annotationAttach // 1-based array of annotation for file attachments (per page) + outlines []outlineType // array of outlines + outlineRoot int // root of outlines + autoPageBreak bool // automatic page breaking + acceptPageBreak func() bool // returns true to accept page break + pageBreakTrigger float64 // threshold used to trigger page breaks + inHeader bool // flag set when processing header + headerFnc func() // function provided by app and called to write header + headerHomeMode bool // set position to home after headerFnc is called + inFooter bool // flag set when processing footer + footerFnc func() // function provided by app and called to write footer + footerFncLpi func(bool) // function provided by app and called to write footer with last page flag + zoomMode string // zoom display mode + layoutMode string // layout display mode + xmp []byte // XMP metadata + producer string // producer + title string // title + subject string // subject + author string // author + keywords string // keywords + creator string // creator + creationDate time.Time // override for document CreationDate value + modDate time.Time // override for document ModDate value + aliasNbPagesStr string // alias for total number of pages + pdfVersion string // PDF version number + fontDirStr string // location of font definition files + capStyle int // line cap style: butt 0, round 1, square 2 + joinStyle int // line segment join style: miter 0, round 1, bevel 2 + dashArray []float64 // dash array + dashPhase float64 // dash phase + blendList []blendModeType // slice[idx] of alpha transparency modes, 1-based + blendMap map[string]int // map into blendList + blendMode string // current blend mode + alpha float64 // current transpacency + gradientList []gradientType // slice[idx] of gradient records + clipNest int // Number of active clipping contexts + transformNest int // Number of active transformation contexts + err error // Set if error occurs during life cycle of instance + protect protectType // document protection structure + layer layerRecType // manages optional layers in document + catalogSort bool // sort resource catalogs in document + nJs int // JavaScript object number + javascript *string // JavaScript code to include in the PDF + colorFlag bool // indicates whether fill and text colors are different + color struct { + // Composite values of colors + draw, fill, text colorType + } + spotColorMap map[string]spotColorType // Map of named ink-based colors + userUnderlineThickness float64 // A custom user underline thickness multiplier. +} + +type encType struct { + uv int + name string +} + +type encListType [256]encType + +type fontBoxType struct { + Xmin, Ymin, Xmax, Ymax int +} + +// Font flags for FontDescType.Flags as defined in the pdf specification. +const ( + // FontFlagFixedPitch is set if all glyphs have the same width (as + // opposed to proportional or variable-pitch fonts, which have + // different widths). + FontFlagFixedPitch = 1 << 0 + // FontFlagSerif is set if glyphs have serifs, which are short + // strokes drawn at an angle on the top and bottom of glyph stems. + // (Sans serif fonts do not have serifs.) + FontFlagSerif = 1 << 1 + // FontFlagSymbolic is set if font contains glyphs outside the + // Adobe standard Latin character set. This flag and the + // Nonsymbolic flag shall not both be set or both be clear. + FontFlagSymbolic = 1 << 2 + // FontFlagScript is set if glyphs resemble cursive handwriting. + FontFlagScript = 1 << 3 + // FontFlagNonsymbolic is set if font uses the Adobe standard + // Latin character set or a subset of it. + FontFlagNonsymbolic = 1 << 5 + // FontFlagItalic is set if glyphs have dominant vertical strokes + // that are slanted. + FontFlagItalic = 1 << 6 + // FontFlagAllCap is set if font contains no lowercase letters; + // typically used for display purposes, such as for titles or + // headlines. + FontFlagAllCap = 1 << 16 + // SmallCap is set if font contains both uppercase and lowercase + // letters. The uppercase letters are similar to those in the + // regular version of the same typeface family. The glyphs for the + // lowercase letters have the same shapes as the corresponding + // uppercase letters, but they are sized and their proportions + // adjusted so that they have the same size and stroke weight as + // lowercase glyphs in the same typeface family. + SmallCap = 1 << 18 + // ForceBold determines whether bold glyphs shall be painted with + // extra pixels even at very small text sizes by a conforming + // reader. If the ForceBold flag is set, features of bold glyphs + // may be thickened at small text sizes. + ForceBold = 1 << 18 +) + +// FontDescType (font descriptor) specifies metrics and other +// attributes of a font, as distinct from the metrics of individual +// glyphs (as defined in the pdf specification). +type FontDescType struct { + // The maximum height above the baseline reached by glyphs in this + // font (for example for "S"). The height of glyphs for accented + // characters shall be excluded. + Ascent int + // The maximum depth below the baseline reached by glyphs in this + // font. The value shall be a negative number. + Descent int + // The vertical coordinate of the top of flat capital letters, + // measured from the baseline (for example "H"). + CapHeight int + // A collection of flags defining various characteristics of the + // font. (See the FontFlag* constants.) + Flags int + // A rectangle, expressed in the glyph coordinate system, that + // shall specify the font bounding box. This should be the smallest + // rectangle enclosing the shape that would result if all of the + // glyphs of the font were placed with their origins coincident + // and then filled. + FontBBox fontBoxType + // The angle, expressed in degrees counterclockwise from the + // vertical, of the dominant vertical strokes of the font. (The + // 9-o’clock position is 90 degrees, and the 3-o’clock position + // is –90 degrees.) The value shall be negative for fonts that + // slope to the right, as almost all italic fonts do. + ItalicAngle int + // The thickness, measured horizontally, of the dominant vertical + // stems of glyphs in the font. + StemV int + // The width to use for character codes whose widths are not + // specified in a font dictionary’s Widths array. This shall have + // a predictable effect only if all such codes map to glyphs whose + // actual widths are the same as the value of the MissingWidth + // entry. (Default value: 0.) + MissingWidth int +} + +type fontDefType struct { + Tp string // "Core", "TrueType", ... + Name string // "Courier-Bold", ... + Desc FontDescType // Font descriptor + Up int // Underline position + Ut int // Underline thickness + Cw []int // Character width by ordinal + Enc string // "cp1252", ... + Diff string // Differences from reference encoding + File string // "Redressed.z" + Size1, Size2 int // Type1 values + OriginalSize int // Size of uncompressed font file + N int // Set by font loader + DiffN int // Position of diff in app array, set by font loader + i string // 1-based position in font list, set by font loader, not this program + utf8File *utf8FontFile // UTF-8 font + usedRunes map[int]int // Array of used runes +} + +// generateFontID generates a font Id from the font definition +func generateFontID(fdt fontDefType) (string, error) { + // file can be different if generated in different instance + fdt.File = "" + b, err := json.Marshal(&fdt) + return fmt.Sprintf("%x", sha1.Sum(b)), err +} + +type fontInfoType struct { + Data []byte + File string + OriginalSize int + FontName string + Bold bool + IsFixedPitch bool + UnderlineThickness int + UnderlinePosition int + Widths []int + Size1, Size2 uint32 + Desc FontDescType +} diff --git a/backend/vendor/github.com/phpdave11/gofpdf/doc.go b/backend/vendor/github.com/phpdave11/gofpdf/doc.go new file mode 100644 index 00000000..993fd6ea --- /dev/null +++ b/backend/vendor/github.com/phpdave11/gofpdf/doc.go @@ -0,0 +1,273 @@ +/* +Package gofpdf implements a PDF document generator with high level +support for text, drawing and images. + + +Features + + +- UTF-8 support + +- Choice of measurement unit, page format and margins + +- Page header and footer management + +- Automatic page breaks, line breaks, and text justification + +- Inclusion of JPEG, PNG, GIF, TIFF and basic path-only SVG images + +- Colors, gradients and alpha channel transparency + +- Outline bookmarks + +- Internal and external links + +- TrueType, Type1 and encoding support + +- Page compression + +- Lines, Bézier curves, arcs, and ellipses + +- Rotation, scaling, skewing, translation, and mirroring + +- Clipping + +- Document protection + +- Layers + +- Templates + +- Barcodes + +- Charting facility + +- Import PDFs as templates + +gofpdf has no dependencies other than the Go standard library. All tests +pass on Linux, Mac and Windows platforms. + +gofpdf supports UTF-8 TrueType fonts and “right-to-left” languages. Note +that Chinese, Japanese, and Korean characters may not be included in +many general purpose fonts. For these languages, a specialized font (for +example, NotoSansSC for simplified Chinese) can be used. + +Also, support is provided to automatically translate UTF-8 runes to code +page encodings for languages that have fewer than 256 glyphs. + + +Installation + +To install the package on your system, run + + go get github.com/phpdave11/gofpdf + +Later, to receive updates, run + + go get -u -v github.com/phpdave11/gofpdf/... + + +Quick Start + +The following Go code generates a simple PDF file. + + pdf := gofpdf.New("P", "mm", "A4", "") + pdf.AddPage() + pdf.SetFont("Arial", "B", 16) + pdf.Cell(40, 10, "Hello, world") + err := pdf.OutputFileAndClose("hello.pdf") + +See the functions in the fpdf_test.go file (shown as examples in this +documentation) for more advanced PDF examples. + + +Errors + +If an error occurs in an Fpdf method, an internal error field is set. +After this occurs, Fpdf method calls typically return without performing +any operations and the error state is retained. This error management +scheme facilitates PDF generation since individual method calls do not +need to be examined for failure; it is generally sufficient to wait +until after Output() is called. For the same reason, if an error occurs +in the calling application during PDF generation, it may be desirable +for the application to transfer the error to the Fpdf instance by +calling the SetError() method or the SetErrorf() method. At any time +during the life cycle of the Fpdf instance, the error state can be +determined with a call to Ok() or Err(). The error itself can be +retrieved with a call to Error(). + + +Conversion Notes + +This package is a relatively straightforward translation from the +original FPDF library written in PHP (despite the caveat in the +introduction to Effective Go). The API names have been retained even +though the Go idiom would suggest otherwise (for example, pdf.GetX() is +used rather than simply pdf.X()). The similarity of the two libraries +makes the original FPDF website a good source of information. It +includes a forum and FAQ. + +However, some internal changes have been made. Page content is built up +using buffers (of type bytes.Buffer) rather than repeated string +concatenation. Errors are handled as explained above rather than +panicking. Output is generated through an interface of type io.Writer or +io.WriteCloser. A number of the original PHP methods behave differently +based on the type of the arguments that are passed to them; in these +cases additional methods have been exported to provide similar +functionality. Font definition files are produced in JSON rather than +PHP. + + +Example PDFs + +A side effect of running go test ./... is the production of a number of +example PDFs. These can be found in the gofpdf/pdf directory after the +tests complete. + +Please note that these examples run in the context of a test. In order +run an example as a standalone application, you’ll need to examine +fpdf_test.go for some helper routines, for example exampleFilename() and +summary(). + +Example PDFs can be compared with reference copies in order to verify +that they have been generated as expected. This comparison will be +performed if a PDF with the same name as the example PDF is placed in +the gofpdf/pdf/reference directory and if the third argument to +ComparePDFFiles() in internal/example/example.go is true. (By default it +is false.) The routine that summarizes an example will look for this +file and, if found, will call ComparePDFFiles() to check the example PDF +for equality with its reference PDF. If differences exist between the +two files they will be printed to standard output and the test will +fail. If the reference file is missing, the comparison is considered to +succeed. In order to successfully compare two PDFs, the placement of +internal resources must be consistent and the internal creation +timestamps must be the same. To do this, the methods SetCatalogSort() +and SetCreationDate() need to be called for both files. This is done +automatically for all examples. + + +Nonstandard Fonts + +Nothing special is required to use the standard PDF fonts (courier, +helvetica, times, zapfdingbats) in your documents other than calling +SetFont(). + +You should use AddUTF8Font() or AddUTF8FontFromBytes() to add a TrueType +UTF-8 encoded font. Use RTL() and LTR() methods switch between +“right-to-left” and “left-to-right” mode. + +In order to use a different non-UTF-8 TrueType or Type1 font, you will +need to generate a font definition file and, if the font will be +embedded into PDFs, a compressed version of the font file. This is done +by calling the MakeFont function or using the included makefont command +line utility. To create the utility, cd into the makefont subdirectory +and run “go build”. This will produce a standalone executable named +makefont. Select the appropriate encoding file from the font +subdirectory and run the command as in the following example. + + ./makefont --embed --enc=../font/cp1252.map --dst=../font ../font/calligra.ttf + +In your PDF generation code, call AddFont() to load the font and, as +with the standard fonts, SetFont() to begin using it. Most examples, +including the package example, demonstrate this method. Good sources of +free, open-source fonts include Google Fonts and DejaVu Fonts. + + +Related Packages + +The draw2d package is a two dimensional vector graphics library that can +generate output in different forms. It uses gofpdf for its document +production mode. + + +Contributing Changes + +gofpdf is a global community effort and you are invited to make it even +better. If you have implemented a new feature or corrected a problem, +please consider contributing your change to the project. A contribution +that does not directly pertain to the core functionality of gofpdf +should be placed in its own directory directly beneath the contrib +directory. + +Here are guidelines for making submissions. Your change should + + +- be compatible with the MIT License + +- be properly documented + +- be formatted with go fmt + +- include an example in fpdf_test.go if appropriate + +- conform to the standards of golint and go vet, that is, golint . and +go vet . should not generate any warnings + +- not diminish test coverage + +Pull requests are the preferred means of accepting your changes. + + +License + +gofpdf is released under the MIT License. It is copyrighted by Kurt Jung +and the contributors acknowledged below. + + +Acknowledgments + +This package’s code and documentation are closely derived from the FPDF +library created by Olivier Plathey, and a number of font and image +resources are copied directly from it. Bruno Michel has provided +valuable assistance with the code. Drawing support is adapted from the +FPDF geometric figures script by David Hernández Sanz. Transparency +support is adapted from the FPDF transparency script by Martin Hall-May. +Support for gradients and clipping is adapted from FPDF scripts by +Andreas Würmser. Support for outline bookmarks is adapted from Olivier +Plathey by Manuel Cornes. Layer support is adapted from Olivier Plathey. +Support for transformations is adapted from the FPDF transformation +script by Moritz Wagner and Andreas Würmser. PDF protection is adapted +from the work of Klemen Vodopivec for the FPDF product. Lawrence +Kesteloot provided code to allow an image’s extent to be determined +prior to placement. Support for vertical alignment within a cell was +provided by Stefan Schroeder. Ivan Daniluk generalized the font and +image loading code to use the Reader interface while maintaining +backward compatibility. Anthony Starks provided code for the Polygon +function. Robert Lillack provided the Beziergon function and corrected +some naming issues with the internal curve function. Claudio Felber +provided implementations for dashed line drawing and generalized font +loading. Stani Michiels provided support for multi-segment path drawing +with smooth line joins, line join styles, enhanced fill modes, and has +helped greatly with package presentation and tests. Templating is +adapted by Marcus Downing from the FPDF_Tpl library created by Jan +Slabon and Setasign. Jelmer Snoeck contributed packages that generate a +variety of barcodes and help with registering images on the web. Jelmer +Snoek and Guillermo Pascual augmented the basic HTML functionality with +aligned text. Kent Quirk implemented backwards-compatible support for +reading DPI from images that support it, and for setting DPI manually +and then having it properly taken into account when calculating image +size. Paulo Coutinho provided support for static embedded fonts. Dan +Meyers added support for embedded JavaScript. David Fish added a generic +alias-replacement function to enable, among other things, table of +contents functionality. Andy Bakun identified and corrected a problem in +which the internal catalogs were not sorted stably. Paul Montag added +encoding and decoding functionality for templates, including images that +are embedded in templates; this allows templates to be stored +independently of gofpdf. Paul also added support for page boxes used in +printing PDF documents. Wojciech Matusiak added supported for word +spacing. Artem Korotkiy added support of UTF-8 fonts. Dave Barnes added +support for imported objects and templates. Brigham Thompson added +support for rounded rectangles. Joe Westcott added underline +functionality and optimized image storage. Benoit KUGLER contributed +support for rectangles with corners of unequal radius, modification +times, and for file attachments and annotations. + + +Roadmap + + +- Remove all legacy code page font support; use UTF-8 exclusively + +- Improve test coverage as reported by the coverage tool. +*/ +package gofpdf diff --git a/backend/vendor/github.com/phpdave11/gofpdf/embedded.go b/backend/vendor/github.com/phpdave11/gofpdf/embedded.go new file mode 100644 index 00000000..1d947b03 --- /dev/null +++ b/backend/vendor/github.com/phpdave11/gofpdf/embedded.go @@ -0,0 +1,559 @@ +/* + * Copyright (c) 2014 Kurt Jung (Gmail: kurt.w.jung) + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package gofpdf + +// Embedded standard fonts + +import ( + "strings" +) + +var embeddedFontList = map[string]string{ + "courierBI": `{"Tp":"Core","Name":"Courier-BoldOblique","Up":-100,"Ut":50,"I":256,"Cw":[600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600]}`, + "courierB": `{"Tp":"Core","Name":"Courier-Bold","Up":-100,"Ut":50,"I":256,"Cw":[600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600]}`, + "courierI": `{"Tp":"Core","Name":"Courier-Oblique","Up":-100,"Ut":50,"I":256,"Cw":[600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600]}`, + "courier": `{"Tp":"Core","Name":"Courier","Up":-100,"Ut":50,"I":256,"Cw":[600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600]}`, + "helveticaBI": `{"Tp":"Core","Name":"Helvetica-BoldOblique","Up":-100,"Ut":50,"Cw":[278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,333,474,556,556,889,722,238,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,333,333,584,584,584,611,975,722,722,722,722,667,611,778,722,278,556,722,611,833,722,778,667,778,722,667,611,722,667,944,667,667,611,333,278,333,584,556,333,556,611,556,611,556,333,611,611,278,278,556,278,889,611,611,611,611,389,556,333,611,556,778,556,556,500,389,280,389,584,350,556,350,278,556,500,1000,556,556,333,1000,667,333,1000,350,611,350,350,278,278,500,500,350,556,1000,333,1000,556,333,944,350,500,667,278,333,556,556,556,556,280,556,333,737,370,556,584,333,737,333,400,584,333,333,333,611,556,278,333,333,365,556,834,834,834,611,722,722,722,722,722,722,1000,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,556,556,556,556,556,278,278,278,278,611,611,611,611,611,611,611,584,611,611,611,611,611,556,611,556]}`, + "helveticaB": `{"Tp":"Core","Name":"Helvetica-Bold","Up":-100,"Ut":50,"Cw":[278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,333,474,556,556,889,722,238,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,333,333,584,584,584,611,975,722,722,722,722,667,611,778,722,278,556,722,611,833,722,778,667,778,722,667,611,722,667,944,667,667,611,333,278,333,584,556,333,556,611,556,611,556,333,611,611,278,278,556,278,889,611,611,611,611,389,556,333,611,556,778,556,556,500,389,280,389,584,350,556,350,278,556,500,1000,556,556,333,1000,667,333,1000,350,611,350,350,278,278,500,500,350,556,1000,333,1000,556,333,944,350,500,667,278,333,556,556,556,556,280,556,333,737,370,556,584,333,737,333,400,584,333,333,333,611,556,278,333,333,365,556,834,834,834,611,722,722,722,722,722,722,1000,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,556,556,556,556,556,278,278,278,278,611,611,611,611,611,611,611,584,611,611,611,611,611,556,611,556]}`, + "helveticaI": `{"Tp":"Core","Name":"Helvetica-Oblique","Up":-100,"Ut":50,"Cw":[278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,355,556,556,889,667,191,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,278,278,584,584,584,556,1015,667,667,722,722,667,611,778,722,278,500,667,556,833,722,778,667,778,722,667,611,722,667,944,667,667,611,278,278,278,469,556,333,556,556,500,556,556,278,556,556,222,222,500,222,833,556,556,556,556,333,500,278,556,500,722,500,500,500,334,260,334,584,350,556,350,222,556,333,1000,556,556,333,1000,667,333,1000,350,611,350,350,222,222,333,333,350,556,1000,333,1000,500,333,944,350,500,667,278,333,556,556,556,556,260,556,333,737,370,556,584,333,737,333,400,584,333,333,333,556,537,278,333,333,365,556,834,834,834,611,667,667,667,667,667,667,1000,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,500,556,556,556,556,278,278,278,278,556,556,556,556,556,556,556,584,611,556,556,556,556,500,556,500]}`, + "helvetica": `{"Tp":"Core","Name":"Helvetica","Up":-100,"Ut":50,"Cw":[278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,355,556,556,889,667,191,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,278,278,584,584,584,556,1015,667,667,722,722,667,611,778,722,278,500,667,556,833,722,778,667,778,722,667,611,722,667,944,667,667,611,278,278,278,469,556,333,556,556,500,556,556,278,556,556,222,222,500,222,833,556,556,556,556,333,500,278,556,500,722,500,500,500,334,260,334,584,350,556,350,222,556,333,1000,556,556,333,1000,667,333,1000,350,611,350,350,222,222,333,333,350,556,1000,333,1000,500,333,944,350,500,667,278,333,556,556,556,556,260,556,333,737,370,556,584,333,737,333,400,584,333,333,333,556,537,278,333,333,365,556,834,834,834,611,667,667,667,667,667,667,1000,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,500,556,556,556,556,278,278,278,278,556,556,556,556,556,556,556,584,611,556,556,556,556,500,556,500]}`, + "timesBI": `{"Tp":"Core","Name":"Times-BoldItalic","Up":-100,"Ut":50,"Cw":[250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,389,555,500,500,833,778,278,333,333,500,570,250,333,250,278,500,500,500,500,500,500,500,500,500,500,333,333,570,570,570,500,832,667,667,667,722,667,667,722,778,389,500,667,611,889,722,722,611,722,667,556,611,722,667,889,667,611,611,333,278,333,570,500,333,500,500,444,500,444,333,500,556,278,278,500,278,778,556,500,500,500,389,389,278,556,444,667,500,444,389,348,220,348,570,350,500,350,333,500,500,1000,500,500,333,1000,556,333,944,350,611,350,350,333,333,500,500,350,500,1000,333,1000,389,333,722,350,389,611,250,389,500,500,500,500,220,500,333,747,266,500,606,333,747,333,400,570,300,300,333,576,500,250,333,300,300,500,750,750,750,500,667,667,667,667,667,667,944,667,667,667,667,667,389,389,389,389,722,722,722,722,722,722,722,570,722,722,722,722,722,611,611,500,500,500,500,500,500,500,722,444,444,444,444,444,278,278,278,278,500,556,500,500,500,500,500,570,500,556,556,556,556,444,500,444]}`, + "timesB": `{"Tp":"Core","Name":"Times-Bold","Up":-100,"Ut":50,"Cw":[250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,333,555,500,500,1000,833,278,333,333,500,570,250,333,250,278,500,500,500,500,500,500,500,500,500,500,333,333,570,570,570,500,930,722,667,722,722,667,611,778,778,389,500,778,667,944,722,778,611,778,722,556,667,722,722,1000,722,722,667,333,278,333,581,500,333,500,556,444,556,444,333,500,556,278,333,556,278,833,556,500,556,556,444,389,333,556,500,722,500,500,444,394,220,394,520,350,500,350,333,500,500,1000,500,500,333,1000,556,333,1000,350,667,350,350,333,333,500,500,350,500,1000,333,1000,389,333,722,350,444,722,250,333,500,500,500,500,220,500,333,747,300,500,570,333,747,333,400,570,300,300,333,556,540,250,333,300,330,500,750,750,750,500,722,722,722,722,722,722,1000,722,667,667,667,667,389,389,389,389,722,722,778,778,778,778,778,570,778,722,722,722,722,722,611,556,500,500,500,500,500,500,722,444,444,444,444,444,278,278,278,278,500,556,500,500,500,500,500,570,500,556,556,556,556,500,556,500]}`, + "timesI": `{"Tp":"Core","Name":"Times-Italic","Up":-100,"Ut":50,"Cw":[250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,333,420,500,500,833,778,214,333,333,500,675,250,333,250,278,500,500,500,500,500,500,500,500,500,500,333,333,675,675,675,500,920,611,611,667,722,611,611,722,722,333,444,667,556,833,667,722,611,722,611,500,556,722,611,833,611,556,556,389,278,389,422,500,333,500,500,444,500,444,278,500,500,278,278,444,278,722,500,500,500,500,389,389,278,500,444,667,444,444,389,400,275,400,541,350,500,350,333,500,556,889,500,500,333,1000,500,333,944,350,556,350,350,333,333,556,556,350,500,889,333,980,389,333,667,350,389,556,250,389,500,500,500,500,275,500,333,760,276,500,675,333,760,333,400,675,300,300,333,500,523,250,333,300,310,500,750,750,750,500,611,611,611,611,611,611,889,667,611,611,611,611,333,333,333,333,722,667,722,722,722,722,722,675,722,722,722,722,722,556,611,500,500,500,500,500,500,500,667,444,444,444,444,444,278,278,278,278,500,500,500,500,500,500,500,675,500,500,500,500,500,444,500,444]}`, + "times": `{"Tp":"Core","Name":"Times-Roman","Up":-100,"Ut":50,"Cw":[250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,333,408,500,500,833,778,180,333,333,500,564,250,333,250,278,500,500,500,500,500,500,500,500,500,500,278,278,564,564,564,444,921,722,667,667,722,611,556,722,722,333,389,722,611,889,722,722,556,722,667,556,611,722,722,944,722,722,611,333,278,333,469,500,333,444,500,444,500,444,333,500,500,278,278,500,278,778,500,500,500,500,333,389,278,500,500,722,500,500,444,480,200,480,541,350,500,350,333,500,444,1000,500,500,333,1000,556,333,889,350,611,350,350,333,333,444,444,350,500,1000,333,980,389,333,722,350,444,722,250,333,500,500,500,500,200,500,333,760,276,500,564,333,760,333,400,564,300,300,333,500,453,250,333,300,310,500,750,750,750,444,722,722,722,722,722,722,889,667,611,611,611,611,333,333,333,333,722,722,722,722,722,722,722,564,722,722,722,722,722,722,556,500,444,444,444,444,444,444,667,444,444,444,444,444,278,278,278,278,500,500,500,500,500,500,500,564,500,500,500,500,500,500,500,500]}`, + "zapfdingbats": `{"Tp":"Core","Name":"ZapfDingbats","Up":-100,"Ut":50,"Cw":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,278,974,961,974,980,719,789,790,791,690,960,939,549,855,911,933,911,945,974,755,846,762,761,571,677,763,760,759,754,494,552,537,577,692,786,788,788,790,793,794,816,823,789,841,823,833,816,831,923,744,723,749,790,792,695,776,768,792,759,707,708,682,701,826,815,789,789,707,687,696,689,786,787,713,791,785,791,873,761,762,762,759,759,892,892,788,784,438,138,277,415,392,392,668,668,0,390,390,317,317,276,276,509,509,410,410,234,234,334,334,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,732,544,544,910,667,760,760,776,595,694,626,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,894,838,1016,458,748,924,748,918,927,928,928,834,873,828,924,924,917,930,931,463,883,836,836,867,867,696,696,874,0,874,760,946,771,865,771,888,967,888,831,873,927,970,918,0]}`, +} + +func (f *Fpdf) coreFontReader(familyStr, styleStr string) (r *strings.Reader) { + key := familyStr + styleStr + str, ok := embeddedFontList[key] + if ok { + r = strings.NewReader(str) + } else { + f.SetErrorf("could not locate \"%s\" among embedded core font definition files", key) + } + return +} + +var embeddedMapList = map[string]string{ + "cp1250": ` +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!89 U+2030 perthousand +!8A U+0160 Scaron +!8B U+2039 guilsinglleft +!8C U+015A Sacute +!8D U+0164 Tcaron +!8E U+017D Zcaron +!8F U+0179 Zacute +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!99 U+2122 trademark +!9A U+0161 scaron +!9B U+203A guilsinglright +!9C U+015B sacute +!9D U+0165 tcaron +!9E U+017E zcaron +!9F U+017A zacute +!A0 U+00A0 space +!A1 U+02C7 caron +!A2 U+02D8 breve +!A3 U+0141 Lslash +!A4 U+00A4 currency +!A5 U+0104 Aogonek +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+015E Scedilla +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+017B Zdotaccent +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+02DB ogonek +!B3 U+0142 lslash +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00B8 cedilla +!B9 U+0105 aogonek +!BA U+015F scedilla +!BB U+00BB guillemotright +!BC U+013D Lcaron +!BD U+02DD hungarumlaut +!BE U+013E lcaron +!BF U+017C zdotaccent +!C0 U+0154 Racute +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+0102 Abreve +!C4 U+00C4 Adieresis +!C5 U+0139 Lacute +!C6 U+0106 Cacute +!C7 U+00C7 Ccedilla +!C8 U+010C Ccaron +!C9 U+00C9 Eacute +!CA U+0118 Eogonek +!CB U+00CB Edieresis +!CC U+011A Ecaron +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+010E Dcaron +!D0 U+0110 Dcroat +!D1 U+0143 Nacute +!D2 U+0147 Ncaron +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+0150 Ohungarumlaut +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+0158 Rcaron +!D9 U+016E Uring +!DA U+00DA Uacute +!DB U+0170 Uhungarumlaut +!DC U+00DC Udieresis +!DD U+00DD Yacute +!DE U+0162 Tcommaaccent +!DF U+00DF germandbls +!E0 U+0155 racute +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+0103 abreve +!E4 U+00E4 adieresis +!E5 U+013A lacute +!E6 U+0107 cacute +!E7 U+00E7 ccedilla +!E8 U+010D ccaron +!E9 U+00E9 eacute +!EA U+0119 eogonek +!EB U+00EB edieresis +!EC U+011B ecaron +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+010F dcaron +!F0 U+0111 dcroat +!F1 U+0144 nacute +!F2 U+0148 ncaron +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+0151 ohungarumlaut +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+0159 rcaron +!F9 U+016F uring +!FA U+00FA uacute +!FB U+0171 uhungarumlaut +!FC U+00FC udieresis +!FD U+00FD yacute +!FE U+0163 tcommaaccent +!FF U+02D9 dotaccent + `, + "cp1252": ` +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!83 U+0192 florin +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!88 U+02C6 circumflex +!89 U+2030 perthousand +!8A U+0160 Scaron +!8B U+2039 guilsinglleft +!8C U+0152 OE +!8E U+017D Zcaron +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!98 U+02DC tilde +!99 U+2122 trademark +!9A U+0161 scaron +!9B U+203A guilsinglright +!9C U+0153 oe +!9E U+017E zcaron +!9F U+0178 Ydieresis +!A0 U+00A0 space +!A1 U+00A1 exclamdown +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A5 U+00A5 yen +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+00AA ordfeminine +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00B8 cedilla +!B9 U+00B9 onesuperior +!BA U+00BA ordmasculine +!BB U+00BB guillemotright +!BC U+00BC onequarter +!BD U+00BD onehalf +!BE U+00BE threequarters +!BF U+00BF questiondown +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+00C3 Atilde +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+00CC Igrave +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+00D0 Eth +!D1 U+00D1 Ntilde +!D2 U+00D2 Ograve +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+00DD Yacute +!DE U+00DE Thorn +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+00E3 atilde +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+00EC igrave +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+00F0 eth +!F1 U+00F1 ntilde +!F2 U+00F2 ograve +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+00FD yacute +!FE U+00FE thorn +!FF U+00FF ydieresis + `, +} diff --git a/backend/vendor/github.com/phpdave11/gofpdf/font.go b/backend/vendor/github.com/phpdave11/gofpdf/font.go new file mode 100644 index 00000000..29417bb0 --- /dev/null +++ b/backend/vendor/github.com/phpdave11/gofpdf/font.go @@ -0,0 +1,474 @@ +/* + * Copyright (c) 2013 Kurt Jung (Gmail: kurt.w.jung) + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package gofpdf + +// Utility to generate font definition files + +// Version: 1.2 +// Date: 2011-06-18 +// Author: Olivier PLATHEY +// Port to Go: Kurt Jung, 2013-07-15 + +import ( + "bufio" + "compress/zlib" + "encoding/binary" + "encoding/json" + "fmt" + "io" + "io/ioutil" + "os" + "path/filepath" + "strconv" + "strings" +) + +func baseNoExt(fileStr string) string { + str := filepath.Base(fileStr) + extLen := len(filepath.Ext(str)) + if extLen > 0 { + str = str[:len(str)-extLen] + } + return str +} + +func loadMap(encodingFileStr string) (encList encListType, err error) { + // printf("Encoding file string [%s]\n", encodingFileStr) + var f *os.File + // f, err = os.Open(encodingFilepath(encodingFileStr)) + f, err = os.Open(encodingFileStr) + if err == nil { + defer f.Close() + for j := range encList { + encList[j].uv = -1 + encList[j].name = ".notdef" + } + scanner := bufio.NewScanner(f) + var enc encType + var pos int + for scanner.Scan() { + // "!3F U+003F question" + _, err = fmt.Sscanf(scanner.Text(), "!%x U+%x %s", &pos, &enc.uv, &enc.name) + if err == nil { + if pos < 256 { + encList[pos] = enc + } else { + err = fmt.Errorf("map position 0x%2X exceeds 0xFF", pos) + return + } + } else { + return + } + } + if err = scanner.Err(); err != nil { + return + } + } + return +} + +// getInfoFromTrueType returns information from a TrueType font +func getInfoFromTrueType(fileStr string, msgWriter io.Writer, embed bool, encList encListType) (info fontInfoType, err error) { + info.Widths = make([]int, 256) + var ttf TtfType + ttf, err = TtfParse(fileStr) + if err != nil { + return + } + if embed { + if !ttf.Embeddable { + err = fmt.Errorf("font license does not allow embedding") + return + } + info.Data, err = ioutil.ReadFile(fileStr) + if err != nil { + return + } + info.OriginalSize = len(info.Data) + } + k := 1000.0 / float64(ttf.UnitsPerEm) + info.FontName = ttf.PostScriptName + info.Bold = ttf.Bold + info.Desc.ItalicAngle = int(ttf.ItalicAngle) + info.IsFixedPitch = ttf.IsFixedPitch + info.Desc.Ascent = round(k * float64(ttf.TypoAscender)) + info.Desc.Descent = round(k * float64(ttf.TypoDescender)) + info.UnderlineThickness = round(k * float64(ttf.UnderlineThickness)) + info.UnderlinePosition = round(k * float64(ttf.UnderlinePosition)) + info.Desc.FontBBox = fontBoxType{ + round(k * float64(ttf.Xmin)), + round(k * float64(ttf.Ymin)), + round(k * float64(ttf.Xmax)), + round(k * float64(ttf.Ymax)), + } + // printf("FontBBox\n") + // dump(info.Desc.FontBBox) + info.Desc.CapHeight = round(k * float64(ttf.CapHeight)) + info.Desc.MissingWidth = round(k * float64(ttf.Widths[0])) + var wd int + for j := 0; j < len(info.Widths); j++ { + wd = info.Desc.MissingWidth + if encList[j].name != ".notdef" { + uv := encList[j].uv + pos, ok := ttf.Chars[uint16(uv)] + if ok { + wd = round(k * float64(ttf.Widths[pos])) + } else { + fmt.Fprintf(msgWriter, "Character %s is missing\n", encList[j].name) + } + } + info.Widths[j] = wd + } + // printf("getInfoFromTrueType/FontBBox\n") + // dump(info.Desc.FontBBox) + return +} + +type segmentType struct { + marker uint8 + tp uint8 + size uint32 + data []byte +} + +func segmentRead(r io.Reader) (s segmentType, err error) { + if err = binary.Read(r, binary.LittleEndian, &s.marker); err != nil { + return + } + if s.marker != 128 { + err = fmt.Errorf("font file is not a valid binary Type1") + return + } + if err = binary.Read(r, binary.LittleEndian, &s.tp); err != nil { + return + } + if err = binary.Read(r, binary.LittleEndian, &s.size); err != nil { + return + } + s.data = make([]byte, s.size) + _, err = r.Read(s.data) + return +} + +// -rw-r--r-- 1 root root 9532 2010-04-22 11:27 /usr/share/fonts/type1/mathml/Symbol.afm +// -rw-r--r-- 1 root root 37744 2010-04-22 11:27 /usr/share/fonts/type1/mathml/Symbol.pfb + +// getInfoFromType1 return information from a Type1 font +func getInfoFromType1(fileStr string, msgWriter io.Writer, embed bool, encList encListType) (info fontInfoType, err error) { + info.Widths = make([]int, 256) + if embed { + var f *os.File + f, err = os.Open(fileStr) + if err != nil { + return + } + defer f.Close() + // Read first segment + var s1, s2 segmentType + s1, err = segmentRead(f) + if err != nil { + return + } + s2, err = segmentRead(f) + if err != nil { + return + } + info.Data = s1.data + info.Data = append(info.Data, s2.data...) + info.Size1 = s1.size + info.Size2 = s2.size + } + afmFileStr := fileStr[0:len(fileStr)-3] + "afm" + size, ok := fileSize(afmFileStr) + if !ok { + err = fmt.Errorf("font file (ATM) %s not found", afmFileStr) + return + } else if size == 0 { + err = fmt.Errorf("font file (AFM) %s empty or not readable", afmFileStr) + return + } + var f *os.File + f, err = os.Open(afmFileStr) + if err != nil { + return + } + defer f.Close() + scanner := bufio.NewScanner(f) + var fields []string + var wd int + var wt, name string + wdMap := make(map[string]int) + for scanner.Scan() { + fields = strings.Fields(strings.TrimSpace(scanner.Text())) + // Comment Generated by FontForge 20080203 + // FontName Symbol + // C 32 ; WX 250 ; N space ; B 0 0 0 0 ; + if len(fields) >= 2 { + switch fields[0] { + case "C": + if wd, err = strconv.Atoi(fields[4]); err == nil { + name = fields[7] + wdMap[name] = wd + } + case "FontName": + info.FontName = fields[1] + case "Weight": + wt = strings.ToLower(fields[1]) + case "ItalicAngle": + info.Desc.ItalicAngle, err = strconv.Atoi(fields[1]) + case "Ascender": + info.Desc.Ascent, err = strconv.Atoi(fields[1]) + case "Descender": + info.Desc.Descent, err = strconv.Atoi(fields[1]) + case "UnderlineThickness": + info.UnderlineThickness, err = strconv.Atoi(fields[1]) + case "UnderlinePosition": + info.UnderlinePosition, err = strconv.Atoi(fields[1]) + case "IsFixedPitch": + info.IsFixedPitch = fields[1] == "true" + case "FontBBox": + if info.Desc.FontBBox.Xmin, err = strconv.Atoi(fields[1]); err == nil { + if info.Desc.FontBBox.Ymin, err = strconv.Atoi(fields[2]); err == nil { + if info.Desc.FontBBox.Xmax, err = strconv.Atoi(fields[3]); err == nil { + info.Desc.FontBBox.Ymax, err = strconv.Atoi(fields[4]) + } + } + } + case "CapHeight": + info.Desc.CapHeight, err = strconv.Atoi(fields[1]) + case "StdVW": + info.Desc.StemV, err = strconv.Atoi(fields[1]) + } + } + if err != nil { + return + } + } + if err = scanner.Err(); err != nil { + return + } + if info.FontName == "" { + err = fmt.Errorf("the field FontName missing in AFM file %s", afmFileStr) + return + } + info.Bold = wt == "bold" || wt == "black" + var missingWd int + missingWd, ok = wdMap[".notdef"] + if ok { + info.Desc.MissingWidth = missingWd + } + for j := 0; j < len(info.Widths); j++ { + info.Widths[j] = info.Desc.MissingWidth + } + for j := 0; j < len(info.Widths); j++ { + name = encList[j].name + if name != ".notdef" { + wd, ok = wdMap[name] + if ok { + info.Widths[j] = wd + } else { + fmt.Fprintf(msgWriter, "Character %s is missing\n", name) + } + } + } + // printf("getInfoFromType1/FontBBox\n") + // dump(info.Desc.FontBBox) + return +} + +func makeFontDescriptor(info *fontInfoType) { + if info.Desc.CapHeight == 0 { + info.Desc.CapHeight = info.Desc.Ascent + } + info.Desc.Flags = 1 << 5 + if info.IsFixedPitch { + info.Desc.Flags |= 1 + } + if info.Desc.ItalicAngle != 0 { + info.Desc.Flags |= 1 << 6 + } + if info.Desc.StemV == 0 { + if info.Bold { + info.Desc.StemV = 120 + } else { + info.Desc.StemV = 70 + } + } + // printf("makeFontDescriptor/FontBBox\n") + // dump(info.Desc.FontBBox) +} + +// makeFontEncoding builds differences from reference encoding +func makeFontEncoding(encList encListType, refEncFileStr string) (diffStr string, err error) { + var refList encListType + if refList, err = loadMap(refEncFileStr); err != nil { + return + } + var buf fmtBuffer + last := 0 + for j := 32; j < 256; j++ { + if encList[j].name != refList[j].name { + if j != last+1 { + buf.printf("%d ", j) + } + last = j + buf.printf("/%s ", encList[j].name) + } + } + diffStr = strings.TrimSpace(buf.String()) + return +} + +func makeDefinitionFile(fileStr, tpStr, encodingFileStr string, embed bool, encList encListType, info fontInfoType) error { + var err error + var def fontDefType + def.Tp = tpStr + def.Name = info.FontName + makeFontDescriptor(&info) + def.Desc = info.Desc + // printf("makeDefinitionFile/FontBBox\n") + // dump(def.Desc.FontBBox) + def.Up = info.UnderlinePosition + def.Ut = info.UnderlineThickness + def.Cw = info.Widths + def.Enc = baseNoExt(encodingFileStr) + // fmt.Printf("encodingFileStr [%s], def.Enc [%s]\n", encodingFileStr, def.Enc) + // fmt.Printf("reference [%s]\n", filepath.Join(filepath.Dir(encodingFileStr), "cp1252.map")) + def.Diff, err = makeFontEncoding(encList, filepath.Join(filepath.Dir(encodingFileStr), "cp1252.map")) + if err != nil { + return err + } + def.File = info.File + def.Size1 = int(info.Size1) + def.Size2 = int(info.Size2) + def.OriginalSize = info.OriginalSize + // printf("Font definition file [%s]\n", fileStr) + var buf []byte + buf, err = json.Marshal(def) + if err != nil { + return err + } + var f *os.File + f, err = os.Create(fileStr) + if err != nil { + return err + } + defer f.Close() + _, err = f.Write(buf) + if err != nil { + return err + } + err = f.Close() + if err != nil { + return err + } + + return err +} + +// MakeFont generates a font definition file in JSON format. A definition file +// of this type is required to use non-core fonts in the PDF documents that +// gofpdf generates. See the makefont utility in the gofpdf package for a +// command line interface to this function. +// +// fontFileStr is the name of the TrueType file (extension .ttf), OpenType file +// (extension .otf) or binary Type1 file (extension .pfb) from which to +// generate a definition file. If an OpenType file is specified, it must be one +// that is based on TrueType outlines, not PostScript outlines; this cannot be +// determined from the file extension alone. If a Type1 file is specified, a +// metric file with the same pathname except with the extension .afm must be +// present. +// +// encodingFileStr is the name of the encoding file that corresponds to the +// font. +// +// dstDirStr is the name of the directory in which to save the definition file +// and, if embed is true, the compressed font file. +// +// msgWriter is the writer that is called to display messages throughout the +// process. Use nil to turn off messages. +// +// embed is true if the font is to be embedded in the PDF files. +func MakeFont(fontFileStr, encodingFileStr, dstDirStr string, msgWriter io.Writer, embed bool) error { + if msgWriter == nil { + msgWriter = ioutil.Discard + } + if !fileExist(fontFileStr) { + return fmt.Errorf("font file not found: %s", fontFileStr) + } + extStr := strings.ToLower(fontFileStr[len(fontFileStr)-3:]) + // printf("Font file extension [%s]\n", extStr) + var tpStr string + switch extStr { + case "ttf": + fallthrough + case "otf": + tpStr = "TrueType" + case "pfb": + tpStr = "Type1" + default: + return fmt.Errorf("unrecognized font file extension: %s", extStr) + } + + var info fontInfoType + encList, err := loadMap(encodingFileStr) + if err != nil { + return err + } + // printf("Encoding table\n") + // dump(encList) + if tpStr == "TrueType" { + info, err = getInfoFromTrueType(fontFileStr, msgWriter, embed, encList) + if err != nil { + return err + } + } else { + info, err = getInfoFromType1(fontFileStr, msgWriter, embed, encList) + if err != nil { + return err + } + } + baseStr := baseNoExt(fontFileStr) + // fmt.Printf("Base [%s]\n", baseStr) + if embed { + var f *os.File + info.File = baseStr + ".z" + zFileStr := filepath.Join(dstDirStr, info.File) + f, err = os.Create(zFileStr) + if err != nil { + return err + } + defer f.Close() + cmp := zlib.NewWriter(f) + _, err = cmp.Write(info.Data) + if err != nil { + return err + } + err = cmp.Close() + if err != nil { + return err + } + fmt.Fprintf(msgWriter, "Font file compressed: %s\n", zFileStr) + } + defFileStr := filepath.Join(dstDirStr, baseStr+".json") + err = makeDefinitionFile(defFileStr, tpStr, encodingFileStr, embed, encList, info) + if err != nil { + return err + } + fmt.Fprintf(msgWriter, "Font definition file successfully generated: %s\n", defFileStr) + return nil +} diff --git a/backend/vendor/github.com/phpdave11/gofpdf/fpdf.go b/backend/vendor/github.com/phpdave11/gofpdf/fpdf.go new file mode 100644 index 00000000..3be1cdc2 --- /dev/null +++ b/backend/vendor/github.com/phpdave11/gofpdf/fpdf.go @@ -0,0 +1,4998 @@ +/* + * Copyright (c) 2013-2014 Kurt Jung (Gmail: kurt.w.jung) + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package gofpdf + +// Version: 1.7 +// Date: 2011-06-18 +// Author: Olivier PLATHEY +// Port to Go: Kurt Jung, 2013-07-15 + +import ( + "bytes" + "encoding/binary" + "encoding/json" + "fmt" + "image" + "image/color" + "image/gif" + "image/jpeg" + "image/png" + "io" + "io/ioutil" + "math" + "os" + "path" + "sort" + "strconv" + "strings" + "time" +) + +var gl struct { + catalogSort bool + noCompress bool // Initial zero value indicates compression + creationDate time.Time + modDate time.Time +} + +type fmtBuffer struct { + bytes.Buffer +} + +func (b *fmtBuffer) printf(fmtStr string, args ...interface{}) { + b.Buffer.WriteString(fmt.Sprintf(fmtStr, args...)) +} + +func fpdfNew(orientationStr, unitStr, sizeStr, fontDirStr string, size SizeType) (f *Fpdf) { + f = new(Fpdf) + if orientationStr == "" { + orientationStr = "p" + } else { + orientationStr = strings.ToLower(orientationStr) + } + if unitStr == "" { + unitStr = "mm" + } + if sizeStr == "" { + sizeStr = "A4" + } + if fontDirStr == "" { + fontDirStr = "." + } + f.page = 0 + f.n = 2 + f.pages = make([]*bytes.Buffer, 0, 8) + f.pages = append(f.pages, bytes.NewBufferString("")) // pages[0] is unused (1-based) + f.pageSizes = make(map[int]SizeType) + f.pageBoxes = make(map[int]map[string]PageBox) + f.defPageBoxes = make(map[string]PageBox) + f.state = 0 + f.fonts = make(map[string]fontDefType) + f.fontFiles = make(map[string]fontFileType) + f.diffs = make([]string, 0, 8) + f.templates = make(map[string]Template) + f.templateObjects = make(map[string]int) + f.importedObjs = make(map[string][]byte, 0) + f.importedObjPos = make(map[string]map[int]string, 0) + f.importedTplObjs = make(map[string]string) + f.importedTplIDs = make(map[string]int, 0) + f.images = make(map[string]*ImageInfoType) + f.pageLinks = make([][]linkType, 0, 8) + f.pageLinks = append(f.pageLinks, make([]linkType, 0, 0)) // pageLinks[0] is unused (1-based) + f.links = make([]intLinkType, 0, 8) + f.links = append(f.links, intLinkType{}) // links[0] is unused (1-based) + f.pageAttachments = make([][]annotationAttach, 0, 8) + f.pageAttachments = append(f.pageAttachments, []annotationAttach{}) // + f.aliasMap = make(map[string]string) + f.inHeader = false + f.inFooter = false + f.lasth = 0 + f.fontFamily = "" + f.fontStyle = "" + f.SetFontSize(12) + f.underline = false + f.strikeout = false + f.setDrawColor(0, 0, 0) + f.setFillColor(0, 0, 0) + f.setTextColor(0, 0, 0) + f.colorFlag = false + f.ws = 0 + f.fontpath = fontDirStr + // Core fonts + f.coreFonts = map[string]bool{ + "courier": true, + "helvetica": true, + "times": true, + "symbol": true, + "zapfdingbats": true, + } + // Scale factor + switch unitStr { + case "pt", "point": + f.k = 1.0 + case "mm": + f.k = 72.0 / 25.4 + case "cm": + f.k = 72.0 / 2.54 + case "in", "inch": + f.k = 72.0 + default: + f.err = fmt.Errorf("incorrect unit %s", unitStr) + return + } + f.unitStr = unitStr + // Page sizes + f.stdPageSizes = make(map[string]SizeType) + f.stdPageSizes["a3"] = SizeType{841.89, 1190.55} + f.stdPageSizes["a4"] = SizeType{595.28, 841.89} + f.stdPageSizes["a5"] = SizeType{420.94, 595.28} + f.stdPageSizes["a6"] = SizeType{297.64, 420.94} + f.stdPageSizes["a2"] = SizeType{1190.55, 1683.78} + f.stdPageSizes["a1"] = SizeType{1683.78, 2383.94} + f.stdPageSizes["letter"] = SizeType{612, 792} + f.stdPageSizes["legal"] = SizeType{612, 1008} + f.stdPageSizes["tabloid"] = SizeType{792, 1224} + if size.Wd > 0 && size.Ht > 0 { + f.defPageSize = size + } else { + f.defPageSize = f.getpagesizestr(sizeStr) + if f.err != nil { + return + } + } + f.curPageSize = f.defPageSize + // Page orientation + switch orientationStr { + case "p", "portrait": + f.defOrientation = "P" + f.w = f.defPageSize.Wd + f.h = f.defPageSize.Ht + // dbg("Assign h: %8.2f", f.h) + case "l", "landscape": + f.defOrientation = "L" + f.w = f.defPageSize.Ht + f.h = f.defPageSize.Wd + default: + f.err = fmt.Errorf("incorrect orientation: %s", orientationStr) + return + } + f.curOrientation = f.defOrientation + f.wPt = f.w * f.k + f.hPt = f.h * f.k + // Page margins (1 cm) + margin := 28.35 / f.k + f.SetMargins(margin, margin, margin) + // Interior cell margin (1 mm) + f.cMargin = margin / 10 + // Line width (0.2 mm) + f.lineWidth = 0.567 / f.k + // Automatic page break + f.SetAutoPageBreak(true, 2*margin) + // Default display mode + f.SetDisplayMode("default", "default") + if f.err != nil { + return + } + f.acceptPageBreak = func() bool { + return f.autoPageBreak + } + // Enable compression + f.SetCompression(!gl.noCompress) + f.spotColorMap = make(map[string]spotColorType) + f.blendList = make([]blendModeType, 0, 8) + f.blendList = append(f.blendList, blendModeType{}) // blendList[0] is unused (1-based) + f.blendMap = make(map[string]int) + f.blendMode = "Normal" + f.alpha = 1 + f.gradientList = make([]gradientType, 0, 8) + f.gradientList = append(f.gradientList, gradientType{}) // gradientList[0] is unused + // Set default PDF version number + f.pdfVersion = "1.3" + f.SetProducer("FPDF "+cnFpdfVersion, true) + f.layerInit() + f.catalogSort = gl.catalogSort + f.creationDate = gl.creationDate + f.modDate = gl.modDate + f.userUnderlineThickness = 1 + return +} + +// NewCustom returns a pointer to a new Fpdf instance. Its methods are +// subsequently called to produce a single PDF document. NewCustom() is an +// alternative to New() that provides additional customization. The PageSize() +// example demonstrates this method. +func NewCustom(init *InitType) (f *Fpdf) { + return fpdfNew(init.OrientationStr, init.UnitStr, init.SizeStr, init.FontDirStr, init.Size) +} + +// New returns a pointer to a new Fpdf instance. Its methods are subsequently +// called to produce a single PDF document. +// +// orientationStr specifies the default page orientation. For portrait mode, +// specify "P" or "Portrait". For landscape mode, specify "L" or "Landscape". +// An empty string will be replaced with "P". +// +// unitStr specifies the unit of length used in size parameters for elements +// other than fonts, which are always measured in points. Specify "pt" for +// point, "mm" for millimeter, "cm" for centimeter, or "in" for inch. An empty +// string will be replaced with "mm". +// +// sizeStr specifies the page size. Acceptable values are "A3", "A4", "A5", +// "Letter", "Legal", or "Tabloid". An empty string will be replaced with "A4". +// +// fontDirStr specifies the file system location in which font resources will +// be found. An empty string is replaced with ".". This argument only needs to +// reference an actual directory if a font other than one of the core +// fonts is used. The core fonts are "courier", "helvetica" (also called +// "arial"), "times", and "zapfdingbats" (also called "symbol"). +func New(orientationStr, unitStr, sizeStr, fontDirStr string) (f *Fpdf) { + return fpdfNew(orientationStr, unitStr, sizeStr, fontDirStr, SizeType{0, 0}) +} + +// Ok returns true if no processing errors have occurred. +func (f *Fpdf) Ok() bool { + return f.err == nil +} + +// Err returns true if a processing error has occurred. +func (f *Fpdf) Err() bool { + return f.err != nil +} + +// ClearError unsets the internal Fpdf error. This method should be used with +// care, as an internal error condition usually indicates an unrecoverable +// problem with the generation of a document. It is intended to deal with cases +// in which an error is used to select an alternate form of the document. +func (f *Fpdf) ClearError() { + f.err = nil +} + +// SetErrorf sets the internal Fpdf error with formatted text to halt PDF +// generation; this may facilitate error handling by application. If an error +// condition is already set, this call is ignored. +// +// See the documentation for printing in the standard fmt package for details +// about fmtStr and args. +func (f *Fpdf) SetErrorf(fmtStr string, args ...interface{}) { + if f.err == nil { + f.err = fmt.Errorf(fmtStr, args...) + } +} + +// String satisfies the fmt.Stringer interface and summarizes the Fpdf +// instance. +func (f *Fpdf) String() string { + return "Fpdf " + cnFpdfVersion +} + +// SetError sets an error to halt PDF generation. This may facilitate error +// handling by application. See also Ok(), Err() and Error(). +func (f *Fpdf) SetError(err error) { + if f.err == nil && err != nil { + f.err = err + } +} + +// Error returns the internal Fpdf error; this will be nil if no error has occurred. +func (f *Fpdf) Error() error { + return f.err +} + +// GetPageSize returns the current page's width and height. This is the paper's +// size. To compute the size of the area being used, subtract the margins (see +// GetMargins()). +func (f *Fpdf) GetPageSize() (width, height float64) { + width = f.w + height = f.h + return +} + +// GetMargins returns the left, top, right, and bottom margins. The first three +// are set with the SetMargins() method. The bottom margin is set with the +// SetAutoPageBreak() method. +func (f *Fpdf) GetMargins() (left, top, right, bottom float64) { + left = f.lMargin + top = f.tMargin + right = f.rMargin + bottom = f.bMargin + return +} + +// SetMargins defines the left, top and right margins. By default, they equal 1 +// cm. Call this method to change them. If the value of the right margin is +// less than zero, it is set to the same as the left margin. +func (f *Fpdf) SetMargins(left, top, right float64) { + f.lMargin = left + f.tMargin = top + if right < 0 { + right = left + } + f.rMargin = right +} + +// SetLeftMargin defines the left margin. The method can be called before +// creating the first page. If the current abscissa gets out of page, it is +// brought back to the margin. +func (f *Fpdf) SetLeftMargin(margin float64) { + f.lMargin = margin + if f.page > 0 && f.x < margin { + f.x = margin + } +} + +// GetCellMargin returns the cell margin. This is the amount of space before +// and after the text within a cell that's left blank, and is in units passed +// to New(). It defaults to 1mm. +func (f *Fpdf) GetCellMargin() float64 { + return f.cMargin +} + +// SetCellMargin sets the cell margin. This is the amount of space before and +// after the text within a cell that's left blank, and is in units passed to +// New(). +func (f *Fpdf) SetCellMargin(margin float64) { + f.cMargin = margin +} + +// SetPageBoxRec sets the page box for the current page, and any following +// pages. Allowable types are trim, trimbox, crop, cropbox, bleed, bleedbox, +// art and artbox box types are case insensitive. See SetPageBox() for a method +// that specifies the coordinates and extent of the page box individually. +func (f *Fpdf) SetPageBoxRec(t string, pb PageBox) { + switch strings.ToLower(t) { + case "trim": + fallthrough + case "trimbox": + t = "TrimBox" + case "crop": + fallthrough + case "cropbox": + t = "CropBox" + case "bleed": + fallthrough + case "bleedbox": + t = "BleedBox" + case "art": + fallthrough + case "artbox": + t = "ArtBox" + default: + f.err = fmt.Errorf("%s is not a valid page box type", t) + return + } + + pb.X = pb.X * f.k + pb.Y = pb.Y * f.k + pb.Wd = (pb.Wd * f.k) + pb.X + pb.Ht = (pb.Ht * f.k) + pb.Y + + if f.page > 0 { + f.pageBoxes[f.page][t] = pb + } + + // always override. page defaults are supplied in addPage function + f.defPageBoxes[t] = pb +} + +// SetPageBox sets the page box for the current page, and any following pages. +// Allowable types are trim, trimbox, crop, cropbox, bleed, bleedbox, art and +// artbox box types are case insensitive. +func (f *Fpdf) SetPageBox(t string, x, y, wd, ht float64) { + f.SetPageBoxRec(t, PageBox{SizeType{Wd: wd, Ht: ht}, PointType{X: x, Y: y}}) +} + +// SetPage sets the current page to that of a valid page in the PDF document. +// pageNum is one-based. The SetPage() example demonstrates this method. +func (f *Fpdf) SetPage(pageNum int) { + if (pageNum > 0) && (pageNum < len(f.pages)) { + f.page = pageNum + } +} + +// PageCount returns the number of pages currently in the document. Since page +// numbers in gofpdf are one-based, the page count is the same as the page +// number of the current last page. +func (f *Fpdf) PageCount() int { + return len(f.pages) - 1 +} + +// SetFontLocation sets the location in the file system of the font and font +// definition files. +func (f *Fpdf) SetFontLocation(fontDirStr string) { + f.fontpath = fontDirStr +} + +// SetFontLoader sets a loader used to read font files (.json and .z) from an +// arbitrary source. If a font loader has been specified, it is used to load +// the named font resources when AddFont() is called. If this operation fails, +// an attempt is made to load the resources from the configured font directory +// (see SetFontLocation()). +func (f *Fpdf) SetFontLoader(loader FontLoader) { + f.fontLoader = loader +} + +// SetHeaderFuncMode sets the function that lets the application render the +// page header. See SetHeaderFunc() for more details. The value for homeMode +// should be set to true to have the current position set to the left and top +// margin after the header function is called. +func (f *Fpdf) SetHeaderFuncMode(fnc func(), homeMode bool) { + f.headerFnc = fnc + f.headerHomeMode = homeMode +} + +// SetHeaderFunc sets the function that lets the application render the page +// header. The specified function is automatically called by AddPage() and +// should not be called directly by the application. The implementation in Fpdf +// is empty, so you have to provide an appropriate function if you want page +// headers. fnc will typically be a closure that has access to the Fpdf +// instance and other document generation variables. +// +// A header is a convenient place to put background content that repeats on +// each page such as a watermark. When this is done, remember to reset the X +// and Y values so the normal content begins where expected. Including a +// watermark on each page is demonstrated in the example for TransformRotate. +// +// This method is demonstrated in the example for AddPage(). +func (f *Fpdf) SetHeaderFunc(fnc func()) { + f.headerFnc = fnc +} + +// SetFooterFunc sets the function that lets the application render the page +// footer. The specified function is automatically called by AddPage() and +// Close() and should not be called directly by the application. The +// implementation in Fpdf is empty, so you have to provide an appropriate +// function if you want page footers. fnc will typically be a closure that has +// access to the Fpdf instance and other document generation variables. See +// SetFooterFuncLpi for a similar function that passes a last page indicator. +// +// This method is demonstrated in the example for AddPage(). +func (f *Fpdf) SetFooterFunc(fnc func()) { + f.footerFnc = fnc + f.footerFncLpi = nil +} + +// SetFooterFuncLpi sets the function that lets the application render the page +// footer. The specified function is automatically called by AddPage() and +// Close() and should not be called directly by the application. It is passed a +// boolean that is true if the last page of the document is being rendered. The +// implementation in Fpdf is empty, so you have to provide an appropriate +// function if you want page footers. fnc will typically be a closure that has +// access to the Fpdf instance and other document generation variables. +func (f *Fpdf) SetFooterFuncLpi(fnc func(lastPage bool)) { + f.footerFncLpi = fnc + f.footerFnc = nil +} + +// SetTopMargin defines the top margin. The method can be called before +// creating the first page. +func (f *Fpdf) SetTopMargin(margin float64) { + f.tMargin = margin +} + +// SetRightMargin defines the right margin. The method can be called before +// creating the first page. +func (f *Fpdf) SetRightMargin(margin float64) { + f.rMargin = margin +} + +// GetAutoPageBreak returns true if automatic pages breaks are enabled, false +// otherwise. This is followed by the triggering limit from the bottom of the +// page. This value applies only if automatic page breaks are enabled. +func (f *Fpdf) GetAutoPageBreak() (auto bool, margin float64) { + auto = f.autoPageBreak + margin = f.bMargin + return +} + +// SetAutoPageBreak enables or disables the automatic page breaking mode. When +// enabling, the second parameter is the distance from the bottom of the page +// that defines the triggering limit. By default, the mode is on and the margin +// is 2 cm. +func (f *Fpdf) SetAutoPageBreak(auto bool, margin float64) { + f.autoPageBreak = auto + f.bMargin = margin + f.pageBreakTrigger = f.h - margin +} + +// SetDisplayMode sets advisory display directives for the document viewer. +// Pages can be displayed entirely on screen, occupy the full width of the +// window, use real size, be scaled by a specific zooming factor or use viewer +// default (configured in the Preferences menu of Adobe Reader). The page +// layout can be specified so that pages are displayed individually or in +// pairs. +// +// zoomStr can be "fullpage" to display the entire page on screen, "fullwidth" +// to use maximum width of window, "real" to use real size (equivalent to 100% +// zoom) or "default" to use viewer default mode. +// +// layoutStr can be "single" (or "SinglePage") to display one page at once, +// "continuous" (or "OneColumn") to display pages continuously, "two" (or +// "TwoColumnLeft") to display two pages on two columns with odd-numbered pages +// on the left, or "TwoColumnRight" to display two pages on two columns with +// odd-numbered pages on the right, or "TwoPageLeft" to display pages two at a +// time with odd-numbered pages on the left, or "TwoPageRight" to display pages +// two at a time with odd-numbered pages on the right, or "default" to use +// viewer default mode. +func (f *Fpdf) SetDisplayMode(zoomStr, layoutStr string) { + if f.err != nil { + return + } + if layoutStr == "" { + layoutStr = "default" + } + switch zoomStr { + case "fullpage", "fullwidth", "real", "default": + f.zoomMode = zoomStr + default: + f.err = fmt.Errorf("incorrect zoom display mode: %s", zoomStr) + return + } + switch layoutStr { + case "single", "continuous", "two", "default", "SinglePage", "OneColumn", + "TwoColumnLeft", "TwoColumnRight", "TwoPageLeft", "TwoPageRight": + f.layoutMode = layoutStr + default: + f.err = fmt.Errorf("incorrect layout display mode: %s", layoutStr) + return + } +} + +// SetDefaultCompression controls the default setting of the internal +// compression flag. See SetCompression() for more details. Compression is on +// by default. +func SetDefaultCompression(compress bool) { + gl.noCompress = !compress +} + +// SetCompression activates or deactivates page compression with zlib. When +// activated, the internal representation of each page is compressed, which +// leads to a compression ratio of about 2 for the resulting document. +// Compression is on by default. +func (f *Fpdf) SetCompression(compress bool) { + f.compress = compress +} + +// SetProducer defines the producer of the document. isUTF8 indicates if the string +// is encoded in ISO-8859-1 (false) or UTF-8 (true). +func (f *Fpdf) SetProducer(producerStr string, isUTF8 bool) { + if isUTF8 { + producerStr = utf8toutf16(producerStr) + } + f.producer = producerStr +} + +// SetTitle defines the title of the document. isUTF8 indicates if the string +// is encoded in ISO-8859-1 (false) or UTF-8 (true). +func (f *Fpdf) SetTitle(titleStr string, isUTF8 bool) { + if isUTF8 { + titleStr = utf8toutf16(titleStr) + } + f.title = titleStr +} + +// SetSubject defines the subject of the document. isUTF8 indicates if the +// string is encoded in ISO-8859-1 (false) or UTF-8 (true). +func (f *Fpdf) SetSubject(subjectStr string, isUTF8 bool) { + if isUTF8 { + subjectStr = utf8toutf16(subjectStr) + } + f.subject = subjectStr +} + +// SetAuthor defines the author of the document. isUTF8 indicates if the string +// is encoded in ISO-8859-1 (false) or UTF-8 (true). +func (f *Fpdf) SetAuthor(authorStr string, isUTF8 bool) { + if isUTF8 { + authorStr = utf8toutf16(authorStr) + } + f.author = authorStr +} + +// SetKeywords defines the keywords of the document. keywordStr is a +// space-delimited string, for example "invoice August". isUTF8 indicates if +// the string is encoded +func (f *Fpdf) SetKeywords(keywordsStr string, isUTF8 bool) { + if isUTF8 { + keywordsStr = utf8toutf16(keywordsStr) + } + f.keywords = keywordsStr +} + +// SetCreator defines the creator of the document. isUTF8 indicates if the +// string is encoded in ISO-8859-1 (false) or UTF-8 (true). +func (f *Fpdf) SetCreator(creatorStr string, isUTF8 bool) { + if isUTF8 { + creatorStr = utf8toutf16(creatorStr) + } + f.creator = creatorStr +} + +// SetXmpMetadata defines XMP metadata that will be embedded with the document. +func (f *Fpdf) SetXmpMetadata(xmpStream []byte) { + f.xmp = xmpStream +} + +// AliasNbPages defines an alias for the total number of pages. It will be +// substituted as the document is closed. An empty string is replaced with the +// string "{nb}". +// +// See the example for AddPage() for a demonstration of this method. +func (f *Fpdf) AliasNbPages(aliasStr string) { + if aliasStr == "" { + aliasStr = "{nb}" + } + f.aliasNbPagesStr = aliasStr +} + +// RTL enables right-to-left mode +func (f *Fpdf) RTL() { + f.isRTL = true +} + +// LTR disables right-to-left mode +func (f *Fpdf) LTR() { + f.isRTL = false +} + +// open begins a document +func (f *Fpdf) open() { + f.state = 1 +} + +// Close terminates the PDF document. It is not necessary to call this method +// explicitly because Output(), OutputAndClose() and OutputFileAndClose() do it +// automatically. If the document contains no page, AddPage() is called to +// prevent the generation of an invalid document. +func (f *Fpdf) Close() { + if f.err == nil { + if f.clipNest > 0 { + f.err = fmt.Errorf("clip procedure must be explicitly ended") + } else if f.transformNest > 0 { + f.err = fmt.Errorf("transformation procedure must be explicitly ended") + } + } + if f.err != nil { + return + } + if f.state == 3 { + return + } + if f.page == 0 { + f.AddPage() + if f.err != nil { + return + } + } + // Page footer + f.inFooter = true + if f.footerFnc != nil { + f.footerFnc() + } else if f.footerFncLpi != nil { + f.footerFncLpi(true) + } + f.inFooter = false + + // Close page + f.endpage() + // Close document + f.enddoc() + return +} + +// PageSize returns the width and height of the specified page in the units +// established in New(). These return values are followed by the unit of +// measure itself. If pageNum is zero or otherwise out of bounds, it returns +// the default page size, that is, the size of the page that would be added by +// AddPage(). +func (f *Fpdf) PageSize(pageNum int) (wd, ht float64, unitStr string) { + sz, ok := f.pageSizes[pageNum] + if ok { + sz.Wd, sz.Ht = sz.Wd/f.k, sz.Ht/f.k + } else { + sz = f.defPageSize // user units + } + return sz.Wd, sz.Ht, f.unitStr +} + +// AddPageFormat adds a new page with non-default orientation or size. See +// AddPage() for more details. +// +// See New() for a description of orientationStr. +// +// size specifies the size of the new page in the units established in New(). +// +// The PageSize() example demonstrates this method. +func (f *Fpdf) AddPageFormat(orientationStr string, size SizeType) { + if f.err != nil { + return + } + if f.page != len(f.pages)-1 { + f.page = len(f.pages) - 1 + } + if f.state == 0 { + f.open() + } + familyStr := f.fontFamily + style := f.fontStyle + if f.underline { + style += "U" + } + if f.strikeout { + style += "S" + } + fontsize := f.fontSizePt + lw := f.lineWidth + dc := f.color.draw + fc := f.color.fill + tc := f.color.text + cf := f.colorFlag + + if f.page > 0 { + f.inFooter = true + // Page footer avoid double call on footer. + if f.footerFnc != nil { + f.footerFnc() + + } else if f.footerFncLpi != nil { + f.footerFncLpi(false) // not last page. + } + f.inFooter = false + // Close page + f.endpage() + } + // Start new page + f.beginpage(orientationStr, size) + // Set line cap style to current value + // f.out("2 J") + f.outf("%d J", f.capStyle) + // Set line join style to current value + f.outf("%d j", f.joinStyle) + // Set line width + f.lineWidth = lw + f.outf("%.2f w", lw*f.k) + // Set dash pattern + if len(f.dashArray) > 0 { + f.outputDashPattern() + } + // Set font + if familyStr != "" { + f.SetFont(familyStr, style, fontsize) + if f.err != nil { + return + } + } + // Set colors + f.color.draw = dc + if dc.str != "0 G" { + f.out(dc.str) + } + f.color.fill = fc + if fc.str != "0 g" { + f.out(fc.str) + } + f.color.text = tc + f.colorFlag = cf + // Page header + if f.headerFnc != nil { + f.inHeader = true + f.headerFnc() + f.inHeader = false + if f.headerHomeMode { + f.SetHomeXY() + } + } + // Restore line width + if f.lineWidth != lw { + f.lineWidth = lw + f.outf("%.2f w", lw*f.k) + } + // Restore font + if familyStr != "" { + f.SetFont(familyStr, style, fontsize) + if f.err != nil { + return + } + } + // Restore colors + if f.color.draw.str != dc.str { + f.color.draw = dc + f.out(dc.str) + } + if f.color.fill.str != fc.str { + f.color.fill = fc + f.out(fc.str) + } + f.color.text = tc + f.colorFlag = cf + return +} + +// AddPage adds a new page to the document. If a page is already present, the +// Footer() method is called first to output the footer. Then the page is +// added, the current position set to the top-left corner according to the left +// and top margins, and Header() is called to display the header. +// +// The font which was set before calling is automatically restored. There is no +// need to call SetFont() again if you want to continue with the same font. The +// same is true for colors and line width. +// +// The origin of the coordinate system is at the top-left corner and increasing +// ordinates go downwards. +// +// See AddPageFormat() for a version of this method that allows the page size +// and orientation to be different than the default. +func (f *Fpdf) AddPage() { + if f.err != nil { + return + } + // dbg("AddPage") + f.AddPageFormat(f.defOrientation, f.defPageSize) + return +} + +// PageNo returns the current page number. +// +// See the example for AddPage() for a demonstration of this method. +func (f *Fpdf) PageNo() int { + return f.page +} + +func colorComp(v int) (int, float64) { + if v < 0 { + v = 0 + } else if v > 255 { + v = 255 + } + return v, float64(v) / 255.0 +} + +func rgbColorValue(r, g, b int, grayStr, fullStr string) (clr colorType) { + clr.ir, clr.r = colorComp(r) + clr.ig, clr.g = colorComp(g) + clr.ib, clr.b = colorComp(b) + clr.mode = colorModeRGB + clr.gray = clr.ir == clr.ig && clr.r == clr.b + if len(grayStr) > 0 { + if clr.gray { + clr.str = sprintf("%.3f %s", clr.r, grayStr) + } else { + clr.str = sprintf("%.3f %.3f %.3f %s", clr.r, clr.g, clr.b, fullStr) + } + } else { + clr.str = sprintf("%.3f %.3f %.3f", clr.r, clr.g, clr.b) + } + return +} + +// SetDrawColor defines the color used for all drawing operations (lines, +// rectangles and cell borders). It is expressed in RGB components (0 - 255). +// The method can be called before the first page is created. The value is +// retained from page to page. +func (f *Fpdf) SetDrawColor(r, g, b int) { + f.setDrawColor(r, g, b) +} + +func (f *Fpdf) setDrawColor(r, g, b int) { + f.color.draw = rgbColorValue(r, g, b, "G", "RG") + if f.page > 0 { + f.out(f.color.draw.str) + } +} + +// GetDrawColor returns the most recently set draw color as RGB components (0 - +// 255). This will not be the current value if a draw color of some other type +// (for example, spot) has been more recently set. +func (f *Fpdf) GetDrawColor() (int, int, int) { + return f.color.draw.ir, f.color.draw.ig, f.color.draw.ib +} + +// SetFillColor defines the color used for all filling operations (filled +// rectangles and cell backgrounds). It is expressed in RGB components (0 +// -255). The method can be called before the first page is created and the +// value is retained from page to page. +func (f *Fpdf) SetFillColor(r, g, b int) { + f.setFillColor(r, g, b) +} + +func (f *Fpdf) setFillColor(r, g, b int) { + f.color.fill = rgbColorValue(r, g, b, "g", "rg") + f.colorFlag = f.color.fill.str != f.color.text.str + if f.page > 0 { + f.out(f.color.fill.str) + } +} + +// GetFillColor returns the most recently set fill color as RGB components (0 - +// 255). This will not be the current value if a fill color of some other type +// (for example, spot) has been more recently set. +func (f *Fpdf) GetFillColor() (int, int, int) { + return f.color.fill.ir, f.color.fill.ig, f.color.fill.ib +} + +// SetTextColor defines the color used for text. It is expressed in RGB +// components (0 - 255). The method can be called before the first page is +// created. The value is retained from page to page. +func (f *Fpdf) SetTextColor(r, g, b int) { + f.setTextColor(r, g, b) +} + +func (f *Fpdf) setTextColor(r, g, b int) { + f.color.text = rgbColorValue(r, g, b, "g", "rg") + f.colorFlag = f.color.fill.str != f.color.text.str +} + +// GetTextColor returns the most recently set text color as RGB components (0 - +// 255). This will not be the current value if a text color of some other type +// (for example, spot) has been more recently set. +func (f *Fpdf) GetTextColor() (int, int, int) { + return f.color.text.ir, f.color.text.ig, f.color.text.ib +} + +// GetStringWidth returns the length of a string in user units. A font must be +// currently selected. +func (f *Fpdf) GetStringWidth(s string) float64 { + if f.err != nil { + return 0 + } + w := f.GetStringSymbolWidth(s) + return float64(w) * f.fontSize / 1000 +} + +// GetStringSymbolWidth returns the length of a string in glyf units. A font must be +// currently selected. +func (f *Fpdf) GetStringSymbolWidth(s string) int { + if f.err != nil { + return 0 + } + w := 0 + if f.isCurrentUTF8 { + unicode := []rune(s) + for _, char := range unicode { + intChar := int(char) + if len(f.currentFont.Cw) >= intChar && f.currentFont.Cw[intChar] > 0 { + if f.currentFont.Cw[intChar] != 65535 { + w += f.currentFont.Cw[intChar] + } + } else if f.currentFont.Desc.MissingWidth != 0 { + w += f.currentFont.Desc.MissingWidth + } else { + w += 500 + } + } + } else { + for _, ch := range []byte(s) { + if ch == 0 { + break + } + w += f.currentFont.Cw[ch] + } + } + return w +} + +// SetLineWidth defines the line width. By default, the value equals 0.2 mm. +// The method can be called before the first page is created. The value is +// retained from page to page. +func (f *Fpdf) SetLineWidth(width float64) { + f.setLineWidth(width) +} + +func (f *Fpdf) setLineWidth(width float64) { + f.lineWidth = width + if f.page > 0 { + f.outf("%.2f w", width*f.k) + } +} + +// GetLineWidth returns the current line thickness. +func (f *Fpdf) GetLineWidth() float64 { + return f.lineWidth +} + +// SetLineCapStyle defines the line cap style. styleStr should be "butt", +// "round" or "square". A square style projects from the end of the line. The +// method can be called before the first page is created. The value is +// retained from page to page. +func (f *Fpdf) SetLineCapStyle(styleStr string) { + var capStyle int + switch styleStr { + case "round": + capStyle = 1 + case "square": + capStyle = 2 + default: + capStyle = 0 + } + f.capStyle = capStyle + if f.page > 0 { + f.outf("%d J", f.capStyle) + } +} + +// SetLineJoinStyle defines the line cap style. styleStr should be "miter", +// "round" or "bevel". The method can be called before the first page +// is created. The value is retained from page to page. +func (f *Fpdf) SetLineJoinStyle(styleStr string) { + var joinStyle int + switch styleStr { + case "round": + joinStyle = 1 + case "bevel": + joinStyle = 2 + default: + joinStyle = 0 + } + f.joinStyle = joinStyle + if f.page > 0 { + f.outf("%d j", f.joinStyle) + } +} + +// SetDashPattern sets the dash pattern that is used to draw lines. The +// dashArray elements are numbers that specify the lengths, in units +// established in New(), of alternating dashes and gaps. The dash phase +// specifies the distance into the dash pattern at which to start the dash. The +// dash pattern is retained from page to page. Call this method with an empty +// array to restore solid line drawing. +// +// The Beziergon() example demonstrates this method. +func (f *Fpdf) SetDashPattern(dashArray []float64, dashPhase float64) { + scaled := make([]float64, len(dashArray)) + for i, value := range dashArray { + scaled[i] = value * f.k + } + dashPhase *= f.k + + f.dashArray = scaled + f.dashPhase = dashPhase + if f.page > 0 { + f.outputDashPattern() + } + +} + +func (f *Fpdf) outputDashPattern() { + var buf bytes.Buffer + buf.WriteByte('[') + for i, value := range f.dashArray { + if i > 0 { + buf.WriteByte(' ') + } + buf.WriteString(strconv.FormatFloat(value, 'f', 2, 64)) + } + buf.WriteString("] ") + buf.WriteString(strconv.FormatFloat(f.dashPhase, 'f', 2, 64)) + buf.WriteString(" d") + f.outbuf(&buf) +} + +// Line draws a line between points (x1, y1) and (x2, y2) using the current +// draw color, line width and cap style. +func (f *Fpdf) Line(x1, y1, x2, y2 float64) { + f.outf("%.2f %.2f m %.2f %.2f l S", x1*f.k, (f.h-y1)*f.k, x2*f.k, (f.h-y2)*f.k) +} + +// fillDrawOp corrects path painting operators +func fillDrawOp(styleStr string) (opStr string) { + switch strings.ToUpper(styleStr) { + case "", "D": + // Stroke the path. + opStr = "S" + case "F": + // fill the path, using the nonzero winding number rule + opStr = "f" + case "F*": + // fill the path, using the even-odd rule + opStr = "f*" + case "FD", "DF": + // fill and then stroke the path, using the nonzero winding number rule + opStr = "B" + case "FD*", "DF*": + // fill and then stroke the path, using the even-odd rule + opStr = "B*" + default: + opStr = styleStr + } + return +} + +// Rect outputs a rectangle of width w and height h with the upper left corner +// positioned at point (x, y). +// +// It can be drawn (border only), filled (with no border) or both. styleStr can +// be "F" for filled, "D" for outlined only, or "DF" or "FD" for outlined and +// filled. An empty string will be replaced with "D". Drawing uses the current +// draw color and line width centered on the rectangle's perimeter. Filling +// uses the current fill color. +func (f *Fpdf) Rect(x, y, w, h float64, styleStr string) { + f.outf("%.2f %.2f %.2f %.2f re %s", x*f.k, (f.h-y)*f.k, w*f.k, -h*f.k, fillDrawOp(styleStr)) +} + +// RoundedRect outputs a rectangle of width w and height h with the upper left +// corner positioned at point (x, y). It can be drawn (border only), filled +// (with no border) or both. styleStr can be "F" for filled, "D" for outlined +// only, or "DF" or "FD" for outlined and filled. An empty string will be +// replaced with "D". Drawing uses the current draw color and line width +// centered on the rectangle's perimeter. Filling uses the current fill color. +// The rounded corners of the rectangle are specified by radius r. corners is a +// string that includes "1" to round the upper left corner, "2" to round the +// upper right corner, "3" to round the lower right corner, and "4" to round +// the lower left corner. The RoundedRect example demonstrates this method. +func (f *Fpdf) RoundedRect(x, y, w, h, r float64, corners string, stylestr string) { + // This routine was adapted by Brigham Thompson from a script by Christophe Prugnaud + var rTL, rTR, rBR, rBL float64 // zero means no rounded corner + if strings.Contains(corners, "1") { + rTL = r + } + if strings.Contains(corners, "2") { + rTR = r + } + if strings.Contains(corners, "3") { + rBR = r + } + if strings.Contains(corners, "4") { + rBL = r + } + f.RoundedRectExt(x, y, w, h, rTL, rTR, rBR, rBL, stylestr) +} + +// RoundedRectExt behaves the same as RoundedRect() but supports a different +// radius for each corner. A zero radius means squared corner. See +// RoundedRect() for more details. This method is demonstrated in the +// RoundedRect() example. +func (f *Fpdf) RoundedRectExt(x, y, w, h, rTL, rTR, rBR, rBL float64, stylestr string) { + f.roundedRectPath(x, y, w, h, rTL, rTR, rBR, rBL) + f.out(fillDrawOp(stylestr)) +} + +// Circle draws a circle centered on point (x, y) with radius r. +// +// styleStr can be "F" for filled, "D" for outlined only, or "DF" or "FD" for +// outlined and filled. An empty string will be replaced with "D". Drawing uses +// the current draw color and line width centered on the circle's perimeter. +// Filling uses the current fill color. +func (f *Fpdf) Circle(x, y, r float64, styleStr string) { + f.Ellipse(x, y, r, r, 0, styleStr) +} + +// Ellipse draws an ellipse centered at point (x, y). rx and ry specify its +// horizontal and vertical radii. +// +// degRotate specifies the counter-clockwise angle in degrees that the ellipse +// will be rotated. +// +// styleStr can be "F" for filled, "D" for outlined only, or "DF" or "FD" for +// outlined and filled. An empty string will be replaced with "D". Drawing uses +// the current draw color and line width centered on the ellipse's perimeter. +// Filling uses the current fill color. +// +// The Circle() example demonstrates this method. +func (f *Fpdf) Ellipse(x, y, rx, ry, degRotate float64, styleStr string) { + f.arc(x, y, rx, ry, degRotate, 0, 360, styleStr, false) +} + +// Polygon draws a closed figure defined by a series of vertices specified by +// points. The x and y fields of the points use the units established in New(). +// The last point in the slice will be implicitly joined to the first to close +// the polygon. +// +// styleStr can be "F" for filled, "D" for outlined only, or "DF" or "FD" for +// outlined and filled. An empty string will be replaced with "D". Drawing uses +// the current draw color and line width centered on the ellipse's perimeter. +// Filling uses the current fill color. +func (f *Fpdf) Polygon(points []PointType, styleStr string) { + if len(points) > 2 { + for j, pt := range points { + if j == 0 { + f.point(pt.X, pt.Y) + } else { + f.outf("%.5f %.5f l ", pt.X*f.k, (f.h-pt.Y)*f.k) + } + } + f.outf("%.5f %.5f l ", points[0].X*f.k, (f.h-points[0].Y)*f.k) + f.DrawPath(styleStr) + } +} + +// Beziergon draws a closed figure defined by a series of cubic Bézier curve +// segments. The first point in the slice defines the starting point of the +// figure. Each three following points p1, p2, p3 represent a curve segment to +// the point p3 using p1 and p2 as the Bézier control points. +// +// The x and y fields of the points use the units established in New(). +// +// styleStr can be "F" for filled, "D" for outlined only, or "DF" or "FD" for +// outlined and filled. An empty string will be replaced with "D". Drawing uses +// the current draw color and line width centered on the ellipse's perimeter. +// Filling uses the current fill color. +func (f *Fpdf) Beziergon(points []PointType, styleStr string) { + + // Thanks, Robert Lillack, for contributing this function. + + if len(points) < 4 { + return + } + f.point(points[0].XY()) + + points = points[1:] + for len(points) >= 3 { + cx0, cy0 := points[0].XY() + cx1, cy1 := points[1].XY() + x1, y1 := points[2].XY() + f.curve(cx0, cy0, cx1, cy1, x1, y1) + points = points[3:] + } + + f.DrawPath(styleStr) +} + +// point outputs current point +func (f *Fpdf) point(x, y float64) { + f.outf("%.2f %.2f m", x*f.k, (f.h-y)*f.k) +} + +// curve outputs a single cubic Bézier curve segment from current point +func (f *Fpdf) curve(cx0, cy0, cx1, cy1, x, y float64) { + // Thanks, Robert Lillack, for straightening this out + f.outf("%.5f %.5f %.5f %.5f %.5f %.5f c", cx0*f.k, (f.h-cy0)*f.k, cx1*f.k, + (f.h-cy1)*f.k, x*f.k, (f.h-y)*f.k) +} + +// Curve draws a single-segment quadratic Bézier curve. The curve starts at +// the point (x0, y0) and ends at the point (x1, y1). The control point (cx, +// cy) specifies the curvature. At the start point, the curve is tangent to the +// straight line between the start point and the control point. At the end +// point, the curve is tangent to the straight line between the end point and +// the control point. +// +// styleStr can be "F" for filled, "D" for outlined only, or "DF" or "FD" for +// outlined and filled. An empty string will be replaced with "D". Drawing uses +// the current draw color, line width, and cap style centered on the curve's +// path. Filling uses the current fill color. +// +// The Circle() example demonstrates this method. +func (f *Fpdf) Curve(x0, y0, cx, cy, x1, y1 float64, styleStr string) { + f.point(x0, y0) + f.outf("%.5f %.5f %.5f %.5f v %s", cx*f.k, (f.h-cy)*f.k, x1*f.k, (f.h-y1)*f.k, + fillDrawOp(styleStr)) +} + +// CurveCubic draws a single-segment cubic Bézier curve. This routine performs +// the same function as CurveBezierCubic() but has a nonstandard argument order. +// It is retained to preserve backward compatibility. +func (f *Fpdf) CurveCubic(x0, y0, cx0, cy0, x1, y1, cx1, cy1 float64, styleStr string) { + // f.point(x0, y0) + // f.outf("%.5f %.5f %.5f %.5f %.5f %.5f c %s", cx0*f.k, (f.h-cy0)*f.k, + // cx1*f.k, (f.h-cy1)*f.k, x1*f.k, (f.h-y1)*f.k, fillDrawOp(styleStr)) + f.CurveBezierCubic(x0, y0, cx0, cy0, cx1, cy1, x1, y1, styleStr) +} + +// CurveBezierCubic draws a single-segment cubic Bézier curve. The curve starts at +// the point (x0, y0) and ends at the point (x1, y1). The control points (cx0, +// cy0) and (cx1, cy1) specify the curvature. At the start point, the curve is +// tangent to the straight line between the start point and the control point +// (cx0, cy0). At the end point, the curve is tangent to the straight line +// between the end point and the control point (cx1, cy1). +// +// styleStr can be "F" for filled, "D" for outlined only, or "DF" or "FD" for +// outlined and filled. An empty string will be replaced with "D". Drawing uses +// the current draw color, line width, and cap style centered on the curve's +// path. Filling uses the current fill color. +// +// This routine performs the same function as CurveCubic() but uses standard +// argument order. +// +// The Circle() example demonstrates this method. +func (f *Fpdf) CurveBezierCubic(x0, y0, cx0, cy0, cx1, cy1, x1, y1 float64, styleStr string) { + f.point(x0, y0) + f.outf("%.5f %.5f %.5f %.5f %.5f %.5f c %s", cx0*f.k, (f.h-cy0)*f.k, + cx1*f.k, (f.h-cy1)*f.k, x1*f.k, (f.h-y1)*f.k, fillDrawOp(styleStr)) +} + +// Arc draws an elliptical arc centered at point (x, y). rx and ry specify its +// horizontal and vertical radii. +// +// degRotate specifies the angle that the arc will be rotated. degStart and +// degEnd specify the starting and ending angle of the arc. All angles are +// specified in degrees and measured counter-clockwise from the 3 o'clock +// position. +// +// styleStr can be "F" for filled, "D" for outlined only, or "DF" or "FD" for +// outlined and filled. An empty string will be replaced with "D". Drawing uses +// the current draw color, line width, and cap style centered on the arc's +// path. Filling uses the current fill color. +// +// The Circle() example demonstrates this method. +func (f *Fpdf) Arc(x, y, rx, ry, degRotate, degStart, degEnd float64, styleStr string) { + f.arc(x, y, rx, ry, degRotate, degStart, degEnd, styleStr, false) +} + +// GetAlpha returns the alpha blending channel, which consists of the +// alpha transparency value and the blend mode. See SetAlpha for more +// details. +func (f *Fpdf) GetAlpha() (alpha float64, blendModeStr string) { + return f.alpha, f.blendMode +} + +// SetAlpha sets the alpha blending channel. The blending effect applies to +// text, drawings and images. +// +// alpha must be a value between 0.0 (fully transparent) to 1.0 (fully opaque). +// Values outside of this range result in an error. +// +// blendModeStr must be one of "Normal", "Multiply", "Screen", "Overlay", +// "Darken", "Lighten", "ColorDodge", "ColorBurn","HardLight", "SoftLight", +// "Difference", "Exclusion", "Hue", "Saturation", "Color", or "Luminosity". An +// empty string is replaced with "Normal". +// +// To reset normal rendering after applying a blending mode, call this method +// with alpha set to 1.0 and blendModeStr set to "Normal". +func (f *Fpdf) SetAlpha(alpha float64, blendModeStr string) { + if f.err != nil { + return + } + var bl blendModeType + switch blendModeStr { + case "Normal", "Multiply", "Screen", "Overlay", + "Darken", "Lighten", "ColorDodge", "ColorBurn", "HardLight", "SoftLight", + "Difference", "Exclusion", "Hue", "Saturation", "Color", "Luminosity": + bl.modeStr = blendModeStr + case "": + bl.modeStr = "Normal" + default: + f.err = fmt.Errorf("unrecognized blend mode \"%s\"", blendModeStr) + return + } + if alpha < 0.0 || alpha > 1.0 { + f.err = fmt.Errorf("alpha value (0.0 - 1.0) is out of range: %.3f", alpha) + return + } + f.alpha = alpha + f.blendMode = blendModeStr + alphaStr := sprintf("%.3f", alpha) + keyStr := sprintf("%s %s", alphaStr, blendModeStr) + pos, ok := f.blendMap[keyStr] + if !ok { + pos = len(f.blendList) // at least 1 + f.blendList = append(f.blendList, blendModeType{alphaStr, alphaStr, blendModeStr, 0}) + f.blendMap[keyStr] = pos + } + f.outf("/GS%d gs", pos) +} + +func (f *Fpdf) gradientClipStart(x, y, w, h float64) { + // Save current graphic state and set clipping area + f.outf("q %.2f %.2f %.2f %.2f re W n", x*f.k, (f.h-y)*f.k, w*f.k, -h*f.k) + // Set up transformation matrix for gradient + f.outf("%.5f 0 0 %.5f %.5f %.5f cm", w*f.k, h*f.k, x*f.k, (f.h-(y+h))*f.k) +} + +func (f *Fpdf) gradientClipEnd() { + // Restore previous graphic state + f.out("Q") +} + +func (f *Fpdf) gradient(tp, r1, g1, b1, r2, g2, b2 int, x1, y1, x2, y2, r float64) { + pos := len(f.gradientList) + clr1 := rgbColorValue(r1, g1, b1, "", "") + clr2 := rgbColorValue(r2, g2, b2, "", "") + f.gradientList = append(f.gradientList, gradientType{tp, clr1.str, clr2.str, + x1, y1, x2, y2, r, 0}) + f.outf("/Sh%d sh", pos) +} + +// LinearGradient draws a rectangular area with a blending of one color to +// another. The rectangle is of width w and height h. Its upper left corner is +// positioned at point (x, y). +// +// Each color is specified with three component values, one each for red, green +// and blue. The values range from 0 to 255. The first color is specified by +// (r1, g1, b1) and the second color by (r2, g2, b2). +// +// The blending is controlled with a gradient vector that uses normalized +// coordinates in which the lower left corner is position (0, 0) and the upper +// right corner is (1, 1). The vector's origin and destination are specified by +// the points (x1, y1) and (x2, y2). In a linear gradient, blending occurs +// perpendicularly to the vector. The vector does not necessarily need to be +// anchored on the rectangle edge. Color 1 is used up to the origin of the +// vector and color 2 is used beyond the vector's end point. Between the points +// the colors are gradually blended. +func (f *Fpdf) LinearGradient(x, y, w, h float64, r1, g1, b1, r2, g2, b2 int, x1, y1, x2, y2 float64) { + f.gradientClipStart(x, y, w, h) + f.gradient(2, r1, g1, b1, r2, g2, b2, x1, y1, x2, y2, 0) + f.gradientClipEnd() +} + +// RadialGradient draws a rectangular area with a blending of one color to +// another. The rectangle is of width w and height h. Its upper left corner is +// positioned at point (x, y). +// +// Each color is specified with three component values, one each for red, green +// and blue. The values range from 0 to 255. The first color is specified by +// (r1, g1, b1) and the second color by (r2, g2, b2). +// +// The blending is controlled with a point and a circle, both specified with +// normalized coordinates in which the lower left corner of the rendered +// rectangle is position (0, 0) and the upper right corner is (1, 1). Color 1 +// begins at the origin point specified by (x1, y1). Color 2 begins at the +// circle specified by the center point (x2, y2) and radius r. Colors are +// gradually blended from the origin to the circle. The origin and the circle's +// center do not necessarily have to coincide, but the origin must be within +// the circle to avoid rendering problems. +// +// The LinearGradient() example demonstrates this method. +func (f *Fpdf) RadialGradient(x, y, w, h float64, r1, g1, b1, r2, g2, b2 int, x1, y1, x2, y2, r float64) { + f.gradientClipStart(x, y, w, h) + f.gradient(3, r1, g1, b1, r2, g2, b2, x1, y1, x2, y2, r) + f.gradientClipEnd() +} + +// ClipRect begins a rectangular clipping operation. The rectangle is of width +// w and height h. Its upper left corner is positioned at point (x, y). outline +// is true to draw a border with the current draw color and line width centered +// on the rectangle's perimeter. Only the outer half of the border will be +// shown. After calling this method, all rendering operations (for example, +// Image(), LinearGradient(), etc) will be clipped by the specified rectangle. +// Call ClipEnd() to restore unclipped operations. +// +// This ClipText() example demonstrates this method. +func (f *Fpdf) ClipRect(x, y, w, h float64, outline bool) { + f.clipNest++ + f.outf("q %.2f %.2f %.2f %.2f re W %s", x*f.k, (f.h-y)*f.k, w*f.k, -h*f.k, strIf(outline, "S", "n")) +} + +// ClipText begins a clipping operation in which rendering is confined to the +// character string specified by txtStr. The origin (x, y) is on the left of +// the first character at the baseline. The current font is used. outline is +// true to draw a border with the current draw color and line width centered on +// the perimeters of the text characters. Only the outer half of the border +// will be shown. After calling this method, all rendering operations (for +// example, Image(), LinearGradient(), etc) will be clipped. Call ClipEnd() to +// restore unclipped operations. +func (f *Fpdf) ClipText(x, y float64, txtStr string, outline bool) { + f.clipNest++ + f.outf("q BT %.5f %.5f Td %d Tr (%s) Tj ET", x*f.k, (f.h-y)*f.k, intIf(outline, 5, 7), f.escape(txtStr)) +} + +func (f *Fpdf) clipArc(x1, y1, x2, y2, x3, y3 float64) { + h := f.h + f.outf("%.5f %.5f %.5f %.5f %.5f %.5f c ", x1*f.k, (h-y1)*f.k, + x2*f.k, (h-y2)*f.k, x3*f.k, (h-y3)*f.k) +} + +// ClipRoundedRect begins a rectangular clipping operation. The rectangle is of +// width w and height h. Its upper left corner is positioned at point (x, y). +// The rounded corners of the rectangle are specified by radius r. outline is +// true to draw a border with the current draw color and line width centered on +// the rectangle's perimeter. Only the outer half of the border will be shown. +// After calling this method, all rendering operations (for example, Image(), +// LinearGradient(), etc) will be clipped by the specified rectangle. Call +// ClipEnd() to restore unclipped operations. +// +// This ClipText() example demonstrates this method. +func (f *Fpdf) ClipRoundedRect(x, y, w, h, r float64, outline bool) { + f.ClipRoundedRectExt(x, y, w, h, r, r, r, r, outline) +} + +// ClipRoundedRectExt behaves the same as ClipRoundedRect() but supports a +// different radius for each corner, given by rTL (top-left), rTR (top-right) +// rBR (bottom-right), rBL (bottom-left). See ClipRoundedRect() for more +// details. This method is demonstrated in the ClipText() example. +func (f *Fpdf) ClipRoundedRectExt(x, y, w, h, rTL, rTR, rBR, rBL float64, outline bool) { + f.clipNest++ + f.roundedRectPath(x, y, w, h, rTL, rTR, rBR, rBL) + f.outf(" W %s", strIf(outline, "S", "n")) +} + +// add a rectangle path with rounded corners. +// routine shared by RoundedRect() and ClipRoundedRect(), which add the +// drawing operation +func (f *Fpdf) roundedRectPath(x, y, w, h, rTL, rTR, rBR, rBL float64) { + k := f.k + hp := f.h + myArc := (4.0 / 3.0) * (math.Sqrt2 - 1.0) + f.outf("q %.5f %.5f m", (x+rTL)*k, (hp-y)*k) + xc := x + w - rTR + yc := y + rTR + f.outf("%.5f %.5f l", xc*k, (hp-y)*k) + if rTR != 0 { + f.clipArc(xc+rTR*myArc, yc-rTR, xc+rTR, yc-rTR*myArc, xc+rTR, yc) + } + xc = x + w - rBR + yc = y + h - rBR + f.outf("%.5f %.5f l", (x+w)*k, (hp-yc)*k) + if rBR != 0 { + f.clipArc(xc+rBR, yc+rBR*myArc, xc+rBR*myArc, yc+rBR, xc, yc+rBR) + } + xc = x + rBL + yc = y + h - rBL + f.outf("%.5f %.5f l", xc*k, (hp-(y+h))*k) + if rBL != 0 { + f.clipArc(xc-rBL*myArc, yc+rBL, xc-rBL, yc+rBL*myArc, xc-rBL, yc) + } + xc = x + rTL + yc = y + rTL + f.outf("%.5f %.5f l", x*k, (hp-yc)*k) + if rTL != 0 { + f.clipArc(xc-rTL, yc-rTL*myArc, xc-rTL*myArc, yc-rTL, xc, yc-rTL) + } +} + +// ClipEllipse begins an elliptical clipping operation. The ellipse is centered +// at (x, y). Its horizontal and vertical radii are specified by rx and ry. +// outline is true to draw a border with the current draw color and line width +// centered on the ellipse's perimeter. Only the outer half of the border will +// be shown. After calling this method, all rendering operations (for example, +// Image(), LinearGradient(), etc) will be clipped by the specified ellipse. +// Call ClipEnd() to restore unclipped operations. +// +// This ClipText() example demonstrates this method. +func (f *Fpdf) ClipEllipse(x, y, rx, ry float64, outline bool) { + f.clipNest++ + lx := (4.0 / 3.0) * rx * (math.Sqrt2 - 1) + ly := (4.0 / 3.0) * ry * (math.Sqrt2 - 1) + k := f.k + h := f.h + f.outf("q %.5f %.5f m %.5f %.5f %.5f %.5f %.5f %.5f c", + (x+rx)*k, (h-y)*k, + (x+rx)*k, (h-(y-ly))*k, + (x+lx)*k, (h-(y-ry))*k, + x*k, (h-(y-ry))*k) + f.outf("%.5f %.5f %.5f %.5f %.5f %.5f c", + (x-lx)*k, (h-(y-ry))*k, + (x-rx)*k, (h-(y-ly))*k, + (x-rx)*k, (h-y)*k) + f.outf("%.5f %.5f %.5f %.5f %.5f %.5f c", + (x-rx)*k, (h-(y+ly))*k, + (x-lx)*k, (h-(y+ry))*k, + x*k, (h-(y+ry))*k) + f.outf("%.5f %.5f %.5f %.5f %.5f %.5f c W %s", + (x+lx)*k, (h-(y+ry))*k, + (x+rx)*k, (h-(y+ly))*k, + (x+rx)*k, (h-y)*k, + strIf(outline, "S", "n")) +} + +// ClipCircle begins a circular clipping operation. The circle is centered at +// (x, y) and has radius r. outline is true to draw a border with the current +// draw color and line width centered on the circle's perimeter. Only the outer +// half of the border will be shown. After calling this method, all rendering +// operations (for example, Image(), LinearGradient(), etc) will be clipped by +// the specified circle. Call ClipEnd() to restore unclipped operations. +// +// The ClipText() example demonstrates this method. +func (f *Fpdf) ClipCircle(x, y, r float64, outline bool) { + f.ClipEllipse(x, y, r, r, outline) +} + +// ClipPolygon begins a clipping operation within a polygon. The figure is +// defined by a series of vertices specified by points. The x and y fields of +// the points use the units established in New(). The last point in the slice +// will be implicitly joined to the first to close the polygon. outline is true +// to draw a border with the current draw color and line width centered on the +// polygon's perimeter. Only the outer half of the border will be shown. After +// calling this method, all rendering operations (for example, Image(), +// LinearGradient(), etc) will be clipped by the specified polygon. Call +// ClipEnd() to restore unclipped operations. +// +// The ClipText() example demonstrates this method. +func (f *Fpdf) ClipPolygon(points []PointType, outline bool) { + f.clipNest++ + var s fmtBuffer + h := f.h + k := f.k + s.printf("q ") + for j, pt := range points { + s.printf("%.5f %.5f %s ", pt.X*k, (h-pt.Y)*k, strIf(j == 0, "m", "l")) + } + s.printf("h W %s", strIf(outline, "S", "n")) + f.out(s.String()) +} + +// ClipEnd ends a clipping operation that was started with a call to +// ClipRect(), ClipRoundedRect(), ClipText(), ClipEllipse(), ClipCircle() or +// ClipPolygon(). Clipping operations can be nested. The document cannot be +// successfully output while a clipping operation is active. +// +// The ClipText() example demonstrates this method. +func (f *Fpdf) ClipEnd() { + if f.err == nil { + if f.clipNest > 0 { + f.clipNest-- + f.out("Q") + } else { + f.err = fmt.Errorf("error attempting to end clip operation out of sequence") + } + } +} + +// AddFont imports a TrueType, OpenType or Type1 font and makes it available. +// It is necessary to generate a font definition file first with the makefont +// utility. It is not necessary to call this function for the core PDF fonts +// (courier, helvetica, times, zapfdingbats). +// +// The JSON definition file (and the font file itself when embedding) must be +// present in the font directory. If it is not found, the error "Could not +// include font definition file" is set. +// +// family specifies the font family. The name can be chosen arbitrarily. If it +// is a standard family name, it will override the corresponding font. This +// string is used to subsequently set the font with the SetFont method. +// +// style specifies the font style. Acceptable values are (case insensitive) the +// empty string for regular style, "B" for bold, "I" for italic, or "BI" or +// "IB" for bold and italic combined. +// +// fileStr specifies the base name with ".json" extension of the font +// definition file to be added. The file will be loaded from the font directory +// specified in the call to New() or SetFontLocation(). +func (f *Fpdf) AddFont(familyStr, styleStr, fileStr string) { + f.addFont(fontFamilyEscape(familyStr), styleStr, fileStr, false) +} + +// AddUTF8Font imports a TrueType font with utf-8 symbols and makes it available. +// It is necessary to generate a font definition file first with the makefont +// utility. It is not necessary to call this function for the core PDF fonts +// (courier, helvetica, times, zapfdingbats). +// +// The JSON definition file (and the font file itself when embedding) must be +// present in the font directory. If it is not found, the error "Could not +// include font definition file" is set. +// +// family specifies the font family. The name can be chosen arbitrarily. If it +// is a standard family name, it will override the corresponding font. This +// string is used to subsequently set the font with the SetFont method. +// +// style specifies the font style. Acceptable values are (case insensitive) the +// empty string for regular style, "B" for bold, "I" for italic, or "BI" or +// "IB" for bold and italic combined. +// +// fileStr specifies the base name with ".json" extension of the font +// definition file to be added. The file will be loaded from the font directory +// specified in the call to New() or SetFontLocation(). +func (f *Fpdf) AddUTF8Font(familyStr, styleStr, fileStr string) { + f.addFont(fontFamilyEscape(familyStr), styleStr, fileStr, true) +} + +func (f *Fpdf) addFont(familyStr, styleStr, fileStr string, isUTF8 bool) { + if fileStr == "" { + if isUTF8 { + fileStr = strings.Replace(familyStr, " ", "", -1) + strings.ToLower(styleStr) + ".ttf" + } else { + fileStr = strings.Replace(familyStr, " ", "", -1) + strings.ToLower(styleStr) + ".json" + } + } + if isUTF8 { + fontKey := getFontKey(familyStr, styleStr) + _, ok := f.fonts[fontKey] + if ok { + return + } + var ttfStat os.FileInfo + var err error + fileStr = path.Join(f.fontpath, fileStr) + ttfStat, err = os.Stat(fileStr) + if err != nil { + f.SetError(err) + return + } + originalSize := ttfStat.Size() + Type := "UTF8" + var utf8Bytes []byte + utf8Bytes, err = ioutil.ReadFile(fileStr) + if err != nil { + f.SetError(err) + return + } + reader := fileReader{readerPosition: 0, array: utf8Bytes} + utf8File := newUTF8Font(&reader) + err = utf8File.parseFile() + if err != nil { + f.SetError(err) + return + } + + desc := FontDescType{ + Ascent: int(utf8File.Ascent), + Descent: int(utf8File.Descent), + CapHeight: utf8File.CapHeight, + Flags: utf8File.Flags, + FontBBox: utf8File.Bbox, + ItalicAngle: utf8File.ItalicAngle, + StemV: utf8File.StemV, + MissingWidth: round(utf8File.DefaultWidth), + } + + var sbarr map[int]int + if f.aliasNbPagesStr == "" { + sbarr = makeSubsetRange(57) + } else { + sbarr = makeSubsetRange(32) + } + def := fontDefType{ + Tp: Type, + Name: fontKey, + Desc: desc, + Up: int(round(utf8File.UnderlinePosition)), + Ut: round(utf8File.UnderlineThickness), + Cw: utf8File.CharWidths, + usedRunes: sbarr, + File: fileStr, + utf8File: utf8File, + } + def.i, _ = generateFontID(def) + f.fonts[fontKey] = def + f.fontFiles[fontKey] = fontFileType{ + length1: originalSize, + fontType: "UTF8", + } + f.fontFiles[fileStr] = fontFileType{ + fontType: "UTF8", + } + } else { + if f.fontLoader != nil { + reader, err := f.fontLoader.Open(fileStr) + if err == nil { + f.AddFontFromReader(familyStr, styleStr, reader) + if closer, ok := reader.(io.Closer); ok { + closer.Close() + } + return + } + } + + fileStr = path.Join(f.fontpath, fileStr) + file, err := os.Open(fileStr) + if err != nil { + f.err = err + return + } + defer file.Close() + + f.AddFontFromReader(familyStr, styleStr, file) + } +} + +func makeSubsetRange(end int) map[int]int { + answer := make(map[int]int) + for i := 0; i < end; i++ { + answer[i] = 0 + } + return answer +} + +// AddFontFromBytes imports a TrueType, OpenType or Type1 font from static +// bytes within the executable and makes it available for use in the generated +// document. +// +// family specifies the font family. The name can be chosen arbitrarily. If it +// is a standard family name, it will override the corresponding font. This +// string is used to subsequently set the font with the SetFont method. +// +// style specifies the font style. Acceptable values are (case insensitive) the +// empty string for regular style, "B" for bold, "I" for italic, or "BI" or +// "IB" for bold and italic combined. +// +// jsonFileBytes contain all bytes of JSON file. +// +// zFileBytes contain all bytes of Z file. +func (f *Fpdf) AddFontFromBytes(familyStr, styleStr string, jsonFileBytes, zFileBytes []byte) { + f.addFontFromBytes(fontFamilyEscape(familyStr), styleStr, jsonFileBytes, zFileBytes, nil) +} + +// AddUTF8FontFromBytes imports a TrueType font with utf-8 symbols from static +// bytes within the executable and makes it available for use in the generated +// document. +// +// family specifies the font family. The name can be chosen arbitrarily. If it +// is a standard family name, it will override the corresponding font. This +// string is used to subsequently set the font with the SetFont method. +// +// style specifies the font style. Acceptable values are (case insensitive) the +// empty string for regular style, "B" for bold, "I" for italic, or "BI" or +// "IB" for bold and italic combined. +// +// jsonFileBytes contain all bytes of JSON file. +// +// zFileBytes contain all bytes of Z file. +func (f *Fpdf) AddUTF8FontFromBytes(familyStr, styleStr string, utf8Bytes []byte) { + f.addFontFromBytes(fontFamilyEscape(familyStr), styleStr, nil, nil, utf8Bytes) +} + +func (f *Fpdf) addFontFromBytes(familyStr, styleStr string, jsonFileBytes, zFileBytes, utf8Bytes []byte) { + if f.err != nil { + return + } + + // load font key + var ok bool + fontkey := getFontKey(familyStr, styleStr) + _, ok = f.fonts[fontkey] + + if ok { + return + } + + if utf8Bytes != nil { + + // if styleStr == "IB" { + // styleStr = "BI" + // } + + Type := "UTF8" + reader := fileReader{readerPosition: 0, array: utf8Bytes} + + utf8File := newUTF8Font(&reader) + + err := utf8File.parseFile() + if err != nil { + fmt.Printf("get metrics Error: %e\n", err) + return + } + desc := FontDescType{ + Ascent: int(utf8File.Ascent), + Descent: int(utf8File.Descent), + CapHeight: utf8File.CapHeight, + Flags: utf8File.Flags, + FontBBox: utf8File.Bbox, + ItalicAngle: utf8File.ItalicAngle, + StemV: utf8File.StemV, + MissingWidth: round(utf8File.DefaultWidth), + } + + var sbarr map[int]int + if f.aliasNbPagesStr == "" { + sbarr = makeSubsetRange(57) + } else { + sbarr = makeSubsetRange(32) + } + def := fontDefType{ + Tp: Type, + Name: fontkey, + Desc: desc, + Up: int(round(utf8File.UnderlinePosition)), + Ut: round(utf8File.UnderlineThickness), + Cw: utf8File.CharWidths, + utf8File: utf8File, + usedRunes: sbarr, + } + def.i, _ = generateFontID(def) + f.fonts[fontkey] = def + } else { + // load font definitions + var info fontDefType + err := json.Unmarshal(jsonFileBytes, &info) + + if err != nil { + f.err = err + } + + if f.err != nil { + return + } + + if info.i, err = generateFontID(info); err != nil { + f.err = err + return + } + + // search existing encodings + if len(info.Diff) > 0 { + n := -1 + + for j, str := range f.diffs { + if str == info.Diff { + n = j + 1 + break + } + } + + if n < 0 { + f.diffs = append(f.diffs, info.Diff) + n = len(f.diffs) + } + + info.DiffN = n + } + + // embed font + if len(info.File) > 0 { + if info.Tp == "TrueType" { + f.fontFiles[info.File] = fontFileType{ + length1: int64(info.OriginalSize), + embedded: true, + content: zFileBytes, + } + } else { + f.fontFiles[info.File] = fontFileType{ + length1: int64(info.Size1), + length2: int64(info.Size2), + embedded: true, + content: zFileBytes, + } + } + } + + f.fonts[fontkey] = info + } +} + +// getFontKey is used by AddFontFromReader and GetFontDesc +func getFontKey(familyStr, styleStr string) string { + familyStr = strings.ToLower(familyStr) + styleStr = strings.ToUpper(styleStr) + if styleStr == "IB" { + styleStr = "BI" + } + return familyStr + styleStr +} + +// AddFontFromReader imports a TrueType, OpenType or Type1 font and makes it +// available using a reader that satisifies the io.Reader interface. See +// AddFont for details about familyStr and styleStr. +func (f *Fpdf) AddFontFromReader(familyStr, styleStr string, r io.Reader) { + if f.err != nil { + return + } + // dbg("Adding family [%s], style [%s]", familyStr, styleStr) + familyStr = fontFamilyEscape(familyStr) + var ok bool + fontkey := getFontKey(familyStr, styleStr) + _, ok = f.fonts[fontkey] + if ok { + return + } + var info fontDefType + info = f.loadfont(r) + if f.err != nil { + return + } + if len(info.Diff) > 0 { + // Search existing encodings + n := -1 + for j, str := range f.diffs { + if str == info.Diff { + n = j + 1 + break + } + } + if n < 0 { + f.diffs = append(f.diffs, info.Diff) + n = len(f.diffs) + } + info.DiffN = n + } + // dbg("font [%s], type [%s]", info.File, info.Tp) + if len(info.File) > 0 { + // Embedded font + if info.Tp == "TrueType" { + f.fontFiles[info.File] = fontFileType{length1: int64(info.OriginalSize)} + } else { + f.fontFiles[info.File] = fontFileType{length1: int64(info.Size1), length2: int64(info.Size2)} + } + } + f.fonts[fontkey] = info + return +} + +// GetFontDesc returns the font descriptor, which can be used for +// example to find the baseline of a font. If familyStr is empty +// current font descriptor will be returned. +// See FontDescType for documentation about the font descriptor. +// See AddFont for details about familyStr and styleStr. +func (f *Fpdf) GetFontDesc(familyStr, styleStr string) FontDescType { + if familyStr == "" { + return f.currentFont.Desc + } + return f.fonts[getFontKey(fontFamilyEscape(familyStr), styleStr)].Desc +} + +// SetFont sets the font used to print character strings. It is mandatory to +// call this method at least once before printing text or the resulting +// document will not be valid. +// +// The font can be either a standard one or a font added via the AddFont() +// method or AddFontFromReader() method. Standard fonts use the Windows +// encoding cp1252 (Western Europe). +// +// The method can be called before the first page is created and the font is +// kept from page to page. If you just wish to change the current font size, it +// is simpler to call SetFontSize(). +// +// Note: the font definition file must be accessible. An error is set if the +// file cannot be read. +// +// familyStr specifies the font family. It can be either a name defined by +// AddFont(), AddFontFromReader() or one of the standard families (case +// insensitive): "Courier" for fixed-width, "Helvetica" or "Arial" for sans +// serif, "Times" for serif, "Symbol" or "ZapfDingbats" for symbolic. +// +// styleStr can be "B" (bold), "I" (italic), "U" (underscore), "S" (strike-out) +// or any combination. The default value (specified with an empty string) is +// regular. Bold and italic styles do not apply to Symbol and ZapfDingbats. +// +// size is the font size measured in points. The default value is the current +// size. If no size has been specified since the beginning of the document, the +// value taken is 12. +func (f *Fpdf) SetFont(familyStr, styleStr string, size float64) { + // dbg("SetFont x %.2f, lMargin %.2f", f.x, f.lMargin) + + if f.err != nil { + return + } + // dbg("SetFont") + familyStr = fontFamilyEscape(familyStr) + var ok bool + if familyStr == "" { + familyStr = f.fontFamily + } else { + familyStr = strings.ToLower(familyStr) + } + styleStr = strings.ToUpper(styleStr) + f.underline = strings.Contains(styleStr, "U") + if f.underline { + styleStr = strings.Replace(styleStr, "U", "", -1) + } + f.strikeout = strings.Contains(styleStr, "S") + if f.strikeout { + styleStr = strings.Replace(styleStr, "S", "", -1) + } + if styleStr == "IB" { + styleStr = "BI" + } + if size == 0.0 { + size = f.fontSizePt + } + + // Test if font is already loaded + fontKey := familyStr + styleStr + _, ok = f.fonts[fontKey] + if !ok { + // Test if one of the core fonts + if familyStr == "arial" { + familyStr = "helvetica" + } + _, ok = f.coreFonts[familyStr] + if ok { + if familyStr == "symbol" { + familyStr = "zapfdingbats" + } + if familyStr == "zapfdingbats" { + styleStr = "" + } + fontKey = familyStr + styleStr + _, ok = f.fonts[fontKey] + if !ok { + rdr := f.coreFontReader(familyStr, styleStr) + if f.err == nil { + f.AddFontFromReader(familyStr, styleStr, rdr) + } + if f.err != nil { + return + } + } + } else { + f.err = fmt.Errorf("undefined font: %s %s", familyStr, styleStr) + return + } + } + // Select it + f.fontFamily = familyStr + f.fontStyle = styleStr + f.fontSizePt = size + f.fontSize = size / f.k + f.currentFont = f.fonts[fontKey] + if f.currentFont.Tp == "UTF8" { + f.isCurrentUTF8 = true + } else { + f.isCurrentUTF8 = false + } + if f.page > 0 { + f.outf("BT /F%s %.2f Tf ET", f.currentFont.i, f.fontSizePt) + } + return +} + +// SetFontStyle sets the style of the current font. See also SetFont() +func (f *Fpdf) SetFontStyle(styleStr string) { + f.SetFont(f.fontFamily, styleStr, f.fontSizePt) +} + +// SetFontSize defines the size of the current font. Size is specified in +// points (1/ 72 inch). See also SetFontUnitSize(). +func (f *Fpdf) SetFontSize(size float64) { + f.fontSizePt = size + f.fontSize = size / f.k + if f.page > 0 { + f.outf("BT /F%s %.2f Tf ET", f.currentFont.i, f.fontSizePt) + } +} + +// SetFontUnitSize defines the size of the current font. Size is specified in +// the unit of measure specified in New(). See also SetFontSize(). +func (f *Fpdf) SetFontUnitSize(size float64) { + f.fontSizePt = size * f.k + f.fontSize = size + if f.page > 0 { + f.outf("BT /F%s %.2f Tf ET", f.currentFont.i, f.fontSizePt) + } +} + +// GetFontSize returns the size of the current font in points followed by the +// size in the unit of measure specified in New(). The second value can be used +// as a line height value in drawing operations. +func (f *Fpdf) GetFontSize() (ptSize, unitSize float64) { + return f.fontSizePt, f.fontSize +} + +// AddLink creates a new internal link and returns its identifier. An internal +// link is a clickable area which directs to another place within the document. +// The identifier can then be passed to Cell(), Write(), Image() or Link(). The +// destination is defined with SetLink(). +func (f *Fpdf) AddLink() int { + f.links = append(f.links, intLinkType{}) + return len(f.links) - 1 +} + +// SetLink defines the page and position a link points to. See AddLink(). +func (f *Fpdf) SetLink(link int, y float64, page int) { + if y == -1 { + y = f.y + } + if page == -1 { + page = f.page + } + f.links[link] = intLinkType{page, y} +} + +// newLink adds a new clickable link on current page +func (f *Fpdf) newLink(x, y, w, h float64, link int, linkStr string) { + // linkList, ok := f.pageLinks[f.page] + // if !ok { + // linkList = make([]linkType, 0, 8) + // f.pageLinks[f.page] = linkList + // } + f.pageLinks[f.page] = append(f.pageLinks[f.page], + linkType{x * f.k, f.hPt - y*f.k, w * f.k, h * f.k, link, linkStr}) +} + +// Link puts a link on a rectangular area of the page. Text or image links are +// generally put via Cell(), Write() or Image(), but this method can be useful +// for instance to define a clickable area inside an image. link is the value +// returned by AddLink(). +func (f *Fpdf) Link(x, y, w, h float64, link int) { + f.newLink(x, y, w, h, link, "") +} + +// LinkString puts a link on a rectangular area of the page. Text or image +// links are generally put via Cell(), Write() or Image(), but this method can +// be useful for instance to define a clickable area inside an image. linkStr +// is the target URL. +func (f *Fpdf) LinkString(x, y, w, h float64, linkStr string) { + f.newLink(x, y, w, h, 0, linkStr) +} + +// Bookmark sets a bookmark that will be displayed in a sidebar outline. txtStr +// is the title of the bookmark. level specifies the level of the bookmark in +// the outline; 0 is the top level, 1 is just below, and so on. y specifies the +// vertical position of the bookmark destination in the current page; -1 +// indicates the current position. +func (f *Fpdf) Bookmark(txtStr string, level int, y float64) { + if y == -1 { + y = f.y + } + if f.isCurrentUTF8 { + txtStr = utf8toutf16(txtStr) + } + f.outlines = append(f.outlines, outlineType{text: txtStr, level: level, y: y, p: f.PageNo(), prev: -1, last: -1, next: -1, first: -1}) +} + +// Text prints a character string. The origin (x, y) is on the left of the +// first character at the baseline. This method permits a string to be placed +// precisely on the page, but it is usually easier to use Cell(), MultiCell() +// or Write() which are the standard methods to print text. +func (f *Fpdf) Text(x, y float64, txtStr string) { + var txt2 string + if f.isCurrentUTF8 { + if f.isRTL { + txtStr = reverseText(txtStr) + x -= f.GetStringWidth(txtStr) + } + txt2 = f.escape(utf8toutf16(txtStr, false)) + for _, uni := range []rune(txtStr) { + f.currentFont.usedRunes[int(uni)] = int(uni) + } + } else { + txt2 = f.escape(txtStr) + } + s := sprintf("BT %.2f %.2f Td (%s) Tj ET", x*f.k, (f.h-y)*f.k, txt2) + if f.underline && txtStr != "" { + s += " " + f.dounderline(x, y, txtStr) + } + if f.strikeout && txtStr != "" { + s += " " + f.dostrikeout(x, y, txtStr) + } + if f.colorFlag { + s = sprintf("q %s %s Q", f.color.text.str, s) + } + f.out(s) +} + +// SetWordSpacing sets spacing between words of following text. See the +// WriteAligned() example for a demonstration of its use. +func (f *Fpdf) SetWordSpacing(space float64) { + f.out(sprintf("%.5f Tw", space*f.k)) +} + +// SetTextRenderingMode sets the rendering mode of following text. +// The mode can be as follows: +// 0: Fill text +// 1: Stroke text +// 2: Fill, then stroke text +// 3: Neither fill nor stroke text (invisible) +// 4: Fill text and add to path for clipping +// 5: Stroke text and add to path for clipping +// 6: Fills then stroke text and add to path for clipping +// 7: Add text to path for clipping +// This method is demonstrated in the SetTextRenderingMode example. +func (f *Fpdf) SetTextRenderingMode(mode int) { + if mode >= 0 && mode <= 7 { + f.out(sprintf("%d Tr", mode)) + } +} + +// SetAcceptPageBreakFunc allows the application to control where page breaks +// occur. +// +// fnc is an application function (typically a closure) that is called by the +// library whenever a page break condition is met. The break is issued if true +// is returned. The default implementation returns a value according to the +// mode selected by SetAutoPageBreak. The function provided should not be +// called by the application. +// +// See the example for SetLeftMargin() to see how this function can be used to +// manage multiple columns. +func (f *Fpdf) SetAcceptPageBreakFunc(fnc func() bool) { + f.acceptPageBreak = fnc +} + +// CellFormat prints a rectangular cell with optional borders, background color +// and character string. The upper-left corner of the cell corresponds to the +// current position. The text can be aligned or centered. After the call, the +// current position moves to the right or to the next line. It is possible to +// put a link on the text. +// +// An error will be returned if a call to SetFont() has not already taken +// place before this method is called. +// +// If automatic page breaking is enabled and the cell goes beyond the limit, a +// page break is done before outputting. +// +// w and h specify the width and height of the cell. If w is 0, the cell +// extends up to the right margin. Specifying 0 for h will result in no output, +// but the current position will be advanced by w. +// +// txtStr specifies the text to display. +// +// borderStr specifies how the cell border will be drawn. An empty string +// indicates no border, "1" indicates a full border, and one or more of "L", +// "T", "R" and "B" indicate the left, top, right and bottom sides of the +// border. +// +// ln indicates where the current position should go after the call. Possible +// values are 0 (to the right), 1 (to the beginning of the next line), and 2 +// (below). Putting 1 is equivalent to putting 0 and calling Ln() just after. +// +// alignStr specifies how the text is to be positioned within the cell. +// Horizontal alignment is controlled by including "L", "C" or "R" (left, +// center, right) in alignStr. Vertical alignment is controlled by including +// "T", "M", "B" or "A" (top, middle, bottom, baseline) in alignStr. The default +// alignment is left middle. +// +// fill is true to paint the cell background or false to leave it transparent. +// +// link is the identifier returned by AddLink() or 0 for no internal link. +// +// linkStr is a target URL or empty for no external link. A non--zero value for +// link takes precedence over linkStr. +func (f *Fpdf) CellFormat(w, h float64, txtStr, borderStr string, ln int, + alignStr string, fill bool, link int, linkStr string) { + // dbg("CellFormat. h = %.2f, borderStr = %s", h, borderStr) + if f.err != nil { + return + } + + if f.currentFont.Name == "" { + f.err = fmt.Errorf("font has not been set; unable to render text") + return + } + + borderStr = strings.ToUpper(borderStr) + k := f.k + if f.y+h > f.pageBreakTrigger && !f.inHeader && !f.inFooter && f.acceptPageBreak() { + // Automatic page break + x := f.x + ws := f.ws + // dbg("auto page break, x %.2f, ws %.2f", x, ws) + if ws > 0 { + f.ws = 0 + f.out("0 Tw") + } + f.AddPageFormat(f.curOrientation, f.curPageSize) + if f.err != nil { + return + } + f.x = x + if ws > 0 { + f.ws = ws + f.outf("%.3f Tw", ws*k) + } + } + if w == 0 { + w = f.w - f.rMargin - f.x + } + var s fmtBuffer + if fill || borderStr == "1" { + var op string + if fill { + if borderStr == "1" { + op = "B" + // dbg("border is '1', fill") + } else { + op = "f" + // dbg("border is empty, fill") + } + } else { + // dbg("border is '1', no fill") + op = "S" + } + /// dbg("(CellFormat) f.x %.2f f.k %.2f", f.x, f.k) + s.printf("%.2f %.2f %.2f %.2f re %s ", f.x*k, (f.h-f.y)*k, w*k, -h*k, op) + } + if len(borderStr) > 0 && borderStr != "1" { + // fmt.Printf("border is '%s', no fill\n", borderStr) + x := f.x + y := f.y + left := x * k + top := (f.h - y) * k + right := (x + w) * k + bottom := (f.h - (y + h)) * k + if strings.Contains(borderStr, "L") { + s.printf("%.2f %.2f m %.2f %.2f l S ", left, top, left, bottom) + } + if strings.Contains(borderStr, "T") { + s.printf("%.2f %.2f m %.2f %.2f l S ", left, top, right, top) + } + if strings.Contains(borderStr, "R") { + s.printf("%.2f %.2f m %.2f %.2f l S ", right, top, right, bottom) + } + if strings.Contains(borderStr, "B") { + s.printf("%.2f %.2f m %.2f %.2f l S ", left, bottom, right, bottom) + } + } + if len(txtStr) > 0 { + var dx, dy float64 + // Horizontal alignment + switch { + case strings.Contains(alignStr, "R"): + dx = w - f.cMargin - f.GetStringWidth(txtStr) + case strings.Contains(alignStr, "C"): + dx = (w - f.GetStringWidth(txtStr)) / 2 + default: + dx = f.cMargin + } + + // Vertical alignment + switch { + case strings.Contains(alignStr, "T"): + dy = (f.fontSize - h) / 2.0 + case strings.Contains(alignStr, "B"): + dy = (h - f.fontSize) / 2.0 + case strings.Contains(alignStr, "A"): + var descent float64 + d := f.currentFont.Desc + if d.Descent == 0 { + // not defined (standard font?), use average of 19% + descent = -0.19 * f.fontSize + } else { + descent = float64(d.Descent) * f.fontSize / float64(d.Ascent-d.Descent) + } + dy = (h-f.fontSize)/2.0 - descent + default: + dy = 0 + } + if f.colorFlag { + s.printf("q %s ", f.color.text.str) + } + //If multibyte, Tw has no effect - do word spacing using an adjustment before each space + if (f.ws != 0 || alignStr == "J") && f.isCurrentUTF8 { // && f.ws != 0 + if f.isRTL { + txtStr = reverseText(txtStr) + } + wmax := int(math.Ceil((w - 2*f.cMargin) * 1000 / f.fontSize)) + for _, uni := range []rune(txtStr) { + f.currentFont.usedRunes[int(uni)] = int(uni) + } + space := f.escape(utf8toutf16(" ", false)) + strSize := f.GetStringSymbolWidth(txtStr) + s.printf("BT 0 Tw %.2f %.2f Td [", (f.x+dx)*k, (f.h-(f.y+.5*h+.3*f.fontSize))*k) + t := strings.Split(txtStr, " ") + shift := float64((wmax - strSize)) / float64(len(t)-1) + numt := len(t) + for i := 0; i < numt; i++ { + tx := t[i] + tx = "(" + f.escape(utf8toutf16(tx, false)) + ")" + s.printf("%s ", tx) + if (i + 1) < numt { + s.printf("%.3f(%s) ", -shift, space) + } + } + s.printf("] TJ ET") + } else { + var txt2 string + if f.isCurrentUTF8 { + if f.isRTL { + txtStr = reverseText(txtStr) + } + txt2 = f.escape(utf8toutf16(txtStr, false)) + for _, uni := range []rune(txtStr) { + f.currentFont.usedRunes[int(uni)] = int(uni) + } + } else { + + txt2 = strings.Replace(txtStr, "\\", "\\\\", -1) + txt2 = strings.Replace(txt2, "(", "\\(", -1) + txt2 = strings.Replace(txt2, ")", "\\)", -1) + } + bt := (f.x + dx) * k + td := (f.h - (f.y + dy + .5*h + .3*f.fontSize)) * k + s.printf("BT %.2f %.2f Td (%s)Tj ET", bt, td, txt2) + //BT %.2F %.2F Td (%s) Tj ET',(f.x+dx)*k,(f.h-(f.y+.5*h+.3*f.FontSize))*k,txt2); + } + + if f.underline { + s.printf(" %s", f.dounderline(f.x+dx, f.y+dy+.5*h+.3*f.fontSize, txtStr)) + } + if f.strikeout { + s.printf(" %s", f.dostrikeout(f.x+dx, f.y+dy+.5*h+.3*f.fontSize, txtStr)) + } + if f.colorFlag { + s.printf(" Q") + } + if link > 0 || len(linkStr) > 0 { + f.newLink(f.x+dx, f.y+dy+.5*h-.5*f.fontSize, f.GetStringWidth(txtStr), f.fontSize, link, linkStr) + } + } + str := s.String() + if len(str) > 0 { + f.out(str) + } + f.lasth = h + if ln > 0 { + // Go to next line + f.y += h + if ln == 1 { + f.x = f.lMargin + } + } else { + f.x += w + } + return +} + +// Revert string to use in RTL languages +func reverseText(text string) string { + oldText := []rune(text) + newText := make([]rune, len(oldText)) + length := len(oldText) - 1 + for i, r := range oldText { + newText[length-i] = r + } + return string(newText) +} + +// Cell is a simpler version of CellFormat with no fill, border, links or +// special alignment. The Cell_strikeout() example demonstrates this method. +func (f *Fpdf) Cell(w, h float64, txtStr string) { + f.CellFormat(w, h, txtStr, "", 0, "L", false, 0, "") +} + +// Cellf is a simpler printf-style version of CellFormat with no fill, border, +// links or special alignment. See documentation for the fmt package for +// details on fmtStr and args. +func (f *Fpdf) Cellf(w, h float64, fmtStr string, args ...interface{}) { + f.CellFormat(w, h, sprintf(fmtStr, args...), "", 0, "L", false, 0, "") +} + +// SplitLines splits text into several lines using the current font. Each line +// has its length limited to a maximum width given by w. This function can be +// used to determine the total height of wrapped text for vertical placement +// purposes. +// +// This method is useful for codepage-based fonts only. For UTF-8 encoded text, +// use SplitText(). +// +// You can use MultiCell if you want to print a text on several lines in a +// simple way. +func (f *Fpdf) SplitLines(txt []byte, w float64) [][]byte { + // Function contributed by Bruno Michel + lines := [][]byte{} + cw := f.currentFont.Cw + wmax := int(math.Ceil((w - 2*f.cMargin) * 1000 / f.fontSize)) + s := bytes.Replace(txt, []byte("\r"), []byte{}, -1) + nb := len(s) + for nb > 0 && s[nb-1] == '\n' { + nb-- + } + s = s[0:nb] + sep := -1 + i := 0 + j := 0 + l := 0 + for i < nb { + c := s[i] + l += cw[c] + if c == ' ' || c == '\t' || c == '\n' { + sep = i + } + if c == '\n' || l > wmax { + if sep == -1 { + if i == j { + i++ + } + sep = i + } else { + i = sep + 1 + } + lines = append(lines, s[j:sep]) + sep = -1 + j = i + l = 0 + } else { + i++ + } + } + if i != j { + lines = append(lines, s[j:i]) + } + return lines +} + +// MultiCell supports printing text with line breaks. They can be automatic (as +// soon as the text reaches the right border of the cell) or explicit (via the +// \n character). As many cells as necessary are output, one below the other. +// +// Text can be aligned, centered or justified. The cell block can be framed and +// the background painted. See CellFormat() for more details. +// +// The current position after calling MultiCell() is the beginning of the next +// line, equivalent to calling CellFormat with ln equal to 1. +// +// w is the width of the cells. A value of zero indicates cells that reach to +// the right margin. +// +// h indicates the line height of each cell in the unit of measure specified in New(). +// +// Note: this method has a known bug that treats UTF-8 fonts differently than +// non-UTF-8 fonts. With UTF-8 fonts, all trailing newlines in txtStr are +// removed. With a non-UTF-8 font, if txtStr has one or more trailing newlines, +// only the last is removed. In the next major module version, the UTF-8 logic +// will be changed to match the non-UTF-8 logic. To prepare for that change, +// applications that use UTF-8 fonts and depend on having all trailing newlines +// removed should call strings.TrimRight(txtStr, "\r\n") before calling this +// method. +func (f *Fpdf) MultiCell(w, h float64, txtStr, borderStr, alignStr string, fill bool) { + if f.err != nil { + return + } + // dbg("MultiCell") + if alignStr == "" { + alignStr = "J" + } + cw := f.currentFont.Cw + if w == 0 { + w = f.w - f.rMargin - f.x + } + wmax := int(math.Ceil((w - 2*f.cMargin) * 1000 / f.fontSize)) + s := strings.Replace(txtStr, "\r", "", -1) + srune := []rune(s) + + // remove extra line breaks + var nb int + if f.isCurrentUTF8 { + nb = len(srune) + for nb > 0 && srune[nb-1] == '\n' { + nb-- + } + srune = srune[0:nb] + } else { + nb = len(s) + bytes2 := []byte(s) + + // for nb > 0 && bytes2[nb-1] == '\n' { + + // Prior to August 2019, if s ended with a newline, this code stripped it. + // After that date, to be compatible with the UTF-8 code above, *all* + // trailing newlines were removed. Because this regression caused at least + // one application to break (see issue #333), the original behavior has been + // reinstated with a caveat included in the documentation. + if nb > 0 && bytes2[nb-1] == '\n' { + nb-- + } + s = s[0:nb] + } + // dbg("[%s]\n", s) + var b, b2 string + b = "0" + if len(borderStr) > 0 { + if borderStr == "1" { + borderStr = "LTRB" + b = "LRT" + b2 = "LR" + } else { + b2 = "" + if strings.Contains(borderStr, "L") { + b2 += "L" + } + if strings.Contains(borderStr, "R") { + b2 += "R" + } + if strings.Contains(borderStr, "T") { + b = b2 + "T" + } else { + b = b2 + } + } + } + sep := -1 + i := 0 + j := 0 + l := 0 + ls := 0 + ns := 0 + nl := 1 + for i < nb { + // Get next character + var c rune + if f.isCurrentUTF8 { + c = srune[i] + } else { + c = rune(s[i]) + } + if c == '\n' { + // Explicit line break + if f.ws > 0 { + f.ws = 0 + f.out("0 Tw") + } + + if f.isCurrentUTF8 { + newAlignStr := alignStr + if newAlignStr == "J" { + if f.isRTL { + newAlignStr = "R" + } else { + newAlignStr = "L" + } + } + f.CellFormat(w, h, string(srune[j:i]), b, 2, newAlignStr, fill, 0, "") + } else { + f.CellFormat(w, h, s[j:i], b, 2, alignStr, fill, 0, "") + } + i++ + sep = -1 + j = i + l = 0 + ns = 0 + nl++ + if len(borderStr) > 0 && nl == 2 { + b = b2 + } + continue + } + if c == ' ' || isChinese(c) { + sep = i + ls = l + ns++ + } + if int(c) >= len(cw) { + f.err = fmt.Errorf("character outside the supported range: %s", string(c)) + return + } + if cw[int(c)] == 0 { //Marker width 0 used for missing symbols + l += f.currentFont.Desc.MissingWidth + } else if cw[int(c)] != 65535 { //Marker width 65535 used for zero width symbols + l += cw[int(c)] + } + if l > wmax { + // Automatic line break + if sep == -1 { + if i == j { + i++ + } + if f.ws > 0 { + f.ws = 0 + f.out("0 Tw") + } + if f.isCurrentUTF8 { + f.CellFormat(w, h, string(srune[j:i]), b, 2, alignStr, fill, 0, "") + } else { + f.CellFormat(w, h, s[j:i], b, 2, alignStr, fill, 0, "") + } + } else { + if alignStr == "J" { + if ns > 1 { + f.ws = float64((wmax-ls)/1000) * f.fontSize / float64(ns-1) + } else { + f.ws = 0 + } + f.outf("%.3f Tw", f.ws*f.k) + } + if f.isCurrentUTF8 { + f.CellFormat(w, h, string(srune[j:sep]), b, 2, alignStr, fill, 0, "") + } else { + f.CellFormat(w, h, s[j:sep], b, 2, alignStr, fill, 0, "") + } + i = sep + 1 + } + sep = -1 + j = i + l = 0 + ns = 0 + nl++ + if len(borderStr) > 0 && nl == 2 { + b = b2 + } + } else { + i++ + } + } + // Last chunk + if f.ws > 0 { + f.ws = 0 + f.out("0 Tw") + } + if len(borderStr) > 0 && strings.Contains(borderStr, "B") { + b += "B" + } + if f.isCurrentUTF8 { + if alignStr == "J" { + if f.isRTL { + alignStr = "R" + } else { + alignStr = "" + } + } + f.CellFormat(w, h, string(srune[j:i]), b, 2, alignStr, fill, 0, "") + } else { + f.CellFormat(w, h, s[j:i], b, 2, alignStr, fill, 0, "") + } + f.x = f.lMargin +} + +// write outputs text in flowing mode +func (f *Fpdf) write(h float64, txtStr string, link int, linkStr string) { + // dbg("Write") + cw := f.currentFont.Cw + w := f.w - f.rMargin - f.x + wmax := (w - 2*f.cMargin) * 1000 / f.fontSize + s := strings.Replace(txtStr, "\r", "", -1) + var nb int + if f.isCurrentUTF8 { + nb = len([]rune(s)) + if nb == 1 && s == " " { + f.x += f.GetStringWidth(s) + return + } + } else { + nb = len(s) + } + sep := -1 + i := 0 + j := 0 + l := 0.0 + nl := 1 + for i < nb { + // Get next character + var c rune + if f.isCurrentUTF8 { + c = []rune(s)[i] + } else { + c = rune(byte(s[i])) + } + if c == '\n' { + // Explicit line break + if f.isCurrentUTF8 { + f.CellFormat(w, h, string([]rune(s)[j:i]), "", 2, "", false, link, linkStr) + } else { + f.CellFormat(w, h, s[j:i], "", 2, "", false, link, linkStr) + } + i++ + sep = -1 + j = i + l = 0.0 + if nl == 1 { + f.x = f.lMargin + w = f.w - f.rMargin - f.x + wmax = (w - 2*f.cMargin) * 1000 / f.fontSize + } + nl++ + continue + } + if c == ' ' { + sep = i + } + l += float64(cw[int(c)]) + if l > wmax { + // Automatic line break + if sep == -1 { + if f.x > f.lMargin { + // Move to next line + f.x = f.lMargin + f.y += h + w = f.w - f.rMargin - f.x + wmax = (w - 2*f.cMargin) * 1000 / f.fontSize + i++ + nl++ + continue + } + if i == j { + i++ + } + if f.isCurrentUTF8 { + f.CellFormat(w, h, string([]rune(s)[j:i]), "", 2, "", false, link, linkStr) + } else { + f.CellFormat(w, h, s[j:i], "", 2, "", false, link, linkStr) + } + } else { + if f.isCurrentUTF8 { + f.CellFormat(w, h, string([]rune(s)[j:sep]), "", 2, "", false, link, linkStr) + } else { + f.CellFormat(w, h, s[j:sep], "", 2, "", false, link, linkStr) + } + i = sep + 1 + } + sep = -1 + j = i + l = 0.0 + if nl == 1 { + f.x = f.lMargin + w = f.w - f.rMargin - f.x + wmax = (w - 2*f.cMargin) * 1000 / f.fontSize + } + nl++ + } else { + i++ + } + } + // Last chunk + if i != j { + if f.isCurrentUTF8 { + f.CellFormat(l/1000*f.fontSize, h, string([]rune(s)[j:]), "", 0, "", false, link, linkStr) + } else { + f.CellFormat(l/1000*f.fontSize, h, s[j:], "", 0, "", false, link, linkStr) + } + } +} + +// Write prints text from the current position. When the right margin is +// reached (or the \n character is met) a line break occurs and text continues +// from the left margin. Upon method exit, the current position is left just at +// the end of the text. +// +// It is possible to put a link on the text. +// +// h indicates the line height in the unit of measure specified in New(). +func (f *Fpdf) Write(h float64, txtStr string) { + f.write(h, txtStr, 0, "") +} + +// Writef is like Write but uses printf-style formatting. See the documentation +// for package fmt for more details on fmtStr and args. +func (f *Fpdf) Writef(h float64, fmtStr string, args ...interface{}) { + f.write(h, sprintf(fmtStr, args...), 0, "") +} + +// WriteLinkString writes text that when clicked launches an external URL. See +// Write() for argument details. +func (f *Fpdf) WriteLinkString(h float64, displayStr, targetStr string) { + f.write(h, displayStr, 0, targetStr) +} + +// WriteLinkID writes text that when clicked jumps to another location in the +// PDF. linkID is an identifier returned by AddLink(). See Write() for argument +// details. +func (f *Fpdf) WriteLinkID(h float64, displayStr string, linkID int) { + f.write(h, displayStr, linkID, "") +} + +// WriteAligned is an implementation of Write that makes it possible to align +// text. +// +// width indicates the width of the box the text will be drawn in. This is in +// the unit of measure specified in New(). If it is set to 0, the bounding box +//of the page will be taken (pageWidth - leftMargin - rightMargin). +// +// lineHeight indicates the line height in the unit of measure specified in +// New(). +// +// alignStr sees to horizontal alignment of the given textStr. The options are +// "L", "C" and "R" (Left, Center, Right). The default is "L". +func (f *Fpdf) WriteAligned(width, lineHeight float64, textStr, alignStr string) { + lMargin, _, rMargin, _ := f.GetMargins() + + pageWidth, _ := f.GetPageSize() + if width == 0 { + width = pageWidth - (lMargin + rMargin) + } + + var lines []string + + if f.isCurrentUTF8 { + lines = f.SplitText(textStr, width) + } else { + for _, line := range f.SplitLines([]byte(textStr), width) { + lines = append(lines, string(line)) + } + } + + for _, lineBt := range lines { + lineStr := string(lineBt) + lineWidth := f.GetStringWidth(lineStr) + + switch alignStr { + case "C": + f.SetLeftMargin(lMargin + ((width - lineWidth) / 2)) + f.Write(lineHeight, lineStr) + f.SetLeftMargin(lMargin) + case "R": + f.SetLeftMargin(lMargin + (width - lineWidth) - 2.01*f.cMargin) + f.Write(lineHeight, lineStr) + f.SetLeftMargin(lMargin) + default: + f.SetRightMargin(pageWidth - lMargin - width) + f.Write(lineHeight, lineStr) + f.SetRightMargin(rMargin) + } + } +} + +// Ln performs a line break. The current abscissa goes back to the left margin +// and the ordinate increases by the amount passed in parameter. A negative +// value of h indicates the height of the last printed cell. +// +// This method is demonstrated in the example for MultiCell. +func (f *Fpdf) Ln(h float64) { + f.x = f.lMargin + if h < 0 { + f.y += f.lasth + } else { + f.y += h + } +} + +// ImageTypeFromMime returns the image type used in various image-related +// functions (for example, Image()) that is associated with the specified MIME +// type. For example, "jpg" is returned if mimeStr is "image/jpeg". An error is +// set if the specified MIME type is not supported. +func (f *Fpdf) ImageTypeFromMime(mimeStr string) (tp string) { + switch mimeStr { + case "image/png": + tp = "png" + case "image/jpg": + tp = "jpg" + case "image/jpeg": + tp = "jpg" + case "image/gif": + tp = "gif" + default: + f.SetErrorf("unsupported image type: %s", mimeStr) + } + return +} + +func (f *Fpdf) imageOut(info *ImageInfoType, x, y, w, h float64, allowNegativeX, flow bool, link int, linkStr string) { + // Automatic width and height calculation if needed + if w == 0 && h == 0 { + // Put image at 96 dpi + w = -96 + h = -96 + } + if w == -1 { + // Set image width to whatever value for dpi we read + // from the image or that was set manually + w = -info.dpi + } + if h == -1 { + // Set image height to whatever value for dpi we read + // from the image or that was set manually + h = -info.dpi + } + if w < 0 { + w = -info.w * 72.0 / w / f.k + } + if h < 0 { + h = -info.h * 72.0 / h / f.k + } + if w == 0 { + w = h * info.w / info.h + } + if h == 0 { + h = w * info.h / info.w + } + // Flowing mode + if flow { + if f.y+h > f.pageBreakTrigger && !f.inHeader && !f.inFooter && f.acceptPageBreak() { + // Automatic page break + x2 := f.x + f.AddPageFormat(f.curOrientation, f.curPageSize) + if f.err != nil { + return + } + f.x = x2 + } + y = f.y + f.y += h + } + if !allowNegativeX { + if x < 0 { + x = f.x + } + } + // dbg("h %.2f", h) + // q 85.04 0 0 NaN 28.35 NaN cm /I2 Do Q + f.outf("q %.5f 0 0 %.5f %.5f %.5f cm /I%s Do Q", w*f.k, h*f.k, x*f.k, (f.h-(y+h))*f.k, info.i) + if link > 0 || len(linkStr) > 0 { + f.newLink(x, y, w, h, link, linkStr) + } +} + +// Image puts a JPEG, PNG or GIF image in the current page. +// +// Deprecated in favor of ImageOptions -- see that function for +// details on the behavior of arguments +func (f *Fpdf) Image(imageNameStr string, x, y, w, h float64, flow bool, tp string, link int, linkStr string) { + options := ImageOptions{ + ReadDpi: false, + ImageType: tp, + } + f.ImageOptions(imageNameStr, x, y, w, h, flow, options, link, linkStr) +} + +// ImageOptions puts a JPEG, PNG or GIF image in the current page. The size it +// will take on the page can be specified in different ways. If both w and h +// are 0, the image is rendered at 96 dpi. If either w or h is zero, it will be +// calculated from the other dimension so that the aspect ratio is maintained. +// If w and/or h are -1, the dpi for that dimension will be read from the +// ImageInfoType object. PNG files can contain dpi information, and if present, +// this information will be populated in the ImageInfoType object and used in +// Width, Height, and Extent calculations. Otherwise, the SetDpi function can +// be used to change the dpi from the default of 72. +// +// If w and h are any other negative value, their absolute values +// indicate their dpi extents. +// +// Supported JPEG formats are 24 bit, 32 bit and gray scale. Supported PNG +// formats are 24 bit, indexed color, and 8 bit indexed gray scale. If a GIF +// image is animated, only the first frame is rendered. Transparency is +// supported. It is possible to put a link on the image. +// +// imageNameStr may be the name of an image as registered with a call to either +// RegisterImageReader() or RegisterImage(). In the first case, the image is +// loaded using an io.Reader. This is generally useful when the image is +// obtained from some other means than as a disk-based file. In the second +// case, the image is loaded as a file. Alternatively, imageNameStr may +// directly specify a sufficiently qualified filename. +// +// However the image is loaded, if it is used more than once only one copy is +// embedded in the file. +// +// If x is negative, the current abscissa is used. +// +// If flow is true, the current y value is advanced after placing the image and +// a page break may be made if necessary. +// +// If link refers to an internal page anchor (that is, it is non-zero; see +// AddLink()), the image will be a clickable internal link. Otherwise, if +// linkStr specifies a URL, the image will be a clickable external link. +func (f *Fpdf) ImageOptions(imageNameStr string, x, y, w, h float64, flow bool, options ImageOptions, link int, linkStr string) { + if f.err != nil { + return + } + info := f.RegisterImageOptions(imageNameStr, options) + if f.err != nil { + return + } + f.imageOut(info, x, y, w, h, options.AllowNegativePosition, flow, link, linkStr) + return +} + +// RegisterImageReader registers an image, reading it from Reader r, adding it +// to the PDF file but not adding it to the page. +// +// This function is now deprecated in favor of RegisterImageOptionsReader +func (f *Fpdf) RegisterImageReader(imgName, tp string, r io.Reader) (info *ImageInfoType) { + options := ImageOptions{ + ReadDpi: false, + ImageType: tp, + } + return f.RegisterImageOptionsReader(imgName, options, r) +} + +// ImageOptions provides a place to hang any options we want to use while +// parsing an image. +// +// ImageType's possible values are (case insensitive): +// "JPG", "JPEG", "PNG" and "GIF". If empty, the type is inferred from +// the file extension. +// +// ReadDpi defines whether to attempt to automatically read the image +// dpi information from the image file. Normally, this should be set +// to true (understanding that not all images will have this info +// available). However, for backwards compatibility with previous +// versions of the API, it defaults to false. +// +// AllowNegativePosition can be set to true in order to prevent the default +// coercion of negative x values to the current x position. +type ImageOptions struct { + ImageType string + ReadDpi bool + AllowNegativePosition bool +} + +// RegisterImageOptionsReader registers an image, reading it from Reader r, adding it +// to the PDF file but not adding it to the page. Use Image() with the same +// name to add the image to the page. Note that tp should be specified in this +// case. +// +// See Image() for restrictions on the image and the options parameters. +func (f *Fpdf) RegisterImageOptionsReader(imgName string, options ImageOptions, r io.Reader) (info *ImageInfoType) { + // Thanks, Ivan Daniluk, for generalizing this code to use the Reader interface. + if f.err != nil { + return + } + info, ok := f.images[imgName] + if ok { + return + } + + // First use of this image, get info + if options.ImageType == "" { + f.err = fmt.Errorf("image type should be specified if reading from custom reader") + return + } + options.ImageType = strings.ToLower(options.ImageType) + if options.ImageType == "jpeg" { + options.ImageType = "jpg" + } + switch options.ImageType { + case "jpg": + info = f.parsejpg(r) + case "png": + info = f.parsepng(r, options.ReadDpi) + case "gif": + info = f.parsegif(r) + default: + f.err = fmt.Errorf("unsupported image type: %s", options.ImageType) + } + if f.err != nil { + return + } + + if info.i, f.err = generateImageID(info); f.err != nil { + return + } + f.images[imgName] = info + + return +} + +// RegisterImage registers an image, adding it to the PDF file but not adding +// it to the page. Use Image() with the same filename to add the image to the +// page. Note that Image() calls this function, so this function is only +// necessary if you need information about the image before placing it. +// +// This function is now deprecated in favor of RegisterImageOptions. +// See Image() for restrictions on the image and the "tp" parameters. +func (f *Fpdf) RegisterImage(fileStr, tp string) (info *ImageInfoType) { + options := ImageOptions{ + ReadDpi: false, + ImageType: tp, + } + return f.RegisterImageOptions(fileStr, options) +} + +// RegisterImageOptions registers an image, adding it to the PDF file but not +// adding it to the page. Use Image() with the same filename to add the image +// to the page. Note that Image() calls this function, so this function is only +// necessary if you need information about the image before placing it. See +// Image() for restrictions on the image and the "tp" parameters. +func (f *Fpdf) RegisterImageOptions(fileStr string, options ImageOptions) (info *ImageInfoType) { + info, ok := f.images[fileStr] + if ok { + return + } + + file, err := os.Open(fileStr) + if err != nil { + f.err = err + return + } + defer file.Close() + + // First use of this image, get info + if options.ImageType == "" { + pos := strings.LastIndex(fileStr, ".") + if pos < 0 { + f.err = fmt.Errorf("image file has no extension and no type was specified: %s", fileStr) + return + } + options.ImageType = fileStr[pos+1:] + } + + return f.RegisterImageOptionsReader(fileStr, options, file) +} + +// GetImageInfo returns information about the registered image specified by +// imageStr. If the image has not been registered, nil is returned. The +// internal error is not modified by this method. +func (f *Fpdf) GetImageInfo(imageStr string) (info *ImageInfoType) { + return f.images[imageStr] +} + +// ImportObjects imports objects from gofpdi into current document +func (f *Fpdf) ImportObjects(objs map[string][]byte) { + for k, v := range objs { + f.importedObjs[k] = v + } +} + +// ImportObjPos imports object hash positions from gofpdi +func (f *Fpdf) ImportObjPos(objPos map[string]map[int]string) { + for k, v := range objPos { + f.importedObjPos[k] = v + } +} + +// putImportedTemplates writes the imported template objects to the PDF +func (f *Fpdf) putImportedTemplates() { + nOffset := f.n + 1 + + // keep track of list of sha1 hashes (to be replaced with integers) + objsIDHash := make([]string, len(f.importedObjs)) + + // actual object data with new id + objsIDData := make([][]byte, len(f.importedObjs)) + + // Populate hash slice and data slice + i := 0 + for k, v := range f.importedObjs { + objsIDHash[i] = k + objsIDData[i] = v + + i++ + } + + // Populate a lookup table to get an object id from a hash + hashToObjID := make(map[string]int, len(f.importedObjs)) + for i = 0; i < len(objsIDHash); i++ { + hashToObjID[objsIDHash[i]] = i + nOffset + } + + // Now, replace hashes inside data with %040d object id + for i = 0; i < len(objsIDData); i++ { + // get hash + hash := objsIDHash[i] + + for pos, h := range f.importedObjPos[hash] { + // Convert object id into a 40 character string padded with spaces + objIDPadded := fmt.Sprintf("%40s", fmt.Sprintf("%d", hashToObjID[h])) + + // Convert objIDPadded into []byte + objIDBytes := []byte(objIDPadded) + + // Replace sha1 hash with object id padded + for j := pos; j < pos+40; j++ { + objsIDData[i][j] = objIDBytes[j-pos] + } + } + + // Save objsIDHash so that procset dictionary has the correct object ids + f.importedTplIDs[hash] = i + nOffset + } + + // Now, put objects + for i = 0; i < len(objsIDData); i++ { + f.newobj() + f.out(string(objsIDData[i])) + } +} + +// UseImportedTemplate uses imported template from gofpdi. It draws imported +// PDF page onto page. +func (f *Fpdf) UseImportedTemplate(tplName string, scaleX float64, scaleY float64, tX float64, tY float64) { + f.outf("q 0 J 1 w 0 j 0 G 0 g q %.4F 0 0 %.4F %.4F %.4F cm %s Do Q Q\n", scaleX*f.k, scaleY*f.k, tX*f.k, (tY+f.h)*f.k, tplName) +} + +// ImportTemplates imports gofpdi template names into importedTplObjs for +// inclusion in the procset dictionary +func (f *Fpdf) ImportTemplates(tpls map[string]string) { + for tplName, tplID := range tpls { + f.importedTplObjs[tplName] = tplID + } +} + +// GetConversionRatio returns the conversion ratio based on the unit given when +// creating the PDF. +func (f *Fpdf) GetConversionRatio() float64 { + return f.k +} + +// GetXY returns the abscissa and ordinate of the current position. +// +// Note: the value returned for the abscissa will be affected by the current +// cell margin. To account for this, you may need to either add the value +// returned by GetCellMargin() to it or call SetCellMargin(0) to remove the +// cell margin. +func (f *Fpdf) GetXY() (float64, float64) { + return f.x, f.y +} + +// GetX returns the abscissa of the current position. +// +// Note: the value returned will be affected by the current cell margin. To +// account for this, you may need to either add the value returned by +// GetCellMargin() to it or call SetCellMargin(0) to remove the cell margin. +func (f *Fpdf) GetX() float64 { + return f.x +} + +// SetX defines the abscissa of the current position. If the passed value is +// negative, it is relative to the right of the page. +func (f *Fpdf) SetX(x float64) { + if x >= 0 { + f.x = x + } else { + f.x = f.w + x + } +} + +// GetY returns the ordinate of the current position. +func (f *Fpdf) GetY() float64 { + return f.y +} + +// SetY moves the current abscissa back to the left margin and sets the +// ordinate. If the passed value is negative, it is relative to the bottom of +// the page. +func (f *Fpdf) SetY(y float64) { + // dbg("SetY x %.2f, lMargin %.2f", f.x, f.lMargin) + f.x = f.lMargin + if y >= 0 { + f.y = y + } else { + f.y = f.h + y + } +} + +// SetHomeXY is a convenience method that sets the current position to the left +// and top margins. +func (f *Fpdf) SetHomeXY() { + f.SetY(f.tMargin) + f.SetX(f.lMargin) +} + +// SetXY defines the abscissa and ordinate of the current position. If the +// passed values are negative, they are relative respectively to the right and +// bottom of the page. +func (f *Fpdf) SetXY(x, y float64) { + f.SetY(y) + f.SetX(x) +} + +// SetProtection applies certain constraints on the finished PDF document. +// +// actionFlag is a bitflag that controls various document operations. +// CnProtectPrint allows the document to be printed. CnProtectModify allows a +// document to be modified by a PDF editor. CnProtectCopy allows text and +// images to be copied into the system clipboard. CnProtectAnnotForms allows +// annotations and forms to be added by a PDF editor. These values can be +// combined by or-ing them together, for example, +// CnProtectCopy|CnProtectModify. This flag is advisory; not all PDF readers +// implement the constraints that this argument attempts to control. +// +// userPassStr specifies the password that will need to be provided to view the +// contents of the PDF. The permissions specified by actionFlag will apply. +// +// ownerPassStr specifies the password that will need to be provided to gain +// full access to the document regardless of the actionFlag value. An empty +// string for this argument will be replaced with a random value, effectively +// prohibiting full access to the document. +func (f *Fpdf) SetProtection(actionFlag byte, userPassStr, ownerPassStr string) { + if f.err != nil { + return + } + f.protect.setProtection(actionFlag, userPassStr, ownerPassStr) +} + +// OutputAndClose sends the PDF document to the writer specified by w. This +// method will close both f and w, even if an error is detected and no document +// is produced. +func (f *Fpdf) OutputAndClose(w io.WriteCloser) error { + f.Output(w) + w.Close() + return f.err +} + +// OutputFileAndClose creates or truncates the file specified by fileStr and +// writes the PDF document to it. This method will close f and the newly +// written file, even if an error is detected and no document is produced. +// +// Most examples demonstrate the use of this method. +func (f *Fpdf) OutputFileAndClose(fileStr string) error { + if f.err == nil { + pdfFile, err := os.Create(fileStr) + if err == nil { + f.Output(pdfFile) + pdfFile.Close() + } else { + f.err = err + } + } + return f.err +} + +// Output sends the PDF document to the writer specified by w. No output will +// take place if an error has occurred in the document generation process. w +// remains open after this function returns. After returning, f is in a closed +// state and its methods should not be called. +func (f *Fpdf) Output(w io.Writer) error { + if f.err != nil { + return f.err + } + // dbg("Output") + if f.state < 3 { + f.Close() + } + _, err := f.buffer.WriteTo(w) + if err != nil { + f.err = err + } + return f.err +} + +func (f *Fpdf) getpagesizestr(sizeStr string) (size SizeType) { + if f.err != nil { + return + } + sizeStr = strings.ToLower(sizeStr) + // dbg("Size [%s]", sizeStr) + var ok bool + size, ok = f.stdPageSizes[sizeStr] + if ok { + // dbg("found %s", sizeStr) + size.Wd /= f.k + size.Ht /= f.k + + } else { + f.err = fmt.Errorf("unknown page size %s", sizeStr) + } + return +} + +// GetPageSizeStr returns the SizeType for the given sizeStr (that is A4, A3, etc..) +func (f *Fpdf) GetPageSizeStr(sizeStr string) (size SizeType) { + return f.getpagesizestr(sizeStr) +} + +func (f *Fpdf) _getpagesize(size SizeType) SizeType { + if size.Wd > size.Ht { + size.Wd, size.Ht = size.Ht, size.Wd + } + return size +} + +func (f *Fpdf) beginpage(orientationStr string, size SizeType) { + if f.err != nil { + return + } + f.page++ + // add the default page boxes, if any exist, to the page + f.pageBoxes[f.page] = make(map[string]PageBox) + for box, pb := range f.defPageBoxes { + f.pageBoxes[f.page][box] = pb + } + f.pages = append(f.pages, bytes.NewBufferString("")) + f.pageLinks = append(f.pageLinks, make([]linkType, 0, 0)) + f.pageAttachments = append(f.pageAttachments, []annotationAttach{}) + f.state = 2 + f.x = f.lMargin + f.y = f.tMargin + f.fontFamily = "" + // Check page size and orientation + if orientationStr == "" { + orientationStr = f.defOrientation + } else { + orientationStr = strings.ToUpper(orientationStr[0:1]) + } + if orientationStr != f.curOrientation || size.Wd != f.curPageSize.Wd || size.Ht != f.curPageSize.Ht { + // New size or orientation + if orientationStr == "P" { + f.w = size.Wd + f.h = size.Ht + } else { + f.w = size.Ht + f.h = size.Wd + } + f.wPt = f.w * f.k + f.hPt = f.h * f.k + f.pageBreakTrigger = f.h - f.bMargin + f.curOrientation = orientationStr + f.curPageSize = size + } + if orientationStr != f.defOrientation || size.Wd != f.defPageSize.Wd || size.Ht != f.defPageSize.Ht { + f.pageSizes[f.page] = SizeType{f.wPt, f.hPt} + } + return +} + +func (f *Fpdf) endpage() { + f.EndLayer() + f.state = 1 +} + +// Load a font definition file from the given Reader +func (f *Fpdf) loadfont(r io.Reader) (def fontDefType) { + if f.err != nil { + return + } + // dbg("Loading font [%s]", fontStr) + var buf bytes.Buffer + _, err := buf.ReadFrom(r) + if err != nil { + f.err = err + return + } + err = json.Unmarshal(buf.Bytes(), &def) + if err != nil { + f.err = err + return + } + + if def.i, err = generateFontID(def); err != nil { + f.err = err + } + // dump(def) + return +} + +// Escape special characters in strings +func (f *Fpdf) escape(s string) string { + s = strings.Replace(s, "\\", "\\\\", -1) + s = strings.Replace(s, "(", "\\(", -1) + s = strings.Replace(s, ")", "\\)", -1) + s = strings.Replace(s, "\r", "\\r", -1) + return s +} + +// textstring formats a text string +func (f *Fpdf) textstring(s string) string { + if f.protect.encrypted { + b := []byte(s) + f.protect.rc4(uint32(f.n), &b) + s = string(b) + } + return "(" + f.escape(s) + ")" +} + +func blankCount(str string) (count int) { + l := len(str) + for j := 0; j < l; j++ { + if byte(' ') == str[j] { + count++ + } + } + return +} + +// SetUnderlineThickness accepts a multiplier for adjusting the text underline +// thickness, defaulting to 1. See SetUnderlineThickness example. +func (f *Fpdf) SetUnderlineThickness(thickness float64) { + f.userUnderlineThickness = thickness +} + +// Underline text +func (f *Fpdf) dounderline(x, y float64, txt string) string { + up := float64(f.currentFont.Up) + ut := float64(f.currentFont.Ut) * f.userUnderlineThickness + w := f.GetStringWidth(txt) + f.ws*float64(blankCount(txt)) + return sprintf("%.2f %.2f %.2f %.2f re f", x*f.k, + (f.h-(y-up/1000*f.fontSize))*f.k, w*f.k, -ut/1000*f.fontSizePt) +} + +func (f *Fpdf) dostrikeout(x, y float64, txt string) string { + up := float64(f.currentFont.Up) + ut := float64(f.currentFont.Ut) + w := f.GetStringWidth(txt) + f.ws*float64(blankCount(txt)) + return sprintf("%.2f %.2f %.2f %.2f re f", x*f.k, + (f.h-(y+4*up/1000*f.fontSize))*f.k, w*f.k, -ut/1000*f.fontSizePt) +} + +func bufEqual(buf []byte, str string) bool { + return string(buf[0:len(str)]) == str +} + +func be16(buf []byte) int { + return 256*int(buf[0]) + int(buf[1]) +} + +func (f *Fpdf) newImageInfo() *ImageInfoType { + // default dpi to 72 unless told otherwise + return &ImageInfoType{scale: f.k, dpi: 72} +} + +// parsejpg extracts info from io.Reader with JPEG data +// Thank you, Bruno Michel, for providing this code. +func (f *Fpdf) parsejpg(r io.Reader) (info *ImageInfoType) { + info = f.newImageInfo() + var ( + data bytes.Buffer + err error + ) + _, err = data.ReadFrom(r) + if err != nil { + f.err = err + return + } + info.data = data.Bytes() + + config, err := jpeg.DecodeConfig(bytes.NewReader(info.data)) + if err != nil { + f.err = err + return + } + info.w = float64(config.Width) + info.h = float64(config.Height) + info.f = "DCTDecode" + info.bpc = 8 + switch config.ColorModel { + case color.GrayModel: + info.cs = "DeviceGray" + case color.YCbCrModel: + info.cs = "DeviceRGB" + case color.CMYKModel: + info.cs = "DeviceCMYK" + default: + f.err = fmt.Errorf("image JPEG buffer has unsupported color space (%v)", config.ColorModel) + return + } + return +} + +// parsepng extracts info from a PNG data +func (f *Fpdf) parsepng(r io.Reader, readdpi bool) (info *ImageInfoType) { + buf, err := bufferFromReader(r) + if err != nil { + f.err = err + return + } + return f.parsepngstream(buf, readdpi) +} + +func (f *Fpdf) readBeInt32(r io.Reader) (val int32) { + err := binary.Read(r, binary.BigEndian, &val) + if err != nil && err != io.EOF { + f.err = err + } + return +} + +func (f *Fpdf) readByte(r io.Reader) (val byte) { + err := binary.Read(r, binary.BigEndian, &val) + if err != nil { + f.err = err + } + return +} + +// parsegif extracts info from a GIF data (via PNG conversion) +func (f *Fpdf) parsegif(r io.Reader) (info *ImageInfoType) { + data, err := bufferFromReader(r) + if err != nil { + f.err = err + return + } + var img image.Image + img, err = gif.Decode(data) + if err != nil { + f.err = err + return + } + pngBuf := new(bytes.Buffer) + err = png.Encode(pngBuf, img) + if err != nil { + f.err = err + return + } + return f.parsepngstream(pngBuf, false) +} + +// newobj begins a new object +func (f *Fpdf) newobj() { + // dbg("newobj") + f.n++ + for j := len(f.offsets); j <= f.n; j++ { + f.offsets = append(f.offsets, 0) + } + f.offsets[f.n] = f.buffer.Len() + f.outf("%d 0 obj", f.n) +} + +func (f *Fpdf) putstream(b []byte) { + // dbg("putstream") + if f.protect.encrypted { + f.protect.rc4(uint32(f.n), &b) + } + f.out("stream") + f.out(string(b)) + f.out("endstream") +} + +// out; Add a line to the document +func (f *Fpdf) out(s string) { + if f.state == 2 { + f.pages[f.page].WriteString(s) + f.pages[f.page].WriteString("\n") + } else { + f.buffer.WriteString(s) + f.buffer.WriteString("\n") + } +} + +// outbuf adds a buffered line to the document +func (f *Fpdf) outbuf(r io.Reader) { + if f.state == 2 { + f.pages[f.page].ReadFrom(r) + f.pages[f.page].WriteString("\n") + } else { + f.buffer.ReadFrom(r) + f.buffer.WriteString("\n") + } +} + +// RawWriteStr writes a string directly to the PDF generation buffer. This is a +// low-level function that is not required for normal PDF construction. An +// understanding of the PDF specification is needed to use this method +// correctly. +func (f *Fpdf) RawWriteStr(str string) { + f.out(str) +} + +// RawWriteBuf writes the contents of the specified buffer directly to the PDF +// generation buffer. This is a low-level function that is not required for +// normal PDF construction. An understanding of the PDF specification is needed +// to use this method correctly. +func (f *Fpdf) RawWriteBuf(r io.Reader) { + f.outbuf(r) +} + +// outf adds a formatted line to the document +func (f *Fpdf) outf(fmtStr string, args ...interface{}) { + f.out(sprintf(fmtStr, args...)) +} + +// SetDefaultCatalogSort sets the default value of the catalog sort flag that +// will be used when initializing a new Fpdf instance. See SetCatalogSort() for +// more details. +func SetDefaultCatalogSort(flag bool) { + gl.catalogSort = flag +} + +// SetCatalogSort sets a flag that will be used, if true, to consistently order +// the document's internal resource catalogs. This method is typically only +// used for test purposes to facilitate PDF comparison. +func (f *Fpdf) SetCatalogSort(flag bool) { + f.catalogSort = flag +} + +// SetDefaultCreationDate sets the default value of the document creation date +// that will be used when initializing a new Fpdf instance. See +// SetCreationDate() for more details. +func SetDefaultCreationDate(tm time.Time) { + gl.creationDate = tm +} + +// SetDefaultModificationDate sets the default value of the document modification date +// that will be used when initializing a new Fpdf instance. See +// SetCreationDate() for more details. +func SetDefaultModificationDate(tm time.Time) { + gl.modDate = tm +} + +// SetCreationDate fixes the document's internal CreationDate value. By +// default, the time when the document is generated is used for this value. +// This method is typically only used for testing purposes to facilitate PDF +// comparison. Specify a zero-value time to revert to the default behavior. +func (f *Fpdf) SetCreationDate(tm time.Time) { + f.creationDate = tm +} + +// SetModificationDate fixes the document's internal ModDate value. +// See `SetCreationDate` for more details. +func (f *Fpdf) SetModificationDate(tm time.Time) { + f.modDate = tm +} + +// SetJavascript adds Adobe JavaScript to the document. +func (f *Fpdf) SetJavascript(script string) { + f.javascript = &script +} + +// RegisterAlias adds an (alias, replacement) pair to the document so we can +// replace all occurrences of that alias after writing but before the document +// is closed. Functions ExampleFpdf_RegisterAlias() and +// ExampleFpdf_RegisterAlias_utf8() in fpdf_test.go demonstrate this method. +func (f *Fpdf) RegisterAlias(alias, replacement string) { + // Note: map[string]string assignments embed literal escape ("\00") sequences + // into utf16 key and value strings. Consequently, subsequent search/replace + // operations will fail unexpectedly if utf8toutf16() conversions take place + // here. Instead, conversions are deferred until the actual search/replace + // operation takes place when the PDF output is generated. + f.aliasMap[alias] = replacement +} + +func (f *Fpdf) replaceAliases() { + for mode := 0; mode < 2; mode++ { + for alias, replacement := range f.aliasMap { + if mode == 1 { + alias = utf8toutf16(alias, false) + replacement = utf8toutf16(replacement, false) + } + for n := 1; n <= f.page; n++ { + s := f.pages[n].String() + if strings.Contains(s, alias) { + s = strings.Replace(s, alias, replacement, -1) + f.pages[n].Truncate(0) + f.pages[n].WriteString(s) + } + } + } + } +} + +func (f *Fpdf) putpages() { + var wPt, hPt float64 + var pageSize SizeType + var ok bool + nb := f.page + if len(f.aliasNbPagesStr) > 0 { + // Replace number of pages + f.RegisterAlias(f.aliasNbPagesStr, sprintf("%d", nb)) + } + f.replaceAliases() + if f.defOrientation == "P" { + wPt = f.defPageSize.Wd * f.k + hPt = f.defPageSize.Ht * f.k + } else { + wPt = f.defPageSize.Ht * f.k + hPt = f.defPageSize.Wd * f.k + } + pagesObjectNumbers := make([]int, nb+1) // 1-based + for n := 1; n <= nb; n++ { + // Page + f.newobj() + pagesObjectNumbers[n] = f.n // save for /Kids + f.out("< 0 { + var annots fmtBuffer + annots.printf("/Annots [") + for _, pl := range f.pageLinks[n] { + annots.printf("<>>>", f.textstring(pl.linkStr)) + } else { + l := f.links[pl.link] + var sz SizeType + var h float64 + sz, ok = f.pageSizes[l.page] + if ok { + h = sz.Ht + } else { + h = hPt + } + // dbg("h [%.2f], l.y [%.2f] f.k [%.2f]\n", h, l.y, f.k) + annots.printf("/Dest [%d 0 R /XYZ 0 %.2f null]>>", 1+2*l.page, h-l.y*f.k) + } + } + f.putAttachmentAnnotationLinks(&annots, n) + annots.printf("]") + f.out(annots.String()) + } + if f.pdfVersion > "1.3" { + f.out("/Group <>") + } + f.outf("/Contents %d 0 R>>", f.n+1) + f.out("endobj") + // Page content + f.newobj() + if f.compress { + data := sliceCompress(f.pages[n].Bytes()) + f.outf("<>", len(data)) + f.putstream(data) + } else { + f.outf("<>", f.pages[n].Len()) + f.putstream(f.pages[n].Bytes()) + } + f.out("endobj") + } + // Pages root + f.offsets[1] = f.buffer.Len() + f.out("1 0 obj") + f.out("<>") + f.out("endobj") +} + +func (f *Fpdf) putfonts() { + if f.err != nil { + return + } + nf := f.n + for _, diff := range f.diffs { + // Encodings + f.newobj() + f.outf("<>", diff) + f.out("endobj") + } + { + var fileList []string + var info fontFileType + var file string + for file = range f.fontFiles { + fileList = append(fileList, file) + } + if f.catalogSort { + sort.SliceStable(fileList, func(i, j int) bool { return fileList[i] < fileList[j] }) + } + for _, file = range fileList { + info = f.fontFiles[file] + if info.fontType != "UTF8" { + f.newobj() + info.n = f.n + f.fontFiles[file] = info + + var font []byte + + if info.embedded { + font = info.content + } else { + var err error + font, err = f.loadFontFile(file) + if err != nil { + f.err = err + return + } + } + compressed := file[len(file)-2:] == ".z" + if !compressed && info.length2 > 0 { + buf := font[6:info.length1] + buf = append(buf, font[6+info.length1+6:info.length2]...) + font = buf + } + f.outf("< 0 { + f.outf("/Length2 %d /Length3 0", info.length2) + } + f.out(">>") + f.putstream(font) + f.out("endobj") + } + } + } + { + var keyList []string + var font fontDefType + var key string + for key = range f.fonts { + keyList = append(keyList, key) + } + if f.catalogSort { + sort.SliceStable(keyList, func(i, j int) bool { return keyList[i] < keyList[j] }) + } + for _, key = range keyList { + font = f.fonts[key] + // Font objects + font.N = f.n + 1 + f.fonts[key] = font + tp := font.Tp + name := font.Name + switch tp { + case "Core": + // Core font + f.newobj() + f.out("<>") + f.out("endobj") + case "Type1": + fallthrough + case "TrueType": + // Additional Type1 or TrueType/OpenType font + f.newobj() + f.out("< 0 { + f.outf("/Encoding %d 0 R", nf+font.DiffN) + } else { + f.out("/Encoding /WinAnsiEncoding") + } + f.out(">>") + f.out("endobj") + // Widths + f.newobj() + var s fmtBuffer + s.WriteString("[") + for j := 32; j < 256; j++ { + s.printf("%d ", font.Cw[j]) + } + s.WriteString("]") + f.out(s.String()) + f.out("endobj") + // Descriptor + f.newobj() + s.Truncate(0) + s.printf("<>", suffix, f.fontFiles[font.File].n) + f.out(s.String()) + f.out("endobj") + case "UTF8": + fontName := "utf8" + font.Name + usedRunes := font.usedRunes + delete(usedRunes, 0) + utf8FontStream := font.utf8File.GenerateCutFont(usedRunes) + utf8FontSize := len(utf8FontStream) + compressedFontStream := sliceCompress(utf8FontStream) + CodeSignDictionary := font.utf8File.CodeSymbolDictionary + delete(CodeSignDictionary, 0) + + f.newobj() + f.out(fmt.Sprintf("<>\n"+"endobj", fontName, f.n+1, f.n+2)) + + f.newobj() + f.out("<>") + f.out("endobj") + + f.newobj() + f.out("<>") + f.putstream([]byte(toUnicode)) + f.out("endobj") + + // CIDInfo + f.newobj() + f.out("<>") + f.out("endobj") + + // Font descriptor + f.newobj() + var s fmtBuffer + s.printf("<>") + f.out(s.String()) + f.out("endobj") + + // Embed CIDToGIDMap + cidToGidMap := make([]byte, 256*256*2) + + for cc, glyph := range CodeSignDictionary { + cidToGidMap[cc*2] = byte(glyph >> 8) + cidToGidMap[cc*2+1] = byte(glyph & 0xFF) + } + + cidToGidMap = sliceCompress(cidToGidMap) + f.newobj() + f.out("<>") + f.putstream(cidToGidMap) + f.out("endobj") + + //Font file + f.newobj() + f.out("<>") + f.putstream(compressedFontStream) + f.out("endobj") + default: + f.err = fmt.Errorf("unsupported font type: %s", tp) + return + } + } + } + return +} + +func (f *Fpdf) generateCIDFontMap(font *fontDefType, LastRune int) { + rangeID := 0 + cidArray := make(map[int]*untypedKeyMap) + cidArrayKeys := make([]int, 0) + prevCid := -2 + prevWidth := -1 + interval := false + startCid := 1 + cwLen := LastRune + 1 + + // for each character + for cid := startCid; cid < cwLen; cid++ { + if font.Cw[cid] == 0x00 { + continue + } + width := font.Cw[cid] + if width == 65535 { + width = 0 + } + if numb, OK := font.usedRunes[cid]; cid > 255 && (!OK || numb == 0) { + continue + } + + if cid == prevCid+1 { + if width == prevWidth { + + if width == cidArray[rangeID].get(0) { + cidArray[rangeID].put(nil, width) + } else { + cidArray[rangeID].pop() + rangeID = prevCid + r := untypedKeyMap{ + valueSet: make([]int, 0), + keySet: make([]interface{}, 0), + } + cidArray[rangeID] = &r + cidArrayKeys = append(cidArrayKeys, rangeID) + cidArray[rangeID].put(nil, prevWidth) + cidArray[rangeID].put(nil, width) + } + interval = true + cidArray[rangeID].put("interval", 1) + } else { + if interval { + // new range + rangeID = cid + r := untypedKeyMap{ + valueSet: make([]int, 0), + keySet: make([]interface{}, 0), + } + cidArray[rangeID] = &r + cidArrayKeys = append(cidArrayKeys, rangeID) + cidArray[rangeID].put(nil, width) + } else { + cidArray[rangeID].put(nil, width) + } + interval = false + } + } else { + rangeID = cid + r := untypedKeyMap{ + valueSet: make([]int, 0), + keySet: make([]interface{}, 0), + } + cidArray[rangeID] = &r + cidArrayKeys = append(cidArrayKeys, rangeID) + cidArray[rangeID].put(nil, width) + interval = false + } + prevCid = cid + prevWidth = width + + } + previousKey := -1 + nextKey := -1 + isInterval := false + for g := 0; g < len(cidArrayKeys); { + key := cidArrayKeys[g] + ws := *cidArray[key] + cws := len(ws.keySet) + if (key == nextKey) && (!isInterval) && (ws.getIndex("interval") < 0 || cws < 4) { + if cidArray[key].getIndex("interval") >= 0 { + cidArray[key].delete("interval") + } + cidArray[previousKey] = arrayMerge(cidArray[previousKey], cidArray[key]) + cidArrayKeys = remove(cidArrayKeys, key) + } else { + g++ + previousKey = key + } + nextKey = key + cws + // ui := ws.getIndex("interval") + // ui = ui + 1 + if ws.getIndex("interval") >= 0 { + if cws > 3 { + isInterval = true + } else { + isInterval = false + } + cidArray[key].delete("interval") + nextKey-- + } else { + isInterval = false + } + } + var w fmtBuffer + for _, k := range cidArrayKeys { + ws := cidArray[k] + if len(arrayCountValues(ws.valueSet)) == 1 { + w.printf(" %d %d %d", k, k+len(ws.valueSet)-1, ws.get(0)) + } else { + w.printf(" %d [ %s ]\n", k, implode(" ", ws.valueSet)) + } + } + f.out("/W [" + w.String() + " ]") +} + +func implode(sep string, arr []int) string { + var s fmtBuffer + for i := 0; i < len(arr)-1; i++ { + s.printf("%v", arr[i]) + s.printf(sep) + } + if len(arr) > 0 { + s.printf("%v", arr[len(arr)-1]) + } + return s.String() +} + +// arrayCountValues counts the occurrences of each item in the $mp array. +func arrayCountValues(mp []int) map[int]int { + answer := make(map[int]int) + for _, v := range mp { + answer[v] = answer[v] + 1 + } + return answer +} + +func (f *Fpdf) loadFontFile(name string) ([]byte, error) { + if f.fontLoader != nil { + reader, err := f.fontLoader.Open(name) + if err == nil { + data, err := ioutil.ReadAll(reader) + if closer, ok := reader.(io.Closer); ok { + closer.Close() + } + return data, err + } + } + return ioutil.ReadFile(path.Join(f.fontpath, name)) +} + +func (f *Fpdf) putimages() { + var keyList []string + var key string + for key = range f.images { + keyList = append(keyList, key) + } + + // Sort the keyList []string by the corresponding image's width. + if f.catalogSort { + sort.SliceStable(keyList, func(i, j int) bool { return f.images[keyList[i]].w < f.images[keyList[j]].w }) + } + + // Maintain a list of inserted image SHA-1 hashes, with their + // corresponding object ID number. + insertedImages := map[string]int{} + + for _, key = range keyList { + image := f.images[key] + + // Check if this image has already been inserted using it's SHA-1 hash. + insertedImageObjN, isFound := insertedImages[image.i] + + // If found, skip inserting the image as a new object, and + // use the object ID from the insertedImages map. + // If not, insert the image into the PDF and store the object ID. + if isFound { + image.n = insertedImageObjN + } else { + f.putimage(image) + insertedImages[image.i] = image.n + } + } +} + +func (f *Fpdf) putimage(info *ImageInfoType) { + f.newobj() + info.n = f.n + f.out("< 0 { + f.outf("/Filter /%s", info.f) + } + if len(info.dp) > 0 { + f.outf("/DecodeParms <<%s>>", info.dp) + } + if len(info.trns) > 0 { + var trns fmtBuffer + for _, v := range info.trns { + trns.printf("%d %d ", v, v) + } + f.outf("/Mask [%s]", trns.String()) + } + if info.smask != nil { + f.outf("/SMask %d 0 R", f.n+1) + } + f.outf("/Length %d>>", len(info.data)) + f.putstream(info.data) + f.out("endobj") + // Soft mask + if len(info.smask) > 0 { + smask := &ImageInfoType{ + w: info.w, + h: info.h, + cs: "DeviceGray", + bpc: 8, + f: info.f, + dp: sprintf("/Predictor 15 /Colors 1 /BitsPerComponent 8 /Columns %d", int(info.w)), + data: info.smask, + scale: f.k, + } + f.putimage(smask) + } + // Palette + if info.cs == "Indexed" { + f.newobj() + if f.compress { + pal := sliceCompress(info.pal) + f.outf("<>", len(pal)) + f.putstream(pal) + } else { + f.outf("<>", len(info.pal)) + f.putstream(info.pal) + } + f.out("endobj") + } +} + +func (f *Fpdf) putxobjectdict() { + { + var image *ImageInfoType + var key string + var keyList []string + for key = range f.images { + keyList = append(keyList, key) + } + if f.catalogSort { + sort.SliceStable(keyList, func(i, j int) bool { return f.images[keyList[i]].i < f.images[keyList[j]].i }) + } + for _, key = range keyList { + image = f.images[key] + f.outf("/I%s %d 0 R", image.i, image.n) + } + } + { + var keyList []string + var key string + var tpl Template + keyList = templateKeyList(f.templates, f.catalogSort) + for _, key = range keyList { + tpl = f.templates[key] + // for _, tpl := range f.templates { + id := tpl.ID() + if objID, ok := f.templateObjects[id]; ok { + f.outf("/TPL%s %d 0 R", id, objID) + } + } + } + { + for tplName, objID := range f.importedTplObjs { + // here replace obj id hash with n + f.outf("%s %d 0 R", tplName, f.importedTplIDs[objID]) + } + } +} + +func (f *Fpdf) putresourcedict() { + f.out("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]") + f.out("/Font <<") + { + var keyList []string + var font fontDefType + var key string + for key = range f.fonts { + keyList = append(keyList, key) + } + if f.catalogSort { + sort.SliceStable(keyList, func(i, j int) bool { return f.fonts[keyList[i]].i < f.fonts[keyList[j]].i }) + } + for _, key = range keyList { + font = f.fonts[key] + f.outf("/F%s %d 0 R", font.i, font.N) + } + } + f.out(">>") + f.out("/XObject <<") + f.putxobjectdict() + f.out(">>") + count := len(f.blendList) + if count > 1 { + f.out("/ExtGState <<") + for j := 1; j < count; j++ { + f.outf("/GS%d %d 0 R", j, f.blendList[j].objNum) + } + f.out(">>") + } + count = len(f.gradientList) + if count > 1 { + f.out("/Shading <<") + for j := 1; j < count; j++ { + f.outf("/Sh%d %d 0 R", j, f.gradientList[j].objNum) + } + f.out(">>") + } + // Layers + f.layerPutResourceDict() + f.spotColorPutResourceDict() +} + +func (f *Fpdf) putBlendModes() { + count := len(f.blendList) + for j := 1; j < count; j++ { + bl := f.blendList[j] + f.newobj() + f.blendList[j].objNum = f.n + f.outf("<>", + bl.fillStr, bl.strokeStr, bl.modeStr) + f.out("endobj") + } +} + +func (f *Fpdf) putGradients() { + count := len(f.gradientList) + for j := 1; j < count; j++ { + var f1 int + gr := f.gradientList[j] + if gr.tp == 2 || gr.tp == 3 { + f.newobj() + f.outf("<>", gr.clr1Str, gr.clr2Str) + f.out("endobj") + f1 = f.n + } + f.newobj() + f.outf("<>", + gr.x1, gr.y1, gr.x2, gr.y2, f1) + } else if gr.tp == 3 { + f.outf("/Coords [%.5f %.5f 0 %.5f %.5f %.5f] /Function %d 0 R /Extend [true true]>>", + gr.x1, gr.y1, gr.x2, gr.y2, gr.r, f1) + } + f.out("endobj") + f.gradientList[j].objNum = f.n + } +} + +func (f *Fpdf) putjavascript() { + if f.javascript == nil { + return + } + + f.newobj() + f.nJs = f.n + f.out("<<") + f.outf("/Names [(EmbeddedJS) %d 0 R]", f.n+1) + f.out(">>") + f.out("endobj") + f.newobj() + f.out("<<") + f.out("/S /JavaScript") + f.outf("/JS %s", f.textstring(*f.javascript)) + f.out(">>") + f.out("endobj") +} + +func (f *Fpdf) putresources() { + if f.err != nil { + return + } + f.layerPutLayers() + f.putBlendModes() + f.putGradients() + f.putSpotColors() + f.putfonts() + if f.err != nil { + return + } + f.putimages() + f.putTemplates() + f.putImportedTemplates() // gofpdi + // Resource dictionary + f.offsets[2] = f.buffer.Len() + f.out("2 0 obj") + f.out("<<") + f.putresourcedict() + f.out(">>") + f.out("endobj") + f.putjavascript() + if f.protect.encrypted { + f.newobj() + f.protect.objNum = f.n + f.out("<<") + f.out("/Filter /Standard") + f.out("/V 1") + f.out("/R 2") + f.outf("/O (%s)", f.escape(string(f.protect.oValue))) + f.outf("/U (%s)", f.escape(string(f.protect.uValue))) + f.outf("/P %d", f.protect.pValue) + f.out(">>") + f.out("endobj") + } + return +} + +// returns Now() if tm is zero +func timeOrNow(tm time.Time) time.Time { + if tm.IsZero() { + return time.Now() + } + return tm +} + +func (f *Fpdf) putinfo() { + if len(f.producer) > 0 { + f.outf("/Producer %s", f.textstring(f.producer)) + } + if len(f.title) > 0 { + f.outf("/Title %s", f.textstring(f.title)) + } + if len(f.subject) > 0 { + f.outf("/Subject %s", f.textstring(f.subject)) + } + if len(f.author) > 0 { + f.outf("/Author %s", f.textstring(f.author)) + } + if len(f.keywords) > 0 { + f.outf("/Keywords %s", f.textstring(f.keywords)) + } + if len(f.creator) > 0 { + f.outf("/Creator %s", f.textstring(f.creator)) + } + creation := timeOrNow(f.creationDate) + f.outf("/CreationDate %s", f.textstring("D:"+creation.Format("20060102150405"))) + mod := timeOrNow(f.modDate) + f.outf("/ModDate %s", f.textstring("D:"+mod.Format("20060102150405"))) +} + +func (f *Fpdf) putcatalog() { + f.out("/Type /Catalog") + f.out("/Pages 1 0 R") + switch f.zoomMode { + case "fullpage": + f.out("/OpenAction [3 0 R /Fit]") + case "fullwidth": + f.out("/OpenAction [3 0 R /FitH null]") + case "real": + f.out("/OpenAction [3 0 R /XYZ null null 1]") + } + // } else if !is_string($this->zoomMode)) + // $this->out('/OpenAction [3 0 R /XYZ null null '.sprintf('%.2f',$this->zoomMode/100).']'); + switch f.layoutMode { + case "single", "SinglePage": + f.out("/PageLayout /SinglePage") + case "continuous", "OneColumn": + f.out("/PageLayout /OneColumn") + case "two", "TwoColumnLeft": + f.out("/PageLayout /TwoColumnLeft") + case "TwoColumnRight": + f.out("/PageLayout /TwoColumnRight") + case "TwoPageLeft", "TwoPageRight": + if f.pdfVersion < "1.5" { + f.pdfVersion = "1.5" + } + f.out("/PageLayout /" + f.layoutMode) + } + // Bookmarks + if len(f.outlines) > 0 { + f.outf("/Outlines %d 0 R", f.outlineRoot) + f.out("/PageMode /UseOutlines") + } + // Layers + f.layerPutCatalog() + // Name dictionary : + // -> Javascript + // -> Embedded files + f.out("/Names <<") + // JavaScript + if f.javascript != nil { + f.outf("/JavaScript %d 0 R", f.nJs) + } + // Embedded files + f.outf("/EmbeddedFiles %s", f.getEmbeddedFiles()) + f.out(">>") +} + +func (f *Fpdf) putheader() { + if len(f.blendMap) > 0 && f.pdfVersion < "1.4" { + f.pdfVersion = "1.4" + } + f.outf("%%PDF-%s", f.pdfVersion) +} + +func (f *Fpdf) puttrailer() { + f.outf("/Size %d", f.n+1) + f.outf("/Root %d 0 R", f.n) + f.outf("/Info %d 0 R", f.n-1) + if f.protect.encrypted { + f.outf("/Encrypt %d 0 R", f.protect.objNum) + f.out("/ID [()()]") + } +} + +func (f *Fpdf) putxmp() { + if len(f.xmp) == 0 { + return + } + f.newobj() + f.outf("<< /Type /Metadata /Subtype /XML /Length %d >>", len(f.xmp)) + f.putstream(f.xmp) + f.out("endobj") +} + +func (f *Fpdf) putbookmarks() { + nb := len(f.outlines) + if nb > 0 { + lru := make(map[int]int) + level := 0 + for i, o := range f.outlines { + if o.level > 0 { + parent := lru[o.level-1] + f.outlines[i].parent = parent + f.outlines[parent].last = i + if o.level > level { + f.outlines[parent].first = i + } + } else { + f.outlines[i].parent = nb + } + if o.level <= level && i > 0 { + prev := lru[o.level] + f.outlines[prev].next = i + f.outlines[i].prev = prev + } + lru[o.level] = i + level = o.level + } + n := f.n + 1 + for _, o := range f.outlines { + f.newobj() + f.outf("<>") + f.out("endobj") + } + f.newobj() + f.outlineRoot = f.n + f.outf("<>", n+lru[0]) + f.out("endobj") + } +} + +func (f *Fpdf) enddoc() { + if f.err != nil { + return + } + f.layerEndDoc() + f.putheader() + // Embedded files + f.putAttachments() + f.putAnnotationsAttachments() + f.putpages() + f.putresources() + if f.err != nil { + return + } + // Bookmarks + f.putbookmarks() + // Metadata + f.putxmp() + // Info + f.newobj() + f.out("<<") + f.putinfo() + f.out(">>") + f.out("endobj") + // Catalog + f.newobj() + f.out("<<") + f.putcatalog() + f.out(">>") + f.out("endobj") + // Cross-ref + o := f.buffer.Len() + f.out("xref") + f.outf("0 %d", f.n+1) + f.out("0000000000 65535 f ") + for j := 1; j <= f.n; j++ { + f.outf("%010d 00000 n ", f.offsets[j]) + } + // Trailer + f.out("trailer") + f.out("<<") + f.puttrailer() + f.out(">>") + f.out("startxref") + f.outf("%d", o) + f.out("%%EOF") + f.state = 3 + return +} + +// Path Drawing + +// MoveTo moves the stylus to (x, y) without drawing the path from the +// previous point. Paths must start with a MoveTo to set the original +// stylus location or the result is undefined. +// +// Create a "path" by moving a virtual stylus around the page (with +// MoveTo, LineTo, CurveTo, CurveBezierCubicTo, ArcTo & ClosePath) +// then draw it or fill it in (with DrawPath). The main advantage of +// using the path drawing routines rather than multiple Fpdf.Line is +// that PDF creates nice line joins at the angles, rather than just +// overlaying the lines. +func (f *Fpdf) MoveTo(x, y float64) { + f.point(x, y) + f.x, f.y = x, y +} + +// LineTo creates a line from the current stylus location to (x, y), which +// becomes the new stylus location. Note that this only creates the line in +// the path; it does not actually draw the line on the page. +// +// The MoveTo() example demonstrates this method. +func (f *Fpdf) LineTo(x, y float64) { + f.outf("%.2f %.2f l", x*f.k, (f.h-y)*f.k) + f.x, f.y = x, y +} + +// CurveTo creates a single-segment quadratic Bézier curve. The curve starts at +// the current stylus location and ends at the point (x, y). The control point +// (cx, cy) specifies the curvature. At the start point, the curve is tangent +// to the straight line between the current stylus location and the control +// point. At the end point, the curve is tangent to the straight line between +// the end point and the control point. +// +// The MoveTo() example demonstrates this method. +func (f *Fpdf) CurveTo(cx, cy, x, y float64) { + f.outf("%.5f %.5f %.5f %.5f v", cx*f.k, (f.h-cy)*f.k, x*f.k, (f.h-y)*f.k) + f.x, f.y = x, y +} + +// CurveBezierCubicTo creates a single-segment cubic Bézier curve. The curve +// starts at the current stylus location and ends at the point (x, y). The +// control points (cx0, cy0) and (cx1, cy1) specify the curvature. At the +// current stylus, the curve is tangent to the straight line between the +// current stylus location and the control point (cx0, cy0). At the end point, +// the curve is tangent to the straight line between the end point and the +// control point (cx1, cy1). +// +// The MoveTo() example demonstrates this method. +func (f *Fpdf) CurveBezierCubicTo(cx0, cy0, cx1, cy1, x, y float64) { + f.curve(cx0, cy0, cx1, cy1, x, y) + f.x, f.y = x, y +} + +// ClosePath creates a line from the current location to the last MoveTo point +// (if not the same) and mark the path as closed so the first and last lines +// join nicely. +// +// The MoveTo() example demonstrates this method. +func (f *Fpdf) ClosePath() { + f.outf("h") +} + +// DrawPath actually draws the path on the page. +// +// styleStr can be "F" for filled, "D" for outlined only, or "DF" or "FD" for +// outlined and filled. An empty string will be replaced with "D". +// Path-painting operators as defined in the PDF specification are also +// allowed: "S" (Stroke the path), "s" (Close and stroke the path), +// "f" (fill the path, using the nonzero winding number), "f*" +// (Fill the path, using the even-odd rule), "B" (Fill and then stroke +// the path, using the nonzero winding number rule), "B*" (Fill and +// then stroke the path, using the even-odd rule), "b" (Close, fill, +// and then stroke the path, using the nonzero winding number rule) and +// "b*" (Close, fill, and then stroke the path, using the even-odd +// rule). +// Drawing uses the current draw color, line width, and cap style +// centered on the +// path. Filling uses the current fill color. +// +// The MoveTo() example demonstrates this method. +func (f *Fpdf) DrawPath(styleStr string) { + f.outf(fillDrawOp(styleStr)) +} + +// ArcTo draws an elliptical arc centered at point (x, y). rx and ry specify its +// horizontal and vertical radii. If the start of the arc is not at +// the current position, a connecting line will be drawn. +// +// degRotate specifies the angle that the arc will be rotated. degStart and +// degEnd specify the starting and ending angle of the arc. All angles are +// specified in degrees and measured counter-clockwise from the 3 o'clock +// position. +// +// styleStr can be "F" for filled, "D" for outlined only, or "DF" or "FD" for +// outlined and filled. An empty string will be replaced with "D". Drawing uses +// the current draw color, line width, and cap style centered on the arc's +// path. Filling uses the current fill color. +// +// The MoveTo() example demonstrates this method. +func (f *Fpdf) ArcTo(x, y, rx, ry, degRotate, degStart, degEnd float64) { + f.arc(x, y, rx, ry, degRotate, degStart, degEnd, "", true) +} + +func (f *Fpdf) arc(x, y, rx, ry, degRotate, degStart, degEnd float64, + styleStr string, path bool) { + x *= f.k + y = (f.h - y) * f.k + rx *= f.k + ry *= f.k + segments := int(degEnd-degStart) / 60 + if segments < 2 { + segments = 2 + } + angleStart := degStart * math.Pi / 180 + angleEnd := degEnd * math.Pi / 180 + angleTotal := angleEnd - angleStart + dt := angleTotal / float64(segments) + dtm := dt / 3 + if degRotate != 0 { + a := -degRotate * math.Pi / 180 + f.outf("q %.5f %.5f %.5f %.5f %.5f %.5f cm", + math.Cos(a), -1*math.Sin(a), + math.Sin(a), math.Cos(a), x, y) + x = 0 + y = 0 + } + t := angleStart + a0 := x + rx*math.Cos(t) + b0 := y + ry*math.Sin(t) + c0 := -rx * math.Sin(t) + d0 := ry * math.Cos(t) + sx := a0 / f.k // start point of arc + sy := f.h - (b0 / f.k) + if path { + if f.x != sx || f.y != sy { + // Draw connecting line to start point + f.LineTo(sx, sy) + } + } else { + f.point(sx, sy) + } + for j := 1; j <= segments; j++ { + // Draw this bit of the total curve + t = (float64(j) * dt) + angleStart + a1 := x + rx*math.Cos(t) + b1 := y + ry*math.Sin(t) + c1 := -rx * math.Sin(t) + d1 := ry * math.Cos(t) + f.curve((a0+(c0*dtm))/f.k, + f.h-((b0+(d0*dtm))/f.k), + (a1-(c1*dtm))/f.k, + f.h-((b1-(d1*dtm))/f.k), + a1/f.k, + f.h-(b1/f.k)) + a0 = a1 + b0 = b1 + c0 = c1 + d0 = d1 + if path { + f.x = a1 / f.k + f.y = f.h - (b1 / f.k) + } + } + if !path { + f.out(fillDrawOp(styleStr)) + } + if degRotate != 0 { + f.out("Q") + } +} diff --git a/backend/vendor/github.com/phpdave11/gofpdf/fpdftrans.go b/backend/vendor/github.com/phpdave11/gofpdf/fpdftrans.go new file mode 100644 index 00000000..9cda3977 --- /dev/null +++ b/backend/vendor/github.com/phpdave11/gofpdf/fpdftrans.go @@ -0,0 +1,213 @@ +package gofpdf + +import ( + "fmt" + "math" +) + +// Routines in this file are translated from the work of Moritz Wagner and +// Andreas Würmser. + +// TransformMatrix is used for generalized transformations of text, drawings +// and images. +type TransformMatrix struct { + A, B, C, D, E, F float64 +} + +// TransformBegin sets up a transformation context for subsequent text, +// drawings and images. The typical usage is to immediately follow a call to +// this method with a call to one or more of the transformation methods such as +// TransformScale(), TransformSkew(), etc. This is followed by text, drawing or +// image output and finally a call to TransformEnd(). All transformation +// contexts must be properly ended prior to outputting the document. +func (f *Fpdf) TransformBegin() { + f.transformNest++ + f.out("q") +} + +// TransformScaleX scales the width of the following text, drawings and images. +// scaleWd is the percentage scaling factor. (x, y) is center of scaling. +// +// The TransformBegin() example demonstrates this method. +func (f *Fpdf) TransformScaleX(scaleWd, x, y float64) { + f.TransformScale(scaleWd, 100, x, y) +} + +// TransformScaleY scales the height of the following text, drawings and +// images. scaleHt is the percentage scaling factor. (x, y) is center of +// scaling. +// +// The TransformBegin() example demonstrates this method. +func (f *Fpdf) TransformScaleY(scaleHt, x, y float64) { + f.TransformScale(100, scaleHt, x, y) +} + +// TransformScaleXY uniformly scales the width and height of the following +// text, drawings and images. s is the percentage scaling factor for both width +// and height. (x, y) is center of scaling. +// +// The TransformBegin() example demonstrates this method. +func (f *Fpdf) TransformScaleXY(s, x, y float64) { + f.TransformScale(s, s, x, y) +} + +// TransformScale generally scales the following text, drawings and images. +// scaleWd and scaleHt are the percentage scaling factors for width and height. +// (x, y) is center of scaling. +// +// The TransformBegin() example demonstrates this method. +func (f *Fpdf) TransformScale(scaleWd, scaleHt, x, y float64) { + if scaleWd == 0 || scaleHt == 0 { + f.err = fmt.Errorf("scale factor cannot be zero") + return + } + y = (f.h - y) * f.k + x *= f.k + scaleWd /= 100 + scaleHt /= 100 + f.Transform(TransformMatrix{scaleWd, 0, 0, + scaleHt, x * (1 - scaleWd), y * (1 - scaleHt)}) +} + +// TransformMirrorHorizontal horizontally mirrors the following text, drawings +// and images. x is the axis of reflection. +// +// The TransformBegin() example demonstrates this method. +func (f *Fpdf) TransformMirrorHorizontal(x float64) { + f.TransformScale(-100, 100, x, f.y) +} + +// TransformMirrorVertical vertically mirrors the following text, drawings and +// images. y is the axis of reflection. +// +// The TransformBegin() example demonstrates this method. +func (f *Fpdf) TransformMirrorVertical(y float64) { + f.TransformScale(100, -100, f.x, y) +} + +// TransformMirrorPoint symmetrically mirrors the following text, drawings and +// images on the point specified by (x, y). +// +// The TransformBegin() example demonstrates this method. +func (f *Fpdf) TransformMirrorPoint(x, y float64) { + f.TransformScale(-100, -100, x, y) +} + +// TransformMirrorLine symmetrically mirrors the following text, drawings and +// images on the line defined by angle and the point (x, y). angles is +// specified in degrees and measured counter-clockwise from the 3 o'clock +// position. +// +// The TransformBegin() example demonstrates this method. +func (f *Fpdf) TransformMirrorLine(angle, x, y float64) { + f.TransformScale(-100, 100, x, y) + f.TransformRotate(-2*(angle-90), x, y) +} + +// TransformTranslateX moves the following text, drawings and images +// horizontally by the amount specified by tx. +// +// The TransformBegin() example demonstrates this method. +func (f *Fpdf) TransformTranslateX(tx float64) { + f.TransformTranslate(tx, 0) +} + +// TransformTranslateY moves the following text, drawings and images vertically +// by the amount specified by ty. +// +// The TransformBegin() example demonstrates this method. +func (f *Fpdf) TransformTranslateY(ty float64) { + f.TransformTranslate(0, ty) +} + +// TransformTranslate moves the following text, drawings and images +// horizontally and vertically by the amounts specified by tx and ty. +// +// The TransformBegin() example demonstrates this method. +func (f *Fpdf) TransformTranslate(tx, ty float64) { + f.Transform(TransformMatrix{1, 0, 0, 1, tx * f.k, -ty * f.k}) +} + +// TransformRotate rotates the following text, drawings and images around the +// center point (x, y). angle is specified in degrees and measured +// counter-clockwise from the 3 o'clock position. +// +// The TransformBegin() example demonstrates this method. +func (f *Fpdf) TransformRotate(angle, x, y float64) { + y = (f.h - y) * f.k + x *= f.k + angle = angle * math.Pi / 180 + var tm TransformMatrix + tm.A = math.Cos(angle) + tm.B = math.Sin(angle) + tm.C = -tm.B + tm.D = tm.A + tm.E = x + tm.B*y - tm.A*x + tm.F = y - tm.A*y - tm.B*x + f.Transform(tm) +} + +// TransformSkewX horizontally skews the following text, drawings and images +// keeping the point (x, y) stationary. angleX ranges from -90 degrees (skew to +// the left) to 90 degrees (skew to the right). +// +// The TransformBegin() example demonstrates this method. +func (f *Fpdf) TransformSkewX(angleX, x, y float64) { + f.TransformSkew(angleX, 0, x, y) +} + +// TransformSkewY vertically skews the following text, drawings and images +// keeping the point (x, y) stationary. angleY ranges from -90 degrees (skew to +// the bottom) to 90 degrees (skew to the top). +// +// The TransformBegin() example demonstrates this method. +func (f *Fpdf) TransformSkewY(angleY, x, y float64) { + f.TransformSkew(0, angleY, x, y) +} + +// TransformSkew generally skews the following text, drawings and images +// keeping the point (x, y) stationary. angleX ranges from -90 degrees (skew to +// the left) to 90 degrees (skew to the right). angleY ranges from -90 degrees +// (skew to the bottom) to 90 degrees (skew to the top). +// +// The TransformBegin() example demonstrates this method. +func (f *Fpdf) TransformSkew(angleX, angleY, x, y float64) { + if angleX <= -90 || angleX >= 90 || angleY <= -90 || angleY >= 90 { + f.err = fmt.Errorf("skew values must be between -90° and 90°") + return + } + x *= f.k + y = (f.h - y) * f.k + var tm TransformMatrix + tm.A = 1 + tm.B = math.Tan(angleY * math.Pi / 180) + tm.C = math.Tan(angleX * math.Pi / 180) + tm.D = 1 + tm.E = -tm.C * y + tm.F = -tm.B * x + f.Transform(tm) +} + +// Transform generally transforms the following text, drawings and images +// according to the specified matrix. It is typically easier to use the various +// methods such as TransformRotate() and TransformMirrorVertical() instead. +func (f *Fpdf) Transform(tm TransformMatrix) { + if f.transformNest > 0 { + f.outf("%.5f %.5f %.5f %.5f %.5f %.5f cm", + tm.A, tm.B, tm.C, tm.D, tm.E, tm.F) + } else if f.err == nil { + f.err = fmt.Errorf("transformation context is not active") + } +} + +// TransformEnd applies a transformation that was begun with a call to TransformBegin(). +// +// The TransformBegin() example demonstrates this method. +func (f *Fpdf) TransformEnd() { + if f.transformNest > 0 { + f.transformNest-- + f.out("Q") + } else { + f.err = fmt.Errorf("error attempting to end transformation operation out of sequence") + } +} diff --git a/backend/vendor/github.com/phpdave11/gofpdf/grid.go b/backend/vendor/github.com/phpdave11/gofpdf/grid.go new file mode 100644 index 00000000..aca8508c --- /dev/null +++ b/backend/vendor/github.com/phpdave11/gofpdf/grid.go @@ -0,0 +1,446 @@ +package gofpdf + +import ( + "math" + "strconv" +) + +func unused(args ...interface{}) { +} + +// RGBType holds fields for red, green and blue color components (0..255) +type RGBType struct { + R, G, B int +} + +// RGBAType holds fields for red, green and blue color components (0..255) and +// an alpha transparency value (0..1) +type RGBAType struct { + R, G, B int + Alpha float64 +} + +// StateType holds various commonly used drawing values for convenient +// retrieval (StateGet()) and restore (Put) methods. +type StateType struct { + clrDraw, clrText, clrFill RGBType + lineWd float64 + fontSize float64 + alpha float64 + blendStr string + cellMargin float64 +} + +// StateGet returns a variable that contains common state values. +func StateGet(pdf *Fpdf) (st StateType) { + st.clrDraw.R, st.clrDraw.G, st.clrDraw.B = pdf.GetDrawColor() + st.clrFill.R, st.clrFill.G, st.clrFill.B = pdf.GetFillColor() + st.clrText.R, st.clrText.G, st.clrText.B = pdf.GetTextColor() + st.lineWd = pdf.GetLineWidth() + _, st.fontSize = pdf.GetFontSize() + st.alpha, st.blendStr = pdf.GetAlpha() + st.cellMargin = pdf.GetCellMargin() + return +} + +// Put sets the common state values contained in the state structure +// specified by st. +func (st StateType) Put(pdf *Fpdf) { + pdf.SetDrawColor(st.clrDraw.R, st.clrDraw.G, st.clrDraw.B) + pdf.SetFillColor(st.clrFill.R, st.clrFill.G, st.clrFill.B) + pdf.SetTextColor(st.clrText.R, st.clrText.G, st.clrText.B) + pdf.SetLineWidth(st.lineWd) + pdf.SetFontUnitSize(st.fontSize) + pdf.SetAlpha(st.alpha, st.blendStr) + pdf.SetCellMargin(st.cellMargin) +} + +// TickFormatFncType defines a callback for label drawing. +type TickFormatFncType func(val float64, precision int) string + +// defaultFormatter returns the string form of val with precision decimal places. +func defaultFormatter(val float64, precision int) string { + return strconv.FormatFloat(val, 'f', precision, 64) +} + +// GridType assists with the generation of graphs. It allows the application to +// work with logical data coordinates rather than page coordinates and assists +// with the drawing of a background grid. +type GridType struct { + // Chart coordinates in page units + x, y, w, h float64 + // X, Y, Wd, Ht float64 + // Slopes and intercepts scale data points to graph coordinates linearly + xm, xb, ym, yb float64 + // Tickmarks + xTicks, yTicks []float64 + // Labels are inside of graph boundary + XLabelIn, YLabelIn bool + // Labels on X-axis should be rotated + XLabelRotate bool + // Formatters; use nil to eliminate labels + XTickStr, YTickStr TickFormatFncType + // Subdivisions between tickmarks + XDiv, YDiv int + // Formatting precision + xPrecision, yPrecision int + // Line and label colors + ClrText, ClrMain, ClrSub RGBAType + // Line thickness + WdMain, WdSub float64 + // Label height in points + TextSize float64 +} + +// linear returns the slope and y-intercept of the straight line joining the +// two specified points. For scaling purposes, associate the arguments as +// follows: x1: observed low value, y1: desired low value, x2: observed high +// value, y2: desired high value. +func linear(x1, y1, x2, y2 float64) (slope, intercept float64) { + if x2 != x1 { + slope = (y2 - y1) / (x2 - x1) + intercept = y2 - x2*slope + } + return +} + +// linearTickmark returns the slope and intercept that will linearly map data +// values (the range of which is specified by the tickmark slice tm) to page +// values (the range of which is specified by lo and hi). +func linearTickmark(tm []float64, lo, hi float64) (slope, intercept float64) { + ln := len(tm) + if ln > 0 { + slope, intercept = linear(tm[0], lo, tm[ln-1], hi) + } + return +} + +// NewGrid returns a variable of type GridType that is initialized to draw on a +// rectangle of width w and height h with the upper left corner positioned at +// point (x, y). The coordinates are in page units, that is, the same as those +// specified in New(). +// +// The returned variable is initialized with a very simple default tickmark +// layout that ranges from 0 to 1 in both axes. Prior to calling Grid(), the +// application may establish a more suitable tickmark layout by calling the +// methods TickmarksContainX() and TickmarksContainY(). These methods bound the +// data range with appropriate boundaries and divisions. Alternatively, if the +// exact extent and divisions of the tickmark layout are known, the methods +// TickmarksExtentX() and TickmarksExtentY may be called instead. +func NewGrid(x, y, w, h float64) (grid GridType) { + grid.x = x + grid.y = y + grid.w = w + grid.h = h + grid.TextSize = 7 // Points + grid.TickmarksExtentX(0, 1, 1) + grid.TickmarksExtentY(0, 1, 1) + grid.XLabelIn = false + grid.YLabelIn = false + grid.XLabelRotate = false + grid.XDiv = 10 + grid.YDiv = 10 + grid.ClrText = RGBAType{R: 0, G: 0, B: 0, Alpha: 1} + grid.ClrMain = RGBAType{R: 128, G: 160, B: 128, Alpha: 1} + grid.ClrSub = RGBAType{R: 192, G: 224, B: 192, Alpha: 1} + grid.WdMain = 0.1 + grid.WdSub = 0.1 + grid.YTickStr = defaultFormatter + grid.XTickStr = defaultFormatter + return +} + +// WdAbs returns the absolute value of dataWd, specified in logical data units, +// that has been converted to the unit of measure specified in New(). +func (g GridType) WdAbs(dataWd float64) float64 { + return math.Abs(g.xm * dataWd) +} + +// Wd converts dataWd, specified in logical data units, to the unit of measure +// specified in New(). +func (g GridType) Wd(dataWd float64) float64 { + return g.xm * dataWd +} + +// XY converts dataX and dataY, specified in logical data units, to the X and Y +// position on the current page. +func (g GridType) XY(dataX, dataY float64) (x, y float64) { + return g.xm*dataX + g.xb, g.ym*dataY + g.yb +} + +// Pos returns the point, in page units, indicated by the relative positions +// xRel and yRel. These are values between 0 and 1. xRel specifies the relative +// position between the grid's left and right edges. yRel specifies the +// relative position between the grid's bottom and top edges. +func (g GridType) Pos(xRel, yRel float64) (x, y float64) { + x = g.w*xRel + g.x + y = g.h*(1-yRel) + g.y + return +} + +// X converts dataX, specified in logical data units, to the X position on the +// current page. +func (g GridType) X(dataX float64) float64 { + return g.xm*dataX + g.xb +} + +// HtAbs returns the absolute value of dataHt, specified in logical data units, +// that has been converted to the unit of measure specified in New(). +func (g GridType) HtAbs(dataHt float64) float64 { + return math.Abs(g.ym * dataHt) +} + +// Ht converts dataHt, specified in logical data units, to the unit of measure +// specified in New(). +func (g GridType) Ht(dataHt float64) float64 { + return g.ym * dataHt +} + +// Y converts dataY, specified in logical data units, to the Y position on the +// current page. +func (g GridType) Y(dataY float64) float64 { + return g.ym*dataY + g.yb +} + +// XRange returns the minimum and maximum values for the current tickmark +// sequence. These correspond to the data values of the graph's left and right +// edges. +func (g GridType) XRange() (min, max float64) { + min = g.xTicks[0] + max = g.xTicks[len(g.xTicks)-1] + return +} + +// YRange returns the minimum and maximum values for the current tickmark +// sequence. These correspond to the data values of the graph's bottom and top +// edges. +func (g GridType) YRange() (min, max float64) { + min = g.yTicks[0] + max = g.yTicks[len(g.yTicks)-1] + return +} + +// TickmarksContainX sets the tickmarks to be shown by Grid() in the horizontal +// dimension. The argument min and max specify the minimum and maximum values +// to be contained within the grid. The tickmark values that are generated are +// suitable for general purpose graphs. +// +// See TickmarkExtentX() for an alternative to this method to be used when the +// exact values of the tickmarks are to be set by the application. +func (g *GridType) TickmarksContainX(min, max float64) { + g.xTicks, g.xPrecision = Tickmarks(min, max) + g.xm, g.xb = linearTickmark(g.xTicks, g.x, g.x+g.w) +} + +// TickmarksContainY sets the tickmarks to be shown by Grid() in the vertical +// dimension. The argument min and max specify the minimum and maximum values +// to be contained within the grid. The tickmark values that are generated are +// suitable for general purpose graphs. +// +// See TickmarkExtentY() for an alternative to this method to be used when the +// exact values of the tickmarks are to be set by the application. +func (g *GridType) TickmarksContainY(min, max float64) { + g.yTicks, g.yPrecision = Tickmarks(min, max) + g.ym, g.yb = linearTickmark(g.yTicks, g.y+g.h, g.y) +} + +func extent(min, div float64, count int) (tm []float64, precision int) { + tm = make([]float64, count+1) + for j := 0; j <= count; j++ { + tm[j] = min + min += div + } + precision = TickmarkPrecision(div) + return +} + +// TickmarksExtentX sets the tickmarks to be shown by Grid() in the horizontal +// dimension. count specifies number of major tickmark subdivisions to be +// graphed. min specifies the leftmost data value. div specifies, in data +// units, the extent of each major tickmark subdivision. +// +// See TickmarkContainX() for an alternative to this method to be used when +// viewer-friendly tickmarks are to be determined automatically. +func (g *GridType) TickmarksExtentX(min, div float64, count int) { + g.xTicks, g.xPrecision = extent(min, div, count) + g.xm, g.xb = linearTickmark(g.xTicks, g.x, g.x+g.w) +} + +// TickmarksExtentY sets the tickmarks to be shown by Grid() in the vertical +// dimension. count specifies number of major tickmark subdivisions to be +// graphed. min specifies the bottommost data value. div specifies, in data +// units, the extent of each major tickmark subdivision. +// +// See TickmarkContainY() for an alternative to this method to be used when +// viewer-friendly tickmarks are to be determined automatically. +func (g *GridType) TickmarksExtentY(min, div float64, count int) { + g.yTicks, g.yPrecision = extent(min, div, count) + g.ym, g.yb = linearTickmark(g.yTicks, g.y+g.h, g.y) +} + +// func (g *GridType) SetXExtent(dataLf, paperLf, dataRt, paperRt float64) { +// g.xm, g.xb = linear(dataLf, paperLf, dataRt, paperRt) +// } + +// func (g *GridType) SetYExtent(dataTp, paperTp, dataBt, paperBt float64) { +// g.ym, g.yb = linear(dataTp, paperTp, dataBt, paperBt) +// } + +func lineAttr(pdf *Fpdf, clr RGBAType, lineWd float64) { + pdf.SetLineWidth(lineWd) + pdf.SetAlpha(clr.Alpha, "Normal") + pdf.SetDrawColor(clr.R, clr.G, clr.B) +} + +// Grid generates a graph-paperlike set of grid lines on the current page. +func (g GridType) Grid(pdf *Fpdf) { + var st StateType + var yLen, xLen int + var textSz, halfTextSz, yMin, yMax, xMin, xMax, yDiv, xDiv float64 + var str string + var strOfs, strWd, tp, bt, lf, rt, drawX, drawY float64 + + xLen = len(g.xTicks) + yLen = len(g.yTicks) + if xLen > 1 && yLen > 1 { + + st = StateGet(pdf) + + line := func(x1, y1, x2, y2 float64, heavy bool) { + if heavy { + lineAttr(pdf, g.ClrMain, g.WdMain) + } else { + lineAttr(pdf, g.ClrSub, g.WdSub) + } + pdf.Line(x1, y1, x2, y2) + } + + textSz = pdf.PointToUnitConvert(g.TextSize) + halfTextSz = textSz / 2 + + pdf.SetAutoPageBreak(false, 0) + pdf.SetFontUnitSize(textSz) + strOfs = pdf.GetStringWidth("0") + pdf.SetFillColor(255, 255, 255) + pdf.SetCellMargin(0) + + xMin = g.xTicks[0] + xMax = g.xTicks[xLen-1] + + yMin = g.yTicks[0] + yMax = g.yTicks[yLen-1] + + lf = g.X(xMin) + rt = g.X(xMax) + bt = g.Y(yMin) + tp = g.Y(yMax) + + // Verticals along X axis + xDiv = g.xTicks[1] - g.xTicks[0] + if g.XDiv > 0 { + xDiv = xDiv / float64(g.XDiv) + } + xDiv = g.Wd(xDiv) + for j, x := range g.xTicks { + drawX = g.X(x) + line(drawX, tp, drawX, bt, true) + if j < xLen-1 { + for k := 1; k < g.XDiv; k++ { + drawX += xDiv + line(drawX, tp, drawX, bt, false) + } + } + } + + // Horizontals along Y axis + yDiv = g.yTicks[1] - g.yTicks[0] + if g.YDiv > 0 { + yDiv = yDiv / float64(g.YDiv) + } + yDiv = g.Ht(yDiv) + for j, y := range g.yTicks { + drawY = g.Y(y) + line(lf, drawY, rt, drawY, true) + if j < yLen-1 { + for k := 1; k < g.YDiv; k++ { + drawY += yDiv + line(lf, drawY, rt, drawY, false) + } + } + } + + // X labels + if g.XTickStr != nil { + drawY = bt + for _, x := range g.xTicks { + str = g.XTickStr(x, g.xPrecision) + strWd = pdf.GetStringWidth(str) + drawX = g.X(x) + if g.XLabelRotate { + pdf.TransformBegin() + pdf.TransformRotate(90, drawX, drawY) + if g.XLabelIn { + pdf.SetXY(drawX+strOfs, drawY-halfTextSz) + } else { + pdf.SetXY(drawX-strOfs-strWd, drawY-halfTextSz) + } + pdf.CellFormat(strWd, textSz, str, "", 0, "L", true, 0, "") + pdf.TransformEnd() + } else { + drawX -= strWd / 2.0 + if g.XLabelIn { + pdf.SetXY(drawX, drawY-textSz-strOfs) + } else { + pdf.SetXY(drawX, drawY+strOfs) + } + pdf.CellFormat(strWd, textSz, str, "", 0, "L", true, 0, "") + } + } + } + + // Y labels + if g.YTickStr != nil { + drawX = lf + for _, y := range g.yTicks { + // str = strconv.FormatFloat(y, 'f', g.yPrecision, 64) + str = g.YTickStr(y, g.yPrecision) + strWd = pdf.GetStringWidth(str) + if g.YLabelIn { + pdf.SetXY(drawX+strOfs, g.Y(y)-halfTextSz) + } else { + pdf.SetXY(lf-strOfs-strWd, g.Y(y)-halfTextSz) + } + pdf.CellFormat(strWd, textSz, str, "", 0, "L", true, 0, "") + } + } + + // Restore drawing attributes + st.Put(pdf) + + } + +} + +// Plot plots a series of count line segments from xMin to xMax. It repeatedly +// calls fnc(x) to retrieve the y value associate with x. The currently +// selected line drawing attributes are used. +func (g GridType) Plot(pdf *Fpdf, xMin, xMax float64, count int, fnc func(x float64) (y float64)) { + if count > 0 { + var x, delta, drawX0, drawY0, drawX1, drawY1 float64 + delta = (xMax - xMin) / float64(count) + x = xMin + for j := 0; j <= count; j++ { + if j == 0 { + drawX1 = g.X(x) + drawY1 = g.Y(fnc(x)) + } else { + pdf.Line(drawX0, drawY0, drawX1, drawY1) + } + x += delta + drawX0 = drawX1 + drawY0 = drawY1 + drawX1 = g.X(x) + drawY1 = g.Y(fnc(x)) + } + } +} diff --git a/backend/vendor/github.com/phpdave11/gofpdf/htmlbasic.go b/backend/vendor/github.com/phpdave11/gofpdf/htmlbasic.go new file mode 100644 index 00000000..9e4eca4e --- /dev/null +++ b/backend/vendor/github.com/phpdave11/gofpdf/htmlbasic.go @@ -0,0 +1,220 @@ +/* + * Copyright (c) 2014 Kurt Jung (Gmail: kurt.w.jung) + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package gofpdf + +import ( + "regexp" + "strings" +) + +// HTMLBasicSegmentType defines a segment of literal text in which the current +// attributes do not vary, or an open tag or a close tag. +type HTMLBasicSegmentType struct { + Cat byte // 'O' open tag, 'C' close tag, 'T' text + Str string // Literal text unchanged, tags are lower case + Attr map[string]string // Attribute keys are lower case +} + +// HTMLBasicTokenize returns a list of HTML tags and literal elements. This is +// done with regular expressions, so the result is only marginally better than +// useless. +func HTMLBasicTokenize(htmlStr string) (list []HTMLBasicSegmentType) { + // This routine is adapted from http://www.fpdf.org/ + list = make([]HTMLBasicSegmentType, 0, 16) + htmlStr = strings.Replace(htmlStr, "\n", " ", -1) + htmlStr = strings.Replace(htmlStr, "\r", "", -1) + tagRe, _ := regexp.Compile(`(?U)<.*>`) + attrRe, _ := regexp.Compile(`([^=]+)=["']?([^"']+)`) + capList := tagRe.FindAllStringIndex(htmlStr, -1) + if capList != nil { + var seg HTMLBasicSegmentType + var parts []string + pos := 0 + for _, cap := range capList { + if pos < cap[0] { + seg.Cat = 'T' + seg.Str = htmlStr[pos:cap[0]] + seg.Attr = nil + list = append(list, seg) + } + if htmlStr[cap[0]+1] == '/' { + seg.Cat = 'C' + seg.Str = strings.ToLower(htmlStr[cap[0]+2 : cap[1]-1]) + seg.Attr = nil + list = append(list, seg) + } else { + // Extract attributes + parts = strings.Split(htmlStr[cap[0]+1:cap[1]-1], " ") + if len(parts) > 0 { + for j, part := range parts { + if j == 0 { + seg.Cat = 'O' + seg.Str = strings.ToLower(parts[0]) + seg.Attr = make(map[string]string) + } else { + attrList := attrRe.FindAllStringSubmatch(part, -1) + if attrList != nil { + for _, attr := range attrList { + seg.Attr[strings.ToLower(attr[1])] = attr[2] + } + } + } + } + list = append(list, seg) + } + } + pos = cap[1] + } + if len(htmlStr) > pos { + seg.Cat = 'T' + seg.Str = htmlStr[pos:] + seg.Attr = nil + list = append(list, seg) + } + } else { + list = append(list, HTMLBasicSegmentType{Cat: 'T', Str: htmlStr, Attr: nil}) + } + return +} + +// HTMLBasicType is used for rendering a very basic subset of HTML. It supports +// only hyperlinks and bold, italic and underscore attributes. In the Link +// structure, the ClrR, ClrG and ClrB fields (0 through 255) define the color +// of hyperlinks. The Bold, Italic and Underscore values define the hyperlink +// style. +type HTMLBasicType struct { + pdf *Fpdf + Link struct { + ClrR, ClrG, ClrB int + Bold, Italic, Underscore bool + } +} + +// HTMLBasicNew returns an instance that facilitates writing basic HTML in the +// specified PDF file. +func (f *Fpdf) HTMLBasicNew() (html HTMLBasicType) { + html.pdf = f + html.Link.ClrR, html.Link.ClrG, html.Link.ClrB = 0, 0, 128 + html.Link.Bold, html.Link.Italic, html.Link.Underscore = false, false, true + return +} + +// Write prints text from the current position using the currently selected +// font. See HTMLBasicNew() to create a receiver that is associated with the +// PDF document instance. The text can be encoded with a basic subset of HTML +// that includes hyperlinks and tags for italic (I), bold (B), underscore +// (U) and center (CENTER) attributes. When the right margin is reached a line +// break occurs and text continues from the left margin. Upon method exit, the +// current position is left at the end of the text. +// +// lineHt indicates the line height in the unit of measure specified in New(). +func (html *HTMLBasicType) Write(lineHt float64, htmlStr string) { + var boldLvl, italicLvl, underscoreLvl, linkBold, linkItalic, linkUnderscore int + var textR, textG, textB = html.pdf.GetTextColor() + var hrefStr string + if html.Link.Bold { + linkBold = 1 + } + if html.Link.Italic { + linkItalic = 1 + } + if html.Link.Underscore { + linkUnderscore = 1 + } + setStyle := func(boldAdj, italicAdj, underscoreAdj int) { + styleStr := "" + boldLvl += boldAdj + if boldLvl > 0 { + styleStr += "B" + } + italicLvl += italicAdj + if italicLvl > 0 { + styleStr += "I" + } + underscoreLvl += underscoreAdj + if underscoreLvl > 0 { + styleStr += "U" + } + html.pdf.SetFont("", styleStr, 0) + } + putLink := func(urlStr, txtStr string) { + // Put a hyperlink + html.pdf.SetTextColor(html.Link.ClrR, html.Link.ClrG, html.Link.ClrB) + setStyle(linkBold, linkItalic, linkUnderscore) + html.pdf.WriteLinkString(lineHt, txtStr, urlStr) + setStyle(-linkBold, -linkItalic, -linkUnderscore) + html.pdf.SetTextColor(textR, textG, textB) + } + list := HTMLBasicTokenize(htmlStr) + var ok bool + alignStr := "L" + for _, el := range list { + switch el.Cat { + case 'T': + if len(hrefStr) > 0 { + putLink(hrefStr, el.Str) + hrefStr = "" + } else { + if alignStr == "C" || alignStr == "R" { + html.pdf.WriteAligned(0, lineHt, el.Str, alignStr) + } else { + html.pdf.Write(lineHt, el.Str) + } + } + case 'O': + switch el.Str { + case "b": + setStyle(1, 0, 0) + case "i": + setStyle(0, 1, 0) + case "u": + setStyle(0, 0, 1) + case "br": + html.pdf.Ln(lineHt) + case "center": + html.pdf.Ln(lineHt) + alignStr = "C" + case "right": + html.pdf.Ln(lineHt) + alignStr = "R" + case "left": + html.pdf.Ln(lineHt) + alignStr = "L" + case "a": + hrefStr, ok = el.Attr["href"] + if !ok { + hrefStr = "" + } + } + case 'C': + switch el.Str { + case "b": + setStyle(-1, 0, 0) + case "i": + setStyle(0, -1, 0) + case "u": + setStyle(0, 0, -1) + case "center": + html.pdf.Ln(lineHt) + alignStr = "L" + case "right": + html.pdf.Ln(lineHt) + alignStr = "L" + } + } + } +} diff --git a/backend/vendor/github.com/phpdave11/gofpdf/label.go b/backend/vendor/github.com/phpdave11/gofpdf/label.go new file mode 100644 index 00000000..b90d8f32 --- /dev/null +++ b/backend/vendor/github.com/phpdave11/gofpdf/label.go @@ -0,0 +1,82 @@ +package gofpdf + +// Adapted from Nice Numbers for Graph Labels by Paul Heckbert from "Graphics +// Gems", Academic Press, 1990 + +// Paul Heckbert 2 Dec 88 + +// https://github.com/erich666/GraphicsGems + +// LICENSE + +// This code repository predates the concept of Open Source, and predates most +// licenses along such lines. As such, the official license truly is: + +// EULA: The Graphics Gems code is copyright-protected. In other words, you +// cannot claim the text of the code as your own and resell it. Using the code +// is permitted in any program, product, or library, non-commercial or +// commercial. Giving credit is not required, though is a nice gesture. The +// code comes as-is, and if there are any flaws or problems with any Gems code, +// nobody involved with Gems - authors, editors, publishers, or webmasters - +// are to be held responsible. Basically, don't be a jerk, and remember that +// anything free comes with no guarantee. + +import ( + "math" +) + +// niceNum returns a "nice" number approximately equal to x. The number is +// rounded if round is true, converted to its ceiling otherwise. +func niceNum(val float64, round bool) float64 { + var nf float64 + + exp := int(math.Floor(math.Log10(val))) + f := val / math.Pow10(exp) + if round { + switch { + case f < 1.5: + nf = 1 + case f < 3.0: + nf = 2 + case f < 7.0: + nf = 5 + default: + nf = 10 + } + } else { + switch { + case f <= 1: + nf = 1 + case f <= 2.0: + nf = 2 + case f <= 5.0: + nf = 5 + default: + nf = 10 + } + } + return nf * math.Pow10(exp) +} + +// TickmarkPrecision returns an appropriate precision value for label +// formatting. +func TickmarkPrecision(div float64) int { + return int(math.Max(-math.Floor(math.Log10(div)), 0)) +} + +// Tickmarks returns a slice of tickmarks appropriate for a chart axis and an +// appropriate precision for formatting purposes. The values min and max will +// be contained within the tickmark range. +func Tickmarks(min, max float64) (list []float64, precision int) { + if max > min { + spread := niceNum(max-min, false) + d := niceNum((spread / 4), true) + graphMin := math.Floor(min/d) * d + graphMax := math.Ceil(max/d) * d + precision = TickmarkPrecision(d) + for x := graphMin; x < graphMax+0.5*d; x += d { + list = append(list, x) + } + } + return +} diff --git a/backend/vendor/github.com/phpdave11/gofpdf/layer.go b/backend/vendor/github.com/phpdave11/gofpdf/layer.go new file mode 100644 index 00000000..bca364f9 --- /dev/null +++ b/backend/vendor/github.com/phpdave11/gofpdf/layer.go @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2014 Kurt Jung (Gmail: kurt.w.jung) + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package gofpdf + +// Routines in this file are translated from +// http://www.fpdf.org/en/script/script97.php + +type layerType struct { + name string + visible bool + objNum int // object number +} + +type layerRecType struct { + list []layerType + currentLayer int + openLayerPane bool +} + +func (f *Fpdf) layerInit() { + f.layer.list = make([]layerType, 0) + f.layer.currentLayer = -1 + f.layer.openLayerPane = false +} + +// AddLayer defines a layer that can be shown or hidden when the document is +// displayed. name specifies the layer name that the document reader will +// display in the layer list. visible specifies whether the layer will be +// initially visible. The return value is an integer ID that is used in a call +// to BeginLayer(). +func (f *Fpdf) AddLayer(name string, visible bool) (layerID int) { + layerID = len(f.layer.list) + f.layer.list = append(f.layer.list, layerType{name: name, visible: visible}) + return +} + +// BeginLayer is called to begin adding content to the specified layer. All +// content added to the page between a call to BeginLayer and a call to +// EndLayer is added to the layer specified by id. See AddLayer for more +// details. +func (f *Fpdf) BeginLayer(id int) { + f.EndLayer() + if id >= 0 && id < len(f.layer.list) { + f.outf("/OC /OC%d BDC", id) + f.layer.currentLayer = id + } +} + +// EndLayer is called to stop adding content to the currently active layer. See +// BeginLayer for more details. +func (f *Fpdf) EndLayer() { + if f.layer.currentLayer >= 0 { + f.out("EMC") + f.layer.currentLayer = -1 + } +} + +// OpenLayerPane advises the document reader to open the layer pane when the +// document is initially displayed. +func (f *Fpdf) OpenLayerPane() { + f.layer.openLayerPane = true +} + +func (f *Fpdf) layerEndDoc() { + if len(f.layer.list) > 0 { + if f.pdfVersion < "1.5" { + f.pdfVersion = "1.5" + } + } +} + +func (f *Fpdf) layerPutLayers() { + for j, l := range f.layer.list { + f.newobj() + f.layer.list[j].objNum = f.n + f.outf("<>", f.textstring(utf8toutf16(l.name))) + f.out("endobj") + } +} + +func (f *Fpdf) layerPutResourceDict() { + if len(f.layer.list) > 0 { + f.out("/Properties <<") + for j, layer := range f.layer.list { + f.outf("/OC%d %d 0 R", j, layer.objNum) + } + f.out(">>") + } + +} + +func (f *Fpdf) layerPutCatalog() { + if len(f.layer.list) > 0 { + onStr := "" + offStr := "" + for _, layer := range f.layer.list { + onStr += sprintf("%d 0 R ", layer.objNum) + if !layer.visible { + offStr += sprintf("%d 0 R ", layer.objNum) + } + } + f.outf("/OCProperties <>>>", onStr, offStr, onStr) + if f.layer.openLayerPane { + f.out("/PageMode /UseOC") + } + } +} diff --git a/backend/vendor/github.com/phpdave11/gofpdf/png.go b/backend/vendor/github.com/phpdave11/gofpdf/png.go new file mode 100644 index 00000000..15002b3f --- /dev/null +++ b/backend/vendor/github.com/phpdave11/gofpdf/png.go @@ -0,0 +1,213 @@ +/* + * Copyright (c) 2013-2016 Kurt Jung (Gmail: kurt.w.jung) + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package gofpdf + +import ( + "bytes" + "fmt" + "strings" +) + +func (f *Fpdf) pngColorSpace(ct byte) (colspace string, colorVal int) { + colorVal = 1 + switch ct { + case 0, 4: + colspace = "DeviceGray" + case 2, 6: + colspace = "DeviceRGB" + colorVal = 3 + case 3: + colspace = "Indexed" + default: + f.err = fmt.Errorf("unknown color type in PNG buffer: %d", ct) + } + return +} + +func (f *Fpdf) parsepngstream(buf *bytes.Buffer, readdpi bool) (info *ImageInfoType) { + info = f.newImageInfo() + // Check signature + if string(buf.Next(8)) != "\x89PNG\x0d\x0a\x1a\x0a" { + f.err = fmt.Errorf("not a PNG buffer") + return + } + // Read header chunk + _ = buf.Next(4) + if string(buf.Next(4)) != "IHDR" { + f.err = fmt.Errorf("incorrect PNG buffer") + return + } + w := f.readBeInt32(buf) + h := f.readBeInt32(buf) + bpc := f.readByte(buf) + if bpc > 8 { + f.err = fmt.Errorf("16-bit depth not supported in PNG file") + } + ct := f.readByte(buf) + var colspace string + var colorVal int + colspace, colorVal = f.pngColorSpace(ct) + if f.err != nil { + return + } + if f.readByte(buf) != 0 { + f.err = fmt.Errorf("'unknown compression method in PNG buffer") + return + } + if f.readByte(buf) != 0 { + f.err = fmt.Errorf("'unknown filter method in PNG buffer") + return + } + if f.readByte(buf) != 0 { + f.err = fmt.Errorf("interlacing not supported in PNG buffer") + return + } + _ = buf.Next(4) + dp := sprintf("/Predictor 15 /Colors %d /BitsPerComponent %d /Columns %d", colorVal, bpc, w) + // Scan chunks looking for palette, transparency and image data + pal := make([]byte, 0, 32) + var trns []int + data := make([]byte, 0, 32) + loop := true + for loop { + n := int(f.readBeInt32(buf)) + // dbg("Loop [%d]", n) + switch string(buf.Next(4)) { + case "PLTE": + // dbg("PLTE") + // Read palette + pal = buf.Next(n) + _ = buf.Next(4) + case "tRNS": + // dbg("tRNS") + // Read transparency info + t := buf.Next(n) + switch ct { + case 0: + trns = []int{int(t[1])} // ord(substr($t,1,1))); + case 2: + trns = []int{int(t[1]), int(t[3]), int(t[5])} // array(ord(substr($t,1,1)), ord(substr($t,3,1)), ord(substr($t,5,1))); + default: + pos := strings.Index(string(t), "\x00") + if pos >= 0 { + trns = []int{pos} // array($pos); + } + } + _ = buf.Next(4) + case "IDAT": + // dbg("IDAT") + // Read image data block + data = append(data, buf.Next(n)...) + _ = buf.Next(4) + case "IEND": + // dbg("IEND") + loop = false + case "pHYs": + // dbg("pHYs") + // png files theoretically support different x/y dpi + // but we ignore files like this + // but if they're the same then we can stamp our info + // object with it + x := int(f.readBeInt32(buf)) + y := int(f.readBeInt32(buf)) + units := buf.Next(1)[0] + // fmt.Printf("got a pHYs block, x=%d, y=%d, u=%d, readdpi=%t\n", + // x, y, int(units), readdpi) + // only modify the info block if the user wants us to + if x == y && readdpi { + switch units { + // if units is 1 then measurement is px/meter + case 1: + info.dpi = float64(x) / 39.3701 // inches per meter + default: + info.dpi = float64(x) + } + } + _ = buf.Next(4) + default: + // dbg("default") + _ = buf.Next(n + 4) + } + if loop { + loop = n > 0 + } + } + if colspace == "Indexed" && len(pal) == 0 { + f.err = fmt.Errorf("missing palette in PNG buffer") + } + info.w = float64(w) + info.h = float64(h) + info.cs = colspace + info.bpc = int(bpc) + info.f = "FlateDecode" + info.dp = dp + info.pal = pal + info.trns = trns + // dbg("ct [%d]", ct) + if ct >= 4 { + // Separate alpha and color channels + var err error + data, err = sliceUncompress(data) + if err != nil { + f.err = err + return + } + var color, alpha bytes.Buffer + if ct == 4 { + // Gray image + width := int(w) + height := int(h) + length := 2 * width + var pos, elPos int + for i := 0; i < height; i++ { + pos = (1 + length) * i + color.WriteByte(data[pos]) + alpha.WriteByte(data[pos]) + elPos = pos + 1 + for k := 0; k < width; k++ { + color.WriteByte(data[elPos]) + alpha.WriteByte(data[elPos+1]) + elPos += 2 + } + } + } else { + // RGB image + width := int(w) + height := int(h) + length := 4 * width + var pos, elPos int + for i := 0; i < height; i++ { + pos = (1 + length) * i + color.WriteByte(data[pos]) + alpha.WriteByte(data[pos]) + elPos = pos + 1 + for k := 0; k < width; k++ { + color.Write(data[elPos : elPos+3]) + alpha.WriteByte(data[elPos+3]) + elPos += 4 + } + } + } + data = sliceCompress(color.Bytes()) + info.smask = sliceCompress(alpha.Bytes()) + if f.pdfVersion < "1.4" { + f.pdfVersion = "1.4" + } + } + info.data = data + return +} diff --git a/backend/vendor/github.com/phpdave11/gofpdf/protect.go b/backend/vendor/github.com/phpdave11/gofpdf/protect.go new file mode 100644 index 00000000..9a335345 --- /dev/null +++ b/backend/vendor/github.com/phpdave11/gofpdf/protect.go @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2013-2014 Kurt Jung (Gmail: kurt.w.jung) + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +// PDF protection is adapted from the work of Klemen VODOPIVEC for the fpdf +// product. + +package gofpdf + +import ( + "crypto/md5" + "crypto/rc4" + "encoding/binary" + "math/rand" +) + +// Advisory bitflag constants that control document activities +const ( + CnProtectPrint = 4 + CnProtectModify = 8 + CnProtectCopy = 16 + CnProtectAnnotForms = 32 +) + +type protectType struct { + encrypted bool + uValue []byte + oValue []byte + pValue int + padding []byte + encryptionKey []byte + objNum int + rc4cipher *rc4.Cipher + rc4n uint32 // Object number associated with rc4 cipher +} + +func (p *protectType) rc4(n uint32, buf *[]byte) { + if p.rc4cipher == nil || p.rc4n != n { + p.rc4cipher, _ = rc4.NewCipher(p.objectKey(n)) + p.rc4n = n + } + p.rc4cipher.XORKeyStream(*buf, *buf) +} + +func (p *protectType) objectKey(n uint32) []byte { + var nbuf, b []byte + nbuf = make([]byte, 8, 8) + binary.LittleEndian.PutUint32(nbuf, n) + b = append(b, p.encryptionKey...) + b = append(b, nbuf[0], nbuf[1], nbuf[2], 0, 0) + s := md5.Sum(b) + return s[0:10] +} + +func oValueGen(userPass, ownerPass []byte) (v []byte) { + var c *rc4.Cipher + tmp := md5.Sum(ownerPass) + c, _ = rc4.NewCipher(tmp[0:5]) + size := len(userPass) + v = make([]byte, size, size) + c.XORKeyStream(v, userPass) + return +} + +func (p *protectType) uValueGen() (v []byte) { + var c *rc4.Cipher + c, _ = rc4.NewCipher(p.encryptionKey) + size := len(p.padding) + v = make([]byte, size, size) + c.XORKeyStream(v, p.padding) + return +} + +func (p *protectType) setProtection(privFlag byte, userPassStr, ownerPassStr string) { + privFlag = 192 | (privFlag & (CnProtectCopy | CnProtectModify | CnProtectPrint | CnProtectAnnotForms)) + p.padding = []byte{ + 0x28, 0xBF, 0x4E, 0x5E, 0x4E, 0x75, 0x8A, 0x41, + 0x64, 0x00, 0x4E, 0x56, 0xFF, 0xFA, 0x01, 0x08, + 0x2E, 0x2E, 0x00, 0xB6, 0xD0, 0x68, 0x3E, 0x80, + 0x2F, 0x0C, 0xA9, 0xFE, 0x64, 0x53, 0x69, 0x7A, + } + userPass := []byte(userPassStr) + var ownerPass []byte + if ownerPassStr == "" { + ownerPass = make([]byte, 8, 8) + binary.LittleEndian.PutUint64(ownerPass, uint64(rand.Int63())) + } else { + ownerPass = []byte(ownerPassStr) + } + userPass = append(userPass, p.padding...)[0:32] + ownerPass = append(ownerPass, p.padding...)[0:32] + p.encrypted = true + p.oValue = oValueGen(userPass, ownerPass) + var buf []byte + buf = append(buf, userPass...) + buf = append(buf, p.oValue...) + buf = append(buf, privFlag, 0xff, 0xff, 0xff) + sum := md5.Sum(buf) + p.encryptionKey = sum[0:5] + p.uValue = p.uValueGen() + p.pValue = -(int(privFlag^255) + 1) +} diff --git a/backend/vendor/github.com/phpdave11/gofpdf/splittext.go b/backend/vendor/github.com/phpdave11/gofpdf/splittext.go new file mode 100644 index 00000000..525f93b0 --- /dev/null +++ b/backend/vendor/github.com/phpdave11/gofpdf/splittext.go @@ -0,0 +1,53 @@ +package gofpdf + +import ( + "math" + // "strings" + "unicode" +) + +// SplitText splits UTF-8 encoded text into several lines using the current +// font. Each line has its length limited to a maximum width given by w. This +// function can be used to determine the total height of wrapped text for +// vertical placement purposes. +func (f *Fpdf) SplitText(txt string, w float64) (lines []string) { + cw := f.currentFont.Cw + wmax := int(math.Ceil((w - 2*f.cMargin) * 1000 / f.fontSize)) + s := []rune(txt) // Return slice of UTF-8 runes + nb := len(s) + for nb > 0 && s[nb-1] == '\n' { + nb-- + } + s = s[0:nb] + sep := -1 + i := 0 + j := 0 + l := 0 + for i < nb { + c := s[i] + l += cw[c] + if unicode.IsSpace(c) || isChinese(c) { + sep = i + } + if c == '\n' || l > wmax { + if sep == -1 { + if i == j { + i++ + } + sep = i + } else { + i = sep + 1 + } + lines = append(lines, string(s[j:sep])) + sep = -1 + j = i + l = 0 + } else { + i++ + } + } + if i != j { + lines = append(lines, string(s[j:i])) + } + return lines +} diff --git a/backend/vendor/github.com/phpdave11/gofpdf/spotcolor.go b/backend/vendor/github.com/phpdave11/gofpdf/spotcolor.go new file mode 100644 index 00000000..33aca827 --- /dev/null +++ b/backend/vendor/github.com/phpdave11/gofpdf/spotcolor.go @@ -0,0 +1,184 @@ +// Copyright (c) Kurt Jung (Gmail: kurt.w.jung) +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +// SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION +// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +// Adapted from http://www.fpdf.org/en/script/script89.php by Olivier PLATHEY + +package gofpdf + +import ( + "fmt" + "strings" +) + +func byteBound(v byte) byte { + if v > 100 { + return 100 + } + return v +} + +// AddSpotColor adds an ink-based CMYK color to the gofpdf instance and +// associates it with the specified name. The individual components specify +// percentages ranging from 0 to 100. Values above this are quietly capped to +// 100. An error occurs if the specified name is already associated with a +// color. +func (f *Fpdf) AddSpotColor(nameStr string, c, m, y, k byte) { + if f.err == nil { + _, ok := f.spotColorMap[nameStr] + if !ok { + id := len(f.spotColorMap) + 1 + f.spotColorMap[nameStr] = spotColorType{ + id: id, + val: cmykColorType{ + c: byteBound(c), + m: byteBound(m), + y: byteBound(y), + k: byteBound(k), + }, + } + } else { + f.err = fmt.Errorf("name \"%s\" is already associated with a spot color", nameStr) + } + } +} + +func (f *Fpdf) getSpotColor(nameStr string) (clr spotColorType, ok bool) { + if f.err == nil { + clr, ok = f.spotColorMap[nameStr] + if !ok { + f.err = fmt.Errorf("spot color name \"%s\" is not registered", nameStr) + } + } + return +} + +// SetDrawSpotColor sets the current draw color to the spot color associated +// with nameStr. An error occurs if the name is not associated with a color. +// The value for tint ranges from 0 (no intensity) to 100 (full intensity). It +// is quietly bounded to this range. +func (f *Fpdf) SetDrawSpotColor(nameStr string, tint byte) { + var clr spotColorType + var ok bool + + clr, ok = f.getSpotColor(nameStr) + if ok { + f.color.draw.mode = colorModeSpot + f.color.draw.spotStr = nameStr + f.color.draw.str = sprintf("/CS%d CS %.3f SCN", clr.id, float64(byteBound(tint))/100) + if f.page > 0 { + f.out(f.color.draw.str) + } + } +} + +// SetFillSpotColor sets the current fill color to the spot color associated +// with nameStr. An error occurs if the name is not associated with a color. +// The value for tint ranges from 0 (no intensity) to 100 (full intensity). It +// is quietly bounded to this range. +func (f *Fpdf) SetFillSpotColor(nameStr string, tint byte) { + var clr spotColorType + var ok bool + + clr, ok = f.getSpotColor(nameStr) + if ok { + f.color.fill.mode = colorModeSpot + f.color.fill.spotStr = nameStr + f.color.fill.str = sprintf("/CS%d cs %.3f scn", clr.id, float64(byteBound(tint))/100) + f.colorFlag = f.color.fill.str != f.color.text.str + if f.page > 0 { + f.out(f.color.fill.str) + } + } +} + +// SetTextSpotColor sets the current text color to the spot color associated +// with nameStr. An error occurs if the name is not associated with a color. +// The value for tint ranges from 0 (no intensity) to 100 (full intensity). It +// is quietly bounded to this range. +func (f *Fpdf) SetTextSpotColor(nameStr string, tint byte) { + var clr spotColorType + var ok bool + + clr, ok = f.getSpotColor(nameStr) + if ok { + f.color.text.mode = colorModeSpot + f.color.text.spotStr = nameStr + f.color.text.str = sprintf("/CS%d cs %.3f scn", clr.id, float64(byteBound(tint))/100) + f.colorFlag = f.color.text.str != f.color.text.str + } +} + +func (f *Fpdf) returnSpotColor(clr colorType) (name string, c, m, y, k byte) { + var spotClr spotColorType + var ok bool + + name = clr.spotStr + if name != "" { + spotClr, ok = f.getSpotColor(name) + if ok { + c = spotClr.val.c + m = spotClr.val.m + y = spotClr.val.y + k = spotClr.val.k + } + } + return +} + +// GetDrawSpotColor returns the most recently used spot color information for +// drawing. This will not be the current drawing color if some other color type +// such as RGB is active. If no spot color has been set for drawing, zero +// values are returned. +func (f *Fpdf) GetDrawSpotColor() (name string, c, m, y, k byte) { + return f.returnSpotColor(f.color.draw) +} + +// GetTextSpotColor returns the most recently used spot color information for +// text output. This will not be the current text color if some other color +// type such as RGB is active. If no spot color has been set for text, zero +// values are returned. +func (f *Fpdf) GetTextSpotColor() (name string, c, m, y, k byte) { + return f.returnSpotColor(f.color.text) +} + +// GetFillSpotColor returns the most recently used spot color information for +// fill output. This will not be the current fill color if some other color +// type such as RGB is active. If no fill spot color has been set, zero values +// are returned. +func (f *Fpdf) GetFillSpotColor() (name string, c, m, y, k byte) { + return f.returnSpotColor(f.color.fill) +} + +func (f *Fpdf) putSpotColors() { + for k, v := range f.spotColorMap { + f.newobj() + f.outf("[/Separation /%s", strings.Replace(k, " ", "#20", -1)) + f.out("/DeviceCMYK <<") + f.out("/Range [0 1 0 1 0 1 0 1] /C0 [0 0 0 0] ") + f.outf("/C1 [%.3f %.3f %.3f %.3f] ", float64(v.val.c)/100, float64(v.val.m)/100, + float64(v.val.y)/100, float64(v.val.k)/100) + f.out("/FunctionType 2 /Domain [0 1] /N 1>>]") + f.out("endobj") + v.objID = f.n + f.spotColorMap[k] = v + } +} + +func (f *Fpdf) spotColorPutResourceDict() { + f.out("/ColorSpace <<") + for _, clr := range f.spotColorMap { + f.outf("/CS%d %d 0 R", clr.id, clr.objID) + } + f.out(">>") +} diff --git a/backend/vendor/github.com/phpdave11/gofpdf/subwrite.go b/backend/vendor/github.com/phpdave11/gofpdf/subwrite.go new file mode 100644 index 00000000..e7ebd774 --- /dev/null +++ b/backend/vendor/github.com/phpdave11/gofpdf/subwrite.go @@ -0,0 +1,35 @@ +package gofpdf + +// Adapted from http://www.fpdf.org/en/script/script61.php by Wirus and released with the FPDF license. + +// SubWrite prints text from the current position in the same way as Write(). +// ht is the line height in the unit of measure specified in New(). str +// specifies the text to write. subFontSize is the size of the font in points. +// subOffset is the vertical offset of the text in points; a positive value +// indicates a superscript, a negative value indicates a subscript. link is the +// identifier returned by AddLink() or 0 for no internal link. linkStr is a +// target URL or empty for no external link. A non--zero value for link takes +// precedence over linkStr. +// +// The SubWrite example demonstrates this method. +func (f *Fpdf) SubWrite(ht float64, str string, subFontSize, subOffset float64, link int, linkStr string) { + if f.err != nil { + return + } + // resize font + subFontSizeOld := f.fontSizePt + f.SetFontSize(subFontSize) + // reposition y + subOffset = (((subFontSize - subFontSizeOld) / f.k) * 0.3) + (subOffset / f.k) + subX := f.x + subY := f.y + f.SetXY(subX, subY-subOffset) + //Output text + f.write(ht, str, link, linkStr) + // restore y position + subX = f.x + subY = f.y + f.SetXY(subX, subY+subOffset) + // restore font size + f.SetFontSize(subFontSizeOld) +} diff --git a/backend/vendor/github.com/phpdave11/gofpdf/svgbasic.go b/backend/vendor/github.com/phpdave11/gofpdf/svgbasic.go new file mode 100644 index 00000000..f75d69f2 --- /dev/null +++ b/backend/vendor/github.com/phpdave11/gofpdf/svgbasic.go @@ -0,0 +1,246 @@ +/* + * Copyright (c) 2014 Kurt Jung (Gmail: kurt.w.jung) + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package gofpdf + +import ( + "encoding/xml" + "fmt" + "io/ioutil" + "strconv" + "strings" +) + +var pathCmdSub *strings.Replacer + +func init() { + // Handle permitted constructions like "100L200,230" + pathCmdSub = strings.NewReplacer(",", " ", + "L", " L ", "l", " l ", + "C", " C ", "c", " c ", + "M", " M ", "m", " m ", + "H", " H ", "h", " h ", + "V", " V ", "v", " v ", + "Q", " Q ", "q", " q ", + "Z", " Z ", "z", " z ") +} + +// SVGBasicSegmentType describes a single curve or position segment +type SVGBasicSegmentType struct { + Cmd byte // See http://www.w3.org/TR/SVG/paths.html for path command structure + Arg [6]float64 +} + +func absolutizePath(segs []SVGBasicSegmentType) { + var x, y float64 + var segPtr *SVGBasicSegmentType + adjust := func(pos int, adjX, adjY float64) { + segPtr.Arg[pos] += adjX + segPtr.Arg[pos+1] += adjY + } + for j, seg := range segs { + segPtr = &segs[j] + if j == 0 && seg.Cmd == 'm' { + segPtr.Cmd = 'M' + } + switch segPtr.Cmd { + case 'M': + x = seg.Arg[0] + y = seg.Arg[1] + case 'm': + adjust(0, x, y) + segPtr.Cmd = 'M' + x = segPtr.Arg[0] + y = segPtr.Arg[1] + case 'L': + x = seg.Arg[0] + y = seg.Arg[1] + case 'l': + adjust(0, x, y) + segPtr.Cmd = 'L' + x = segPtr.Arg[0] + y = segPtr.Arg[1] + case 'C': + x = seg.Arg[4] + y = seg.Arg[5] + case 'c': + adjust(0, x, y) + adjust(2, x, y) + adjust(4, x, y) + segPtr.Cmd = 'C' + x = segPtr.Arg[4] + y = segPtr.Arg[5] + case 'Q': + x = seg.Arg[2] + y = seg.Arg[3] + case 'q': + adjust(0, x, y) + adjust(2, x, y) + segPtr.Cmd = 'Q' + x = segPtr.Arg[2] + y = segPtr.Arg[3] + case 'H': + x = seg.Arg[0] + case 'h': + segPtr.Arg[0] += x + segPtr.Cmd = 'H' + x += seg.Arg[0] + case 'V': + y = seg.Arg[0] + case 'v': + segPtr.Arg[0] += y + segPtr.Cmd = 'V' + y += seg.Arg[0] + case 'z': + segPtr.Cmd = 'Z' + } + } +} + +func pathParse(pathStr string) (segs []SVGBasicSegmentType, err error) { + var seg SVGBasicSegmentType + var j, argJ, argCount, prevArgCount int + setup := func(n int) { + // It is not strictly necessary to clear arguments, but result may be clearer + // to caller + for j := 0; j < len(seg.Arg); j++ { + seg.Arg[j] = 0.0 + } + argJ = 0 + argCount = n + prevArgCount = n + } + var str string + var c byte + pathStr = pathCmdSub.Replace(pathStr) + strList := strings.Fields(pathStr) + count := len(strList) + for j = 0; j < count && err == nil; j++ { + str = strList[j] + if argCount == 0 { // Look for path command or argument continuation + c = str[0] + if c == '-' || (c >= '0' && c <= '9') { // More arguments + if j > 0 { + setup(prevArgCount) + // Repeat previous action + if seg.Cmd == 'M' { + seg.Cmd = 'L' + } else if seg.Cmd == 'm' { + seg.Cmd = 'l' + } + } else { + err = fmt.Errorf("expecting SVG path command at first position, got %s", str) + } + } + } + if err == nil { + if argCount == 0 { + seg.Cmd = str[0] + switch seg.Cmd { + case 'M', 'm': // Absolute/relative moveto: x, y + setup(2) + case 'C', 'c': // Absolute/relative Bézier curve: cx0, cy0, cx1, cy1, x1, y1 + setup(6) + case 'H', 'h': // Absolute/relative horizontal line to: x + setup(1) + case 'L', 'l': // Absolute/relative lineto: x, y + setup(2) + case 'Q', 'q': // Absolute/relative quadratic curve: x0, y0, x1, y1 + setup(4) + case 'V', 'v': // Absolute/relative vertical line to: y + setup(1) + case 'Z', 'z': // closepath instruction (takes no arguments) + segs = append(segs, seg) + default: + err = fmt.Errorf("expecting SVG path command at position %d, got %s", j, str) + } + } else { + seg.Arg[argJ], err = strconv.ParseFloat(str, 64) + if err == nil { + argJ++ + argCount-- + if argCount == 0 { + segs = append(segs, seg) + } + } + } + } + } + if err == nil { + if argCount == 0 { + absolutizePath(segs) + } else { + err = fmt.Errorf("expecting additional (%d) numeric arguments", argCount) + } + } + return +} + +// SVGBasicType aggregates the information needed to describe a multi-segment +// basic vector image +type SVGBasicType struct { + Wd, Ht float64 + Segments [][]SVGBasicSegmentType +} + +// SVGBasicParse parses a simple scalable vector graphics (SVG) buffer into a +// descriptor. Only a small subset of the SVG standard, in particular the path +// information generated by jSignature, is supported. The returned path data +// includes only the commands 'M' (absolute moveto: x, y), 'L' (absolute +// lineto: x, y), 'C' (absolute cubic Bézier curve: cx0, cy0, cx1, cy1, +// x1,y1), 'Q' (absolute quadratic Bézier curve: x0, y0, x1, y1) and 'Z' +// (closepath). +func SVGBasicParse(buf []byte) (sig SVGBasicType, err error) { + type pathType struct { + D string `xml:"d,attr"` + } + type srcType struct { + Wd float64 `xml:"width,attr"` + Ht float64 `xml:"height,attr"` + Paths []pathType `xml:"path"` + } + var src srcType + err = xml.Unmarshal(buf, &src) + if err == nil { + if src.Wd > 0 && src.Ht > 0 { + sig.Wd, sig.Ht = src.Wd, src.Ht + var segs []SVGBasicSegmentType + for _, path := range src.Paths { + if err == nil { + segs, err = pathParse(path.D) + if err == nil { + sig.Segments = append(sig.Segments, segs) + } + } + } + } else { + err = fmt.Errorf("unacceptable values for basic SVG extent: %.2f x %.2f", + sig.Wd, sig.Ht) + } + } + return +} + +// SVGBasicFileParse parses a simple scalable vector graphics (SVG) file into a +// basic descriptor. The SVGBasicWrite() example demonstrates this method. +func SVGBasicFileParse(svgFileStr string) (sig SVGBasicType, err error) { + var buf []byte + buf, err = ioutil.ReadFile(svgFileStr) + if err == nil { + sig, err = SVGBasicParse(buf) + } + return +} diff --git a/backend/vendor/github.com/phpdave11/gofpdf/svgwrite.go b/backend/vendor/github.com/phpdave11/gofpdf/svgwrite.go new file mode 100644 index 00000000..398a6dae --- /dev/null +++ b/backend/vendor/github.com/phpdave11/gofpdf/svgwrite.go @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2014 Kurt Jung (Gmail: kurt.w.jung) + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package gofpdf + +// SVGBasicWrite renders the paths encoded in the basic SVG image specified by +// sb. The scale value is used to convert the coordinates in the path to the +// unit of measure specified in New(). The current position (as set with a call +// to SetXY()) is used as the origin of the image. The current line cap style +// (as set with SetLineCapStyle()), line width (as set with SetLineWidth()), +// and draw color (as set with SetDrawColor()) are used in drawing the image +// paths. +func (f *Fpdf) SVGBasicWrite(sb *SVGBasicType, scale float64) { + originX, originY := f.GetXY() + var x, y, newX, newY float64 + var cx0, cy0, cx1, cy1 float64 + var path []SVGBasicSegmentType + var seg SVGBasicSegmentType + var startX, startY float64 + sval := func(origin float64, arg int) float64 { + return origin + scale*seg.Arg[arg] + } + xval := func(arg int) float64 { + return sval(originX, arg) + } + yval := func(arg int) float64 { + return sval(originY, arg) + } + val := func(arg int) (float64, float64) { + return xval(arg), yval(arg + 1) + } + for j := 0; j < len(sb.Segments) && f.Ok(); j++ { + path = sb.Segments[j] + for k := 0; k < len(path) && f.Ok(); k++ { + seg = path[k] + switch seg.Cmd { + case 'M': + x, y = val(0) + startX, startY = x, y + f.SetXY(x, y) + case 'L': + newX, newY = val(0) + f.Line(x, y, newX, newY) + x, y = newX, newY + case 'C': + cx0, cy0 = val(0) + cx1, cy1 = val(2) + newX, newY = val(4) + f.CurveCubic(x, y, cx0, cy0, newX, newY, cx1, cy1, "D") + x, y = newX, newY + case 'Q': + cx0, cy0 = val(0) + newX, newY = val(2) + f.Curve(x, y, cx0, cy0, newX, newY, "D") + x, y = newX, newY + case 'H': + newX = xval(0) + f.Line(x, y, newX, y) + x = newX + case 'V': + newY = yval(0) + f.Line(x, y, x, newY) + y = newY + case 'Z': + f.Line(x, y, startX, startY) + x, y = startX, startY + default: + f.SetErrorf("Unexpected path command '%c'", seg.Cmd) + } + } + } +} diff --git a/backend/vendor/github.com/phpdave11/gofpdf/template.go b/backend/vendor/github.com/phpdave11/gofpdf/template.go new file mode 100644 index 00000000..c0d3933b --- /dev/null +++ b/backend/vendor/github.com/phpdave11/gofpdf/template.go @@ -0,0 +1,284 @@ +package gofpdf + +/* + * Copyright (c) 2015 Kurt Jung (Gmail: kurt.w.jung), + * Marcus Downing, Jan Slabon (Setasign) + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +import ( + "encoding/gob" + "sort" +) + +// CreateTemplate defines a new template using the current page size. +func (f *Fpdf) CreateTemplate(fn func(*Tpl)) Template { + return newTpl(PointType{0, 0}, f.curPageSize, f.defOrientation, f.unitStr, f.fontDirStr, fn, f) +} + +// CreateTemplateCustom starts a template, using the given bounds. +func (f *Fpdf) CreateTemplateCustom(corner PointType, size SizeType, fn func(*Tpl)) Template { + return newTpl(corner, size, f.defOrientation, f.unitStr, f.fontDirStr, fn, f) +} + +// CreateTemplate creates a template that is not attached to any document. +// +// This function is deprecated; it incorrectly assumes that a page with a width +// smaller than its height is oriented in portrait mode, otherwise it assumes +// landscape mode. This causes problems when placing the template in a master +// document where this condition does not apply. CreateTpl() is a similar +// function that lets you specify the orientation to avoid this problem. +func CreateTemplate(corner PointType, size SizeType, unitStr, fontDirStr string, fn func(*Tpl)) Template { + orientationStr := "p" + if size.Wd > size.Ht { + orientationStr = "l" + } + + return CreateTpl(corner, size, orientationStr, unitStr, fontDirStr, fn) +} + +// CreateTpl creates a template not attached to any document +func CreateTpl(corner PointType, size SizeType, orientationStr, unitStr, fontDirStr string, fn func(*Tpl)) Template { + return newTpl(corner, size, orientationStr, unitStr, fontDirStr, fn, nil) +} + +// UseTemplate adds a template to the current page or another template, +// using the size and position at which it was originally written. +func (f *Fpdf) UseTemplate(t Template) { + if t == nil { + f.SetErrorf("template is nil") + return + } + corner, size := t.Size() + f.UseTemplateScaled(t, corner, size) +} + +// UseTemplateScaled adds a template to the current page or another template, +// using the given page coordinates. +func (f *Fpdf) UseTemplateScaled(t Template, corner PointType, size SizeType) { + if t == nil { + f.SetErrorf("template is nil") + return + } + + // You have to add at least a page first + if f.page <= 0 { + f.SetErrorf("cannot use a template without first adding a page") + return + } + + // make a note of the fact that we actually use this template, as well as any other templates, + // images or fonts it uses + f.templates[t.ID()] = t + for _, tt := range t.Templates() { + f.templates[tt.ID()] = tt + } + + // Create a list of existing image SHA-1 hashes. + existingImages := map[string]bool{} + for _, image := range f.images { + existingImages[image.i] = true + } + + // Add each template image to $f, unless already present. + for name, ti := range t.Images() { + if _, found := existingImages[ti.i]; found { + continue + } + name = sprintf("t%s-%s", t.ID(), name) + f.images[name] = ti + } + + // template data + _, templateSize := t.Size() + scaleX := size.Wd / templateSize.Wd + scaleY := size.Ht / templateSize.Ht + tx := corner.X * f.k + ty := (f.curPageSize.Ht - corner.Y - size.Ht) * f.k + + f.outf("q %.4f 0 0 %.4f %.4f %.4f cm", scaleX, scaleY, tx, ty) // Translate + f.outf("/TPL%s Do Q", t.ID()) +} + +// Template is an object that can be written to, then used and re-used any number of times within a document. +type Template interface { + ID() string + Size() (PointType, SizeType) + Bytes() []byte + Images() map[string]*ImageInfoType + Templates() []Template + NumPages() int + FromPage(int) (Template, error) + FromPages() []Template + Serialize() ([]byte, error) + gob.GobDecoder + gob.GobEncoder +} + +func (f *Fpdf) templateFontCatalog() { + var keyList []string + var font fontDefType + var key string + f.out("/Font <<") + for key = range f.fonts { + keyList = append(keyList, key) + } + if f.catalogSort { + sort.Strings(keyList) + } + for _, key = range keyList { + font = f.fonts[key] + f.outf("/F%s %d 0 R", font.i, font.N) + } + f.out(">>") +} + +// putTemplates writes the templates to the PDF +func (f *Fpdf) putTemplates() { + filter := "" + if f.compress { + filter = "/Filter /FlateDecode " + } + + templates := sortTemplates(f.templates, f.catalogSort) + var t Template + for _, t = range templates { + corner, size := t.Size() + + f.newobj() + f.templateObjects[t.ID()] = f.n + f.outf("<<%s/Type /XObject", filter) + f.out("/Subtype /Form") + f.out("/Formtype 1") + f.outf("/BBox [%.2f %.2f %.2f %.2f]", corner.X*f.k, corner.Y*f.k, (corner.X+size.Wd)*f.k, (corner.Y+size.Ht)*f.k) + if corner.X != 0 || corner.Y != 0 { + f.outf("/Matrix [1 0 0 1 %.5f %.5f]", -corner.X*f.k*2, corner.Y*f.k*2) + } + + // Template's resource dictionary + f.out("/Resources ") + f.out("< 0 || len(tTemplates) > 0 { + f.out("/XObject <<") + { + var key string + var keyList []string + var ti *ImageInfoType + for key = range tImages { + keyList = append(keyList, key) + } + if gl.catalogSort { + sort.Strings(keyList) + } + for _, key = range keyList { + // for _, ti := range tImages { + ti = tImages[key] + f.outf("/I%s %d 0 R", ti.i, ti.n) + } + } + for _, tt := range tTemplates { + id := tt.ID() + if objID, ok := f.templateObjects[id]; ok { + f.outf("/TPL%s %d 0 R", id, objID) + } + } + f.out(">>") + } + + f.out(">>") + + // Write the template's byte stream + buffer := t.Bytes() + // fmt.Println("Put template bytes", string(buffer[:])) + if f.compress { + buffer = sliceCompress(buffer) + } + f.outf("/Length %d >>", len(buffer)) + f.putstream(buffer) + f.out("endobj") + } +} + +func templateKeyList(mp map[string]Template, sort bool) (keyList []string) { + var key string + for key = range mp { + keyList = append(keyList, key) + } + if sort { + gensort(len(keyList), + func(a, b int) bool { + return keyList[a] < keyList[b] + }, + func(a, b int) { + keyList[a], keyList[b] = keyList[b], keyList[a] + }) + } + return +} + +// sortTemplates puts templates in a suitable order based on dependices +func sortTemplates(templates map[string]Template, catalogSort bool) []Template { + chain := make([]Template, 0, len(templates)*2) + + // build a full set of dependency chains + var keyList []string + var key string + var t Template + keyList = templateKeyList(templates, catalogSort) + for _, key = range keyList { + t = templates[key] + tlist := templateChainDependencies(t) + for _, tt := range tlist { + if tt != nil { + chain = append(chain, tt) + } + } + } + + // reduce that to make a simple list + sorted := make([]Template, 0, len(templates)) +chain: + for _, t := range chain { + for _, already := range sorted { + if t == already { + continue chain + } + } + sorted = append(sorted, t) + } + + return sorted +} + +// templateChainDependencies is a recursive function for determining the full chain of template dependencies +func templateChainDependencies(template Template) []Template { + requires := template.Templates() + chain := make([]Template, len(requires)*2) + for _, req := range requires { + chain = append(chain, templateChainDependencies(req)...) + } + chain = append(chain, template) + return chain +} + +// < 0002640 31 20 31 32 20 30 20 52 0a 2f 54 50 4c 32 20 31 |1 12 0 R./TPL2 1| +// < 0002650 35 20 30 20 52 0a 2f 54 50 4c 31 20 31 34 20 30 |5 0 R./TPL1 14 0| + +// > 0002640 31 20 31 32 20 30 20 52 0a 2f 54 50 4c 31 20 31 |1 12 0 R./TPL1 1| +// > 0002650 34 20 30 20 52 0a 2f 54 50 4c 32 20 31 35 20 30 |4 0 R./TPL2 15 0| diff --git a/backend/vendor/github.com/phpdave11/gofpdf/template_impl.go b/backend/vendor/github.com/phpdave11/gofpdf/template_impl.go new file mode 100644 index 00000000..c1e2dff3 --- /dev/null +++ b/backend/vendor/github.com/phpdave11/gofpdf/template_impl.go @@ -0,0 +1,303 @@ +package gofpdf + +import ( + "bytes" + "crypto/sha1" + "encoding/gob" + "errors" + "fmt" +) + +/* + * Copyright (c) 2015 Kurt Jung (Gmail: kurt.w.jung), + * Marcus Downing, Jan Slabon (Setasign) + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +// newTpl creates a template, copying graphics settings from a template if one is given +func newTpl(corner PointType, size SizeType, orientationStr, unitStr, fontDirStr string, fn func(*Tpl), copyFrom *Fpdf) Template { + sizeStr := "" + + fpdf := fpdfNew(orientationStr, unitStr, sizeStr, fontDirStr, size) + tpl := Tpl{*fpdf} + if copyFrom != nil { + tpl.loadParamsFromFpdf(copyFrom) + } + tpl.Fpdf.AddPage() + fn(&tpl) + + bytes := make([][]byte, len(tpl.Fpdf.pages)) + // skip the first page as it will always be empty + for x := 1; x < len(bytes); x++ { + bytes[x] = tpl.Fpdf.pages[x].Bytes() + } + + templates := make([]Template, 0, len(tpl.Fpdf.templates)) + for _, key := range templateKeyList(tpl.Fpdf.templates, true) { + templates = append(templates, tpl.Fpdf.templates[key]) + } + images := tpl.Fpdf.images + + template := FpdfTpl{corner, size, bytes, images, templates, tpl.Fpdf.page} + return &template +} + +// FpdfTpl is a concrete implementation of the Template interface. +type FpdfTpl struct { + corner PointType + size SizeType + bytes [][]byte + images map[string]*ImageInfoType + templates []Template + page int +} + +// ID returns the global template identifier +func (t *FpdfTpl) ID() string { + return fmt.Sprintf("%x", sha1.Sum(t.Bytes())) +} + +// Size gives the bounding dimensions of this template +func (t *FpdfTpl) Size() (corner PointType, size SizeType) { + return t.corner, t.size +} + +// Bytes returns the actual template data, not including resources +func (t *FpdfTpl) Bytes() []byte { + return t.bytes[t.page] +} + +// FromPage creates a new template from a specific Page +func (t *FpdfTpl) FromPage(page int) (Template, error) { + // pages start at 1 + if page == 0 { + return nil, errors.New("Pages start at 1 No template will have a page 0") + } + + if page > t.NumPages() { + return nil, fmt.Errorf("The template does not have a page %d", page) + } + // if it is already pointing to the correct page + // there is no need to create a new template + if t.page == page { + return t, nil + } + + t2 := *t + t2.page = page + return &t2, nil +} + +// FromPages creates a template slice with all the pages within a template. +func (t *FpdfTpl) FromPages() []Template { + p := make([]Template, t.NumPages()) + for x := 1; x <= t.NumPages(); x++ { + // the only error is when accessing a + // non existing template... that can't happen + // here + p[x-1], _ = t.FromPage(x) + } + + return p +} + +// Images returns a list of the images used in this template +func (t *FpdfTpl) Images() map[string]*ImageInfoType { + return t.images +} + +// Templates returns a list of templates used in this template +func (t *FpdfTpl) Templates() []Template { + return t.templates +} + +// NumPages returns the number of available pages within the template. Look at FromPage and FromPages on access to that content. +func (t *FpdfTpl) NumPages() int { + // the first page is empty to + // make the pages begin at one + return len(t.bytes) - 1 +} + +// Serialize turns a template into a byte string for later deserialization +func (t *FpdfTpl) Serialize() ([]byte, error) { + b := new(bytes.Buffer) + enc := gob.NewEncoder(b) + err := enc.Encode(t) + + return b.Bytes(), err +} + +// DeserializeTemplate creaties a template from a previously serialized +// template +func DeserializeTemplate(b []byte) (Template, error) { + tpl := new(FpdfTpl) + dec := gob.NewDecoder(bytes.NewBuffer(b)) + err := dec.Decode(tpl) + return tpl, err +} + +// childrenImages returns the next layer of children images, it doesn't dig into +// children of children. Applies template namespace to keys to ensure +// no collisions. See UseTemplateScaled +func (t *FpdfTpl) childrenImages() map[string]*ImageInfoType { + childrenImgs := make(map[string]*ImageInfoType) + + for x := 0; x < len(t.templates); x++ { + imgs := t.templates[x].Images() + for key, val := range imgs { + name := sprintf("t%s-%s", t.templates[x].ID(), key) + childrenImgs[name] = val + } + } + + return childrenImgs +} + +// childrensTemplates returns the next layer of children templates, it doesn't dig into +// children of children. +func (t *FpdfTpl) childrensTemplates() []Template { + childrenTmpls := make([]Template, 0) + + for x := 0; x < len(t.templates); x++ { + tmpls := t.templates[x].Templates() + childrenTmpls = append(childrenTmpls, tmpls...) + } + + return childrenTmpls +} + +// GobEncode encodes the receiving template into a byte buffer. Use GobDecode +// to decode the byte buffer back to a template. +func (t *FpdfTpl) GobEncode() ([]byte, error) { + w := new(bytes.Buffer) + encoder := gob.NewEncoder(w) + + childrensTemplates := t.childrensTemplates() + firstClassTemplates := make([]Template, 0) + +found_continue: + for x := 0; x < len(t.templates); x++ { + for y := 0; y < len(childrensTemplates); y++ { + if childrensTemplates[y].ID() == t.templates[x].ID() { + continue found_continue + } + } + + firstClassTemplates = append(firstClassTemplates, t.templates[x]) + } + err := encoder.Encode(firstClassTemplates) + + childrenImgs := t.childrenImages() + firstClassImgs := make(map[string]*ImageInfoType) + + for key, img := range t.images { + if _, ok := childrenImgs[key]; !ok { + firstClassImgs[key] = img + } + } + + if err == nil { + err = encoder.Encode(firstClassImgs) + } + if err == nil { + err = encoder.Encode(t.corner) + } + if err == nil { + err = encoder.Encode(t.size) + } + if err == nil { + err = encoder.Encode(t.bytes) + } + if err == nil { + err = encoder.Encode(t.page) + } + + return w.Bytes(), err +} + +// GobDecode decodes the specified byte buffer into the receiving template. +func (t *FpdfTpl) GobDecode(buf []byte) error { + r := bytes.NewBuffer(buf) + decoder := gob.NewDecoder(r) + + firstClassTemplates := make([]*FpdfTpl, 0) + err := decoder.Decode(&firstClassTemplates) + t.templates = make([]Template, len(firstClassTemplates)) + + for x := 0; x < len(t.templates); x++ { + t.templates[x] = Template(firstClassTemplates[x]) + } + + firstClassImages := t.childrenImages() + + t.templates = append(t.childrensTemplates(), t.templates...) + + t.images = make(map[string]*ImageInfoType) + if err == nil { + err = decoder.Decode(&t.images) + } + + for k, v := range firstClassImages { + t.images[k] = v + } + + if err == nil { + err = decoder.Decode(&t.corner) + } + if err == nil { + err = decoder.Decode(&t.size) + } + if err == nil { + err = decoder.Decode(&t.bytes) + } + if err == nil { + err = decoder.Decode(&t.page) + } + + return err +} + +// Tpl is an Fpdf used for writing a template. It has most of the facilities of +// an Fpdf, but cannot add more pages. Tpl is used directly only during the +// limited time a template is writable. +type Tpl struct { + Fpdf +} + +func (t *Tpl) loadParamsFromFpdf(f *Fpdf) { + t.Fpdf.compress = false + + t.Fpdf.k = f.k + t.Fpdf.x = f.x + t.Fpdf.y = f.y + t.Fpdf.lineWidth = f.lineWidth + t.Fpdf.capStyle = f.capStyle + t.Fpdf.joinStyle = f.joinStyle + + t.Fpdf.color.draw = f.color.draw + t.Fpdf.color.fill = f.color.fill + t.Fpdf.color.text = f.color.text + + t.Fpdf.fonts = f.fonts + t.Fpdf.currentFont = f.currentFont + t.Fpdf.fontFamily = f.fontFamily + t.Fpdf.fontSize = f.fontSize + t.Fpdf.fontSizePt = f.fontSizePt + t.Fpdf.fontStyle = f.fontStyle + t.Fpdf.ws = f.ws + + for key, value := range f.images { + t.Fpdf.images[key] = value + } +} diff --git a/backend/vendor/github.com/phpdave11/gofpdf/ttfparser.go b/backend/vendor/github.com/phpdave11/gofpdf/ttfparser.go new file mode 100644 index 00000000..669ab4d8 --- /dev/null +++ b/backend/vendor/github.com/phpdave11/gofpdf/ttfparser.go @@ -0,0 +1,374 @@ +/* + * Copyright (c) 2013 Kurt Jung (Gmail: kurt.w.jung) + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package gofpdf + +// Utility to parse TTF font files +// Version: 1.0 +// Date: 2011-06-18 +// Author: Olivier PLATHEY +// Port to Go: Kurt Jung, 2013-07-15 + +import ( + "encoding/binary" + "fmt" + "os" + "regexp" + "strings" +) + +// TtfType contains metrics of a TrueType font. +type TtfType struct { + Embeddable bool + UnitsPerEm uint16 + PostScriptName string + Bold bool + ItalicAngle int16 + IsFixedPitch bool + TypoAscender int16 + TypoDescender int16 + UnderlinePosition int16 + UnderlineThickness int16 + Xmin, Ymin, Xmax, Ymax int16 + CapHeight int16 + Widths []uint16 + Chars map[uint16]uint16 +} + +type ttfParser struct { + rec TtfType + f *os.File + tables map[string]uint32 + numberOfHMetrics uint16 + numGlyphs uint16 +} + +// TtfParse extracts various metrics from a TrueType font file. +func TtfParse(fileStr string) (TtfRec TtfType, err error) { + var t ttfParser + t.f, err = os.Open(fileStr) + if err != nil { + return + } + version, err := t.ReadStr(4) + if err != nil { + return + } + if version == "OTTO" { + err = fmt.Errorf("fonts based on PostScript outlines are not supported") + return + } + if version != "\x00\x01\x00\x00" { + err = fmt.Errorf("unrecognized file format") + return + } + numTables := int(t.ReadUShort()) + t.Skip(3 * 2) // searchRange, entrySelector, rangeShift + t.tables = make(map[string]uint32) + var tag string + for j := 0; j < numTables; j++ { + tag, err = t.ReadStr(4) + if err != nil { + return + } + t.Skip(4) // checkSum + offset := t.ReadULong() + t.Skip(4) // length + t.tables[tag] = offset + } + err = t.ParseComponents() + if err != nil { + return + } + t.f.Close() + TtfRec = t.rec + return +} + +func (t *ttfParser) ParseComponents() (err error) { + err = t.ParseHead() + if err == nil { + err = t.ParseHhea() + if err == nil { + err = t.ParseMaxp() + if err == nil { + err = t.ParseHmtx() + if err == nil { + err = t.ParseCmap() + if err == nil { + err = t.ParseName() + if err == nil { + err = t.ParseOS2() + if err == nil { + err = t.ParsePost() + } + } + } + } + } + } + } + return +} + +func (t *ttfParser) ParseHead() (err error) { + err = t.Seek("head") + t.Skip(3 * 4) // version, fontRevision, checkSumAdjustment + magicNumber := t.ReadULong() + if magicNumber != 0x5F0F3CF5 { + err = fmt.Errorf("incorrect magic number") + return + } + t.Skip(2) // flags + t.rec.UnitsPerEm = t.ReadUShort() + t.Skip(2 * 8) // created, modified + t.rec.Xmin = t.ReadShort() + t.rec.Ymin = t.ReadShort() + t.rec.Xmax = t.ReadShort() + t.rec.Ymax = t.ReadShort() + return +} + +func (t *ttfParser) ParseHhea() (err error) { + err = t.Seek("hhea") + if err == nil { + t.Skip(4 + 15*2) + t.numberOfHMetrics = t.ReadUShort() + } + return +} + +func (t *ttfParser) ParseMaxp() (err error) { + err = t.Seek("maxp") + if err == nil { + t.Skip(4) + t.numGlyphs = t.ReadUShort() + } + return +} + +func (t *ttfParser) ParseHmtx() (err error) { + err = t.Seek("hmtx") + if err == nil { + t.rec.Widths = make([]uint16, 0, 8) + for j := uint16(0); j < t.numberOfHMetrics; j++ { + t.rec.Widths = append(t.rec.Widths, t.ReadUShort()) + t.Skip(2) // lsb + } + if t.numberOfHMetrics < t.numGlyphs { + lastWidth := t.rec.Widths[t.numberOfHMetrics-1] + for j := t.numberOfHMetrics; j < t.numGlyphs; j++ { + t.rec.Widths = append(t.rec.Widths, lastWidth) + } + } + } + return +} + +func (t *ttfParser) ParseCmap() (err error) { + var offset int64 + if err = t.Seek("cmap"); err != nil { + return + } + t.Skip(2) // version + numTables := int(t.ReadUShort()) + offset31 := int64(0) + for j := 0; j < numTables; j++ { + platformID := t.ReadUShort() + encodingID := t.ReadUShort() + offset = int64(t.ReadULong()) + if platformID == 3 && encodingID == 1 { + offset31 = offset + } + } + if offset31 == 0 { + err = fmt.Errorf("no Unicode encoding found") + return + } + startCount := make([]uint16, 0, 8) + endCount := make([]uint16, 0, 8) + idDelta := make([]int16, 0, 8) + idRangeOffset := make([]uint16, 0, 8) + t.rec.Chars = make(map[uint16]uint16) + t.f.Seek(int64(t.tables["cmap"])+offset31, os.SEEK_SET) + format := t.ReadUShort() + if format != 4 { + err = fmt.Errorf("unexpected subtable format: %d", format) + return + } + t.Skip(2 * 2) // length, language + segCount := int(t.ReadUShort() / 2) + t.Skip(3 * 2) // searchRange, entrySelector, rangeShift + for j := 0; j < segCount; j++ { + endCount = append(endCount, t.ReadUShort()) + } + t.Skip(2) // reservedPad + for j := 0; j < segCount; j++ { + startCount = append(startCount, t.ReadUShort()) + } + for j := 0; j < segCount; j++ { + idDelta = append(idDelta, t.ReadShort()) + } + offset, _ = t.f.Seek(int64(0), os.SEEK_CUR) + for j := 0; j < segCount; j++ { + idRangeOffset = append(idRangeOffset, t.ReadUShort()) + } + for j := 0; j < segCount; j++ { + c1 := startCount[j] + c2 := endCount[j] + d := idDelta[j] + ro := idRangeOffset[j] + if ro > 0 { + t.f.Seek(offset+2*int64(j)+int64(ro), os.SEEK_SET) + } + for c := c1; c <= c2; c++ { + if c == 0xFFFF { + break + } + var gid int32 + if ro > 0 { + gid = int32(t.ReadUShort()) + if gid > 0 { + gid += int32(d) + } + } else { + gid = int32(c) + int32(d) + } + if gid >= 65536 { + gid -= 65536 + } + if gid > 0 { + t.rec.Chars[c] = uint16(gid) + } + } + } + return +} + +func (t *ttfParser) ParseName() (err error) { + err = t.Seek("name") + if err == nil { + tableOffset, _ := t.f.Seek(0, os.SEEK_CUR) + t.rec.PostScriptName = "" + t.Skip(2) // format + count := t.ReadUShort() + stringOffset := t.ReadUShort() + for j := uint16(0); j < count && t.rec.PostScriptName == ""; j++ { + t.Skip(3 * 2) // platformID, encodingID, languageID + nameID := t.ReadUShort() + length := t.ReadUShort() + offset := t.ReadUShort() + if nameID == 6 { + // PostScript name + t.f.Seek(int64(tableOffset)+int64(stringOffset)+int64(offset), os.SEEK_SET) + var s string + s, err = t.ReadStr(int(length)) + if err != nil { + return + } + s = strings.Replace(s, "\x00", "", -1) + var re *regexp.Regexp + if re, err = regexp.Compile("[(){}<> /%[\\]]"); err != nil { + return + } + t.rec.PostScriptName = re.ReplaceAllString(s, "") + } + } + if t.rec.PostScriptName == "" { + err = fmt.Errorf("the name PostScript was not found") + } + } + return +} + +func (t *ttfParser) ParseOS2() (err error) { + err = t.Seek("OS/2") + if err == nil { + version := t.ReadUShort() + t.Skip(3 * 2) // xAvgCharWidth, usWeightClass, usWidthClass + fsType := t.ReadUShort() + t.rec.Embeddable = (fsType != 2) && (fsType&0x200) == 0 + t.Skip(11*2 + 10 + 4*4 + 4) + fsSelection := t.ReadUShort() + t.rec.Bold = (fsSelection & 32) != 0 + t.Skip(2 * 2) // usFirstCharIndex, usLastCharIndex + t.rec.TypoAscender = t.ReadShort() + t.rec.TypoDescender = t.ReadShort() + if version >= 2 { + t.Skip(3*2 + 2*4 + 2) + t.rec.CapHeight = t.ReadShort() + } else { + t.rec.CapHeight = 0 + } + } + return +} + +func (t *ttfParser) ParsePost() (err error) { + err = t.Seek("post") + if err == nil { + t.Skip(4) // version + t.rec.ItalicAngle = t.ReadShort() + t.Skip(2) // Skip decimal part + t.rec.UnderlinePosition = t.ReadShort() + t.rec.UnderlineThickness = t.ReadShort() + t.rec.IsFixedPitch = t.ReadULong() != 0 + } + return +} + +func (t *ttfParser) Seek(tag string) (err error) { + ofs, ok := t.tables[tag] + if ok { + t.f.Seek(int64(ofs), os.SEEK_SET) + } else { + err = fmt.Errorf("table not found: %s", tag) + } + return +} + +func (t *ttfParser) Skip(n int) { + t.f.Seek(int64(n), os.SEEK_CUR) +} + +func (t *ttfParser) ReadStr(length int) (str string, err error) { + var n int + buf := make([]byte, length) + n, err = t.f.Read(buf) + if err == nil { + if n == length { + str = string(buf) + } else { + err = fmt.Errorf("unable to read %d bytes", length) + } + } + return +} + +func (t *ttfParser) ReadUShort() (val uint16) { + binary.Read(t.f, binary.BigEndian, &val) + return +} + +func (t *ttfParser) ReadShort() (val int16) { + binary.Read(t.f, binary.BigEndian, &val) + return +} + +func (t *ttfParser) ReadULong() (val uint32) { + binary.Read(t.f, binary.BigEndian, &val) + return +} diff --git a/backend/vendor/github.com/phpdave11/gofpdf/utf8fontfile.go b/backend/vendor/github.com/phpdave11/gofpdf/utf8fontfile.go new file mode 100644 index 00000000..0e1a17a7 --- /dev/null +++ b/backend/vendor/github.com/phpdave11/gofpdf/utf8fontfile.go @@ -0,0 +1,1154 @@ +/* + * Copyright (c) 2019 Arteom Korotkiy (Gmail: arteomkorotkiy) + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package gofpdf + +import ( + "bytes" + "encoding/binary" + "fmt" + "math" + "sort" +) + +// flags +const symbolWords = 1 << 0 +const symbolScale = 1 << 3 +const symbolContinue = 1 << 5 +const symbolAllScale = 1 << 6 +const symbol2x2 = 1 << 7 + +// CID map Init +const toUnicode = "/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap\n/CIDSystemInfo\n<> def\n/CMapName /Adobe-Identity-UCS def\n/CMapType 2 def\n1 begincodespacerange\n<0000> \nendcodespacerange\n1 beginbfrange\n<0000> <0000>\nendbfrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend" + +type utf8FontFile struct { + fileReader *fileReader + LastRune int + tableDescriptions map[string]*tableDescription + outTablesData map[string][]byte + symbolPosition []int + charSymbolDictionary map[int]int + Ascent int + Descent int + fontElementSize int + Bbox fontBoxType + CapHeight int + StemV int + ItalicAngle int + Flags int + UnderlinePosition float64 + UnderlineThickness float64 + CharWidths []int + DefaultWidth float64 + symbolData map[int]map[string][]int + CodeSymbolDictionary map[int]int +} + +type tableDescription struct { + name string + checksum []int + position int + size int +} + +type fileReader struct { + readerPosition int64 + array []byte +} + +func (fr *fileReader) Read(s int) []byte { + b := fr.array[fr.readerPosition : fr.readerPosition+int64(s)] + fr.readerPosition += int64(s) + return b +} + +func (fr *fileReader) seek(shift int64, flag int) (int64, error) { + if flag == 0 { + fr.readerPosition = shift + } else if flag == 1 { + fr.readerPosition += shift + } else if flag == 2 { + fr.readerPosition = int64(len(fr.array)) - shift + } + return int64(fr.readerPosition), nil +} + +func newUTF8Font(reader *fileReader) *utf8FontFile { + utf := utf8FontFile{ + fileReader: reader, + } + return &utf +} + +func (utf *utf8FontFile) parseFile() error { + utf.fileReader.readerPosition = 0 + utf.symbolPosition = make([]int, 0) + utf.charSymbolDictionary = make(map[int]int) + utf.tableDescriptions = make(map[string]*tableDescription) + utf.outTablesData = make(map[string][]byte) + utf.Ascent = 0 + utf.Descent = 0 + codeType := uint32(utf.readUint32()) + if codeType == 0x4F54544F { + return fmt.Errorf("not supported\n ") + } + if codeType == 0x74746366 { + return fmt.Errorf("not supported\n ") + } + if codeType != 0x00010000 && codeType != 0x74727565 { + return fmt.Errorf("Not a TrueType font: codeType=%v\n ", codeType) + } + utf.generateTableDescriptions() + utf.parseTables() + return nil +} + +func (utf *utf8FontFile) generateTableDescriptions() { + + tablesCount := utf.readUint16() + _ = utf.readUint16() + _ = utf.readUint16() + _ = utf.readUint16() + utf.tableDescriptions = make(map[string]*tableDescription) + + for i := 0; i < tablesCount; i++ { + record := tableDescription{ + name: utf.readTableName(), + checksum: []int{utf.readUint16(), utf.readUint16()}, + position: utf.readUint32(), + size: utf.readUint32(), + } + utf.tableDescriptions[record.name] = &record + } +} + +func (utf *utf8FontFile) readTableName() string { + return string(utf.fileReader.Read(4)) +} + +func (utf *utf8FontFile) readUint16() int { + s := utf.fileReader.Read(2) + return (int(s[0]) << 8) + int(s[1]) +} + +func (utf *utf8FontFile) readUint32() int { + s := utf.fileReader.Read(4) + return (int(s[0]) * 16777216) + (int(s[1]) << 16) + (int(s[2]) << 8) + int(s[3]) // 16777216 = 1<<24 +} + +func (utf *utf8FontFile) calcInt32(x, y []int) []int { + answer := make([]int, 2) + if y[1] > x[1] { + x[1] += 1 << 16 + x[0]++ + } + answer[1] = x[1] - y[1] + if y[0] > x[0] { + x[0] += 1 << 16 + } + answer[0] = x[0] - y[0] + answer[0] = answer[0] & 0xFFFF + return answer +} + +func (utf *utf8FontFile) generateChecksum(data []byte) []int { + if (len(data) % 4) != 0 { + for i := 0; (len(data) % 4) != 0; i++ { + data = append(data, 0) + } + } + answer := []int{0x0000, 0x0000} + for i := 0; i < len(data); i += 4 { + answer[0] += (int(data[i]) << 8) + int(data[i+1]) + answer[1] += (int(data[i+2]) << 8) + int(data[i+3]) + answer[0] += answer[1] >> 16 + answer[1] = answer[1] & 0xFFFF + answer[0] = answer[0] & 0xFFFF + } + return answer +} + +func (utf *utf8FontFile) seek(shift int) { + _, _ = utf.fileReader.seek(int64(shift), 0) +} + +func (utf *utf8FontFile) skip(delta int) { + _, _ = utf.fileReader.seek(int64(delta), 1) +} + +//SeekTable position +func (utf *utf8FontFile) SeekTable(name string) int { + return utf.seekTable(name, 0) +} + +func (utf *utf8FontFile) seekTable(name string, offsetInTable int) int { + _, _ = utf.fileReader.seek(int64(utf.tableDescriptions[name].position+offsetInTable), 0) + return int(utf.fileReader.readerPosition) +} + +func (utf *utf8FontFile) readInt16() int16 { + s := utf.fileReader.Read(2) + a := (int16(s[0]) << 8) + int16(s[1]) + if (int(a) & (1 << 15)) == 0 { + a = int16(int(a) - (1 << 16)) + } + return a +} + +func (utf *utf8FontFile) getUint16(pos int) int { + _, _ = utf.fileReader.seek(int64(pos), 0) + s := utf.fileReader.Read(2) + return (int(s[0]) << 8) + int(s[1]) +} + +func (utf *utf8FontFile) splice(stream []byte, offset int, value []byte) []byte { + stream = append([]byte{}, stream...) + return append(append(stream[:offset], value...), stream[offset+len(value):]...) +} + +func (utf *utf8FontFile) insertUint16(stream []byte, offset int, value int) []byte { + up := make([]byte, 2) + binary.BigEndian.PutUint16(up, uint16(value)) + return utf.splice(stream, offset, up) +} + +func (utf *utf8FontFile) getRange(pos, length int) []byte { + _, _ = utf.fileReader.seek(int64(pos), 0) + if length < 1 { + return make([]byte, 0) + } + s := utf.fileReader.Read(length) + return s +} + +func (utf *utf8FontFile) getTableData(name string) []byte { + desckrip := utf.tableDescriptions[name] + if desckrip == nil { + return nil + } + if desckrip.size == 0 { + return nil + } + _, _ = utf.fileReader.seek(int64(desckrip.position), 0) + s := utf.fileReader.Read(desckrip.size) + return s +} + +func (utf *utf8FontFile) setOutTable(name string, data []byte) { + if data == nil { + return + } + if name == "head" { + data = utf.splice(data, 8, []byte{0, 0, 0, 0}) + } + utf.outTablesData[name] = data +} + +func arrayKeys(arr map[int]string) []int { + answer := make([]int, len(arr)) + i := 0 + for key := range arr { + answer[i] = key + i++ + } + return answer +} + +func inArray(s int, arr []int) bool { + for _, i := range arr { + if s == i { + return true + } + } + return false +} + +func (utf *utf8FontFile) parseNAMETable() int { + namePosition := utf.SeekTable("name") + format := utf.readUint16() + if format != 0 { + fmt.Printf("Illegal format %d\n", format) + return format + } + nameCount := utf.readUint16() + stringDataPosition := namePosition + utf.readUint16() + names := map[int]string{1: "", 2: "", 3: "", 4: "", 6: ""} + keys := arrayKeys(names) + counter := len(names) + for i := 0; i < nameCount; i++ { + system := utf.readUint16() + code := utf.readUint16() + local := utf.readUint16() + nameID := utf.readUint16() + size := utf.readUint16() + position := utf.readUint16() + if !inArray(nameID, keys) { + continue + } + currentName := "" + if system == 3 && code == 1 && local == 0x409 { + oldPos := utf.fileReader.readerPosition + utf.seek(stringDataPosition + position) + if size%2 != 0 { + fmt.Printf("name is not binar byte format\n") + return format + } + size /= 2 + currentName = "" + for size > 0 { + char := utf.readUint16() + currentName += string(rune(char)) + size-- + } + utf.fileReader.readerPosition = oldPos + utf.seek(int(oldPos)) + } else if system == 1 && code == 0 && local == 0 { + oldPos := utf.fileReader.readerPosition + currentName = string(utf.getRange(stringDataPosition+position, size)) + utf.fileReader.readerPosition = oldPos + utf.seek(int(oldPos)) + } + if currentName != "" && names[nameID] == "" { + names[nameID] = currentName + counter-- + if counter == 0 { + break + } + } + } + return format +} + +func (utf *utf8FontFile) parseHEADTable() { + utf.SeekTable("head") + utf.skip(18) + utf.fontElementSize = utf.readUint16() + scale := 1000.0 / float64(utf.fontElementSize) + utf.skip(16) + xMin := utf.readInt16() + yMin := utf.readInt16() + xMax := utf.readInt16() + yMax := utf.readInt16() + utf.Bbox = fontBoxType{int(float64(xMin) * scale), int(float64(yMin) * scale), int(float64(xMax) * scale), int(float64(yMax) * scale)} + utf.skip(3 * 2) + _ = utf.readUint16() + symbolDataFormat := utf.readUint16() + if symbolDataFormat != 0 { + fmt.Printf("Unknown symbol data format %d\n", symbolDataFormat) + return + } +} + +func (utf *utf8FontFile) parseHHEATable() int { + metricsCount := 0 + if _, OK := utf.tableDescriptions["hhea"]; OK { + scale := 1000.0 / float64(utf.fontElementSize) + utf.SeekTable("hhea") + utf.skip(4) + hheaAscender := utf.readInt16() + hheaDescender := utf.readInt16() + utf.Ascent = int(float64(hheaAscender) * scale) + utf.Descent = int(float64(hheaDescender) * scale) + utf.skip(24) + metricDataFormat := utf.readUint16() + if metricDataFormat != 0 { + fmt.Printf("Unknown horizontal metric data format %d\n", metricDataFormat) + return 0 + } + metricsCount = utf.readUint16() + if metricsCount == 0 { + fmt.Printf("Number of horizontal metrics is 0\n") + return 0 + } + } + return metricsCount +} + +func (utf *utf8FontFile) parseOS2Table() int { + var weightType int + scale := 1000.0 / float64(utf.fontElementSize) + if _, OK := utf.tableDescriptions["OS/2"]; OK { + utf.SeekTable("OS/2") + version := utf.readUint16() + utf.skip(2) + weightType = utf.readUint16() + utf.skip(2) + fsType := utf.readUint16() + if fsType == 0x0002 || (fsType&0x0300) != 0 { + fmt.Printf("ERROR - copyright restrictions.\n") + return 0 + } + utf.skip(20) + _ = utf.readInt16() + + utf.skip(36) + sTypoAscender := utf.readInt16() + sTypoDescender := utf.readInt16() + if utf.Ascent == 0 { + utf.Ascent = int(float64(sTypoAscender) * scale) + } + if utf.Descent == 0 { + utf.Descent = int(float64(sTypoDescender) * scale) + } + if version > 1 { + utf.skip(16) + sCapHeight := utf.readInt16() + utf.CapHeight = int(float64(sCapHeight) * scale) + } else { + utf.CapHeight = utf.Ascent + } + } else { + weightType = 500 + if utf.Ascent == 0 { + utf.Ascent = int(float64(utf.Bbox.Ymax) * scale) + } + if utf.Descent == 0 { + utf.Descent = int(float64(utf.Bbox.Ymin) * scale) + } + utf.CapHeight = utf.Ascent + } + utf.StemV = 50 + int(math.Pow(float64(weightType)/65.0, 2)) + return weightType +} + +func (utf *utf8FontFile) parsePOSTTable(weight int) { + utf.SeekTable("post") + utf.skip(4) + utf.ItalicAngle = int(utf.readInt16()) + utf.readUint16()/65536.0 + scale := 1000.0 / float64(utf.fontElementSize) + utf.UnderlinePosition = float64(utf.readInt16()) * scale + utf.UnderlineThickness = float64(utf.readInt16()) * scale + fixed := utf.readUint32() + + utf.Flags = 4 + + if utf.ItalicAngle != 0 { + utf.Flags = utf.Flags | 64 + } + if weight >= 600 { + utf.Flags = utf.Flags | 262144 + } + if fixed != 0 { + utf.Flags = utf.Flags | 1 + } +} + +func (utf *utf8FontFile) parseCMAPTable(format int) int { + cmapPosition := utf.SeekTable("cmap") + utf.skip(2) + cmapTableCount := utf.readUint16() + cidCMAPPosition := 0 + for i := 0; i < cmapTableCount; i++ { + system := utf.readUint16() + coded := utf.readUint16() + position := utf.readUint32() + oldReaderPosition := utf.fileReader.readerPosition + if (system == 3 && coded == 1) || system == 0 { // Microsoft, Unicode + format = utf.getUint16(cmapPosition + position) + if format == 4 { + if cidCMAPPosition == 0 { + cidCMAPPosition = cmapPosition + position + } + break + } + } + utf.seek(int(oldReaderPosition)) + } + if cidCMAPPosition == 0 { + fmt.Printf("Font does not have cmap for Unicode\n") + return cidCMAPPosition + } + return cidCMAPPosition +} + +func (utf *utf8FontFile) parseTables() { + f := utf.parseNAMETable() + utf.parseHEADTable() + n := utf.parseHHEATable() + w := utf.parseOS2Table() + utf.parsePOSTTable(w) + runeCMAPPosition := utf.parseCMAPTable(f) + + utf.SeekTable("maxp") + utf.skip(4) + numSymbols := utf.readUint16() + + symbolCharDictionary := make(map[int][]int) + charSymbolDictionary := make(map[int]int) + utf.generateSCCSDictionaries(runeCMAPPosition, symbolCharDictionary, charSymbolDictionary) + + scale := 1000.0 / float64(utf.fontElementSize) + utf.parseHMTXTable(n, numSymbols, symbolCharDictionary, scale) +} + +func (utf *utf8FontFile) generateCMAP() map[int][]int { + cmapPosition := utf.SeekTable("cmap") + utf.skip(2) + cmapTableCount := utf.readUint16() + runeCmapPosition := 0 + for i := 0; i < cmapTableCount; i++ { + system := utf.readUint16() + coder := utf.readUint16() + position := utf.readUint32() + oldPosition := utf.fileReader.readerPosition + if (system == 3 && coder == 1) || system == 0 { + format := utf.getUint16(cmapPosition + position) + if format == 4 { + runeCmapPosition = cmapPosition + position + break + } + } + utf.seek(int(oldPosition)) + } + + if runeCmapPosition == 0 { + fmt.Printf("Font does not have cmap for Unicode\n") + return nil + } + + symbolCharDictionary := make(map[int][]int) + charSymbolDictionary := make(map[int]int) + utf.generateSCCSDictionaries(runeCmapPosition, symbolCharDictionary, charSymbolDictionary) + + utf.charSymbolDictionary = charSymbolDictionary + + return symbolCharDictionary +} + +func (utf *utf8FontFile) parseSymbols(usedRunes map[int]int) (map[int]int, map[int]int, map[int]int, []int) { + symbolCollection := map[int]int{0: 0} + charSymbolPairCollection := make(map[int]int) + for _, char := range usedRunes { + if _, OK := utf.charSymbolDictionary[char]; OK { + symbolCollection[utf.charSymbolDictionary[char]] = char + charSymbolPairCollection[char] = utf.charSymbolDictionary[char] + + } + utf.LastRune = max(utf.LastRune, char) + } + + begin := utf.tableDescriptions["glyf"].position + + symbolArray := make(map[int]int) + symbolCollectionKeys := keySortInt(symbolCollection) + + symbolCounter := 0 + maxRune := 0 + for _, oldSymbolIndex := range symbolCollectionKeys { + maxRune = max(maxRune, symbolCollection[oldSymbolIndex]) + symbolArray[oldSymbolIndex] = symbolCounter + symbolCounter++ + } + charSymbolPairCollectionKeys := keySortInt(charSymbolPairCollection) + runeSymbolPairCollection := make(map[int]int) + for _, runa := range charSymbolPairCollectionKeys { + runeSymbolPairCollection[runa] = symbolArray[charSymbolPairCollection[runa]] + } + utf.CodeSymbolDictionary = runeSymbolPairCollection + + symbolCollectionKeys = keySortInt(symbolCollection) + for _, oldSymbolIndex := range symbolCollectionKeys { + _, symbolArray, symbolCollection, symbolCollectionKeys = utf.getSymbols(oldSymbolIndex, &begin, symbolArray, symbolCollection, symbolCollectionKeys) + } + + return runeSymbolPairCollection, symbolArray, symbolCollection, symbolCollectionKeys +} + +func (utf *utf8FontFile) generateCMAPTable(cidSymbolPairCollection map[int]int, numSymbols int) []byte { + cidSymbolPairCollectionKeys := keySortInt(cidSymbolPairCollection) + cidID := 0 + cidArray := make(map[int][]int) + prevCid := -2 + prevSymbol := -1 + for _, cid := range cidSymbolPairCollectionKeys { + if cid == (prevCid+1) && cidSymbolPairCollection[cid] == (prevSymbol+1) { + if n, OK := cidArray[cidID]; !OK || n == nil { + cidArray[cidID] = make([]int, 0) + } + cidArray[cidID] = append(cidArray[cidID], cidSymbolPairCollection[cid]) + } else { + cidID = cid + cidArray[cidID] = make([]int, 0) + cidArray[cidID] = append(cidArray[cidID], cidSymbolPairCollection[cid]) + } + prevCid = cid + prevSymbol = cidSymbolPairCollection[cid] + } + cidArrayKeys := keySortArrayRangeMap(cidArray) + segCount := len(cidArray) + 1 + + searchRange := 1 + entrySelector := 0 + for searchRange*2 <= segCount { + searchRange = searchRange * 2 + entrySelector = entrySelector + 1 + } + searchRange = searchRange * 2 + rangeShift := segCount*2 - searchRange + length := 16 + (8 * segCount) + (numSymbols + 1) + cmap := []int{0, 1, 3, 1, 0, 12, 4, length, 0, segCount * 2, searchRange, entrySelector, rangeShift} + + for _, start := range cidArrayKeys { + endCode := start + (len(cidArray[start]) - 1) + cmap = append(cmap, endCode) + } + cmap = append(cmap, 0xFFFF) + cmap = append(cmap, 0) + + for _, cidKey := range cidArrayKeys { + cmap = append(cmap, cidKey) + } + cmap = append(cmap, 0xFFFF) + for _, cidKey := range cidArrayKeys { + idDelta := -(cidKey - cidArray[cidKey][0]) + cmap = append(cmap, idDelta) + } + cmap = append(cmap, 1) + for range cidArray { + cmap = append(cmap, 0) + + } + cmap = append(cmap, 0) + for _, start := range cidArrayKeys { + for _, glidx := range cidArray[start] { + cmap = append(cmap, glidx) + } + } + cmap = append(cmap, 0) + cmapstr := make([]byte, 0) + for _, cm := range cmap { + cmapstr = append(cmapstr, packUint16(cm)...) + } + return cmapstr +} + +//GenerateCutFont fill utf8FontFile from .utf file, only with runes from usedRunes +func (utf *utf8FontFile) GenerateCutFont(usedRunes map[int]int) []byte { + utf.fileReader.readerPosition = 0 + utf.symbolPosition = make([]int, 0) + utf.charSymbolDictionary = make(map[int]int) + utf.tableDescriptions = make(map[string]*tableDescription) + utf.outTablesData = make(map[string][]byte) + utf.Ascent = 0 + utf.Descent = 0 + utf.skip(4) + utf.LastRune = 0 + utf.generateTableDescriptions() + + utf.SeekTable("head") + utf.skip(50) + LocaFormat := utf.readUint16() + + utf.SeekTable("hhea") + utf.skip(34) + metricsCount := utf.readUint16() + oldMetrics := metricsCount + + utf.SeekTable("maxp") + utf.skip(4) + numSymbols := utf.readUint16() + + symbolCharDictionary := utf.generateCMAP() + if symbolCharDictionary == nil { + return nil + } + + utf.parseHMTXTable(metricsCount, numSymbols, symbolCharDictionary, 1.0) + + utf.parseLOCATable(LocaFormat, numSymbols) + + cidSymbolPairCollection, symbolArray, symbolCollection, symbolCollectionKeys := utf.parseSymbols(usedRunes) + + metricsCount = len(symbolCollection) + numSymbols = metricsCount + + utf.setOutTable("name", utf.getTableData("name")) + utf.setOutTable("cvt ", utf.getTableData("cvt ")) + utf.setOutTable("fpgm", utf.getTableData("fpgm")) + utf.setOutTable("prep", utf.getTableData("prep")) + utf.setOutTable("gasp", utf.getTableData("gasp")) + + postTable := utf.getTableData("post") + postTable = append(append([]byte{0x00, 0x03, 0x00, 0x00}, postTable[4:16]...), []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}...) + utf.setOutTable("post", postTable) + + delete(cidSymbolPairCollection, 0) + + utf.setOutTable("cmap", utf.generateCMAPTable(cidSymbolPairCollection, numSymbols)) + + symbolData := utf.getTableData("glyf") + + offsets := make([]int, 0) + glyfData := make([]byte, 0) + pos := 0 + hmtxData := make([]byte, 0) + utf.symbolData = make(map[int]map[string][]int, 0) + + for _, originalSymbolIdx := range symbolCollectionKeys { + hm := utf.getMetrics(oldMetrics, originalSymbolIdx) + hmtxData = append(hmtxData, hm...) + + offsets = append(offsets, pos) + symbolPos := utf.symbolPosition[originalSymbolIdx] + symbolLen := utf.symbolPosition[originalSymbolIdx+1] - symbolPos + data := symbolData[symbolPos : symbolPos+symbolLen] + var up int + if symbolLen > 0 { + up = unpackUint16(data[0:2]) + } + + if symbolLen > 2 && (up&(1<<15)) != 0 { + posInSymbol := 10 + flags := symbolContinue + nComponentElements := 0 + for (flags & symbolContinue) != 0 { + nComponentElements++ + up = unpackUint16(data[posInSymbol : posInSymbol+2]) + flags = up + up = unpackUint16(data[posInSymbol+2 : posInSymbol+4]) + symbolIdx := up + if _, OK := utf.symbolData[originalSymbolIdx]; !OK { + utf.symbolData[originalSymbolIdx] = make(map[string][]int) + } + if _, OK := utf.symbolData[originalSymbolIdx]["compSymbols"]; !OK { + utf.symbolData[originalSymbolIdx]["compSymbols"] = make([]int, 0) + } + utf.symbolData[originalSymbolIdx]["compSymbols"] = append(utf.symbolData[originalSymbolIdx]["compSymbols"], symbolIdx) + data = utf.insertUint16(data, posInSymbol+2, symbolArray[symbolIdx]) + posInSymbol += 4 + if (flags & symbolWords) != 0 { + posInSymbol += 4 + } else { + posInSymbol += 2 + } + if (flags & symbolScale) != 0 { + posInSymbol += 2 + } else if (flags & symbolAllScale) != 0 { + posInSymbol += 4 + } else if (flags & symbol2x2) != 0 { + posInSymbol += 8 + } + } + } + + glyfData = append(glyfData, data...) + pos += symbolLen + if pos%4 != 0 { + padding := 4 - (pos % 4) + glyfData = append(glyfData, make([]byte, padding)...) + pos += padding + } + } + + offsets = append(offsets, pos) + utf.setOutTable("glyf", glyfData) + + utf.setOutTable("hmtx", hmtxData) + + locaData := make([]byte, 0) + if ((pos + 1) >> 1) > 0xFFFF { + LocaFormat = 1 + for _, offset := range offsets { + locaData = append(locaData, packUint32(offset)...) + } + } else { + LocaFormat = 0 + for _, offset := range offsets { + locaData = append(locaData, packUint16(offset/2)...) + } + } + utf.setOutTable("loca", locaData) + + headData := utf.getTableData("head") + headData = utf.insertUint16(headData, 50, LocaFormat) + utf.setOutTable("head", headData) + + hheaData := utf.getTableData("hhea") + hheaData = utf.insertUint16(hheaData, 34, metricsCount) + utf.setOutTable("hhea", hheaData) + + maxp := utf.getTableData("maxp") + maxp = utf.insertUint16(maxp, 4, numSymbols) + utf.setOutTable("maxp", maxp) + + os2Data := utf.getTableData("OS/2") + utf.setOutTable("OS/2", os2Data) + + return utf.assembleTables() +} + +func (utf *utf8FontFile) getSymbols(originalSymbolIdx int, start *int, symbolSet map[int]int, SymbolsCollection map[int]int, SymbolsCollectionKeys []int) (*int, map[int]int, map[int]int, []int) { + symbolPos := utf.symbolPosition[originalSymbolIdx] + symbolSize := utf.symbolPosition[originalSymbolIdx+1] - symbolPos + if symbolSize == 0 { + return start, symbolSet, SymbolsCollection, SymbolsCollectionKeys + } + utf.seek(*start + symbolPos) + + lineCount := utf.readInt16() + + if lineCount < 0 { + utf.skip(8) + flags := symbolContinue + for flags&symbolContinue != 0 { + flags = utf.readUint16() + symbolIndex := utf.readUint16() + if _, OK := symbolSet[symbolIndex]; !OK { + symbolSet[symbolIndex] = len(SymbolsCollection) + SymbolsCollection[symbolIndex] = 1 + SymbolsCollectionKeys = append(SymbolsCollectionKeys, symbolIndex) + } + oldPosition, _ := utf.fileReader.seek(0, 1) + _, _, _, SymbolsCollectionKeys = utf.getSymbols(symbolIndex, start, symbolSet, SymbolsCollection, SymbolsCollectionKeys) + utf.seek(int(oldPosition)) + if flags&symbolWords != 0 { + utf.skip(4) + } else { + utf.skip(2) + } + if flags&symbolScale != 0 { + utf.skip(2) + } else if flags&symbolAllScale != 0 { + utf.skip(4) + } else if flags&symbol2x2 != 0 { + utf.skip(8) + } + } + } + return start, symbolSet, SymbolsCollection, SymbolsCollectionKeys +} + +func (utf *utf8FontFile) parseHMTXTable(numberOfHMetrics, numSymbols int, symbolToChar map[int][]int, scale float64) { + var widths int + start := utf.SeekTable("hmtx") + arrayWidths := 0 + var arr []int + utf.CharWidths = make([]int, 256*256) + charCount := 0 + arr = unpackUint16Array(utf.getRange(start, numberOfHMetrics*4)) + for symbol := 0; symbol < numberOfHMetrics; symbol++ { + arrayWidths = arr[(symbol*2)+1] + if _, OK := symbolToChar[symbol]; OK || symbol == 0 { + + if arrayWidths >= (1 << 15) { + arrayWidths = 0 + } + if symbol == 0 { + utf.DefaultWidth = scale * float64(arrayWidths) + continue + } + for _, char := range symbolToChar[symbol] { + if char != 0 && char != 65535 { + widths = int(math.Round(scale * float64(arrayWidths))) + if widths == 0 { + widths = 65535 + } + if char < 196608 { + utf.CharWidths[char] = widths + charCount++ + } + } + } + } + } + diff := numSymbols - numberOfHMetrics + for pos := 0; pos < diff; pos++ { + symbol := pos + numberOfHMetrics + if _, OK := symbolToChar[symbol]; OK { + for _, char := range symbolToChar[symbol] { + if char != 0 && char != 65535 { + widths = int(math.Round(scale * float64(arrayWidths))) + if widths == 0 { + widths = 65535 + } + if char < 196608 { + utf.CharWidths[char] = widths + charCount++ + } + } + } + } + } + utf.CharWidths[0] = charCount +} + +func (utf *utf8FontFile) getMetrics(metricCount, gid int) []byte { + start := utf.SeekTable("hmtx") + var metrics []byte + if gid < metricCount { + utf.seek(start + (gid * 4)) + metrics = utf.fileReader.Read(4) + } else { + utf.seek(start + ((metricCount - 1) * 4)) + metrics = utf.fileReader.Read(2) + utf.seek(start + (metricCount * 2) + (gid * 2)) + metrics = append(metrics, utf.fileReader.Read(2)...) + } + return metrics +} + +func (utf *utf8FontFile) parseLOCATable(format, numSymbols int) { + start := utf.SeekTable("loca") + utf.symbolPosition = make([]int, 0) + if format == 0 { + data := utf.getRange(start, (numSymbols*2)+2) + arr := unpackUint16Array(data) + for n := 0; n <= numSymbols; n++ { + utf.symbolPosition = append(utf.symbolPosition, arr[n+1]*2) + } + } else if format == 1 { + data := utf.getRange(start, (numSymbols*4)+4) + arr := unpackUint32Array(data) + for n := 0; n <= numSymbols; n++ { + utf.symbolPosition = append(utf.symbolPosition, arr[n+1]) + } + } else { + fmt.Printf("Unknown loca table format %d\n", format) + return + } +} + +func (utf *utf8FontFile) generateSCCSDictionaries(runeCmapPosition int, symbolCharDictionary map[int][]int, charSymbolDictionary map[int]int) { + maxRune := 0 + utf.seek(runeCmapPosition + 2) + size := utf.readUint16() + rim := runeCmapPosition + size + utf.skip(2) + + segmentSize := utf.readUint16() / 2 + utf.skip(6) + completers := make([]int, 0) + for i := 0; i < segmentSize; i++ { + completers = append(completers, utf.readUint16()) + } + utf.skip(2) + beginners := make([]int, 0) + for i := 0; i < segmentSize; i++ { + beginners = append(beginners, utf.readUint16()) + } + sizes := make([]int, 0) + for i := 0; i < segmentSize; i++ { + sizes = append(sizes, int(utf.readInt16())) + } + readerPositionStart := utf.fileReader.readerPosition + positions := make([]int, 0) + for i := 0; i < segmentSize; i++ { + positions = append(positions, utf.readUint16()) + } + var symbol int + for n := 0; n < segmentSize; n++ { + completePosition := completers[n] + 1 + for char := beginners[n]; char < completePosition; char++ { + if positions[n] == 0 { + symbol = (char + sizes[n]) & 0xFFFF + } else { + position := (char-beginners[n])*2 + positions[n] + position = int(readerPositionStart) + 2*n + position + if position >= rim { + symbol = 0 + } else { + symbol = utf.getUint16(position) + if symbol != 0 { + symbol = (symbol + sizes[n]) & 0xFFFF + } + } + } + charSymbolDictionary[char] = symbol + if char < 196608 { + maxRune = max(char, maxRune) + } + symbolCharDictionary[symbol] = append(symbolCharDictionary[symbol], char) + } + } +} + +func max(i, n int) int { + if n > i { + return n + } + return i +} + +func (utf *utf8FontFile) assembleTables() []byte { + answer := make([]byte, 0) + tablesCount := len(utf.outTablesData) + findSize := 1 + writer := 0 + for findSize*2 <= tablesCount { + findSize = findSize * 2 + writer = writer + 1 + } + findSize = findSize * 16 + rOffset := tablesCount*16 - findSize + + answer = append(answer, packHeader(0x00010000, tablesCount, findSize, writer, rOffset)...) + + tables := utf.outTablesData + tablesNames := keySortStrings(tables) + + offset := 12 + tablesCount*16 + begin := 0 + + for _, name := range tablesNames { + if name == "head" { + begin = offset + } + answer = append(answer, []byte(name)...) + checksum := utf.generateChecksum(tables[name]) + answer = append(answer, pack2Uint16(checksum[0], checksum[1])...) + answer = append(answer, pack2Uint32(offset, len(tables[name]))...) + paddedLength := (len(tables[name]) + 3) &^ 3 + offset = offset + paddedLength + } + + for _, key := range tablesNames { + data := append([]byte{}, tables[key]...) + data = append(data, []byte{0, 0, 0}...) + answer = append(answer, data[:(len(data)&^3)]...) + } + + checksum := utf.generateChecksum([]byte(answer)) + checksum = utf.calcInt32([]int{0xB1B0, 0xAFBA}, checksum) + answer = utf.splice(answer, (begin + 8), pack2Uint16(checksum[0], checksum[1])) + return answer +} + +func unpackUint16Array(data []byte) []int { + answer := make([]int, 1) + r := bytes.NewReader(data) + bs := make([]byte, 2) + var e error + var c int + c, e = r.Read(bs) + for e == nil && c > 0 { + answer = append(answer, int(binary.BigEndian.Uint16(bs))) + c, e = r.Read(bs) + } + return answer +} + +func unpackUint32Array(data []byte) []int { + answer := make([]int, 1) + r := bytes.NewReader(data) + bs := make([]byte, 4) + var e error + var c int + c, e = r.Read(bs) + for e == nil && c > 0 { + answer = append(answer, int(binary.BigEndian.Uint32(bs))) + c, e = r.Read(bs) + } + return answer +} + +func unpackUint16(data []byte) int { + return int(binary.BigEndian.Uint16(data)) +} + +func packHeader(N uint32, n1, n2, n3, n4 int) []byte { + answer := make([]byte, 0) + bs4 := make([]byte, 4) + binary.BigEndian.PutUint32(bs4, N) + answer = append(answer, bs4...) + bs := make([]byte, 2) + binary.BigEndian.PutUint16(bs, uint16(n1)) + answer = append(answer, bs...) + binary.BigEndian.PutUint16(bs, uint16(n2)) + answer = append(answer, bs...) + binary.BigEndian.PutUint16(bs, uint16(n3)) + answer = append(answer, bs...) + binary.BigEndian.PutUint16(bs, uint16(n4)) + answer = append(answer, bs...) + return answer +} + +func pack2Uint16(n1, n2 int) []byte { + answer := make([]byte, 0) + bs := make([]byte, 2) + binary.BigEndian.PutUint16(bs, uint16(n1)) + answer = append(answer, bs...) + binary.BigEndian.PutUint16(bs, uint16(n2)) + answer = append(answer, bs...) + return answer +} + +func pack2Uint32(n1, n2 int) []byte { + answer := make([]byte, 0) + bs := make([]byte, 4) + binary.BigEndian.PutUint32(bs, uint32(n1)) + answer = append(answer, bs...) + binary.BigEndian.PutUint32(bs, uint32(n2)) + answer = append(answer, bs...) + return answer +} + +func packUint32(n1 int) []byte { + bs := make([]byte, 4) + binary.BigEndian.PutUint32(bs, uint32(n1)) + return bs +} + +func packUint16(n1 int) []byte { + bs := make([]byte, 2) + binary.BigEndian.PutUint16(bs, uint16(n1)) + return bs +} + +func keySortStrings(s map[string][]byte) []string { + keys := make([]string, len(s)) + i := 0 + for key := range s { + keys[i] = key + i++ + } + sort.Strings(keys) + return keys +} + +func keySortInt(s map[int]int) []int { + keys := make([]int, len(s)) + i := 0 + for key := range s { + keys[i] = key + i++ + } + sort.Ints(keys) + return keys +} + +func keySortArrayRangeMap(s map[int][]int) []int { + keys := make([]int, len(s)) + i := 0 + for key := range s { + keys[i] = key + i++ + } + sort.Ints(keys) + return keys +} + +// UTF8CutFont is a utility function that generates a TrueType font composed +// only of the runes included in cutset. The rune glyphs are copied from This +// function is demonstrated in ExampleUTF8CutFont(). +func UTF8CutFont(inBuf []byte, cutset string) (outBuf []byte) { + f := newUTF8Font(&fileReader{readerPosition: 0, array: inBuf}) + runes := map[int]int{} + for i, r := range cutset { + runes[i] = int(r) + } + outBuf = f.GenerateCutFont(runes) + return +} diff --git a/backend/vendor/github.com/phpdave11/gofpdf/util.go b/backend/vendor/github.com/phpdave11/gofpdf/util.go new file mode 100644 index 00000000..351d3192 --- /dev/null +++ b/backend/vendor/github.com/phpdave11/gofpdf/util.go @@ -0,0 +1,462 @@ +/* + * Copyright (c) 2013 Kurt Jung (Gmail: kurt.w.jung) + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package gofpdf + +import ( + "bufio" + "bytes" + "compress/zlib" + "fmt" + "io" + "math" + "os" + "path/filepath" + "strings" +) + +func round(f float64) int { + if f < 0 { + return -int(math.Floor(-f + 0.5)) + } + return int(math.Floor(f + 0.5)) +} + +func sprintf(fmtStr string, args ...interface{}) string { + return fmt.Sprintf(fmtStr, args...) +} + +// fileExist returns true if the specified normal file exists +func fileExist(filename string) (ok bool) { + info, err := os.Stat(filename) + if err == nil { + if ^os.ModePerm&info.Mode() == 0 { + ok = true + } + } + return ok +} + +// fileSize returns the size of the specified file; ok will be false +// if the file does not exist or is not an ordinary file +func fileSize(filename string) (size int64, ok bool) { + info, err := os.Stat(filename) + ok = err == nil + if ok { + size = info.Size() + } + return +} + +// bufferFromReader returns a new buffer populated with the contents of the specified Reader +func bufferFromReader(r io.Reader) (b *bytes.Buffer, err error) { + b = new(bytes.Buffer) + _, err = b.ReadFrom(r) + return +} + +// slicesEqual returns true if the two specified float slices are equal +func slicesEqual(a, b []float64) bool { + if len(a) != len(b) { + return false + } + for i := range a { + if a[i] != b[i] { + return false + } + } + return true +} + +// sliceCompress returns a zlib-compressed copy of the specified byte array +func sliceCompress(data []byte) []byte { + var buf bytes.Buffer + cmp, _ := zlib.NewWriterLevel(&buf, zlib.BestSpeed) + cmp.Write(data) + cmp.Close() + return buf.Bytes() +} + +// sliceUncompress returns an uncompressed copy of the specified zlib-compressed byte array +func sliceUncompress(data []byte) (outData []byte, err error) { + inBuf := bytes.NewReader(data) + r, err := zlib.NewReader(inBuf) + defer r.Close() + if err == nil { + var outBuf bytes.Buffer + _, err = outBuf.ReadFrom(r) + if err == nil { + outData = outBuf.Bytes() + } + } + return +} + +// utf8toutf16 converts UTF-8 to UTF-16BE; from http://www.fpdf.org/ +func utf8toutf16(s string, withBOM ...bool) string { + bom := true + if len(withBOM) > 0 { + bom = withBOM[0] + } + res := make([]byte, 0, 8) + if bom { + res = append(res, 0xFE, 0xFF) + } + nb := len(s) + i := 0 + for i < nb { + c1 := byte(s[i]) + i++ + switch { + case c1 >= 224: + // 3-byte character + c2 := byte(s[i]) + i++ + c3 := byte(s[i]) + i++ + res = append(res, ((c1&0x0F)<<4)+((c2&0x3C)>>2), + ((c2&0x03)<<6)+(c3&0x3F)) + case c1 >= 192: + // 2-byte character + c2 := byte(s[i]) + i++ + res = append(res, ((c1 & 0x1C) >> 2), + ((c1&0x03)<<6)+(c2&0x3F)) + default: + // Single-byte character + res = append(res, 0, c1) + } + } + return string(res) +} + +// intIf returns a if cnd is true, otherwise b +func intIf(cnd bool, a, b int) int { + if cnd { + return a + } + return b +} + +// strIf returns aStr if cnd is true, otherwise bStr +func strIf(cnd bool, aStr, bStr string) string { + if cnd { + return aStr + } + return bStr +} + +// doNothing returns the passed string with no translation. +func doNothing(s string) string { + return s +} + +// Dump the internals of the specified values +// func dump(fileStr string, a ...interface{}) { +// fl, err := os.OpenFile(fileStr, os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0600) +// if err == nil { +// fmt.Fprintf(fl, "----------------\n") +// spew.Fdump(fl, a...) +// fl.Close() +// } +// } + +func repClosure(m map[rune]byte) func(string) string { + var buf bytes.Buffer + return func(str string) string { + var ch byte + var ok bool + buf.Truncate(0) + for _, r := range str { + if r < 0x80 { + ch = byte(r) + } else { + ch, ok = m[r] + if !ok { + ch = byte('.') + } + } + buf.WriteByte(ch) + } + return buf.String() + } +} + +// UnicodeTranslator returns a function that can be used to translate, where +// possible, utf-8 strings to a form that is compatible with the specified code +// page. The returned function accepts a string and returns a string. +// +// r is a reader that should read a buffer made up of content lines that +// pertain to the code page of interest. Each line is made up of three +// whitespace separated fields. The first begins with "!" and is followed by +// two hexadecimal digits that identify the glyph position in the code page of +// interest. The second field begins with "U+" and is followed by the unicode +// code point value. The third is the glyph name. A number of these code page +// map files are packaged with the gfpdf library in the font directory. +// +// An error occurs only if a line is read that does not conform to the expected +// format. In this case, the returned function is valid but does not perform +// any rune translation. +func UnicodeTranslator(r io.Reader) (f func(string) string, err error) { + m := make(map[rune]byte) + var uPos, cPos uint32 + var lineStr, nameStr string + sc := bufio.NewScanner(r) + for sc.Scan() { + lineStr = sc.Text() + lineStr = strings.TrimSpace(lineStr) + if len(lineStr) > 0 { + _, err = fmt.Sscanf(lineStr, "!%2X U+%4X %s", &cPos, &uPos, &nameStr) + if err == nil { + if cPos >= 0x80 { + m[rune(uPos)] = byte(cPos) + } + } + } + } + if err == nil { + f = repClosure(m) + } else { + f = doNothing + } + return +} + +// UnicodeTranslatorFromFile returns a function that can be used to translate, +// where possible, utf-8 strings to a form that is compatible with the +// specified code page. See UnicodeTranslator for more details. +// +// fileStr identifies a font descriptor file that maps glyph positions to names. +// +// If an error occurs reading the file, the returned function is valid but does +// not perform any rune translation. +func UnicodeTranslatorFromFile(fileStr string) (f func(string) string, err error) { + var fl *os.File + fl, err = os.Open(fileStr) + if err == nil { + f, err = UnicodeTranslator(fl) + fl.Close() + } else { + f = doNothing + } + return +} + +// UnicodeTranslatorFromDescriptor returns a function that can be used to +// translate, where possible, utf-8 strings to a form that is compatible with +// the specified code page. See UnicodeTranslator for more details. +// +// cpStr identifies a code page. A descriptor file in the font directory, set +// with the fontDirStr argument in the call to New(), should have this name +// plus the extension ".map". If cpStr is empty, it will be replaced with +// "cp1252", the gofpdf code page default. +// +// If an error occurs reading the descriptor, the returned function is valid +// but does not perform any rune translation. +// +// The CellFormat_codepage example demonstrates this method. +func (f *Fpdf) UnicodeTranslatorFromDescriptor(cpStr string) (rep func(string) string) { + var str string + var ok bool + if f.err == nil { + if len(cpStr) == 0 { + cpStr = "cp1252" + } + str, ok = embeddedMapList[cpStr] + if ok { + rep, f.err = UnicodeTranslator(strings.NewReader(str)) + } else { + rep, f.err = UnicodeTranslatorFromFile(filepath.Join(f.fontpath, cpStr) + ".map") + } + } else { + rep = doNothing + } + return +} + +// Transform moves a point by given X, Y offset +func (p *PointType) Transform(x, y float64) PointType { + return PointType{p.X + x, p.Y + y} +} + +// Orientation returns the orientation of a given size: +// "P" for portrait, "L" for landscape +func (s *SizeType) Orientation() string { + if s == nil || s.Ht == s.Wd { + return "" + } + if s.Wd > s.Ht { + return "L" + } + return "P" +} + +// ScaleBy expands a size by a certain factor +func (s *SizeType) ScaleBy(factor float64) SizeType { + return SizeType{s.Wd * factor, s.Ht * factor} +} + +// ScaleToWidth adjusts the height of a size to match the given width +func (s *SizeType) ScaleToWidth(width float64) SizeType { + height := s.Ht * width / s.Wd + return SizeType{width, height} +} + +// ScaleToHeight adjusts the width of a size to match the given height +func (s *SizeType) ScaleToHeight(height float64) SizeType { + width := s.Wd * height / s.Ht + return SizeType{width, height} +} + +//The untypedKeyMap structure and its methods are copyrighted 2019 by Arteom Korotkiy (Gmail: arteomkorotkiy). +//Imitation of untyped Map Array +type untypedKeyMap struct { + keySet []interface{} + valueSet []int +} + +//Get position of key=>value in PHP Array +func (pa *untypedKeyMap) getIndex(key interface{}) int { + if key != nil { + for i, mKey := range pa.keySet { + if mKey == key { + return i + } + } + return -1 + } + return -1 +} + +//Put key=>value in PHP Array +func (pa *untypedKeyMap) put(key interface{}, value int) { + if key == nil { + var i int + for n := 0; ; n++ { + i = pa.getIndex(n) + if i < 0 { + key = n + break + } + } + pa.keySet = append(pa.keySet, key) + pa.valueSet = append(pa.valueSet, value) + } else { + i := pa.getIndex(key) + if i < 0 { + pa.keySet = append(pa.keySet, key) + pa.valueSet = append(pa.valueSet, value) + } else { + pa.valueSet[i] = value + } + } +} + +//Delete value in PHP Array +func (pa *untypedKeyMap) delete(key interface{}) { + if pa == nil || pa.keySet == nil || pa.valueSet == nil { + return + } + i := pa.getIndex(key) + if i >= 0 { + if i == 0 { + pa.keySet = pa.keySet[1:] + pa.valueSet = pa.valueSet[1:] + } else if i == len(pa.keySet)-1 { + pa.keySet = pa.keySet[:len(pa.keySet)-1] + pa.valueSet = pa.valueSet[:len(pa.valueSet)-1] + } else { + pa.keySet = append(pa.keySet[:i], pa.keySet[i+1:]...) + pa.valueSet = append(pa.valueSet[:i], pa.valueSet[i+1:]...) + } + } +} + +//Get value from PHP Array +func (pa *untypedKeyMap) get(key interface{}) int { + i := pa.getIndex(key) + if i >= 0 { + return pa.valueSet[i] + } + return 0 +} + +//Imitation of PHP function pop() +func (pa *untypedKeyMap) pop() { + pa.keySet = pa.keySet[:len(pa.keySet)-1] + pa.valueSet = pa.valueSet[:len(pa.valueSet)-1] +} + +//Imitation of PHP function array_merge() +func arrayMerge(arr1, arr2 *untypedKeyMap) *untypedKeyMap { + answer := untypedKeyMap{} + if arr1 == nil && arr2 == nil { + answer = untypedKeyMap{ + make([]interface{}, 0), + make([]int, 0), + } + } else if arr2 == nil { + answer.keySet = arr1.keySet[:] + answer.valueSet = arr1.valueSet[:] + } else if arr1 == nil { + answer.keySet = arr2.keySet[:] + answer.valueSet = arr2.valueSet[:] + } else { + answer.keySet = arr1.keySet[:] + answer.valueSet = arr1.valueSet[:] + for i := 0; i < len(arr2.keySet); i++ { + if arr2.keySet[i] == "interval" { + if arr1.getIndex("interval") < 0 { + answer.put("interval", arr2.valueSet[i]) + } + } else { + answer.put(nil, arr2.valueSet[i]) + } + } + } + return &answer +} + +func remove(arr []int, key int) []int { + n := 0 + for i, mKey := range arr { + if mKey == key { + n = i + } + } + if n == 0 { + return arr[1:] + } else if n == len(arr)-1 { + return arr[:len(arr)-1] + } + return append(arr[:n], arr[n+1:]...) +} + +func isChinese(rune2 rune) bool { + // chinese unicode: 4e00-9fa5 + if rune2 >= rune(0x4e00) && rune2 <= rune(0x9fa5) { + return true + } + return false +} + +// Condition font family string to PDF name compliance. See section 5.3 (Names) +// in https://resources.infosecinstitute.com/pdf-file-format-basic-structure/ +func fontFamilyEscape(familyStr string) (escStr string) { + escStr = strings.Replace(familyStr, " ", "#20", -1) + // Additional replacements can take place here + return +} diff --git a/backend/vendor/modules.txt b/backend/vendor/modules.txt index 88bd6c22..ba795ac8 100644 --- a/backend/vendor/modules.txt +++ b/backend/vendor/modules.txt @@ -1,3 +1,23 @@ +# baliance.com/gooxml v1.0.1 +## explicit +baliance.com/gooxml +baliance.com/gooxml/algo +baliance.com/gooxml/color +baliance.com/gooxml/common +baliance.com/gooxml/document +baliance.com/gooxml/measurement +baliance.com/gooxml/schema/soo/dml +baliance.com/gooxml/schema/soo/dml/picture +baliance.com/gooxml/schema/soo/ofc/docPropsVTypes +baliance.com/gooxml/schema/soo/ofc/extended_properties +baliance.com/gooxml/schema/soo/ofc/math +baliance.com/gooxml/schema/soo/ofc/sharedTypes +baliance.com/gooxml/schema/soo/pkg/content_types +baliance.com/gooxml/schema/soo/pkg/metadata/core_properties +baliance.com/gooxml/schema/soo/pkg/relationships +baliance.com/gooxml/schema/soo/schemaLibrary +baliance.com/gooxml/schema/soo/wml +baliance.com/gooxml/zippkg # cloud.google.com/go/auth v0.16.3 ## explicit; go 1.23.0 cloud.google.com/go/auth @@ -171,12 +191,18 @@ github.com/mitchellh/go-homedir # github.com/mitchellh/mapstructure v1.5.0 ## explicit; go 1.14 github.com/mitchellh/mapstructure +# github.com/nguyenthenguyen/docx v0.0.0-20230621112118-9c8e795a11db +## explicit; go 1.16 +github.com/nguyenthenguyen/docx # github.com/patrickmn/go-cache v2.1.0+incompatible ## explicit github.com/patrickmn/go-cache # github.com/pelletier/go-toml v1.7.0 ## explicit; go 1.12 github.com/pelletier/go-toml +# github.com/phpdave11/gofpdf v1.4.3 +## explicit; go 1.12 +github.com/phpdave11/gofpdf # github.com/pkg/errors v0.9.1 ## explicit github.com/pkg/errors diff --git a/frontend/src/api/companies.ts b/frontend/src/api/companies.ts index 1f66cbe7..15f22a76 100644 --- a/frontend/src/api/companies.ts +++ b/frontend/src/api/companies.ts @@ -90,3 +90,21 @@ export const updateRepresentativeOrder = ( export const uploadCompanyInternalImage = (id: string, data: FormData) => instance.post(`/companies/${id}/image/internal`, data); + +export interface GenerateCompanyContractData { + language: string; + eventId: number; +} + +export const generateCompanyContract = ( + companyId: string, + data: GenerateCompanyContractData, +) => { + const payload = { + ...data, + language: (data.language ?? "en").toLowerCase(), + } as GenerateCompanyContractData; + return instance.post(`/companies/${companyId}/contract/docx`, payload, { + responseType: "blob", + }); +}; diff --git a/frontend/src/api/templates.ts b/frontend/src/api/templates.ts new file mode 100644 index 00000000..3be3a06b --- /dev/null +++ b/frontend/src/api/templates.ts @@ -0,0 +1,34 @@ +import { instance } from "."; + +export const getTemplates = (params?: { event?: number; name?: string }) => + instance.get("/templates", { params }); + +export const uploadTemplate = ( + templateId: string, + eventId: number, + file: File, +) => { + const fd = new FormData(); + fd.append("file", file); + return instance.post(`/templates/${templateId}/upload`, fd, { + params: { event: eventId }, + headers: { "Content-Type": "multipart/form-data" }, + }); +}; + +export const uploadTemplateByName = ( + name: string, + eventId: number, + file: File, +) => { + const fd = new FormData(); + fd.append("file", file); + fd.append("name", name); + return instance.post(`/templates/upload-by-name`, fd, { + params: { event: eventId }, + headers: { "Content-Type": "multipart/form-data" }, + }); +}; + +export const downloadTemplate = (templateId: string) => + instance.get(`/templates/${templateId}/download`, { responseType: "blob" }); diff --git a/frontend/src/components/Navbar.vue b/frontend/src/components/Navbar.vue index 97e1d040..1f685e5c 100644 --- a/frontend/src/components/Navbar.vue +++ b/frontend/src/components/Navbar.vue @@ -62,6 +62,7 @@ const coordNavigation: NavigationItem[] = [ { name: "My Team", to: { name: "my-coordination-team" } }, { name: "Coordination Teams", to: { name: "coordination-teams" } }, { name: "Packages", to: { name: "event-packages" } }, + { name: "Templates", to: { name: "contract-templates" } }, ]; const { data: events, isLoading: eventsLoading } = useQuery({ diff --git a/frontend/src/components/companies/CompanyBillingInfo.vue b/frontend/src/components/companies/CompanyBillingInfo.vue index 4d291885..f9b830a1 100644 --- a/frontend/src/components/companies/CompanyBillingInfo.vue +++ b/frontend/src/components/companies/CompanyBillingInfo.vue @@ -61,6 +61,11 @@ {{ company?.billingInfo?.tin }} + + @@ -75,6 +80,7 @@ diff --git a/frontend/src/router.ts b/frontend/src/router.ts index 6ce9996f..df0b8afc 100644 --- a/frontend/src/router.ts +++ b/frontend/src/router.ts @@ -80,6 +80,15 @@ const router = createRouter({ ), meta: { roles: ["COORDINATOR", "ADMIN"] }, }, + { + path: "contract-templates", + name: "contract-templates", + component: () => + import( + "./views/Dashboard/ContractTemplates/ContractTemplatesView.vue" + ), + meta: { roles: ["COORDINATOR", "ADMIN"] }, + }, { path: "me/coord-team", name: "my-coordination-team", diff --git a/frontend/src/views/Dashboard/ContractTemplates/ContractTemplatesView.vue b/frontend/src/views/Dashboard/ContractTemplates/ContractTemplatesView.vue new file mode 100644 index 00000000..f2de3499 --- /dev/null +++ b/frontend/src/views/Dashboard/ContractTemplates/ContractTemplatesView.vue @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + diff --git a/frontend/src/views/Dashboard/ContractTemplates/TemplatesList.vue b/frontend/src/views/Dashboard/ContractTemplates/TemplatesList.vue new file mode 100644 index 00000000..30f85a46 --- /dev/null +++ b/frontend/src/views/Dashboard/ContractTemplates/TemplatesList.vue @@ -0,0 +1,58 @@ + + + + + Templates for this edition + + No templates for this edition. + + + + + Name + Actions + + + + + {{ t.name }} + + Download + + + + + + diff --git a/frontend/src/views/Dashboard/ContractTemplates/UploadTemplateForm.vue b/frontend/src/views/Dashboard/ContractTemplates/UploadTemplateForm.vue new file mode 100644 index 00000000..3fa07d31 --- /dev/null +++ b/frontend/src/views/Dashboard/ContractTemplates/UploadTemplateForm.vue @@ -0,0 +1,98 @@ + + + + + Upload Template File + + + Template record + + + + + + + {{ t.name }} + + + + + + + File (.docx) + + + + + Upload + Uploading... + + +
{{ company?.billingInfo?.tin }}