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.
|
|
|
|
|
|
|
|
*/
|
2021-01-04 16:11:39 +00:00
|
|
|
package unioffice ;import (_d "encoding/xml";_dgg "errors";_c "fmt";_a "github.com/unidoc/unioffice/algo";_bd "log";_g "reflect";_dg "strings";_dc "unicode";);
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2020-12-17 22:07:08 +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.
|
2021-01-04 16:11:39 +00:00
|
|
|
func CreateElement (start _d .StartElement )(Any ,error ){_ac ,_f :=_da [start .Name .Space +"\u002f"+start .Name .Local ];if !_f {_bde :=&XSDAny {};return _bde ,nil ;};_cf :=_g .ValueOf (_ac );_cg :=_cf .Call (nil );if len (_cg )!=1{return nil ,_c .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 (_cg ));};_ec ,_f :=_cg [0].Interface ().(Any );if !_f {return nil ,_dgg .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 _ec ,nil ;};
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2021-01-04 16:11:39 +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)
|
|
|
|
func RelativeFilename (dt DocType ,relToTyp ,typ string ,index int )string {_dggc :=AbsoluteFilename (dt ,typ ,index );if relToTyp ==""{return _dggc ;};_gg :=AbsoluteFilename (dt ,relToTyp ,index );_be :=_dg .Split (_gg ,"\u002f");_bc :=_dg .Split (_dggc ,"\u002f");_ga :=0;for _cc :=0;_cc < len (_be );_cc ++{if _be [_cc ]==_bc [_cc ]{_ga ++;};if _cc +1==len (_bc ){break ;};};_be =_be [_ga :];_bc =_bc [_ga :];_ee :=len (_be )-1;if _ee > 0{return _a .RepeatString ("\u002e\u002e\u002f",_ee )+_dg .Join (_bc ,"\u002f");};return _dg .Join (_bc ,"\u002f");};
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2021-01-04 16:11:39 +00:00
|
|
|
// Bool returns a copy of v as a pointer.
|
|
|
|
func Bool (v bool )*bool {_bcc :=v ;return &_bcc };
|
2020-10-12 13:59:12 +00:00
|
|
|
|
2021-01-04 16:11:39 +00:00
|
|
|
// Stringf formats according to a format specifier and returns a pointer to the
|
|
|
|
// resulting string.
|
|
|
|
func Stringf (f string ,args ...interface{})*string {_de :=_c .Sprintf (f ,args ...);return &_de };
|
2020-10-12 13:59:12 +00:00
|
|
|
|
2021-01-04 16:11:39 +00:00
|
|
|
// Int8 returns a copy of v as a pointer.
|
|
|
|
func Int8 (v int8 )*int8 {_ed :=v ;return &_ed };const MinGoVersion =_ddd ;const _ddd =true ;
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2021-01-04 16:11:39 +00:00
|
|
|
// Int64 returns a copy of v as a pointer.
|
|
|
|
func Int64 (v int64 )*int64 {_dgb :=v ;return &_dgb };
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2021-01-04 16:11:39 +00:00
|
|
|
// Any is the interface used for marshaling/unmarshaling xsd:any
|
|
|
|
type Any interface{MarshalXML (_e *_d .Encoder ,_ca _d .StartElement )error ;UnmarshalXML (_dd *_d .Decoder ,_bg _d .StartElement )error ;};
|
2020-08-31 22:58:25 +00:00
|
|
|
|
2021-01-04 16:11:39 +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 ;};
|
2020-12-17 22:07:08 +00:00
|
|
|
|
2021-01-04 16:11:39 +00:00
|
|
|
// RegisterConstructor registers a constructor function used for unmarshaling
|
|
|
|
// xsd:any elements.
|
|
|
|
func RegisterConstructor (ns ,name string ,fn interface{}){_da [ns +"\u002f"+name ]=fn };
|
|
|
|
|
|
|
|
// String returns a copy of v as a pointer.
|
|
|
|
func String (v string )*string {_db :=v ;return &_db };
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2020-11-09 01:00:18 +00:00
|
|
|
// UnmarshalXML implements the xml.Unmarshaler interface.
|
2021-01-04 16:11:39 +00:00
|
|
|
func (_fg *XSDAny )UnmarshalXML (d *_d .Decoder ,start _d .StartElement )error {_ag :=any {};if _cbf :=d .DecodeElement (&_ag ,&start );_cbf !=nil {return _cbf ;};_df (&_ag );_fg .XMLName =_ag .XMLName ;_fg .Attrs =_ag .Attrs ;_fg .Data =_ag .Data ;_fg .Nodes =_baa (_ag .Nodes );return nil ;};
|
2020-12-17 22:07:08 +00:00
|
|
|
|
2021-01-04 16:11:39 +00:00
|
|
|
// Float64 returns a copy of v as a pointer.
|
|
|
|
func Float64 (v float64 )*float64 {_gaf :=v ;return &_gaf };const (Unknown DocType =iota ;DocTypeSpreadsheet ;DocTypeDocument ;DocTypePresentation ;);type nsSet struct{_gbe map[string ]string ;_fdc map[string ]string ;_bgg []string ;};
|
|
|
|
|
|
|
|
// DocType represents one of the three document types supported (docx/xlsx/pptx)
|
|
|
|
type DocType byte ;
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2020-11-09 01:00:18 +00:00
|
|
|
// Uint64 returns a copy of v as a pointer.
|
2021-01-04 16:11:39 +00:00
|
|
|
func Uint64 (v uint64 )*uint64 {_gag :=v ;return &_gag };func _df (_deb *any ){for _ ,_eg :=range _deb .Nodes {_df (_eg );};};var _fd =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\
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2021-01-04 16:11:39 +00:00
|
|
|
// XSDAny is used to marshal/unmarshal xsd:any types in the OOXML schema.
|
|
|
|
type XSDAny struct{XMLName _d .Name ;Attrs []_d .Attr ;Data []byte ;Nodes []*XSDAny ;};func (_eb nsSet )applyToNode (_af *any ){if _af .XMLName .Space ==""{return ;};_bf :=_eb .getPrefix (_af .XMLName .Space );_af .XMLName .Space ="";_af .XMLName .Local =_bf +"\u003a"+_af .XMLName .Local ;_bcb :=_af .Attrs ;_af .Attrs =nil ;for _ ,_dad :=range _bcb {if _dad .Name .Space =="\u0078\u006d\u006cn\u0073"{continue ;};if _dad .Name .Space !=""{_ge :=_eb .getPrefix (_dad .Name .Space );_dad .Name .Space ="";_dad .Name .Local =_ge +"\u003a"+_dad .Name .Local ;};_af .Attrs =append (_af .Attrs ,_dad );};for _ ,_cag :=range _af .Nodes {_eb .applyToNode (_cag );};};func _gac (_eab []*XSDAny )[]*any {_eae :=[]*any {};for _ ,_cde :=range _eab {_ggb :=&any {};_ggb .XMLName =_cde .XMLName ;_bea :=[]_d .Attr {};for _ ,_cge :=range _cde .Attrs {if _cge .Name .Local !="\u0078\u006d\u006cn\u0073"{_bea =append (_bea ,_cge );};};_ggb .Attrs =_bea ;_ggb .Data =_cde .Data ;_ggb .Nodes =_gac (_cde .Nodes );_eae =append (_eae ,_ggb );};return _eae ;};type any struct{XMLName _d .Name ;Attrs []_d .Attr `xml:",any,attr"`;Nodes []*any `xml:",any"`;Data []byte `xml:",chardata"`;};
|
2020-08-23 14:15:53 +00:00
|
|
|
|
2020-12-17 22:07:08 +00:00
|
|
|
// 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)
|
2021-01-04 16:11:39 +00:00
|
|
|
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 _c .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 _c .Sprintf ("x\u006c/\u0074\u0068\u0065\u006d\u0065\u002f\u0074\u0068e\u006d\u0065\u0025\u0064.x\u006d\u006c",index );case DocTypeDocument :return _c .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 _c .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 _c .Sprintf ("x\u006c\u002f\u0063\u0068ar\u0074s\u002f\u0063\u0068\u0061\u0072t\u0025\u0064\u002e\u0078\u006d\u006c",index );case DocTypeDocument :return _c .Sprintf ("\u0077\u006f\u0072d/\u0063\u0068\u
|
2020-08-31 22:58:25 +00:00
|
|
|
|
2021-01-04 16:11:39 +00:00
|
|
|
// Int32 returns a copy of v as a pointer.
|
|
|
|
func Int32 (v int32 )*int32 {_cgf :=v ;return &_cgf };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";);
|
2020-08-31 22:58:25 +00:00
|
|
|
|
2020-12-17 22:07:08 +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.
|
2021-01-04 16:11:39 +00:00
|
|
|
func RelativeImageFilename (dt DocType ,relToTyp ,typ string ,index int ,fileExtension string )string {_gd :=RelativeFilename (dt ,relToTyp ,typ ,index );return _gd [0:len (_gd )-3]+fileExtension ;};
|
2020-08-31 22:58:25 +00:00
|
|
|
|
2021-01-04 16:11:39 +00:00
|
|
|
// DisableLogging sets the Log function to a no-op so that any log messages are
|
|
|
|
// silently discarded.
|
|
|
|
func DisableLogging (){Log =func (string ,...interface{}){}};var _da =map[string ]interface{}{};
|
2020-08-31 22:58:25 +00:00
|
|
|
|
2021-01-04 16:11:39 +00:00
|
|
|
// MarshalXML implements the xml.Marshaler interface.
|
|
|
|
func (_gfe *XSDAny )MarshalXML (e *_d .Encoder ,start _d .StartElement )error {start .Name =_gfe .XMLName ;start .Attr =_gfe .Attrs ;_cac :=any {};_cac .XMLName =_gfe .XMLName ;_cac .Attrs =_gfe .Attrs ;_cac .Data =_gfe .Data ;_cac .Nodes =_gac (_gfe .Nodes );_ecde :=[]string {};_eca :=false ;_dbg :=nsSet {_gbe :map[string ]string {},_fdc :map[string ]string {}};_gfe .collectNS (&_dbg );_dbg .applyToNode (&_cac );for _ ,_dggb :=range _dbg ._bgg {if _ ,_cga :=_bbd [_dggb ];_cga {_ecde =append (_ecde ,_dggb );};_bed :=_dbg ._fdc [_dggb ];_cac .Attrs =append (_cac .Attrs ,_d .Attr {Name :_d .Name {Local :"\u0078\u006d\u006c\u006e\u0073\u003a"+_dggb },Value :_bed });if _dggb =="\u006d\u0063"{_eca =true ;};};if _eca &&len (_ecde )> 0{_cac .Attrs =append (_cac .Attrs ,_d .Attr {Name :_d .Name {Local :"\u006d\u0063\u003aI\u0067\u006e\u006f\u0072\u0061\u0062\u006c\u0065"},Value :_dg .Join (_ecde ,"\u0020")});};return e .Encode (&_cac );};func (_afd *XSDAny )collectNS (_aga *nsSet ){if _afd .XMLName .Space !=""{_aga .getPrefix (_afd .XMLName .Space );};for _ ,_dag :=range _afd .Attrs {if _dag .Name .Space !=""&&_dag .Name .Space !="\u0078\u006d\u006cn\u0073"{_aga .getPrefix (_dag .Name .Space );};};for _ ,_ecd :=range _afd .Nodes {_ecd .collectNS (_aga );};};
|
|
|
|
|
|
|
|
// Uint8 returns a copy of v as a pointer.
|
|
|
|
func Uint8 (v uint8 )*uint8 {_dcb :=v ;return &_dcb };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\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\u0063\u0068\u0061\u0072\u0074";ExtendedPropertiesTypeStrict ="\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\u0065\u0078\u0074\u0065\u006e\u0064\u0065\u0064\u0050\u0072\u006f\u0070\u0065\u0072\u0074\u0069\u0065\u0073";CustomXMLTypeStrict ="\u0068\u0074\u0074\u0070\u003a/\u002f\u0070\u0075\u0072\u006c.\u006fc\u006c\u0063\u002e\u006f\u0072\u0067\u002f\u006f\u006f\u0078\u006d\u006c\u002f\u006f\u0066\u00
|
|
|
|
|
|
|
|
// Float32 returns a copy of v as a pointer.
|
|
|
|
func Float32 (v float32 )*float32 {_ef :=v ;return &_ef };
|
|
|
|
|
|
|
|
// AddPreserveSpaceAttr adds an xml:space="preserve" attribute to a start
|
|
|
|
// element if it is required for the string s.
|
|
|
|
func AddPreserveSpaceAttr (se *_d .StartElement ,s string ){if NeedsSpacePreserve (s ){se .Attr =append (se .Attr ,_d .Attr {Name :_d .Name {Local :"\u0078m\u006c\u003a\u0073\u0070\u0061\u0063e"},Value :"\u0070\u0072\u0065\u0073\u0065\u0072\u0076\u0065"});};};func _baa (_fe []*any )[]*XSDAny {_cgfe :=[]*XSDAny {};for _ ,_gdd :=range _fe {_bce :=&XSDAny {};_bce .XMLName =_gdd .XMLName ;_bce .Attrs =_gdd .Attrs ;_bce .Data =_gdd .Data ;_bce .Nodes =_baa (_gdd .Nodes );_cgfe =append (_cgfe ,_bce );};return _cgfe ;};
|
|
|
|
|
|
|
|
// AbsoluteImageFilename returns the full path to an image from the root of the
|
|
|
|
// zip container.
|
|
|
|
func AbsoluteImageFilename (dt DocType ,index int ,fileExtension string )string {_ce :=AbsoluteFilename (dt ,ImageType ,index );return _ce [0:len (_ce )-3]+fileExtension ;};
|
|
|
|
|
|
|
|
// Uint32 returns a copy of v as a pointer.
|
|
|
|
func Uint32 (v uint32 )*uint32 {_ba :=v ;return &_ba };
|
|
|
|
|
|
|
|
// Uint16 returns a copy of v as a pointer.
|
|
|
|
func Uint16 (v uint16 )*uint16 {_bcf :=v ;return &_bcf };
|