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 common contains wrapper types and utilities common to all of the
// OOXML document formats.
//
// Package common contains common properties used by the subpackages.
2023-07-04 11:04:03 +00:00
package common ; import ( _e "archive/zip" ; _d "bytes" ; _dg "encoding/xml" ; _dd "errors" ; _ff "fmt" ; _bag "github.com/unidoc/unioffice" ; _fa "github.com/unidoc/unioffice/common/logger" ; _gf "github.com/unidoc/unioffice/common/tempstorage" ; _fg "github.com/unidoc/unioffice/common/tempstorage/diskstore" ; _ec "github.com/unidoc/unioffice/measurement" ; _bb "github.com/unidoc/unioffice/schema/soo/dml" ; _gc "github.com/unidoc/unioffice/schema/soo/ofc/custom_properties" ; _fd "github.com/unidoc/unioffice/schema/soo/ofc/docPropsVTypes" ; _bf "github.com/unidoc/unioffice/schema/soo/ofc/extended_properties" ; _ca "github.com/unidoc/unioffice/schema/soo/pkg/content_types" ; _cfd "github.com/unidoc/unioffice/schema/soo/pkg/metadata/core_properties" ; _db "github.com/unidoc/unioffice/schema/soo/pkg/relationships" ; _ge "github.com/unidoc/unioffice/zippkg" ; _dc "image" ; _ "image/gif" ; _ "image/jpeg" ; _ "image/png" ; _af "os" ; _g "reflect" ; _ba "regexp" ; _fb "strconv" ; _b "strings" ; _cf "time" ; ) ; const _bgg = "2\u00300\u0036\u002d\u0030\u0031\u002d\u0030\u0032\u00541\u0035\u003a\u0030\u0034:0\u0035\u005a" ;
2020-08-23 14:15:53 +00:00
2023-07-04 11:04:03 +00:00
// CustomProperties contains document specific properties.
type CustomProperties struct { _da * _gc . Properties } ;
2020-08-23 14:15:53 +00:00
2023-07-04 11:04:03 +00:00
// Clear removes any existing relationships.
func ( _aegd Relationships ) Clear ( ) { _aegd . _bcde . Relationship = nil } ; func ( _afdc CustomProperties ) SetPropertyAsBlob ( name , blob string ) { _faf := _afdc . getNewProperty ( name ) ; _faf . Blob = & blob ; _afdc . setOrReplaceProperty ( _faf ) ; } ;
2020-08-23 14:15:53 +00:00
2023-07-04 11:04:03 +00:00
// CoreProperties contains document specific properties.
type CoreProperties struct { _fdb * _cfd . CoreProperties } ; func ( _fdf CustomProperties ) SetPropertyAsDate ( name string , date _cf . Time ) { date = date . UTC ( ) ; _gde , _ffab , _aac := date . Date ( ) ; _fde , _gcaa , _cdca := date . Clock ( ) ; _cgg := _cf . Date ( _gde , _ffab , _aac , _fde , _gcaa , _cdca , 0 , _cf . UTC ) ; _deg := _fdf . getNewProperty ( name ) ; _deg . Filetime = & _cgg ; _fdf . setOrReplaceProperty ( _deg ) ; } ; func ( _bad CustomProperties ) setProperty ( _gdf * _gc . CT_Property ) { _bad . setPropertyHelper ( _gdf , false ) } ;
2022-02-05 13:05:36 +00:00
2023-07-04 11:04:03 +00:00
// SetContentStatus records the content status of the document.
func ( _fag CoreProperties ) SetContentStatus ( s string ) { _fag . _fdb . ContentStatus = & s } ;
2022-02-05 13:05:36 +00:00
2023-07-04 11:04:03 +00:00
// NewContentTypes returns a wrapper around a newly constructed content-types.
func NewContentTypes ( ) ContentTypes { _ga := ContentTypes { _ag : _ca . NewTypes ( ) } ; _ga . AddDefault ( "\u0078\u006d\u006c" , "\u0061p\u0070l\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u0078\u006d\u006c" ) ; _ga . AddDefault ( "\u0072\u0065\u006c\u0073" , "\u0061\u0070\u0070\u006c\u0069\u0063a\u0074\u0069\u006fn\u002f\u0076\u006ed\u002e\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006fr\u006d\u0061\u0074\u0073\u002dpa\u0063\u006b\u0061\u0067\u0065\u002e\u0072\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073\u002b\u0078\u006d\u006c" ) ; _ga . AddDefault ( "\u0070\u006e\u0067" , "\u0069m\u0061\u0067\u0065\u002f\u0070\u006eg" ) ; _ga . AddDefault ( "\u006a\u0070\u0065\u0067" , "\u0069\u006d\u0061\u0067\u0065\u002f\u006a\u0070\u0065\u0067" ) ; _ga . AddDefault ( "\u006a\u0070\u0067" , "\u0069m\u0061\u0067\u0065\u002f\u006a\u0070g" ) ; _ga . AddDefault ( "\u0077\u006d\u0066" , "i\u006d\u0061\u0067\u0065\u002f\u0078\u002d\u0077\u006d\u0066" ) ; _ga . AddOverride ( "\u002fd\u006fc\u0050\u0072\u006f\u0070\u0073/\u0063\u006fr\u0065\u002e\u0078\u006d\u006c" , "\u0061\u0070\u0070\u006c\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u0076\u006e\u0064\u002e\u006f\u0070\u0065\u006ex\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073-\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002e\u0063\u006f\u0072\u0065\u002dp\u0072\u006f\u0070\u0065\u0072\u0074i\u0065\u0073\u002bx\u006d\u006c" ) ; _ga . AddOverride ( "\u002f\u0064\u006f\u0063\u0050\u0072\u006f\u0070\u0073\u002f\u0061\u0070p\u002e\u0078\u006d\u006c" , "a\u0070\u0070l\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u0076\u006e\u0064\u002e\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066o\u0072\u006d\u0061\u0074\u0073\u002d\u006f\u0066\u0066\u0069\u0063\u0065\u0064\u006f\u0063\u0075m\u0065\u006e\u0074\u002e\u0065\u0078\u0074\u0065\u006e\u0064\u0065\u0064\u002dp\u0072\u006f\u0070\u0065\u0072\u0074\u0069\u0065\u0073\u002b\u0078m\u006c" ) ; return _ga ; } ;
2020-10-12 13:59:12 +00:00
2023-07-04 11:04:03 +00:00
// RelID returns the relationship ID.
func ( _bdab ImageRef ) RelID ( ) string { return _bdab . _ffc } ; func ( _afeb CustomProperties ) SetPropertyAsBstr ( name string , bstr string ) { _daf := _afeb . getNewProperty ( name ) ; _daf . Bstr = & bstr ; _afeb . setOrReplaceProperty ( _daf ) ; } ;
2020-10-12 13:59:12 +00:00
2023-07-04 11:04:03 +00:00
// NewTable makes a new table.
func NewTable ( ) * Table { _efbc := _bb . NewTbl ( ) ; _efbc . TblPr = _bb . NewCT_TableProperties ( ) ; return & Table { _baa : _efbc } ; } ;
2020-08-23 14:15:53 +00:00
2023-07-04 11:04:03 +00:00
// X returns the inner wrapped XML type of CustomProperty.
func ( _cbd CustomProperty ) X ( ) * _gc . CT_Property { return _cbd . _ddc } ;
2020-08-23 14:15:53 +00:00
2023-07-04 11:04:03 +00:00
// X returns the inner raw content types.
func ( _faa ContentTypes ) X ( ) * _ca . Types { return _faa . _ag } ;
2020-08-23 14:15:53 +00:00
2023-07-04 11:04:03 +00:00
// ImageFromFile reads an image from a file on disk. It doesn't keep the image
// in memory and only reads it to determine the format and size. You can also
// construct an Image directly if the file and size are known.
// NOTE: See also ImageFromStorage.
func ImageFromFile ( path string ) ( Image , error ) { _cfc , _bff := _af . Open ( path ) ; _ccea := Image { } ; if _bff != nil { return _ccea , _ff . Errorf ( "\u0065\u0072\u0072or\u0020\u0072\u0065\u0061\u0064\u0069\u006e\u0067\u0020\u0069\u006d\u0061\u0067\u0065\u003a\u0020\u0025\u0073" , _bff ) ; } ; defer _cfc . Close ( ) ; _cgc , _gbgd , _bff := _dc . Decode ( _cfc ) ; if _bff != nil { return _ccea , _ff . Errorf ( "\u0075n\u0061\u0062\u006c\u0065 \u0074\u006f\u0020\u0070\u0061r\u0073e\u0020i\u006d\u0061\u0067\u0065\u003a\u0020\u0025s" , _bff ) ; } ; _ccea . Path = path ; _ccea . Format = _gbgd ; _ccea . Size = _cgc . Bounds ( ) . Size ( ) ; return _ccea , nil ; } ;
2021-03-16 20:51:18 +00:00
2023-07-04 11:04:03 +00:00
// ID returns the ID of a relationship.
func ( _bgd Relationship ) ID ( ) string { return _bgd . _fdfb . IdAttr } ;
2021-08-23 20:44:48 +00:00
2023-07-04 11:04:03 +00:00
// ExtraFile is an unsupported file type extracted from, or to be written to a
// zip package
type ExtraFile struct { ZipPath string ; DiskPath string ; } ;
2020-11-09 01:00:18 +00:00
2023-07-04 11:04:03 +00:00
// SetAuthor records the author of the document.
func ( _fbd CoreProperties ) SetAuthor ( s string ) { if _fbd . _fdb . Creator == nil { _fbd . _fdb . Creator = & _bag . XSDAny { XMLName : _dg . Name { Local : "\u0064\u0063\u003a\u0063\u0072\u0065\u0061\u0074\u006f\u0072" } } ; } ; _fbd . _fdb . Creator . Data = [ ] byte ( s ) ; } ; func ( _cgf CustomProperties ) SetPropertyAsError ( name string , error string ) { _bbf := _cgf . getNewProperty ( name ) ; _bbf . Error = & error ; _cgf . setOrReplaceProperty ( _bbf ) ; } ;
2020-11-09 01:00:18 +00:00
2023-07-04 11:04:03 +00:00
// TblStyle returns the TblStyle property.
func ( _cfbg TableStyles ) TblStyle ( ) [ ] * _bb . CT_TableStyle { return _cfbg . _afbd . TblStyle } ; func ( _bcd CustomProperties ) SetPropertyAsI2 ( name string , i2 int16 ) { _ded := _bcd . getNewProperty ( name ) ; _ded . I2 = & i2 ; _bcd . setOrReplaceProperty ( _ded ) ; } ; func ( _fdcd Relationship ) String ( ) string { return _ff . Sprintf ( "\u007b\u0049\u0044\u003a \u0025\u0073\u0020\u0054\u0061\u0072\u0067\u0065\u0074\u003a \u0025s\u0020\u0054\u0079\u0070\u0065\u003a\u0020%\u0073\u007d" , _fdcd . ID ( ) , _fdcd . Target ( ) , _fdcd . Type ( ) ) ; } ;
2020-08-23 14:15:53 +00:00
2023-07-04 11:04:03 +00:00
// SetTarget changes the target attribute of the image reference (e.g. in the case of the creation of the reference or if the image which the reference is related to was moved from one location to another).
func ( _egg * ImageRef ) SetTarget ( target string ) { _egg . _cccf = target } ;
2020-08-23 14:15:53 +00:00
2023-06-10 07:12:37 +00:00
// SetLastModifiedBy records the last person to modify the document.
2023-07-04 11:04:03 +00:00
func ( _gg CoreProperties ) SetLastModifiedBy ( s string ) { _gg . _fdb . LastModifiedBy = & s } ; func _eaf ( _afgf _cf . Time , _ecge string ) * _bag . XSDAny { _cag := & _bag . XSDAny { XMLName : _dg . Name { Local : _ecge } } ; _cag . Attrs = append ( _cag . Attrs , _dg . Attr { Name : _dg . Name { Local : "\u0078\u0073\u0069\u003a\u0074\u0079\u0070\u0065" } , Value : "\u0064\u0063\u0074\u0065\u0072\u006d\u0073\u003a\u00573\u0043\u0044\u0054\u0046" } ) ; _cag . Attrs = append ( _cag . Attrs , _dg . Attr { Name : _dg . Name { Local : "\u0078m\u006c\u006e\u0073\u003a\u0078\u0073i" } , Value : "\u0068\u0074\u0074\u0070\u003a/\u002f\u0077\u0077\u0077\u002e\u0077\u0033\u002e\u006f\u0072\u0067\u002f\u00320\u0030\u0031\u002f\u0058\u004d\u004c\u0053\u0063\u0068\u0065\u006d\u0061\u002d\u0069\u006e\u0073\u0074\u0061\u006e\u0063\u0065" } ) ; _cag . Attrs = append ( _cag . Attrs , _dg . Attr { Name : _dg . Name { Local : "\u0078\u006d\u006c\u006e\u0073\u003a\u0064\u0063\u0074\u0065\u0072\u006d\u0073" } , Value : "\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/" } ) ; _cag . Data = [ ] byte ( _afgf . Format ( _bgg ) ) ; return _cag ; } ;
2020-08-23 14:15:53 +00:00
2023-07-04 11:04:03 +00:00
// NewCustomProperties constructs a new CustomProperties.
func NewCustomProperties ( ) CustomProperties { return CustomProperties { _da : _gc . NewProperties ( ) } } ;
2021-05-31 16:22:30 +00:00
2023-07-04 11:04:03 +00:00
// Description returns the description of the document
func ( _dfd CoreProperties ) Description ( ) string { if _dfd . _fdb . Description != nil { return string ( _dfd . _fdb . Description . Data ) ; } ; return "" ; } ;
2020-08-23 14:15:53 +00:00
2023-07-04 11:04:03 +00:00
// ImageRef is a reference to an image within a document.
type ImageRef struct { _daa * DocBase ; _ggaf Relationships ; _dcc Image ; _ffc string ; _cccf string ; } ;
2020-08-23 14:15:53 +00:00
2023-07-04 11:04:03 +00:00
// AddOverride adds an override content type for a given path name.
func ( _ce ContentTypes ) AddOverride ( path , contentType string ) { if ! _b . HasPrefix ( path , "\u002f" ) { path = "\u002f" + path ; } ; if _b . HasPrefix ( contentType , "\u0068\u0074\u0074\u0070" ) { _fa . Log . Debug ( "\u0063\u006f\u006e\u0074\u0065\u006et\u0020\u0074\u0079p\u0065\u0020\u0027%\u0073\u0027\u0020\u0069\u0073\u0020\u0069\u006e\u0063\u006fr\u0072\u0065\u0063\u0074\u002c m\u0075\u0073\u0074\u0020\u006e\u006f\u0074\u0020\u0073\u0074\u0061\u0072\u0074\u0020\u0077\u0069\u0074\u0068\u0020\u0068\u0074\u0074\u0070" , contentType ) ; } ; for _ , _bfe := range _ce . _ag . Override { if _bfe . PartNameAttr == path && _bfe . ContentTypeAttr == contentType { return ; } ; } ; _cfa := _ca . NewOverride ( ) ; _cfa . PartNameAttr = path ; _cfa . ContentTypeAttr = contentType ; _ce . _ag . Override = append ( _ce . _ag . Override , _cfa ) ; } ; func ( _bgf CustomProperties ) SetPropertyAsOstream ( name string , ostream string ) { _gbg := _bgf . getNewProperty ( name ) ; _gbg . Ostream = & ostream ; _bgf . setOrReplaceProperty ( _gbg ) ; } ;
2020-08-23 14:15:53 +00:00
2023-07-04 11:04:03 +00:00
// EnsureDefault esnures that an extension and default content type exist,
// adding it if necessary.
func ( _agc ContentTypes ) EnsureDefault ( ext , contentType string ) { ext = _b . ToLower ( ext ) ; for _ , _de := range _agc . _ag . Default { if _de . ExtensionAttr == ext { _de . ContentTypeAttr = contentType ; return ; } ; } ; _cba := & _ca . Default { } ; _cba . ContentTypeAttr = contentType ; _cba . ExtensionAttr = ext ; _agc . _ag . Default = append ( _agc . _ag . Default , _cba ) ; } ;
2020-08-23 14:15:53 +00:00
2023-07-04 11:04:03 +00:00
// FindRIDForN returns the relationship ID for the i'th relationship of type t.
func ( _ggf Relationships ) FindRIDForN ( i int , t string ) string { for _ , _fafb := range _ggf . _bcde . CT_Relationships . Relationship { if _fafb . TypeAttr == t { if i == 0 { return _fafb . IdAttr ; } ; i -- ; } ; } ; return "" ; } ;
2020-10-12 13:59:12 +00:00
2023-07-04 11:04:03 +00:00
// MakeImageRef constructs an image reference which is a reference to a
// particular image file inside a document. The same image can be used multiple
// times in a document by re-use the ImageRef.
func MakeImageRef ( img Image , d * DocBase , rels Relationships ) ImageRef { return ImageRef { _dcc : img , _daa : d , _ggaf : rels } ; } ;
2020-08-23 14:15:53 +00:00
2023-07-04 11:04:03 +00:00
// EnsureOverride ensures that an override for the given path exists, adding it if necessary
func ( _dfc ContentTypes ) EnsureOverride ( path , contentType string ) { for _ , _eda := range _dfc . _ag . Override { if _eda . PartNameAttr == path { if _b . HasPrefix ( contentType , "\u0068\u0074\u0074\u0070" ) { _fa . Log . Debug ( "\u0063\u006f\u006e\u0074\u0065\u006et\u0020\u0074\u0079p\u0065\u0020\u0027%\u0073\u0027\u0020\u0069\u0073\u0020\u0069\u006e\u0063\u006fr\u0072\u0065\u0063\u0074\u002c m\u0075\u0073\u0074\u0020\u006e\u006f\u0074\u0020\u0073\u0074\u0061\u0072\u0074\u0020\u0077\u0069\u0074\u0068\u0020\u0068\u0074\u0074\u0070" , contentType ) ; } ; _eda . ContentTypeAttr = contentType ; return ; } ; } ; _dfc . AddOverride ( path , contentType ) ; } ; func ( _deab CustomProperties ) SetPropertyAsBool ( name string , b bool ) { _ccc := _deab . getNewProperty ( name ) ; _ccc . Bool = & b ; _deab . setOrReplaceProperty ( _ccc ) ; } ;
2022-02-05 13:05:36 +00:00
2023-07-04 11:04:03 +00:00
// RelativeWidth returns the relative width of an image given a fixed height.
// This is used when setting image to a fixed height to calculate the width
// required to keep the same image aspect ratio.
func ( _caad ImageRef ) RelativeWidth ( h _ec . Distance ) _ec . Distance { _eab := float64 ( _caad . Size ( ) . X ) / float64 ( _caad . Size ( ) . Y ) ; return h * _ec . Distance ( _eab ) ; } ;
2020-08-23 14:15:53 +00:00
2023-07-04 11:04:03 +00:00
// TableStyles contains document specific properties.
type TableStyles struct { _afbd * _bb . TblStyleLst } ;
2021-06-16 07:10:52 +00:00
2023-07-04 11:04:03 +00:00
// SetLinksUpToDate sets the links up to date flag.
func ( _gda AppProperties ) SetLinksUpToDate ( v bool ) { _gda . _gdd . LinksUpToDate = _bag . Bool ( v ) } ;
2021-06-16 07:10:52 +00:00
2023-07-04 11:04:03 +00:00
// SetStyle assigns TableStyle to a table.
func ( _fgb Table ) SetStyle ( style * _bb . CT_TableStyle ) { if _fgb . _baa . TblPr == nil { _fgb . _baa . TblPr = _bb . NewCT_TableProperties ( ) ; } ; if _fgb . _baa . TblPr . Choice == nil { _fgb . _baa . TblPr . Choice = _bb . NewCT_TablePropertiesChoice ( ) ; } ; _fgb . _baa . TblPr . Choice . TableStyle = style ; } ;
2021-06-16 07:10:52 +00:00
2023-07-04 11:04:03 +00:00
// CreateCustomProperties creates the custom properties of the document.
func ( _ecga * DocBase ) CreateCustomProperties ( ) { _ecga . CustomProperties = NewCustomProperties ( ) ; _ecga . AddCustomRelationships ( ) ; } ;
2022-04-09 14:27:46 +00:00
2023-07-04 11:04:03 +00:00
// PropertiesList returns the list of all custom properties of the document.
func ( _gab CustomProperties ) PropertiesList ( ) [ ] * _gc . CT_Property { return _gab . _da . Property } ; var _eddg = _dd . New ( "\u0069\u006d\u0061\u0067\u0065\u0020\u006e\u006f\u0074\u0020\u0066o\u0075\u006e\u0064\u0020\u0069\u006e\u0020\u0073\u0074\u006fr\u0061\u0067\u0065" ) ; func ( _edb CustomProperties ) SetPropertyAsI1 ( name string , i1 int8 ) { _gac := _edb . getNewProperty ( name ) ; _gac . I1 = & i1 ; _edb . setOrReplaceProperty ( _gac ) ; } ;
2020-08-23 14:15:53 +00:00
2023-07-04 11:04:03 +00:00
// GetOrCreateCustomProperties returns the custom properties of the document (and if they not exist yet, creating them first).
func ( _egb * DocBase ) GetOrCreateCustomProperties ( ) CustomProperties { if _egb . CustomProperties . X ( ) == nil { _egb . CreateCustomProperties ( ) ; } ; return _egb . CustomProperties ; } ;
2022-12-06 11:56:49 +00:00
2023-07-04 11:04:03 +00:00
// Theme is a drawingml theme.
type Theme struct { _fbfeb * _bb . Theme } ;
// AddCustomRelationships adds relationships related to custom properties to the document.
func ( _gbd * DocBase ) AddCustomRelationships ( ) { _gbd . ContentTypes . AddOverride ( "/\u0064o\u0063\u0050\u0072\u006f\u0070\u0073\u002f\u0063u\u0073\u0074\u006f\u006d.x\u006d\u006c" , "\u0061\u0070\u0070\u006c\u0069\u0063a\u0074\u0069\u006f\u006e\u002fv\u006e\u0064\u002e\u006f\u0070\u0065n\u0078\u006d\u006c\u0066\u006fr\u006d\u0061\u0074\u0073\u002d\u006f\u0066\u0066\u0069\u0063\u0065\u0064o\u0063\u0075\u006d\u0065\u006e\u0074\u002e\u0063\u0075\u0073\u0074\u006f\u006d\u002d\u0070r\u006f\u0070\u0065\u0072\u0074\u0069\u0065\u0073+\u0078\u006d\u006c" ) ; _gbd . Rels . AddRelationship ( "\u0064\u006f\u0063\u0050ro\u0070\u0073\u002f\u0063\u0075\u0073\u0074\u006f\u006d\u002e\u0078\u006d\u006c" , _bag . CustomPropertiesType ) ; } ;
// SetCreated sets the time that the document was created.
func ( _bca CoreProperties ) SetCreated ( t _cf . Time ) { _bca . _fdb . Created = _eaf ( t , "\u0064c\u0074e\u0072\u006d\u0073\u003a\u0063\u0072\u0065\u0061\u0074\u0065\u0064" ) ; } ;
// SetHeight sets row height, see measurement package.
func ( _aaee TableRow ) SetHeight ( m _ec . Distance ) { _acgg := _ec . ToEMU ( float64 ( m ) ) ; _aaee . _bga . HAttr = _bb . ST_Coordinate { ST_CoordinateUnqualified : & _acgg } ; } ; func ( _ggd CustomProperties ) SetPropertyAsR8 ( name string , r8 float64 ) { _fbg := _ggd . getNewProperty ( name ) ; _fbg . R8 = & r8 ; _ggd . setOrReplaceProperty ( _fbg ) ; } ;
// Application returns the name of the application that created the document.
2023-06-10 07:12:37 +00:00
// For unioffice created documents, it defaults to github.com/unidoc/unioffice
2023-07-04 11:04:03 +00:00
func ( _fff AppProperties ) Application ( ) string { if _fff . _gdd . Application != nil { return * _fff . _gdd . Application ; } ; return "" ; } ;
2020-08-23 14:15:53 +00:00
2023-07-04 11:04:03 +00:00
// SetDescription records the description of the document.
func ( _ceg CoreProperties ) SetDescription ( s string ) { if _ceg . _fdb . Description == nil { _ceg . _fdb . Description = & _bag . XSDAny { XMLName : _dg . Name { Local : "\u0064\u0063\u003a\u0064\u0065\u0073\u0063\u0072\u0069p\u0074\u0069\u006f\u006e" } } ; } ; _ceg . _fdb . Description . Data = [ ] byte ( s ) ; } ; func ( _gef CustomProperties ) SetPropertyAsNull ( name string ) { _efb := _gef . getNewProperty ( name ) ; _efb . Null = _fd . NewNull ( ) ; _gef . setOrReplaceProperty ( _efb ) ; } ;
2020-08-23 14:15:53 +00:00
2023-07-04 11:04:03 +00:00
// Title returns the Title of the document
func ( _bfac CoreProperties ) Title ( ) string { if _bfac . _fdb . Title != nil { return string ( _bfac . _fdb . Title . Data ) ; } ; return "" ; } ;
2020-08-23 14:15:53 +00:00
2023-07-04 11:04:03 +00:00
// NewTableWithXfrm makes a new table with a pointer to its parent Xfrm for changing its offset and size.
func NewTableWithXfrm ( xfrm * _bb . CT_Transform2D ) * Table { _eabe := _bb . NewTbl ( ) ; _eabe . TblPr = _bb . NewCT_TableProperties ( ) ; return & Table { _baa : _eabe , _ebff : xfrm } ; } ; func ( _cg CustomProperties ) SetPropertyAsVector ( name string , vector * _fd . Vector ) { _aec := _cg . getNewProperty ( name ) ; _aec . Vector = vector ; _cg . setOrReplaceProperty ( _aec ) ; } ;
2020-08-23 14:15:53 +00:00
2023-07-04 11:04:03 +00:00
// GetTargetByRelIdAndType returns a target path with the associated relation ID.
func ( _faca Relationships ) GetTargetByRelIdAndType ( idAttr string , typeAttr string ) string { for _ , _deabe := range _faca . _bcde . Relationship { if _deabe . IdAttr == idAttr && _deabe . TypeAttr == typeAttr { return _deabe . TargetAttr ; } ; } ; return "" ; } ;
2022-04-09 14:27:46 +00:00
2023-07-04 11:04:03 +00:00
// Relationship is a relationship within a .rels file.
type Relationship struct { _fdfb * _db . Relationship } ;
2021-05-31 16:22:30 +00:00
2023-07-04 11:04:03 +00:00
// Image is a container for image information. It's used as we need format and
// and size information to use images.
// It contains either the filesystem path to the image, or the image itself.
type Image struct { Size _dc . Point ; Format string ; Path string ; Data * [ ] byte ; } ;
2021-05-31 16:22:30 +00:00
2023-07-04 11:04:03 +00:00
// WriteExtraFiles writes the extra files to the zip package.
func ( _gbga * DocBase ) WriteExtraFiles ( z * _e . Writer ) error { for _ , _cbbd := range _gbga . ExtraFiles { if _eag := _ge . AddFileFromDisk ( z , _cbbd . ZipPath , _cbbd . DiskPath ) ; _eag != nil { return _eag ; } ; } ; return nil ; } ;
2020-08-23 14:15:53 +00:00
2023-07-04 11:04:03 +00:00
// X returns the inner wrapped XML type.
func ( _ebb CustomProperties ) X ( ) * _gc . Properties { return _ebb . _da } ; func ( _bbe CustomProperties ) SetPropertyAsArray ( name string , array * _fd . Array ) { _egff := _bbe . getNewProperty ( name ) ; _egff . Array = array ; _bbe . setOrReplaceProperty ( _egff ) ; } ;
2020-08-23 14:15:53 +00:00
2023-07-04 11:04:03 +00:00
// Category returns the category of the document
func ( _edd CoreProperties ) Category ( ) string { if _edd . _fdb . Category != nil { return * _edd . _fdb . Category ; } ; return "" ; } ;
2020-08-23 14:15:53 +00:00
2023-07-04 11:04:03 +00:00
// NewTableStyles constructs a new TableStyles.
func NewTableStyles ( ) TableStyles { return TableStyles { _afbd : _bb . NewTblStyleLst ( ) } } ; func ( _geb CustomProperties ) SetPropertyAsOstorage ( name string , ostorage string ) { _egea := _geb . getNewProperty ( name ) ; _egea . Ostorage = & ostorage ; _geb . setOrReplaceProperty ( _egea ) ; } ; func ( _acc CustomProperties ) SetPropertyAsI4 ( name string , i4 int32 ) { _bbc := _acc . getNewProperty ( name ) ; _bbc . I4 = & i4 ; _acc . setOrReplaceProperty ( _bbc ) ; } ;
2021-11-10 11:45:21 +00:00
2023-07-04 11:04:03 +00:00
// Company returns the name of the company that created the document.
// For unioffice created documents, it defaults to github.com/unidoc/unioffice
func ( _gca AppProperties ) Company ( ) string { if _gca . _gdd . Company != nil { return * _gca . _gdd . Company ; } ; return "" ; } ;
2023-06-10 07:12:37 +00:00
2023-07-04 11:04:03 +00:00
// Properties returns table properties.
func ( _bdfb Table ) Properties ( ) * _bb . CT_TableProperties { return _bdfb . _baa . TblPr } ; func ( _dgd CustomProperties ) SetPropertyAsStream ( name string , stream string ) { _afb := _dgd . getNewProperty ( name ) ; _afb . Stream = & stream ; _dgd . setOrReplaceProperty ( _afb ) ; } ;
2023-06-10 07:12:37 +00:00
2023-07-04 11:04:03 +00:00
// SetWidth sets column width, see measurement package.
func ( _cee TableCol ) SetWidth ( m _ec . Distance ) { _egecc := _ec . ToEMU ( float64 ( m ) ) ; _cee . _gdcc . WAttr = _bb . ST_Coordinate { ST_CoordinateUnqualified : & _egecc } ; } ;
2021-11-10 11:45:21 +00:00
2023-05-26 09:49:04 +00:00
// AddAutoRelationship adds a relationship with an automatically generated
// filename based off of the type. It should be preferred over AddRelationship
// to ensure consistent filenames are maintained.
2023-07-04 11:04:03 +00:00
func ( _ffde Relationships ) AddAutoRelationship ( dt _bag . DocType , src string , idx int , ctype string ) Relationship { return _ffde . AddRelationship ( _bag . RelativeFilename ( dt , src , ctype , idx ) , ctype ) ; } ; func ( _efba CustomProperties ) SetPropertyAsLpstr ( name string , lpstr string ) { _edc := _efba . getNewProperty ( name ) ; _edc . Lpstr = & lpstr ; _efba . setOrReplaceProperty ( _edc ) ; } ;
2021-11-10 11:45:21 +00:00
2023-07-04 11:04:03 +00:00
// SetDocSecurity sets the document security flag.
func ( _bcg AppProperties ) SetDocSecurity ( v int32 ) { _bcg . _gdd . DocSecurity = _bag . Int32 ( v ) } ;
2021-11-10 11:45:21 +00:00
2023-07-04 11:04:03 +00:00
// SetID set the ID of a relationship.
func ( _dcb Relationship ) SetID ( ID string ) { _dcb . _fdfb . IdAttr = ID ; } ; func ( _agb CustomProperties ) SetPropertyAsStorage ( name string , storage string ) { _gbbc := _agb . getNewProperty ( name ) ; _gbbc . Storage = & storage ; _agb . setOrReplaceProperty ( _gbbc ) ; } ; func ( _fbf CustomProperties ) SetPropertyAsLpwstr ( name string , lpwstr string ) { _cbef := _fbf . getNewProperty ( name ) ; _cbef . Lpwstr = & lpwstr ; _fbf . setOrReplaceProperty ( _cbef ) ; } ;
2021-11-10 11:45:21 +00:00
2023-07-04 11:04:03 +00:00
// ImageFromBytes returns an Image struct for an in-memory image. You can also
// construct an Image directly if the file and size are known.
func ImageFromBytes ( data [ ] byte ) ( Image , error ) { _fad := Image { } ; _aedb , _fagd , _eddc := _dc . Decode ( _d . NewReader ( data ) ) ; if _eddc != nil { return _fad , _ff . Errorf ( "\u0075n\u0061\u0062\u006c\u0065 \u0074\u006f\u0020\u0070\u0061r\u0073e\u0020i\u006d\u0061\u0067\u0065\u003a\u0020\u0025s" , _eddc ) ; } ; _fad . Data = & data ; _fad . Format = _fagd ; _fad . Size = _aedb . Bounds ( ) . Size ( ) ; return _fad , nil ; } ; func ( _bda CustomProperties ) SetPropertyAsUint ( name string , ui uint ) { _acda := _bda . getNewProperty ( name ) ; _dged := uint32 ( ui ) ; _acda . Uint = & _dged ; _bda . setOrReplaceProperty ( _acda ) ; } ;
2022-04-09 14:27:46 +00:00
2023-07-04 11:04:03 +00:00
// ImageFromStorage reads an image using the currently set
// temporary storage mechanism (see tempstorage). You can also
// construct an Image directly if the file and size are known.
func ImageFromStorage ( path string ) ( Image , error ) { _bge := Image { } ; _efa , _faff := _gf . Open ( path ) ; if _faff != nil { return _bge , _ff . Errorf ( "\u0065\u0072\u0072or\u0020\u0072\u0065\u0061\u0064\u0069\u006e\u0067\u0020\u0069\u006d\u0061\u0067\u0065\u003a\u0020\u0025\u0073" , _faff ) ; } ; defer _efa . Close ( ) ; _cfg , _egc , _faff := _dc . Decode ( _efa ) ; if _faff != nil { return _bge , _ff . Errorf ( "\u0075n\u0061\u0062\u006c\u0065 \u0074\u006f\u0020\u0070\u0061r\u0073e\u0020i\u006d\u0061\u0067\u0065\u003a\u0020\u0025s" , _faff ) ; } ; _bge . Path = path ; _bge . Format = _egc ; _bge . Size = _cfg . Bounds ( ) . Size ( ) ; return _bge , nil ; } ; var ReleasedAt = _cf . Date ( _cfca , _cbg , _gec , _gbde , _cgd , 0 , 0 , _cf . UTC ) ;
2021-06-16 07:10:52 +00:00
2023-07-04 11:04:03 +00:00
// SetLanguage records the language of the document.
func ( _bbgc CoreProperties ) SetLanguage ( s string ) { _bbgc . _fdb . Language = & _bag . XSDAny { XMLName : _dg . Name { Local : "d\u0063\u003a\u006c\u0061\u006e\u0067\u0075\u0061\u0067\u0065" } } ; _bbgc . _fdb . Language . Data = [ ] byte ( s ) ; } ;
2023-05-26 09:49:04 +00:00
2023-07-04 11:04:03 +00:00
// SetTitle records the title of the document.
func ( _fea CoreProperties ) SetTitle ( s string ) { if _fea . _fdb . Title == nil { _fea . _fdb . Title = & _bag . XSDAny { XMLName : _dg . Name { Local : "\u0064\u0063\u003a\u0074\u0069\u0074\u006c\u0065" } } ; } ; _fea . _fdb . Title . Data = [ ] byte ( s ) ; } ;
2022-01-15 21:17:38 +00:00
2023-07-04 11:04:03 +00:00
// Format returns the format of the underlying image
func ( _faac ImageRef ) Format ( ) string { return _faac . _dcc . Format } ;
2020-10-12 13:59:12 +00:00
2023-07-04 11:04:03 +00:00
// RelativeHeight returns the relative height of an image given a fixed width.
// This is used when setting image to a fixed width to calculate the height
// required to keep the same image aspect ratio.
func ( _afbg ImageRef ) RelativeHeight ( w _ec . Distance ) _ec . Distance { _deb := float64 ( _afbg . Size ( ) . Y ) / float64 ( _afbg . Size ( ) . X ) ; return w * _ec . Distance ( _deb ) ; } ; func ( _aaa CustomProperties ) SetPropertyAsUi8 ( name string , ui8 uint64 ) { _fgd := _aaa . getNewProperty ( name ) ; _fgd . Ui8 = & ui8 ; _aaa . setOrReplaceProperty ( _fgd ) ; } ;
2021-05-31 16:22:30 +00:00
2023-07-04 11:04:03 +00:00
// SetCategory records the category of the document.
func ( _dgc CoreProperties ) SetCategory ( s string ) { _dgc . _fdb . Category = & s } ; const _cgd = 30 ; const _eacf = "\u0032\u0020\u004aan\u0075\u0061\u0072\u0079\u0020\u0032\u0030\u0030\u0036\u0020\u0061\u0074\u0020\u0031\u0035\u003a\u0030\u0034" ;
2021-05-31 16:22:30 +00:00
2023-07-04 11:04:03 +00:00
// Path returns the path to an image file, if any.
func ( _ggafe ImageRef ) Path ( ) string { return _ggafe . _dcc . Path } ;
2022-01-15 21:17:38 +00:00
2023-07-04 11:04:03 +00:00
// SetModified sets the time that the document was modified.
func ( _acd CoreProperties ) SetModified ( t _cf . Time ) { _acd . _fdb . Modified = _eaf ( t , "\u0064\u0063t\u0065\u0072\u006ds\u003a\u006d\u006f\u0064\u0069\u0066\u0069\u0065\u0064" ) ; } ; const Version = "\u0031\u002e\u0032\u0036\u002e\u0030" ;
2022-01-15 21:17:38 +00:00
2023-07-04 11:04:03 +00:00
// GetByRelId returns a relationship with the associated relation ID.
func ( _bef Relationships ) GetByRelId ( idAttr string ) Relationship { for _ , _dac := range _bef . _bcde . Relationship { if _dac . IdAttr == idAttr { return Relationship { _fdfb : _dac } ; } ; } ; return Relationship { } ; } ;
2022-01-15 21:17:38 +00:00
2023-07-04 11:04:03 +00:00
// X returns the underlying raw XML data.
func ( _fadb Relationships ) X ( ) * _db . Relationships { return _fadb . _bcde } ;
2020-11-09 01:00:18 +00:00
2023-05-26 09:49:04 +00:00
// X returns the inner wrapped XML type.
2023-07-04 11:04:03 +00:00
func ( _dgef Relationship ) X ( ) * _db . Relationship { return _dgef . _fdfb } ;
2020-12-17 22:07:08 +00:00
2023-06-10 07:12:37 +00:00
// ContentTypes is the top level "[Content_Types].xml" in a zip package.
2023-07-04 11:04:03 +00:00
type ContentTypes struct { _ag * _ca . Types } ;
2020-12-17 22:07:08 +00:00
2023-07-04 11:04:03 +00:00
// SetOffsetX sets horizontal offset of a table in distance units (see measurement package).
func ( _dag Table ) SetOffsetX ( offX float64 ) { if _dag . _ebff . Off == nil { _dag . _ebff . Off = _bb . NewCT_Point2D ( ) ; _dec := int64 ( 0 ) ; _dag . _ebff . Off . YAttr = _bb . ST_Coordinate { ST_CoordinateUnqualified : & _dec } ; } ; _bedf := _ec . ToEMU ( offX ) ; _dag . _ebff . Off . XAttr = _bb . ST_Coordinate { ST_CoordinateUnqualified : & _bedf } ; } ;
2023-05-26 09:49:04 +00:00
2023-07-04 11:04:03 +00:00
// Target returns the target attrubute of the image reference (a path where the image file is located in the document structure).
func ( _bdcb * ImageRef ) Target ( ) string { return _bdcb . _cccf } ; func ( _dbg CustomProperties ) SetPropertyAsEmpty ( name string ) { _cdc := _dbg . getNewProperty ( name ) ; _cdc . Empty = _fd . NewEmpty ( ) ; _dbg . setOrReplaceProperty ( _cdc ) ; } ;
2020-12-17 22:07:08 +00:00
2023-07-04 11:04:03 +00:00
// CopyOverride copies override content type for a given `path` and puts it with a path `newPath`.
func ( _dde ContentTypes ) CopyOverride ( path , newPath string ) { if ! _b . HasPrefix ( path , "\u002f" ) { path = "\u002f" + path ; } ; if ! _b . HasPrefix ( newPath , "\u002f" ) { newPath = "\u002f" + newPath ; } ; for _affc := range _dde . _ag . Override { if _dde . _ag . Override [ _affc ] . PartNameAttr == path { _ddb := * _dde . _ag . Override [ _affc ] ; _ddb . PartNameAttr = newPath ; _dde . _ag . Override = append ( _dde . _ag . Override , & _ddb ) ; } ; } ; } ; const _cbg = 7 ;
2020-12-17 22:07:08 +00:00
2023-07-04 11:04:03 +00:00
// Relationships returns a slice of all of the relationships.
func ( _aaac Relationships ) Relationships ( ) [ ] Relationship { _def := [ ] Relationship { } ; for _ , _eae := range _aaac . _bcde . Relationship { _def = append ( _def , Relationship { _fdfb : _eae } ) ; } ; return _def ; } ; const _cfca = 2023 ;
2021-11-10 11:45:21 +00:00
2023-07-04 11:04:03 +00:00
// Properties returns table properties.
func ( _feag Table ) Grid ( ) * _bb . CT_TableGrid { return _feag . _baa . TblGrid } ; func ( _acg CustomProperties ) SetPropertyAsInt ( name string , i int ) { _gfgc := _acg . getNewProperty ( name ) ; _fdc := int32 ( i ) ; _gfgc . Int = & _fdc ; _acg . setOrReplaceProperty ( _gfgc ) ; } ;
2021-11-10 11:45:21 +00:00
2023-07-04 11:04:03 +00:00
// AddRelationship adds a relationship.
func ( _dbgd Relationships ) AddRelationship ( target , ctype string ) Relationship { if ! _b . HasPrefix ( ctype , "\u0068t\u0074\u0070\u003a\u002f\u002f" ) { _fa . Log . Debug ( "\u0072\u0065\u006c\u0061\u0074\u0069\u006f\u006es\u0068\u0069\u0070 t\u0079\u0070\u0065\u0020\u0025\u0073 \u0073\u0068\u006f\u0075\u006c\u0064\u0020\u0073\u0074\u0061\u0072\u0074\u0020\u0077\u0069t\u0068\u0020\u0027\u0068\u0074\u0074\u0070\u003a/\u002f\u0027" , ctype ) ; } ; _cfaf := _db . NewRelationship ( ) ; _ada := len ( _dbgd . _bcde . Relationship ) + 1 ; _cccfa := map [ string ] struct { } { } ; for _ , _ebba := range _dbgd . _bcde . Relationship { _cccfa [ _ebba . IdAttr ] = struct { } { } ; } ; for _ , _dcd := _cccfa [ _ff . Sprintf ( "\u0072\u0049\u0064%\u0064" , _ada ) ] ; _dcd ; _ , _dcd = _cccfa [ _ff . Sprintf ( "\u0072\u0049\u0064%\u0064" , _ada ) ] { _ada ++ ; } ; _cfaf . IdAttr = _ff . Sprintf ( "\u0072\u0049\u0064%\u0064" , _ada ) ; _cfaf . TargetAttr = target ; _cfaf . TypeAttr = ctype ; _dbgd . _bcde . Relationship = append ( _dbgd . _bcde . Relationship , _cfaf ) ; return Relationship { _fdfb : _cfaf } ; } ; func ( _gaca CustomProperties ) SetPropertyAsCy ( name string , cy string ) { _fed := _gaca . getNewProperty ( name ) ; _fed . Cy = & cy ; _gaca . setOrReplaceProperty ( _fed ) ; } ;
2021-11-10 11:45:21 +00:00
2023-07-04 11:04:03 +00:00
// ApplicationVersion returns the version of the application that created the
// document.
func ( _gbba AppProperties ) ApplicationVersion ( ) string { if _gbba . _gdd . AppVersion != nil { return * _gbba . _gdd . AppVersion ; } ; return "" ; } ; func ( _abde CustomProperties ) SetPropertyAsUi4 ( name string , ui4 uint32 ) { _efc := _abde . getNewProperty ( name ) ; _efc . Ui4 = & ui4 ; _abde . setOrReplaceProperty ( _efc ) ; } ;
2023-03-01 18:42:44 +00:00
2023-07-04 11:04:03 +00:00
// NewRelationships creates a new relationship wrapper.
func NewRelationships ( ) Relationships { return Relationships { _bcde : _db . NewRelationships ( ) } } ;
2022-04-09 14:27:46 +00:00
2023-07-04 11:04:03 +00:00
// Hyperlink is just an appropriately configured relationship.
type Hyperlink Relationship ;
2021-04-23 20:00:00 +00:00
2023-07-04 11:04:03 +00:00
// Table represents a table in the document.
type Table struct { _baa * _bb . Tbl ; _ebff * _bb . CT_Transform2D ; } ;
2021-05-31 16:22:30 +00:00
2023-07-04 11:04:03 +00:00
// Created returns the time that the document was created.
func ( _bcgb CoreProperties ) Created ( ) _cf . Time { return _ddbf ( _bcgb . _fdb . Created ) } ; func ( _cbee CustomProperties ) setOrReplaceProperty ( _gfg * _gc . CT_Property ) { _cbee . setPropertyHelper ( _gfg , true ) ; } ;
2021-06-16 07:10:52 +00:00
2023-07-04 11:04:03 +00:00
// AddCol adds a column to a table.
func ( _faag Table ) AddCol ( ) * TableCol { _cgbd := _bb . NewCT_TableCol ( ) ; _faag . _baa . TblGrid . GridCol = append ( _faag . _baa . TblGrid . GridCol , _cgbd ) ; for _ , _gaf := range _faag . _baa . Tr { _eef := _bb . NewCT_TableCell ( ) ; _gaf . Tc = append ( _gaf . Tc , _eef ) ; } ; return & TableCol { _gdcc : _cgbd } ; } ;
2023-05-26 09:49:04 +00:00
2023-07-04 11:04:03 +00:00
// Type returns the type of a relationship.
func ( _gfgce Relationship ) Type ( ) string { return _gfgce . _fdfb . TypeAttr } ;
2021-06-16 07:10:52 +00:00
2023-07-04 11:04:03 +00:00
// GetImageBytesByTarget returns Image object with Data bytes read from its target.
func ( _afgb * DocBase ) GetImageBytesByTarget ( target string ) ( Image , error ) { if target != "" { target = "\u0077\u006f\u0072d\u002f" + target ; for _ , _gddb := range _afgb . Images { if _gddb . Target ( ) == target { return ImageFromStorage ( _gddb . Path ( ) ) ; } ; } ; } ; return Image { } , _eddg ; } ;
2021-06-16 07:10:52 +00:00
2023-07-04 11:04:03 +00:00
// Append appends DocBase part of an office document to another DocBase.
func ( _cad DocBase ) Append ( docBase1 DocBase ) DocBase { _bg := docBase1 . ContentTypes . X ( ) ; for _ , _ad := range _bg . Default { _cad . ContentTypes . AddDefault ( _ad . ExtensionAttr , _ad . ContentTypeAttr ) ; } ; for _ , _cb := range _bg . Override { _cad . ContentTypes . AddOverride ( _cb . PartNameAttr , _cb . ContentTypeAttr ) ; } ; _ee := _cad . AppProperties . X ( ) ; _fec := docBase1 . AppProperties . X ( ) ; if _ee . Pages != nil { if _fec . Pages != nil { * _ee . Pages += * _fec . Pages ; } ; } else if _fec . Pages != nil { _ee . Pages = _fec . Pages ; } ; if _ee . Words != nil { if _fec . Words != nil { * _ee . Words += * _fec . Words ; } ; } else if _fec . Words != nil { _ee . Words = _fec . Words ; } ; if _ee . Characters != nil { if _fec . Characters != nil { * _ee . Characters += * _fec . Characters ; } ; } else if _fec . Characters != nil { _ee . Characters = _fec . Characters ; } ; if _ee . Lines != nil { if _fec . Lines != nil { * _ee . Lines += * _fec . Lines ; } ; } else if _fec . Lines != nil { _ee . Lines = _fec . Lines ; } ; if _ee . Paragraphs != nil { if _fec . Paragraphs != nil { * _ee . Paragraphs += * _fec . Paragraphs ; } ; } else if _fec . Paragraphs != nil { _ee . Paragraphs = _fec . Paragraphs ; } ; if _ee . Notes != nil { if _fec . Notes != nil { * _ee . Notes += * _fec . Notes ; } ; } else if _fec . Notes != nil { _ee . Notes = _fec . Notes ; } ; if _ee . HiddenSlides != nil { if _fec . HiddenSlides != nil { * _ee . HiddenSlides += * _fec . HiddenSlides ; } ; } else if _fec . HiddenSlides != nil { _ee . HiddenSlides = _fec . HiddenSlides ; } ; if _ee . MMClips != nil { if _fec . MMClips != nil { * _ee . MMClips += * _fec . MMClips ; } ; } else if _fec . MMClips != nil { _ee . MMClips = _fec . MMClips ; } ; if _ee . LinksUpToDate != nil { if _fec . LinksUpToDate != nil { * _ee . LinksUpToDate = * _ee . LinksUpToDate && * _fec . LinksUpToDate ; } ; } else if _fec . LinksUpToDate != nil { _ee . LinksUpToDate = _fec . LinksUpToDate ; } ; if _ee . CharactersWithSpaces != nil { if _fec . CharactersWithSpaces != nil { * _ee . CharactersWithSpaces += * _fec . CharactersWithSpaces ; } ; } else if _fec . CharactersWithSpaces != nil { _ee . CharactersWithSpaces = _fec . CharactersWithSpaces ; } ; if _ee . SharedDoc != nil { if _fec . SharedDoc != nil { * _ee . SharedDoc = * _ee . SharedDoc || * _fec . SharedDoc ; } ; } else if _fec . SharedDoc != nil { _ee . SharedDoc = _fec . SharedDoc ; } ; if _ee . HyperlinksChanged != nil { if _fec . HyperlinksChanged != nil { * _ee . HyperlinksChanged = * _ee . HyperlinksChanged || * _fec . HyperlinksChanged ; } ; } else if _fec . HyperlinksChanged != nil { _ee . HyperlinksChanged = _fec . HyperlinksChanged ; } ; _ee . DigSig = nil ; if _ee . TitlesOfParts == nil && _fec . TitlesOfParts != nil { _ee . TitlesOfParts = _fec . TitlesOfParts ; } ; if _ee . HeadingPairs != nil { if _fec . HeadingPairs != nil { _bfa := _ee . HeadingPairs . Vector ; _bfad := _fec . HeadingPairs . Vector ; _bbb := _bfa . Variant ; _ab := _bfad . Variant ; _gb := [ ] * _fd . Variant { } ; for _gfd := 0 ; _gfd < len ( _ab ) ; _gfd += 2 { _bc := _ab [ _gfd ] . Lpstr ; _afd := false ; for _aa := 0 ; _aa < len ( _bbb ) ; _aa += 2 { _bbg := _bbb [ _aa ] . Lpstr ; if _bbg != nil && _bc != nil && * _bbg == * _bc { * _bbb [ _aa + 1 ] . I4 = * _bbb [ _aa + 1 ] . I4 + * _ab [ _gfd + 1 ] . I4 ; _afd = true ; break ; } ; } ; if ! _afd { _gb = append ( _gb , & _fd . Variant { CT_Variant : _fd . CT_Variant { Lpstr : _ab [ _gfd ] . Lpstr } } ) ; _gb = append ( _gb , & _fd . Variant { CT_Variant : _fd . CT_Variant { I4 : _ab [ _gfd ] . I4 } } ) ; } ; } ; _bbb = append ( _bbb , _gb ... ) ; _bfa . SizeAttr = uint32 ( len ( _bbb ) ) ; } ; } else if _fec . HeadingPairs != nil { _ee . HeadingPairs = _fec . HeadingPairs ; } ; if _ee . HLinks != nil { if _fec . HLinks != nil { _ea := _ee . HLinks . Vector ; _bd := _fec . HLinks . Vector ; _eg := _ea . Variant ; _afe := _bd . Variant ; for _ , _cc := range _afe { _ae := true ; for _ , _cd := range _eg { if _g . DeepEqual ( _cd , _cc ) { _ae = false ; break ; } ; } ; if _ae { _eg = append ( _eg , _cc ) ; _ea . SizeAttr ++ ; } ; } ; } ; } else if _fec . HLinks != nil { _ee . HLinks = _fec . HLinks ; } ; _df := _cad . GetOrCreateCustomProperties ( ) ; _caa := docBase1 . GetOrCreateCustomProperties ( ) ; for _ , _ega := range _caa . PropertiesList ( ) { _df . setProperty ( _ega ) ; } ; _cad . CustomProperties = _df ; _aaf := _cad . Rels . X ( ) . Relationship ; for _ , _ffd := range docBase1 . Rels . X ( ) . Relationship { _ecc := true ; for _ , _gbb := range _aaf { if _gbb . TargetAttr == _ffd . TargetAttr && _gbb . TypeAttr == _ffd . TypeAttr { _ecc = false ; break ; } ; } ; if _ecc {
2021-06-16 07:10:52 +00:00
2023-07-04 11:04:03 +00:00
// AddDefault registers a default content type for a given file extension.
func ( _aff ContentTypes ) AddDefault ( fileExtension string , contentType string ) { fileExtension = _b . ToLower ( fileExtension ) ; for _ , _cfb := range _aff . _ag . Default { if _cfb . ExtensionAttr == fileExtension && _cfb . ContentTypeAttr == contentType { return ; } ; } ; _ged := _ca . NewDefault ( ) ; _ged . ExtensionAttr = fileExtension ; _ged . ContentTypeAttr = contentType ; _aff . _ag . Default = append ( _aff . _ag . Default , _ged ) ; } ;
2021-06-16 07:10:52 +00:00
2023-07-04 11:04:03 +00:00
// CustomProperty contains document specific property.
// Using of this type is deprecated.
type CustomProperty struct { _ddc * _gc . CT_Property } ;
2021-06-16 07:10:52 +00:00
2023-07-04 11:04:03 +00:00
// NewRelationship constructs a new relationship.
func NewRelationship ( ) Relationship { return Relationship { _fdfb : _db . NewRelationship ( ) } } ;
2021-06-16 07:10:52 +00:00
2023-07-04 11:04:03 +00:00
// X returns the inner wrapped XML type.
func ( _efag Theme ) X ( ) * _bb . Theme { return _efag . _fbfeb } ; func ( _cdea CustomProperties ) SetPropertyAsUi1 ( name string , ui1 uint8 ) { _ddf := _cdea . getNewProperty ( name ) ; _ddf . Ui1 = & ui1 ; _cdea . setOrReplaceProperty ( _ddf ) ; } ; func ( _cbaa CustomProperties ) SetPropertyAsR4 ( name string , r4 float32 ) { _cbed := _cbaa . getNewProperty ( name ) ; _cbed . R4 = & r4 ; _cbaa . setOrReplaceProperty ( _cbed ) ; } ;
2022-02-25 19:20:45 +00:00
2023-06-10 07:12:37 +00:00
// AppProperties contains properties specific to the document and the
// application that created it.
2023-07-04 11:04:03 +00:00
type AppProperties struct { _gdd * _bf . Properties } ;
2022-02-25 19:20:45 +00:00
2023-07-04 11:04:03 +00:00
// CopyRelationship copies the relationship.
func ( _ffb Relationships ) CopyRelationship ( idAttr string ) ( Relationship , bool ) { for _eca := range _ffb . _bcde . Relationship { if _ffb . _bcde . Relationship [ _eca ] . IdAttr == idAttr { _dbdd := * _ffb . _bcde . Relationship [ _eca ] ; _bfg := len ( _ffb . _bcde . Relationship ) + 1 ; _cge := map [ string ] struct { } { } ; for _ , _eff := range _ffb . _bcde . Relationship { _cge [ _eff . IdAttr ] = struct { } { } ; } ; for _ , _fgag := _cge [ _ff . Sprintf ( "\u0072\u0049\u0064%\u0064" , _bfg ) ] ; _fgag ; _ , _fgag = _cge [ _ff . Sprintf ( "\u0072\u0049\u0064%\u0064" , _bfg ) ] { _bfg ++ ; } ; _dbdd . IdAttr = _ff . Sprintf ( "\u0072\u0049\u0064%\u0064" , _bfg ) ; _ffb . _bcde . Relationship = append ( _ffb . _bcde . Relationship , & _dbdd ) ; return Relationship { _fdfb : & _dbdd } , true ; } ; } ; return Relationship { } , false ; } ;
2022-12-06 11:56:49 +00:00
2023-07-04 11:04:03 +00:00
// DocBase is the type embedded in in the Document/Workbook/Presentation types
// that contains members common to all.
type DocBase struct { ContentTypes ContentTypes ; AppProperties AppProperties ; Rels Relationships ; CoreProperties CoreProperties ; CustomProperties CustomProperties ; Thumbnail _dc . Image ; Images [ ] ImageRef ; ExtraFiles [ ] ExtraFile ; TmpPath string ; } ;
2021-08-23 20:44:48 +00:00
2023-06-10 07:12:37 +00:00
// NewAppProperties constructs a new AppProperties.
2023-07-04 11:04:03 +00:00
func NewAppProperties ( ) AppProperties { _aed := AppProperties { _gdd : _bf . NewProperties ( ) } ; _aed . SetCompany ( "\u0046\u006f\u0078\u0079\u0055\u0074\u0069\u006c\u0073\u0020\u0065\u0068\u0066" ) ; _aed . SetApplication ( "g\u0069\u0074\u0068\u0075\u0062\u002ec\u006f\u006d\u002f\u0075\u006e\u0069\u0064\u006f\u0063/\u0075\u006e\u0069o\u0066f\u0069\u0063\u0065" ) ; _aed . SetDocSecurity ( 0 ) ; _aed . SetLinksUpToDate ( false ) ; var _fac , _cbe , _adc int64 ; _ff . Sscanf ( Version , "\u0025\u0064\u002e\u0025\u0064\u002e\u0025\u0064" , & _fac , & _cbe , & _adc ) ; _fdg := float64 ( _fac ) + float64 ( _cbe ) / 10000.0 ; _aed . SetApplicationVersion ( _ff . Sprintf ( "\u0025\u0030\u0037\u002e\u0034\u0066" , _fdg ) ) ; return _aed ; } ;
2023-04-15 17:27:31 +00:00
2023-06-10 07:12:37 +00:00
// NewCoreProperties constructs a new CoreProperties.
2023-07-04 11:04:03 +00:00
func NewCoreProperties ( ) CoreProperties { return CoreProperties { _fdb : _cfd . NewCoreProperties ( ) } } ;
2022-06-27 19:44:23 +00:00
2023-07-04 11:04:03 +00:00
// ContentStatus returns the content status of the document (e.g. "Final", "Draft")
func ( _feg CoreProperties ) ContentStatus ( ) string { if _feg . _fdb . ContentStatus != nil { return * _feg . _fdb . ContentStatus ; } ; return "" ; } ;
2022-06-27 19:44:23 +00:00
2023-07-04 11:04:03 +00:00
// Author returns the author of the document
func ( _feb CoreProperties ) Author ( ) string { if _feb . _fdb . Creator != nil { return string ( _feb . _fdb . Creator . Data ) ; } ; return "" ; } ; func ( _dfb CustomProperties ) SetPropertyAsVstream ( name string , vstream * _fd . Vstream ) { _gded := _dfb . getNewProperty ( name ) ; _gded . Vstream = vstream ; _dfb . setOrReplaceProperty ( _gded ) ; } ;
2023-06-10 07:12:37 +00:00
2023-07-04 11:04:03 +00:00
// X returns the inner wrapped XML type.
func ( _dfea Table ) X ( ) * _bb . Tbl { return _dfea . _baa } ;
2023-06-10 07:12:37 +00:00
2023-07-04 11:04:03 +00:00
// GetTargetByRelId returns a target path with the associated relation ID.
func ( _bfc Relationships ) GetTargetByRelId ( idAttr string ) string { for _ , _beg := range _bfc . _bcde . Relationship { if _beg . IdAttr == idAttr { return _beg . TargetAttr ; } ; } ; return "" ; } ;
2023-06-10 07:12:37 +00:00
2023-07-04 11:04:03 +00:00
// Cells returns an array of row cells.
func ( _abb TableRow ) Cells ( ) [ ] * _bb . CT_TableCell { return _abb . _bga . Tc } ;
2023-06-10 07:12:37 +00:00
// X returns the inner wrapped XML type.
2023-07-04 11:04:03 +00:00
func ( _ede TableStyles ) X ( ) * _bb . TblStyleLst { return _ede . _afbd } ;
2023-06-10 07:12:37 +00:00
2023-07-04 11:04:03 +00:00
// DefAttr returns the DefAttr property.
func ( _eace TableStyles ) DefAttr ( ) string { return _eace . _afbd . DefAttr } ; func ( _deca TableRow ) addCell ( ) * _bb . CT_TableCell { _gee := _bb . NewCT_TableCell ( ) ; _deca . _bga . Tc = append ( _deca . _bga . Tc , _gee ) ; return _gee ; } ;
2023-06-10 07:12:37 +00:00
2023-07-04 11:04:03 +00:00
// AddHyperlink adds an external hyperlink relationship.
func ( _cgb Relationships ) AddHyperlink ( target string ) Hyperlink { _dedb := _cgb . AddRelationship ( target , _bag . HyperLinkType ) ; _dedb . _fdfb . TargetModeAttr = _db . ST_TargetModeExternal ; return Hyperlink ( _dedb ) ; } ;
2023-06-10 07:12:37 +00:00
2023-07-04 11:04:03 +00:00
// Size returns the size of an image
func ( _bbgd ImageRef ) Size ( ) _dc . Point { return _bbgd . _dcc . Size } ;
// NewTheme constructs a new theme.
func NewTheme ( ) Theme { return Theme { _bb . NewTheme ( ) } } ;
// AddExtraFileFromZip is used when reading an unsupported file from an OOXML
// file. This ensures that unsupported file content will at least round-trip
// correctly.
func ( _ebe * DocBase ) AddExtraFileFromZip ( f * _e . File ) error { _cca , _ced := _ge . ExtractToDiskTmp ( f , _ebe . TmpPath ) ; if _ced != nil { return _ff . Errorf ( "\u0065\u0072r\u006f\u0072\u0020\u0065x\u0074\u0072a\u0063\u0074\u0069\u006e\u0067\u0020\u0075\u006es\u0075\u0070\u0070\u006f\u0072\u0074\u0065\u0064\u0020\u0066\u0069\u006ce\u003a\u0020\u0025\u0073" , _ced ) ; } ; _ebe . ExtraFiles = append ( _ebe . ExtraFiles , ExtraFile { ZipPath : f . Name , DiskPath : _cca } ) ; return nil ; } ; func init ( ) { _fg . SetAsStorage ( ) } ;
2023-06-10 07:12:37 +00:00
// X returns the inner wrapped XML type.
2023-07-04 11:04:03 +00:00
func ( _cfe AppProperties ) X ( ) * _bf . Properties { return _cfe . _gdd } ;
2022-06-27 19:44:23 +00:00
2023-07-04 11:04:03 +00:00
// RemoveOverride removes an override given a path.
func ( _affa ContentTypes ) RemoveOverride ( path string ) { if ! _b . HasPrefix ( path , "\u002f" ) { path = "\u002f" + path ; } ; for _bed , _aeg := range _affa . _ag . Override { if _aeg . PartNameAttr == path { copy ( _affa . _ag . Override [ _bed : ] , _affa . _ag . Override [ _bed + 1 : ] ) ; _affa . _ag . Override = _affa . _ag . Override [ 0 : len ( _affa . _ag . Override ) - 1 ] ; } ; } ; } ; func ( _dca CustomProperties ) SetPropertyAsClsid ( name string , clsid string ) { _faaf := _dca . getNewProperty ( name ) ; _faaf . Clsid = & clsid ; _dca . setOrReplaceProperty ( _faaf ) ; } ;
2022-09-02 11:46:53 +00:00
2023-07-04 11:04:03 +00:00
// AddRow adds a row to a table.
func ( _dcdc Table ) AddRow ( ) * TableRow { _gdcb := _bb . NewCT_TableRow ( ) ; for _aacd := 0 ; _aacd < len ( _dcdc . _baa . TblGrid . GridCol ) ; _aacd ++ { _gdcb . Tc = append ( _gdcb . Tc , _bb . NewCT_TableCell ( ) ) ; } ; _dcdc . _baa . Tr = append ( _dcdc . _baa . Tr , _gdcb ) ; return & TableRow { _bga : _gdcb } ; } ;
2022-09-02 11:46:53 +00:00
2023-07-04 11:04:03 +00:00
// Pages returns total number of pages which are saved by the text editor which produced the document.
// For unioffice created documents, it is 0.
func ( _dge AppProperties ) Pages ( ) int32 { if _dge . _gdd . Pages != nil { return * _dge . _gdd . Pages ; } ; return 0 ; } ;
2022-09-02 11:46:53 +00:00
2023-07-04 11:04:03 +00:00
// Remove removes an existing relationship.
func ( _eafd Relationships ) Remove ( rel Relationship ) bool { for _eeab , _adf := range _eafd . _bcde . Relationship { if _adf == rel . _fdfb { copy ( _eafd . _bcde . Relationship [ _eeab : ] , _eafd . _bcde . Relationship [ _eeab + 1 : ] ) ; _eafd . _bcde . Relationship = _eafd . _bcde . Relationship [ 0 : len ( _eafd . _bcde . Relationship ) - 1 ] ; return true ; } ; } ; return false ; } ;
2022-12-06 11:56:49 +00:00
2023-07-04 11:04:03 +00:00
// AddImageToZip adds an image (either from bytes or from disk) and adds it to the zip file.
func AddImageToZip ( z * _e . Writer , img ImageRef , imageNum int , dt _bag . DocType ) error { _cec := _bag . AbsoluteImageFilename ( dt , imageNum , _b . ToLower ( img . Format ( ) ) ) ; if img . Data ( ) != nil && len ( * img . Data ( ) ) > 0 { if _bfb := _ge . AddFileFromBytes ( z , _cec , * img . Data ( ) ) ; _bfb != nil { return _bfb ; } ; } else if img . Path ( ) != "" { if _bfbf := _ge . AddFileFromDisk ( z , _cec , img . Path ( ) ) ; _bfbf != nil { return _bfbf ; } ; } else { return _ff . Errorf ( "\u0075\u006es\u0075\u0070\u0070\u006f\u0072\u0074\u0065\u0064\u0020\u0069\u006d\u0061\u0067\u0065\u0020\u0073\u006f\u0075\u0072\u0063\u0065\u003a %\u002b\u0076" , img ) ; } ; return nil ; } ;
2022-12-06 11:56:49 +00:00
2023-07-04 11:04:03 +00:00
// Relationships represents a .rels file.
type Relationships struct { _bcde * _db . Relationships } ;
2022-12-06 11:56:49 +00:00
2023-07-04 11:04:03 +00:00
// NewRelationshipsCopy creates a new relationships wrapper as a copy of passed in instance.
func NewRelationshipsCopy ( rels Relationships ) Relationships { _agcb := * rels . _bcde ; return Relationships { _bcde : & _agcb } ; } ; func ( _cce CustomProperties ) getNewProperty ( _ecd string ) * _gc . CT_Property { _ead := _cce . _da . Property ; _ggg := int32 ( 1 ) ; for _ , _eac := range _ead { if _eac . PidAttr > _ggg { _ggg = _eac . PidAttr ; } ; } ; _ebc := _gc . NewCT_Property ( ) ; _ebc . NameAttr = & _ecd ; _ebc . PidAttr = _ggg + 1 ; _ebc . FmtidAttr = "\u007b\u0044\u0035\u0043\u0044\u0044\u0035\u0030\u0035\u002d\u0032\u0045\u0039\u0043\u002d\u0031\u0030\u0031\u0042\u002d\u0039\u0033\u0039\u0037-\u0030\u0038\u0030\u0030\u0032B\u0032\u0043F\u0039\u0041\u0045\u007d" ; return _ebc ; } ; func ( _dgec CustomProperties ) SetPropertyAsUi2 ( name string , ui2 uint16 ) { _eea := _dgec . getNewProperty ( name ) ; _eea . Ui2 = & ui2 ; _dgec . setOrReplaceProperty ( _eea ) ; } ;
2023-03-01 18:42:44 +00:00
2023-07-04 11:04:03 +00:00
// SetCompany sets the name of the company that created the document.
func ( _bdf AppProperties ) SetCompany ( s string ) { _bdf . _gdd . Company = & s } ; func UtcTimeFormat ( t _cf . Time ) string { return t . Format ( _eacf ) + "\u0020\u0055\u0054\u0043" } ;
2023-03-01 18:42:44 +00:00
2023-07-04 11:04:03 +00:00
// RemoveOverrideByIndex removes an override given a path and override index.
func ( _gaa ContentTypes ) RemoveOverrideByIndex ( path string , indexToFind int ) error { _bcc := path [ 0 : len ( path ) - 5 ] ; if ! _b . HasPrefix ( _bcc , "\u002f" ) { _bcc = "\u002f" + _bcc ; } ; _aae , _gfde := _ba . Compile ( _bcc + "\u0028\u005b\u0030-\u0039\u005d\u002b\u0029\u002e\u0078\u006d\u006c" ) ; if _gfde != nil { return _gfde ; } ; _gdc := 0 ; _ffa := - 1 ; for _bgc , _ebf := range _gaa . _ag . Override { if _ccd := _aae . FindStringSubmatch ( _ebf . PartNameAttr ) ; len ( _ccd ) > 1 { if _gdc == indexToFind { _ffa = _bgc ; } else if _gdc > indexToFind { _cbb , _ := _fb . Atoi ( _ccd [ 1 ] ) ; _cbb -- ; _ebf . PartNameAttr = _ff . Sprintf ( "\u0025\u0073\u0025\u0064\u002e\u0078\u006d\u006c" , _bcc , _cbb ) ; } ; _gdc ++ ; } ; } ; if _ffa > - 1 { copy ( _gaa . _ag . Override [ _ffa : ] , _gaa . _ag . Override [ _ffa + 1 : ] ) ; _gaa . _ag . Override = _gaa . _ag . Override [ 0 : len ( _gaa . _ag . Override ) - 1 ] ; } ; return nil ; } ;
2022-12-06 11:56:49 +00:00
2023-07-04 11:04:03 +00:00
// GetPropertyByName returns a custom property selected by it's name.
func ( _afde CustomProperties ) GetPropertyByName ( name string ) CustomProperty { _abd := _afde . _da . Property ; for _ , _gcc := range _abd { if * _gcc . NameAttr == name { return CustomProperty { _ddc : _gcc } ; } ; } ; return CustomProperty { } ; } ;
2023-03-01 18:42:44 +00:00
2023-07-04 11:04:03 +00:00
// Data returns the data of an image file, if any.
func ( _egec ImageRef ) Data ( ) * [ ] byte { return _egec . _dcc . Data } ;
2023-03-01 18:42:44 +00:00
2023-07-04 11:04:03 +00:00
// SetOffsetY sets vertical offset of a table in distance units (see measurement package).
func ( _fc Table ) SetOffsetY ( offY float64 ) { if _fc . _ebff . Off == nil { _fc . _ebff . Off = _bb . NewCT_Point2D ( ) ; _age := int64 ( 0 ) ; _fc . _ebff . Off . XAttr = _bb . ST_Coordinate { ST_CoordinateUnqualified : & _age } ; } ; _bab := _ec . ToEMU ( offY ) ; _fc . _ebff . Off . YAttr = _bb . ST_Coordinate { ST_CoordinateUnqualified : & _bab } ; } ; func ( _dbb CustomProperties ) SetPropertyAsOblob ( name , oblob string ) { _ggge := _dbb . getNewProperty ( name ) ; _ggge . Oblob = & oblob ; _dbb . setOrReplaceProperty ( _ggge ) ; } ; const _gec = 4 ;
2023-05-26 09:49:04 +00:00
2023-07-04 11:04:03 +00:00
// LastModifiedBy returns the name of the last person to modify the document
func ( _dea CoreProperties ) LastModifiedBy ( ) string { if _dea . _fdb . LastModifiedBy != nil { return * _dea . _fdb . LastModifiedBy ; } ; return "" ; } ;
2023-05-26 09:49:04 +00:00
2023-07-04 11:04:03 +00:00
// Target returns the target (path) of a relationship.
func ( _efca Relationship ) Target ( ) string { return _efca . _fdfb . TargetAttr } ;
2023-03-01 18:42:44 +00:00
2023-07-04 11:04:03 +00:00
// Rows returns all table rows.
func ( _adga Table ) Rows ( ) [ ] * TableRow { _edg := _adga . _baa . Tr ; _gbe := [ ] * TableRow { } ; for _ , _fbfed := range _edg { _gbe = append ( _gbe , & TableRow { _bga : _fbfed } ) ; } ; return _gbe ; } ;
// SetTarget set the target (path) of a relationship.
func ( _fgf Relationship ) SetTarget ( s string ) { _fgf . _fdfb . TargetAttr = s } ; func ( _fega CustomProperties ) SetPropertyAsI8 ( name string , i8 int64 ) { _ddbg := _fega . getNewProperty ( name ) ; _ddbg . I8 = & i8 ; _fega . setOrReplaceProperty ( _ddbg ) ; } ; func ( _cde CustomProperties ) setPropertyHelper ( _efg * _gc . CT_Property , _gaba bool ) { _adg := _cde . GetPropertyByName ( * _efg . NameAttr ) ; if ( _adg == CustomProperty { } ) { _cde . _da . Property = append ( _cde . _da . Property , _efg ) ; } else if _gaba { _efg . FmtidAttr = _adg . _ddc . FmtidAttr ; if _adg . _ddc . PidAttr == 0 { _efg . PidAttr = _adg . _ddc . PidAttr ; } ; _efg . LinkTargetAttr = _adg . _ddc . LinkTargetAttr ; * _adg . _ddc = * _efg ; } ; } ; func ( _gbc CustomProperties ) SetPropertyAsFiletime ( name string , filetime _cf . Time ) { _dbd := _gbc . getNewProperty ( name ) ; _dbd . Filetime = & filetime ; _gbc . setOrReplaceProperty ( _dbd ) ; } ; const _gbde = 15 ;
2023-05-26 09:49:04 +00:00
2023-06-10 07:12:37 +00:00
// TableRow represents a row in a table.
2023-07-04 11:04:03 +00:00
type TableRow struct { _bga * _bb . CT_TableRow } ;
2023-03-01 18:42:44 +00:00
2023-07-04 11:04:03 +00:00
// X returns the inner wrapped XML type.
func ( _ecf CoreProperties ) X ( ) * _cfd . CoreProperties { return _ecf . _fdb } ;
2023-03-01 18:42:44 +00:00
2023-07-04 11:04:03 +00:00
// SetApplication sets the name of the application that created the document.
func ( _be AppProperties ) SetApplication ( s string ) { _be . _gdd . Application = & s } ;
2023-03-01 18:42:44 +00:00
2023-07-04 11:04:03 +00:00
// TableCol represents a column in a table.
type TableCol struct { _gdcc * _bb . CT_TableCol } ;
2023-03-01 18:42:44 +00:00
2023-07-04 11:04:03 +00:00
// IsEmpty returns true if there are no relationships.
func ( _gfdee Relationships ) IsEmpty ( ) bool { return _gfdee . _bcde == nil || len ( _gfdee . _bcde . Relationship ) == 0 ; } ; func ( _cef * ImageRef ) SetRelID ( id string ) { _cef . _ffc = id } ;
2023-04-15 17:27:31 +00:00
2023-07-04 11:04:03 +00:00
// SetApplicationVersion sets the version of the application that created the
// document. Per MS, the verison string mut be in the form 'XX.YYYY'.
func ( _eb AppProperties ) SetApplicationVersion ( s string ) { _eb . _gdd . AppVersion = & s } ;
2023-05-26 09:49:04 +00:00
2023-07-04 11:04:03 +00:00
// Modified returns the time that the document was modified.
func ( _agce CoreProperties ) Modified ( ) _cf . Time { return _ddbf ( _agce . _fdb . Modified ) } ;