├── .github ├── preview.png ├── ISSUE_TEMPLATE.md └── workflows │ └── greetings.yml ├── LICENSE.md ├── schema ├── soo │ ├── ofc │ │ └── relationships │ │ │ └── relationships.go │ ├── dml │ │ ├── lockedCanvas │ │ │ └── lockedCanvas.go │ │ └── picture │ │ │ └── picture.go │ ├── schemaLibrary │ │ └── schemaLibrary.go │ └── pkg │ │ └── relationships │ │ └── relationships.go ├── schemas.microsoft.com │ └── office │ │ └── word │ │ ├── 2015 │ │ └── wordml │ │ │ └── symex │ │ │ └── symex.go │ │ ├── 2016 │ │ └── wordml │ │ │ └── cid │ │ │ └── cid.go │ │ ├── 2018 │ │ └── wordml │ │ │ ├── wordml.go │ │ │ └── cex │ │ │ └── cex.go │ │ ├── 2020 │ │ └── wordml │ │ │ └── sdtdatahash │ │ │ └── sdtdatahash.go │ │ └── 2023 │ │ └── wordml │ │ └── word16du │ │ └── word16du.go ├── purl.org │ └── dc │ │ └── elements │ │ └── elements.go └── urn │ └── schemas_microsoft_com │ └── office │ └── powerpoint │ └── powerpoint.go ├── algo └── algo.go ├── utils └── utils.go ├── spreadsheet ├── update │ └── update.go └── reference │ └── reference.go ├── measurement └── measurement.go ├── go.mod ├── common ├── tempstorage │ ├── diskstore │ │ └── diskstore.go │ ├── tempstorage.go │ └── memstore │ │ └── memstore.go ├── license │ └── license.go └── logger │ └── logger.go ├── internal ├── sort │ └── sort.go ├── wildcard │ └── wildcard.go ├── mscfb │ └── rw │ │ └── rw.go └── formatutils │ └── formatutils.go ├── ACKNOWLEDGEMENTS.md ├── CLA.md ├── go.sum ├── README.md ├── drawing └── drawing.go ├── zippkg └── zippkg.go └── vmldrawing └── vmldrawing.go /.github/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unidoc/unioffice/HEAD/.github/preview.png -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Description 2 | 3 | ## Expected Behavior 4 | 5 | ## Actual Behavior 6 | 7 | 8 | Please include a reproducible code snippet or document attachment that 9 | demonstrates the issue. -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | ## Licensing Information 2 | 3 | This software package is a commercial product and requires a license 4 | code to operate. 5 | 6 | The use of this software package is governed by the end-user license agreement 7 | (EULA) available at: https://unidoc.io/eula/ 8 | 9 | To obtain a Trial license code to evaluate the software, please visit 10 | https://unidoc.io/ 11 | -------------------------------------------------------------------------------- /schema/soo/ofc/relationships/relationships.go: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2020 FoxyUtils ehf. All rights reserved. 3 | // 4 | // This is a commercial product and requires a license to operate. 5 | // A trial license can be obtained at https://unidoc.io 6 | // 7 | // DO NOT EDIT: generated by unitwist Go source code obfuscator. 8 | // 9 | // Use of this source code is governed by the UniDoc End User License Agreement 10 | // terms that can be accessed at https://unidoc.io/eula/ 11 | 12 | package relationships ; -------------------------------------------------------------------------------- /schema/schemas.microsoft.com/office/word/2023/wordml/word16du/word16du.go: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2020 FoxyUtils ehf. All rights reserved. 3 | // 4 | // This is a commercial product and requires a license to operate. 5 | // A trial license can be obtained at https://unidoc.io 6 | // 7 | // DO NOT EDIT: generated by unitwist Go source code obfuscator. 8 | // 9 | // Use of this source code is governed by the UniDoc End User License Agreement 10 | // terms that can be accessed at https://unidoc.io/eula/ 11 | 12 | package word16du ; -------------------------------------------------------------------------------- /schema/schemas.microsoft.com/office/word/2020/wordml/sdtdatahash/sdtdatahash.go: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2020 FoxyUtils ehf. All rights reserved. 3 | // 4 | // This is a commercial product and requires a license to operate. 5 | // A trial license can be obtained at https://unidoc.io 6 | // 7 | // DO NOT EDIT: generated by unitwist Go source code obfuscator. 8 | // 9 | // Use of this source code is governed by the UniDoc End User License Agreement 10 | // terms that can be accessed at https://unidoc.io/eula/ 11 | 12 | package sdtdatahash ; -------------------------------------------------------------------------------- /algo/algo.go: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2020 FoxyUtils ehf. All rights reserved. 3 | // 4 | // This is a commercial product and requires a license to operate. 5 | // A trial license can be obtained at https://unidoc.io 6 | // 7 | // DO NOT EDIT: generated by unitwist Go source code obfuscator. 8 | // 9 | // Use of this source code is governed by the UniDoc End User License Agreement 10 | // terms that can be accessed at https://unidoc.io/eula/ 11 | 12 | package algo ;func RepeatString (s string ,cnt int )string {if cnt <=0{return "";};_e :=make ([]byte ,len (s )*cnt );_a :=[]byte (s );for _c :=0;_c < cnt ;_c ++{copy (_e [_c :],_a );};return string (_e );}; -------------------------------------------------------------------------------- /utils/utils.go: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2020 FoxyUtils ehf. All rights reserved. 3 | // 4 | // This is a commercial product and requires a license to operate. 5 | // A trial license can be obtained at https://unidoc.io 6 | // 7 | // DO NOT EDIT: generated by unitwist Go source code obfuscator. 8 | // 9 | // Use of this source code is governed by the UniDoc End User License Agreement 10 | // terms that can be accessed at https://unidoc.io/eula/ 11 | 12 | package utils ;import (_d "bytes";_f "github.com/unidoc/unioffice/v2/document";_ef "github.com/unidoc/unioffice/v2/document/convert";_b "github.com/unidoc/unipdf/v4/model";); 13 | 14 | // GetNumPages will try to get actual document page count by converting the document to a PDF first 15 | // and then get the actual page count from the PDF result. 16 | // 17 | // WARNING: This method is currently in experimental state as the PDF result might have incorrect page count. 18 | func GetNumPages (d *_f .Document )(int ,error ){var _a _d .Buffer ;_db :=_ef .ConvertToPdf (d );if _g :=_db .Write (&_a );_g !=nil {return 0,_g ;};_c ,_ca :=_b .NewPdfReader (_d .NewReader (_a .Bytes ()));if _ca !=nil {return 0,_ca ;};_ea ,_ca :=_c .GetNumPages (); 19 | if _ca !=nil {return 0,_ca ;};return _ea ,nil ;}; -------------------------------------------------------------------------------- /.github/workflows/greetings.yml: -------------------------------------------------------------------------------- 1 | name: Greetings 2 | 3 | on: [issues] 4 | 5 | jobs: 6 | greeting: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/first-interaction@v1 10 | with: 11 | repo-token: ${{ secrets.GITHUB_TOKEN }} 12 | issue-message: | 13 | Welcome! Thanks for posting your first issue. The way things work here is that while customer issues are prioritized, 14 | other issues go into our backlog where they are assessed and fitted into the roadmap when suitable. 15 | If you need to get this done, consider buying a license which also enables you to use it in your commercial products. 16 | More information can be found on https://unidoc.io/ 17 | pr-message: | 18 | Thanks for posting your first PR. Please be sure to sign the CLA and make sure that the 19 | the Developer Guidelines https://github.com/unidoc/unioffice/wiki/UniOffice-Developer-Guide were followed. 20 | You can expect that we will review the PR and post comments. The timeframe fpr this can vary depending 21 | on various factors, including which issue(s) the PR addresses and where it fits in the roadmap. 22 | Note also that customer PRs are prioritized. 23 | -------------------------------------------------------------------------------- /spreadsheet/update/update.go: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2020 FoxyUtils ehf. All rights reserved. 3 | // 4 | // This is a commercial product and requires a license to operate. 5 | // A trial license can be obtained at https://unidoc.io 6 | // 7 | // DO NOT EDIT: generated by unitwist Go source code obfuscator. 8 | // 9 | // Use of this source code is governed by the UniDoc End User License Agreement 10 | // terms that can be accessed at https://unidoc.io/eula/ 11 | 12 | // Package update contains definitions needed for updating references after removing rows/columns. 13 | package update ;const (UpdateActionRemoveColumn UpdateAction =iota ;); 14 | 15 | // UpdateQuery contains terms of how to update references after removing row/column. 16 | type UpdateQuery struct{ 17 | 18 | // UpdateType is one of the update types like UpdateActionRemoveColumn. 19 | UpdateType UpdateAction ; 20 | 21 | // ColumnIdx is the index of the column removed. 22 | ColumnIdx uint32 ; 23 | 24 | // SheetToUpdate contains the name of the sheet on which removing happened. 25 | SheetToUpdate string ; 26 | 27 | // UpdateCurrentSheet is true if references without sheet prefix should be updated as well. 28 | UpdateCurrentSheet bool ;}; 29 | 30 | // UpdateAction is the type for update types constants. 31 | type UpdateAction byte ; -------------------------------------------------------------------------------- /measurement/measurement.go: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2020 FoxyUtils ehf. All rights reserved. 3 | // 4 | // This is a commercial product and requires a license to operate. 5 | // A trial license can be obtained at https://unidoc.io 6 | // 7 | // DO NOT EDIT: generated by unitwist Go source code obfuscator. 8 | // 9 | // Use of this source code is governed by the UniDoc End User License Agreement 10 | // terms that can be accessed at https://unidoc.io/eula/ 11 | 12 | package measurement ; 13 | 14 | // FromEMU converts int64 EMU units to float64 distance units. 15 | func FromEMU (emu int64 )float64 {return float64 (emu )/914400*Inch };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 ; 16 | Foot =12*Inch ;Twips =1.0/20.0*Point ;EMU =1.0/914400.0*Inch ;HundredthPoint =1/100.0;Dxa =Twips ;);const _d =60000; 17 | 18 | // Convert ST_Angle to degree. 19 | func DegreeFromSTAngle (stAngle int32 )float64 {return -float64 (stAngle )/_d }; 20 | 21 | // Distance represents a distance and is automatically converted 22 | // to the units needed internally in the various ECMA 376 formats. 23 | type Distance float64 ; 24 | 25 | // ToEMU converts float64 distance units to int64 EMU. 26 | func ToEMU (m float64 )int64 {return int64 (914400.0/Inch *m )}; -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/unidoc/unioffice/v2 2 | 3 | go 1.23.0 4 | 5 | require ( 6 | github.com/richardlehane/msoleps v1.0.4 7 | github.com/stretchr/testify v1.11.1 8 | github.com/unidoc/emf v0.1.0 9 | github.com/unidoc/unichart v0.5.1 10 | github.com/unidoc/unipdf/v4 v4.3.0 11 | github.com/unidoc/unitype v0.5.1 12 | golang.org/x/image v0.30.0 13 | ) 14 | 15 | require ( 16 | github.com/adrg/strutil v0.3.1 // indirect 17 | github.com/adrg/sysfont v0.1.2 // indirect 18 | github.com/adrg/xdg v0.5.3 // indirect 19 | github.com/davecgh/go-spew v1.1.1 // indirect 20 | github.com/disintegration/imaging v1.6.2 // indirect 21 | github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect 22 | github.com/gorilla/i18n v0.0.0-20150820051429-8b358169da46 // indirect 23 | github.com/h2non/filetype v1.1.3 // indirect 24 | github.com/llgcode/draw2d v0.0.0-20240627062922-0ed1ff131195 // indirect 25 | github.com/pmezard/go-difflib v1.0.0 // indirect 26 | github.com/sirupsen/logrus v1.9.3 // indirect 27 | github.com/unidoc/freetype v0.2.3 // indirect 28 | github.com/unidoc/garabic v0.0.0-20220702200334-8c7cb25baa11 // indirect 29 | github.com/unidoc/pkcs7 v0.3.0 // indirect 30 | github.com/unidoc/timestamp v0.0.0-20200412005513-91597fd3793a // indirect 31 | golang.org/x/crypto v0.41.0 // indirect 32 | golang.org/x/net v0.43.0 // indirect 33 | golang.org/x/sys v0.35.0 // indirect 34 | golang.org/x/text v0.28.0 // indirect 35 | golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect 36 | gopkg.in/yaml.v3 v3.0.1 // indirect 37 | ) 38 | -------------------------------------------------------------------------------- /common/tempstorage/diskstore/diskstore.go: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2020 FoxyUtils ehf. All rights reserved. 3 | // 4 | // This is a commercial product and requires a license to operate. 5 | // A trial license can be obtained at https://unidoc.io 6 | // 7 | // DO NOT EDIT: generated by unitwist Go source code obfuscator. 8 | // 9 | // Use of this source code is governed by the UniDoc End User License Agreement 10 | // terms that can be accessed at https://unidoc.io/eula/ 11 | 12 | // Package diskstore implements tempStorage interface 13 | // by using disk as a storage 14 | package diskstore ;import (_ab "github.com/unidoc/unioffice/v2/common/tempstorage";_ae "io/ioutil";_da "os";_d "strings";); 15 | 16 | // TempFile creates a new temp directory by calling ioutil TempDir 17 | func (_dg diskStorage )TempDir (pattern string )(string ,error ){return _ae .TempDir ("",pattern )}; 18 | 19 | // Open opens file from disk according to a path 20 | func (_e diskStorage )Open (path string )(_ab .File ,error ){return _da .OpenFile (path ,_da .O_RDWR ,0644);}; 21 | 22 | // TempFile creates a new temp file by calling ioutil TempFile 23 | func (_ed diskStorage )TempFile (dir ,pattern string )(_ab .File ,error ){return _ae .TempFile (dir ,pattern );}; 24 | 25 | // SetAsStorage sets temp storage as a disk storage 26 | func SetAsStorage (){_c :=diskStorage {};_ab .SetAsStorage (&_c )}; 27 | 28 | // Add is not applicable in the diskstore implementation 29 | func (_dc diskStorage )Add (path string )error {return nil };type diskStorage struct{}; 30 | 31 | // RemoveAll removes all files in the directory 32 | func (_ee diskStorage )RemoveAll (dir string )error {if _d .HasPrefix (dir ,_da .TempDir ()){return _da .RemoveAll (dir );};return nil ;}; -------------------------------------------------------------------------------- /common/tempstorage/tempstorage.go: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2020 FoxyUtils ehf. All rights reserved. 3 | // 4 | // This is a commercial product and requires a license to operate. 5 | // A trial license can be obtained at https://unidoc.io 6 | // 7 | // DO NOT EDIT: generated by unitwist Go source code obfuscator. 8 | // 9 | // Use of this source code is governed by the UniDoc End User License Agreement 10 | // terms that can be accessed at https://unidoc.io/eula/ 11 | 12 | package tempstorage ;import _ga "io"; 13 | 14 | // File is a representation of a storage file 15 | // with Read, Write, Close and Name methods identical to os.File. 16 | type File interface{_ga .Reader ;_ga .ReaderAt ;_ga .Writer ;_ga .Closer ;Name ()string ;};type storage interface{Open (_d string )(File ,error );TempFile (_b ,_db string )(File ,error );TempDir (_c string )(string ,error );RemoveAll (_f string )error ; 17 | Add (_fg string )error ;}; 18 | 19 | // TempFile creates new empty file in the storage and returns it. 20 | func TempFile (dir ,pattern string )(File ,error ){return _bg .TempFile (dir ,pattern )}; 21 | 22 | // RemoveAll removes all files according to the dir argument prefix. 23 | func RemoveAll (dir string )error {return _bg .RemoveAll (dir )}; 24 | 25 | // Add reads a file from a disk and adds it to the storage. 26 | func Add (path string )error {return _bg .Add (path )}; 27 | 28 | // TempDir creates a name for a new temp directory using a pattern argument. 29 | func TempDir (pattern string )(string ,error ){return _bg .TempDir (pattern )};var _bg storage ; 30 | 31 | // SetAsStorage changes temporary storage to newStorage. 32 | func SetAsStorage (newStorage storage ){_bg =newStorage }; 33 | 34 | // Open returns tempstorage File object by name. 35 | func Open (path string )(File ,error ){return _bg .Open (path )}; -------------------------------------------------------------------------------- /internal/sort/sort.go: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2020 FoxyUtils ehf. All rights reserved. 3 | // 4 | // This is a commercial product and requires a license to operate. 5 | // A trial license can be obtained at https://unidoc.io 6 | // 7 | // DO NOT EDIT: generated by unitwist Go source code obfuscator. 8 | // 9 | // Use of this source code is governed by the UniDoc End User License Agreement 10 | // terms that can be accessed at https://unidoc.io/eula/ 11 | 12 | package sort ;import (_d "regexp";_a "sort";_ge "strconv";);var _dg =_d .MustCompile ("\u0028\\\u0064\u002b\u007c\u005c\u0044\u002b)");func (_cbb stringSlice )Less (a ,b int )bool {return NaturalCompare (_cbb [a ],_cbb [b ])};func (_ac stringSlice )Swap (a ,b int ){_ac [a ],_ac [b ]=_ac [b ],_ac [a ]}; 13 | func NaturalSort (l []string ){_a .Sort (stringSlice (l ))};func MergeSort (array []float64 )[]float64 {if len (array )<=1{_c :=make ([]float64 ,len (array ));copy (_c ,array );return _c ;};_b :=len (array )/2;_cd :=MergeSort (array [:_b ]);_e :=MergeSort (array [_b :]); 14 | _cc :=make ([]float64 ,len (array ));_dd :=0;_cb :=0;_ba :=0;for _cb < len (_cd )&&_ba < len (_e ){if _cd [_cb ]<=_e [_ba ]{_cc [_dd ]=_cd [_cb ];_cb ++;}else {_cc [_dd ]=_e [_ba ];_ba ++;};_dd ++;};for _cb < len (_cd ){_cc [_dd ]=_cd [_cb ];_cb ++;_dd ++; 15 | };for _ba < len (_e ){_cc [_dd ]=_e [_ba ];_ba ++;_dd ++;};return _cc ;};type stringSlice []string ;func NaturalCompare (a ,b string )bool {_eb :=_ed (a );_gcc :=_ed (b );_ee :=len (_eb );_cf :=len (_gcc );for _db :=range _eb {if _db >=_cf {return false ; 16 | };_dc ,_bc :=_ge .Atoi (_eb [_db ]);_gcg ,_dbc :=_ge .Atoi (_gcc [_db ]);if _bc ==nil &&_dbc ==nil {if _dc ==_gcg {if _db ==_ee -1{return true ;}else if _db ==_cf -1{return false ;};continue ;};return _dc < _gcg ;};if _eb [_db ]==_gcc [_db ]{if _db ==_ee -1{return true ; 17 | }else if _db ==_cf -1{return false ;};continue ;};return _eb [_db ]< _gcc [_db ];};return false ;};func (_df stringSlice )Len ()int {return len (_df )};func _ed (_gc string )[]string {return _dg .FindAllString (_gc ,-1)}; -------------------------------------------------------------------------------- /internal/wildcard/wildcard.go: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2020 FoxyUtils ehf. All rights reserved. 3 | // 4 | // This is a commercial product and requires a license to operate. 5 | // A trial license can be obtained at https://unidoc.io 6 | // 7 | // DO NOT EDIT: generated by unitwist Go source code obfuscator. 8 | // 9 | // Use of this source code is governed by the UniDoc End User License Agreement 10 | // terms that can be accessed at https://unidoc.io/eula/ 11 | 12 | package wildcard ;func _d (_dd ,_cec []rune ,_ga bool )bool {for len (_cec )> 0{switch _cec [0]{default:if len (_dd )==0||_dd [0]!=_cec [0]{return false ;};case '?':if len (_dd )==0&&!_ga {return false ;};case '*':return _d (_dd ,_cec [1:],_ga )||(len (_dd )> 0&&_d (_dd [1:],_cec ,_ga )); 13 | };_dd =_dd [1:];_cec =_cec [1:];};return len (_dd )==0&&len (_cec )==0;};func Match (pattern ,name string )(_ce bool ){if pattern ==""{return name ==pattern ;};if pattern =="\u002a"{return true ;};_gga :=make ([]rune ,0,len (name ));_cb :=make ([]rune ,0,len (pattern )); 14 | for _ ,_cc :=range name {_gga =append (_gga ,_cc );};for _ ,_bb :=range pattern {_cb =append (_cb ,_bb );};_gda :=false ;return _d (_gga ,_cb ,_gda );};func MatchSimple (pattern ,name string )bool {if pattern ==""{return name ==pattern ;};if pattern =="\u002a"{return true ; 15 | };_ge :=make ([]rune ,0,len (name ));_c :=make ([]rune ,0,len (pattern ));for _ ,_gg :=range name {_ge =append (_ge ,_gg );};for _ ,_e :=range pattern {_c =append (_c ,_e );};_cf :=true ;return _d (_ge ,_c ,_cf );};func Index (pattern ,name string )(_f int ){if pattern ==""||pattern =="\u002a"{return 0; 16 | };_df :=make ([]rune ,0,len (name ));_fe :=make ([]rune ,0,len (pattern ));for _ ,_ec :=range name {_df =append (_df ,_ec );};for _ ,_eb :=range pattern {_fe =append (_fe ,_eb );};return _fb (_df ,_fe ,0);};func _fb (_bf ,_gbe []rune ,_dc int )int {for len (_gbe )> 0{switch _gbe [0]{default:if len (_bf )==0{return -1; 17 | };if _bf [0]!=_gbe [0]{return _fb (_bf [1:],_gbe ,_dc +1);};case '?':if len (_bf )==0{return -1;};case '*':if len (_bf )==0{return -1;};_bbf :=_fb (_bf ,_gbe [1:],_dc );if _bbf !=-1{return _dc ;}else {_bbf =_fb (_bf [1:],_gbe ,_dc );if _bbf !=-1{return _dc ; 18 | }else {return -1;};};};_bf =_bf [1:];_gbe =_gbe [1:];};return _dc ;}; -------------------------------------------------------------------------------- /common/license/license.go: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2020 FoxyUtils ehf. All rights reserved. 3 | // 4 | // This is a commercial product and requires a license to operate. 5 | // A trial license can be obtained at https://unidoc.io 6 | // 7 | // DO NOT EDIT: generated by unitwist Go source code obfuscator. 8 | // 9 | // Use of this source code is governed by the UniDoc End User License Agreement 10 | // terms that can be accessed at https://unidoc.io/eula/ 11 | 12 | // Package license helps manage commercial licenses and check if they 13 | // are valid for the version of UniOffice used. 14 | package license ;import _g "github.com/unidoc/unioffice/v2/internal/license"; 15 | 16 | // LicenseKey represents a loaded license key. 17 | type LicenseKey =_g .LicenseKey ; 18 | 19 | // SetMeteredKeyPersistentCache sets the metered License API Key persistent cache. 20 | // Default value `true`, set to `false` will report the usage immediately to license server, 21 | // this can be used when there's no access to persistent data storage. 22 | func SetMeteredKeyPersistentCache (val bool ){_g .SetMeteredKeyPersistentCache (val )}; 23 | 24 | // LegacyLicenseType is the type of license 25 | type LegacyLicenseType =_g .LegacyLicenseType ; 26 | 27 | // SetMeteredKey sets the metered License API key required for SaaS operation. 28 | // Document usage is reported periodically for the product to function correctly. 29 | func SetMeteredKey (apiKey string )error {return _g .SetMeteredKey (apiKey )}; 30 | 31 | // LegacyLicense holds the old-style unioffice license information. 32 | type LegacyLicense =_g .LegacyLicense ;const (LicenseTierUnlicensed =_g .LicenseTierUnlicensed ;LicenseTierCommunity =_g .LicenseTierCommunity ;LicenseTierIndividual =_g .LicenseTierIndividual ;LicenseTierBusiness =_g .LicenseTierBusiness ;); 33 | 34 | // GetLicenseKey returns the currently loaded license key. 35 | func GetLicenseKey ()*LicenseKey {return _g .GetLicenseKey ()}; 36 | 37 | // GetMeteredState checks the currently used metered document usage status, 38 | // documents used and credits available. 39 | func GetMeteredState ()(_g .MeteredStatus ,error ){return _g .GetMeteredState ()}; 40 | 41 | // MakeUnlicensedKey returns a default key. 42 | func MakeUnlicensedKey ()*LicenseKey {return _g .MakeUnlicensedKey ()}; 43 | 44 | // SetMeteredKeyUsageLogVerboseMode sets the metered License API Key usage log verbose mode. 45 | // Default value `false`, set to `true` will log the credit usages and print out to console with log level INFO. 46 | func SetMeteredKeyUsageLogVerboseMode (val bool ){_g .SetMeteredKeyUsageLogVerboseMode (val )}; 47 | 48 | // SetLicenseKey sets and validates the license key. 49 | func SetLicenseKey (content string ,customerName string )error {return _g .SetLicenseKey (content ,customerName );}; -------------------------------------------------------------------------------- /schema/soo/dml/lockedCanvas/lockedCanvas.go: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2020 FoxyUtils ehf. All rights reserved. 3 | // 4 | // This is a commercial product and requires a license to operate. 5 | // A trial license can be obtained at https://unidoc.io 6 | // 7 | // DO NOT EDIT: generated by unitwist Go source code obfuscator. 8 | // 9 | // Use of this source code is governed by the UniDoc End User License Agreement 10 | // terms that can be accessed at https://unidoc.io/eula/ 11 | 12 | package lockedCanvas ;import (_b "encoding/xml";_d "fmt";_de "github.com/unidoc/unioffice/v2";_e "github.com/unidoc/unioffice/v2/schema/soo/dml";); 13 | 14 | // Validate validates the LockedCanvas and its children 15 | func (_ca *LockedCanvas )Validate ()error {return _ca .ValidateWithPath ("\u004c\u006f\u0063k\u0065\u0064\u0043\u0061\u006e\u0076\u0061\u0073");};func (_g *LockedCanvas )UnmarshalXML (d *_b .Decoder ,start _b .StartElement )error {_g .CT_GvmlGroupShape =*_e .NewCT_GvmlGroupShape (); 16 | for {_a ,_c :=d .Token ();if _c !=nil {return _d .Errorf ("\u0070a\u0072\u0073\u0069\u006e\u0067\u0020\u004c\u006f\u0063\u006b\u0065d\u0043\u0061\u006e\u0076\u0061\u0073\u003a\u0020\u0025\u0073",_c );};if _gb ,_ef :=_a .(_b .EndElement );_ef &&_gb .Name ==start .Name {break ; 17 | };};return nil ;}; 18 | 19 | // ValidateWithPath validates the LockedCanvas and its children, prefixing error messages with path 20 | func (_ga *LockedCanvas )ValidateWithPath (path string )error {if _ce :=_ga .CT_GvmlGroupShape .ValidateWithPath (path );_ce !=nil {return _ce ;};return nil ;};func (_eg *LockedCanvas )MarshalXML (e *_b .Encoder ,start _b .StartElement )error {start .Attr =append (start .Attr ,_b .Attr {Name :_b .Name {Local :"\u0078\u006d\u006cn\u0073"},Value :"h\u0074\u0074\u0070\u003a\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073\u002e\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061t\u0073.\u006f\u0072\u0067\u002fd\u0072\u0061w\u0069\u006e\u0067\u006d\u006c\u002f\u0032\u0030\u0030\u0036\u002f\u006c\u006f\u0063\u006b\u0065\u0064\u0043\u0061\u006e\u0076\u0061\u0073"}); 21 | start .Attr =append (start .Attr ,_b .Attr {Name :_b .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u0077\u00314"},Value :"\u0068\u0074t\u0070\u003a\u002f\u002f\u0073c\u0068\u0065\u006d\u0061\u0073.\u006d\u0069\u0063\u0072\u006f\u0073\u006f\u0066\u0074\u002e\u0063\u006f\u006d\u002f\u006f\u0066\u0066\u0069\u0063\u0065\u002f\u0077\u006f\u0072\u0064\u002f\u0032\u0030\u0031\u0030\u002f\u0077\u006f\u0072\u0064\u006d\u006c"}); 22 | start .Attr =append (start .Attr ,_b .Attr {Name :_b .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u0078\u006dl"},Value :"\u0068\u0074tp\u003a\u002f\u002fw\u0077\u0077\u002e\u00773.o\u0072g/\u0058\u004d\u004c\u002f\u0031\u0039\u00398/\u006e\u0061\u006d\u0065\u0073\u0070\u0061c\u0065"}); 23 | start .Name .Local ="\u006c\u006f\u0063k\u0065\u0064\u0043\u0061\u006e\u0076\u0061\u0073";return _eg .CT_GvmlGroupShape .MarshalXML (e ,start );};func NewLockedCanvas ()*LockedCanvas {_dd :=&LockedCanvas {};_dd .CT_GvmlGroupShape =*_e .NewCT_GvmlGroupShape (); 24 | return _dd ;};type LockedCanvas struct{_e .CT_GvmlGroupShape };func init (){_de .RegisterConstructor ("h\u0074\u0074\u0070\u003a\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073\u002e\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061t\u0073.\u006f\u0072\u0067\u002fd\u0072\u0061w\u0069\u006e\u0067\u006d\u006c\u002f\u0032\u0030\u0030\u0036\u002f\u006c\u006f\u0063\u006b\u0065\u0064\u0043\u0061\u006e\u0076\u0061\u0073","\u006c\u006f\u0063k\u0065\u0064\u0043\u0061\u006e\u0076\u0061\u0073",NewLockedCanvas ); 25 | }; -------------------------------------------------------------------------------- /common/tempstorage/memstore/memstore.go: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2020 FoxyUtils ehf. All rights reserved. 3 | // 4 | // This is a commercial product and requires a license to operate. 5 | // A trial license can be obtained at https://unidoc.io 6 | // 7 | // DO NOT EDIT: generated by unitwist Go source code obfuscator. 8 | // 9 | // Use of this source code is governed by the UniDoc End User License Agreement 10 | // terms that can be accessed at https://unidoc.io/eula/ 11 | 12 | // Package memstore implements tempStorage interface 13 | // by using memory as a storage 14 | package memstore ;import (_cf "encoding/hex";_cg "errors";_f "fmt";_a "github.com/unidoc/unioffice/v2/common/tempstorage";_d "io";_ef "io/ioutil";_e "math/rand";_c "sync";); 15 | 16 | // Name returns the filename of the underlying memDataCell 17 | func (_gc *memFile )Name ()string {return _gc ._fa ._fbd }; 18 | 19 | // Close is not applicable in this implementation 20 | func (_ga *memFile )Close ()error {return nil };type memDataCell struct{_fbd string ;_ca []byte ;_gd int64 ;}; 21 | 22 | // TempFile creates a new empty file in the storage and returns it 23 | func (_edf *memStorage )TempFile (dir ,pattern string )(_a .File ,error ){_cee :=dir +"\u002f"+_be (pattern );_de :=&memDataCell {_fbd :_cee ,_ca :[]byte {}};_cae :=&memFile {_fa :_de };_edf ._ecg .Store (_cee ,_de );return _cae ,nil ;}; 24 | 25 | // Open returns tempstorage File object by name 26 | func (_ea *memStorage )Open (path string )(_a .File ,error ){_egg ,_bb :=_ea ._ecg .Load (path );if !_bb {return nil ,_cg .New (_f .Sprintf ("\u0043\u0061\u006eno\u0074\u0020\u006f\u0070\u0065\u006e\u0020\u0074\u0068\u0065\u0020\u0066\u0069\u006c\u0065\u0020\u0025\u0073",path )); 27 | };return &memFile {_fa :_egg .(*memDataCell )},nil ;}; 28 | 29 | // SetAsStorage sets temp storage as a memory storage 30 | func SetAsStorage (){_bg :=memStorage {_ecg :_c .Map {}};_a .SetAsStorage (&_bg )}; 31 | 32 | // TempDir creates a name for a new temp directory using a pattern argument 33 | func (_fc *memStorage )TempDir (pattern string )(string ,error ){return _be (pattern ),nil }; 34 | 35 | // Write writes to the end of the underlying memDataCell in order to implement Writer interface 36 | func (_ce *memFile )Write (p []byte )(int ,error ){_ce ._fa ._ca =append (_ce ._fa ._ca ,p ...);_ce ._fa ._gd +=int64 (len (p ));return len (p ),nil ;};type memFile struct{_fa *memDataCell ;_ee int64 ;};func _fd (_ffe int )(string ,error ){_fe :=make ([]byte ,_ffe ); 37 | if _ ,_deb :=_e .Read (_fe );_deb !=nil {return "",_deb ;};return _cf .EncodeToString (_fe ),nil ;};func _be (_cd string )string {_fg ,_ :=_fd (6);return _cd +_fg }; 38 | 39 | // RemoveAll removes all files according to the dir argument prefix 40 | func (_dfa *memStorage )RemoveAll (dir string )error {_dfa ._ecg .Range (func (_dd ,_bc interface{})bool {_dfa ._ecg .Delete (_dd );return true });return nil ;};type memStorage struct{_ecg _c .Map }; 41 | 42 | // Read reads from the underlying memDataCell in order to implement Reader interface 43 | func (_b *memFile )Read (p []byte )(int ,error ){_cgf :=_b ._ee ;_fb :=_b ._fa ._gd ;_fbb :=int64 (len (p ));if _fbb > _fb {_fbb =_fb ;p =p [:_fbb ];};if _cgf >=_fb {return 0,_d .EOF ;};_ff :=_cgf +_fbb ;if _ff >=_fb {_ff =_fb ;};_df :=copy (p ,_b ._fa ._ca [_cgf :_ff ]); 44 | _b ._ee =_ff ;return _df ,nil ;}; 45 | 46 | // Add reads a file from a disk and adds it to the storage 47 | func (_da *memStorage )Add (path string )error {_ ,_db :=_da ._ecg .Load (path );if _db {return nil ;};_af ,_bbf :=_ef .ReadFile (path );if _bbf !=nil {return _bbf ;};_da ._ecg .Store (path ,&memDataCell {_fbd :path ,_ca :_af ,_gd :int64 (len (_af ))}); 48 | return nil ;}; 49 | 50 | // ReadAt reads from the underlying memDataCell at an offset provided in order to implement ReaderAt interface. 51 | // It does not affect f.readOffset. 52 | func (_eg *memFile )ReadAt (p []byte ,readOffset int64 )(int ,error ){_efc :=_eg ._fa ._gd ;_ec :=int64 (len (p ));if _ec > _efc {_ec =_efc ;p =p [:_ec ];};if readOffset >=_efc {return 0,_d .EOF ;};_ed :=readOffset +_ec ;if _ed >=_efc {_ed =_efc ;};_dg :=copy (p ,_eg ._fa ._ca [readOffset :_ed ]); 53 | return _dg ,nil ;}; -------------------------------------------------------------------------------- /ACKNOWLEDGEMENTS.md: -------------------------------------------------------------------------------- 1 | Acknowledgements 2 | ---------------- 3 | 4 | UniOffice contains code from or depends on the following open source projects: 5 | 6 | * [The standard Go library](https://golang.org/pkg/#stdlib). 7 | 8 | ``` 9 | Copyright (c) 2009 The Go Authors. All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are 13 | met: 14 | 15 | * Redistributions of source code must retain the above copyright 16 | notice, this list of conditions and the following disclaimer. 17 | * Redistributions in binary form must reproduce the above 18 | copyright notice, this list of conditions and the following disclaimer 19 | in the documentation and/or other materials provided with the 20 | distribution. 21 | * Neither the name of Google Inc. nor the names of its 22 | contributors may be used to endorse or promote products derived from 23 | this software without specific prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | ``` 37 | 38 | * [MSCFB Reader](https://github.com/richardlehane/mscfb). 39 | 40 | ``` 41 | Copyright 2013 Richard Lehane. All rights reserved. 42 | 43 | Licensed under the Apache License, Version 2.0 (the "License"); 44 | you may not use this file except in compliance with the License. 45 | You may obtain a copy of the License at 46 | 47 | http://www.apache.org/licenses/LICENSE-2.0 48 | 49 | Unless required by applicable law or agreed to in writing, software 50 | distributed under the License is distributed on an "AS IS" BASIS, 51 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 52 | See the License for the specific language governing permissions and 53 | limitations under the License. 54 | ``` 55 | 56 | * [NATSORT](https://github.com/facette/natsort) 57 | 58 | ``` 59 | Copyright (c) 2015, Vincent Batoufflet and Marc Falzon 60 | All rights reserved. 61 | 62 | Redistribution and use in source and binary forms, with or without 63 | modification, are permitted provided that the following conditions 64 | are met: 65 | 66 | * Redistributions of source code must retain the above copyright 67 | notice, this list of conditions and the following disclaimer. 68 | 69 | * Redistributions in binary form must reproduce the above copyright 70 | notice, this list of conditions and the following disclaimer in the 71 | documentation and/or other materials provided with the distribution. 72 | 73 | * Neither the name of the authors nor the names of its contributors 74 | may be used to endorse or promote products derived from this software 75 | without specific prior written permission. 76 | 77 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 78 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 79 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 80 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 81 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 82 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 83 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 84 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 85 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 86 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 87 | POSSIBILITY OF SUCH DAMAGE. 88 | ``` -------------------------------------------------------------------------------- /schema/schemas.microsoft.com/office/word/2015/wordml/symex/symex.go: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2020 FoxyUtils ehf. All rights reserved. 3 | // 4 | // This is a commercial product and requires a license to operate. 5 | // A trial license can be obtained at https://unidoc.io 6 | // 7 | // DO NOT EDIT: generated by unitwist Go source code obfuscator. 8 | // 9 | // Use of this source code is governed by the UniDoc End User License Agreement 10 | // terms that can be accessed at https://unidoc.io/eula/ 11 | 12 | package symex ;import (_ef "encoding/xml";_a "fmt";_c "github.com/unidoc/unioffice/v2";);type CT_SymEx struct{FontAttr *string ;CharAttr *string ;};func (_ff *SymEx )UnmarshalXML (d *_ef .Decoder ,start _ef .StartElement )error {_ff .CT_SymEx =*NewCT_SymEx (); 13 | for _ ,_gcc :=range start .Attr {if _gcc .Name .Local =="\u0066\u006f\u006e\u0074"{_b :=_gcc .Value ;_ff .FontAttr =&_b ;continue ;};if _gcc .Name .Local =="\u0063\u0068\u0061\u0072"{_ee :=_gcc .Value ;_ff .CharAttr =&_ee ;continue ;};};for {_ceg ,_bb :=d .Token (); 14 | if _bb !=nil {return _a .Errorf ("\u0070\u0061\u0072\u0073\u0069\u006e\u0067\u0020\u0053\u0079\u006d\u0045x\u003a\u0020\u0025\u0073",_bb );};if _df ,_ag :=_ceg .(_ef .EndElement );_ag &&_df .Name ==start .Name {break ;};};return nil ;}; 15 | 16 | // ValidateWithPath validates the CT_SymEx and its children, prefixing error messages with path 17 | func (_fgc *CT_SymEx )ValidateWithPath (path string )error {return nil };func (_cd *CT_SymEx )UnmarshalXML (d *_ef .Decoder ,start _ef .StartElement )error {for _ ,_d :=range start .Attr {if _d .Name .Local =="\u0066\u006f\u006e\u0074"{_cfc :=_d .Value ; 18 | _cd .FontAttr =&_cfc ;continue ;};if _d .Name .Local =="\u0063\u0068\u0061\u0072"{_cfb :=_d .Value ;_cd .CharAttr =&_cfb ;continue ;};};for {_fc ,_cg :=d .Token ();if _cg !=nil {return _a .Errorf ("p\u0061r\u0073\u0069\u006e\u0067\u0020\u0043\u0054\u005fS\u0079\u006d\u0045\u0078: \u0025\u0073",_cg ); 19 | };if _gg ,_fg :=_fc .(_ef .EndElement );_fg &&_gg .Name ==start .Name {break ;};};return nil ;}; 20 | 21 | // ValidateWithPath validates the SymEx and its children, prefixing error messages with path 22 | func (_cc *SymEx )ValidateWithPath (path string )error {if _fa :=_cc .CT_SymEx .ValidateWithPath (path );_fa !=nil {return _fa ;};return nil ;}; 23 | 24 | // Validate validates the CT_SymEx and its children 25 | func (_cdf *CT_SymEx )Validate ()error {return _cdf .ValidateWithPath ("\u0043\u0054\u005f\u0053\u0079\u006d\u0045\u0078");};func NewCT_SymEx ()*CT_SymEx {_cf :=&CT_SymEx {};return _cf };func (_gc *SymEx )MarshalXML (e *_ef .Encoder ,start _ef .StartElement )error {start .Attr =append (start .Attr ,_ef .Attr {Name :_ef .Name {Local :"\u0078\u006d\u006cn\u0073"},Value :"\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073\u002e\u006d\u0069\u0063\u0072\u006fs\u006f\u0066\u0074\u002e\u0063\u006f\u006d\u002f\u006ff\u0066\u0069\u0063\u0065\u002f\u0077\u006f\u0072\u0064\u002f\u0032\u0030\u00315\u002f\u0077\u006f\u0072\u0064\u006dl\u002f\u0073\u0079m\u0065\u0078"}); 26 | start .Attr =append (start .Attr ,_ef .Attr {Name :_ef .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u0073"},Value :"\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073\u002e\u006d\u0069\u0063\u0072\u006fs\u006f\u0066\u0074\u002e\u0063\u006f\u006d\u002f\u006ff\u0066\u0069\u0063\u0065\u002f\u0077\u006f\u0072\u0064\u002f\u0032\u0030\u00315\u002f\u0077\u006f\u0072\u0064\u006dl\u002f\u0073\u0079m\u0065\u0078"}); 27 | start .Attr =append (start .Attr ,_ef .Attr {Name :_ef .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u0077\u00314"},Value :"\u0068\u0074t\u0070\u003a\u002f\u002f\u0073c\u0068\u0065\u006d\u0061\u0073.\u006d\u0069\u0063\u0072\u006f\u0073\u006f\u0066\u0074\u002e\u0063\u006f\u006d\u002f\u006f\u0066\u0066\u0069\u0063\u0065\u002f\u0077\u006f\u0072\u0064\u002f\u0032\u0030\u0031\u0030\u002f\u0077\u006f\u0072\u0064\u006d\u006c"}); 28 | start .Attr =append (start .Attr ,_ef .Attr {Name :_ef .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u0078\u006dl"},Value :"\u0068\u0074tp\u003a\u002f\u002fw\u0077\u0077\u002e\u00773.o\u0072g/\u0058\u004d\u004c\u002f\u0031\u0039\u00398/\u006e\u0061\u006d\u0065\u0073\u0070\u0061c\u0065"}); 29 | start .Name .Local ="\u0073:\u0073\u0079\u006d\u0045\u0078";return _gc .CT_SymEx .MarshalXML (e ,start );}; 30 | 31 | // Validate validates the SymEx and its children 32 | func (_de *SymEx )Validate ()error {return _de .ValidateWithPath ("\u0053\u0079\u006dE\u0078")};func (_g *CT_SymEx )MarshalXML (e *_ef .Encoder ,start _ef .StartElement )error {if _g .FontAttr !=nil {start .Attr =append (start .Attr ,_ef .Attr {Name :_ef .Name {Local :"\u0073\u003a\u0066\u006f\u006e\u0074"},Value :_a .Sprintf ("\u0025\u0076",*_g .FontAttr )}); 33 | };if _g .CharAttr !=nil {start .Attr =append (start .Attr ,_ef .Attr {Name :_ef .Name {Local :"\u0073\u003a\u0063\u0068\u0061\u0072"},Value :_a .Sprintf ("\u0025\u0076",*_g .CharAttr )});};e .EncodeToken (start );e .EncodeToken (_ef .EndElement {Name :start .Name }); 34 | return nil ;};func NewSymEx ()*SymEx {_ce :=&SymEx {};_ce .CT_SymEx =*NewCT_SymEx ();return _ce };type SymEx struct{CT_SymEx };func init (){_c .RegisterConstructor ("\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073\u002e\u006d\u0069\u0063\u0072\u006fs\u006f\u0066\u0074\u002e\u0063\u006f\u006d\u002f\u006ff\u0066\u0069\u0063\u0065\u002f\u0077\u006f\u0072\u0064\u002f\u0032\u0030\u00315\u002f\u0077\u006f\u0072\u0064\u006dl\u002f\u0073\u0079m\u0065\u0078","\u0043\u0054\u005f\u0053\u0079\u006d\u0045\u0078",NewCT_SymEx ); 35 | _c .RegisterConstructor ("\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073\u002e\u006d\u0069\u0063\u0072\u006fs\u006f\u0066\u0074\u002e\u0063\u006f\u006d\u002f\u006ff\u0066\u0069\u0063\u0065\u002f\u0077\u006f\u0072\u0064\u002f\u0032\u0030\u00315\u002f\u0077\u006f\u0072\u0064\u006dl\u002f\u0073\u0079m\u0065\u0078","\u0073\u0079\u006dE\u0078",NewSymEx ); 36 | }; -------------------------------------------------------------------------------- /internal/mscfb/rw/rw.go: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2020 FoxyUtils ehf. All rights reserved. 3 | // 4 | // This is a commercial product and requires a license to operate. 5 | // A trial license can be obtained at https://unidoc.io 6 | // 7 | // DO NOT EDIT: generated by unitwist Go source code obfuscator. 8 | // 9 | // Use of this source code is governed by the UniDoc End User License Agreement 10 | // terms that can be accessed at https://unidoc.io/eula/ 11 | 12 | package rw ;import (_e "bytes";_dg "encoding/binary";_ca "errors";_d "fmt";_f "io";_g "io/ioutil";_cc "reflect";);func NewWriter ()*Writer {return &Writer {_fad :[]byte {}}};func PopRightUI64 (v uint64 )(bool ,uint64 ){return (v &uint64 (1))==1,v >>1}; 13 | func (_cde *Writer )tryGrowByReslice (_bb int )(int ,bool ){if _efg :=len (_cde ._fad );_bb <=cap (_cde ._fad )-_efg {_cde ._fad =_cde ._fad [:_efg +_bb ];return _efg ,true ;};return 0,false ;};func (_aea *Writer )grow (_af int )(int ,error ){_dbd :=_aea .Len (); 14 | if _dbd ==0&&_aea ._db !=0{_aea .reset ();};if _dgea ,_gc :=_aea .tryGrowByReslice (_af );_gc {return _dgea ,nil ;};if _aea ._fad ==nil &&_af <=_aa {_aea ._fad =make ([]byte ,_af ,_aa );return 0,nil ;};_fe :=cap (_aea ._fad );if _af <=_fe /2-_dbd {copy (_aea ._fad ,_aea ._fad [_aea ._db :]); 15 | }else if _fe > _bgf -_fe -_af {return 0,_ecb ;}else {_eg :=_dfa (2*_fe +_af );copy (_eg ,_aea ._fad [_aea ._db :]);_aea ._fad =_eg ;};_aea ._db =0;_aea ._fad =_aea ._fad [:_dbd +_af ];return _dbd ,nil ;};func (_ba *Writer )WriteStringProperty (s string )error {_ba .align (4); 16 | _aee :=[]byte (s );if _dc :=_dg .Write (_ba ,_dg .LittleEndian ,&_aee );_dc !=nil {return _dc ;};return nil ;};func PushLeftUI64 (v uint64 ,flag bool )uint64 {v >>=1;if flag {v |=1<<63;};return v ;};var _ecb =_ca .New ("r\u0077.\u0057\u0072\u0069\u0074\u0065\u0072\u003a\u0020t\u006f\u006f\u0020\u006car\u0067\u0065"); 17 | func (_dd *Writer )WriteProperty (a interface{})error {if _bc :=_dd .align (int (_cc .TypeOf (a ).Size ()));_bc !=nil {return _bc ;};return _dd .WritePropertyNoAlign (a );};type Reader struct{*_e .Reader };func (_cag *Writer )AlignLength (alignTo int )error {_bcd :=_cag .Len ()%alignTo ; 18 | if _bcd > 0{_ ,_ag :=_cag .Write (make ([]byte ,alignTo -_bcd ));if _ag !=nil {return _ag ;};};return nil ;};func (_cf *Writer )WritePropertyNoAlign (a interface{})error {if _ee :=_dg .Write (_cf ,_dg .LittleEndian ,a );_ee !=nil {return _ee ;};return nil ; 19 | };const _bgf =int (^uint (0)>>1);func NewReader (b []byte )(*Reader ,error ){return &Reader {_e .NewReader (b )},nil };func PopRightUI32 (v uint32 )(bool ,uint32 ){return (v &uint32 (1))==1,v >>1};func (_agf *Writer )reset (){_agf ._fad =_agf ._fad [:0]; 20 | _agf ._db =0};func (_fb *Reader )skip (_gd int )error {_ ,_bg :=_f .CopyN (_g .Discard ,_fb ,int64 (_gd ));if _bg !=nil {return _bg ;};return nil ;};func (_ae *Reader )align (_ccd int )error {return _ae .skip ((_ccd -_ae .curPos ()%_ccd )%_ccd )};const _aa =64; 21 | type Writer struct{_fad []byte ;_db int ;};func (_gdg *Writer )WriteTo (wTo _f .Writer )(_bcg int64 ,_gbb error ){if _bgb :=_gdg .Len ();_bgb > 0{_ed ,_bca :=wTo .Write (_gdg ._fad [_gdg ._db :]);if _ed > _bgb {return 0,_ca .New ("\u0072\u0077\u002e\u0057\u0072\u0069\u0074\u0065\u0072\u002e\u0057\u0072\u0069\u0074\u0065\u0054\u006f\u003a\u0020\u0069\u006e\u0076\u0061\u006ci\u0064\u0020\u0057\u0072\u0069t\u0065\u0020c\u006f\u0075\u006e\u0074"); 22 | };_gdg ._db +=_ed ;_bcg =int64 (_ed );if _bca !=nil {return _bcg ,_bca ;};if _ed !=_bgb {return _bcg ,_f .ErrShortWrite ;};};_gdg .reset ();return _bcg ,nil ;};func (_add *Writer )FillWithByte (fillSize int ,b byte )error {for _cbb :=0;_cbb < fillSize ; 23 | _cbb ++{if _dcd :=_add .WritePropertyNoAlign (b );_dcd !=nil {return _dcd ;};};return nil ;};func (_ab *Reader )ReadStringProperty (n uint32 )(string ,error ){if _dge :=_ab .align (4);_dge !=nil {return "",_dge ;};_bgg :=make ([]byte ,n );if _be :=_dg .Read (_ab ,_dg .LittleEndian ,&_bgg ); 24 | _be !=nil {return "",_be ;};return string (_bgg ),nil ;};func (_a *Reader )curPos ()int {return int (_a .Size ())-_a .Len ()};func PushLeftUI32 (v uint32 ,flag bool )uint32 {v >>=1;if flag {v |=1<<31;};return v ;};func (_cd *Writer )align (_eee int )error {return _cd .Skip ((_eee -(_cd .Len ())%_eee )%_eee )}; 25 | func (_cgb *Writer )curPos ()int {return int (_cgb .Cap ())-_cgb .Len ()};func (_eef *Writer )Skip (n int )error {if n ==0{return nil ;};_ ,_cgbb :=_eef .Write (make ([]byte ,n ));return _cgbb ;};func (_bee *Writer )Bytes ()[]byte {return _bee ._fad }; 26 | func _dfa (_ecg int )[]byte {defer func (){if recover ()!=nil {panic (_ecb );};}();return make ([]byte ,_ecg );};func (_ff *Reader )ReadPairProperty (p interface{})error {if _ef :=_ff .align (4);_ef !=nil {return _ef ;};_gb :=_cc .ValueOf (p );for _gb .Kind ()==_cc .Ptr {_gb =_gb .Elem (); 27 | };if !_gb .IsValid (){return _d .Errorf ("\u0076a\u006cu\u0065\u0020\u0069\u0073\u0020n\u006f\u0074 \u0076\u0061\u006c\u0069\u0064");};if _cg :=_dg .Read (_ff ,_dg .LittleEndian ,p );_cg !=nil {return _cg ;};return nil ;};func (_cae *Reader )ReadProperty (a interface{})error {_ad :=_cc .ValueOf (a ); 28 | for _ad .Kind ()==_cc .Ptr {_ad =_ad .Elem ();};if !_ad .IsValid (){return _d .Errorf ("\u0076a\u006cu\u0065\u0020\u0069\u0073\u0020n\u006f\u0074 \u0076\u0061\u006c\u0069\u0064");};if _fa :=_cae .align (int (_ad .Type ().Size ()));_fa !=nil {return _fa ; 29 | };if _ea :=_dg .Read (_cae ,_dg .LittleEndian ,a );_ea !=nil {return _ea ;};return nil ;};func (_cb *Writer )Len ()int {return len (_cb ._fad )-_cb ._db };func (_ge *Writer )Cap ()int {return cap (_ge ._fad )};func (_fbd *Writer )WriteByteAt (b byte ,off int )error {if off >=len (_fbd ._fad ){return _ca .New ("\u004f\u0075\u0074\u0020\u006f\u0066\u0020\u0062\u006f\u0075\u006e\u0064\u0073"); 30 | };_fbd ._fad [off ]=b ;return nil ;};func (_df *Writer )Write (p []byte )(_faa int ,_aad error ){_eb ,_bga :=_df .tryGrowByReslice (len (p ));if !_bga {var _de error ;_eb ,_de =_df .grow (len (p ));if _de !=nil {return 0,_de ;};};return copy (_df ._fad [_eb :],p ),nil ; 31 | }; -------------------------------------------------------------------------------- /internal/formatutils/formatutils.go: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2020 FoxyUtils ehf. All rights reserved. 3 | // 4 | // This is a commercial product and requires a license to operate. 5 | // A trial license can be obtained at https://unidoc.io 6 | // 7 | // DO NOT EDIT: generated by unitwist Go source code obfuscator. 8 | // 9 | // Use of this source code is governed by the UniDoc End User License Agreement 10 | // terms that can be accessed at https://unidoc.io/eula/ 11 | 12 | package formatutils ;import (_g "fmt";_ga "github.com/unidoc/unioffice/v2/schema/soo/wml";_da "strconv";_a "strings";);var (_fdd =[]string {"","\u0049","\u0049\u0049","\u0049\u0049\u0049","\u0049\u0056","\u0056","\u0056\u0049","\u0056\u0049\u0049","\u0056\u0049\u0049\u0049","\u0049\u0058"}; 13 | _ge =[]string {"","\u0058","\u0058\u0058","\u0058\u0058\u0058","\u0058\u004c","\u004c","\u004c\u0058","\u004c\u0058\u0058","\u004c\u0058\u0058\u0058","\u0058\u0043"};_dc =[]string {"","\u0043","\u0043\u0043","\u0043\u0043\u0043","\u0043\u0044","\u0044","\u0044\u0043","\u0044\u0043\u0043","\u0044\u0043\u0043\u0043","\u0043\u004d","\u004d"}; 14 | _eb =[]string {"","\u004d","\u004d\u004d","\u004d\u004d\u004d","\u004d\u004d\u004d\u004d","\u004d\u004d\u004dM\u004d","\u004d\u004d\u004d\u004d\u004d\u004d","\u004dM\u004d\u004d\u004d\u004d\u004d","\u004d\u004d\u004d\u004d\u004d\u004d\u004d\u004d","\u004dM\u004d\u004d\u004d\u004d\u004d\u004dM","\u004d\u004d\u004d\u004d\u004d\u004d\u004d\u004d\u004d\u004d"}; 15 | _fb =[]string {"\u006f\u006e\u0065","\u0074\u0077\u006f","\u0074\u0068\u0072e\u0065","\u0066\u006f\u0075\u0072","\u0066\u0069\u0076\u0065","\u0073\u0069\u0078","\u0073\u0065\u0076e\u006e","\u0065\u0069\u0067h\u0074","\u006e\u0069\u006e\u0065","\u0074\u0065\u006e","\u0065\u006c\u0065\u0076\u0065\u006e","\u0074\u0077\u0065\u006c\u0076\u0065","\u0074\u0068\u0069\u0072\u0074\u0065\u0065\u006e","\u0066\u006f\u0075\u0072\u0074\u0065\u0065\u006e","\u0066i\u0066\u0074\u0065\u0065\u006e","\u0073i\u0078\u0074\u0065\u0065\u006e","\u0073e\u0076\u0065\u006e\u0074\u0065\u0065n","\u0065\u0069\u0067\u0068\u0074\u0065\u0065\u006e","\u006e\u0069\u006e\u0065\u0074\u0065\u0065\u006e"}; 16 | _ae =[]string {"\u0074\u0065\u006e","\u0074\u0077\u0065\u006e\u0074\u0079","\u0074\u0068\u0069\u0072\u0074\u0079","\u0066\u006f\u0072t\u0079","\u0066\u0069\u0066t\u0079","\u0073\u0069\u0078t\u0079","\u0073e\u0076\u0065\u006e\u0074\u0079","\u0065\u0069\u0067\u0068\u0074\u0079","\u006e\u0069\u006e\u0065\u0074\u0079"}; 17 | _ca =[]string {"\u0066\u0069\u0072s\u0074","\u0073\u0065\u0063\u006f\u006e\u0064","\u0074\u0068\u0069r\u0064","\u0066\u006f\u0075\u0072\u0074\u0068","\u0066\u0069\u0066t\u0068","\u0073\u0069\u0078t\u0068","\u0073e\u0076\u0065\u006e\u0074\u0068","\u0065\u0069\u0067\u0068\u0074\u0068","\u006e\u0069\u006et\u0068","\u0074\u0065\u006et\u0068","\u0065\u006c\u0065\u0076\u0065\u006e\u0074\u0068","\u0074w\u0065\u006c\u0066\u0074\u0068","\u0074\u0068\u0069\u0072\u0074\u0065\u0065\u006e\u0074\u0068","\u0066\u006f\u0075\u0072\u0074\u0065\u0065\u006e\u0074\u0068","\u0066i\u0066\u0074\u0065\u0065\u006e\u0074h","\u0073i\u0078\u0074\u0065\u0065\u006e\u0074h","s\u0065\u0076\u0065\u006e\u0074\u0065\u0065\u006e\u0074\u0068","\u0065\u0069\u0067\u0068\u0074\u0065\u0065\u006e\u0074\u0068","\u006e\u0069\u006e\u0065\u0074\u0065\u0065\u006e\u0074\u0068"}; 18 | _dab =[]string {"\u0074\u0065\u006et\u0068","\u0074w\u0065\u006e\u0074\u0069\u0065\u0074h","\u0074h\u0069\u0072\u0074\u0069\u0065\u0074h","\u0066\u006f\u0072\u0074\u0069\u0065\u0074\u0068","\u0066\u0069\u0066\u0074\u0069\u0065\u0074\u0068","\u0073\u0069\u0078\u0074\u0069\u0065\u0074\u0068","\u0073\u0065\u0076\u0065\u006e\u0074\u0069\u0065\u0074\u0068","\u0065i\u0067\u0068\u0074\u0069\u0065\u0074h","\u006ei\u006e\u0065\u0074\u0069\u0065\u0074h"}; 19 | _cd ="\u0041\u0042\u0043\u0044\u0045\u0046\u0047\u0048\u0049\u004a\u004bL\u004d\u004e\u004f\u0050\u0051\u0052\u0053\u0054\u0055\u0056W\u0058\u0059\u005a";);func StringToNumbers (str string )(int ,bool ){_eab :=0;_gef :=false ;for _ ,_cb :=range []byte (str ){_cb -='0'; 20 | if _cb > 9{continue ;};_eab =_eab *10+int (_cb );_gef =true ;};return _eab ,_gef ;};func Initials (text string )string {if text ==""{return "";};_bcf :=_a .Split (text ,"\u0020");_bec :=_a .Builder {};for _ ,_gab :=range _bcf {_bec .WriteByte (_gab [0]); 21 | };return _bec .String ();};func FormatNumberingText (currentNumber int64 ,ilvl int64 ,lvlText string ,numFmt *_ga .CT_NumFmt ,levelNumbers map[int64 ]int64 )string {_f :=_fa (lvlText );_gg :=_de (currentNumber ,numFmt );_daf :=int64 (0);for _e ,_ff :=range _f {_gf :=_g .Sprintf ("\u0025\u0025\u0025\u0064",_e +1); 22 | if len (_f )==1{_gf =_g .Sprintf ("\u0025\u0025\u0025\u0064",ilvl +1);_f [_e ]=_a .Replace (_ff ,_gf ,_gg ,1);break ;};if ilvl > 0&&ilvl > _daf &&_e < (len (_f )-1){_fd :=_de (levelNumbers [_daf ],numFmt );_f [_e ]=_a .Replace (_ff ,_gf ,_fd ,1);_daf ++; 23 | }else {_f [_e ]=_a .Replace (_ff ,_gf ,_gg ,1);};};return _a .Join (_f ,"");};func _fa (_b string )(_c []string ){for _ac :=0;_ac < len (_b )-2;_ac ++{if string (_b [_ac ])=="\u0025"{if !_a .Contains (string (_b [_ac +2:]),"\u0025"){if _ac ==0{_c =append (_c ,_g .Sprintf ("\u0025\u0073\u0025\u0073\u0025\u0073",string (_b [_ac ]),string (_b [_ac +1]),string (_b [_ac +2:]))); 24 | }else {_c =append (_c ,_g .Sprintf ("\u0025\u0073\u0025\u0073\u0025\u0073\u0025\u0073",string (_b [_ac -1]),string (_b [_ac ]),string (_b [_ac +1]),string (_b [_ac +2:])));};}else {_c =append (_c ,_g .Sprintf ("\u0025\u0073\u0025\u0073\u0025\u0073",string (_b [_ac ]),string (_b [_ac +1]),string (_b [_ac +2]))); 25 | };};};return ;};func _de (_ef int64 ,_ed *_ga .CT_NumFmt )(_gb string ){if _ed ==nil {return ;};_cdg :=_ed .ValAttr ;switch _cdg {case _ga .ST_NumberFormatNone :_gb ="";case _ga .ST_NumberFormatDecimal :_gb =_da .Itoa (int (_ef ));case _ga .ST_NumberFormatDecimalZero :_gb =_da .Itoa (int (_ef )); 26 | if _ef < 10{_gb ="\u0030"+_gb ;};case _ga .ST_NumberFormatUpperRoman :var (_be =_ef %10;_cde =(_ef %100)/10;_faf =(_ef %1000)/100;_gba =_ef /1000;);_gb =_eb [_gba ]+_dc [_faf ]+_ge [_cde ]+_fdd [_be ];case _ga .ST_NumberFormatLowerRoman :var (_bc =_ef %10; 27 | _bed =(_ef %100)/10;_eg =(_ef %1000)/100;_cc =_ef /1000;);_gb =_eb [_cc ]+_dc [_eg ]+_ge [_bed ]+_fdd [_bc ];_gb =_a .ToLower (_gb );case _ga .ST_NumberFormatUpperLetter :_ea :=_ef %780;if _ea ==0{_ea =780;};_eff :=(_ea -1)/26;_db :=(_ea -1)%26;_ee :=_cd [_eff +_db ]; 28 | _gb =string (_ee );case _ga .ST_NumberFormatLowerLetter :_gee :=_ef %780;if _gee ==0{_gee =780;};_ba :=(_gee -1)/26;_acd :=(_gee -1)%26;_fdda :=_cd [_ba +_acd ];_gb =_a .ToLower (string (_fdda ));default:_gb ="";};return ;}; -------------------------------------------------------------------------------- /common/logger/logger.go: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2020 FoxyUtils ehf. All rights reserved. 3 | // 4 | // This is a commercial product and requires a license to operate. 5 | // A trial license can be obtained at https://unidoc.io 6 | // 7 | // DO NOT EDIT: generated by unitwist Go source code obfuscator. 8 | // 9 | // Use of this source code is governed by the UniDoc End User License Agreement 10 | // terms that can be accessed at https://unidoc.io/eula/ 11 | 12 | package logger ;import (_f "fmt";_ce "io";_a "os";_b "path/filepath";_c "runtime";); 13 | 14 | // DummyLogger does nothing. 15 | type DummyLogger struct{}; 16 | 17 | // Debug logs debug message. 18 | func (_df ConsoleLogger )Debug (format string ,args ...interface{}){if _df .LogLevel >=LogLevelDebug {_aac :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_df .output (_a .Stdout ,_aac ,format ,args ...);};}; 19 | 20 | // Warning logs warning message. 21 | func (_ae WriterLogger )Warning (format string ,args ...interface{}){if _ae .LogLevel >=LogLevelWarning {_agc :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_ae .logToWriter (_ae .Output ,_agc ,format ,args ...);};}; 22 | 23 | // IsLogLevel returns true from dummy logger. 24 | func (DummyLogger )IsLogLevel (level LogLevel )bool {return true }; 25 | 26 | // Debug does nothing for dummy logger. 27 | func (DummyLogger )Debug (format string ,args ...interface{}){}; 28 | 29 | // Notice logs notice message. 30 | func (_gb ConsoleLogger )Notice (format string ,args ...interface{}){if _gb .LogLevel >=LogLevelNotice {_da :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_gb .output (_a .Stdout ,_da ,format ,args ...);};}; 31 | 32 | // Notice does nothing for dummy logger. 33 | func (DummyLogger )Notice (format string ,args ...interface{}){}; 34 | 35 | // SetLogger sets 'logger' to be used by the unidoc unipdf library. 36 | func SetLogger (logger Logger ){Log =logger }; 37 | 38 | // Error logs error message. 39 | func (_cbg WriterLogger )Error (format string ,args ...interface{}){if _cbg .LogLevel >=LogLevelError {_de :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_cbg .logToWriter (_cbg .Output ,_de ,format ,args ...);};}; 40 | 41 | // NewConsoleLogger creates new console logger. 42 | func NewConsoleLogger (logLevel LogLevel )*ConsoleLogger {return &ConsoleLogger {LogLevel :logLevel }}; 43 | 44 | // Info logs info message. 45 | func (_daf ConsoleLogger )Info (format string ,args ...interface{}){if _daf .LogLevel >=LogLevelInfo {_ga :="\u005bI\u004e\u0046\u004f\u005d\u0020";_daf .output (_a .Stdout ,_ga ,format ,args ...);};}; 46 | 47 | // Error logs error message. 48 | func (_cc ConsoleLogger )Error (format string ,args ...interface{}){if _cc .LogLevel >=LogLevelError {_ec :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_cc .output (_a .Stdout ,_ec ,format ,args ...);};}; 49 | 50 | // Error does nothing for dummy logger. 51 | func (DummyLogger )Error (format string ,args ...interface{}){}; 52 | 53 | // Trace logs trace message. 54 | func (_cb ConsoleLogger )Trace (format string ,args ...interface{}){if _cb .LogLevel >=LogLevelTrace {_bgb :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_cb .output (_a .Stdout ,_bgb ,format ,args ...);};}; 55 | 56 | // NewWriterLogger creates new 'writer' logger. 57 | func NewWriterLogger (logLevel LogLevel ,writer _ce .Writer )*WriterLogger {logger :=WriterLogger {Output :writer ,LogLevel :logLevel };return &logger ;}; 58 | 59 | // Notice logs notice message. 60 | func (_cf WriterLogger )Notice (format string ,args ...interface{}){if _cf .LogLevel >=LogLevelNotice {_ad :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_cf .logToWriter (_cf .Output ,_ad ,format ,args ...);};}; 61 | 62 | // WriterLogger is the logger that writes data to the Output writer 63 | type WriterLogger struct{LogLevel LogLevel ;Output _ce .Writer ;};const (LogLevelTrace LogLevel =5;LogLevelDebug LogLevel =4;LogLevelInfo LogLevel =3;LogLevelNotice LogLevel =2;LogLevelWarning LogLevel =1;LogLevelError LogLevel =0;);func (_eb ConsoleLogger )output (_ced _ce .Writer ,_fg string ,_ca string ,_fge ...interface{}){_dg (_ced ,_fg ,_ca ,_fge ...); 64 | }; 65 | 66 | // IsLogLevel returns true if log level is greater or equal than `level`. 67 | // Can be used to avoid resource intensive calls to loggers. 68 | func (_bec WriterLogger )IsLogLevel (level LogLevel )bool {return _bec .LogLevel >=level }; 69 | 70 | // Warning does nothing for dummy logger. 71 | func (DummyLogger )Warning (format string ,args ...interface{}){}; 72 | 73 | // ConsoleLogger is a logger that writes logs to the 'os.Stdout' 74 | type ConsoleLogger struct{LogLevel LogLevel ;}; 75 | 76 | // IsLogLevel returns true if log level is greater or equal than `level`. 77 | // Can be used to avoid resource intensive calls to loggers. 78 | func (_fc ConsoleLogger )IsLogLevel (level LogLevel )bool {return _fc .LogLevel >=level };var Log Logger =DummyLogger {}; 79 | 80 | // Warning logs warning message. 81 | func (_fcc ConsoleLogger )Warning (format string ,args ...interface{}){if _fcc .LogLevel >=LogLevelWarning {_ff :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_fcc .output (_a .Stdout ,_ff ,format ,args ...);};}; 82 | 83 | // Info does nothing for dummy logger. 84 | func (DummyLogger )Info (format string ,args ...interface{}){};func (_ded WriterLogger )logToWriter (_efb _ce .Writer ,_ada string ,_cfa string ,_bac ...interface{}){_dg (_efb ,_ada ,_cfa ,_bac );}; 85 | 86 | // Trace logs trace message. 87 | func (_edg WriterLogger )Trace (format string ,args ...interface{}){if _edg .LogLevel >=LogLevelTrace {_gbd :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_edg .logToWriter (_edg .Output ,_gbd ,format ,args ...);};}; 88 | 89 | // Trace does nothing for dummy logger. 90 | func (DummyLogger )Trace (format string ,args ...interface{}){}; 91 | 92 | // LogLevel is the verbosity level for logging. 93 | type LogLevel int ;func _dg (_bf _ce .Writer ,_gc string ,_afb string ,_cg ...interface{}){_ ,_dad ,_aag ,_bad :=_c .Caller (3);if !_bad {_dad ="\u003f\u003f\u003f";_aag =0;}else {_dad =_b .Base (_dad );};_ebef :=_f .Sprintf ("\u0025s\u0020\u0025\u0073\u003a\u0025\u0064 ",_gc ,_dad ,_aag )+_afb +"\u000a"; 94 | _f .Fprintf (_bf ,_ebef ,_cg ...);}; 95 | 96 | // Info logs info message. 97 | func (_ba WriterLogger )Info (format string ,args ...interface{}){if _ba .LogLevel >=LogLevelInfo {_gg :="\u005bI\u004e\u0046\u004f\u005d\u0020";_ba .logToWriter (_ba .Output ,_gg ,format ,args ...);};}; 98 | 99 | // Debug logs debug message. 100 | func (_ab WriterLogger )Debug (format string ,args ...interface{}){if _ab .LogLevel >=LogLevelDebug {_bae :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_ab .logToWriter (_ab .Output ,_bae ,format ,args ...);};}; 101 | 102 | // Logger is the interface used for logging in the unipdf package. 103 | type Logger interface{Error (_eg string ,_g ...interface{});Warning (_d string ,_cd ...interface{});Notice (_aa string ,_af ...interface{});Info (_dd string ,_ag ...interface{});Debug (_ee string ,_cef ...interface{});Trace (_be string ,_bg ...interface{}); 104 | IsLogLevel (_ed LogLevel )bool ;}; -------------------------------------------------------------------------------- /CLA.md: -------------------------------------------------------------------------------- 1 | Thank you for your interest in contributing to unioffice ("We" or "Us"). 2 | 3 | The purpose of this contributor agreement ("Agreement") is to clarify and 4 | document the rights granted by contributors to Us. 5 | 6 | 7 | # 1. DEFINITIONS 8 | 9 | "YOU" means the Individual Copyright owner who submits a Contribution to Us. If 10 | You are an employee and submit the Contribution as part of your employment, You 11 | have had Your employer approve this Agreement or sign the Entity version of this 12 | document. 13 | 14 | "CONTRIBUTION" means any original work of authorship (software and/or 15 | documentation) including any modifications or additions to an existing work, 16 | Submitted by You to Us, in which You own the Copyright. If You do not own the 17 | Copyright in the entire work of authorship, please contact Us at 18 | sales@unidoc.io. 19 | 20 | "COPYRIGHT" means all rights protecting works of authorship owned or controlled 21 | by You, including copyright, moral and neighboring rights, as appropriate, for 22 | the full term of their existence including any extensions by You. 23 | 24 | "MATERIAL" means the software or documentation made available by Us to third 25 | parties. When this Agreement covers more than one software project, the Material 26 | means the software or documentation to which the Contribution was Submitted. 27 | After You Submit the Contribution, it may be included in the Material. 28 | 29 | "SUBMIT" means any form of physical, electronic, or written communication sent 30 | to Us, including but not limited to electronic mailing lists, source code 31 | control systems, and issue tracking systems that are managed by, or on behalf 32 | of, Us, but excluding communication that is conspicuously marked or otherwise 33 | designated in writing by You as "Not a Contribution." 34 | 35 | "SUBMISSION DATE" means the date You Submit a Contribution to Us. 36 | 37 | "DOCUMENTATION" means any non-software portion of a Contribution. 38 | 39 | 40 | # 2. LICENSE GRANT 41 | 42 | ## 2.1 Copyright License to Us 43 | 44 | Subject to the terms and conditions of this Agreement, You hereby grant to Us a 45 | worldwide, royalty-free, NON-exclusive, perpetual and irrevocable license, with 46 | the right to transfer an unlimited number of non-exclusive licenses or to grant 47 | sublicenses to third parties, under the Copyright covering the Contribution to 48 | use the Contribution by all means, including, but not limited to: 49 | 50 | * to publish the Contribution, 51 | 52 | * to modify the Contribution, to prepare derivative works based upon or 53 | containing the Contribution and to combine the Contribution with other 54 | software code, 55 | 56 | * to reproduce the Contribution in original or modified form, 57 | 58 | * to distribute, to make the Contribution available to the public, display and 59 | publicly perform the Contribution in original or modified form. 60 | 61 | 2.2 Moral Rights remain unaffected to the extent they are recognized and not 62 | waivable by applicable law. Notwithstanding, You may add your name in the header 63 | of the source code files of Your Contribution and We will respect this 64 | attribution when using Your Contribution. 65 | 66 | 67 | # 3. PATENTS 68 | 69 | ## 3.1 Patent License 70 | 71 | Subject to the terms and conditions of this Agreement You hereby grant to us a 72 | worldwide, royalty-free, non-exclusive, perpetual and irrevocable (except as 73 | stated in Section 3.2) patent license, with the right to transfer an unlimited 74 | number of non-exclusive licenses or to grant sublicenses to third parties, to 75 | make, have made, use, sell, offer for sale, import and otherwise transfer the 76 | Contribution and the Contribution in combination with the Material (and portions 77 | of such combination). This license applies to all patents owned or controlled by 78 | You, whether already acquired or hereafter acquired, that would be infringed by 79 | making, having made, using, selling, offering for sale, importing or otherwise 80 | transferring of Your Contribution(s) alone or by combination of Your 81 | Contribution(s) with the Material. 82 | 83 | ##3.2 Revocation of Patent License 84 | 85 | You reserve the right to revoke the patent license stated in section 3.1 if we 86 | make any infringement claim that is targeted at your Contribution and not 87 | asserted for a Defensive Purpose. An assertion of claims of the Patents shall be 88 | considered for a "Defensive Purpose" if the claims are asserted against an 89 | entity that has filed, maintained, threatened, or voluntarily participated in a 90 | patent infringement lawsuit against Us or any of Our licensees. 91 | 92 | 93 | # 4. DISCLAIMER 94 | 95 | THE CONTRIBUTION IS PROVIDED "AS IS". MORE PARTICULARLY, ALL EXPRESS OR IMPLIED 96 | WARRANTIES INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTY OF 97 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 98 | EXPRESSLY DISCLAIMED BY YOU TO US AND BY US TO YOU. TO THE EXTENT THAT ANY SUCH 99 | WARRANTIES CANNOT BE DISCLAIMED, SUCH WARRANTY IS LIMITED IN DURATION TO THE 100 | MINIMUM PERIOD PERMITTED BY LAW. 101 | 102 | 103 | # 5. CONSEQUENTIAL DAMAGE WAIVER 104 | 105 | TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT WILL YOU OR US BE 106 | LIABLE FOR ANY LOSS OF PROFITS, LOSS OF ANTICIPATED SAVINGS, LOSS OF DATA, 107 | INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL AND EXEMPLARY DAMAGES ARISING OUT 108 | OF THIS AGREEMENT REGARDLESS OF THE LEGAL OR EQUITABLE THEORY (CONTRACT, TORT OR 109 | OTHERWISE) UPON WHICH THE CLAIM IS BASED. 110 | 111 | 112 | # 6. APPROXIMATION OF DISCLAIMER AND DAMAGE WAIVER 113 | 114 | IF THE DISCLAIMER AND DAMAGE WAIVER MENTIONED IN SECTION 4 AND SECTION 5 CANNOT 115 | BE GIVEN LEGAL EFFECT UNDER APPLICABLE LOCAL LAW, REVIEWING COURTS SHALL APPLY 116 | LOCAL LAW THAT MOST CLOSELY APPROXIMATES AN ABSOLUTE WAIVER OF ALL CIVIL 117 | LIABILITY IN CONNECTION WITH THE CONTRIBUTION. 118 | 119 | 120 | # 7. TERM 121 | 122 | 7.1 This Agreement shall come into effect upon Your acceptance of the terms and 123 | conditions. 124 | 125 | 7.2 In the event of a termination of this Agreement Sections 4, 5, 6, 7 and 8 126 | shall survive such termination and shall remain in full force thereafter. For 127 | the avoidance of doubt, Contributions that are already licensed under a free and 128 | open source license at the date of the termination shall remain in full force 129 | after the termination of this Agreement. 130 | 131 | 132 | # 8. MISCELLANEOUS 133 | 134 | 8.1 This Agreement and all disputes, claims, actions, suits or other proceedings 135 | arising out of this agreement or relating in any way to it shall be governed by 136 | the laws of the United States excluding its private international law provisions. 137 | 138 | 8.2 This Agreement sets out the entire agreement between You and Us for Your 139 | Contributions to Us and overrides all other agreements or understandings. 140 | 141 | 8.3 If any provision of this Agreement is found void and unenforceable, such 142 | provision will be replaced to the extent possible with a provision that comes 143 | closest to the meaning of the original provision and that is enforceable. The 144 | terms and conditions set forth in this Agreement shall apply notwithstanding any 145 | failure of essential purpose of this Agreement or any limited remedy to the 146 | maximum extent possible under law. 147 | 148 | 8.4 You agree to notify Us of any facts or circumstances of which you become 149 | aware that would make this Agreement inaccurate in any respect. 150 | -------------------------------------------------------------------------------- /schema/schemas.microsoft.com/office/word/2018/wordml/wordml.go: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2020 FoxyUtils ehf. All rights reserved. 3 | // 4 | // This is a commercial product and requires a license to operate. 5 | // A trial license can be obtained at https://unidoc.io 6 | // 7 | // DO NOT EDIT: generated by unitwist Go source code obfuscator. 8 | // 9 | // Use of this source code is governed by the UniDoc End User License Agreement 10 | // terms that can be accessed at https://unidoc.io/eula/ 11 | 12 | package wordml ;import (_c "encoding/xml";_b "fmt";_aa "github.com/unidoc/unioffice/v2";_e "github.com/unidoc/unioffice/v2/common/logger";_ce "github.com/unidoc/unioffice/v2/schema/soo/dml";_bd "github.com/unidoc/unioffice/v2/schema/soo/ofc/sharedTypes"; 13 | _g "time";);func NewCT_Extension ()*CT_Extension {_f :=&CT_Extension {};return _f };func ParseUnionST_FixedPercentage (s string )(_ce .ST_FixedPercentage ,error ){return _ce .ParseUnionST_FixedPercentage (s );};type CT_Extension struct{UriAttr *string ; 14 | Any _aa .Any ;};func ParseUnionST_AdjAngle (s string )(_ce .ST_AdjAngle ,error ){return _ce .ParseUnionST_AdjAngle (s )}; 15 | 16 | // ValidateWithPath validates the CT_ExtensionList and its children, prefixing error messages with path 17 | func (_efa *CT_ExtensionList )ValidateWithPath (path string )error {for _ff ,_bc :=range _efa .Ext {if _ggd :=_bc .ValidateWithPath (_b .Sprintf ("\u0025\u0073\u002f\u0045\u0078\u0074\u005b\u0025\u0064\u005d",path ,_ff ));_ggd !=nil {return _ggd ;};};return nil ; 18 | };func _dbf (_aea bool )uint8 {if _aea {return 1;};return 0;};func ParseUnionST_Coordinate32 (s string )(_ce .ST_Coordinate32 ,error ){return _ce .ParseUnionST_Coordinate32 (s );};func ParseUnionST_TextSpacingPercentOrPercentString (s string )(_ce .ST_TextSpacingPercentOrPercentString ,error ){return _ce .ParseUnionST_TextSpacingPercentOrPercentString (s ); 19 | };type CT_ExtensionList struct{Ext []*CT_Extension ;};func ParseUnionST_AnimationChartBuildType (s string )(_ce .ST_AnimationChartBuildType ,error ){return _ce .ParseUnionST_AnimationChartBuildType (s );};func (_gf *CT_ExtensionList )UnmarshalXML (d *_c .Decoder ,start _c .StartElement )error {_ag :for {_ee ,_ca :=d .Token (); 20 | if _ca !=nil {return _ca ;};switch _agc :=_ee .(type ){case _c .StartElement :switch _agc .Name {case _c .Name {Space :"\u0068\u0074t\u0070\u003a\u002f\u002f\u0073c\u0068\u0065\u006d\u0061\u0073.\u006d\u0069\u0063\u0072\u006f\u0073\u006f\u0066\u0074\u002e\u0063\u006f\u006d\u002f\u006f\u0066\u0066\u0069\u0063\u0065\u002f\u0077\u006f\u0072\u0064\u002f\u0032\u0030\u0031\u0038\u002f\u0077\u006f\u0072\u0064\u006d\u006c",Local :"\u0065\u0078\u0074"}:_ceb :=NewCT_Extension (); 21 | if _gg :=d .DecodeElement (_ceb ,&_agc );_gg !=nil {return _gg ;};_gf .Ext =append (_gf .Ext ,_ceb );default:_e .Log .Debug ("\u0073\u006b\u0069\u0070\u0070i\u006e\u0067\u0020\u0075\u006e\u0073\u0075\u0070\u0070\u006f\u0072\u0074\u0065d\u0020\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0020\u006f\u006e\u0020\u0043\u0054\u005f\u0045\u0078\u0074\u0065\u006e\u0073\u0069\u006f\u006e\u004c\u0069\u0073\u0074\u0020\u0025v",_agc .Name ); 22 | if _aee :=d .Skip ();_aee !=nil {return _aee ;};};case _c .EndElement :break _ag ;case _c .CharData :};};return nil ;};func ParseUnionST_Coordinate (s string )(_ce .ST_Coordinate ,error ){return _ce .ParseUnionST_Coordinate (s );};func ParseUnionST_Percentage (s string )(_ce .ST_Percentage ,error ){return _ce .ParseUnionST_Percentage (s ); 23 | };func ParseUnionST_PositiveFixedPercentage (s string )(_ce .ST_PositiveFixedPercentage ,error ){return _ce .ParseUnionST_PositiveFixedPercentage (s );};func (_bg *CT_Extension )UnmarshalXML (d *_c .Decoder ,start _c .StartElement )error {for _ ,_cd :=range start .Attr {if _cd .Name .Local =="\u0075\u0072\u0069"{_bf :=_cd .Value ; 24 | _bg .UriAttr =&_bf ;continue ;};};_ga :for {_cdc ,_gag :=d .Token ();if _gag !=nil {return _gag ;};switch _ec :=_cdc .(type ){case _c .StartElement :switch _ec .Name {default:if _gd ,_bgb :=_aa .CreateElement (_ec );_bgb !=nil {return _bgb ;}else {if _cee :=d .DecodeElement (_gd ,&_ec ); 25 | _cee !=nil {return _cee ;};_bg .Any =_gd ;};};case _c .EndElement :break _ga ;case _c .CharData :};};return nil ;};func ParseUnionST_TextPoint (s string )(_ce .ST_TextPoint ,error ){return _ce .ParseUnionST_TextPoint (s )};func ParseUnionST_AnimationDgmBuildType (s string )(_ce .ST_AnimationDgmBuildType ,error ){return _ce .ParseUnionST_AnimationDgmBuildType (s ); 26 | }; 27 | 28 | // Validate validates the CT_ExtensionList and its children 29 | func (_gfa *CT_ExtensionList )Validate ()error {return _gfa .ValidateWithPath ("\u0043\u0054_\u0045\u0078\u0074e\u006e\u0073\u0069\u006f\u006e\u004c\u0069\u0073\u0074");};func NewCT_ExtensionList ()*CT_ExtensionList {_ge :=&CT_ExtensionList {};return _ge }; 30 | func (_d *CT_ExtensionList )MarshalXML (e *_c .Encoder ,start _c .StartElement )error {start .Name .Local ="\u0077\u006f\u003a\u0043T_\u0045\u0078\u0074\u0065\u006e\u0073\u0069\u006f\u006e\u004c\u0069\u0073\u0074";e .EncodeToken (start );if _d .Ext !=nil {_cef :=_c .StartElement {Name :_c .Name {Local :"\u0077\u006f\u003a\u0065\u0078\u0074"}}; 31 | for _ ,_cdcd :=range _d .Ext {e .EncodeElement (_cdcd ,_cef );};};e .EncodeToken (_c .EndElement {Name :start .Name });return nil ;};func ParseStdlibTime (s string )(_g .Time ,error ){return _bd .ParseStdlibTime (s )};func (_ae *CT_Extension )MarshalXML (e *_c .Encoder ,start _c .StartElement )error {if _ae .UriAttr !=nil {start .Attr =append (start .Attr ,_c .Attr {Name :_c .Name {Local :"\u0077\u006f\u003a\u0075\u0072\u0069"},Value :_b .Sprintf ("\u0025\u0076",*_ae .UriAttr )}); 32 | };e .EncodeToken (start );if _ae .Any !=nil {_ae .Any .MarshalXML (e ,_c .StartElement {});};e .EncodeToken (_c .EndElement {Name :start .Name });return nil ;};func ParseUnionST_PositivePercentage (s string )(_ce .ST_PositivePercentage ,error ){return _ce .ParseUnionST_PositivePercentage (s ); 33 | }; 34 | 35 | // Validate validates the CT_Extension and its children 36 | func (_ef *CT_Extension )Validate ()error {return _ef .ValidateWithPath ("\u0043\u0054\u005fE\u0078\u0074\u0065\u006e\u0073\u0069\u006f\u006e");};func ParseUnionST_TextFontScalePercentOrPercentString (s string )(_ce .ST_TextFontScalePercentOrPercentString ,error ){return _ce .ParseUnionST_TextFontScalePercentOrPercentString (s ); 37 | };type Any interface{MarshalXML (_ed *_c .Encoder ,_af _c .StartElement )error ;UnmarshalXML (_be *_c .Decoder ,_ea _c .StartElement )error ;};func ParseUnionST_AdjCoordinate (s string )(_ce .ST_AdjCoordinate ,error ){return _ce .ParseUnionST_AdjCoordinate (s ); 38 | };func ParseUnionST_OnOff (s string )(_bd .ST_OnOff ,error ){return _bd .ST_OnOff {},nil }; 39 | 40 | // ValidateWithPath validates the CT_Extension and its children, prefixing error messages with path 41 | func (_cf *CT_Extension )ValidateWithPath (path string )error {return nil };func init (){_aa .RegisterConstructor ("\u0068\u0074t\u0070\u003a\u002f\u002f\u0073c\u0068\u0065\u006d\u0061\u0073.\u006d\u0069\u0063\u0072\u006f\u0073\u006f\u0066\u0074\u002e\u0063\u006f\u006d\u002f\u006f\u0066\u0066\u0069\u0063\u0065\u002f\u0077\u006f\u0072\u0064\u002f\u0032\u0030\u0031\u0038\u002f\u0077\u006f\u0072\u0064\u006d\u006c","\u0043\u0054\u005fE\u0078\u0074\u0065\u006e\u0073\u0069\u006f\u006e",NewCT_Extension ); 42 | _aa .RegisterConstructor ("\u0068\u0074t\u0070\u003a\u002f\u002f\u0073c\u0068\u0065\u006d\u0061\u0073.\u006d\u0069\u0063\u0072\u006f\u0073\u006f\u0066\u0074\u002e\u0063\u006f\u006d\u002f\u006f\u0066\u0066\u0069\u0063\u0065\u002f\u0077\u006f\u0072\u0064\u002f\u0032\u0030\u0031\u0038\u002f\u0077\u006f\u0072\u0064\u006d\u006c","\u0043\u0054_\u0045\u0078\u0074e\u006e\u0073\u0069\u006f\u006e\u004c\u0069\u0073\u0074",NewCT_ExtensionList ); 43 | }; -------------------------------------------------------------------------------- /schema/purl.org/dc/elements/elements.go: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2020 FoxyUtils ehf. All rights reserved. 3 | // 4 | // This is a commercial product and requires a license to operate. 5 | // A trial license can be obtained at https://unidoc.io 6 | // 7 | // DO NOT EDIT: generated by unitwist Go source code obfuscator. 8 | // 9 | // Use of this source code is governed by the UniDoc End User License Agreement 10 | // terms that can be accessed at https://unidoc.io/eula/ 11 | 12 | package elements ;import (_b "encoding/xml";_e "fmt";_g "github.com/unidoc/unioffice/v2";_a "github.com/unidoc/unioffice/v2/common/logger";); 13 | 14 | // ValidateWithPath validates the ElementContainer and its children, prefixing error messages with path 15 | func (_aba *ElementContainer )ValidateWithPath (path string )error {if _aba .Any !=nil {if _ff :=_aba .Any .ValidateWithPath (path +"\u002f\u0041\u006e\u0079");_ff !=nil {return _ff ;};};return nil ;}; 16 | 17 | // ValidateWithPath validates the Any and its children, prefixing error messages with path 18 | func (_ae *Any )ValidateWithPath (path string )error {if _ef :=_ae .SimpleLiteral .ValidateWithPath (path );_ef !=nil {return _ef ;};return nil ;};func NewElementsGroup ()*ElementsGroup {_cea :=&ElementsGroup {};return _cea };type SimpleLiteral struct{}; 19 | type ElementsGroup struct{Any *Any ;};func (_ce *ElementContainer )MarshalXML (e *_b .Encoder ,start _b .StartElement )error {start .Name .Local ="\u0065\u006ce\u006d\u0065\u006et\u0043\u006f\u006e\u0074\u0061\u0069\u006e\u0065\u0072";e .EncodeToken (start ); 20 | if _ce .Any !=nil {_cgg :=_b .StartElement {Name :_b .Name {Local :"\u0061\u006e\u0079"}};e .EncodeElement (_ce .Any ,_cgg );};e .EncodeToken (_b .EndElement {Name :start .Name });return nil ;};func (_gdg *ElementsGroup )UnmarshalXML (d *_b .Decoder ,start _b .StartElement )error {_da :for {_ad ,_df :=d .Token (); 21 | if _df !=nil {return _df ;};switch _cge :=_ad .(type ){case _b .StartElement :switch _cge .Name {case _b .Name {Space :"\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0072\u0067/\u0064c\u002f\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u002f\u0031\u002e\u0031\u002f",Local :"\u0061\u006e\u0079"}:_gdg .Any =NewAny (); 22 | if _gga :=d .DecodeElement (_gdg .Any ,&_cge );_gga !=nil {return _gga ;};default:_a .Log .Debug ("\u0073\u006b\u0069\u0070\u0070\u0069\u006e\u0067 \u0075\u006e\u0073up\u0070\u006f\u0072\u0074\u0065\u0064 \u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0020\u006f\u006e\u0020\u0045\u006c\u0065\u006de\u006e\u0074\u0073\u0047\u0072\u006f\u0075\u0070 \u0025\u0076",_cge .Name ); 23 | if _ec :=d .Skip ();_ec !=nil {return _ec ;};};case _b .EndElement :break _da ;case _b .CharData :};};return nil ;};func NewElementContainer ()*ElementContainer {_ab :=&ElementContainer {};return _ab }; 24 | 25 | // Validate validates the ElementsGroup and its children 26 | func (_ca *ElementsGroup )Validate ()error {return _ca .ValidateWithPath ("\u0045\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u0047\u0072\u006f\u0075\u0070");};func (_ade *SimpleLiteral )UnmarshalXML (d *_b .Decoder ,start _b .StartElement )error {for {_bcc ,_ada :=d .Token (); 27 | if _ada !=nil {return _e .Errorf ("\u0070a\u0072\u0073\u0069\u006eg\u0020\u0053\u0069\u006d\u0070l\u0065L\u0069t\u0065\u0072\u0061\u006c\u003a\u0020\u0025s",_ada );};if _ag ,_agd :=_bcc .(_b .EndElement );_agd &&_ag .Name ==start .Name {break ;};};return nil ; 28 | };type Any struct{SimpleLiteral };func NewSimpleLiteral ()*SimpleLiteral {_fd :=&SimpleLiteral {};return _fd };func NewAny ()*Any {_d :=&Any {};_d .SimpleLiteral =*NewSimpleLiteral ();return _d };func (_gb *ElementContainer )UnmarshalXML (d *_b .Decoder ,start _b .StartElement )error {_gg :for {_cd ,_ac :=d .Token (); 29 | if _ac !=nil {return _ac ;};switch _gf :=_cd .(type ){case _b .StartElement :switch _gf .Name {case _b .Name {Space :"\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0072\u0067/\u0064c\u002f\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u002f\u0031\u002e\u0031\u002f",Local :"\u0061\u006e\u0079"}:_gb .Any =NewAny (); 30 | if _fg :=d .DecodeElement (_gb .Any ,&_gf );_fg !=nil {return _fg ;};default:_a .Log .Debug ("\u0073\u006b\u0069\u0070\u0070i\u006e\u0067\u0020\u0075\u006e\u0073\u0075\u0070\u0070\u006f\u0072\u0074\u0065d\u0020\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0020\u006f\u006e\u0020\u0045\u006c\u0065\u006d\u0065\u006e\u0074\u0043\u006f\u006e\u0074\u0061\u0069\u006e\u0065\u0072\u0020\u0025v",_gf .Name ); 31 | if _bb :=d .Skip ();_bb !=nil {return _bb ;};};case _b .EndElement :break _gg ;case _b .CharData :};};return nil ;};func (_eaf *SimpleLiteral )MarshalXML (e *_b .Encoder ,start _b .StartElement )error {e .EncodeToken (start );e .EncodeToken (_b .EndElement {Name :start .Name }); 32 | return nil ;}; 33 | 34 | // Validate validates the SimpleLiteral and its children 35 | func (_cc *SimpleLiteral )Validate ()error {return _cc .ValidateWithPath ("\u0053\u0069\u006d\u0070\u006c\u0065\u004c\u0069\u0074\u0065\u0072\u0061\u006c");};func (_gd *Any )UnmarshalXML (d *_b .Decoder ,start _b .StartElement )error {_gd .SimpleLiteral =*NewSimpleLiteral (); 36 | for {_ea ,_bc :=d .Token ();if _bc !=nil {return _e .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0041\u006e\u0079\u003a\u0020\u0025\u0073",_bc );};if _c ,_cg :=_ea .(_b .EndElement );_cg &&_c .Name ==start .Name {break ;};};return nil ;}; 37 | 38 | // ValidateWithPath validates the SimpleLiteral and its children, prefixing error messages with path 39 | func (_abe *SimpleLiteral )ValidateWithPath (path string )error {return nil };func (_fc *ElementsGroup )MarshalXML (e *_b .Encoder ,start _b .StartElement )error {if _fc .Any !=nil {_ga :=_b .StartElement {Name :_b .Name {Local :"\u0064\u0063\u003a\u0061\u006e\u0079"}}; 40 | e .EncodeElement (_fc .Any ,_ga );};return nil ;}; 41 | 42 | // Validate validates the Any and its children 43 | func (_fa *Any )Validate ()error {return _fa .ValidateWithPath ("\u0041\u006e\u0079")}; 44 | 45 | // ValidateWithPath validates the ElementsGroup and its children, prefixing error messages with path 46 | func (_ba *ElementsGroup )ValidateWithPath (path string )error {if _ba .Any !=nil {if _dae :=_ba .Any .ValidateWithPath (path +"\u002f\u0041\u006e\u0079");_dae !=nil {return _dae ;};};return nil ;};func (_eb *Any )MarshalXML (e *_b .Encoder ,start _b .StartElement )error {return _eb .SimpleLiteral .MarshalXML (e ,start ); 47 | };type ElementContainer struct{Any *Any ;}; 48 | 49 | // Validate validates the ElementContainer and its children 50 | func (_dc *ElementContainer )Validate ()error {return _dc .ValidateWithPath ("\u0045\u006ce\u006d\u0065\u006et\u0043\u006f\u006e\u0074\u0061\u0069\u006e\u0065\u0072");};func init (){_g .RegisterConstructor ("\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0072\u0067/\u0064c\u002f\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u002f\u0031\u002e\u0031\u002f","\u0053\u0069\u006d\u0070\u006c\u0065\u004c\u0069\u0074\u0065\u0072\u0061\u006c",NewSimpleLiteral ); 51 | _g .RegisterConstructor ("\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0072\u0067/\u0064c\u002f\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u002f\u0031\u002e\u0031\u002f","\u0065\u006ce\u006d\u0065\u006et\u0043\u006f\u006e\u0074\u0061\u0069\u006e\u0065\u0072",NewElementContainer ); 52 | _g .RegisterConstructor ("\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0072\u0067/\u0064c\u002f\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u002f\u0031\u002e\u0031\u002f","\u0061\u006e\u0079",NewAny );_g .RegisterConstructor ("\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0072\u0067/\u0064c\u002f\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u002f\u0031\u002e\u0031\u002f","\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u0047\u0072\u006f\u0075\u0070",NewElementsGroup ); 53 | }; -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | github.com/adrg/strutil v0.2.2/go.mod h1:EF2fjOFlGTepljfI+FzgTG13oXthR7ZAil9/aginnNQ= 2 | github.com/adrg/strutil v0.3.1 h1:OLvSS7CSJO8lBii4YmBt8jiK9QOtB9CzCzwl4Ic/Fz4= 3 | github.com/adrg/strutil v0.3.1/go.mod h1:8h90y18QLrs11IBffcGX3NW/GFBXCMcNg4M7H6MspPA= 4 | github.com/adrg/sysfont v0.1.2 h1:MSU3KREM4RhsQ+7QgH7wPEPTgAgBIz0Hw6Nd4u7QgjE= 5 | github.com/adrg/sysfont v0.1.2/go.mod h1:6d3l7/BSjX9VaeXWJt9fcrftFaD/t7l11xgSywCPZGk= 6 | github.com/adrg/xdg v0.3.0/go.mod h1:7I2hH/IT30IsupOpKZ5ue7/qNi3CoKzD6tL3HwpaRMQ= 7 | github.com/adrg/xdg v0.5.3 h1:xRnxJXne7+oWDatRhR1JLnvuccuIeCoBu2rtuLqQB78= 8 | github.com/adrg/xdg v0.5.3/go.mod h1:nlTsY+NNiCBGCK2tpm09vRqfVzrc2fLmXGpBLF0zlTQ= 9 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 10 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 11 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 12 | github.com/disintegration/imaging v1.6.2 h1:w1LecBlG2Lnp8B3jk5zSuNqd7b4DXhcjwek1ei82L+c= 13 | github.com/disintegration/imaging v1.6.2/go.mod h1:44/5580QXChDfwIclfc/PCwrr44amcmDAg8hxG0Ewe4= 14 | github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g= 15 | github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= 16 | github.com/gorilla/i18n v0.0.0-20150820051429-8b358169da46 h1:N+R2A3fGIr5GucoRMu2xpqyQWQlfY31orbofBCdjMz8= 17 | github.com/gorilla/i18n v0.0.0-20150820051429-8b358169da46/go.mod h1:2Yoiy15Cf7Q3NFwfaJquh7Mk1uGI09ytcD7CUhn8j7s= 18 | github.com/h2non/filetype v1.1.3 h1:FKkx9QbD7HR/zjK1Ia5XiBsq9zdLi5Kf3zGyFTAFkGg= 19 | github.com/h2non/filetype v1.1.3/go.mod h1:319b3zT68BvV+WRj7cwy856M2ehB3HqNOt6sy1HndBY= 20 | github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= 21 | github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= 22 | github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= 23 | github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= 24 | github.com/llgcode/draw2d v0.0.0-20240627062922-0ed1ff131195 h1:Vdz2cBh5Fw2MYHWi3ED2PraDQaWEUhNCr1XFHrP4N5A= 25 | github.com/llgcode/draw2d v0.0.0-20240627062922-0ed1ff131195/go.mod h1:1Vk0LDW6jG5cGc2D9RQUxHaE0vYhTvIwSo9mOL6K4/U= 26 | github.com/llgcode/ps v0.0.0-20210114104736-f4b0c5d1e02e h1:ZAvbj5hI/G/EbAYAcj4yCXUNiFKefEhH0qfImDDD0/8= 27 | github.com/llgcode/ps v0.0.0-20210114104736-f4b0c5d1e02e/go.mod h1:1l8ky+Ew27CMX29uG+a2hNOKpeNYEQjjtiALiBlFQbY= 28 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 29 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 30 | github.com/richardlehane/msoleps v1.0.4 h1:WuESlvhX3gH2IHcd8UqyCuFY5yiq/GR/yqaSM/9/g00= 31 | github.com/richardlehane/msoleps v1.0.4/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg= 32 | github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= 33 | github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= 34 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 35 | github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= 36 | github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= 37 | github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 38 | github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 39 | github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 40 | github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= 41 | github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= 42 | github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= 43 | github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= 44 | github.com/unidoc/emf v0.1.0 h1:Iz6NPQybwaMoJeApCTm3ISE75XPCirKmI/RLNNiLzhI= 45 | github.com/unidoc/emf v0.1.0/go.mod h1:Qc3u+zymqB+sWkwjyA3eQg5PyaLooI0bcmpjYVxfbZ0= 46 | github.com/unidoc/freetype v0.2.3 h1:uPqW+AY0vXN6K2tvtg8dMAtHTEvvHTN52b72XpZU+3I= 47 | github.com/unidoc/freetype v0.2.3/go.mod h1:mJ/Q7JnqEoWtajJVrV6S1InbRv0K/fJerPB5SQs32KI= 48 | github.com/unidoc/garabic v0.0.0-20220702200334-8c7cb25baa11 h1:kExUKrbi429KdVVuAc85z4P+W/Rk4bjGWB5KzZLl/l8= 49 | github.com/unidoc/garabic v0.0.0-20220702200334-8c7cb25baa11/go.mod h1:SX63w9Ww4+Z7E96B01OuG59SleQUb+m+dmapZ8o1Jac= 50 | github.com/unidoc/pkcs7 v0.0.0-20200411230602-d883fd70d1df/go.mod h1:UEzOZUEpJfDpywVJMUT8QiugqEZC29pDq7kdIZhWCr8= 51 | github.com/unidoc/pkcs7 v0.3.0 h1:+RCopNCR8UoZtlf4bu4Y88O3j1MbvrLcOuQj/tbPLoU= 52 | github.com/unidoc/pkcs7 v0.3.0/go.mod h1:UEzOZUEpJfDpywVJMUT8QiugqEZC29pDq7kdIZhWCr8= 53 | github.com/unidoc/timestamp v0.0.0-20200412005513-91597fd3793a h1:RLtvUhe4DsUDl66m7MJ8OqBjq8jpWBXPK6/RKtqeTkc= 54 | github.com/unidoc/timestamp v0.0.0-20200412005513-91597fd3793a/go.mod h1:j+qMWZVpZFTvDey3zxUkSgPJZEX33tDgU/QIA0IzCUw= 55 | github.com/unidoc/unichart v0.5.1 h1:qnYavwBV5sg9NUF59KbMOqJdh2kA454nVxdDTPPtSz8= 56 | github.com/unidoc/unichart v0.5.1/go.mod h1:/8yJsL49OqBOyG53JFVZOwwDXDquo/ZRMkfz9fNsVgc= 57 | github.com/unidoc/unipdf/v4 v4.3.0 h1:eA4zjRHTULtV5thy3MausfFYDP1i59qGdsfxe709oUY= 58 | github.com/unidoc/unipdf/v4 v4.3.0/go.mod h1:oR0EX7TmS7KaAuzFQPA9t9HjbU4f2NbWMvzXNqtXo70= 59 | github.com/unidoc/unitype v0.5.1 h1:UwTX15K6bktwKocWVvLoijIeu4JAVEAIeFqMOjvxqQs= 60 | github.com/unidoc/unitype v0.5.1/go.mod h1:3dxbRL+f1otNqFQIRHho8fxdg3CcUKrqS8w1SXTsqcI= 61 | golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4= 62 | golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc= 63 | golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= 64 | golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= 65 | golang.org/x/image v0.30.0 h1:jD5RhkmVAnjqaCUXfbGBrn3lpxbknfN9w2UhHHU+5B4= 66 | golang.org/x/image v0.30.0/go.mod h1:SAEUTxCCMWSrJcCy/4HwavEsfZZJlYxeHLc6tTiAe/c= 67 | golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE= 68 | golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg= 69 | golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 70 | golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= 71 | golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= 72 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 73 | golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 74 | golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng= 75 | golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU= 76 | golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 77 | golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da h1:noIWHXmPHxILtqtCOPIhSt0ABwskkZKjD3bXGnZGpNY= 78 | golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= 79 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 80 | gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= 81 | gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 82 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 83 | gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= 84 | gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 85 | -------------------------------------------------------------------------------- /spreadsheet/reference/reference.go: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2020 FoxyUtils ehf. All rights reserved. 3 | // 4 | // This is a commercial product and requires a license to operate. 5 | // A trial license can be obtained at https://unidoc.io 6 | // 7 | // DO NOT EDIT: generated by unitwist Go source code obfuscator. 8 | // 9 | // Use of this source code is governed by the UniDoc End User License Agreement 10 | // terms that can be accessed at https://unidoc.io/eula/ 11 | 12 | package reference ;import (_a "errors";_dad "fmt";_ee "github.com/unidoc/unioffice/v2/spreadsheet/update";_e "regexp";_da "strconv";_d "strings";); 13 | 14 | // ParseColumnRangeReference splits a range reference of the form "A:B" into its 15 | // components. 16 | func ParseColumnRangeReference (s string )(_efe ,_beb ColumnReference ,_cg error ){_daa :="";_aag :=_d .Split (s ,"\u0021");if len (_aag )==2{_daa =_aag [0];s =_aag [1];};_ed :=_d .Split (s ,"\u003a");if len (_ed )!=2{return ColumnReference {},ColumnReference {},_a .New ("i\u006ev\u0061\u006c\u0069\u0064\u0020\u0072\u0061\u006eg\u0065\u0020\u0066\u006frm\u0061\u0074"); 17 | };if _daa !=""{_ed [0]=_daa +"\u0021"+_ed [0];_ed [1]=_daa +"\u0021"+_ed [1];};_bdf ,_cg :=ParseColumnReference (_ed [0]);if _cg !=nil {return ColumnReference {},ColumnReference {},_cg ;};_dd ,_cg :=ParseColumnReference (_ed [1]);if _cg !=nil {return ColumnReference {},ColumnReference {},_cg ; 18 | };return _bdf ,_dd ,nil ;}; 19 | 20 | // ParseRangeReference splits a range reference of the form "A1:B5" into its 21 | // components. 22 | func ParseRangeReference (s string )(_bb ,_egd CellReference ,_cee error ){_eeb ,_dee ,_cee :=_gg (s );if _cee !=nil {return CellReference {},CellReference {},_cee ;};_egec :=_d .Split (_dee ,"\u003a");if len (_egec )!=2{return CellReference {},CellReference {},_a .New ("i\u006ev\u0061\u006c\u0069\u0064\u0020\u0072\u0061\u006eg\u0065\u0020\u0066\u006frm\u0061\u0074"); 23 | };if _eeb !=""{_egec [0]=_eeb +"\u0021"+_egec [0];_egec [1]=_eeb +"\u0021"+_egec [1];};_fa ,_cee :=ParseCellReference (_egec [0]);if _cee !=nil {return CellReference {},CellReference {},_cee ;};_fe ,_cee :=ParseCellReference (_egec [1]);if _cee !=nil {return CellReference {},CellReference {},_cee ; 24 | };return _fa ,_fe ,nil ;}; 25 | 26 | // ParseCellReference parses a cell reference of the form 'A10' and splits it 27 | // into column/row segments. 28 | func ParseCellReference (s string )(CellReference ,error ){s =_d .TrimSpace (s );if len (s )< 2{return CellReference {},_a .New ("\u0063\u0065\u006c\u006c\u0020\u0072\u0065\u0066e\u0072\u0065\u006ece\u0020\u006d\u0075\u0073\u0074\u0020h\u0061\u0076\u0065\u0020\u0061\u0074\u0020\u006c\u0065\u0061\u0073\u0074\u0020\u0074\u0077o\u0020\u0063\u0068\u0061\u0072\u0061\u0063\u0074e\u0072\u0073"); 29 | };_b :=CellReference {};_bd ,_eb ,_ebg :=_gg (s );if _ebg !=nil {return CellReference {},_ebg ;};if _bd !=""{_b .SheetName =_bd ;};if s [0]=='$'{_b .AbsoluteColumn =true ;_eb =_eb [1:];};_eg :=-1;_ff :for _c :=0;_c < len (_eb );_c ++{switch {case _eb [_c ]>='0'&&_eb [_c ]<='9'||_eb [_c ]=='$':_eg =_c ; 30 | break _ff ;};};switch _eg {case 0:return CellReference {},_dad .Errorf ("\u006e\u006f\u0020\u006cet\u0074\u0065\u0072\u0020\u0070\u0072\u0065\u0066\u0069\u0078\u0020\u0069\u006e\u0020%\u0073",_eb );case -1:return CellReference {},_dad .Errorf ("\u006eo\u0020d\u0069\u0067\u0069\u0074\u0073\u0020\u0069\u006e\u0020\u0025\u0073",_eb ); 31 | };_b .Column =_eb [0:_eg ];if _eb [_eg ]=='$'{_b .AbsoluteRow =true ;_eg ++;};_b .ColumnIdx =ColumnToIndex (_b .Column );_fc ,_ebg :=_da .ParseUint (_eb [_eg :],10,32);if _ebg !=nil {return CellReference {},_dad .Errorf ("e\u0072\u0072\u006f\u0072 p\u0061r\u0073\u0069\u006e\u0067\u0020r\u006f\u0077\u003a\u0020\u0025\u0073",_ebg ); 32 | };if _fc ==0{return CellReference {},_dad .Errorf ("\u0065\u0072\u0072\u006f\u0072\u0020\u0070\u0061\u0072\u0073i\u006e\u0067\u0020\u0072\u006f\u0077\u003a \u0063\u0061\u006e\u006e\u006f\u0074\u0020\u0062\u0065\u0020\u0030");};_b .RowIdx =uint32 (_fc ); 33 | return _b ,nil ;}; 34 | 35 | // ColumnToIndex maps a column to a zero based index (e.g. A = 0, B = 1, AA = 26) 36 | func ColumnToIndex (col string )uint32 {col =_d .ToUpper (col );_ae :=uint32 (0);for _ ,_ba :=range col {_ae *=26;_ae +=uint32 (_ba -'A'+1);};return _ae -1;}; 37 | 38 | // String returns a string representation of ColumnReference. 39 | func (_ce ColumnReference )String ()string {_cb :=make ([]byte ,0,4);if _ce .AbsoluteColumn {_cb =append (_cb ,'$');};_cb =append (_cb ,_ce .Column ...);return string (_cb );};func _gg (_ca string )(string ,string ,error ){_ge :="";_adb :=_d .LastIndex (_ca ,"\u0021"); 40 | if _adb > -1{_ge =_ca [:_adb ];_ca =_ca [_adb +1:];if _ge ==""{return "","",_a .New ("\u0049n\u0076a\u006c\u0069\u0064\u0020\u0073h\u0065\u0065t\u0020\u006e\u0061\u006d\u0065");};};return _ge ,_ca ,nil ;}; 41 | 42 | // ColumnReference is a parsed reference to a column. Input is of the form 'A', 43 | // '$C', etc. 44 | type ColumnReference struct{ColumnIdx uint32 ;Column string ;AbsoluteColumn bool ;SheetName string ;}; 45 | 46 | // CellReference is a parsed reference to a cell. Input is of the form 'A1', 47 | // '$C$2', etc. 48 | type CellReference struct{RowIdx uint32 ;ColumnIdx uint32 ;Column string ;AbsoluteColumn bool ;AbsoluteRow bool ;SheetName string ;}; 49 | 50 | // String returns a string representation of CellReference. 51 | func (_db CellReference )String ()string {_ef :=make ([]byte ,0,4);if _db .AbsoluteColumn {_ef =append (_ef ,'$');};_ef =append (_ef ,_db .Column ...);if _db .AbsoluteRow {_ef =append (_ef ,'$');};_ef =_da .AppendInt (_ef ,int64 (_db .RowIdx ),10);return string (_ef ); 52 | }; 53 | 54 | // Update updates reference to point one of the neighboring columns with respect to the update type after removing a row/column. 55 | func (_ced *ColumnReference )Update (updateType _ee .UpdateAction )*ColumnReference {switch updateType {case _ee .UpdateActionRemoveColumn :_cfe :=_ced ;_cfe .ColumnIdx =_ced .ColumnIdx -1;_cfe .Column =IndexToColumn (_cfe .ColumnIdx );return _cfe ;default:return _ced ; 56 | };}; 57 | 58 | // IndexToColumn maps a column number to a column name (e.g. 0 = A, 1 = B, 26 = AA) 59 | func IndexToColumn (col uint32 )string {var _gc [64+1]byte ;_ege :=len (_gc );_de :=col ;const _aa =26;for _de >=_aa {_ege --;_ag :=_de /_aa ;_gc [_ege ]=byte ('A'+uint (_de -_ag *_aa ));_de =_ag -1;};_ege --;_gc [_ege ]=byte ('A'+uint (_de ));return string (_gc [_ege :]); 60 | };var _df =_e .MustCompile ("^\u005b\u0061\u002d\u007aA-\u005a]\u0028\u005b\u0061\u002d\u007aA\u002d\u005a\u005d\u003f\u0029\u0024"); 61 | 62 | // Update updates reference to point one of the neighboring cells with respect to the update type after removing a row/column. 63 | func (_ad *CellReference )Update (updateType _ee .UpdateAction )*CellReference {switch updateType {case _ee .UpdateActionRemoveColumn :_dbb :=_ad ;_dbb .ColumnIdx =_ad .ColumnIdx -1;_dbb .Column =IndexToColumn (_dbb .ColumnIdx );return _dbb ;default:return _ad ; 64 | };}; 65 | 66 | // ParseColumnReference parses a column reference of the form 'Sheet1!A' and splits it 67 | // into sheet name and column segments. 68 | func ParseColumnReference (s string )(ColumnReference ,error ){s =_d .TrimSpace (s );if len (s )< 1{return ColumnReference {},_a .New ("\u0063\u006f\u006c\u0075\u006d\u006e \u0072\u0065\u0066\u0065\u0072\u0065\u006e\u0063\u0065\u0020\u006d\u0075\u0073\u0074\u0020\u0068\u0061\u0076\u0065\u0020a\u0074\u0020\u006c\u0065\u0061\u0073\u0074\u0020\u006f\u006e\u0065\u0020\u0063\u0068a\u0072a\u0063\u0074\u0065\u0072"); 69 | };_g :=ColumnReference {};_dc ,_be ,_cf :=_gg (s );if _cf !=nil {return ColumnReference {},_cf ;};if _dc !=""{_g .SheetName =_dc ;};if _be [0]=='$'{_g .AbsoluteColumn =true ;_be =_be [1:];};if !_df .MatchString (_be ){return ColumnReference {},_a .New ("\u0063\u006f\u006c\u0075\u006dn\u0020\u0072\u0065\u0066\u0065\u0072\u0065\u006e\u0063\u0065\u0020\u006d\u0075s\u0074\u0020\u0062\u0065\u0020\u0062\u0065\u0074\u0077\u0065\u0065\u006e\u0020\u0041\u0020\u0061\u006e\u0064\u0020\u005a\u005a"); 70 | };_g .Column =_be ;_g .ColumnIdx =ColumnToIndex (_g .Column );return _g ,nil ;}; -------------------------------------------------------------------------------- /schema/urn/schemas_microsoft_com/office/powerpoint/powerpoint.go: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2020 FoxyUtils ehf. All rights reserved. 3 | // 4 | // This is a commercial product and requires a license to operate. 5 | // A trial license can be obtained at https://unidoc.io 6 | // 7 | // DO NOT EDIT: generated by unitwist Go source code obfuscator. 8 | // 9 | // Use of this source code is governed by the UniDoc End User License Agreement 10 | // terms that can be accessed at https://unidoc.io/eula/ 11 | 12 | package powerpoint ;import (_d "encoding/xml";_c "fmt";_gg "github.com/unidoc/unioffice/v2";);func (_dga *Iscomment )MarshalXML (e *_d .Encoder ,start _d .StartElement )error {start .Attr =append (start .Attr ,_d .Attr {Name :_d .Name {Local :"\u0078\u006d\u006cn\u0073"},Value :"\u0075\u0072\u006e\u003a\u0073\u0063\u0068e\u006d\u0061\u0073-\u006d\u0069\u0063\u0072o\u0073\u006f\u0066\u0074\u002d\u0063\u006f\u006d\u003a\u006f\u0066\u0066\u0069\u0063\u0065\u003a\u0070\u006f\u0077\u0065\u0072\u0070\u006f\u0069\u006e\u0074"}); 13 | start .Attr =append (start .Attr ,_d .Attr {Name :_d .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u0077\u00314"},Value :"\u0068\u0074t\u0070\u003a\u002f\u002f\u0073c\u0068\u0065\u006d\u0061\u0073.\u006d\u0069\u0063\u0072\u006f\u0073\u006f\u0066\u0074\u002e\u0063\u006f\u006d\u002f\u006f\u0066\u0066\u0069\u0063\u0065\u002f\u0077\u006f\u0072\u0064\u002f\u0032\u0030\u0031\u0030\u002f\u0077\u006f\u0072\u0064\u006d\u006c"}); 14 | start .Attr =append (start .Attr ,_d .Attr {Name :_d .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u0078\u006dl"},Value :"\u0068\u0074tp\u003a\u002f\u002fw\u0077\u0077\u002e\u00773.o\u0072g/\u0058\u004d\u004c\u002f\u0031\u0039\u00398/\u006e\u0061\u006d\u0065\u0073\u0070\u0061c\u0065"}); 15 | start .Name .Local ="\u0069s\u0063\u006f\u006d\u006d\u0065\u006et";return _dga .CT_Empty .MarshalXML (e ,start );};func (_dg *CT_Empty )UnmarshalXML (d *_d .Decoder ,start _d .StartElement )error {for {_b ,_e :=d .Token ();if _e !=nil {return _c .Errorf ("p\u0061r\u0073\u0069\u006e\u0067\u0020\u0043\u0054\u005fE\u006d\u0070\u0074\u0079: \u0025\u0073",_e ); 16 | };if _fd ,_ea :=_b .(_d .EndElement );_ea &&_fd .Name ==start .Name {break ;};};return nil ;}; 17 | 18 | // Validate validates the CT_Rel and its children 19 | func (_ef *CT_Rel )Validate ()error {return _ef .ValidateWithPath ("\u0043\u0054\u005f\u0052\u0065\u006c");};func (_gc *Iscomment )UnmarshalXML (d *_d .Decoder ,start _d .StartElement )error {_gc .CT_Empty =*NewCT_Empty ();for {_fe ,_ce :=d .Token ();if _ce !=nil {return _c .Errorf ("p\u0061\u0072\u0073\u0069ng\u0020I\u0073\u0063\u006f\u006d\u006de\u006e\u0074\u003a\u0020\u0025\u0073",_ce ); 20 | };if _fc ,_bd :=_fe .(_d .EndElement );_bd &&_fc .Name ==start .Name {break ;};};return nil ;};func NewCT_Rel ()*CT_Rel {_cd :=&CT_Rel {};return _cd };func NewIscomment ()*Iscomment {_ag :=&Iscomment {};_ag .CT_Empty =*NewCT_Empty ();return _ag }; 21 | 22 | // ValidateWithPath validates the Iscomment and its children, prefixing error messages with path 23 | func (_bg *Iscomment )ValidateWithPath (path string )error {if _cg :=_bg .CT_Empty .ValidateWithPath (path );_cg !=nil {return _cg ;};return nil ;};func (_dd *CT_Rel )MarshalXML (e *_d .Encoder ,start _d .StartElement )error {if _dd .IdAttr !=nil {start .Attr =append (start .Attr ,_d .Attr {Name :_d .Name {Local :"\u0069\u0064"},Value :_c .Sprintf ("\u0025\u0076",*_dd .IdAttr )}); 24 | };e .EncodeToken (start );e .EncodeToken (_d .EndElement {Name :start .Name });return nil ;};func (_fba *Textdata )UnmarshalXML (d *_d .Decoder ,start _d .StartElement )error {_fba .CT_Rel =*NewCT_Rel ();for _ ,_aa :=range start .Attr {if _aa .Name .Local =="\u0069\u0064"{_ca :=_aa .Value ; 25 | _fba .IdAttr =&_ca ;continue ;};};for {_gfa ,_fec :=d .Token ();if _fec !=nil {return _c .Errorf ("p\u0061r\u0073\u0069\u006e\u0067\u0020\u0054\u0065\u0078t\u0064\u0061\u0074\u0061: \u0025\u0073",_fec );};if _eaa ,_aae :=_gfa .(_d .EndElement );_aae &&_eaa .Name ==start .Name {break ; 26 | };};return nil ;};type Iscomment struct{CT_Empty }; 27 | 28 | // Validate validates the Iscomment and its children 29 | func (_bc *Iscomment )Validate ()error {return _bc .ValidateWithPath ("\u0049s\u0063\u006f\u006d\u006d\u0065\u006et");}; 30 | 31 | // ValidateWithPath validates the CT_Empty and its children, prefixing error messages with path 32 | func (_dgg *CT_Empty )ValidateWithPath (path string )error {return nil }; 33 | 34 | // Validate validates the Textdata and its children 35 | func (_ac *Textdata )Validate ()error {return _ac .ValidateWithPath ("\u0054\u0065\u0078\u0074\u0064\u0061\u0074\u0061");};func (_fdg *Textdata )MarshalXML (e *_d .Encoder ,start _d .StartElement )error {start .Attr =append (start .Attr ,_d .Attr {Name :_d .Name {Local :"\u0078\u006d\u006cn\u0073"},Value :"\u0075\u0072\u006e\u003a\u0073\u0063\u0068e\u006d\u0061\u0073-\u006d\u0069\u0063\u0072o\u0073\u006f\u0066\u0074\u002d\u0063\u006f\u006d\u003a\u006f\u0066\u0066\u0069\u0063\u0065\u003a\u0070\u006f\u0077\u0065\u0072\u0070\u006f\u0069\u006e\u0074"}); 36 | start .Attr =append (start .Attr ,_d .Attr {Name :_d .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u0077\u00314"},Value :"\u0068\u0074t\u0070\u003a\u002f\u002f\u0073c\u0068\u0065\u006d\u0061\u0073.\u006d\u0069\u0063\u0072\u006f\u0073\u006f\u0066\u0074\u002e\u0063\u006f\u006d\u002f\u006f\u0066\u0066\u0069\u0063\u0065\u002f\u0077\u006f\u0072\u0064\u002f\u0032\u0030\u0031\u0030\u002f\u0077\u006f\u0072\u0064\u006d\u006c"}); 37 | start .Attr =append (start .Attr ,_d .Attr {Name :_d .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u0078\u006dl"},Value :"\u0068\u0074tp\u003a\u002f\u002fw\u0077\u0077\u002e\u00773.o\u0072g/\u0058\u004d\u004c\u002f\u0031\u0039\u00398/\u006e\u0061\u006d\u0065\u0073\u0070\u0061c\u0065"}); 38 | start .Name .Local ="\u0074\u0065\u0078\u0074\u0064\u0061\u0074\u0061";return _fdg .CT_Rel .MarshalXML (e ,start );};type CT_Rel struct{ 39 | 40 | // Text Reference 41 | IdAttr *string ;}; 42 | 43 | // Validate validates the CT_Empty and its children 44 | func (_ed *CT_Empty )Validate ()error {return _ed .ValidateWithPath ("\u0043\u0054\u005f\u0045\u006d\u0070\u0074\u0079");};type Textdata struct{CT_Rel };type CT_Empty struct{};func (_gb *CT_Empty )MarshalXML (e *_d .Encoder ,start _d .StartElement )error {e .EncodeToken (start ); 45 | e .EncodeToken (_d .EndElement {Name :start .Name });return nil ;};func NewCT_Empty ()*CT_Empty {_f :=&CT_Empty {};return _f };func NewTextdata ()*Textdata {_fb :=&Textdata {};_fb .CT_Rel =*NewCT_Rel ();return _fb };func (_gf *CT_Rel )UnmarshalXML (d *_d .Decoder ,start _d .StartElement )error {for _ ,_a :=range start .Attr {if _a .Name .Local =="\u0069\u0064"{_gd :=_a .Value ; 46 | _gf .IdAttr =&_gd ;continue ;};};for {_fdc ,_af :=d .Token ();if _af !=nil {return _c .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0043T\u005f\u0052e\u006c\u003a\u0020\u0025\u0073",_af );};if _db ,_eb :=_fdc .(_d .EndElement );_eb &&_db .Name ==start .Name {break ; 47 | };};return nil ;}; 48 | 49 | // ValidateWithPath validates the CT_Rel and its children, prefixing error messages with path 50 | func (_df *CT_Rel )ValidateWithPath (path string )error {return nil }; 51 | 52 | // ValidateWithPath validates the Textdata and its children, prefixing error messages with path 53 | func (_ba *Textdata )ValidateWithPath (path string )error {if _fdb :=_ba .CT_Rel .ValidateWithPath (path );_fdb !=nil {return _fdb ;};return nil ;};func init (){_gg .RegisterConstructor ("\u0075\u0072\u006e\u003a\u0073\u0063\u0068e\u006d\u0061\u0073-\u006d\u0069\u0063\u0072o\u0073\u006f\u0066\u0074\u002d\u0063\u006f\u006d\u003a\u006f\u0066\u0066\u0069\u0063\u0065\u003a\u0070\u006f\u0077\u0065\u0072\u0070\u006f\u0069\u006e\u0074","\u0043\u0054\u005f\u0045\u006d\u0070\u0074\u0079",NewCT_Empty ); 54 | _gg .RegisterConstructor ("\u0075\u0072\u006e\u003a\u0073\u0063\u0068e\u006d\u0061\u0073-\u006d\u0069\u0063\u0072o\u0073\u006f\u0066\u0074\u002d\u0063\u006f\u006d\u003a\u006f\u0066\u0066\u0069\u0063\u0065\u003a\u0070\u006f\u0077\u0065\u0072\u0070\u006f\u0069\u006e\u0074","\u0043\u0054\u005f\u0052\u0065\u006c",NewCT_Rel ); 55 | _gg .RegisterConstructor ("\u0075\u0072\u006e\u003a\u0073\u0063\u0068e\u006d\u0061\u0073-\u006d\u0069\u0063\u0072o\u0073\u006f\u0066\u0074\u002d\u0063\u006f\u006d\u003a\u006f\u0066\u0066\u0069\u0063\u0065\u003a\u0070\u006f\u0077\u0065\u0072\u0070\u006f\u0069\u006e\u0074","\u0069s\u0063\u006f\u006d\u006d\u0065\u006et",NewIscomment ); 56 | _gg .RegisterConstructor ("\u0075\u0072\u006e\u003a\u0073\u0063\u0068e\u006d\u0061\u0073-\u006d\u0069\u0063\u0072o\u0073\u006f\u0066\u0074\u002d\u0063\u006f\u006d\u003a\u006f\u0066\u0066\u0069\u0063\u0065\u003a\u0070\u006f\u0077\u0065\u0072\u0070\u006f\u0069\u006e\u0074","\u0074\u0065\u0078\u0074\u0064\u0061\u0074\u0061",NewTextdata ); 57 | }; -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | **unioffice** is a library for creation of Office Open XML documents (.docx, .xlsx 2 | and .pptx). Its goal is to be the most compatible and highest performance Go 3 | library for creation and editing of docx/xlsx/pptx files. 4 | 5 | [![Build Status](https://travis-ci.org/unidoc/unioffice.svg?branch=master)](https://travis-ci.org/unidoc/unioffice) 6 | [![GitHub (pre-)release](https://img.shields.io/github/release/unidoc/unioffice/all.svg)](https://github.com/unidoc/unioffice/releases) 7 | [![License: UniDoc EULA](https://img.shields.io/badge/license-UniDoc%20EULA-blue)](https://unidoc.io/eula/) 8 | [![ApiDocs](https://img.shields.io/badge/godoc-reference-blue.svg)](https://apidocs.unidoc.io/unioffice/latest/) 9 | 10 | 11 | ![https://github.com/unidoc/unioffice/](./.github/preview.png "unioffice") 12 | 13 | ## Status ## 14 | 15 | - Documents (docx) [Word] 16 | - Read/Write/Edit 17 | - Formatting 18 | - Images 19 | - Tables 20 | - Word to PDF (docx to pdf) 21 | - Spreadsheets (xlsx) [Excel] 22 | - Read/Write/Edit 23 | - Cell formatting including conditional formatting 24 | - Cell validation (drop down combobox, rules, etc.) 25 | - Retrieve cell values as formatted by Excel (e.g. retrieve a date or number as displayed in Excel) 26 | - Formula Evaluation (100+ functions supported currently, more will be added as required) 27 | - Embedded Images 28 | - All chart types 29 | - PowerPoint (pptx) [PowerPoint] 30 | - Creation from templates 31 | - Textboxes/shapes 32 | 33 | 34 | ## Performance ## 35 | 36 | There has been a great deal of interest in performance numbers for spreadsheet 37 | creation/reading lately, so here are unioffice numbers for this 38 | [benchmark](https://github.com/unidoc/unioffice-examples/tree/master/spreadsheet/lots-of-rows) 39 | which creates a sheet with 30k rows, each with 100 columns. 40 | 41 | creating 30000 rows * 100 cells took 3.92506863s 42 | saving took 89ns 43 | reading took 9.522383048s 44 | 45 | Creation is fairly fast, saving is very quick due to no reflection usage, and 46 | reading is a bit slower. The downside is that the binary is large (33MB) as it 47 | contains generated structs, serialization and deserialization code for all of 48 | DOCX/XLSX/PPTX. 49 | 50 | ## Installation ## 51 | 52 | go get github.com/unidoc/unioffice/v2 53 | 54 | ## License key 55 | This software package (unioffice) is a commercial product and requires a license code to operate. 56 | 57 | To Get a Metered License API Key in the Free Tier, sign up on https://cloud.unidoc.io 58 | 59 | ## Document Examples ## 60 | 61 | - [Simple Text Formatting](https://github.com/unidoc/unioffice-examples/tree/master/document/simple) Text font colors, sizes, highlighting, etc. 62 | - [Auto Generated Table of Contents](https://github.com/unidoc/unioffice-examples/tree/master/document/toc) Creating document headings with an auto generated TOC based off of the headingds 63 | - [Floating Image](https://github.com/unidoc/unioffice-examples/tree/master/document/image) Placing an image somewhere on a page, absolutely positioned with different text wrapping. 64 | - [Header & Footer](https://github.com/unidoc/unioffice-examples/tree/master/document/header-footer) Creating headers and footers including page numbering. 65 | - [Multiple Headers & Footers](https://github.com/unidoc/unioffice-examples/tree/master/document/header-footer-multiple) Using different headers and footers depending on document section. 66 | - [Inline Tables](https://github.com/unidoc/unioffice-examples/tree/master/document/tables) Adding an table with and without borders. 67 | - [Using Existing Word Document as a Template](https://github.com/unidoc/unioffice-examples/tree/master/document/use-template) Opening a document as a template to re-use the styles created in the document. 68 | - [Filling out Form Fields](https://github.com/unidoc/unioffice-examples/tree/master/document/fill-out-form) Opening a document with embedded form fields, filling out the fields and saving the result as a new filled form. 69 | - [Editing an existing document](https://github.com/unidoc/unioffice-examples/tree/master/document/edit-document) Open an existing document and replace/remove text without modifying formatting. 70 | 71 | ## Spreadsheet Examples ## 72 | - [Simple](https://github.com/unidoc/unioffice-examples/tree/master/spreadsheet/simple) A simple sheet with a few cells 73 | - [Named Cells](https://github.com/unidoc/unioffice-examples/tree/master/spreadsheet/named-cells) Different ways of referencing rows and cells 74 | - [Cell Number/Date/Time Formats](https://github.com/unidoc/unioffice-examples/tree/master/spreadsheet/number-date-time-formats) Creating cells with various number/date/time formats 75 | - [Line Chart](https://github.com/unidoc/unioffice-examples/tree/master/spreadsheet/line-chart)/[Line Chart 3D](https://github.com/unidoc/unioffice-examples/tree/master/spreadsheet/line-chart-3d) Line Charts 76 | - [Bar Chart](https://github.com/unidoc/unioffice-examples/tree/master/spreadsheet/bar-chart) Bar Charts 77 | - [Mutiple Charts](https://github.com/unidoc/unioffice-examples/tree/master/spreadsheet/multiple-charts) Multiple charts on a single sheet 78 | - [Named Cell Ranges](https://github.com/unidoc/unioffice-examples/tree/master/spreadsheet/named-ranges) Naming cell ranges 79 | - [Merged Cells](https://github.com/unidoc/unioffice-examples/tree/master/spreadsheet/merged) Merge and unmerge cells 80 | - [Conditional Formatting](https://github.com/unidoc/unioffice-examples/tree/master/spreadsheet/conditional-formatting) Conditionally formatting cells, styling, gradients, icons, data bar 81 | - [Complex](https://github.com/unidoc/unioffice-examples/tree/master/spreadsheet/complex) Multiple charts, auto filtering and conditional formatting 82 | - [Borders](https://github.com/unidoc/unioffice-examples/tree/master/spreadsheet/borders) Individual cell borders and rectangular borders around a range of cells. 83 | - [Validation](https://github.com/unidoc/unioffice-examples/tree/master/spreadsheet/validation) Data validation including combo box dropdowns. 84 | - [Frozen Rows/Cols](https://github.com/unidoc/unioffice-examples/tree/master/spreadsheet/freeze-rows-cols) A sheet with a frozen header column and row 85 | 86 | ## Presentation Examples ## 87 | 88 | - [Simple Text Boxes](https://github.com/unidoc/unioffice-examples/tree/master/presentation/simple) Simple text boxes and shapes 89 | - [Images](https://github.com/unidoc/unioffice-examples/tree/master/presentation/image) Simple image insertion 90 | - [Template](https://github.com/unidoc/unioffice-examples/tree/master/presentation/use-template/simple) Creating a presentation from a template 91 | 92 | ## Raw Types ## 93 | 94 | The OOXML specification is large and creating a friendly API to cover the entire 95 | specification is a very time consuming endeavor. This library attempts to 96 | provide an easy to use API for common use cases in creating OOXML documents 97 | while allowing users to fall back to raw document manipulation should the 98 | library's API not cover a specific use case. 99 | 100 | The raw XML based types reside in the ```schema/``` directory. These types are 101 | accessible from the wrapper types via a ```X()``` method that returns the raw 102 | type. 103 | 104 | For example, the library currently doesn't have an API for setting a document 105 | background color. However it's easy to do manually via editing the 106 | ```CT_Background``` element of the document. 107 | 108 | doc := document.New() 109 | doc.X().Background = wordprocessingml.NewCT_Background() 110 | doc.X().Background.ColorAttr = &wordprocessingml.ST_HexColor{} 111 | doc.X().Background.ColorAttr.ST_HexColorRGB = color.RGB(50, 50, 50).AsRGBString() 112 | 113 | ## Contribution guidelines ### 114 | 115 | If you are interested in contributing, please contact us. 116 | 117 | ## Development Notes 118 | 119 | The bash script file `run_test.sh` could be used to run test and update the test result (if required). This script could receive the following parameter: 120 | - `-s`: Save a baseline, updates all the test result. 121 | - `-v`: Run the test in verbose mode. 122 | - `t` or `--testname` [test name]: Run a specific test name. For example `-t AddImage` would be running a `TestAddImage` test. 123 | 124 | To run the script in dockerized environment, use the provided `Makefile` such as: 125 | 126 | ```bash 127 | make docker-test 128 | ``` 129 | or 130 | 131 | ```bash 132 | make docker-update-testdata 133 | ``` 134 | 135 | ## Go Version Compatibility 136 | 137 | Officially we support three latest Go versions. 138 | 139 | ## Support and consulting ## 140 | 141 | Please email us at support@unidoc.io for any queries. 142 | 143 | If you have any specific tasks that need to be done, we offer consulting in certain cases. 144 | Please contact us with a brief summary of what you need and we will get back to you with a quote, if appropriate. 145 | 146 | ## License agreement ## 147 | 148 | The use of this software package is governed by the end-user license agreement 149 | (EULA) available at: https://unidoc.io/eula/ 150 | 151 | -------------------------------------------------------------------------------- /drawing/drawing.go: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2020 FoxyUtils ehf. All rights reserved. 3 | // 4 | // This is a commercial product and requires a license to operate. 5 | // A trial license can be obtained at https://unidoc.io 6 | // 7 | // DO NOT EDIT: generated by unitwist Go source code obfuscator. 8 | // 9 | // Use of this source code is governed by the UniDoc End User License Agreement 10 | // terms that can be accessed at https://unidoc.io/eula/ 11 | 12 | package drawing ;import (_f "github.com/unidoc/unioffice/v2";_a "github.com/unidoc/unioffice/v2/color";_e "github.com/unidoc/unioffice/v2/measurement";_d "github.com/unidoc/unioffice/v2/schema/soo/dml";); 13 | 14 | // X returns the inner wrapped XML type. 15 | func (_ef LineProperties )X ()*_d .CT_LineProperties {return _ef ._ca }; 16 | 17 | // SetSolidFill controls the text color of a run. 18 | func (_bgf RunProperties )SetSolidFill (c _a .Color ){_bgf ._ebec .FillPropertiesChoice =_d .NewEG_FillPropertiesChoice ();_bgf ._ebec .FillPropertiesChoice .SolidFill =_d .NewCT_SolidColorFillProperties ();_bgf ._ebec .FillPropertiesChoice .SolidFill .SrgbClr =_d .NewCT_SRgbColor (); 19 | _bgf ._ebec .FillPropertiesChoice .SolidFill .SrgbClr .ValAttr =*c .AsRGBString ();}; 20 | 21 | // X returns the inner wrapped XML type. 22 | func (_fce ShapeProperties )X ()*_d .CT_ShapeProperties {return _fce ._da }; 23 | 24 | // SetNumbered controls if bullets are numbered or not. 25 | func (_bg ParagraphProperties )SetNumbered (scheme _d .ST_TextAutonumberScheme ){if scheme ==_d .ST_TextAutonumberSchemeUnset {_bg ._g .TextBulletChoice .BuAutoNum =nil ;}else {_bg ._g .TextBulletChoice .BuAutoNum =_d .NewCT_TextAutonumberBullet ();_bg ._g .TextBulletChoice .BuAutoNum .TypeAttr =scheme ; 26 | };}; 27 | 28 | // LineJoin is the type of line join 29 | type LineJoin byte ; 30 | 31 | // Properties returns the paragraph properties. 32 | func (_fe Paragraph )Properties ()ParagraphProperties {if _fe ._ed .PPr ==nil {_fe ._ed .PPr =_d .NewCT_TextParagraphProperties ();};return MakeParagraphProperties (_fe ._ed .PPr );}; 33 | 34 | // SetJoin sets the line join style. 35 | func (_ff LineProperties )SetJoin (e LineJoin ){_ff ._ca .LineJoinPropertiesChoice =_d .NewEG_LineJoinPropertiesChoice ();switch e {case LineJoinRound :_ff ._ca .LineJoinPropertiesChoice .Round =_d .NewCT_LineJoinRound ();case LineJoinBevel :_ff ._ca .LineJoinPropertiesChoice .Bevel =_d .NewCT_LineJoinBevel (); 36 | case LineJoinMiter :_ff ._ca .LineJoinPropertiesChoice .Miter =_d .NewCT_LineJoinMiterProperties ();};};func (_eb LineProperties )SetNoFill (){_eb .clearFill ();_eb ._ca .LineFillPropertiesChoice .NoFill =_d .NewCT_NoFillProperties ();}; 37 | 38 | // SetHeight sets the height of the shape. 39 | func (_ee ShapeProperties )SetHeight (h _e .Distance ){_ee .ensureXfrm ();if _ee ._da .Xfrm .Ext ==nil {_ee ._da .Xfrm .Ext =_d .NewCT_PositiveSize2D ();};_ee ._da .Xfrm .Ext .CyAttr =int64 (h /_e .EMU );}; 40 | 41 | // MakeRunProperties constructs a new RunProperties wrapper. 42 | func MakeRunProperties (x *_d .CT_TextCharacterProperties )RunProperties {return RunProperties {x }}; 43 | 44 | // SetWidth sets the line width, MS products treat zero as the minimum width 45 | // that can be displayed. 46 | func (_db LineProperties )SetWidth (w _e .Distance ){_db ._ca .WAttr =_f .Int32 (int32 (w /_e .EMU ))}; 47 | 48 | // SetPosition sets the position of the shape. 49 | func (_cf ShapeProperties )SetPosition (x ,y _e .Distance ){_cf .ensureXfrm ();if _cf ._da .Xfrm .Off ==nil {_cf ._da .Xfrm .Off =_d .NewCT_Point2D ();};_cf ._da .Xfrm .Off .XAttr .ST_CoordinateUnqualified =_f .Int64 (int64 (x /_e .EMU ));_cf ._da .Xfrm .Off .YAttr .ST_CoordinateUnqualified =_f .Int64 (int64 (y /_e .EMU )); 50 | }; 51 | 52 | // SetFont controls the font of a run. 53 | func (_gdb RunProperties )SetFont (s string ){_gdb ._ebec .Latin =_d .NewCT_TextFont ();_gdb ._ebec .Latin .TypefaceAttr =s ;};func (_cg LineProperties )clearFill (){_cg ._ca .LineFillPropertiesChoice =_d .NewEG_LineFillPropertiesChoice ();}; 54 | 55 | // SetFlipVertical controls if the shape is flipped vertically. 56 | func (_gc ShapeProperties )SetFlipVertical (b bool ){_gc .ensureXfrm ();if !b {_gc ._da .Xfrm .FlipVAttr =nil ;}else {_gc ._da .Xfrm .FlipVAttr =_f .Bool (true );};}; 57 | 58 | // Run is a run within a paragraph. 59 | type Run struct{_ebe *_d .EG_TextRun };func (_gfd ShapeProperties )SetNoFill (){_gfd .clearFill ();_gfd ._da .FillPropertiesChoice .NoFill =_d .NewCT_NoFillProperties ();}; 60 | 61 | // X returns the inner wrapped XML type. 62 | func (_ge ParagraphProperties )X ()*_d .CT_TextParagraphProperties {return _ge ._g }; 63 | 64 | // X returns the inner wrapped XML type. 65 | func (_fc Run )X ()*_d .EG_TextRun {return _fc ._ebe };type ShapeProperties struct{_da *_d .CT_ShapeProperties }; 66 | 67 | // MakeParagraph constructs a new paragraph wrapper. 68 | func MakeParagraph (x *_d .CT_TextParagraph )Paragraph {return Paragraph {x }}; 69 | 70 | // ParagraphProperties allows controlling paragraph properties. 71 | type ParagraphProperties struct{_g *_d .CT_TextParagraphProperties ;}; 72 | 73 | // Properties returns the run's properties. 74 | func (_gf Run )Properties ()RunProperties {if _gf ._ebe .TextRunChoice .R ==nil {_gf ._ebe .TextRunChoice .R =_d .NewCT_RegularTextRun ();};if _gf ._ebe .TextRunChoice .R .RPr ==nil {_gf ._ebe .TextRunChoice .R .RPr =_d .NewCT_TextCharacterProperties (); 75 | };return RunProperties {_gf ._ebe .TextRunChoice .R .RPr };}; 76 | 77 | // SetBulletFont controls the font for the bullet character. 78 | func (_gd ParagraphProperties )SetBulletFont (f string ){if f ==""{_gd ._g .TextBulletTypefaceChoice .BuFont =nil ;}else {_gd ._g .TextBulletTypefaceChoice .BuFont =_d .NewCT_TextFont ();_gd ._g .TextBulletTypefaceChoice .BuFont .TypefaceAttr =f ;};};func (_bf ShapeProperties )clearFill (){_bf ._da .FillPropertiesChoice =_d .NewEG_FillPropertiesChoice (); 79 | }; 80 | 81 | // AddRun adds a new run to a paragraph. 82 | func (_ffe Paragraph )AddRun ()Run {_ce :=MakeRun (_d .NewEG_TextRun ());_ffe ._ed .EG_TextRun =append (_ffe ._ed .EG_TextRun ,_ce .X ());return _ce ;};func (_dba ShapeProperties )ensureXfrm (){if _dba ._da .Xfrm ==nil {_dba ._da .Xfrm =_d .NewCT_Transform2D (); 83 | };}; 84 | 85 | // GetPosition gets the position of the shape in EMU. 86 | func (_ba ShapeProperties )GetPosition ()(int64 ,int64 ){_ba .ensureXfrm ();if _ba ._da .Xfrm .Off ==nil {_ba ._da .Xfrm .Off =_d .NewCT_Point2D ();};return *_ba ._da .Xfrm .Off .XAttr .ST_CoordinateUnqualified ,*_ba ._da .Xfrm .Off .YAttr .ST_CoordinateUnqualified ; 87 | }; 88 | 89 | // SetBold controls the bolding of a run. 90 | func (_cac RunProperties )SetBold (b bool ){_cac ._ebec .BAttr =_f .Bool (b )}; 91 | 92 | // AddBreak adds a new line break to a paragraph. 93 | func (_ea Paragraph )AddBreak (){_b :=_d .NewEG_TextRun ();_b .TextRunChoice .Br =_d .NewCT_TextLineBreak ();_ea ._ed .EG_TextRun =append (_ea ._ed .EG_TextRun ,_b );}; 94 | 95 | // SetFlipHorizontal controls if the shape is flipped horizontally. 96 | func (_bfe ShapeProperties )SetFlipHorizontal (b bool ){_bfe .ensureXfrm ();if !b {_bfe ._da .Xfrm .FlipHAttr =nil ;}else {_bfe ._da .Xfrm .FlipHAttr =_f .Bool (true );};};func (_eaa ShapeProperties )LineProperties ()LineProperties {if _eaa ._da .Ln ==nil {_eaa ._da .Ln =_d .NewCT_LineProperties (); 97 | };return LineProperties {_eaa ._da .Ln };};func (_ad ShapeProperties )SetSolidFill (c _a .Color ){_ad .clearFill ();_ad ._da .FillPropertiesChoice .SolidFill =_d .NewCT_SolidColorFillProperties ();_ad ._da .FillPropertiesChoice .SolidFill .SrgbClr =_d .NewCT_SRgbColor (); 98 | _ad ._da .FillPropertiesChoice .SolidFill .SrgbClr .ValAttr =*c .AsRGBString ();};const (LineJoinRound LineJoin =iota ;LineJoinBevel ;LineJoinMiter ;); 99 | 100 | // SetGeometry sets the shape type of the shape 101 | func (_ae ShapeProperties )SetGeometry (g _d .ST_ShapeType ){if _ae ._da .GeometryChoice .PrstGeom ==nil {_ae ._da .GeometryChoice .PrstGeom =_d .NewCT_PresetGeometry2D ();};_ae ._da .GeometryChoice .PrstGeom .PrstAttr =g ;};func (_df LineProperties )SetSolidFill (c _a .Color ){_df .clearFill (); 102 | _df ._ca .LineFillPropertiesChoice .SolidFill =_d .NewCT_SolidColorFillProperties ();_df ._ca .LineFillPropertiesChoice .SolidFill .SrgbClr =_d .NewCT_SRgbColor ();_df ._ca .LineFillPropertiesChoice .SolidFill .SrgbClr .ValAttr =*c .AsRGBString ();}; 103 | 104 | // MakeRun constructs a new Run wrapper. 105 | func MakeRun (x *_d .EG_TextRun )Run {return Run {x }}; 106 | 107 | // SetText sets the run's text contents. 108 | func (_dfd Run )SetText (s string ){_dfd ._ebe .TextRunChoice .Br =nil ;_dfd ._ebe .TextRunChoice .Fld =nil ;if _dfd ._ebe .TextRunChoice .R ==nil {_dfd ._ebe .TextRunChoice .R =_d .NewCT_RegularTextRun ();};_dfd ._ebe .TextRunChoice .R .T =s ;}; 109 | 110 | // SetWidth sets the width of the shape. 111 | func (_bb ShapeProperties )SetWidth (w _e .Distance ){_bb .ensureXfrm ();if _bb ._da .Xfrm .Ext ==nil {_bb ._da .Xfrm .Ext =_d .NewCT_PositiveSize2D ();};_bb ._da .Xfrm .Ext .CxAttr =int64 (w /_e .EMU );}; 112 | 113 | // SetSize sets the font size of the run text 114 | func (_dd RunProperties )SetSize (sz _e .Distance ){_dd ._ebec .SzAttr =_f .Int32 (int32 (sz /_e .HundredthPoint ));}; 115 | 116 | // SetLevel sets the level of indentation of a paragraph. 117 | func (_af ParagraphProperties )SetLevel (idx int32 ){_af ._g .LvlAttr =_f .Int32 (idx )}; 118 | 119 | // SetAlign controls the paragraph alignment 120 | func (_aa ParagraphProperties )SetAlign (a _d .ST_TextAlignType ){_aa ._g .AlgnAttr =a }; 121 | 122 | // MakeParagraphProperties constructs a new ParagraphProperties wrapper. 123 | func MakeParagraphProperties (x *_d .CT_TextParagraphProperties )ParagraphProperties {return ParagraphProperties {x };}; 124 | 125 | // X returns the inner wrapped XML type. 126 | func (_edd Paragraph )X ()*_d .CT_TextParagraph {return _edd ._ed }; 127 | 128 | // Paragraph is a paragraph within a document. 129 | type Paragraph struct{_ed *_d .CT_TextParagraph };func MakeShapeProperties (x *_d .CT_ShapeProperties )ShapeProperties {return ShapeProperties {x }}; 130 | 131 | // RunProperties controls the run properties. 132 | type RunProperties struct{_ebec *_d .CT_TextCharacterProperties ;}; 133 | 134 | // SetSize sets the width and height of the shape. 135 | func (_ab ShapeProperties )SetSize (w ,h _e .Distance ){_ab .SetWidth (w );_ab .SetHeight (h )};type LineProperties struct{_ca *_d .CT_LineProperties }; 136 | 137 | // SetBulletChar sets the bullet character for the paragraph. 138 | func (_bc ParagraphProperties )SetBulletChar (c string ){if c ==""{_bc ._g .TextBulletChoice .BuChar =nil ;}else {_bc ._g .TextBulletChoice .BuChar =_d .NewCT_TextCharBullet ();_bc ._g .TextBulletChoice .BuChar .CharAttr =c ;};}; -------------------------------------------------------------------------------- /schema/soo/schemaLibrary/schemaLibrary.go: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2020 FoxyUtils ehf. All rights reserved. 3 | // 4 | // This is a commercial product and requires a license to operate. 5 | // A trial license can be obtained at https://unidoc.io 6 | // 7 | // DO NOT EDIT: generated by unitwist Go source code obfuscator. 8 | // 9 | // Use of this source code is governed by the UniDoc End User License Agreement 10 | // terms that can be accessed at https://unidoc.io/eula/ 11 | 12 | package schemaLibrary ;import (_e "encoding/xml";_f "fmt";_d "github.com/unidoc/unioffice/v2";_fd "github.com/unidoc/unioffice/v2/common/logger";); 13 | 14 | // Validate validates the SchemaLibrary and its children 15 | func (_cb *SchemaLibrary )Validate ()error {return _cb .ValidateWithPath ("\u0053\u0063\u0068\u0065\u006d\u0061\u004c\u0069\u0062\u0072\u0061\u0072\u0079");};type CT_Schema struct{ 16 | 17 | // Custom XML Schema Namespace 18 | UriAttr *string ; 19 | 20 | // Supplementary XML File Location 21 | ManifestLocationAttr *string ; 22 | 23 | // Custom XML Schema Location 24 | SchemaLocationAttr *string ; 25 | 26 | // Schema Language 27 | SchemaLanguageAttr *string ;}; 28 | 29 | // Validate validates the CT_Schema and its children 30 | func (_ac *CT_Schema )Validate ()error {return _ac .ValidateWithPath ("\u0043T\u005f\u0053\u0063\u0068\u0065\u006da");};func NewSchemaLibrary ()*SchemaLibrary {_gfg :=&SchemaLibrary {};_gfg .CT_SchemaLibrary =*NewCT_SchemaLibrary ();return _gfg ;}; 31 | 32 | // ValidateWithPath validates the CT_SchemaLibrary and its children, prefixing error messages with path 33 | func (_bf *CT_SchemaLibrary )ValidateWithPath (path string )error {for _agc ,_bg :=range _bf .Schema {if _ab :=_bg .ValidateWithPath (_f .Sprintf ("\u0025\u0073\u002f\u0053\u0063\u0068\u0065\u006d\u0061\u005b\u0025\u0064\u005d",path ,_agc ));_ab !=nil {return _ab ; 34 | };};return nil ;};func NewCT_SchemaLibrary ()*CT_SchemaLibrary {_cab :=&CT_SchemaLibrary {};return _cab }; 35 | 36 | // ValidateWithPath validates the CT_Schema and its children, prefixing error messages with path 37 | func (_bc *CT_Schema )ValidateWithPath (path string )error {return nil };type CT_SchemaLibrary struct{ 38 | 39 | // Custom XML Schema Reference 40 | Schema []*CT_Schema ;};func (_gf *CT_SchemaLibrary )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {_ec :for {_bb ,_ae :=d .Token ();if _ae !=nil {return _ae ;};switch _acg :=_bb .(type ){case _e .StartElement :switch _acg .Name {case _e .Name {Space :"\u0068\u0074\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067/\u0073\u0063\u0068\u0065\u006da\u004c\u0069\u0062\u0072\u0061\u0072\u0079\u002f\u0032\u0030\u0030\u0036\u002f\u006d\u0061\u0069\u006e",Local :"\u0073\u0063\u0068\u0065\u006d\u0061"}:_af :=NewCT_Schema (); 41 | if _dd :=d .DecodeElement (_af ,&_acg );_dd !=nil {return _dd ;};_gf .Schema =append (_gf .Schema ,_af );default:_fd .Log .Debug ("\u0073\u006b\u0069\u0070\u0070i\u006e\u0067\u0020\u0075\u006e\u0073\u0075\u0070\u0070\u006f\u0072\u0074\u0065d\u0020\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0020\u006f\u006e\u0020\u0043\u0054\u005f\u0053\u0063\u0068\u0065\u006d\u0061\u004c\u0069\u0062\u0072\u0061\u0072\u0079\u0020\u0025v",_acg .Name ); 42 | if _acb :=d .Skip ();_acb !=nil {return _acb ;};};case _e .EndElement :break _ec ;case _e .CharData :};};return nil ;};type SchemaLibrary struct{CT_SchemaLibrary };func (_abc *SchemaLibrary )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {_abc .CT_SchemaLibrary =*NewCT_SchemaLibrary (); 43 | _gg :for {_ace ,_cf :=d .Token ();if _cf !=nil {return _cf ;};switch _gd :=_ace .(type ){case _e .StartElement :switch _gd .Name {case _e .Name {Space :"\u0068\u0074\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067/\u0073\u0063\u0068\u0065\u006da\u004c\u0069\u0062\u0072\u0061\u0072\u0079\u002f\u0032\u0030\u0030\u0036\u002f\u006d\u0061\u0069\u006e",Local :"\u0073\u0063\u0068\u0065\u006d\u0061"}:_aed :=NewCT_Schema (); 44 | if _def :=d .DecodeElement (_aed ,&_gd );_def !=nil {return _def ;};_abc .Schema =append (_abc .Schema ,_aed );default:_fd .Log .Debug ("\u0073\u006b\u0069\u0070\u0070\u0069\u006e\u0067 \u0075\u006e\u0073up\u0070\u006f\u0072\u0074\u0065\u0064 \u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0020\u006f\u006e\u0020\u0053\u0063\u0068\u0065m\u0061\u004c\u0069\u0062\u0072\u0061\u0072\u0079 \u0025\u0076",_gd .Name ); 45 | if _dcf :=d .Skip ();_dcf !=nil {return _dcf ;};};case _e .EndElement :break _gg ;case _e .CharData :};};return nil ;};func NewCT_Schema ()*CT_Schema {_da :=&CT_Schema {};return _da };func (_gb *CT_Schema )MarshalXML (e *_e .Encoder ,start _e .StartElement )error {if _gb .UriAttr !=nil {start .Attr =append (start .Attr ,_e .Attr {Name :_e .Name {Local :"\u006d\u0061\u003a\u0075\u0072\u0069"},Value :_f .Sprintf ("\u0025\u0076",*_gb .UriAttr )}); 46 | };if _gb .ManifestLocationAttr !=nil {start .Attr =append (start .Attr ,_e .Attr {Name :_e .Name {Local :"\u006d\u0061\u003a\u006dan\u0069\u0066\u0065\u0073\u0074\u004c\u006f\u0063\u0061\u0074\u0069\u006f\u006e"},Value :_f .Sprintf ("\u0025\u0076",*_gb .ManifestLocationAttr )}); 47 | };if _gb .SchemaLocationAttr !=nil {start .Attr =append (start .Attr ,_e .Attr {Name :_e .Name {Local :"\u006d\u0061\u003a\u0073\u0063\u0068\u0065\u006d\u0061\u004c\u006f\u0063a\u0074\u0069\u006f\u006e"},Value :_f .Sprintf ("\u0025\u0076",*_gb .SchemaLocationAttr )}); 48 | };if _gb .SchemaLanguageAttr !=nil {start .Attr =append (start .Attr ,_e .Attr {Name :_e .Name {Local :"\u006d\u0061\u003a\u0073\u0063\u0068\u0065\u006d\u0061\u004c\u0061\u006eg\u0075\u0061\u0067\u0065"},Value :_f .Sprintf ("\u0025\u0076",*_gb .SchemaLanguageAttr )}); 49 | };e .EncodeToken (start );e .EncodeToken (_e .EndElement {Name :start .Name });return nil ;};func (_cg *SchemaLibrary )MarshalXML (e *_e .Encoder ,start _e .StartElement )error {start .Attr =append (start .Attr ,_e .Attr {Name :_e .Name {Local :"\u0078\u006d\u006cn\u0073"},Value :"\u0068\u0074\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067/\u0073\u0063\u0068\u0065\u006da\u004c\u0069\u0062\u0072\u0061\u0072\u0079\u002f\u0032\u0030\u0030\u0036\u002f\u006d\u0061\u0069\u006e"}); 50 | start .Attr =append (start .Attr ,_e .Attr {Name :_e .Name {Local :"\u0078\u006d\u006c\u006e\u0073\u003a\u006d\u0061"},Value :"\u0068\u0074\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067/\u0073\u0063\u0068\u0065\u006da\u004c\u0069\u0062\u0072\u0061\u0072\u0079\u002f\u0032\u0030\u0030\u0036\u002f\u006d\u0061\u0069\u006e"}); 51 | start .Attr =append (start .Attr ,_e .Attr {Name :_e .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u0077\u00314"},Value :"\u0068\u0074t\u0070\u003a\u002f\u002f\u0073c\u0068\u0065\u006d\u0061\u0073.\u006d\u0069\u0063\u0072\u006f\u0073\u006f\u0066\u0074\u002e\u0063\u006f\u006d\u002f\u006f\u0066\u0066\u0069\u0063\u0065\u002f\u0077\u006f\u0072\u0064\u002f\u0032\u0030\u0031\u0030\u002f\u0077\u006f\u0072\u0064\u006d\u006c"}); 52 | start .Attr =append (start .Attr ,_e .Attr {Name :_e .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u0078\u006dl"},Value :"\u0068\u0074tp\u003a\u002f\u002fw\u0077\u0077\u002e\u00773.o\u0072g/\u0058\u004d\u004c\u002f\u0031\u0039\u00398/\u006e\u0061\u006d\u0065\u0073\u0070\u0061c\u0065"}); 53 | start .Name .Local ="\u006d\u0061:\u0073\u0063\u0068e\u006d\u0061\u004c\u0069\u0062\u0072\u0061\u0072\u0079";return _cg .CT_SchemaLibrary .MarshalXML (e ,start );}; 54 | 55 | // Validate validates the CT_SchemaLibrary and its children 56 | func (_dea *CT_SchemaLibrary )Validate ()error {return _dea .ValidateWithPath ("\u0043\u0054_\u0053\u0063\u0068e\u006d\u0061\u004c\u0069\u0062\u0072\u0061\u0072\u0079");}; 57 | 58 | // ValidateWithPath validates the SchemaLibrary and its children, prefixing error messages with path 59 | func (_abb *SchemaLibrary )ValidateWithPath (path string )error {if _eae :=_abb .CT_SchemaLibrary .ValidateWithPath (path );_eae !=nil {return _eae ;};return nil ;};func (_cd *CT_SchemaLibrary )MarshalXML (e *_e .Encoder ,start _e .StartElement )error {e .EncodeToken (start ); 60 | if _cd .Schema !=nil {_fb :=_e .StartElement {Name :_e .Name {Local :"\u006da\u003a\u0073\u0063\u0068\u0065\u006da"}};for _ ,_age :=range _cd .Schema {e .EncodeElement (_age ,_fb );};};e .EncodeToken (_e .EndElement {Name :start .Name });return nil ;}; 61 | func (_c *CT_Schema )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {for _ ,_ea :=range start .Attr {if _ea .Name .Local =="\u0075\u0072\u0069"{_a :=_ea .Value ;_c .UriAttr =&_a ;continue ;};if _ea .Name .Local =="\u006d\u0061n\u0069\u0066\u0065s\u0074\u004c\u006f\u0063\u0061\u0074\u0069\u006f\u006e"{_ag :=_ea .Value ; 62 | _c .ManifestLocationAttr =&_ag ;continue ;};if _ea .Name .Local =="\u0073\u0063\u0068\u0065\u006d\u0061\u004c\u006f\u0063a\u0074\u0069\u006f\u006e"{_de :=_ea .Value ;_c .SchemaLocationAttr =&_de ;continue ;};if _ea .Name .Local =="\u0073\u0063\u0068\u0065\u006d\u0061\u004c\u0061\u006eg\u0075\u0061\u0067\u0065"{_daeg :=_ea .Value ; 63 | _c .SchemaLanguageAttr =&_daeg ;continue ;};};for {_agf ,_dc :=d .Token ();if _dc !=nil {return _f .Errorf ("p\u0061\u0072\u0073\u0069ng\u0020C\u0054\u005f\u0053\u0063\u0068e\u006d\u0061\u003a\u0020\u0025\u0073",_dc );};if _b ,_ca :=_agf .(_e .EndElement ); 64 | _ca &&_b .Name ==start .Name {break ;};};return nil ;};func init (){_d .RegisterConstructor ("\u0068\u0074\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067/\u0073\u0063\u0068\u0065\u006da\u004c\u0069\u0062\u0072\u0061\u0072\u0079\u002f\u0032\u0030\u0030\u0036\u002f\u006d\u0061\u0069\u006e","\u0043T\u005f\u0053\u0063\u0068\u0065\u006da",NewCT_Schema ); 65 | _d .RegisterConstructor ("\u0068\u0074\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067/\u0073\u0063\u0068\u0065\u006da\u004c\u0069\u0062\u0072\u0061\u0072\u0079\u002f\u0032\u0030\u0030\u0036\u002f\u006d\u0061\u0069\u006e","\u0043\u0054_\u0053\u0063\u0068e\u006d\u0061\u004c\u0069\u0062\u0072\u0061\u0072\u0079",NewCT_SchemaLibrary ); 66 | _d .RegisterConstructor ("\u0068\u0074\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067/\u0073\u0063\u0068\u0065\u006da\u004c\u0069\u0062\u0072\u0061\u0072\u0079\u002f\u0032\u0030\u0030\u0036\u002f\u006d\u0061\u0069\u006e","\u0073\u0063\u0068\u0065\u006d\u0061\u004c\u0069\u0062\u0072\u0061\u0072\u0079",NewSchemaLibrary ); 67 | }; -------------------------------------------------------------------------------- /schema/schemas.microsoft.com/office/word/2016/wordml/cid/cid.go: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2020 FoxyUtils ehf. All rights reserved. 3 | // 4 | // This is a commercial product and requires a license to operate. 5 | // A trial license can be obtained at https://unidoc.io 6 | // 7 | // DO NOT EDIT: generated by unitwist Go source code obfuscator. 8 | // 9 | // Use of this source code is governed by the UniDoc End User License Agreement 10 | // terms that can be accessed at https://unidoc.io/eula/ 11 | 12 | package cid ;import (_b "encoding/xml";_fc "fmt";_ed "github.com/unidoc/unioffice/v2";_e "github.com/unidoc/unioffice/v2/common/logger";_f "strconv";);func NewCT_CommentId ()*CT_CommentId {_bb :=&CT_CommentId {};return _bb };func (_ceca *CommentsIds )UnmarshalXML (d *_b .Decoder ,start _b .StartElement )error {_ceca .CT_CommentsIds =*NewCT_CommentsIds (); 13 | _dab :for {_de ,_bae :=d .Token ();if _bae !=nil {return _bae ;};switch _bd :=_de .(type ){case _b .StartElement :switch _bd .Name {case _b .Name {Space :"\u0068\u0074\u0074\u0070\u003a\u002f/\u0073\u0063\u0068e\u006d\u0061\u0073.\u006d\u0069\u0063\u0072\u006f\u0073\u006f\u0066\u0074\u002ec\u006f\u006d\u002f\u006f\u0066fi\u0063\u0065\u002f\u0077\u006f\u0072\u0064\u002f\u0032\u0030\u0031\u0036\u002f\u0077\u006f\u0072\u0064\u006d\u006c\u002f\u0063\u0069\u0064",Local :"\u0063o\u006d\u006d\u0065\u006e\u0074\u0049d"}:_dbb :=NewCT_CommentId (); 14 | if _fac :=d .DecodeElement (_dbb ,&_bd );_fac !=nil {return _fac ;};_ceca .CommentId =append (_ceca .CommentId ,_dbb );default:_e .Log .Debug ("\u0073\u006bi\u0070\u0070\u0069\u006e\u0067\u0020\u0075\u006e\u0073\u0075\u0070\u0070\u006f\u0072\u0074\u0065\u0064\u0020\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0020\u006f\u006e\u0020\u0043\u006f\u006d\u006d\u0065\u006e\u0074\u0073\u0049\u0064\u0073\u0020\u0025\u0076",_bd .Name ); 15 | if _dg :=d .Skip ();_dg !=nil {return _dg ;};};case _b .EndElement :break _dab ;case _b .CharData :};};return nil ;}; 16 | 17 | // Validate validates the DecimaldurableId and its children 18 | func (_bg *DecimaldurableId )Validate ()error {return _bg .ValidateWithPath ("\u0044\u0065c\u0069\u006d\u0061l\u0064\u0075\u0072\u0061\u0062\u006c\u0065\u0049\u0064");};type DecimaldurableId struct{DurableIdAttr *int64 ;};func (_ged *DecimaldurableId )UnmarshalXML (d *_b .Decoder ,start _b .StartElement )error {for _ ,_eb :=range start .Attr {if _eb .Name .Local =="\u0064u\u0072\u0061\u0062\u006c\u0065\u0049d"{_cb ,_cg :=_f .ParseInt (_eb .Value ,10,64); 19 | if _cg !=nil {return _cg ;};_ged .DurableIdAttr =&_cb ;continue ;};};for {_ac ,_dabf :=d .Token ();if _dabf !=nil {return _fc .Errorf ("\u0070\u0061\u0072\u0073i\u006e\u0067\u0020\u0044\u0065\u0063\u0069\u006d\u0061\u006cd\u0075r\u0061\u0062\u006c\u0065\u0049\u0064\u003a \u0025\u0073",_dabf ); 20 | };if _ec ,_cbb :=_ac .(_b .EndElement );_cbb &&_ec .Name ==start .Name {break ;};};return nil ;};type CT_CommentId struct{ParaIdAttr string ;DurableIdAttr string ;};type CommentsIds struct{CT_CommentsIds }; 21 | 22 | // ValidateWithPath validates the CT_CommentId and its children, prefixing error messages with path 23 | func (_ga *CT_CommentId )ValidateWithPath (path string )error {return nil }; 24 | 25 | // Validate validates the CommentsIds and its children 26 | func (_cea *CommentsIds )Validate ()error {return _cea .ValidateWithPath ("C\u006f\u006d\u006d\u0065\u006e\u0074\u0073\u0049\u0064\u0073");};func (_fb *CT_CommentsIds )UnmarshalXML (d *_b .Decoder ,start _b .StartElement )error {_bbg :for {_ccc ,_db :=d .Token (); 27 | if _db !=nil {return _db ;};switch _dbc :=_ccc .(type ){case _b .StartElement :switch _dbc .Name {case _b .Name {Space :"\u0068\u0074\u0074\u0070\u003a\u002f/\u0073\u0063\u0068e\u006d\u0061\u0073.\u006d\u0069\u0063\u0072\u006f\u0073\u006f\u0066\u0074\u002ec\u006f\u006d\u002f\u006f\u0066fi\u0063\u0065\u002f\u0077\u006f\u0072\u0064\u002f\u0032\u0030\u0031\u0036\u002f\u0077\u006f\u0072\u0064\u006d\u006c\u002f\u0063\u0069\u0064",Local :"\u0063o\u006d\u006d\u0065\u006e\u0074\u0049d"}:_fcf :=NewCT_CommentId (); 28 | if _ge :=d .DecodeElement (_fcf ,&_dbc );_ge !=nil {return _ge ;};_fb .CommentId =append (_fb .CommentId ,_fcf );default:_e .Log .Debug ("\u0073\u006b\u0069\u0070\u0070\u0069n\u0067\u0020\u0075\u006e\u0073\u0075\u0070\u0070\u006f\u0072\u0074\u0065\u0064\u0020\u0065\u006c\u0065\u006d\u0065\u006et\u0020\u006f\u006e\u0020\u0043\u0054\u005f\u0043\u006f\u006d\u006d\u0065\u006e\u0074s\u0049d\u0073\u0020\u0025\u0076",_dbc .Name ); 29 | if _da :=d .Skip ();_da !=nil {return _da ;};};case _b .EndElement :break _bbg ;case _b .CharData :};};return nil ;};func (_cc *CT_CommentId )UnmarshalXML (d *_b .Decoder ,start _b .StartElement )error {for _ ,_d :=range start .Attr {if _d .Name .Local =="\u0070\u0061\u0072\u0061\u0049\u0064"{_eg :=_d .Value ; 30 | _cc .ParaIdAttr =_eg ;continue ;};if _d .Name .Local =="\u0064u\u0072\u0061\u0062\u006c\u0065\u0049d"{_dd :=_d .Value ;_cc .DurableIdAttr =_dd ;continue ;};};for {_a ,_fa :=d .Token ();if _fa !=nil {return _fc .Errorf ("\u0070a\u0072\u0073\u0069\u006e\u0067\u0020\u0043\u0054\u005f\u0043\u006fm\u006d\u0065\u006e\u0074\u0049\u0064\u003a\u0020\u0025\u0073",_fa ); 31 | };if _df ,_ce :=_a .(_b .EndElement );_ce &&_df .Name ==start .Name {break ;};};return nil ;}; 32 | 33 | // ValidateWithPath validates the CT_CommentsIds and its children, prefixing error messages with path 34 | func (_bab *CT_CommentsIds )ValidateWithPath (path string )error {for _ab ,_cec :=range _bab .CommentId {if _gadd :=_cec .ValidateWithPath (_fc .Sprintf ("\u0025\u0073/\u0043\u006f\u006dm\u0065\u006e\u0074\u0049\u0064\u005b\u0025\u0064\u005d",path ,_ab )); 35 | _gadd !=nil {return _gadd ;};};return nil ;};func (_dc *CT_CommentsIds )MarshalXML (e *_b .Encoder ,start _b .StartElement )error {e .EncodeToken (start );if _dc .CommentId !=nil {_gad :=_b .StartElement {Name :_b .Name {Local :"\u0063\u0069\u0064\u003a\u0063\u006f\u006d\u006d\u0065\u006e\u0074\u0049\u0064"}}; 36 | for _ ,_egg :=range _dc .CommentId {e .EncodeElement (_egg ,_gad );};};e .EncodeToken (_b .EndElement {Name :start .Name });return nil ;}; 37 | 38 | // ValidateWithPath validates the CommentsIds and its children, prefixing error messages with path 39 | func (_fbg *CommentsIds )ValidateWithPath (path string )error {if _deb :=_fbg .CT_CommentsIds .ValidateWithPath (path );_deb !=nil {return _deb ;};return nil ;};func NewCT_CommentsIds ()*CT_CommentsIds {_gg :=&CT_CommentsIds {};return _gg };type CT_CommentsIds struct{CommentId []*CT_CommentId ; 40 | };func (_c *CT_CommentId )MarshalXML (e *_b .Encoder ,start _b .StartElement )error {start .Attr =append (start .Attr ,_b .Attr {Name :_b .Name {Local :"\u0063\u0069\u0064\u003a\u0070\u0061\u0072\u0061\u0049\u0064"},Value :_fc .Sprintf ("\u0025\u0076",_c .ParaIdAttr )}); 41 | start .Attr =append (start .Attr ,_b .Attr {Name :_b .Name {Local :"\u0063\u0069\u0064\u003a\u0064\u0075\u0072\u0061\u0062\u006c\u0065\u0049\u0064"},Value :_fc .Sprintf ("\u0025\u0076",_c .DurableIdAttr )});e .EncodeToken (start );e .EncodeToken (_b .EndElement {Name :start .Name }); 42 | return nil ;};func (_dec *DecimaldurableId )MarshalXML (e *_b .Encoder ,start _b .StartElement )error {if _dec .DurableIdAttr !=nil {start .Attr =append (start .Attr ,_b .Attr {Name :_b .Name {Local :"\u0064u\u0072\u0061\u0062\u006c\u0065\u0049d"},Value :_fc .Sprintf ("\u0025\u0076",*_dec .DurableIdAttr )}); 43 | };start .Name .Local ="c\u0069d\u003a\u0064\u0065\u0063\u0069\u006d\u0061\u006cd\u0075\u0072\u0061\u0062le\u0049\u0064";return nil ;}; 44 | 45 | // Validate validates the CT_CommentsIds and its children 46 | func (_ff *CT_CommentsIds )Validate ()error {return _ff .ValidateWithPath ("\u0043\u0054\u005f\u0043\u006f\u006d\u006d\u0065\u006et\u0073\u0049\u0064\u0073");};func NewDecimaldurableId ()*DecimaldurableId {_gf :=&DecimaldurableId {};return _gf }; 47 | 48 | // ValidateWithPath validates the DecimaldurableId and its children, prefixing error messages with path 49 | func (_ege *DecimaldurableId )ValidateWithPath (path string )error {return nil }; 50 | 51 | // Validate validates the CT_CommentId and its children 52 | func (_gb *CT_CommentId )Validate ()error {return _gb .ValidateWithPath ("\u0043\u0054\u005fC\u006f\u006d\u006d\u0065\u006e\u0074\u0049\u0064");};func NewCommentsIds ()*CommentsIds {_abf :=&CommentsIds {};_abf .CT_CommentsIds =*NewCT_CommentsIds ();return _abf ; 53 | };func (_fbf *CommentsIds )MarshalXML (e *_b .Encoder ,start _b .StartElement )error {start .Attr =append (start .Attr ,_b .Attr {Name :_b .Name {Local :"\u0078\u006d\u006cn\u0073"},Value :"\u0068\u0074\u0074\u0070\u003a\u002f/\u0073\u0063\u0068e\u006d\u0061\u0073.\u006d\u0069\u0063\u0072\u006f\u0073\u006f\u0066\u0074\u002ec\u006f\u006d\u002f\u006f\u0066fi\u0063\u0065\u002f\u0077\u006f\u0072\u0064\u002f\u0032\u0030\u0031\u0036\u002f\u0077\u006f\u0072\u0064\u006d\u006c\u002f\u0063\u0069\u0064"}); 54 | start .Attr =append (start .Attr ,_b .Attr {Name :_b .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u0063\u0069d"},Value :"\u0068\u0074\u0074\u0070\u003a\u002f/\u0073\u0063\u0068e\u006d\u0061\u0073.\u006d\u0069\u0063\u0072\u006f\u0073\u006f\u0066\u0074\u002ec\u006f\u006d\u002f\u006f\u0066fi\u0063\u0065\u002f\u0077\u006f\u0072\u0064\u002f\u0032\u0030\u0031\u0036\u002f\u0077\u006f\u0072\u0064\u006d\u006c\u002f\u0063\u0069\u0064"}); 55 | start .Attr =append (start .Attr ,_b .Attr {Name :_b .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u0077\u00314"},Value :"\u0068\u0074t\u0070\u003a\u002f\u002f\u0073c\u0068\u0065\u006d\u0061\u0073.\u006d\u0069\u0063\u0072\u006f\u0073\u006f\u0066\u0074\u002e\u0063\u006f\u006d\u002f\u006f\u0066\u0066\u0069\u0063\u0065\u002f\u0077\u006f\u0072\u0064\u002f\u0032\u0030\u0031\u0030\u002f\u0077\u006f\u0072\u0064\u006d\u006c"}); 56 | start .Attr =append (start .Attr ,_b .Attr {Name :_b .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u0078\u006dl"},Value :"\u0068\u0074tp\u003a\u002f\u002fw\u0077\u0077\u002e\u00773.o\u0072g/\u0058\u004d\u004c\u002f\u0031\u0039\u00398/\u006e\u0061\u006d\u0065\u0073\u0070\u0061c\u0065"}); 57 | start .Name .Local ="\u0063i\u0064:\u0063\u006f\u006d\u006d\u0065\u006e\u0074\u0073\u0049\u0064\u0073";return _fbf .CT_CommentsIds .MarshalXML (e ,start );};func init (){_ed .RegisterConstructor ("\u0068\u0074\u0074\u0070\u003a\u002f/\u0073\u0063\u0068e\u006d\u0061\u0073.\u006d\u0069\u0063\u0072\u006f\u0073\u006f\u0066\u0074\u002ec\u006f\u006d\u002f\u006f\u0066fi\u0063\u0065\u002f\u0077\u006f\u0072\u0064\u002f\u0032\u0030\u0031\u0036\u002f\u0077\u006f\u0072\u0064\u006d\u006c\u002f\u0063\u0069\u0064","\u0043\u0054\u005f\u0043\u006f\u006d\u006d\u0065\u006et\u0073\u0049\u0064\u0073",NewCT_CommentsIds ); 58 | _ed .RegisterConstructor ("\u0068\u0074\u0074\u0070\u003a\u002f/\u0073\u0063\u0068e\u006d\u0061\u0073.\u006d\u0069\u0063\u0072\u006f\u0073\u006f\u0066\u0074\u002ec\u006f\u006d\u002f\u006f\u0066fi\u0063\u0065\u002f\u0077\u006f\u0072\u0064\u002f\u0032\u0030\u0031\u0036\u002f\u0077\u006f\u0072\u0064\u006d\u006c\u002f\u0063\u0069\u0064","\u0043\u0054\u005fC\u006f\u006d\u006d\u0065\u006e\u0074\u0049\u0064",NewCT_CommentId ); 59 | _ed .RegisterConstructor ("\u0068\u0074\u0074\u0070\u003a\u002f/\u0073\u0063\u0068e\u006d\u0061\u0073.\u006d\u0069\u0063\u0072\u006f\u0073\u006f\u0066\u0074\u002ec\u006f\u006d\u002f\u006f\u0066fi\u0063\u0065\u002f\u0077\u006f\u0072\u0064\u002f\u0032\u0030\u0031\u0036\u002f\u0077\u006f\u0072\u0064\u006d\u006c\u002f\u0063\u0069\u0064","c\u006f\u006d\u006d\u0065\u006e\u0074\u0073\u0049\u0064\u0073",NewCommentsIds ); 60 | _ed .RegisterConstructor ("\u0068\u0074\u0074\u0070\u003a\u002f/\u0073\u0063\u0068e\u006d\u0061\u0073.\u006d\u0069\u0063\u0072\u006f\u0073\u006f\u0066\u0074\u002ec\u006f\u006d\u002f\u006f\u0066fi\u0063\u0065\u002f\u0077\u006f\u0072\u0064\u002f\u0032\u0030\u0031\u0036\u002f\u0077\u006f\u0072\u0064\u006d\u006c\u002f\u0063\u0069\u0064","\u0064\u0065c\u0069\u006d\u0061l\u0064\u0075\u0072\u0061\u0062\u006c\u0065\u0049\u0064",NewDecimaldurableId ); 61 | }; -------------------------------------------------------------------------------- /zippkg/zippkg.go: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2020 FoxyUtils ehf. All rights reserved. 3 | // 4 | // This is a commercial product and requires a license to operate. 5 | // A trial license can be obtained at https://unidoc.io 6 | // 7 | // DO NOT EDIT: generated by unitwist Go source code obfuscator. 8 | // 9 | // Use of this source code is governed by the UniDoc End User License Agreement 10 | // terms that can be accessed at https://unidoc.io/eula/ 11 | 12 | package zippkg ;import (_g "archive/zip";_e "bytes";_ce "encoding/xml";_c "fmt";_f "github.com/unidoc/unioffice/v2";_gba "github.com/unidoc/unioffice/v2/common/tempstorage";_cf "github.com/unidoc/unioffice/v2/internal/sort";_b "github.com/unidoc/unioffice/v2/schema/soo/pkg/relationships"; 13 | _a "io";_ge "path";_da "sort";_ga "strings";_gb "time";);func (_fb SelfClosingWriter )Write (b []byte )(int ,error ){_gbc :=0;_dbe :=0;for _gge :=0;_gge < len (b )-2;_gge ++{if b [_gge ]=='>'&&b [_gge +1]=='<'&&b [_gge +2]=='/'{_ecd :=[]byte {};_efc :=_gge ; 14 | for _eed :=_gge ;_eed >=0;_eed --{if b [_eed ]==' '{_efc =_eed ;}else if b [_eed ]=='<'{_ecd =b [_eed +1:_efc ];break ;};};_dcgc :=[]byte {};for _ddb :=_gge +3;_ddb < len (b );_ddb ++{if b [_ddb ]=='>'{_dcgc =b [_gge +3:_ddb ];break ;};};if !_e .Equal (_ecd ,_dcgc ){continue ; 15 | };_fdd ,_ada :=_fb .W .Write (b [_gbc :_gge ]);if _ada !=nil {return _dbe +_fdd ,_ada ;};_dbe +=_fdd ;_ ,_ada =_fb .W .Write (_egb );if _ada !=nil {return _dbe ,_ada ;};_dbe +=3;for _de :=_gge +2;_de < len (b )&&b [_de ]!='>';_de ++{_dbe ++;_gbc =_de +2; 16 | _gge =_gbc ;};};};_cc ,_bfa :=_fb .W .Write (b [_gbc :]);return _cc +_dbe ,_bfa ;}; 17 | 18 | // SetOnNewRelationshipFunc sets the function to be called when a new 19 | // relationship has been discovered. 20 | func (_caa *DecodeMap )SetOnNewRelationshipFunc (fn OnNewRelationshipFunc ){_caa ._fed =fn }; 21 | 22 | // SelfClosingWriter wraps a writer and replaces XML tags of the 23 | // type with 24 | type SelfClosingWriter struct{W _a .Writer ;}; 25 | 26 | // AddTarget allows documents to register decode targets. Path is a path that 27 | // will be found in the zip file and ifc is an XML element that the file will be 28 | // unmarshaled to. filePath is the absolute path to the target, ifc is the 29 | // object to decode into, sourceFileType is the type of file that the reference 30 | // was discovered in, and index is the index of the source file type. 31 | func (_aa *DecodeMap )AddTarget (filePath string ,ifc interface{},sourceFileType string ,idx uint32 )bool {if _aa ._ca ==nil {_aa ._ca =make (map[string ]Target );_aa ._ff =make (map[*_b .Relationships ]string );_aa ._ae =make (map[string ]struct{});_aa ._df =make (map[string ]int ); 32 | };if _ge .IsAbs (filePath ){filePath =_ga .TrimPrefix (filePath ,"\u002f");};_db :=_ge .Clean (filePath );if _ ,_eb :=_aa ._ae [_db ];_eb {return false ;};_aa ._ae [_db ]=struct{}{};_aa ._ca [_db ]=Target {Path :_db ,Typ :sourceFileType ,Ifc :ifc ,Index :idx }; 33 | return true ;}; 34 | 35 | // AddFileFromBytes takes a byte array and adds it at a given path to a zip file. 36 | func AddFileFromBytes (z *_g .Writer ,zipPath string ,data []byte )error {_fc ,_dd :=z .Create (zipPath );if _dd !=nil {return _c .Errorf ("e\u0072\u0072\u006f\u0072 c\u0072e\u0061\u0074\u0069\u006e\u0067 \u0025\u0073\u003a\u0020\u0025\u0073",zipPath ,_dd ); 37 | };_ ,_dd =_a .Copy (_fc ,_e .NewReader (data ));return _dd ;}; 38 | 39 | // DecodeMap is used to walk a tree of relationships, decoding files and passing 40 | // control back to the document. 41 | type DecodeMap struct{_ca map[string ]Target ;_ff map[*_b .Relationships ]string ;_cb []Target ;_fed OnNewRelationshipFunc ;_ae map[string ]struct{};_df map[string ]int ;};const XMLHeader ="\u003c\u003f\u0078\u006d\u006c\u0020\u0076e\u0072\u0073\u0069o\u006e\u003d\u00221\u002e\u0030\"\u0020\u0065\u006e\u0063\u006f\u0064i\u006eg=\u0022\u0055\u0054\u0046\u002d\u0038\u0022\u0020\u0073\u0074\u0061\u006e\u0064\u0061\u006c\u006f\u006e\u0065\u003d\u0022\u0079\u0065\u0073\u0022\u003f\u003e"+"\u000a"; 42 | func (_dc *DecodeMap )IndexFor (path string )int {return _dc ._df [path ]};func MarshalXMLByType (z *_g .Writer ,dt _f .DocType ,typ string ,v interface{})error {_gg :=_f .AbsoluteFilename (dt ,typ ,0);return MarshalXML (z ,_gg ,v );}; 43 | 44 | // AddFileFromStorage reads a file from internal storage and adds it at a given path to a zip file. 45 | // NOTE: If disk storage cannot be used, memory storage can be used instead by calling memstore.SetAsStorage(). 46 | func AddFileFromStorage (z *_g .Writer ,zipPath ,storagePath string )error {_gbe ,_cab :=z .Create (zipPath );if _cab !=nil {return _c .Errorf ("e\u0072\u0072\u006f\u0072 c\u0072e\u0061\u0074\u0069\u006e\u0067 \u0025\u0073\u003a\u0020\u0025\u0073",zipPath ,_cab ); 47 | };_ebg ,_cab :=_gba .Open (storagePath );if _cab !=nil {return _c .Errorf ("e\u0072r\u006f\u0072\u0020\u006f\u0070\u0065\u006e\u0069n\u0067\u0020\u0025\u0073: \u0025\u0073",storagePath ,_cab );};defer _ebg .Close ();_ ,_cab =_a .Copy (_gbe ,_ebg );return _cab ; 48 | }; 49 | 50 | // MarshalXML creates a file inside of a zip and marshals an object as xml, prefixing it 51 | // with a standard XML header. 52 | func MarshalXML (z *_g .Writer ,filename string ,v interface{})error {_dcg :=&_g .FileHeader {};_dcg .Method =_g .Deflate ;_dcg .Name =filename ;_dcg .SetModTime (_gb .Now ());_fga ,_age :=z .CreateHeader (_dcg );if _age !=nil {return _c .Errorf ("\u0063\u0072\u0065\u0061ti\u006e\u0067\u0020\u0025\u0073\u0020\u0069\u006e\u0020\u007a\u0069\u0070\u003a\u0020%\u0073",filename ,_age ); 53 | };_ ,_age =_fga .Write ([]byte (XMLHeader ));if _age !=nil {return _c .Errorf ("\u0063\u0072e\u0061\u0074\u0069\u006e\u0067\u0020\u0078\u006d\u006c\u0020\u0068\u0065\u0061\u0064\u0065\u0072\u0020\u0074\u006f\u0020\u0025\u0073: \u0025\u0073",filename ,_age ); 54 | };if _age =_ce .NewEncoder (SelfClosingWriter {_fga }).Encode (v );_age !=nil {return _c .Errorf ("\u006d\u0061\u0072\u0073\u0068\u0061\u006c\u0069\u006e\u0067\u0020\u0025s\u003a\u0020\u0025\u0073",filename ,_age );};_ ,_age =_fga .Write (_ec );return _age ; 55 | };func (_af *DecodeMap )RecordIndex (path string ,idx int ){_af ._df [path ]=idx };var _ec =[]byte {'\r','\n'}; 56 | 57 | // ExtractToDiskTmp extracts a zip file to a temporary file in a given path, 58 | // returning the name of the file. 59 | func ExtractToDiskTmp (f *_g .File ,path string )(string ,error ){_agb ,_fde :=_gba .TempFile (path ,"\u007a\u007a");if _fde !=nil {return "",_fde ;};defer _agb .Close ();_bf ,_fde :=f .Open ();if _fde !=nil {return "",_fde ;};defer _bf .Close ();_ ,_fde =_a .Copy (_agb ,_bf ); 60 | if _fde !=nil {return "",_fde ;};return _agb .Name (),nil ;}; 61 | 62 | // RelationsPathFor returns the relations path for a given filename. 63 | func RelationsPathFor (path string )string {_acf :=_ga .Split (path ,"\u002f");_ea :=_ga .Join (_acf [0:len (_acf )-1],"\u002f");_gbae :=_acf [len (_acf )-1];_ea +="\u002f_\u0072\u0065\u006c\u0073\u002f";_gbae +="\u002e\u0072\u0065l\u0073";return _ea +_gbae ; 64 | };func MarshalXMLByTypeIndex (z *_g .Writer ,dt _f .DocType ,typ string ,idx int ,v interface{})error {_fee :=_f .AbsoluteFilename (dt ,typ ,idx );return MarshalXML (z ,_fee ,v );};type Target struct{Path string ;Typ string ;Ifc interface{};Index uint32 ; 65 | };var _egb =[]byte {'/','>'}; 66 | 67 | // Decode unmarshals the content of a *zip.File as XML to a given destination. 68 | func Decode (f *_g .File ,dest interface{})error {_gag ,_fac :=f .Open ();if _fac !=nil {return _c .Errorf ("e\u0072r\u006f\u0072\u0020\u0072\u0065\u0061\u0064\u0069n\u0067\u0020\u0025\u0073: \u0025\u0073",f .Name ,_fac );};defer _gag .Close ();_daa :=_ce .NewDecoder (_gag ); 69 | if _bb :=_daa .Decode (dest );_bb !=nil {return _c .Errorf ("e\u0072\u0072\u006f\u0072 d\u0065c\u006f\u0064\u0069\u006e\u0067 \u0025\u0073\u003a\u0020\u0025\u0073",f .Name ,_bb );};if _acd ,_bg :=dest .(*_b .Relationships );_bg {for _cgda ,_ed :=range _acd .Relationship {switch _ed .TypeAttr {case _f .OfficeDocumentTypeStrict :_acd .Relationship [_cgda ].TypeAttr =_f .OfficeDocumentType ; 70 | case _f .StylesTypeStrict :_acd .Relationship [_cgda ].TypeAttr =_f .StylesType ;case _f .ThemeTypeStrict :_acd .Relationship [_cgda ].TypeAttr =_f .ThemeType ;case _f .ControlTypeStrict :_acd .Relationship [_cgda ].TypeAttr =_f .ControlType ;case _f .SettingsTypeStrict :_acd .Relationship [_cgda ].TypeAttr =_f .SettingsType ; 71 | case _f .ImageTypeStrict :_acd .Relationship [_cgda ].TypeAttr =_f .ImageType ;case _f .CommentsTypeStrict :_acd .Relationship [_cgda ].TypeAttr =_f .CommentsType ;case _f .ThumbnailTypeStrict :_acd .Relationship [_cgda ].TypeAttr =_f .ThumbnailType ;case _f .DrawingTypeStrict :_acd .Relationship [_cgda ].TypeAttr =_f .DrawingType ; 72 | case _f .ChartTypeStrict :_acd .Relationship [_cgda ].TypeAttr =_f .ChartType ;case _f .ExtendedPropertiesTypeStrict :_acd .Relationship [_cgda ].TypeAttr =_f .ExtendedPropertiesType ;case _f .CustomXMLTypeStrict :_acd .Relationship [_cgda ].TypeAttr =_f .CustomXMLType ; 73 | case _f .WorksheetTypeStrict :_acd .Relationship [_cgda ].TypeAttr =_f .WorksheetType ;case _f .SharedStringsTypeStrict :_acd .Relationship [_cgda ].TypeAttr =_f .SharedStringsType ;case _f .TableTypeStrict :_acd .Relationship [_cgda ].TypeAttr =_f .TableType ; 74 | case _f .HeaderTypeStrict :_acd .Relationship [_cgda ].TypeAttr =_f .HeaderType ;case _f .FooterTypeStrict :_acd .Relationship [_cgda ].TypeAttr =_f .FooterType ;case _f .NumberingTypeStrict :_acd .Relationship [_cgda ].TypeAttr =_f .NumberingType ;case _f .FontTableTypeStrict :_acd .Relationship [_cgda ].TypeAttr =_f .FontTableType ; 75 | case _f .WebSettingsTypeStrict :_acd .Relationship [_cgda ].TypeAttr =_f .WebSettingsType ;case _f .FootNotesTypeStrict :_acd .Relationship [_cgda ].TypeAttr =_f .FootNotesType ;case _f .EndNotesTypeStrict :_acd .Relationship [_cgda ].TypeAttr =_f .EndNotesType ; 76 | case _f .SlideTypeStrict :_acd .Relationship [_cgda ].TypeAttr =_f .SlideType ;case _f .VMLDrawingTypeStrict :_acd .Relationship [_cgda ].TypeAttr =_f .VMLDrawingType ;};};_da .Slice (_acd .Relationship ,func (_ef ,_eac int )bool {_geb :=_acd .Relationship [_ef ]; 77 | _cbg :=_acd .Relationship [_eac ];return _cf .NaturalCompare (_geb .IdAttr ,_cbg .IdAttr );});};return nil ;}; 78 | 79 | // Decode loops decoding targets registered with AddTarget and calling th 80 | func (_ad *DecodeMap )Decode (files []*_g .File )error {_gbb :=1;for _gbb > 0{for len (_ad ._cb )> 0{_dbd :=_ad ._cb [0];_ad ._cb =_ad ._cb [1:];_agf :=_dbd .Ifc .(*_b .Relationships );for _ ,_dcf :=range _agf .Relationship {_dcc :=_ad ._ff [_agf ];_cbb :=_ga .TrimPrefix (_dcf .TargetAttr ,"\u002f"); 81 | if _ga .HasPrefix (_dcf .TargetAttr ,"\u002f"){_ =_ad ._fed (_ad ,_cbb ,_dcf .TypeAttr ,files ,_dcf ,_dbd );}else {if _ga .IndexByte (_dcc ,'/')> -1{_gec :=_dcc [:_ga .IndexByte (_dcc ,'/')+1];if _ga .HasPrefix (_cbb ,_gec ){_dcc ="";};};if _ga .HasPrefix (_cbb ,_dcc ){_dcc =""; 82 | };_ =_ad ._fed (_ad ,_dcc +_cbb ,_dcf .TypeAttr ,files ,_dcf ,_dbd );};};};for _fa ,_eg :=range files {if _eg ==nil {continue ;};if _cbba ,_ac :=_ad ._ca [_eg .Name ];_ac {delete (_ad ._ca ,_eg .Name );if _gece :=Decode (_eg ,_cbba .Ifc );_gece !=nil {return _gece ; 83 | };files [_fa ]=nil ;if _cgd ,_ffd :=_cbba .Ifc .(*_b .Relationships );_ffd {_ad ._cb =append (_ad ._cb ,_cbba );_fd ,_ :=_ge .Split (_ge .Clean (_eg .Name +"\u002f\u002e\u002e\u002f"));_ad ._ff [_cgd ]=_fd ;_gbb ++;};};};_gbb --;};return nil ;}; 84 | 85 | // OnNewRelationshipFunc is called when a new relationship has been discovered. 86 | // 87 | // target is a resolved path that takes into account the location of the 88 | // relationships file source and should be the path in the zip file. 89 | // 90 | // files are passed so non-XML files that can't be handled by AddTarget can be 91 | // decoded directly (e.g. images) 92 | // 93 | // rel is the actual relationship so its target can be modified if the source 94 | // target doesn't match where unioffice will write the file (e.g. read in 95 | // 'xl/worksheets/MyWorksheet.xml' and we'll write out 96 | // 'xl/worksheets/sheet1.xml') 97 | type OnNewRelationshipFunc func (_gc *DecodeMap ,_gbg ,_ag string ,_gd []*_g .File ,_cec *_b .Relationship ,_fe Target )error ; -------------------------------------------------------------------------------- /schema/schemas.microsoft.com/office/word/2018/wordml/cex/cex.go: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2020 FoxyUtils ehf. All rights reserved. 3 | // 4 | // This is a commercial product and requires a license to operate. 5 | // A trial license can be obtained at https://unidoc.io 6 | // 7 | // DO NOT EDIT: generated by unitwist Go source code obfuscator. 8 | // 9 | // Use of this source code is governed by the UniDoc End User License Agreement 10 | // terms that can be accessed at https://unidoc.io/eula/ 11 | 12 | package cex ;import (_g "encoding/xml";_b "fmt";_ag "github.com/unidoc/unioffice/v2";_aa "github.com/unidoc/unioffice/v2/common/logger";_fd "github.com/unidoc/unioffice/v2/schema/schemas.microsoft.com/office/word/2018/wordml";_d "github.com/unidoc/unioffice/v2/schema/soo/ofc/sharedTypes"; 13 | _a "time";);func (_bf *CT_CommentExtensible )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {if _bf .DateUtcAttr !=nil {start .Attr =append (start .Attr ,_g .Attr {Name :_g .Name {Local :"\u0063\u0065\u003a\u0064\u0061\u0074\u0065\u0055\u0074\u0063"},Value :_d .FormatDateTime (*_bf .DateUtcAttr )}); 14 | };if _bf .IntelligentPlaceholderAttr !=nil {start .Attr =append (start .Attr ,_g .Attr {Name :_g .Name {Local :"\u0063e\u003a\u0069\u006e\u0074e\u006c\u006c\u0069\u0067\u0065n\u0074P\u006ca\u0063\u0065\u0068\u006f\u006c\u0064\u0065r"},Value :_b .Sprintf ("\u0025\u0076",*_bf .IntelligentPlaceholderAttr )}); 15 | };e .EncodeToken (start );if _bf .ExtLst !=nil {_e :=_g .StartElement {Name :_g .Name {Local :"\u0063e\u003a\u0065\u0078\u0074\u004c\u0073t"}};e .EncodeElement (_bf .ExtLst ,_e );};e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};func (_aag *CT_CommentsExtensible )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {e .EncodeToken (start ); 16 | if _aag .CommentExtensible !=nil {_aad :=_g .StartElement {Name :_g .Name {Local :"c\u0065:\u0063\u006f\u006d\u006d\u0065\u006e\u0074\u0045x\u0074\u0065\u006e\u0073ib\u006c\u0065"}};for _ ,_ac :=range _aag .CommentExtensible {e .EncodeElement (_ac ,_aad ); 17 | };};if _aag .ExtLst !=nil {_cdb :=_g .StartElement {Name :_g .Name {Local :"\u0063e\u003a\u0065\u0078\u0074\u004c\u0073t"}};e .EncodeElement (_aag .ExtLst ,_cdb );};e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};type CommentsExtensible struct{CT_CommentsExtensible }; 18 | 19 | 20 | // Validate validates the CT_CommentsExtensible and its children 21 | func (_cbf *CT_CommentsExtensible )Validate ()error {return _cbf .ValidateWithPath ("C\u0054\u005f\u0043\u006fmm\u0065n\u0074\u0073\u0045\u0078\u0074e\u006e\u0073\u0069\u0062\u006c\u0065");};func ParseStdlibTime (s string )(_a .Time ,error ){return _d .ParseStdlibTime (s )}; 22 | func (_dd *CT_CommentsExtensible )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {_cb :for {_dc ,_ace :=d .Token ();if _ace !=nil {return _ace ;};switch _bcc :=_dc .(type ){case _g .StartElement :switch _bcc .Name {case _g .Name {Space :"\u0068\u0074\u0074\u0070\u003a\u002f/\u0073\u0063\u0068e\u006d\u0061\u0073.\u006d\u0069\u0063\u0072\u006f\u0073\u006f\u0066\u0074\u002ec\u006f\u006d\u002f\u006f\u0066fi\u0063\u0065\u002f\u0077\u006f\u0072\u0064\u002f\u0032\u0030\u0031\u0038\u002f\u0077\u006f\u0072\u0064\u006d\u006c\u002f\u0063\u0065\u0078",Local :"\u0063\u006f\u006d\u006d\u0065\u006e\u0074\u0045\u0078\u0074\u0065\u006es\u0069\u0062\u006c\u0065"}:_bed :=NewCT_CommentExtensible (); 23 | if _de :=d .DecodeElement (_bed ,&_bcc );_de !=nil {return _de ;};_dd .CommentExtensible =append (_dd .CommentExtensible ,_bed );case _g .Name {Space :"\u0068\u0074\u0074\u0070\u003a\u002f/\u0073\u0063\u0068e\u006d\u0061\u0073.\u006d\u0069\u0063\u0072\u006f\u0073\u006f\u0066\u0074\u002ec\u006f\u006d\u002f\u006f\u0066fi\u0063\u0065\u002f\u0077\u006f\u0072\u0064\u002f\u0032\u0030\u0031\u0038\u002f\u0077\u006f\u0072\u0064\u006d\u006c\u002f\u0063\u0065\u0078",Local :"\u0065\u0078\u0074\u004c\u0073\u0074"}:_dd .ExtLst =_fd .NewCT_ExtensionList (); 24 | if _efc :=d .DecodeElement (_dd .ExtLst ,&_bcc );_efc !=nil {return _efc ;};default:_aa .Log .Debug ("\u0073\u006b\u0069\u0070\u0070\u0069n\u0067\u0020\u0075n\u0073\u0075\u0070p\u006f\u0072\u0074\u0065\u0064\u0020\u0065\u006c\u0065\u006de\u006e\u0074\u0020\u006f\u006e C\u0054\u005f\u0043\u006f\u006d\u006d\u0065\u006e\u0074\u0073\u0045\u0078\u0074\u0065\u006e\u0073\u0069\u0062\u006c\u0065\u0020\u0025\u0076",_bcc .Name ); 25 | if _bgeb :=d .Skip ();_bgeb !=nil {return _bgeb ;};};case _g .EndElement :break _cb ;case _g .CharData :};};return nil ;};func NewCommentsExtensible ()*CommentsExtensible {_bb :=&CommentsExtensible {};_bb .CT_CommentsExtensible =*NewCT_CommentsExtensible (); 26 | return _bb ;};type CT_CommentExtensible struct{DateUtcAttr *_a .Time ;IntelligentPlaceholderAttr *_d .ST_OnOff ;ExtLst *_fd .CT_ExtensionList ;};func NewCT_CommentsExtensible ()*CT_CommentsExtensible {_ee :=&CT_CommentsExtensible {};return _ee };func ParseUnionST_OnOff (s string )(_d .ST_OnOff ,error ){return _d .ParseUnionST_OnOff (s )}; 27 | func (_db *CommentsExtensible )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Attr =append (start .Attr ,_g .Attr {Name :_g .Name {Local :"\u0078\u006d\u006cn\u0073"},Value :"\u0068\u0074\u0074\u0070\u003a\u002f/\u0073\u0063\u0068e\u006d\u0061\u0073.\u006d\u0069\u0063\u0072\u006f\u0073\u006f\u0066\u0074\u002ec\u006f\u006d\u002f\u006f\u0066fi\u0063\u0065\u002f\u0077\u006f\u0072\u0064\u002f\u0032\u0030\u0031\u0038\u002f\u0077\u006f\u0072\u0064\u006d\u006c\u002f\u0063\u0065\u0078"}); 28 | start .Attr =append (start .Attr ,_g .Attr {Name :_g .Name {Local :"\u0078\u006d\u006c\u006e\u0073\u003a\u0063\u0065"},Value :"\u0068\u0074\u0074\u0070\u003a\u002f/\u0073\u0063\u0068e\u006d\u0061\u0073.\u006d\u0069\u0063\u0072\u006f\u0073\u006f\u0066\u0074\u002ec\u006f\u006d\u002f\u006f\u0066fi\u0063\u0065\u002f\u0077\u006f\u0072\u0064\u002f\u0032\u0030\u0031\u0038\u002f\u0077\u006f\u0072\u0064\u006d\u006c\u002f\u0063\u0065\u0078"}); 29 | start .Attr =append (start .Attr ,_g .Attr {Name :_g .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u0077\u00314"},Value :"\u0068\u0074t\u0070\u003a\u002f\u002f\u0073c\u0068\u0065\u006d\u0061\u0073.\u006d\u0069\u0063\u0072\u006f\u0073\u006f\u0066\u0074\u002e\u0063\u006f\u006d\u002f\u006f\u0066\u0066\u0069\u0063\u0065\u002f\u0077\u006f\u0072\u0064\u002f\u0032\u0030\u0031\u0030\u002f\u0077\u006f\u0072\u0064\u006d\u006c"}); 30 | start .Attr =append (start .Attr ,_g .Attr {Name :_g .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u0078\u006dl"},Value :"\u0068\u0074tp\u003a\u002f\u002fw\u0077\u0077\u002e\u00773.o\u0072g/\u0058\u004d\u004c\u002f\u0031\u0039\u00398/\u006e\u0061\u006d\u0065\u0073\u0070\u0061c\u0065"}); 31 | start .Name .Local ="c\u0065\u003a\u0063\u006fmm\u0065n\u0074\u0073\u0045\u0078\u0074e\u006e\u0073\u0069\u0062\u006c\u0065";return _db .CT_CommentsExtensible .MarshalXML (e ,start );};func (_fa *CommentsExtensible )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {_fa .CT_CommentsExtensible =*NewCT_CommentsExtensible (); 32 | _deg :for {_af ,_beb :=d .Token ();if _beb !=nil {return _beb ;};switch _cdf :=_af .(type ){case _g .StartElement :switch _cdf .Name {case _g .Name {Space :"\u0068\u0074\u0074\u0070\u003a\u002f/\u0073\u0063\u0068e\u006d\u0061\u0073.\u006d\u0069\u0063\u0072\u006f\u0073\u006f\u0066\u0074\u002ec\u006f\u006d\u002f\u006f\u0066fi\u0063\u0065\u002f\u0077\u006f\u0072\u0064\u002f\u0032\u0030\u0031\u0038\u002f\u0077\u006f\u0072\u0064\u006d\u006c\u002f\u0063\u0065\u0078",Local :"\u0063\u006f\u006d\u006d\u0065\u006e\u0074\u0045\u0078\u0074\u0065\u006es\u0069\u0062\u006c\u0065"}:_fg :=NewCT_CommentExtensible (); 33 | if _df :=d .DecodeElement (_fg ,&_cdf );_df !=nil {return _df ;};_fa .CommentExtensible =append (_fa .CommentExtensible ,_fg );case _g .Name {Space :"\u0068\u0074\u0074\u0070\u003a\u002f/\u0073\u0063\u0068e\u006d\u0061\u0073.\u006d\u0069\u0063\u0072\u006f\u0073\u006f\u0066\u0074\u002ec\u006f\u006d\u002f\u006f\u0066fi\u0063\u0065\u002f\u0077\u006f\u0072\u0064\u002f\u0032\u0030\u0031\u0038\u002f\u0077\u006f\u0072\u0064\u006d\u006c\u002f\u0063\u0065\u0078",Local :"\u0065\u0078\u0074\u004c\u0073\u0074"}:_fa .ExtLst =_fd .NewCT_ExtensionList (); 34 | if _ea :=d .DecodeElement (_fa .ExtLst ,&_cdf );_ea !=nil {return _ea ;};default:_aa .Log .Debug ("\u0073\u006b\u0069\u0070\u0070\u0069\u006e\u0067\u0020\u0075\u006es\u0075\u0070\u0070\u006f\u0072\u0074\u0065\u0064 \u0065l\u0065\u006d\u0065\u006e\u0074\u0020\u006f\u006e\u0020\u0043\u006f\u006d\u006d\u0065\u006e\u0074\u0073\u0045x\u0074\u0065\u006e\u0073\u0069\u0062\u006c\u0065\u0020\u0025\u0076",_cdf .Name ); 35 | if _ege :=d .Skip ();_ege !=nil {return _ege ;};};case _g .EndElement :break _deg ;case _g .CharData :};};return nil ;};func NewCT_CommentExtensible ()*CT_CommentExtensible {_ae :=&CT_CommentExtensible {};return _ae }; 36 | 37 | // Validate validates the CT_CommentExtensible and its children 38 | func (_ef *CT_CommentExtensible )Validate ()error {return _ef .ValidateWithPath ("C\u0054_\u0043\u006f\u006d\u006d\u0065\u006e\u0074\u0045x\u0074\u0065\u006e\u0073ib\u006c\u0065");}; 39 | 40 | // Validate validates the CommentsExtensible and its children 41 | func (_ca *CommentsExtensible )Validate ()error {return _ca .ValidateWithPath ("\u0043o\u006dm\u0065\u006e\u0074\u0073\u0045x\u0074\u0065n\u0073\u0069\u0062\u006c\u0065");}; 42 | 43 | // ValidateWithPath validates the CT_CommentsExtensible and its children, prefixing error messages with path 44 | func (_fce *CT_CommentsExtensible )ValidateWithPath (path string )error {for _cc ,_bff :=range _fce .CommentExtensible {if _eg :=_bff .ValidateWithPath (_b .Sprintf ("\u0025s\u002f\u0043\u006f\u006d\u006d\u0065\u006e\u0074\u0045\u0078\u0074e\u006e\u0073\u0069\u0062\u006c\u0065\u005b\u0025\u0064\u005d",path ,_cc )); 45 | _eg !=nil {return _eg ;};};if _fce .ExtLst !=nil {if _bgf :=_fce .ExtLst .ValidateWithPath (path +"\u002fE\u0078\u0074\u004c\u0073\u0074");_bgf !=nil {return _bgf ;};};return nil ;}; 46 | 47 | // ValidateWithPath validates the CommentsExtensible and its children, prefixing error messages with path 48 | func (_cf *CommentsExtensible )ValidateWithPath (path string )error {if _fe :=_cf .CT_CommentsExtensible .ValidateWithPath (path );_fe !=nil {return _fe ;};return nil ;};func (_fc *CT_CommentExtensible )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for _ ,_c :=range start .Attr {if _c .Name .Local =="\u0064a\u0074\u0065\u0055\u0074\u0063"{_fb ,_bd :=ParseStdlibTime (_c .Value ); 49 | if _bd !=nil {return _bd ;};_fc .DateUtcAttr =&_fb ;continue ;};if _c .Name .Local =="\u0069\u006e\u0074\u0065ll\u0069\u0067\u0065\u006e\u0074\u0050\u006c\u0061\u0063\u0065\u0068\u006f\u006c\u0064e\u0072"{_be ,_bg :=ParseUnionST_OnOff (_c .Value );if _bg !=nil {return _bg ; 50 | };_fc .IntelligentPlaceholderAttr =&_be ;continue ;};};_ab :for {_da ,_cd :=d .Token ();if _cd !=nil {return _cd ;};switch _gd :=_da .(type ){case _g .StartElement :switch _gd .Name {case _g .Name {Space :"\u0068\u0074\u0074\u0070\u003a\u002f/\u0073\u0063\u0068e\u006d\u0061\u0073.\u006d\u0069\u0063\u0072\u006f\u0073\u006f\u0066\u0074\u002ec\u006f\u006d\u002f\u006f\u0066fi\u0063\u0065\u002f\u0077\u006f\u0072\u0064\u002f\u0032\u0030\u0031\u0038\u002f\u0077\u006f\u0072\u0064\u006d\u006c\u002f\u0063\u0065\u0078",Local :"\u0065\u0078\u0074\u004c\u0073\u0074"}:_fc .ExtLst =_fd .NewCT_ExtensionList (); 51 | if _gf :=d .DecodeElement (_fc .ExtLst ,&_gd );_gf !=nil {return _gf ;};default:_aa .Log .Debug ("\u0073\u006b\u0069\u0070\u0070\u0069\u006eg\u0020\u0075\u006es\u0075\u0070\u0070o\u0072\u0074e\u0064\u0020\u0065\u006c\u0065\u006de\u006et \u006f\u006e\u0020\u0043\u0054\u005f\u0043\u006f\u006d\u006d\u0065\u006e\u0074\u0045\u0078\u0074\u0065\u006e\u0073\u0069\u0062\u006c\u0065\u0020\u0025\u0076",_gd .Name ); 52 | if _gg :=d .Skip ();_gg !=nil {return _gg ;};};case _g .EndElement :break _ab ;case _g .CharData :};};return nil ;};type CT_CommentsExtensible struct{CommentExtensible []*CT_CommentExtensible ;ExtLst *_fd .CT_ExtensionList ;}; 53 | 54 | // ValidateWithPath validates the CT_CommentExtensible and its children, prefixing error messages with path 55 | func (_efe *CT_CommentExtensible )ValidateWithPath (path string )error {if _efe .IntelligentPlaceholderAttr !=nil {if _bc :=_efe .IntelligentPlaceholderAttr .ValidateWithPath (path +"/\u0049\u006e\u0074\u0065\u006c\u006ci\u0067\u0065\u006e\u0074\u0050\u006c\u0061\u0063\u0065h\u006f\u006c\u0064e\u0072A\u0074\u0074\u0072"); 56 | _bc !=nil {return _bc ;};};if _efe .ExtLst !=nil {if _bce :=_efe .ExtLst .ValidateWithPath (path +"\u002fE\u0078\u0074\u004c\u0073\u0074");_bce !=nil {return _bce ;};};return nil ;};func init (){_ag .RegisterConstructor ("\u0068\u0074\u0074\u0070\u003a\u002f/\u0073\u0063\u0068e\u006d\u0061\u0073.\u006d\u0069\u0063\u0072\u006f\u0073\u006f\u0066\u0074\u002ec\u006f\u006d\u002f\u006f\u0066fi\u0063\u0065\u002f\u0077\u006f\u0072\u0064\u002f\u0032\u0030\u0031\u0038\u002f\u0077\u006f\u0072\u0064\u006d\u006c\u002f\u0063\u0065\u0078","C\u0054\u005f\u0043\u006fmm\u0065n\u0074\u0073\u0045\u0078\u0074e\u006e\u0073\u0069\u0062\u006c\u0065",NewCT_CommentsExtensible ); 57 | _ag .RegisterConstructor ("\u0068\u0074\u0074\u0070\u003a\u002f/\u0073\u0063\u0068e\u006d\u0061\u0073.\u006d\u0069\u0063\u0072\u006f\u0073\u006f\u0066\u0074\u002ec\u006f\u006d\u002f\u006f\u0066fi\u0063\u0065\u002f\u0077\u006f\u0072\u0064\u002f\u0032\u0030\u0031\u0038\u002f\u0077\u006f\u0072\u0064\u006d\u006c\u002f\u0063\u0065\u0078","C\u0054_\u0043\u006f\u006d\u006d\u0065\u006e\u0074\u0045x\u0074\u0065\u006e\u0073ib\u006c\u0065",NewCT_CommentExtensible ); 58 | _ag .RegisterConstructor ("\u0068\u0074\u0074\u0070\u003a\u002f/\u0073\u0063\u0068e\u006d\u0061\u0073.\u006d\u0069\u0063\u0072\u006f\u0073\u006f\u0066\u0074\u002ec\u006f\u006d\u002f\u006f\u0066fi\u0063\u0065\u002f\u0077\u006f\u0072\u0064\u002f\u0032\u0030\u0031\u0038\u002f\u0077\u006f\u0072\u0064\u006d\u006c\u002f\u0063\u0065\u0078","\u0063o\u006dm\u0065\u006e\u0074\u0073\u0045x\u0074\u0065n\u0073\u0069\u0062\u006c\u0065",NewCommentsExtensible ); 59 | }; -------------------------------------------------------------------------------- /schema/soo/pkg/relationships/relationships.go: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2020 FoxyUtils ehf. All rights reserved. 3 | // 4 | // This is a commercial product and requires a license to operate. 5 | // A trial license can be obtained at https://unidoc.io 6 | // 7 | // DO NOT EDIT: generated by unitwist Go source code obfuscator. 8 | // 9 | // Use of this source code is governed by the UniDoc End User License Agreement 10 | // terms that can be accessed at https://unidoc.io/eula/ 11 | 12 | package relationships ;import (_a "encoding/xml";_g "fmt";_fd "github.com/unidoc/unioffice/v2";_d "github.com/unidoc/unioffice/v2/common/logger";);func (_cd *ST_TargetMode )UnmarshalXMLAttr (attr _a .Attr )error {switch attr .Value {case "":*_cd =0;case "\u0045\u0078\u0074\u0065\u0072\u006e\u0061\u006c":*_cd =1; 13 | case "\u0049\u006e\u0074\u0065\u0072\u006e\u0061\u006c":*_cd =2;};return nil ;};func (_ffe ST_TargetMode )MarshalXML (e *_a .Encoder ,start _a .StartElement )error {return e .EncodeElement (_ffe .String (),start );};func NewCT_Relationship ()*CT_Relationship {_ac :=&CT_Relationship {}; 14 | return _ac }; 15 | 16 | // ValidateWithPath validates the CT_Relationships and its children, prefixing error messages with path 17 | func (_db *CT_Relationships )ValidateWithPath (path string )error {for _fa ,_cfb :=range _db .Relationship {if _aa :=_cfb .ValidateWithPath (_g .Sprintf ("\u0025\u0073\u002f\u0052el\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u005b\u0025\u0064\u005d",path ,_fa )); 18 | _aa !=nil {return _aa ;};};return nil ;}; 19 | 20 | // Validate validates the Relationship and its children 21 | func (_ga *Relationship )Validate ()error {return _ga .ValidateWithPath ("\u0052\u0065\u006ca\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070");};type Relationships struct{CT_Relationships };func NewCT_Relationships ()*CT_Relationships {_fddd :=&CT_Relationships {}; 22 | return _fddd };func (_gd *CT_Relationships )MarshalXML (e *_a .Encoder ,start _a .StartElement )error {e .EncodeToken (start );if _gd .Relationship !=nil {_fde :=_a .StartElement {Name :_a .Name {Local :"\u0052\u0065\u006ca\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070"}}; 23 | for _ ,_dc :=range _gd .Relationship {e .EncodeElement (_dc ,_fde );};};e .EncodeToken (_a .EndElement {Name :start .Name });return nil ;}; 24 | 25 | // Validate validates the Relationships and its children 26 | func (_cfd *Relationships )Validate ()error {return _cfd .ValidateWithPath ("\u0052\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073");}; 27 | 28 | // ValidateWithPath validates the CT_Relationship and its children, prefixing error messages with path 29 | func (_fdd *CT_Relationship )ValidateWithPath (path string )error {if _eb :=_fdd .TargetModeAttr .ValidateWithPath (path +"\u002fT\u0061r\u0067\u0065\u0074\u004d\u006f\u0064\u0065\u0041\u0074\u0074\u0072");_eb !=nil {return _eb ;};return nil ;};func (_ea *Relationship )UnmarshalXML (d *_a .Decoder ,start _a .StartElement )error {_ea .CT_Relationship =*NewCT_Relationship (); 30 | for _ ,_ace :=range start .Attr {if _ace .Name .Local =="\u0054\u0061\u0072\u0067\u0065\u0074\u004d\u006f\u0064\u0065"{_ea .TargetModeAttr .UnmarshalXMLAttr (_ace );continue ;};if _ace .Name .Local =="\u0054\u0061\u0072\u0067\u0065\u0074"{_abc :=_ace .Value ; 31 | _ea .TargetAttr =_abc ;continue ;};if _ace .Name .Local =="\u0054\u0079\u0070\u0065"{_ffc :=_ace .Value ;_ea .TypeAttr =_ffc ;continue ;};if _ace .Name .Local =="\u0049\u0064"{_cbd :=_ace .Value ;_ea .IdAttr =_cbd ;continue ;};};for {_eef ,_be :=d .Token (); 32 | if _be !=nil {return _g .Errorf ("\u0070a\u0072\u0073\u0069\u006e\u0067\u0020\u0052\u0065\u006c\u0061\u0074i\u006f\u006e\u0073\u0068\u0069\u0070\u003a\u0020\u0025\u0073",_be );};if _ba ,_egf :=_eef .(_a .EndElement );_egf &&_ba .Name ==start .Name {break ; 33 | };};return nil ;};type ST_TargetMode byte ; 34 | 35 | // Validate validates the CT_Relationships and its children 36 | func (_af *CT_Relationships )Validate ()error {return _af .ValidateWithPath ("\u0043\u0054_\u0052\u0065\u006ca\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073");};type CT_Relationship struct{TargetModeAttr ST_TargetMode ;TargetAttr string ;TypeAttr string ; 37 | IdAttr string ;Content string ;};func (_def ST_TargetMode )MarshalXMLAttr (name _a .Name )(_a .Attr ,error ){_eae :=_a .Attr {};_eae .Name =name ;switch _def {case ST_TargetModeUnset :_eae .Value ="";case ST_TargetModeExternal :_eae .Value ="\u0045\u0078\u0074\u0065\u0072\u006e\u0061\u006c"; 38 | case ST_TargetModeInternal :_eae .Value ="\u0049\u006e\u0074\u0065\u0072\u006e\u0061\u006c";};return _eae ,nil ;};func (_gf *Relationships )UnmarshalXML (d *_a .Decoder ,start _a .StartElement )error {_gf .CT_Relationships =*NewCT_Relationships ();_dfc :for {_bgc ,_dba :=d .Token (); 39 | if _dba !=nil {return _dba ;};switch _afe :=_bgc .(type ){case _a .StartElement :switch _afe .Name {case _a .Name {Space :"ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0072\u0065\u006c\u0061\u0074\u0069\u006fn\u0073h\u0069\u0070s",Local :"\u0052\u0065\u006ca\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070"}:_cga :=NewRelationship (); 40 | if _ced :=d .DecodeElement (_cga ,&_afe );_ced !=nil {return _ced ;};_gf .Relationship =append (_gf .Relationship ,_cga );default:_d .Log .Debug ("\u0073\u006b\u0069\u0070\u0070\u0069\u006e\u0067 \u0075\u006e\u0073up\u0070\u006f\u0072\u0074\u0065\u0064 \u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0020\u006f\u006e\u0020\u0052\u0065\u006c\u0061t\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073 \u0025\u0076",_afe .Name ); 41 | if _gdd :=d .Skip ();_gdd !=nil {return _gdd ;};};case _a .EndElement :break _dfc ;case _a .CharData :};};return nil ;};func (_fb *ST_TargetMode )UnmarshalXML (d *_a .Decoder ,start _a .StartElement )error {_fe ,_ecc :=d .Token ();if _ecc !=nil {return _ecc ; 42 | };if _fdg ,_dfg :=_fe .(_a .EndElement );_dfg &&_fdg .Name ==start .Name {*_fb =1;return nil ;};if _deb ,_dfcf :=_fe .(_a .CharData );!_dfcf {return _g .Errorf ("\u0065\u0078\u0070\u0065\u0063\u0074\u0065\u0064\u0020\u0063\u0068a\u0072\u0020\u0064\u0061\u0074\u0061\u002c\u0020\u0067\u006ft\u0020\u0025\u0054",_fe ); 43 | }else {switch string (_deb ){case "":*_fb =0;case "\u0045\u0078\u0074\u0065\u0072\u006e\u0061\u006c":*_fb =1;case "\u0049\u006e\u0074\u0065\u0072\u006e\u0061\u006c":*_fb =2;};};_fe ,_ecc =d .Token ();if _ecc !=nil {return _ecc ;};if _agf ,_fee :=_fe .(_a .EndElement ); 44 | _fee &&_agf .Name ==start .Name {return nil ;};return _g .Errorf ("\u0065\u0078\u0070\u0065c\u0074\u0065\u0064\u0020\u0065\u006e\u0064\u0020\u0065\u006ce\u006de\u006e\u0074\u002c\u0020\u0067\u006f\u0074 \u0025\u0076",_fe );};func (_fda ST_TargetMode )ValidateWithPath (path string )error {switch _fda {case 0,1,2:default:return _g .Errorf ("\u0025s\u003a\u0020\u006f\u0075t\u0020\u006f\u0066\u0020\u0072a\u006eg\u0065 \u0076\u0061\u006c\u0075\u0065\u0020\u0025d",path ,int (_fda )); 45 | };return nil ;};func (_abcg ST_TargetMode )String ()string {switch _abcg {case 0:return "";case 1:return "\u0045\u0078\u0074\u0065\u0072\u006e\u0061\u006c";case 2:return "\u0049\u006e\u0074\u0065\u0072\u006e\u0061\u006c";};return "";};type Relationship struct{CT_Relationship }; 46 | func (_c *CT_Relationship )UnmarshalXML (d *_a .Decoder ,start _a .StartElement )error {for _ ,_ee :=range start .Attr {if _ee .Name .Local =="\u0054\u0061\u0072\u0067\u0065\u0074\u004d\u006f\u0064\u0065"{_c .TargetModeAttr .UnmarshalXMLAttr (_ee );continue ; 47 | };if _ee .Name .Local =="\u0054\u0061\u0072\u0067\u0065\u0074"{_cf :=_ee .Value ;_c .TargetAttr =_cf ;continue ;};if _ee .Name .Local =="\u0054\u0079\u0070\u0065"{_ce :=_ee .Value ;_c .TypeAttr =_ce ;continue ;};if _ee .Name .Local =="\u0049\u0064"{_cb :=_ee .Value ; 48 | _c .IdAttr =_cb ;continue ;};};for {_dfa ,_da :=d .Token ();if _da !=nil {return _g .Errorf ("p\u0061\u0072\u0073\u0069\u006e\u0067 \u0043\u0054\u005f\u0052\u0065\u006c\u0061\u0074\u0069o\u006e\u0073\u0068i\u0070:\u0020\u0025\u0073",_da );};if _bd ,_ff :=_dfa .(_a .CharData ); 49 | _ff {_c .Content =string (_bd );};if _ab ,_bb :=_dfa .(_a .EndElement );_bb &&_ab .Name ==start .Name {break ;};};return nil ;}; 50 | 51 | // ValidateWithPath validates the Relationship and its children, prefixing error messages with path 52 | func (_gdc *Relationship )ValidateWithPath (path string )error {if _ae :=_gdc .CT_Relationship .ValidateWithPath (path );_ae !=nil {return _ae ;};return nil ;};func (_de *CT_Relationships )UnmarshalXML (d *_a .Decoder ,start _a .StartElement )error {_cg :for {_eg ,_ag :=d .Token (); 53 | if _ag !=nil {return _ag ;};switch _dca :=_eg .(type ){case _a .StartElement :switch _dca .Name {case _a .Name {Space :"ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0072\u0065\u006c\u0061\u0074\u0069\u006fn\u0073h\u0069\u0070s",Local :"\u0052\u0065\u006ca\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070"}:_bf :=NewRelationship (); 54 | if _dce :=d .DecodeElement (_bf ,&_dca );_dce !=nil {return _dce ;};_de .Relationship =append (_de .Relationship ,_bf );default:_d .Log .Debug ("\u0073\u006b\u0069\u0070\u0070i\u006e\u0067\u0020\u0075\u006e\u0073\u0075\u0070\u0070\u006f\u0072\u0074\u0065d\u0020\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0020\u006f\u006e\u0020\u0043\u0054\u005f\u0052\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073\u0020\u0025v",_dca .Name ); 55 | if _ef :=d .Skip ();_ef !=nil {return _ef ;};};case _a .EndElement :break _cg ;case _a .CharData :};};return nil ;};func (_e *CT_Relationship )MarshalXML (e *_a .Encoder ,start _a .StartElement )error {if _e .TargetModeAttr !=ST_TargetModeUnset {_acg ,_b :=_e .TargetModeAttr .MarshalXMLAttr (_a .Name {Local :"\u0054\u0061\u0072\u0067\u0065\u0074\u004d\u006f\u0064\u0065"}); 56 | if _b !=nil {return _b ;};start .Attr =append (start .Attr ,_acg );};start .Attr =append (start .Attr ,_a .Attr {Name :_a .Name {Local :"\u0054\u0061\u0072\u0067\u0065\u0074"},Value :_g .Sprintf ("\u0025\u0076",_e .TargetAttr )});start .Attr =append (start .Attr ,_a .Attr {Name :_a .Name {Local :"\u0054\u0079\u0070\u0065"},Value :_g .Sprintf ("\u0025\u0076",_e .TypeAttr )}); 57 | start .Attr =append (start .Attr ,_a .Attr {Name :_a .Name {Local :"\u0049\u0064"},Value :_g .Sprintf ("\u0025\u0076",_e .IdAttr )});e .EncodeElement (_e .Content ,start );e .EncodeToken (_a .EndElement {Name :start .Name });return nil ;};type CT_Relationships struct{Relationship []*Relationship ; 58 | }; 59 | 60 | // ValidateWithPath validates the Relationships and its children, prefixing error messages with path 61 | func (_dff *Relationships )ValidateWithPath (path string )error {if _fc :=_dff .CT_Relationships .ValidateWithPath (path );_fc !=nil {return _fc ;};return nil ;};func NewRelationships ()*Relationships {_ge :=&Relationships {};_ge .CT_Relationships =*NewCT_Relationships (); 62 | return _ge ;}; 63 | 64 | // Validate validates the CT_Relationship and its children 65 | func (_ec *CT_Relationship )Validate ()error {return _ec .ValidateWithPath ("\u0043T\u005fR\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070");};func (_ffd *Relationship )MarshalXML (e *_a .Encoder ,start _a .StartElement )error {return _ffd .CT_Relationship .MarshalXML (e ,start ); 66 | };func (_ca ST_TargetMode )Validate ()error {return _ca .ValidateWithPath ("")};func NewRelationship ()*Relationship {_cba :=&Relationship {};_cba .CT_Relationship =*NewCT_Relationship ();return _cba ;};func (_fg *Relationships )MarshalXML (e *_a .Encoder ,start _a .StartElement )error {start .Attr =append (start .Attr ,_a .Attr {Name :_a .Name {Local :"\u0078\u006d\u006cn\u0073"},Value :"ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0072\u0065\u006c\u0061\u0074\u0069\u006fn\u0073h\u0069\u0070s"}); 67 | start .Attr =append (start .Attr ,_a .Attr {Name :_a .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u0077\u00314"},Value :"\u0068\u0074t\u0070\u003a\u002f\u002f\u0073c\u0068\u0065\u006d\u0061\u0073.\u006d\u0069\u0063\u0072\u006f\u0073\u006f\u0066\u0074\u002e\u0063\u006f\u006d\u002f\u006f\u0066\u0066\u0069\u0063\u0065\u002f\u0077\u006f\u0072\u0064\u002f\u0032\u0030\u0031\u0030\u002f\u0077\u006f\u0072\u0064\u006d\u006c"}); 68 | start .Attr =append (start .Attr ,_a .Attr {Name :_a .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u0078\u006dl"},Value :"\u0068\u0074tp\u003a\u002f\u002fw\u0077\u0077\u002e\u00773.o\u0072g/\u0058\u004d\u004c\u002f\u0031\u0039\u00398/\u006e\u0061\u006d\u0065\u0073\u0070\u0061c\u0065"}); 69 | start .Name .Local ="\u0052\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073";return _fg .CT_Relationships .MarshalXML (e ,start );};const (ST_TargetModeUnset ST_TargetMode =0;ST_TargetModeExternal ST_TargetMode =1;ST_TargetModeInternal ST_TargetMode =2; 70 | );func init (){_fd .RegisterConstructor ("ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0072\u0065\u006c\u0061\u0074\u0069\u006fn\u0073h\u0069\u0070s","\u0043\u0054_\u0052\u0065\u006ca\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073",NewCT_Relationships ); 71 | _fd .RegisterConstructor ("ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0072\u0065\u006c\u0061\u0074\u0069\u006fn\u0073h\u0069\u0070s","\u0043T\u005fR\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070",NewCT_Relationship ); 72 | _fd .RegisterConstructor ("ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0072\u0065\u006c\u0061\u0074\u0069\u006fn\u0073h\u0069\u0070s","\u0052\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073",NewRelationships ); 73 | _fd .RegisterConstructor ("ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0072\u0065\u006c\u0061\u0074\u0069\u006fn\u0073h\u0069\u0070s","\u0052\u0065\u006ca\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070",NewRelationship ); 74 | }; -------------------------------------------------------------------------------- /schema/soo/dml/picture/picture.go: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2020 FoxyUtils ehf. All rights reserved. 3 | // 4 | // This is a commercial product and requires a license to operate. 5 | // A trial license can be obtained at https://unidoc.io 6 | // 7 | // DO NOT EDIT: generated by unitwist Go source code obfuscator. 8 | // 9 | // Use of this source code is governed by the UniDoc End User License Agreement 10 | // terms that can be accessed at https://unidoc.io/eula/ 11 | 12 | package picture ;import (_ca "encoding/xml";_cda "github.com/unidoc/unioffice/v2";_cd "github.com/unidoc/unioffice/v2/common/logger";_d "github.com/unidoc/unioffice/v2/schema/soo/dml";); 13 | 14 | // Validate validates the CT_PictureNonVisual and its children 15 | func (_gae *CT_PictureNonVisual )Validate ()error {return _gae .ValidateWithPath ("\u0043\u0054\u005f\u0050ic\u0074\u0075\u0072\u0065\u004e\u006f\u006e\u0056\u0069\u0073\u0075\u0061\u006c");};type CT_PictureNonVisual struct{ 16 | 17 | // Non-Visual Drawing Properties 18 | CNvPr *_d .CT_NonVisualDrawingProps ; 19 | 20 | // Non-Visual Picture Drawing Properties 21 | CNvPicPr *_d .CT_NonVisualPictureProperties ;};func NewCT_Picture ()*CT_Picture {_a :=&CT_Picture {};_a .NvPicPr =NewCT_PictureNonVisual ();_a .BlipFill =_d .NewCT_BlipFillProperties ();_a .SpPr =_d .NewCT_ShapeProperties ();return _a ;};type Pic struct{CT_Picture }; 22 | func (_ab *CT_PictureNonVisual )UnmarshalXML (d *_ca .Decoder ,start _ca .StartElement )error {_ab .CNvPr =_d .NewCT_NonVisualDrawingProps ();_ab .CNvPicPr =_d .NewCT_NonVisualPictureProperties ();_ag :for {_ae ,_aa :=d .Token ();if _aa !=nil {return _aa ; 23 | };switch _fb :=_ae .(type ){case _ca .StartElement :switch _fb .Name {case _ca .Name {Space :"\u0068\u0074\u0074\u0070\u003a\u002f/\u0073\u0063\u0068e\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072m\u0061\u0074\u0073\u002e\u006frg\u002f\u0064\u0072\u0061\u0077\u0069\u006e\u0067\u006d\u006c\u002f\u0032\u0030\u0030\u0036\u002f\u0070\u0069\u0063\u0074\u0075\u0072\u0065",Local :"\u0063\u004e\u0076P\u0072"},_ca .Name {Space :"\u0068t\u0074\u0070:\u002f\u002f\u0070\u0075r\u006c\u002e\u006fc\u006c\u0063\u002e\u006f\u0072\u0067\u002f\u006f\u006fxm\u006c\u002f\u0064r\u0061\u0077i\u006e\u0067\u006d\u006c\u002f\u0070i\u0063\u0074u\u0072\u0065",Local :"\u0063\u004e\u0076P\u0072"}:if _fg :=d .DecodeElement (_ab .CNvPr ,&_fb ); 24 | _fg !=nil {return _fg ;};case _ca .Name {Space :"\u0068\u0074\u0074\u0070\u003a\u002f/\u0073\u0063\u0068e\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072m\u0061\u0074\u0073\u002e\u006frg\u002f\u0064\u0072\u0061\u0077\u0069\u006e\u0067\u006d\u006c\u002f\u0032\u0030\u0030\u0036\u002f\u0070\u0069\u0063\u0074\u0075\u0072\u0065",Local :"\u0063\u004e\u0076\u0050\u0069\u0063\u0050\u0072"},_ca .Name {Space :"\u0068t\u0074\u0070:\u002f\u002f\u0070\u0075r\u006c\u002e\u006fc\u006c\u0063\u002e\u006f\u0072\u0067\u002f\u006f\u006fxm\u006c\u002f\u0064r\u0061\u0077i\u006e\u0067\u006d\u006c\u002f\u0070i\u0063\u0074u\u0072\u0065",Local :"\u0063\u004e\u0076\u0050\u0069\u0063\u0050\u0072"}:if _ee :=d .DecodeElement (_ab .CNvPicPr ,&_fb ); 25 | _ee !=nil {return _ee ;};default:_cd .Log .Debug ("\u0073\u006b\u0069\u0070\u0070\u0069\u006e\u0067\u0020\u0075\u006e\u0073\u0075\u0070\u0070o\u0072\u0074\u0065\u0064\u0020\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0020o\u006e\u0020\u0043\u0054\u005f\u0050\u0069\u0063\u0074\u0075\u0072\u0065No\u006e\u0056\u0069\u0073\u0075\u0061\u006c\u0020\u0025\u0076",_fb .Name ); 26 | if _fgb :=d .Skip ();_fgb !=nil {return _fgb ;};};case _ca .EndElement :break _ag ;case _ca .CharData :};};return nil ;};func (_bcg *Pic )MarshalXML (e *_ca .Encoder ,start _ca .StartElement )error {start .Attr =append (start .Attr ,_ca .Attr {Name :_ca .Name {Local :"\u0078\u006d\u006cn\u0073"},Value :"\u0068\u0074\u0074\u0070\u003a\u002f/\u0073\u0063\u0068e\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072m\u0061\u0074\u0073\u002e\u006frg\u002f\u0064\u0072\u0061\u0077\u0069\u006e\u0067\u006d\u006c\u002f\u0032\u0030\u0030\u0036\u002f\u0070\u0069\u0063\u0074\u0075\u0072\u0065"}); 27 | start .Attr =append (start .Attr ,_ca .Attr {Name :_ca .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u0070\u0069c"},Value :"\u0068\u0074\u0074\u0070\u003a\u002f/\u0073\u0063\u0068e\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072m\u0061\u0074\u0073\u002e\u006frg\u002f\u0064\u0072\u0061\u0077\u0069\u006e\u0067\u006d\u006c\u002f\u0032\u0030\u0030\u0036\u002f\u0070\u0069\u0063\u0074\u0075\u0072\u0065"}); 28 | start .Attr =append (start .Attr ,_ca .Attr {Name :_ca .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u0077\u00314"},Value :"\u0068\u0074t\u0070\u003a\u002f\u002f\u0073c\u0068\u0065\u006d\u0061\u0073.\u006d\u0069\u0063\u0072\u006f\u0073\u006f\u0066\u0074\u002e\u0063\u006f\u006d\u002f\u006f\u0066\u0066\u0069\u0063\u0065\u002f\u0077\u006f\u0072\u0064\u002f\u0032\u0030\u0031\u0030\u002f\u0077\u006f\u0072\u0064\u006d\u006c"}); 29 | start .Attr =append (start .Attr ,_ca .Attr {Name :_ca .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u0078\u006dl"},Value :"\u0068\u0074tp\u003a\u002f\u002fw\u0077\u0077\u002e\u00773.o\u0072g/\u0058\u004d\u004c\u002f\u0031\u0039\u00398/\u006e\u0061\u006d\u0065\u0073\u0070\u0061c\u0065"}); 30 | start .Name .Local ="\u0070i\u0063\u003a\u0070\u0069\u0063";return _bcg .CT_Picture .MarshalXML (e ,start );}; 31 | 32 | // ValidateWithPath validates the CT_PictureNonVisual and its children, prefixing error messages with path 33 | func (_ce *CT_PictureNonVisual )ValidateWithPath (path string )error {if _fbf :=_ce .CNvPr .ValidateWithPath (path +"\u002f\u0043\u004e\u0076\u0050\u0072");_fbf !=nil {return _fbf ;};if _fa :=_ce .CNvPicPr .ValidateWithPath (path +"\u002fC\u004e\u0076\u0050\u0069\u0063\u0050r"); 34 | _fa !=nil {return _fa ;};return nil ;};func (_ea *Pic )UnmarshalXML (d *_ca .Decoder ,start _ca .StartElement )error {_ea .CT_Picture =*NewCT_Picture ();_cae :for {_ade ,_ec :=d .Token ();if _ec !=nil {return _ec ;};switch _ddb :=_ade .(type ){case _ca .StartElement :switch _ddb .Name {case _ca .Name {Space :"\u0068\u0074\u0074\u0070\u003a\u002f/\u0073\u0063\u0068e\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072m\u0061\u0074\u0073\u002e\u006frg\u002f\u0064\u0072\u0061\u0077\u0069\u006e\u0067\u006d\u006c\u002f\u0032\u0030\u0030\u0036\u002f\u0070\u0069\u0063\u0074\u0075\u0072\u0065",Local :"\u006ev\u0050\u0069\u0063\u0050\u0072"},_ca .Name {Space :"\u0068t\u0074\u0070:\u002f\u002f\u0070\u0075r\u006c\u002e\u006fc\u006c\u0063\u002e\u006f\u0072\u0067\u002f\u006f\u006fxm\u006c\u002f\u0064r\u0061\u0077i\u006e\u0067\u006d\u006c\u002f\u0070i\u0063\u0074u\u0072\u0065",Local :"\u006ev\u0050\u0069\u0063\u0050\u0072"}:if _cfbf :=d .DecodeElement (_ea .NvPicPr ,&_ddb ); 35 | _cfbf !=nil {return _cfbf ;};case _ca .Name {Space :"\u0068\u0074\u0074\u0070\u003a\u002f/\u0073\u0063\u0068e\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072m\u0061\u0074\u0073\u002e\u006frg\u002f\u0064\u0072\u0061\u0077\u0069\u006e\u0067\u006d\u006c\u002f\u0032\u0030\u0030\u0036\u002f\u0070\u0069\u0063\u0074\u0075\u0072\u0065",Local :"\u0062\u006c\u0069\u0070\u0046\u0069\u006c\u006c"},_ca .Name {Space :"\u0068t\u0074\u0070:\u002f\u002f\u0070\u0075r\u006c\u002e\u006fc\u006c\u0063\u002e\u006f\u0072\u0067\u002f\u006f\u006fxm\u006c\u002f\u0064r\u0061\u0077i\u006e\u0067\u006d\u006c\u002f\u0070i\u0063\u0074u\u0072\u0065",Local :"\u0062\u006c\u0069\u0070\u0046\u0069\u006c\u006c"}:if _ba :=d .DecodeElement (_ea .BlipFill ,&_ddb ); 36 | _ba !=nil {return _ba ;};case _ca .Name {Space :"\u0068\u0074\u0074\u0070\u003a\u002f/\u0073\u0063\u0068e\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072m\u0061\u0074\u0073\u002e\u006frg\u002f\u0064\u0072\u0061\u0077\u0069\u006e\u0067\u006d\u006c\u002f\u0032\u0030\u0030\u0036\u002f\u0070\u0069\u0063\u0074\u0075\u0072\u0065",Local :"\u0073\u0070\u0050\u0072"},_ca .Name {Space :"\u0068t\u0074\u0070:\u002f\u002f\u0070\u0075r\u006c\u002e\u006fc\u006c\u0063\u002e\u006f\u0072\u0067\u002f\u006f\u006fxm\u006c\u002f\u0064r\u0061\u0077i\u006e\u0067\u006d\u006c\u002f\u0070i\u0063\u0074u\u0072\u0065",Local :"\u0073\u0070\u0050\u0072"}:if _aea :=d .DecodeElement (_ea .SpPr ,&_ddb ); 37 | _aea !=nil {return _aea ;};default:_cd .Log .Debug ("\u0073\u006b\u0069\u0070\u0070\u0069\u006e\u0067\u0020\u0075\u006e\u0073\u0075\u0070\u0070\u006f\u0072\u0074\u0065\u0064\u0020\u0065\u006c\u0065m\u0065\u006e\u0074\u0020\u006fn\u0020\u0050i\u0063\u0020\u0025\u0076",_ddb .Name ); 38 | if _baf :=d .Skip ();_baf !=nil {return _baf ;};};case _ca .EndElement :break _cae ;case _ca .CharData :};};return nil ;};func (_cc *CT_Picture )MarshalXML (e *_ca .Encoder ,start _ca .StartElement )error {e .EncodeToken (start );_g :=_ca .StartElement {Name :_ca .Name {Local :"p\u0069\u0063\u003a\u006e\u0076\u0050\u0069\u0063\u0050\u0072"}}; 39 | e .EncodeElement (_cc .NvPicPr ,_g );_gb :=_ca .StartElement {Name :_ca .Name {Local :"\u0070\u0069\u0063:\u0062\u006c\u0069\u0070\u0046\u0069\u006c\u006c"}};e .EncodeElement (_cc .BlipFill ,_gb );_ga :=_ca .StartElement {Name :_ca .Name {Local :"\u0070\u0069\u0063\u003a\u0073\u0070\u0050\u0072"}}; 40 | e .EncodeElement (_cc .SpPr ,_ga );e .EncodeToken (_ca .EndElement {Name :start .Name });return nil ;}; 41 | 42 | // ValidateWithPath validates the CT_Picture and its children, prefixing error messages with path 43 | func (_eb *CT_Picture )ValidateWithPath (path string )error {if _cfb :=_eb .NvPicPr .ValidateWithPath (path +"\u002f\u004e\u0076\u0050\u0069\u0063\u0050\u0072");_cfb !=nil {return _cfb ;};if _bcd :=_eb .BlipFill .ValidateWithPath (path +"\u002fB\u006c\u0069\u0070\u0046\u0069\u006cl"); 44 | _bcd !=nil {return _bcd ;};if _eg :=_eb .SpPr .ValidateWithPath (path +"\u002f\u0053\u0070P\u0072");_eg !=nil {return _eg ;};return nil ;}; 45 | 46 | // Validate validates the CT_Picture and its children 47 | func (_cf *CT_Picture )Validate ()error {return _cf .ValidateWithPath ("\u0043\u0054\u005f\u0050\u0069\u0063\u0074\u0075\u0072\u0065");}; 48 | 49 | // ValidateWithPath validates the Pic and its children, prefixing error messages with path 50 | func (_adb *Pic )ValidateWithPath (path string )error {if _be :=_adb .CT_Picture .ValidateWithPath (path );_be !=nil {return _be ;};return nil ;}; 51 | 52 | // Validate validates the Pic and its children 53 | func (_bce *Pic )Validate ()error {return _bce .ValidateWithPath ("\u0050\u0069\u0063")};func (_cbd *CT_PictureNonVisual )MarshalXML (e *_ca .Encoder ,start _ca .StartElement )error {e .EncodeToken (start );_dd :=_ca .StartElement {Name :_ca .Name {Local :"\u0070i\u0063\u003a\u0063\u004e\u0076\u0050r"}}; 54 | e .EncodeElement (_cbd .CNvPr ,_dd );_f :=_ca .StartElement {Name :_ca .Name {Local :"\u0070\u0069\u0063:\u0063\u004e\u0076\u0050\u0069\u0063\u0050\u0072"}};e .EncodeElement (_cbd .CNvPicPr ,_f );e .EncodeToken (_ca .EndElement {Name :start .Name });return nil ; 55 | };func (_dc *CT_Picture )UnmarshalXML (d *_ca .Decoder ,start _ca .StartElement )error {_dc .NvPicPr =NewCT_PictureNonVisual ();_dc .BlipFill =_d .NewCT_BlipFillProperties ();_dc .SpPr =_d .NewCT_ShapeProperties ();_gg :for {_cb ,_b :=d .Token ();if _b !=nil {return _b ; 56 | };switch _bc :=_cb .(type ){case _ca .StartElement :switch _bc .Name {case _ca .Name {Space :"\u0068\u0074\u0074\u0070\u003a\u002f/\u0073\u0063\u0068e\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072m\u0061\u0074\u0073\u002e\u006frg\u002f\u0064\u0072\u0061\u0077\u0069\u006e\u0067\u006d\u006c\u002f\u0032\u0030\u0030\u0036\u002f\u0070\u0069\u0063\u0074\u0075\u0072\u0065",Local :"\u006ev\u0050\u0069\u0063\u0050\u0072"},_ca .Name {Space :"\u0068t\u0074\u0070:\u002f\u002f\u0070\u0075r\u006c\u002e\u006fc\u006c\u0063\u002e\u006f\u0072\u0067\u002f\u006f\u006fxm\u006c\u002f\u0064r\u0061\u0077i\u006e\u0067\u006d\u006c\u002f\u0070i\u0063\u0074u\u0072\u0065",Local :"\u006ev\u0050\u0069\u0063\u0050\u0072"}:if _cdg :=d .DecodeElement (_dc .NvPicPr ,&_bc ); 57 | _cdg !=nil {return _cdg ;};case _ca .Name {Space :"\u0068\u0074\u0074\u0070\u003a\u002f/\u0073\u0063\u0068e\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072m\u0061\u0074\u0073\u002e\u006frg\u002f\u0064\u0072\u0061\u0077\u0069\u006e\u0067\u006d\u006c\u002f\u0032\u0030\u0030\u0036\u002f\u0070\u0069\u0063\u0074\u0075\u0072\u0065",Local :"\u0062\u006c\u0069\u0070\u0046\u0069\u006c\u006c"},_ca .Name {Space :"\u0068t\u0074\u0070:\u002f\u002f\u0070\u0075r\u006c\u002e\u006fc\u006c\u0063\u002e\u006f\u0072\u0067\u002f\u006f\u006fxm\u006c\u002f\u0064r\u0061\u0077i\u006e\u0067\u006d\u006c\u002f\u0070i\u0063\u0074u\u0072\u0065",Local :"\u0062\u006c\u0069\u0070\u0046\u0069\u006c\u006c"}:if _caa :=d .DecodeElement (_dc .BlipFill ,&_bc ); 58 | _caa !=nil {return _caa ;};case _ca .Name {Space :"\u0068\u0074\u0074\u0070\u003a\u002f/\u0073\u0063\u0068e\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072m\u0061\u0074\u0073\u002e\u006frg\u002f\u0064\u0072\u0061\u0077\u0069\u006e\u0067\u006d\u006c\u002f\u0032\u0030\u0030\u0036\u002f\u0070\u0069\u0063\u0074\u0075\u0072\u0065",Local :"\u0073\u0070\u0050\u0072"},_ca .Name {Space :"\u0068t\u0074\u0070:\u002f\u002f\u0070\u0075r\u006c\u002e\u006fc\u006c\u0063\u002e\u006f\u0072\u0067\u002f\u006f\u006fxm\u006c\u002f\u0064r\u0061\u0077i\u006e\u0067\u006d\u006c\u002f\u0070i\u0063\u0074u\u0072\u0065",Local :"\u0073\u0070\u0050\u0072"}:if _cg :=d .DecodeElement (_dc .SpPr ,&_bc ); 59 | _cg !=nil {return _cg ;};default:_cd .Log .Debug ("\u0073k\u0069\u0070p\u0069\u006e\u0067 \u0075\u006e\u0073\u0075\u0070\u0070\u006fr\u0074\u0065\u0064\u0020\u0065\u006ce\u006d\u0065\u006e\u0074\u0020\u006f\u006e\u0020\u0043\u0054\u005fP\u0069\u0063\u0074\u0075\u0072\u0065\u0020\u0025\u0076",_bc .Name ); 60 | if _e :=d .Skip ();_e !=nil {return _e ;};};case _ca .EndElement :break _gg ;case _ca .CharData :};};return nil ;};type CT_Picture struct{ 61 | 62 | // Non-Visual Picture Properties 63 | NvPicPr *CT_PictureNonVisual ; 64 | 65 | // Picture Fill 66 | BlipFill *_d .CT_BlipFillProperties ; 67 | 68 | // Shape Properties 69 | SpPr *_d .CT_ShapeProperties ;};func NewCT_PictureNonVisual ()*CT_PictureNonVisual {_ad :=&CT_PictureNonVisual {};_ad .CNvPr =_d .NewCT_NonVisualDrawingProps ();_ad .CNvPicPr =_d .NewCT_NonVisualPictureProperties ();return _ad ;};func NewPic ()*Pic {_abc :=&Pic {}; 70 | _abc .CT_Picture =*NewCT_Picture ();return _abc };func init (){_cda .RegisterConstructor ("\u0068\u0074\u0074\u0070\u003a\u002f/\u0073\u0063\u0068e\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072m\u0061\u0074\u0073\u002e\u006frg\u002f\u0064\u0072\u0061\u0077\u0069\u006e\u0067\u006d\u006c\u002f\u0032\u0030\u0030\u0036\u002f\u0070\u0069\u0063\u0074\u0075\u0072\u0065","\u0043\u0054\u005f\u0050ic\u0074\u0075\u0072\u0065\u004e\u006f\u006e\u0056\u0069\u0073\u0075\u0061\u006c",NewCT_PictureNonVisual ); 71 | _cda .RegisterConstructor ("\u0068\u0074\u0074\u0070\u003a\u002f/\u0073\u0063\u0068e\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072m\u0061\u0074\u0073\u002e\u006frg\u002f\u0064\u0072\u0061\u0077\u0069\u006e\u0067\u006d\u006c\u002f\u0032\u0030\u0030\u0036\u002f\u0070\u0069\u0063\u0074\u0075\u0072\u0065","\u0043\u0054\u005f\u0050\u0069\u0063\u0074\u0075\u0072\u0065",NewCT_Picture ); 72 | _cda .RegisterConstructor ("\u0068\u0074\u0074\u0070\u003a\u002f/\u0073\u0063\u0068e\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072m\u0061\u0074\u0073\u002e\u006frg\u002f\u0064\u0072\u0061\u0077\u0069\u006e\u0067\u006d\u006c\u002f\u0032\u0030\u0030\u0036\u002f\u0070\u0069\u0063\u0074\u0075\u0072\u0065","\u0070\u0069\u0063",NewPic ); 73 | }; -------------------------------------------------------------------------------- /vmldrawing/vmldrawing.go: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2020 FoxyUtils ehf. All rights reserved. 3 | // 4 | // This is a commercial product and requires a license to operate. 5 | // A trial license can be obtained at https://unidoc.io 6 | // 7 | // DO NOT EDIT: generated by unitwist Go source code obfuscator. 8 | // 9 | // Use of this source code is governed by the UniDoc End User License Agreement 10 | // terms that can be accessed at https://unidoc.io/eula/ 11 | 12 | package vmldrawing ;import (_c "encoding/xml";_d "fmt";_a "github.com/unidoc/unioffice/v2";_cb "github.com/unidoc/unioffice/v2/common/logger";_gg "github.com/unidoc/unioffice/v2/schema/soo/ofc/sharedTypes";_g "github.com/unidoc/unioffice/v2/schema/urn/schemas_microsoft_com/office/excel"; 13 | _fe "github.com/unidoc/unioffice/v2/schema/urn/schemas_microsoft_com/vml";_e "strconv";_f "strings";);const (ShapeStylePositionAbsolute ="\u0061\u0062\u0073\u006f\u006c\u0075\u0074\u0065";ShapeStylePositionRelative ="\u0072\u0065\u006c\u0061\u0074\u0069\u0076\u0065"; 14 | ); 15 | 16 | // MSOPositionVerticalRelative get `mso-position-vertical-relative` attribute of shape style. 17 | func (_fgd *ShapeStyle )MSOPositionVerticalRelative ()string {return _fgd ._fg }; 18 | 19 | // Bottom get bottom attribute of shape style. 20 | func (_ab *ShapeStyle )Bottom ()float64 {return _ab ._bb }; 21 | 22 | // ShapeStyle is style attribute of v:shape element. 23 | type ShapeStyle struct{_bdg string ;_cef float64 ;_cce float64 ;_cba float64 ;_dbb float64 ;_gf float64 ;_ecc float64 ;_bb float64 ;_gff float64 ;_dbe float64 ;_ca float64 ;_fb int64 ;_be string ;_ced string ;_fbg string ;_fg string ;}; 24 | 25 | // ToString generate string of TextpathStyle. 26 | func (_cbf *TextpathStyle )String ()string {_cf :="";_cf +=_d .Sprintf ("\u0066o\u006et\u002d\u0066\u0061\u006d\u0069\u006c\u0079\u003a\u0025\u0073\u003b",_cbf ._fc );_cf +=_d .Sprintf ("\u0066o\u006et\u002d\u0073\u0069\u007a\u0065\u003a\u0025\u0064\u0070\u0074\u003b",_cbf ._egg ); 27 | if _cbf ._cd {_cf +="\u0066o\u006et\u002d\u0073\u0074\u0079\u006ce\u003a\u0069t\u0061\u006c\u0069\u0063\u003b";};if _cbf ._fac {_cf +="\u0066\u006f\u006e\u0074\u002d\u0077\u0065\u0069\u0067\u0068\u0074\u003ab\u006f\u006c\u0064\u003b";};return _cf ;}; 28 | 29 | // Left get left attribute of shape style. 30 | func (_gdd *ShapeStyle )Left ()float64 {return _gdd ._ecc }; 31 | 32 | // SetHeight set height of shape. 33 | func (_fga *ShapeStyle )SetHeight (height float64 ){_fga ._ca =height };func (_ae *Container )UnmarshalXML (d *_c .Decoder ,start _c .StartElement )error {_ae .Shape =nil ;_fd :for {_cbb ,_ba :=d .Token ();if _ba !=nil {return _ba ;};switch _ec :=_cbb .(type ){case _c .StartElement :switch _ec .Name .Local {case "s\u0068\u0061\u0070\u0065\u006c\u0061\u0079\u006f\u0075\u0074":_ae .Layout =_fe .NewOfcShapelayout (); 34 | if _ce :=d .DecodeElement (_ae .Layout ,&_ec );_ce !=nil {return _ce ;};case "\u0073h\u0061\u0070\u0065\u0074\u0079\u0070e":_ae .ShapeType =_fe .NewShapetype ();if _eg :=d .DecodeElement (_ae .ShapeType ,&_ec );_eg !=nil {return _eg ;};case "\u0073\u0068\u0061p\u0065":_aeb :=_fe .NewShape (); 35 | if _dfe :=d .DecodeElement (_aeb ,&_ec );_dfe !=nil {return _dfe ;};_ae .Shape =append (_ae .Shape ,_aeb );};case _c .EndElement :break _fd ;};};return nil ;}; 36 | 37 | // FontSize returns fontSize of the text. 38 | func (_bba *TextpathStyle )FontSize ()int64 {return _bba ._egg }; 39 | 40 | // SetFontFamily sets text's fontFamily. 41 | func (_dcb *TextpathStyle )SetFontFamily (fontFamily string ){_dcb ._fc =fontFamily };type Container struct{Layout *_fe .OfcShapelayout ;ShapeType *_fe .Shapetype ;Shape []*_fe .Shape ;}; 42 | 43 | // SetBold sets text to bold. 44 | func (_bbca *TextpathStyle )SetBold (bold bool ){_bbca ._fac =bold }; 45 | 46 | // ToString formatting ShapeStyle to string. 47 | func (_ega *ShapeStyle )String ()string {_ed :="";_ed +=_d .Sprintf ("\u0070\u006f\u0073i\u0074\u0069\u006f\u006e\u003a\u0025\u0073\u003b",_ega ._bdg );_ed +=_d .Sprintf ("\u006da\u0072g\u0069\u006e\u002d\u006c\u0065\u0066\u0074\u003a\u0025\u0064\u003b",int64 (_ega ._cce )); 48 | _ed +=_d .Sprintf ("\u006d\u0061\u0072\u0067\u0069\u006e\u002d\u0074\u006fp\u003a\u0025\u0064\u003b",int64 (_ega ._cef ));_ed +=_d .Sprintf ("w\u0069\u0064\u0074\u0068\u003a\u0025\u0064\u0070\u0074\u003b",int64 (_ega ._dbe ));_ed +=_d .Sprintf ("\u0068\u0065\u0069g\u0068\u0074\u003a\u0025\u0064\u0070\u0074\u003b",int64 (_ega ._ca )); 49 | _ed +=_d .Sprintf ("z\u002d\u0069\u006e\u0064\u0065\u0078\u003a\u0025\u0064\u003b",_ega ._fb );_ed +=_d .Sprintf ("m\u0073\u006f\u002d\u0070\u006f\u0073i\u0074\u0069\u006f\u006e\u002d\u0068\u006f\u0072\u0069z\u006f\u006e\u0074a\u006c:\u0025\u0073\u003b",_ega ._be ); 50 | _ed +=_d .Sprintf ("\u006d\u0073o-\u0070\u006f\u0073i\u0074\u0069\u006f\u006e-ho\u0072iz\u006f\u006e\u0074\u0061\u006c\u002d\u0072el\u0061\u0074\u0069\u0076\u0065\u003a\u0025s\u003b",_ega ._ced );_ed +=_d .Sprintf ("\u006ds\u006f\u002d\u0070\u006fs\u0069\u0074\u0069\u006f\u006e-\u0076e\u0072t\u0069\u0063\u0061\u006c\u003a\u0025\u0073;",_ega ._fbg ); 51 | _ed +=_d .Sprintf ("\u006d\u0073\u006f-p\u006f\u0073\u0069\u0074\u0069\u006f\u006e\u002d\u0076e\u0072t\u0069c\u0061l\u002d\u0072\u0065\u006c\u0061\u0074\u0069\u0076\u0065\u003a\u0025\u0073\u003b",_ega ._fg );return _ed ;};func NewContainer ()*Container {return &Container {}}; 52 | func (_gd *Container )MarshalXML (e *_c .Encoder ,start _c .StartElement )error {start .Attr =append (start .Attr ,_c .Attr {Name :_c .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u0076"},Value :"\u0075\u0072n\u003a\u0073\u0063\u0068\u0065\u006d\u0061\u0073\u002d\u006d\u0069\u0063\u0072\u006f\u0073\u006f\u0066\u0074\u002d\u0063\u006f\u006d:v\u006d\u006c"}); 53 | start .Attr =append (start .Attr ,_c .Attr {Name :_c .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u006f"},Value :"\u0075\u0072\u006e\u003a\u0073\u0063\u0068\u0065\u006d\u0061\u0073\u002d\u006di\u0063\u0072\u006f\u0073\u006f\u0066t\u002d\u0063\u006f\u006d\u003a\u006f\u0066\u0066\u0069\u0063\u0065\u003a\u006ff\u0066\u0069\u0063\u0065"}); 54 | start .Attr =append (start .Attr ,_c .Attr {Name :_c .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u0078"},Value :"\u0075\u0072\u006e\u003a\u0073\u0063\u0068\u0065\u006d\u0061\u0073\u002d\u006d\u0069\u0063\u0072\u006f\u0073\u006f\u0066\u0074\u002d\u0063\u006fm\u003a\u006f\u0066\u0066\u0069c\u0065\u003ae\u0078\u0063\u0065\u006c"}); 55 | start .Name .Local ="\u0078\u006d\u006c";e .EncodeToken (start );if _gd .Layout !=nil {_gc :=_c .StartElement {Name :_c .Name {Local :"\u006f\u003a\u0073\u0068\u0061\u0070\u0065\u006c\u0061\u0079\u006f\u0075\u0074"}};e .EncodeElement (_gd .Layout ,_gc ); 56 | };if _gd .ShapeType !=nil {_ccf :=_c .StartElement {Name :_c .Name {Local :"v\u003a\u0073\u0068\u0061\u0070\u0065\u0074\u0079\u0070\u0065"}};e .EncodeElement (_gd .ShapeType ,_ccf );};for _ ,_eff :=range _gd .Shape {_df :=_c .StartElement {Name :_c .Name {Local :"\u0076:\u0073\u0068\u0061\u0070\u0065"}}; 57 | e .EncodeElement (_eff ,_df );};return e .EncodeToken (_c .EndElement {Name :start .Name });}; 58 | 59 | // NewShapeStyle accept value of string style attribute in v:shape and format it to generate ShapeStyle. 60 | func NewShapeStyle (style string )ShapeStyle {_aed :=ShapeStyle {_dbe :0,_ca :0};_fad :=_f .Split (style ,"\u003b");for _ ,_bg :=range _fad {_gdg :=_f .Split (_bg ,"\u003a");if len (_gdg )!=2{continue ;};var _bf error ;switch _gdg [0]{case "\u0070\u006f\u0073\u0069\u0074\u0069\u006f\u006e":_aed ._bdg =_gdg [1]; 61 | break ;case "\u006d\u0061\u0072\u0067\u0069\u006e\u002d\u0074\u006f\u0070":_aed ._cef ,_bf =_e .ParseFloat (_f .ReplaceAll (_gdg [1],"\u0070\u0074",""),64);break ;case "m\u0061\u0072\u0067\u0069\u006e\u002d\u006c\u0065\u0066\u0074":_aed ._cce ,_bf =_e .ParseFloat (_f .ReplaceAll (_gdg [1],"\u0070\u0074",""),64); 62 | break ;case "\u006d\u0061\u0072\u0067\u0069\u006e\u002d\u0062\u006f\u0074\u0074\u006f\u006d":_aed ._cba ,_bf =_e .ParseFloat (_f .ReplaceAll (_gdg [1],"\u0070\u0074",""),64);break ;case "\u006d\u0061\u0072g\u0069\u006e\u002d\u0072\u0069\u0067\u0068\u0074":_aed ._dbb ,_bf =_e .ParseFloat (_f .ReplaceAll (_gdg [1],"\u0070\u0074",""),64); 63 | break ;case "\u0074\u006f\u0070":_aed ._gf ,_bf =_e .ParseFloat (_f .ReplaceAll (_gdg [1],"\u0070\u0074",""),64);break ;case "\u006c\u0065\u0066\u0074":_aed ._ecc ,_bf =_e .ParseFloat (_f .ReplaceAll (_gdg [1],"\u0070\u0074",""),64);break ;case "\u0062\u006f\u0074\u0074\u006f\u006d":_aed ._bb ,_bf =_e .ParseFloat (_f .ReplaceAll (_gdg [1],"\u0070\u0074",""),64); 64 | break ;case "\u0072\u0069\u0067h\u0074":_aed ._gff ,_bf =_e .ParseFloat (_f .ReplaceAll (_gdg [1],"\u0070\u0074",""),64);break ;case "\u0077\u0069\u0064t\u0068":_aed ._dbe ,_bf =_e .ParseFloat (_f .ReplaceAll (_gdg [1],"\u0070\u0074",""),64);break ;case "\u0068\u0065\u0069\u0067\u0068\u0074":_aed ._ca ,_bf =_e .ParseFloat (_f .ReplaceAll (_gdg [1],"\u0070\u0074",""),64); 65 | break ;case "\u007a-\u0069\u006e\u0064\u0065\u0078":_aed ._fb ,_bf =_e .ParseInt (_gdg [1],10,64);break ;case "\u006d\u0073\u006f-p\u006f\u0073\u0069\u0074\u0069\u006f\u006e\u002d\u0068\u006f\u0072\u0069\u007a\u006f\u006e\u0074\u0061\u006c":_aed ._be =_gdg [1]; 66 | break ;case "\u006d\u0073\u006f\u002d\u0070\u006f\u0073\u0069\u0074\u0069\u006f\u006e\u002d\u0068\u006fr\u0069z\u006f\u006e\u0074\u0061\u006c\u002d\u0072\u0065\u006c\u0061\u0074\u0069\u0076\u0065":_aed ._ced =_gdg [1];break ;case "m\u0073\u006f\u002d\u0070os\u0069t\u0069\u006f\u006e\u002d\u0076e\u0072\u0074\u0069\u0063\u0061\u006c":_aed ._fbg =_gdg [1]; 67 | break ;case "\u006d\u0073\u006f\u002d\u0070\u006f\u0073\u0069\u0074\u0069o\u006e\u002d\u0076\u0065\u0072\u0074\u0069c\u0061\u006c\u002d\u0072\u0065\u006c\u0061\u0074\u0069\u0076\u0065":_aed ._fg =_gdg [1];break ;};if _bf !=nil {_cb .Log .Debug ("\u0055n\u0061\u0062l\u0065\u0020\u0074o\u0020\u0070\u0061\u0072\u0073\u0065\u0020s\u0074\u0079\u006c\u0065\u0020\u0061t\u0074\u0072\u0069\u0062\u0075\u0074\u0065\u003a\u0020\u0025\u0073 \u0076\u0061\u006c\u0075\u0065\u003a\u0020\u0025\u0076",_gdg [0],_gdg [1]); 68 | };};return _aed ;}; 69 | 70 | // Height return height of shape. 71 | func (_efg *ShapeStyle )Height ()float64 {return _efg ._ca }; 72 | 73 | // SetItalic sets text to italic. 74 | func (_ebd *TextpathStyle )SetItalic (italic bool ){_ebd ._cd =italic }; 75 | 76 | // Top get top attribute of shape style. 77 | func (_dc *ShapeStyle )Top ()float64 {return _dc ._gf }; 78 | 79 | // Position get position attribute of shape style. 80 | func (_egc *ShapeStyle )Position ()string {return _egc ._bdg }; 81 | 82 | // IsItalic returns true if text is italic. 83 | func (_bbba *TextpathStyle )IsItalic ()bool {return _bbba ._cd }; 84 | 85 | // CreateFormula creates F element for typeFormulas. 86 | func CreateFormula (s string )*_fe .CT_F {_bff :=_fe .NewCT_F ();_bff .EqnAttr =&s ;return _bff }; 87 | 88 | // SetWidth set width of shape. 89 | func (_ad *ShapeStyle )SetWidth (width float64 ){_ad ._dbe =width }; 90 | 91 | // NewCommentDrawing constructs a new comment drawing. 92 | func NewCommentDrawing ()*Container {_da :=NewContainer ();_da .Layout =_fe .NewOfcShapelayout ();_da .Layout .ExtAttr =_fe .ST_ExtEdit ;_da .Layout .Idmap =_fe .NewOfcCT_IdMap ();_da .Layout .Idmap .DataAttr =_a .String ("\u0031");_da .Layout .Idmap .ExtAttr =_fe .ST_ExtEdit ; 93 | _da .ShapeType =_fe .NewShapetype ();_da .ShapeType .IdAttr =_a .String ("_\u0078\u0030\u0030\u0030\u0030\u005f\u0074\u0032\u0030\u0032");_da .ShapeType .CoordsizeAttr =_a .String ("2\u0031\u0036\u0030\u0030\u002c\u0032\u0031\u0036\u0030\u0030");_da .ShapeType .SptAttr =_a .Float32 (202); 94 | _da .ShapeType .PathAttr =_a .String ("\u006d\u0030\u002c0l\u0030\u002c\u0032\u0031\u0036\u0030\u0030\u002c\u00321\u00360\u0030,\u00321\u0036\u0030\u0030\u002c\u0032\u0031\u0036\u0030\u0030\u002c\u0030\u0078\u0065");_af :=_fe .NewEG_ShapeElements ();_da .ShapeType .EG_ShapeElements =append (_da .ShapeType .EG_ShapeElements ,_af ); 95 | _af .ShapeElementsChoice .Path =_fe .NewPath ();_af .ShapeElementsChoice .Path .GradientshapeokAttr =_gg .ST_TrueFalseT ;_af .ShapeElementsChoice .Path .ConnecttypeAttr =_fe .OfcST_ConnectTypeRect ;return _da ;}; 96 | 97 | // TextpathStyle is style attribute of element v:textpath. 98 | type TextpathStyle struct{_fc string ;_egg int64 ;_fac bool ;_cd bool ;}; 99 | 100 | // Right get right attribute of shape style. 101 | func (_gdgg *ShapeStyle )Right ()float64 {return _gdgg ._gff }; 102 | 103 | // FontFamily returns fontFamily of the text. 104 | func (_ecb *TextpathStyle )FontFamily ()string {return _ecb ._fc }; 105 | 106 | // IsBold returns true if text is bold. 107 | func (_gcb *TextpathStyle )IsBold ()bool {return _gcb ._fac }; 108 | 109 | // Margins get margin top, left, bottom, and right of shape style. 110 | func (_effe *ShapeStyle )Margins ()(float64 ,float64 ,float64 ,float64 ){return _effe ._cef ,_effe ._cce ,_effe ._cba ,_effe ._dbb ;}; 111 | 112 | // SetFontSize sets text's fontSize. 113 | func (_fba *TextpathStyle )SetFontSize (fontSize int64 ){_fba ._egg =fontSize }; 114 | 115 | // NewCommentShape creates a new comment shape for a given cell index. The 116 | // indices here are zero based. 117 | func NewCommentShape (col ,row int64 )*_fe .Shape {_cbg :=_fe .NewShape ();_cbg .IdAttr =_a .String (_d .Sprintf ("\u0063\u0073\u005f\u0025\u0064\u005f\u0025\u0064",col ,row ));_cbg .TypeAttr =_a .String ("\u0023\u005f\u00780\u0030\u0030\u0030\u005f\u0074\u0032\u0030\u0032"); 118 | _cbg .StyleAttr =_a .String ("\u0070\u006f\u0073i\u0074\u0069\u006f\u006e\u003a\u0061\u0062\u0073\u006f\u006cu\u0074\u0065\u003b\u006d\u0061\u0072\u0067\u0069\u006e\u002d\u006c\u0065\u0066\u0074:\u0038\u0030\u0070\u0074;\u006d\u0061\u0072\u0067\u0069n-\u0074o\u0070\u003a\u0032pt\u003b\u0077\u0069\u0064\u0074\u0068\u003a1\u0030\u0034\u0070\u0074\u003b\u0068\u0065\u0069\u0067\u0068\u0074\u003a\u0037\u0036\u0070\u0074\u003b\u007a\u002d\u0069\u006e\u0064\u0065x\u003a\u0031\u003bv\u0069\u0073\u0069\u0062\u0069\u006c\u0069t\u0079\u003a\u0068\u0069\u0064\u0064\u0065\u006e"); 119 | _cbg .FillcolorAttr =_a .String ("\u0023f\u0062\u0066\u0036\u0064\u0036");_cbg .StrokecolorAttr =_a .String ("\u0023e\u0064\u0065\u0061\u0061\u0031");_cc :=_fe .NewFill ();_cc .Color2Attr =_a .String ("\u0023f\u0062\u0066\u0065\u0038\u0032");_cc .AngleAttr =_a .Float64 (-180); 120 | _cc .TypeAttr =_fe .ST_FillTypeGradient ;_cc .Fill =_fe .NewOfcFill ();_cc .Fill .ExtAttr =_fe .ST_ExtView ;_cc .Fill .TypeAttr =_fe .OfcST_FillTypeGradientUnscaled ;_cbg .ShapeChoice =append (_cbg .ShapeChoice ,&_fe .CT_ShapeChoice {ShapeElementsChoice :&_fe .EG_ShapeElementsChoice {Fill :_cc }}); 121 | _fa :=_fe .NewShadow ();_fa .OnAttr =_gg .ST_TrueFalseT ;_fa .ObscuredAttr =_gg .ST_TrueFalseT ;_cbg .ShapeChoice =append (_cbg .ShapeChoice ,&_fe .CT_ShapeChoice {ShapeElementsChoice :&_fe .EG_ShapeElementsChoice {Shadow :_fa }});_bd :=_fe .NewPath (); 122 | _bd .ConnecttypeAttr =_fe .OfcST_ConnectTypeNone ;_cbg .ShapeChoice =append (_cbg .ShapeChoice ,&_fe .CT_ShapeChoice {ShapeElementsChoice :&_fe .EG_ShapeElementsChoice {Path :_bd }});_db :=_fe .NewTextbox ();_db .StyleAttr =_a .String ("\u006d\u0073\u006f\u002ddi\u0072\u0065\u0063\u0074\u0069\u006f\u006e\u002d\u0061\u006c\u0074\u003a\u0061\u0075t\u006f"); 123 | _cbg .ShapeChoice =append (_cbg .ShapeChoice ,&_fe .CT_ShapeChoice {ShapeElementsChoice :&_fe .EG_ShapeElementsChoice {Textbox :_db }});_ef :=_g .NewClientData ();_ef .ObjectTypeAttr =_g .ST_ObjectTypeNote ;_ef .ClientDataChoice =[]*_g .CT_ClientDataChoice {{MoveWithCells :_gg .ST_TrueFalseBlankT },{SizeWithCells :_gg .ST_TrueFalseBlankT },{Anchor :_a .String ("\u0031,\u0020\u0031\u0035\u002c\u0020\u0030\u002c\u0020\u0032\u002c\u00202\u002c\u0020\u0035\u0034\u002c\u0020\u0035\u002c\u0020\u0033")},{AutoFill :_gg .ST_TrueFalseBlankFalse },{Row :_a .Int64 (row )},{Column :_a .Int64 (col )}}; 124 | _cbg .ShapeChoice =append (_cbg .ShapeChoice ,&_fe .CT_ShapeChoice {ShapeElementsChoice :&_fe .EG_ShapeElementsChoice {ClientData :_ef }});return _cbg ;}; 125 | 126 | // NewTextpathStyle accept value of string style attribute of element v:textpath and format it to generate TextpathStyle. 127 | func NewTextpathStyle (style string )TextpathStyle {_ag :=TextpathStyle {_fc :"\u0022C\u0061\u006c\u0069\u0062\u0072\u0069\"",_egg :44,_fac :false ,_cd :false };_de :=_f .Split (style ,"\u003b");for _ ,_bge :=range _de {_gcc :=_f .Split (_bge ,"\u003a"); 128 | if len (_gcc )!=2{continue ;};switch _gcc [0]{case "f\u006f\u006e\u0074\u002d\u0066\u0061\u006d\u0069\u006c\u0079":_ag ._fc =_gcc [1];break ;case "\u0066o\u006e\u0074\u002d\u0073\u0069\u007ae":_ag ._egg ,_ =_e .ParseInt (_f .ReplaceAll (_gcc [1],"\u0070\u0074",""),10,64); 129 | break ;case "f\u006f\u006e\u0074\u002d\u0077\u0065\u0069\u0067\u0068\u0074":_ag ._fac =_gcc [1]=="\u0062\u006f\u006c\u0064";break ;case "\u0066\u006f\u006e\u0074\u002d\u0073\u0074\u0079\u006c\u0065":_ag ._cd =_gcc [1]=="\u0069\u0074\u0061\u006c\u0069\u0063"; 130 | break ;};};return _ag ;}; 131 | 132 | // Width return width of shape. 133 | func (_eb *ShapeStyle )Width ()float64 {return _eb ._dbe }; 134 | 135 | // MSOPositionHorizontalRelative get `mso-position-horizontal-relative` attribute of shape style. 136 | func (_bbc *ShapeStyle )MSOPositionHorizontalRelative ()string {return _bbc ._ced }; --------------------------------------------------------------------------------