2020-08-23 14:15:53 +00:00
|
|
|
//
|
|
|
|
// Copyright 2020 FoxyUtils ehf. All rights reserved.
|
|
|
|
//
|
|
|
|
// This is a commercial product and requires a license to operate.
|
|
|
|
// A trial license can be obtained at https://unidoc.io
|
|
|
|
//
|
|
|
|
// DO NOT EDIT: generated by unitwist Go source code obfuscator.
|
|
|
|
//
|
|
|
|
// Use of this source code is governed by the UniDoc End User License Agreement
|
|
|
|
// terms that can be accessed at https://unidoc.io/eula/
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
Package unioffice provides creation, reading, and writing of ECMA 376 Office Open
|
|
|
|
XML documents, spreadsheets and presentations. It is still early in
|
|
|
|
development, but is progressing quickly. This library takes a slightly
|
|
|
|
different approach from others, in that it starts by trying to support all of
|
|
|
|
the ECMA-376 standard when marshaling/unmarshaling XML documents. From there it
|
|
|
|
adds wrappers around the ECMA-376 derived types that provide a more convenient
|
|
|
|
interface.
|
|
|
|
|
|
|
|
The raw XML based types reside in the `schema/`` directory. These types are
|
|
|
|
always accessible from the wrapper types via a `X() method that returns the
|
|
|
|
raw type. Except for the base documents (document.Document,
|
|
|
|
spreadsheet.Workbook and presentation.Presentation), the other wrapper types are
|
|
|
|
value types with non-pointer methods. They exist solely to modify and return
|
|
|
|
data from one or more XML types.
|
|
|
|
|
|
|
|
The packages of interest are github.com/unidoc/unioffice/document,
|
|
|
|
unidoc/unioffice/spreadsheet and github.com/unidoc/unioffice/presentation.
|
|
|
|
|
|
|
|
*/
|
2020-08-31 22:58:25 +00:00
|
|
|
package unioffice ;import (_c "encoding/xml";_cc "errors";_d "fmt";_bd "github.com/unidoc/unioffice/algo";_cf "log";_b "reflect";_aa "strings";_ca "unicode";);
|
2020-08-23 14:15:53 +00:00
|
|
|
|
|
|
|
// XSDAny is used to marshal/unmarshal xsd:any types in the OOXML schema.
|
2020-08-31 22:58:25 +00:00
|
|
|
type XSDAny struct{XMLName _c .Name ;Attrs []_c .Attr ;Data []byte ;Nodes []*XSDAny ;};func _gbe (_bab []*any )[]*XSDAny {_gbef :=[]*XSDAny {};for _ ,_fggg :=range _bab {_dce :=&XSDAny {};_dce .XMLName =_fggg .XMLName ;_dce .Attrs =_fggg .Attrs ;_dce .Data =_fggg .Data ;_dce .Nodes =_gbe (_fggg .Nodes );_gbef =append (_gbef ,_dce );};return _gbef ;};func (_eag nsSet )applyToNode (_ec *any ){if _ec .XMLName .Space ==""{return ;};_gf :=_eag .getPrefix (_ec .XMLName .Space );_ec .XMLName .Space ="";_ec .XMLName .Local =_gf +"\u003a"+_ec .XMLName .Local ;_gcd :=_ec .Attrs ;_ec .Attrs =nil ;for _ ,_agc :=range _gcd {if _agc .Name .Space =="\u0078\u006d\u006cn\u0073"{continue ;};if _agc .Name .Space !=""{_ccc :=_eag .getPrefix (_agc .Name .Space );_agc .Name .Space ="";_agc .Name .Local =_ccc +"\u003a"+_agc .Name .Local ;};_ec .Attrs =append (_ec .Attrs ,_agc );};for _ ,_eeb :=range _ec .Nodes {_eag .applyToNode (_eeb );};};
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2020-08-31 22:58:25 +00:00
|
|
|
// MarshalXML implements the xml.Marshaler interface.
|
|
|
|
func (_ggf *XSDAny )MarshalXML (e *_c .Encoder ,start _c .StartElement )error {start .Name =_ggf .XMLName ;start .Attr =_ggf .Attrs ;_dgg :=any {};_dgg .XMLName =_ggf .XMLName ;_dgg .Attrs =_ggf .Attrs ;_dgg .Data =_ggf .Data ;_dgg .Nodes =_bdd (_ggf .Nodes );_gcec :=[]string {};_fda :=false ;_dfd :=nsSet {_gce :map[string ]string {},_cd :map[string ]string {}};_ggf .collectNS (&_dfd );_dfd .applyToNode (&_dgg );for _ ,_feb :=range _dfd ._af {if _ ,_fga :=_cae [_feb ];_fga {_gcec =append (_gcec ,_feb );};_dbbd :=_dfd ._cd [_feb ];_dgg .Attrs =append (_dgg .Attrs ,_c .Attr {Name :_c .Name {Local :"\u0078\u006d\u006c\u006e\u0073\u003a"+_feb },Value :_dbbd });if _feb =="\u006d\u0063"{_fda =true ;};};if _fda &&len (_gcec )> 0{_dgg .Attrs =append (_dgg .Attrs ,_c .Attr {Name :_c .Name {Local :"\u006d\u0063\u003aI\u0067\u006e\u006f\u0072\u0061\u0062\u006c\u0065"},Value :_aa .Join (_gcec ,"\u0020")});};return e .Encode (&_dgg );};
|
2020-08-23 14:15:53 +00:00
|
|
|
|
|
|
|
// RelativeFilename returns a filename relative to the source file referenced
|
|
|
|
// from a relationships file. Index is used in some cases for files which there
|
|
|
|
// may be more than one of (e.g. worksheets/drawings/charts)
|
2020-08-31 22:58:25 +00:00
|
|
|
func RelativeFilename (dt DocType ,relToTyp ,typ string ,index int )string {_ag :=AbsoluteFilename (dt ,typ ,index );if relToTyp ==""{return _ag ;};_agg :=AbsoluteFilename (dt ,relToTyp ,index );_fg :=_aa .Split (_agg ,"\u002f");_ba :=_aa .Split (_ag ,"\u002f");_ac :=0;for _bb :=0;_bb < len (_fg );_bb ++{if _fg [_bb ]==_ba [_bb ]{_ac ++;};if _bb +1==len (_ba ){break ;};};_fg =_fg [_ac :];_ba =_ba [_ac :];_cb :=len (_fg )-1;if _cb > 0{return _bd .RepeatString ("\u002e\u002e\u002f",_cb )+_aa .Join (_ba ,"\u002f");};return _aa .Join (_ba ,"\u002f");};type any struct{XMLName _c .Name ;Attrs []_c .Attr `xml:",any,attr"`;Nodes []*any `xml:",any"`;Data []byte `xml:",chardata"`;};
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2020-08-31 22:58:25 +00:00
|
|
|
// RelativeImageFilename returns an image filename relative to the source file referenced
|
|
|
|
// from a relationships file. It is identical to RelativeFilename but is used particularly for images
|
|
|
|
// in order to handle different image formats.
|
|
|
|
func RelativeImageFilename (dt DocType ,relToTyp ,typ string ,index int ,fileExtension string )string {_bbg :=RelativeFilename (dt ,relToTyp ,typ ,index );return _bbg [0:len (_bbg )-3]+fileExtension ;};
|
2020-08-23 14:15:53 +00:00
|
|
|
|
|
|
|
// DisableLogging sets the Log function to a no-op so that any log messages are
|
|
|
|
// silently discarded.
|
2020-08-31 22:58:25 +00:00
|
|
|
func DisableLogging (){Log =func (string ,...interface{}){}};var Log =_cf .Printf ;
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2020-08-31 22:58:25 +00:00
|
|
|
// Int64 returns a copy of v as a pointer.
|
|
|
|
func Int64 (v int64 )*int64 {_gc :=v ;return &_gc };const (Unknown DocType =iota ;DocTypeSpreadsheet ;DocTypeDocument ;DocTypePresentation ;);func _ccd (_fca *any ){for _ ,_fcab :=range _fca .Nodes {_ccd (_fcab );};};
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2020-08-31 22:58:25 +00:00
|
|
|
// CreateElement creates an element with the given namespace and name. It is
|
|
|
|
// used to unmarshal some xsd:any elements to the appropriate concrete type.
|
|
|
|
func CreateElement (start _c .StartElement )(Any ,error ){_df ,_ccg :=_fc [start .Name .Space +"\u002f"+start .Name .Local ];if !_ccg {_bc :=&XSDAny {};return _bc ,nil ;};_g :=_b .ValueOf (_df );_aac :=_g .Call (nil );if len (_aac )!=1{return nil ,_d .Errorf ("\u0063\u006fn\u0073\u0074\u0072\u0075\u0063t\u006f\u0072\u0020\u0066\u0075n\u0063\u0074\u0069\u006f\u006e\u0020\u0073\u0068\u006f\u0075\u006c\u0064\u0020\u0072\u0065\u0074\u0075\u0072\u006e\u0020\u006f\u006e\u0065\u0020\u0076\u0061\u006c\u0075\u0065\u002c\u0020\u0067\u006f\u0074\u0020\u0025\u0064",len (_aac ));};_gg ,_ccg :=_aac [0].Interface ().(Any );if !_ccg {return nil ,_cc .New ("\u0063o\u006e\u0073t\u0072\u0075\u0063\u0074o\u0072\u0020\u0066u\u006e\u0063\u0074\u0069\u006f\u006e\u0020\u0073\u0068ou\u006c\u0064\u0020r\u0065\u0074u\u0072\u006e\u0020\u0061\u006e\u0079 \u0027\u0041n\u0079\u0027");};return _gg ,nil ;};const (OfficeDocumentTypeStrict ="\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0063\u006c\u0063\u002e\u006f\u0072g\u002f\u006f\u006f\u0078\u006d\u006c\u002f\u006f\u0066\u0066\u0069\u0063\u0065\u0044\u006f\u0063u\u006d\u0065\u006e\u0074\u002f\u0072\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073\u002f\u006f\u0066\u0066\u0069\u0063e\u0044\u006f\u0063\u0075\u006de\u006e\u0074";StylesTypeStrict ="\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0063\u006c\u0063\u002e\u006frg\u002fo\u006f\u0078\u006d\u006c\u002f\u006f\u0066\u0066\u0069\u0063\u0065\u0044o\u0063\u0075\u006d\u0065\u006e\u0074\u002f\u0072\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068i\u0070\u0073\u002f\u0073\u0074\u0079\u006c\u0065\u0073";ThemeTypeStrict ="h\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0063\u006c\u0063\u002e\u006f\u0072\u0067\u002f\u006f\u006f\u0078\u006d\u006c\u002fo\u0066f\u0069\u0063\u0065\u0044o\u0063\u0075m\u0065\u006e\u0074\u002f\u0072\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073\u002f\u0074\u0068\u0065\u006d\u0065";SettingsTypeStrict ="\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0063\u006c\u0063\u002eo\u0072\u0067\u002f\u006f\u006f\u0078\u006d\u006c\u002f\u006ff\u0066\u0069\u0063\u0065\u0044\u006f\u0063\u0075\u006d\u0065\u006e\u0074\u002f\u0072\u0065\u006c\u0061\u0074i\u006f\u006e\u0073\u0068\u0069\u0070s\u002f\u0073e\u0074\u0074i\u006eg\u0073";ImageTypeStrict ="h\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0063\u006c\u0063\u002e\u006f\u0072\u0067\u002f\u006f\u006f\u0078\u006d\u006c\u002fo\u0066f\u0069\u0063\u0065\u0044o\u0063\u0075m\u0065\u006e\u0074\u002f\u0072\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073\u002f\u0069\u006d\u0061\u0067\u0065";CommentsTypeStrict ="\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0063\u006c\u0063\u002eo\u0072\u0067\u002f\u006f\u006f\u0078\u006d\u006c\u002f\u006ff\u0066\u0069\u0063\u0065\u0044\u006f\u0063\u0075\u006d\u0065\u006e\u0074\u002f\u0072\u0065\u006c\u0061\u0074i\u006f\u006e\u0073\u0068\u0069\u0070s\u002f\u0063o\u006d\u006de\u006et\u0073";ThumbnailTypeStrict ="\u0068\u0074\u0074\u0070\u003a/\u002f\u0070\u0075\u0072\u006c\u002eo\u0063\u006c\u0063\u002e\u006f\u0072\u0067/\u006f\u006f\u0078m\u006c\u002f\u006f\u0066f\u0069\u0063\u0065\u0044\u006f\u0063u\u006d\u0065\u006e\u0074\u002f\u0072\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070s\u002f\u006d\u0065\u0074\u0061\u0064\u0061\u0074\u0061\u002f\u0074\u0068\u0075\u006d\u0062\u006e\u0061\u0069\u006c";DrawingTypeStrict ="\u0068t\u0074\u0070\u003a\u002f\u002f\u0070\u0075rl\u002e\u006f\u0063\u006c\u0063\u002e\u006f\u0072\u0067\u002f\u006f\u006f\u0078\u006dl\u002f\u006ff\u0066\u0069\u0063e\u0044\u006f\u0063\u0075\u006d\u0065\u006e\u0074\u002f\u0072\u0065\u006c\u0061\u0074\u0069\u006fn\u0073\u0068ip\u0073\u002f\u0064r\u0061\u0077\u0069\u006e\u0067";ChartTypeStrict ="h\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0063\u006c\u0063\u002e\u006f\u0072\u0067\u002f\u006f\u006f\u00
|
2020-08-23 14:15:53 +00:00
|
|
|
|
|
|
|
// AbsoluteImageFilename returns the full path to an image from the root of the
|
|
|
|
// zip container.
|
2020-08-31 22:58:25 +00:00
|
|
|
func AbsoluteImageFilename (dt DocType ,index int ,fileExtension string )string {_fge :=AbsoluteFilename (dt ,ImageType ,index );return _fge [0:len (_fge )-3]+fileExtension ;};var _cae =map[string ]bool {"\u0077\u0031\u0030":true ,"\u0077\u0031\u0034":true ,"\u0077\u0070\u0031\u0034":true ,"\u0077\u0031\u0035":true ,"\u0078\u0031\u0035a\u0063":true ,"\u0077\u0031\u0036s\u0065":true ,"\u0077\u0031\u0036\u0063\u0069\u0064":true ,"\u0077\u0031\u0036":true ,"\u0077\u0031\u0036\u0063\u0065\u0078":true };
|
2020-08-23 14:15:53 +00:00
|
|
|
|
|
|
|
// Bool returns a copy of v as a pointer.
|
2020-08-31 22:58:25 +00:00
|
|
|
func Bool (v bool )*bool {_ea :=v ;return &_ea };
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2020-08-31 22:58:25 +00:00
|
|
|
// Int8 returns a copy of v as a pointer.
|
|
|
|
func Int8 (v int8 )*int8 {_fa :=v ;return &_fa };
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2020-08-31 22:58:25 +00:00
|
|
|
// UnmarshalXML implements the xml.Unmarshaler interface.
|
|
|
|
func (_eaa *XSDAny )UnmarshalXML (d *_c .Decoder ,start _c .StartElement )error {_dfea :=any {};if _bf :=d .DecodeElement (&_dfea ,&start );_bf !=nil {return _bf ;};_ccd (&_dfea );_eaa .XMLName =_dfea .XMLName ;_eaa .Attrs =_dfea .Attrs ;_eaa .Data =_dfea .Data ;_eaa .Nodes =_gbe (_dfea .Nodes );return nil ;};const _fb =true ;type nsSet struct{_gce map[string ]string ;_cd map[string ]string ;_af []string ;};var _fc =map[string ]interface{}{};
|
2020-08-23 14:15:53 +00:00
|
|
|
|
|
|
|
// Uint32 returns a copy of v as a pointer.
|
2020-08-31 22:58:25 +00:00
|
|
|
func Uint32 (v uint32 )*uint32 {_ee :=v ;return &_ee };func (_fcd *XSDAny )collectNS (_ed *nsSet ){if _fcd .XMLName .Space !=""{_ed .getPrefix (_fcd .XMLName .Space );};for _ ,_cbg :=range _fcd .Attrs {if _cbg .Name .Space !=""&&_cbg .Name .Space !="\u0078\u006d\u006cn\u0073"{_ed .getPrefix (_cbg .Name .Space );};};for _ ,_ccf :=range _fcd .Nodes {_ccf .collectNS (_ed );};};const (ContentTypesFilename ="\u005b\u0043\u006f\u006ete\u006e\u0074\u005f\u0054\u0079\u0070\u0065\u0073\u005d\u002e\u0078\u006d\u006c";BaseRelsFilename ="_\u0072\u0065\u006c\u0073\u002f\u002e\u0072\u0065\u006c\u0073";);
|
|
|
|
|
|
|
|
// Any is the interface used for marshaling/unmarshaling xsd:any
|
|
|
|
type Any interface{MarshalXML (_f *_c .Encoder ,_ce _c .StartElement )error ;UnmarshalXML (_bg *_c .Decoder ,_fe _c .StartElement )error ;};func (_dg *nsSet )getPrefix (_gd string )string {if _acd ,_eed :=_cfc [_gd ];_eed {if _ ,_db :=_dg ._cd [_acd ];!_db {_dg ._cd [_acd ]=_gd ;_dg ._gce [_gd ]=_acd ;_dg ._af =append (_dg ._af ,_acd );};return _acd ;};_gd =_aa .TrimFunc (_gd ,func (_gde rune )bool {return !_ca .IsLetter (_gde )});if _afe ,_dbe :=_dg ._gce [_gd ];_dbe {return _afe ;};_bfd :=_aa .Split (_gd ,"\u002f");_bfd =_aa .Split (_bfd [len (_bfd )-1],"\u003a");_fbc :=_bfd [len (_bfd )-1];_gdf :=0;_afg :=[]byte {};for {if _gdf < len (_fbc ){_afg =append (_afg ,_fbc [_gdf ]);}else {_afg =append (_afg ,'_');};_gdf ++;if _ ,_agge :=_dg ._cd [string (_afg )];!_agge {_dg ._cd [string (_afg )]=_gd ;_dg ._gce [_gd ]=string (_afg );_dg ._af =append (_dg ._af ,string (_afg ));return string (_afg );};};};
|
2020-08-23 14:15:53 +00:00
|
|
|
|
|
|
|
// Float64 returns a copy of v as a pointer.
|
2020-08-31 22:58:25 +00:00
|
|
|
func Float64 (v float64 )*float64 {_e :=v ;return &_e };
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2020-08-31 22:58:25 +00:00
|
|
|
// Uint8 returns a copy of v as a pointer.
|
|
|
|
func Uint8 (v uint8 )*uint8 {_fgg :=v ;return &_fgg };var _cfc =func ()map[string ]string {_dfe :=map[string ]string {};for _cfg ,_ga :=range _fbg {_dfe [_ga ]=_cfg ;};return _dfe ;}();func _bdd (_gcb []*XSDAny )[]*any {_be :=[]*any {};for _ ,_ded :=range _gcb {_bbb :=&any {};_bbb .XMLName =_ded .XMLName ;_eea :=[]_c .Attr {};for _ ,_caa :=range _ded .Attrs {if _caa .Name .Local !="\u0078\u006d\u006cn\u0073"{_eea =append (_eea ,_caa );};};_bbb .Attrs =_eea ;_bbb .Data =_ded .Data ;_bbb .Nodes =_bdd (_ded .Nodes );_be =append (_be ,_bbb );};return _be ;};
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2020-08-31 22:58:25 +00:00
|
|
|
// Uint64 returns a copy of v as a pointer.
|
|
|
|
func Uint64 (v uint64 )*uint64 {_ace :=v ;return &_ace };
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2020-08-31 22:58:25 +00:00
|
|
|
// DocType represents one of the three document types supported (docx/xlsx/pptx)
|
|
|
|
type DocType byte ;
|
|
|
|
|
|
|
|
// AddPreserveSpaceAttr adds an xml:space="preserve" attribute to a start
|
|
|
|
// element if it is required for the string s.
|
|
|
|
func AddPreserveSpaceAttr (se *_c .StartElement ,s string ){if NeedsSpacePreserve (s ){se .Attr =append (se .Attr ,_c .Attr {Name :_c .Name {Local :"\u0078m\u006c\u003a\u0073\u0070\u0061\u0063e"},Value :"\u0070\u0072\u0065\u0073\u0065\u0072\u0076\u0065"});};};
|
|
|
|
|
|
|
|
// RegisterConstructor registers a constructor function used for unmarshaling
|
|
|
|
// xsd:any elements.
|
|
|
|
func RegisterConstructor (ns ,name string ,fn interface{}){_fc [ns +"\u002f"+name ]=fn };
|
2020-08-23 14:15:53 +00:00
|
|
|
|
|
|
|
// Stringf formats according to a format specifier and returns a pointer to the
|
|
|
|
// resulting string.
|
2020-08-31 22:58:25 +00:00
|
|
|
func Stringf (f string ,args ...interface{})*string {_bde :=_d .Sprintf (f ,args ...);return &_bde };
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2020-08-31 22:58:25 +00:00
|
|
|
// NeedsSpacePreserve returns true if the string has leading or trailing space.
|
|
|
|
func NeedsSpacePreserve (s string )bool {if len (s )==0{return false ;};switch s [0]{case '\t','\n','\v','\f','\r',' ',0x85,0xA0:return true ;};switch s [len (s )-1]{case '\t','\n','\v','\f','\r',' ',0x85,0xA0:return true ;};return false ;};
|
|
|
|
|
|
|
|
// Int32 returns a copy of v as a pointer.
|
|
|
|
func Int32 (v int32 )*int32 {_gb :=v ;return &_gb };
|
|
|
|
|
|
|
|
// String returns a copy of v as a pointer.
|
|
|
|
func String (v string )*string {_de :=v ;return &_de };
|
|
|
|
|
|
|
|
// Float32 returns a copy of v as a pointer.
|
|
|
|
func Float32 (v float32 )*float32 {_fec :=v ;return &_fec };
|
|
|
|
|
|
|
|
// Uint16 returns a copy of v as a pointer.
|
|
|
|
func Uint16 (v uint16 )*uint16 {_baa :=v ;return &_baa };const MinGoVersion =_fb ;var _fbg =map[string ]string {"\u0061":"\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0073\u0063\u0068\u0065m\u0061\u0073\u002e\u006f\u0070\u0065\u006e\u0078m\u006cf\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0064\u0072\u0061\u0077\u0069\u006e\u0067m\u006c\u002f\u0032\u0030\u0030\u0036\u002f\u006d\u0061\u0069\u006e","\u0064\u0063":"\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","\u0064c\u0074\u0065\u0072\u006d\u0073":"\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u006d\u0063":"\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073\u002e\u006f\u0070\u0065\u006e\u0078m\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u006d\u0061\u0072\u006b\u0075\u0070\u002d\u0063\u006f\u006d\u0070\u0061\u0074\u0069\u0062\u0069\u006ci\u0074\u0079\u002f\u0032\u00300\u0036","\u006d\u006f":"\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\u006d\u0061\u0063\u002f\u006f\u0066\u0066\u0069\u0063\u0065\u002f\u0032\u0030\u0030\u0038\u002f\u006d\u0061\u0069\u006e","\u0077":"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\u0077\u006f\u0072\u0064\u0070\u0072\u006f\u0063\u0065s\u0073i\u006e\u0067\u006d\u006c\u002f\u0032\u0030\u00306\u002fm\u0061\u0069n","\u0077\u0031\u0030":"\u0075\u0072n\u003a\u0073\u0063\u0068e\u006d\u0061s\u002d\u006d\u0069\u0063\u0072\u006f\u0073\u006ff\u0074\u002d\u0063\u006f\u006d\u003a\u006f\u0066\u0066\u0069\u0063\u0065:\u0077\u006f\u0072\u0064","\u0077\u0031\u0034":"\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","\u0077\u0031\u0035":"\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\u0032\u002f\u0077\u006f\u0072\u0064\u006d\u006c","\u0077\u006e\u0065":"\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\u0030\u0036\u002f\u0077\u006f\u0072\u0064\u006d\u006c","\u0077\u0070":"\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073\u002e\u006f\u0070\u0065\u006ex\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0064\u0072a\u0077\u0069\u006e\u0067\u006d\u006c\u002f\u0032\u0030\u0030\u0036\u002f\u0077\u006f\u0072\u0064\u0070\u0072\u006f\u0063\u0065\u0073\u0073\u0069n\u0067\u0044\u0072\u0061\u0077i\u006e\u0067","\u0077\u0070\u0031\u0034":"\u0068\u0074\u0074\u0070\u003a\u002f/\u0073\u0063\u0068\u0065\u006da\u0073\u002e\u006d\u0069\u0063\u0072o\u0073\u006f\u0066\u0074\u002ec\u006f\u006d\u002f\u006f\u0066\u0066\u0069\u0063\u0065\u002f\u0077\u006fr\u0064\u002f\u0032\u0030\u0031\u0030\u002f\u0077\u006f\u0072\u0064\u0070\u0072\u006f\u0063e\u0073\u0073\u0069\u006e\u0067\u0044\u0072\u0061w\u0069\u006e\u0067","\u0077\u0070\u0063":"\u0068\u0074t\u0070\u003a\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073\u002e\u006d\u0069\u0063\u0072\u006f\u0073\u006ff\u0074\u002e\u0063\u006f\u006d\u002fo\u0066\u0066\u0069\u0063\u0065\u002f\u0077\u006f\u0072\u0064\u002f\u0032\u0030\u00310\u002f\u0077o\u0072\u0064\u0070
|
|
|
|
|
|
|
|
// AbsoluteFilename returns the full path to a file from the root of the zip
|
|
|
|
// container. Index is used in some cases for files which there may be more than
|
|
|
|
// one of (e.g. worksheets/drawings/charts)
|
|
|
|
func AbsoluteFilename (dt DocType ,typ string ,index int )string {switch typ {case CorePropertiesType :return "\u0064\u006f\u0063\u0050\u0072\u006f\u0070\u0073\u002f\u0063\u006f\u0072e\u002e\u0078\u006d\u006c";case CustomPropertiesType :return "\u0064\u006f\u0063\u0050ro\u0070\u0073\u002f\u0063\u0075\u0073\u0074\u006f\u006d\u002e\u0078\u006d\u006c";case ExtendedPropertiesType ,ExtendedPropertiesTypeStrict :return "\u0064\u006fc\u0050\u0072\u006fp\u0073\u002f\u0061\u0070\u0070\u002e\u0078\u006d\u006c";case ThumbnailType ,ThumbnailTypeStrict :return "\u0064\u006f\u0063Pr\u006f\u0070\u0073\u002f\u0074\u0068\u0075\u006d\u0062\u006e\u0061\u0069\u006c\u002e\u006a\u0070\u0065\u0067";case CustomXMLType :return _d .Sprintf ("c\u0075s\u0074\u006f\u006d\u0058\u006d\u006c\u002f\u0069t\u0065\u006d\u0025\u0064.x\u006d\u006c",index );case PresentationPropertiesType :return "\u0070\u0070\u0074\u002f\u0070\u0072\u0065\u0073\u0050\u0072\u006f\u0070s\u002e\u0078\u006d\u006c";case ViewPropertiesType :switch dt {case DocTypePresentation :return "\u0070\u0070\u0074\u002f\u0076\u0069\u0065\u0077\u0050\u0072\u006f\u0070s\u002e\u0078\u006d\u006c";case DocTypeSpreadsheet :return "\u0078\u006c/\u0076\u0069\u0065w\u0050\u0072\u006f\u0070\u0073\u002e\u0078\u006d\u006c";case DocTypeDocument :return "\u0077o\u0072d\u002f\u0076\u0069\u0065\u0077P\u0072\u006fp\u0073\u002e\u0078\u006d\u006c";};case TableStylesType :switch dt {case DocTypePresentation :return "\u0070\u0070\u0074\u002fta\u0062\u006c\u0065\u0053\u0074\u0079\u006c\u0065\u0073\u002e\u0078\u006d\u006c";case DocTypeSpreadsheet :return "\u0078l\u002ft\u0061\u0062\u006c\u0065\u0053t\u0079\u006ce\u0073\u002e\u0078\u006d\u006c";case DocTypeDocument :return "w\u006fr\u0064\u002f\u0074\u0061\u0062\u006c\u0065\u0053t\u0079\u006c\u0065\u0073.x\u006d\u006c";};case HyperLinkType :return "";case OfficeDocumentType ,OfficeDocumentTypeStrict :switch dt {case DocTypeSpreadsheet :return "\u0078l\u002fw\u006f\u0072\u006b\u0062\u006f\u006f\u006b\u002e\u0078\u006d\u006c";case DocTypeDocument :return "\u0077\u006f\u0072\u0064\u002f\u0064\u006f\u0063\u0075\u006d\u0065\u006et\u002e\u0078\u006d\u006c";case DocTypePresentation :return "p\u0070t\u002f\u0070\u0072\u0065\u0073\u0065\u006e\u0074a\u0074\u0069\u006f\u006e.x\u006d\u006c";default:Log ("\u0075\u006e\u0073u\u0070\u0070\u006f\u0072t\u0065\u0064\u0020\u0074\u0079\u0070\u0065 \u0025\u0073\u0020\u0070\u0061\u0069\u0072\u0020\u0061\u006e\u0064\u0020\u0025\u0076",typ ,dt );};case ThemeType ,ThemeTypeStrict ,ThemeContentType :switch dt {case DocTypeSpreadsheet :return _d .Sprintf ("x\u006c/\u0074\u0068\u0065\u006d\u0065\u002f\u0074\u0068e\u006d\u0065\u0025\u0064.x\u006d\u006c",index );case DocTypeDocument :return _d .Sprintf ("\u0077\u006f\u0072\u0064/t\u0068\u0065\u006d\u0065\u002f\u0074\u0068\u0065\u006d\u0065\u0025\u0064\u002e\u0078m\u006c",index );case DocTypePresentation :return _d .Sprintf ("p\u0070\u0074\u002f\u0074he\u006de\u002f\u0074\u0068\u0065\u006de\u0025\u0064\u002e\u0078\u006d\u006c",index );default:Log ("\u0075\u006e\u0073u\u0070\u0070\u006f\u0072t\u0065\u0064\u0020\u0074\u0079\u0070\u0065 \u0025\u0073\u0020\u0070\u0061\u0069\u0072\u0020\u0061\u006e\u0064\u0020\u0025\u0076",typ ,dt );};case StylesType ,StylesTypeStrict :switch dt {case DocTypeSpreadsheet :return "\u0078\u006c\u002f\u0073\u0074\u0079\u006c\u0065\u0073\u002e\u0078\u006d\u006c";case DocTypeDocument :return "\u0077o\u0072d\u002f\u0073\u0074\u0079\u006c\u0065\u0073\u002e\u0078\u006d\u006c";case DocTypePresentation :return "\u0070\u0070\u0074\u002f\u0073\u0074\u0079\u006c\u0065s\u002e\u0078\u006d\u006c";default:Log ("\u0075\u006e\u0073u\u0070\u0070\u006f\u0072t\u0065\u0064\u0020\u0074\u0079\u0070\u0065 \u0025\u0073\u0020\u0070\u0061\u0069\u0072\u0020\u0061\u006e\u0064\u0020\u0025\u0076",typ ,dt );};case ChartType ,ChartTypeStrict ,ChartContentType :switch dt {case DocTypeSpreadsheet :return _d .Sprintf ("x\u006c\u002f\u0063\u0068ar\u0074s\u002f\u0063\u0068\u0061\u0072t\u0025\u0064\u002e\u0078\u006d\u006c",index );case DocTypeDocument :return _d .Sprintf ("\u0077\u006f\u0072d/\u0063\u0068\u
|