unioffice/presentation/presentation.go
2022-02-05 13:05:36 +00:00

322 lines
75 KiB
Go

//
// 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 presentation ;import (_fbf "archive/zip";_dd "bytes";_ff "encoding/xml";_eb "errors";_fag "fmt";_fa "github.com/unidoc/unioffice";_bb "github.com/unidoc/unioffice/common";_be "github.com/unidoc/unioffice/common/logger";_c "github.com/unidoc/unioffice/common/tempstorage";_eg "github.com/unidoc/unioffice/drawing";_ba "github.com/unidoc/unioffice/internal/license";_da "github.com/unidoc/unioffice/measurement";_ffd "github.com/unidoc/unioffice/schema/soo/dml";_f "github.com/unidoc/unioffice/schema/soo/dml/chart";_b "github.com/unidoc/unioffice/schema/soo/ofc/sharedTypes";_ec "github.com/unidoc/unioffice/schema/soo/pkg/relationships";_cg "github.com/unidoc/unioffice/schema/soo/pml";_d "github.com/unidoc/unioffice/zippkg";_aa "image";_g "image/jpeg";_fb "io";_ce "math";_bc "os";_ca "path";_bcc "sort";_fe "strconv";_a "strings";);
// AddTextBox adds an empty textbox to a slide.
func (_fcee Slide )AddTextBox ()TextBox {_ccce :=_cg .NewCT_GroupShapeChoice ();_fcee ._dfbe .CSld .SpTree .Choice =append (_fcee ._dfbe .CSld .SpTree .Choice ,_ccce );_deag :=_cg .NewCT_Shape ();_ccce .Sp =append (_ccce .Sp ,_deag );_deag .SpPr =_ffd .NewCT_ShapeProperties ();_deag .SpPr .Xfrm =_ffd .NewCT_Transform2D ();_deag .SpPr .PrstGeom =_ffd .NewCT_PresetGeometry2D ();_deag .SpPr .PrstGeom .PrstAttr =_ffd .ST_ShapeTypeRect ;_deag .NvSpPr =_cg .NewCT_ShapeNonVisual ();_deag .NvSpPr .CNvSpPr =_ffd .NewCT_NonVisualDrawingShapeProps ();_acfb :=true ;_deag .NvSpPr .CNvSpPr .TxBoxAttr =&_acfb ;_deag .TxBody =_ffd .NewCT_TextBody ();_deag .TxBody .BodyPr =_ffd .NewCT_TextBodyProperties ();_deag .TxBody .BodyPr .WrapAttr =_ffd .ST_TextWrappingTypeSquare ;_deag .TxBody .BodyPr .SpAutoFit =_ffd .NewCT_TextShapeAutofit ();_fbc :=TextBox {_deag };_fbc .Properties ().SetWidth (3*_da .Inch );_fbc .Properties ().SetHeight (1*_da .Inch );_fbc .Properties ().SetPosition (0,0);return _fbc ;};func (_ge *chart )Target ()string {return _ge ._gc };
// Text returns text from a slide as one string separated with line breaks.
func (_gg *SlideText )Text ()string {_bfg :=_dd .NewBuffer ([]byte {});for _ ,_ccee :=range _gg .Items {if _ccee .Text !=""{_bfg .WriteString (_ccee .Text );_bfg .WriteString ("\u000a");};};return _bfg .String ();};
// Type returns the placeholder type
func (_bdce PlaceHolder )Type ()_cg .ST_PlaceholderType {return _bdce ._edbb .NvSpPr .NvPr .Ph .TypeAttr };
// Presentation is the a presentation base document.
type Presentation struct{_bb .DocBase ;_ede *_cg .Presentation ;_aae _bb .Relationships ;_dgb []*_cg .Sld ;_fegc []_bb .Relationships ;_ecc []*_cg .SldMaster ;_cfaa []_bb .Relationships ;_acgb []*_cg .SldLayout ;_ecd []_bb .Relationships ;_ffa []*_ffd .Theme ;_cdb []_bb .Relationships ;_ceb _bb .TableStyles ;_fcge PresentationProperties ;_dcd ViewProperties ;_bag []*_ffd .CT_Hyperlink ;_cff []*chart ;_gaa []*_cg .HandoutMaster ;_dad []*_cg .NotesMaster ;_efb []*_fa .XSDAny ;_aaef map[string ]string ;_edbc string ;};func (_gf *chart )RelId ()string {return _gf ._bccd };
// X returns TextBox's underlying *pml.CT_Shape.
func (_bcac TextBox )X ()*_cg .CT_Shape {return _bcac ._fdc };func _afe ()*Presentation {_bga :=&Presentation {_ede :_cg .NewPresentation ()};_bga ._ede .SldIdLst =_cg .NewCT_SlideIdList ();_bga ._ede .ConformanceAttr =_b .ST_ConformanceClassTransitional ;_bga .AppProperties =_bb .NewAppProperties ();_bga .CoreProperties =_bb .NewCoreProperties ();_bga ._ceb =_bb .NewTableStyles ();_bga .ContentTypes =_bb .NewContentTypes ();_bga .Rels =_bb .NewRelationships ();_bga ._aae =_bb .NewRelationships ();_bga ._fcge =NewPresentationProperties ();_bga ._dcd =NewViewProperties ();_bga ._aaef =map[string ]string {};return _bga ;};
// Properties returns the properties of the TextBox.
func (_eba Image )Properties ()_eg .ShapeProperties {if _eba ._adf .SpPr ==nil {_eba ._adf .SpPr =_ffd .NewCT_ShapeProperties ();};return _eg .MakeShapeProperties (_eba ._adf .SpPr );};type sort2d []*TextItem ;
// SaveAsTemplate writes the presentation out to a writer in the Zip package format as a template
func (_ggaa *Presentation )SaveAsTemplate (w _fb .Writer )error {return _ggaa .save (w ,true )};func (_aca sort2d )Swap (i ,j int ){_aca [i ],_aca [j ]=_aca [j ],_aca [i ]};
// ExtLst returns the ExtLst property.
func (_cgbe ViewProperties )ExtLst ()*_cg .CT_ExtensionList {return _cgbe ._decg .ExtLst };
// ExtractText returns text from a presentation as a PresentationText object.
func (_fab *Presentation )ExtractText ()*PresentationText {_bfb :=[]*SlideText {};for _ ,_cc :=range _fab .Slides (){_de :=_cc .ExtractText ();if _de !=nil {_bfb =append (_bfb ,_de );};};return &PresentationText {Slides :_bfb };};
// Remove removes a placeholder from a presentation.
func (_bead PlaceHolder )Remove ()error {for _dee ,_cdc :=range _bead ._gegg .CSld .SpTree .Choice {for _ ,_gfb :=range _cdc .Sp {if _gfb ==_bead ._edbb {copy (_bead ._gegg .CSld .SpTree .Choice [_dee :],_bead ._gegg .CSld .SpTree .Choice [_dee +1:]);_bead ._gegg .CSld .SpTree .Choice =_bead ._gegg .CSld .SpTree .Choice [0:len (_bead ._gegg .CSld .SpTree .Choice )-1];return nil ;};};};return _eb .New ("\u0070\u006c\u0061\u0063\u0065\u0068\u006f\u006c\u0064\u0065r\u0020\u006e\u006f\u0074\u0020\u0066\u006fu\u006e\u0064\u0020\u0069\u006e\u0020\u0073\u006c\u0069\u0064\u0065");};
// Save writes the presentation out to a writer in the Zip package format
func (_abfg *Presentation )Save (w _fb .Writer )error {return _abfg .save (w ,false )};
// AddImage adds an image to the document package, returning a reference that
// can be used to add the image to a run and place it in the document contents.
func (_bfgg *Presentation )AddImage (i _bb .Image )(_bb .ImageRef ,error ){_cgfg :=_bb .MakeImageRef (i ,&_bfgg .DocBase ,_bfgg ._aae );if i .Data ==nil &&i .Path ==""{return _cgfg ,_eb .New ("\u0069\u006d\u0061\u0067\u0065\u0020\u006d\u0075\u0073\u0074 \u0068\u0061\u0076\u0065\u0020\u0064\u0061t\u0061\u0020\u006f\u0072\u0020\u0061\u0020\u0070\u0061\u0074\u0068");};if i .Format ==""{return _cgfg ,_eb .New ("\u0069\u006d\u0061\u0067\u0065\u0020\u006d\u0075\u0073\u0074 \u0068\u0061\u0076\u0065\u0020\u0061\u0020v\u0061\u006c\u0069\u0064\u0020\u0066\u006f\u0072\u006d\u0061\u0074");};if i .Size .X ==0||i .Size .Y ==0{return _cgfg ,_eb .New ("\u0069\u006d\u0061\u0067e\u0020\u006d\u0075\u0073\u0074\u0020\u0068\u0061\u0076\u0065 \u0061 \u0076\u0061\u006c\u0069\u0064\u0020\u0073i\u007a\u0065");};if i .Path !=""{_daeb :=_c .Add (i .Path );if _daeb !=nil {return _cgfg ,_daeb ;};};_bfgg .Images =append (_bfgg .Images ,_cgfg );_bfgg .ContentTypes .EnsureDefault ("\u0070\u006e\u0067","\u0069m\u0061\u0067\u0065\u002f\u0070\u006eg");_bfgg .ContentTypes .EnsureDefault ("\u006a\u0070\u0065\u0067","\u0069\u006d\u0061\u0067\u0065\u002f\u006a\u0070\u0065\u0067");_bfgg .ContentTypes .EnsureDefault ("\u006a\u0070\u0067","\u0069\u006d\u0061\u0067\u0065\u002f\u006a\u0070\u0065\u0067");_bfgg .ContentTypes .EnsureDefault ("\u0077\u006d\u0066","i\u006d\u0061\u0067\u0065\u002f\u0078\u002d\u0077\u006d\u0066");_bfgg .ContentTypes .EnsureDefault (i .Format ,"\u0069\u006d\u0061\u0067\u0065\u002f"+i .Format );return _cgfg ,nil ;};
// Index returns the placeholder index
func (_baa PlaceHolder )Index ()uint32 {if _baa ._edbb .NvSpPr .NvPr .Ph .IdxAttr ==nil {return 0;};return *_baa ._edbb .NvSpPr .NvPr .Ph .IdxAttr ;};
// ShowCommentsAttr returns the WebPr property.
func (_abd ViewProperties )ShowCommentsAttr ()*bool {return _abd ._decg .ShowCommentsAttr };
// GetPlaceholder returns a placeholder given its type. If there are multiplace
// placeholders of the same type, this method returns the first one. You must use the
// PlaceHolders() method to access the others.
func (_fedc Slide )GetPlaceholder (t _cg .ST_PlaceholderType )(PlaceHolder ,error ){for _ ,_aecg :=range _fedc ._dfbe .CSld .SpTree .Choice {for _ ,_dabg :=range _aecg .Sp {if _dabg .NvSpPr !=nil &&_dabg .NvSpPr .NvPr !=nil &&_dabg .NvSpPr .NvPr .Ph !=nil {if _dabg .NvSpPr .NvPr .Ph .TypeAttr ==t {return PlaceHolder {_dabg ,_fedc ._dfbe },nil ;};};};};return PlaceHolder {},_eb .New ("\u0075\u006e\u0061\u0062\u006c\u0065\u0020\u0074\u006f\u0020\u0066i\u006e\u0064\u0020\u0070\u006c\u0061\u0063\u0065\u0068\u006fl\u0064\u0065\u0072");};
// Read reads a document from an io.Reader.
func Read (r _fb .ReaderAt ,size int64 )(*Presentation ,error ){const _gcadg ="\u0070\u0072\u0065\u0073\u0065\u006e\u0074\u0061\u0074\u0069\u006f\u006e:\u0052\u0065\u0061\u0064";if !_ba .GetLicenseKey ().IsLicensed ()&&!_gfc {_fag .Println ("\u0055\u006e\u006ci\u0063\u0065\u006e\u0073e\u0064\u0020\u0076\u0065\u0072\u0073\u0069o\u006e\u0020\u006f\u0066\u0020\u0055\u006e\u0069\u004f\u0066\u0066\u0069\u0063\u0065");_fag .Println ("\u002d\u0020\u0047e\u0074\u0020\u0061\u0020\u0074\u0072\u0069\u0061\u006c\u0020\u006c\u0069\u0063\u0065\u006e\u0073\u0065\u0020\u006f\u006e\u0020\u0068\u0074\u0074\u0070\u0073\u003a\u002f\u002fu\u006e\u0069\u0064\u006f\u0063\u002e\u0069\u006f");return nil ,_eb .New ("\u0075\u006e\u0069\u006f\u0066\u0066\u0069\u0063\u0065\u0020\u006ci\u0063\u0065\u006e\u0073\u0065\u0020\u0072\u0065\u0071\u0075i\u0072\u0065\u0064");};_efce :=_afe ();_cfc ,_eag :=_ba .GenRefId ("\u0070\u0072");if _eag !=nil {_be .Log .Error ("\u0045R\u0052\u004f\u0052\u003a\u0020\u0025v",_eag );return nil ,_eag ;};_efce ._edbc =_cfc ;if _cfe :=_ba .Track (_efce ._edbc ,_gcadg );_cfe !=nil {_be .Log .Error ("\u0045R\u0052\u004f\u0052\u003a\u0020\u0025v",_cfe );return nil ,_cfe ;};_eabe ,_eag :=_c .TempDir ("\u0075\u006e\u0069\u006f\u0066\u0066\u0069\u0063\u0065-\u0070\u0070\u0074\u0078");if _eag !=nil {return nil ,_eag ;};_efce .TmpPath =_eabe ;_dccd ,_eag :=_fbf .NewReader (r ,size );if _eag !=nil {return nil ,_fag .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u007a\u0069\u0070\u003a\u0020\u0025\u0073",_eag );};_dbb :=[]*_fbf .File {};_dbb =append (_dbb ,_dccd .File ...);_begg :=false ;for _ ,_adcd :=range _dbb {if _adcd .FileHeader .Name =="\u0064\u006f\u0063\u0050ro\u0070\u0073\u002f\u0063\u0075\u0073\u0074\u006f\u006d\u002e\u0078\u006d\u006c"{_begg =true ;break ;};};if _begg {_efce .CreateCustomProperties ();};_aade :=_d .DecodeMap {};_aade .SetOnNewRelationshipFunc (_efce .onNewRelationship );_aade .AddTarget (_fa .ContentTypesFilename ,_efce .ContentTypes .X (),"",0);_aade .AddTarget (_fa .BaseRelsFilename ,_efce .Rels .X (),"",0);if _egcb :=_aade .Decode (_dbb );_egcb !=nil {return nil ,_egcb ;};for _ ,_bcfd :=range _dbb {if _bcfd ==nil {continue ;};if _facg :=_efce .AddExtraFileFromZip (_bcfd );_facg !=nil {return nil ,_facg ;};};if _begg {_adfd :=false ;for _ ,_ggc :=range _efce .Rels .X ().Relationship {if _ggc .TargetAttr =="\u0064\u006f\u0063\u0050ro\u0070\u0073\u002f\u0063\u0075\u0073\u0074\u006f\u006d\u002e\u0078\u006d\u006c"{_adfd =true ;break ;};};if !_adfd {_efce .AddCustomRelationships ();};};return _efce ,nil ;};
// SlideLayout is a layout from which slides can be created.
type SlideLayout struct{_cef *_cg .SldLayout };type chart struct{_gb *_f .ChartSpace ;_bccd string ;_gc string ;};
// X returns the inner wrapped XML type.
func (_eaca Slide )X ()*_cg .Sld {return _eaca ._dfbe };
// AddSlideWithLayout adds a new slide with content copied from a layout. Normally you should
// use AddDefaultSlideWithLayout as it will do some post processing similar to PowerPoint to
// clear place holder text, etc.
func (_ebe *Presentation )AddSlideWithLayout (l SlideLayout )(Slide ,error ){_dag :=_cg .NewCT_SlideIdListEntry ();_dag .IdAttr =256;for _ ,_bge :=range _ebe ._ede .SldIdLst .SldId {if _bge .IdAttr >=_dag .IdAttr {_dag .IdAttr =_bge .IdAttr +1;};};_ebe ._ede .SldIdLst .SldId =append (_ebe ._ede .SldIdLst .SldId ,_dag );_cgc :=_cg .NewSld ();_ggfb :=_dd .Buffer {};_bbfa :=_ff .NewEncoder (&_ggfb );_gfag :=_ff .StartElement {Name :_ff .Name {Local :"\u0073\u006c\u0069d\u0065"}};_gfag .Attr =append (_gfag .Attr ,_ff .Attr {Name :_ff .Name {Local :"\u0078\u006d\u006cn\u0073"},Value :"\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\u002eo\u0072\u0067\u002f\u0070\u0072\u0065\u0073\u0065\u006e\u0074\u0061\u0074\u0069o\u006e\u006d\u006c\u002f\u0032\u00300\u0036\u002f\u006da\u0069\u006e"});_gfag .Attr =append (_gfag .Attr ,_ff .Attr {Name :_ff .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u0061"},Value :"\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"});_gfag .Attr =append (_gfag .Attr ,_ff .Attr {Name :_ff .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u0070"},Value :"\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\u002eo\u0072\u0067\u002f\u0070\u0072\u0065\u0073\u0065\u006e\u0074\u0061\u0074\u0069o\u006e\u006d\u006c\u002f\u0032\u00300\u0036\u002f\u006da\u0069\u006e"});_gfag .Attr =append (_gfag .Attr ,_ff .Attr {Name :_ff .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u0072"},Value :"\u0068\u0074\u0074\u0070\u003a\u002f/\u0073\u0063\u0068\u0065\u006da\u0073\u002e\u006f\u0070\u0065\u006ex\u006d\u006c\u0066\u006f\u0072m\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u006f\u0066\u0066\u0069c\u0065\u0044\u006f\u0063\u0075\u006d\u0065\u006e\u0074\u002f\u0032\u0030\u0030\u0036\u002fr\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073h\u0069\u0070\u0073"});_gfag .Attr =append (_gfag .Attr ,_ff .Attr {Name :_ff .Name {Local :"\u0078\u006d\u006c\u006e\u0073\u003a\u0073\u0068"},Value :"\u0068\u0074\u0074\u0070\u003a/\u002f\u0073\u0063\u0068\u0065m\u0061s\u002e\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067/\u006f\u0066\u0066\u0069\u0063\u0065\u0044\u006f\u0063\u0075\u006d\u0065\u006e\u0074\u002f\u0032\u0030\u0030\u0036\u002f\u0073\u0068\u0061\u0072e\u0064\u0054\u0079\u0070\u0065\u0073"});_gfag .Attr =append (_gfag .Attr ,_ff .Attr {Name :_ff .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u0078\u006dl"},Value :"\u0068\u0074tp\u003a\u002f\u002fw\u0077\u0077\u002e\u00773.o\u0072g/\u0058\u004d\u004c\u002f\u0031\u0039\u00398/\u006e\u0061\u006d\u0065\u0073\u0070\u0061c\u0065"});if _fbfd :=l ._cef .CSld .MarshalXML (_bbfa ,_gfag );_fbfd !=nil {return Slide {},_fbfd ;};_bbfa .Flush ();_ega :=_ff .NewDecoder (&_ggfb );_cgc .CSld =_cg .NewCT_CommonSlideData ();if _bbfe :=_ega .Decode (_cgc .CSld );_bbfe !=nil {return Slide {},_bbfe ;};_cgc .CSld .NameAttr =nil ;_cgc .CSld .SpTree .Choice =_cbe (_cgc .CSld .SpTree .Choice );_ebe ._dgb =append (_ebe ._dgb ,_cgc );_gfbe :=_ebe ._aae .AddAutoRelationship (_fa .DocTypePresentation ,_fa .OfficeDocumentType ,len (_ebe ._dgb ),_fa .SlideType );_dag .RIdAttr =_gfbe .ID ();_ddd :=_fa .AbsoluteFilename (_fa .DocTypePresentation ,_fa .SlideType ,len (_ebe ._dgb ));_ebe .ContentTypes .AddOverride (_ddd ,_fa .SlideContentType );_dfb :=_bb .NewRelationships ();_ebe ._fegc =append (_ebe ._fegc ,_dfb );_defb :=len (_ebe ._fegc )-1;for _gab ,_cbd :=range _ebe ._acgb {if _cbd ==l .X (){_aaf :=_ebe ._ecd [_gab ];for _ ,_ffda :=range _aaf .X ().Relationship {if _ffda .TypeAttr !=_fa .SlideMasterType {_ebe ._fegc [_defb ].X ().Relationship =append (_ebe ._fegc [_defb ].X ().Relationship ,_ffda );};};_dfb .AddAutoRelationship (_fa .DocTypePresentation ,_fa .SlideType ,_gab +1,_fa .SlideLayoutType );};};_gacf :=Slide {_dag ,_cgc ,_ebe ,nil };return _gacf ,nil ;};func (_feba *Presentation )onNewRelationship (_cgfc *_d .DecodeMap ,_egcc ,_afec string ,_gca []*_fbf .File ,_gfca *_ec .Relationship ,_baca _d .Target )error {_eaa :=_fa .DocTypePresentation ;switch _afec {case _fa .OfficeDocumentType :_feba ._ede =_cg .NewPresentation ();_cgfc .AddTarget (_egcc ,_feba ._ede ,_afec ,0);_cgfc .AddTarget (_d .RelationsPathFor (_egcc ),_feba ._aae .X (),_afec ,0);_gfca .TargetAttr =_fa .RelativeFilename (_eaa ,_baca .Typ ,_afec ,0);case _fa .CorePropertiesType :_cgfc .AddTarget (_egcc ,_feba .CoreProperties .X (),_afec ,0);_gfca .TargetAttr =_fa .RelativeFilename (_eaa ,_baca .Typ ,_afec ,0);case _fa .CustomPropertiesType :_cgfc .AddTarget (_egcc ,_feba .CustomProperties .X (),_afec ,0);_gfca .TargetAttr =_fa .RelativeFilename (_eaa ,_baca .Typ ,_afec ,0);case _fa .PresentationPropertiesType :_cgfc .AddTarget (_egcc ,_feba ._fcge .X (),_afec ,0);_gfca .TargetAttr =_fa .RelativeFilename (_eaa ,_baca .Typ ,_afec ,0);case _fa .ViewPropertiesType :_cgfc .AddTarget (_egcc ,_feba ._dcd .X (),_afec ,0);_gfca .TargetAttr =_fa .RelativeFilename (_eaa ,_baca .Typ ,_afec ,0);case _fa .TableStylesType :_cgfc .AddTarget (_egcc ,_feba ._ceb .X (),_afec ,0);_gfca .TargetAttr =_fa .RelativeFilename (_eaa ,_baca .Typ ,_afec ,0);case _fa .HyperLinkType :_cfag :=_ffd .NewCT_Hyperlink ();_eea :=uint32 (len (_feba ._bag ));_cgfc .AddTarget (_egcc ,_cfag ,_afec ,_eea );_feba ._bag =append (_feba ._bag ,_cfag );case _fa .CustomXMLType :_dfeb :=&_fa .XSDAny {};_ggae :=uint32 (len (_feba ._efb ));_cgfc .AddTarget (_egcc ,_dfeb ,_afec ,_ggae );_feba ._efb =append (_feba ._efb ,_dfeb );_gfca .TargetAttr =_fa .RelativeFilename (_eaa ,_baca .Typ ,_afec ,len (_feba ._efb ));case _fa .ChartType :_edd :=chart {_gb :_f .NewChartSpace ()};_begd :=uint32 (len (_feba ._cff ));_cgfc .AddTarget (_egcc ,_edd ._gb ,_afec ,_begd );_feba ._cff =append (_feba ._cff ,&_edd );_gfca .TargetAttr =_fa .RelativeFilename (_eaa ,_baca .Typ ,_afec ,len (_feba ._cff ));_edd ._gc =_gfca .TargetAttr ;case _fa .HandoutMasterType :_gdg :=_cg .NewHandoutMaster ();_ebae :=uint32 (len (_feba ._gaa ));_cgfc .AddTarget (_egcc ,_gdg ,_afec ,_ebae );_feba ._gaa =append (_feba ._gaa ,_gdg );_gfca .TargetAttr =_fa .RelativeFilename (_eaa ,_baca .Typ ,_afec ,len (_feba ._gaa ));case _fa .NotesMasterType :_gace :=_cg .NewNotesMaster ();_cbac :=uint32 (len (_feba ._dad ));_cgfc .AddTarget (_egcc ,_gace ,_afec ,_cbac );_feba ._dad =append (_feba ._dad ,_gace );_gfca .TargetAttr =_fa .RelativeFilename (_eaa ,_baca .Typ ,_afec ,len (_feba ._dad ));case _fa .ExtendedPropertiesType :_cgfc .AddTarget (_egcc ,_feba .AppProperties .X (),_afec ,0);_gfca .TargetAttr =_fa .RelativeFilename (_eaa ,_baca .Typ ,_afec ,0);case _fa .SlideType :_edf :=_cg .NewSld ();_feba ._dgb =append (_feba ._dgb ,_edf );_cgfc .AddTarget (_egcc ,_edf ,_afec ,uint32 (len (_feba ._dgb )));_gfca .TargetAttr =_fa .RelativeFilename (_eaa ,_baca .Typ ,_afec ,len (_feba ._dgb ));_cdeg :=_bb .NewRelationships ();_cgfc .AddTarget (_d .RelationsPathFor (_egcc ),_cdeg .X (),_afec ,0);_feba ._fegc =append (_feba ._fegc ,_cdeg );case _fa .SlideMasterType :_bccdb :=_cg .NewSldMaster ();if !_cgfc .AddTarget (_egcc ,_bccdb ,_afec ,uint32 (len (_feba ._ecc )+1)){return nil ;};_feba ._ecc =append (_feba ._ecc ,_bccdb );_gfca .TargetAttr =_fa .RelativeFilename (_eaa ,_baca .Typ ,_afec ,len (_feba ._ecc ));_dbg :=_bb .NewRelationships ();_cgfc .AddTarget (_d .RelationsPathFor (_egcc ),_dbg .X (),_afec ,0);_feba ._cfaa =append (_feba ._cfaa ,_dbg );case _fa .SlideLayoutType :_bafe :=_cg .NewSldLayout ();if !_cgfc .AddTarget (_egcc ,_bafe ,_afec ,uint32 (len (_feba ._acgb )+1)){return nil ;};_feba ._acgb =append (_feba ._acgb ,_bafe );_gfca .TargetAttr =_fa .RelativeFilename (_eaa ,_baca .Typ ,_afec ,len (_feba ._acgb ));_egce :=_bb .NewRelationships ();_cgfc .AddTarget (_d .RelationsPathFor (_egcc ),_egce .X (),_afec ,0);_feba ._ecd =append (_feba ._ecd ,_egce );case _fa .ThumbnailType :for _ccaa ,_defbb :=range _gca {if _defbb ==nil {continue ;};if _defbb .Name ==_egcc {_gdba ,_fgg :=_defbb .Open ();if _fgg !=nil {return _fag .Errorf ("e\u0072\u0072\u006f\u0072\u0020\u0072e\u0061\u0064\u0069\u006e\u0067\u0020\u0074\u0068\u0075m\u0062\u006e\u0061i\u006c:\u0020\u0025\u0073",_fgg );};_feba .Thumbnail ,_ ,_fgg =_aa .Decode (_gdba );_gdba .Close ();if _fgg !=nil {return _fag .Errorf ("\u0065\u0072\u0072\u006fr\u0020\u0064\u0065\u0063\u006f\u0064\u0069\u006e\u0067\u0020t\u0068u\u006d\u0062\u006e\u0061\u0069\u006c\u003a \u0025\u0073",_fgg );};_gca [_ccaa ]=nil ;};};case _fa .ThemeType :_fde :=_ffd .NewTheme ();if !_cgfc .AddTarget (_egcc ,_fde ,_afec ,uint32 (len (_feba ._ffa )+1)){return nil ;};_feba ._ffa =append (_feba ._ffa ,_fde );_gfca .TargetAttr =_fa .RelativeFilename (_eaa ,_baca .Typ ,_afec ,len (_feba ._ffa ));_abg :=_bb .NewRelationships ();_cgfc .AddTarget (_d .RelationsPathFor (_egcc ),_abg .X (),_afec ,0);_feba ._cdb =append (_feba ._cdb ,_abg );case _fa .ImageType :_egcc =_ca .Clean (_egcc );if _cfg ,_ada :=_feba ._aaef [_egcc ];_ada {_gfca .TargetAttr =_cfg ;return nil ;};_cabc :="";for _befa ,_afc :=range _gca {if _afc ==nil {continue ;};if _afc .Name ==_egcc {_gcad ,_aed :=_d .ExtractToDiskTmp (_afc ,_feba .TmpPath );if _aed !=nil {return _aed ;};_feac ,_aed :=_bb .ImageFromStorage (_gcad );if _aed !=nil {return _aed ;};_cabc =_feac .Format ;_caeg :=_bb .MakeImageRef (_feac ,&_feba .DocBase ,_feba ._aae );_caeg .SetTarget ("\u002e\u002e\u002f"+_egcc [4:]);_feba .Images =append (_feba .Images ,_caeg );_gca [_befa ]=nil ;_cgfc .RecordIndex (_egcc ,len (_feba .Images ));break ;};};_dge :=_cgfc .IndexFor (_egcc );_gfca .TargetAttr =_fa .RelativeImageFilename (_eaa ,_baca .Typ ,_afec ,_dge ,_cabc );_feba ._aaef [_egcc ]=_gfca .TargetAttr ;default:_be .Log .Debug ("\u0075\u006e\u0073\u0075\u0070p\u006f\u0072\u0074\u0065\u0064\u0020\u0072\u0065\u006c\u0061\u0074\u0069\u006fn\u0073\u0068\u0069\u0070\u0020\u0074\u0079\u0070\u0065\u003a\u0020\u0025\u0073\u0020\u0074\u0067\u0074\u003a\u0020\u0025\u0073",_afec ,_egcc );};return nil ;};
// TableInfo is used for keep information about a table, a row and a cell where the text is located.
type TableInfo struct{Table *_ffd .CT_Table ;Row *_ffd .CT_TableRow ;Cell *_ffd .CT_TableCell ;RowIndex int ;ColIndex int ;};
// New initializes and reurns a new presentation
func New ()*Presentation {_cbf :=_afe ();_cbf .ContentTypes .AddOverride ("/\u0070\u0070\u0074\u002fpr\u0065s\u0065\u006e\u0074\u0061\u0074i\u006f\u006e\u002e\u0078\u006d\u006c","\u0061\u0070\u0070\u006c\u0069\u0063\u0061t\u0069\u006f\u006e\u002f\u0076\u006e\u0064\u002e\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072m\u0061\u0074\u0073\u002d\u006ff\u0066\u0069\u0063\u0065\u0064\u006f\u0063\u0075\u006de\u006e\u0074\u002e\u0070\u0072\u0065\u0073\u0065\u006e\u0074\u0061\u0074\u0069\u006f\u006e\u006d\u006c\u002e\u0070\u0072\u0065\u0073\u0065\u006e\u0074\u0061\u0074\u0069\u006f\u006e\u002e\u006d\u0061\u0069\u006e\u002b\u0078\u006d\u006c");_cbf .Rels .AddRelationship ("\u0064\u006f\u0063\u0050\u0072\u006f\u0070\u0073\u002f\u0063\u006f\u0072e\u002e\u0078\u006d\u006c","\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061s\u002e\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066o\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006ba\u0067\u0065\u002f\u0032\u0030\u0030\u0036\u002f\u0072\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073\u002f\u006d\u0065\u0074\u0061\u0064\u0061\u0074\u0061/\u0063\u006f\u0072\u0065\u002d\u0070\u0072\u006f\u0070e\u0072\u0074i\u0065\u0073");_cbf .Rels .AddRelationship ("\u0064\u006fc\u0050\u0072\u006fp\u0073\u002f\u0061\u0070\u0070\u002e\u0078\u006d\u006c","\u0068t\u0074\u0070\u003a\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073\u002eo\u0070\u0065\u006ex\u006d\u006c\u0066\u006f\u0072\u006da\u0074\u0073.\u006f\u0072\u0067\u002f\u006f\u0066\u0066\u0069\u0063\u0065\u0044\u006f\u0063\u0075\u006d\u0065\u006e\u0074\u002f\u0032\u0030\u0030\u0036\u002f\u0072\u0065\u006c\u0061\u0074i\u006f\u006e\u0073\u0068\u0069p\u0073\u002f\u0065x\u0074\u0065\u006e\u0064\u0065d\u002d\u0070\u0072\u006f\u0070\u0065\u0072\u0074\u0069\u0065\u0073");_cbf .Rels .AddRelationship ("p\u0070t\u002f\u0070\u0072\u0065\u0073\u0065\u006e\u0074a\u0074\u0069\u006f\u006e.x\u006d\u006c","\u0068\u0074\u0074\u0070\u003a\u002f\u002fs\u0063\u0068\u0065\u006d\u0061\u0073\u002e\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006da\u0074\u0073\u002e\u006f\u0072g\u002f\u006f\u0066\u0066\u0069\u0063\u0065\u0044\u006fc\u0075\u006d\u0065\u006e\u0074\u002f\u0032\u0030\u0030\u0036\u002f\u0072\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073\u002f\u006f\u0066\u0066\u0069\u0063\u0065\u0044\u006f\u0063\u0075\u006d\u0065\u006e\u0074");_cbf .Rels .AddRelationship ("\u0070\u0070\u0074\u002f\u0070\u0072\u0065\u0073\u0050\u0072\u006f\u0070s\u002e\u0078\u006d\u006c","ht\u0074\u0070\u003a\u002f\u002f\u0073\u0063he\u006d\u0061\u0073\u002e\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006da\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u006f\u0066\u0066\u0069\u0063\u0065\u0044\u006f\u0063\u0075\u006d\u0065\u006et\u002f\u0032\u0030\u0030\u0036\u002fr\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068i\u0070s\u002f\u0070\u0072\u0065\u0073\u0050\u0072\u006f\u0070\u0073");_cbf .Rels .AddRelationship ("\u0070\u0070\u0074\u002f\u0076\u0069\u0065\u0077\u0050\u0072\u006f\u0070s\u002e\u0078\u006d\u006c","ht\u0074\u0070\u003a\u002f\u002f\u0073\u0063he\u006d\u0061\u0073\u002e\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006da\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u006f\u0066\u0066\u0069\u0063\u0065\u0044\u006f\u0063\u0075\u006d\u0065\u006et\u002f\u0032\u0030\u0030\u0036\u002fr\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068i\u0070s\u002f\u0076\u0069\u0065\u0077\u0050\u0072\u006f\u0070\u0073");_cbf .Rels .AddRelationship ("\u0070\u0070\u0074\u002fta\u0062\u006c\u0065\u0053\u0074\u0079\u006c\u0065\u0073\u002e\u0078\u006d\u006c","\u0068\u0074\u0074\u0070\u003a\u002f\u002fs\u0063\u0068\u0065\u006d\u0061\u0073\u002e\u006f\u0070\u0065\u006e\u0078\u006d\u006cf\u006fr\u006d\u0061\u0074\u0073\u002e\u006fr\u0067\u002f\u006f\u0066\u0066\u0069\u0063e\u0044\u006f\u0063\u0075\u006d\u0065\u006e\u0074\u002f\u0032\u0030\u0030\u0036\u002f\u0072\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073h\u0069\u0070\u0073\u002f\u0074\u0061\u0062\u006c\u0065\u0053\u0074\u0079\u006ce\u0073");_cbf ._ede .SldMasterIdLst =_cg .NewCT_SlideMasterIdList ();_ffac :=_cg .NewSldMaster ();_ffac .ClrMap .Bg1Attr =_ffd .ST_ColorSchemeIndexLt1 ;_ffac .ClrMap .Bg2Attr =_ffd .ST_ColorSchemeIndexLt2 ;_ffac .ClrMap .Tx1Attr =_ffd .ST_ColorSchemeIndexDk1 ;_ffac .ClrMap .Tx2Attr =_ffd .ST_ColorSchemeIndexDk2 ;_ffac .ClrMap .Accent1Attr =_ffd .ST_ColorSchemeIndexAccent1 ;_ffac .ClrMap .Accent2Attr =_ffd .ST_ColorSchemeIndexAccent2 ;_ffac .ClrMap .Accent3Attr =_ffd .ST_ColorSchemeIndexAccent3 ;_ffac .ClrMap .Accent4Attr =_ffd .ST_ColorSchemeIndexAccent4 ;_ffac .ClrMap .Accent5Attr =_ffd .ST_ColorSchemeIndexAccent5 ;_ffac .ClrMap .Accent6Attr =_ffd .ST_ColorSchemeIndexAccent6 ;_ffac .ClrMap .HlinkAttr =_ffd .ST_ColorSchemeIndexHlink ;_ffac .ClrMap .FolHlinkAttr =_ffd .ST_ColorSchemeIndexFolHlink ;_cbf ._ecc =append (_cbf ._ecc ,_ffac );_eda :=_fa .AbsoluteFilename (_fa .DocTypePresentation ,_fa .SlideMasterType ,1);_cbf .ContentTypes .AddOverride (_eda ,_fa .SlideMasterContentType );_cab :=_cbf ._aae .AddAutoRelationship (_fa .DocTypePresentation ,_fa .OfficeDocumentType ,1,_fa .SlideMasterType );_dgg :=_cg .NewCT_SlideMasterIdListEntry ();_dgg .IdAttr =_fa .Uint32 (2147483648);_dgg .RIdAttr =_cab .ID ();_cbf ._ede .SldMasterIdLst .SldMasterId =append (_cbf ._ede .SldMasterIdLst .SldMasterId ,_dgg );_agc :=_bb .NewRelationships ();_cbf ._cfaa =append (_cbf ._cfaa ,_agc );_efd :=_cg .NewSldLayout ();_cece :=_agc .AddAutoRelationship (_fa .DocTypePresentation ,_fa .SlideMasterType ,1,_fa .SlideLayoutType );_abc :=_fa .AbsoluteFilename (_fa .DocTypePresentation ,_fa .SlideLayoutType ,1);_cbf .ContentTypes .AddOverride (_abc ,_fa .SlideLayoutContentType );_agc .AddAutoRelationship (_fa .DocTypePresentation ,_fa .SlideMasterType ,1,_fa .ThemeType );_cbf ._acgb =append (_cbf ._acgb ,_efd );_ffac .SldLayoutIdLst =_cg .NewCT_SlideLayoutIdList ();_acc :=_cg .NewCT_SlideLayoutIdListEntry ();_acc .IdAttr =_fa .Uint32 (2147483649);_acc .RIdAttr =_cece .ID ();_ffac .SldLayoutIdLst .SldLayoutId =append (_ffac .SldLayoutIdLst .SldLayoutId ,_acc );_dce :=_bb .NewRelationships ();_cbf ._ecd =append (_cbf ._ecd ,_dce );_dce .AddAutoRelationship (_fa .DocTypePresentation ,_fa .SlideType ,1,_fa .SlideMasterType );_cbf ._ede .NotesSz .CxAttr =6858000;_cbf ._ede .NotesSz .CyAttr =9144000;_gfe :=_ffd .NewTheme ();_gfe .NameAttr =_fa .String ("\u0075n\u0069o\u0066\u0066\u0069\u0063\u0065\u0020\u0054\u0068\u0065\u006d\u0065");_gfe .ThemeElements .ClrScheme .NameAttr ="\u004f\u0066\u0066\u0069\u0063\u0065";_gfe .ThemeElements .ClrScheme .Dk1 .SysClr =_ffd .NewCT_SystemColor ();_gfe .ThemeElements .ClrScheme .Dk1 .SysClr .LastClrAttr =_fa .String ("\u0030\u0030\u0030\u0030\u0030\u0030");_gfe .ThemeElements .ClrScheme .Dk1 .SysClr .ValAttr =_ffd .ST_SystemColorValWindowText ;_gfe .ThemeElements .ClrScheme .Lt1 .SysClr =_ffd .NewCT_SystemColor ();_gfe .ThemeElements .ClrScheme .Lt1 .SysClr .LastClrAttr =_fa .String ("\u0066\u0066\u0066\u0066\u0066\u0066");_gfe .ThemeElements .ClrScheme .Lt1 .SysClr .ValAttr =_ffd .ST_SystemColorValWindow ;_gfe .ThemeElements .ClrScheme .Dk2 .SrgbClr =_ffd .NewCT_SRgbColor ();_gfe .ThemeElements .ClrScheme .Dk2 .SrgbClr .ValAttr ="\u0034\u0034\u0035\u0034\u0036\u0061";_gfe .ThemeElements .ClrScheme .Lt2 .SrgbClr =_ffd .NewCT_SRgbColor ();_gfe .ThemeElements .ClrScheme .Lt2 .SrgbClr .ValAttr ="\u0065\u0037\u0065\u0037\u0065\u0036";_gfe .ThemeElements .ClrScheme .Accent1 .SrgbClr =_ffd .NewCT_SRgbColor ();_gfe .ThemeElements .ClrScheme .Accent1 .SrgbClr .ValAttr ="\u0034\u0034\u0037\u0032\u0063\u0034";_gfe .ThemeElements .ClrScheme .Accent2 .SrgbClr =_ffd .NewCT_SRgbColor ();_gfe .ThemeElements .ClrScheme .Accent2 .SrgbClr .ValAttr ="\u0065\u0064\u0037\u0064\u0033\u0031";_gfe .ThemeElements .ClrScheme .Accent3 .SrgbClr =_ffd .NewCT_SRgbColor ();_gfe .ThemeElements .ClrScheme .Accent3 .SrgbClr .ValAttr ="\u0061\u0035\u0061\u0035\u0061\u0035";_gfe .ThemeElements .ClrScheme .Accent4 .SrgbClr =_ffd .NewCT_SRgbColor ();_gfe .ThemeElements .ClrScheme .Accent4 .SrgbClr .ValAttr ="\u0066\u0066\u0063\u0030\u0030\u0030";_gfe .ThemeElements .ClrScheme .Accent5 .SrgbClr =_ffd .NewCT_SRgbColor ();_gfe .ThemeElements .ClrScheme .Accent5 .SrgbClr .ValAttr ="\u0035\u0062\u0039\u0062\u0064\u0035";_gfe .ThemeElements .ClrScheme .Accent6 .SrgbClr =_ffd .NewCT_SRgbColor ();_gfe .ThemeElements .ClrScheme .Accent6 .SrgbClr .ValAttr ="\u0037\u0030\u0061\u0064\u0034\u0037";_gfe .ThemeElements .ClrScheme .Hlink .SrgbClr =_ffd .NewCT_SRgbColor ();_gfe .ThemeElements .ClrScheme .Hlink .SrgbClr .ValAttr ="\u0030\u0035\u0036\u0033\u0063\u0031";_gfe .ThemeElements .ClrScheme .FolHlink .SrgbClr =_ffd .NewCT_SRgbColor ();_gfe .ThemeElements .ClrScheme .FolHlink .SrgbClr .ValAttr ="\u0039\u0035\u0034\u0066\u0037\u0032";_gfe .ThemeElements .FontScheme .NameAttr ="\u004f\u0066\u0066\u0069\u0063\u0065";_gfe .ThemeElements .FontScheme .MajorFont .Latin .TypefaceAttr ="\u0043\u0061\u006c\u0069\u0062\u0072\u0069\u0020\u004c\u0069\u0067\u0068\u0074";_gfe .ThemeElements .FontScheme .MinorFont .Latin .TypefaceAttr ="\u0043a\u006c\u0069\u0062\u0072\u0069";_gfe .ThemeElements .FmtScheme .NameAttr =_fa .String ("\u004f\u0066\u0066\u0069\u0063\u0065");_aga :=_ffd .NewEG_FillProperties ();_gfe .ThemeElements .FmtScheme .FillStyleLst .EG_FillProperties =append (_gfe .ThemeElements .FmtScheme .FillStyleLst .EG_FillProperties ,_aga );_aga .SolidFill =&_ffd .CT_SolidColorFillProperties {SchemeClr :&_ffd .CT_SchemeColor {ValAttr :_ffd .ST_SchemeColorValPhClr }};_aga =_ffd .NewEG_FillProperties ();_gfe .ThemeElements .FmtScheme .FillStyleLst .EG_FillProperties =append (_gfe .ThemeElements .FmtScheme .FillStyleLst .EG_FillProperties ,_aga );_gfe .ThemeElements .FmtScheme .FillStyleLst .EG_FillProperties =append (_gfe .ThemeElements .FmtScheme .FillStyleLst .EG_FillProperties ,_aga );_aga .GradFill =&_ffd .CT_GradientFillProperties {RotWithShapeAttr :_fa .Bool (true ),GsLst :&_ffd .CT_GradientStopList {},Lin :&_ffd .CT_LinearShadeProperties {}};_aga .GradFill .Lin .AngAttr =_fa .Int32 (5400000);_aga .GradFill .Lin .ScaledAttr =_fa .Bool (false );_aad :=_ffd .NewCT_GradientStop ();_aad .PosAttr .ST_PositiveFixedPercentageDecimal =_fa .Int32 (0);_aad .SchemeClr =&_ffd .CT_SchemeColor {ValAttr :_ffd .ST_SchemeColorValPhClr };_aga .GradFill .GsLst .Gs =append (_aga .GradFill .GsLst .Gs ,_aad );_aad =_ffd .NewCT_GradientStop ();_aad .PosAttr .ST_PositiveFixedPercentageDecimal =_fa .Int32 (50000);_aad .SchemeClr =&_ffd .CT_SchemeColor {ValAttr :_ffd .ST_SchemeColorValPhClr };_aga .GradFill .GsLst .Gs =append (_aga .GradFill .GsLst .Gs ,_aad );_gfe .ThemeElements .FmtScheme .LnStyleLst =_ffd .NewCT_LineStyleList ();for _cfb :=0;_cfb < 3;_cfb ++{_cgbb :=_ffd .NewCT_LineProperties ();_cgbb .WAttr =_fa .Int32 (int32 (6350*(_cfb +1)));_cgbb .CapAttr =_ffd .ST_LineCapFlat ;_cgbb .CmpdAttr =_ffd .ST_CompoundLineSng ;_cgbb .AlgnAttr =_ffd .ST_PenAlignmentCtr ;_gfe .ThemeElements .FmtScheme .LnStyleLst .Ln =append (_gfe .ThemeElements .FmtScheme .LnStyleLst .Ln ,_cgbb );};_gfe .ThemeElements .FmtScheme .EffectStyleLst =_ffd .NewCT_EffectStyleList ();for _ffba :=0;_ffba < 3;_ffba ++{_cdee :=_ffd .NewCT_EffectStyleItem ();_cdee .EffectLst =_ffd .NewCT_EffectList ();_gfe .ThemeElements .FmtScheme .EffectStyleLst .EffectStyle =append (_gfe .ThemeElements .FmtScheme .EffectStyleLst .EffectStyle ,_cdee );};_aaab :=_ffd .NewEG_FillProperties ();_aaab .SolidFill =&_ffd .CT_SolidColorFillProperties {SchemeClr :&_ffd .CT_SchemeColor {ValAttr :_ffd .ST_SchemeColorValPhClr }};_gfe .ThemeElements .FmtScheme .BgFillStyleLst .EG_FillProperties =append (_gfe .ThemeElements .FmtScheme .BgFillStyleLst .EG_FillProperties ,_aaab );_gfe .ThemeElements .FmtScheme .BgFillStyleLst .EG_FillProperties =append (_gfe .ThemeElements .FmtScheme .BgFillStyleLst .EG_FillProperties ,_aaab );_gfe .ThemeElements .FmtScheme .BgFillStyleLst .EG_FillProperties =append (_gfe .ThemeElements .FmtScheme .BgFillStyleLst .EG_FillProperties ,_aga );_cbf ._ffa =append (_cbf ._ffa ,_gfe );_gcfcf :=_fa .AbsoluteFilename (_fa .DocTypePresentation ,_fa .ThemeType ,1);_cbf .ContentTypes .AddOverride (_gcfcf ,_fa .ThemeContentType );_cbf ._aae .AddAutoRelationship (_fa .DocTypePresentation ,_fa .OfficeDocumentType ,1,_fa .ThemeType );_fabc :=_bb .NewRelationships ();_cbf ._cdb =append (_cbf ._cdb ,_fabc );return _cbf ;};
// ValidateWithPath validates the slide passing path informaton for a better
// error message.
func (_daee Slide )ValidateWithPath (path string )error {if _fga :=_daee ._dfbe .ValidateWithPath (path );_fga !=nil {return _fga ;};for _ ,_fcgf :=range _daee ._dfbe .CSld .SpTree .Choice {for _ ,_face :=range _fcgf .Sp {if _face .TxBody !=nil {if len (_face .TxBody .P )==0{return _eb .New (path +"\u0020\u003a \u0073\u006c\u0069\u0064\u0065 \u0073\u0068\u0061\u0070\u0065 \u0077\u0069\u0074\u0068\u0020\u0061\u0020\u0074\u0078\u0062\u006f\u0064\u0079\u0020\u006d\u0075\u0073\u0074\u0020\u0063\u006f\u006e\u0074\u0061\u0069\u006e\u0020\u0070\u0061\u0072\u0061\u0067\u0072\u0061\u0070\u0068\u0073");};};};};return nil ;};func (_ceae *Slide )ensureClrMap (){if len (_ceae ._eagc ._ecc )==0||len (_ceae ._eagc ._ffa )==0{return ;};_fegce :=_ceae ._eagc ._ecc [0];_gcd :=_fegce .ClrMap ;if _fgeb :=_ceae ._dfbe .ClrMapOvr ;_fgeb !=nil {if _deef :=_fgeb .Choice ;_deef !=nil {if _deef .MasterClrMapping ==nil {if _aaabd :=_deef .OverrideClrMapping ;_aaabd !=nil {if _aaabd .Bg1Attr !=_ffd .ST_ColorSchemeIndexUnset {_gcd .Bg1Attr =_aaabd .Bg1Attr ;};if _aaabd .Tx1Attr !=_ffd .ST_ColorSchemeIndexUnset {_gcd .Tx1Attr =_aaabd .Tx1Attr ;};if _aaabd .Bg2Attr !=_ffd .ST_ColorSchemeIndexUnset {_gcd .Bg2Attr =_aaabd .Bg2Attr ;};if _aaabd .Tx2Attr !=_ffd .ST_ColorSchemeIndexUnset {_gcd .Tx2Attr =_aaabd .Tx2Attr ;};if _aaabd .Accent1Attr !=_ffd .ST_ColorSchemeIndexUnset {_gcd .Accent1Attr =_aaabd .Accent1Attr ;};if _aaabd .Accent2Attr !=_ffd .ST_ColorSchemeIndexUnset {_gcd .Accent2Attr =_aaabd .Accent2Attr ;};if _aaabd .Accent3Attr !=_ffd .ST_ColorSchemeIndexUnset {_gcd .Accent3Attr =_aaabd .Accent3Attr ;};if _aaabd .Accent4Attr !=_ffd .ST_ColorSchemeIndexUnset {_gcd .Accent4Attr =_aaabd .Accent4Attr ;};if _aaabd .Accent5Attr !=_ffd .ST_ColorSchemeIndexUnset {_gcd .Accent5Attr =_aaabd .Accent5Attr ;};if _aaabd .Accent6Attr !=_ffd .ST_ColorSchemeIndexUnset {_gcd .Accent6Attr =_aaabd .Accent6Attr ;};if _aaabd .HlinkAttr !=_ffd .ST_ColorSchemeIndexUnset {_gcd .HlinkAttr =_aaabd .HlinkAttr ;};if _aaabd .FolHlinkAttr !=_ffd .ST_ColorSchemeIndexUnset {_gcd .FolHlinkAttr =_aaabd .FolHlinkAttr ;};};};};};_ceae ._gfagd =_gcd ;};func (_ege *Presentation )Validate ()error {if _cgf :=_ege ._ede .Validate ();_cgf !=nil {return _cgf ;};for _fea ,_ffgf :=range _ege .Slides (){if _afb :=_ffgf .ValidateWithPath (_fag .Sprintf ("\u0053l\u0069\u0064\u0065\u005b\u0025\u0064]",_fea ));_afb !=nil {return _afb ;};};for _fcf ,_gfec :=range _ege ._ecc {if _begc :=_gfec .ValidateWithPath (_fag .Sprintf ("\u0053l\u0069d\u0065\u004d\u0061\u0073\u0074\u0065\u0072\u005b\u0025\u0064\u005d",_fcf ));_begc !=nil {return _begc ;};};for _dfe ,_ecg :=range _ege ._acgb {if _dgdc :=_ecg .ValidateWithPath (_fag .Sprintf ("\u0053l\u0069d\u0065\u004c\u0061\u0079\u006f\u0075\u0074\u005b\u0025\u0064\u005d",_dfe ));_dgdc !=nil {return _dgdc ;};};return nil ;};
// NewPresentationProperties constructs a new PresentationProperties.
func NewPresentationProperties ()PresentationProperties {return PresentationProperties {_egg :_cg .NewPresentationPr ()};};
// GetImageByRelID returns an ImageRef with the associated relation ID in the
// document.
func (_agag *Presentation )GetImageByRelID (relID string )(_bb .ImageRef ,bool ){for _ ,_deg :=range _agag .Images {if _deg .RelID ()==relID {return _deg ,true ;};};return _bb .ImageRef {},false ;};
// TextItem is used for keeping text with references to a paragraph and run, a shape or a table, a row and a cell where it is located.
type TextItem struct{Text string ;Presentation *Presentation ;Shape *_cg .CT_Shape ;GraphicFrame *_cg .CT_GraphicalObjectFrame ;Paragraph *_ffd .CT_TextParagraph ;Run *_ffd .CT_RegularTextRun ;TableInfo *TableInfo ;_ae []rectangle ;_ea int ;_feg int ;};
// Themes returns an array of presentation themes.
func (_adc *Presentation )Themes ()[]*_ffd .Theme {return _adc ._ffa };func _cbe (_cba []*_cg .CT_GroupShapeChoice )[]*_cg .CT_GroupShapeChoice {var _gcfb []*_cg .CT_GroupShapeChoice ;for _ ,_ecce :=range _cba {if len (_ecce .Pic )==0{_gcfb =append (_gcfb ,_ecce );};};return _gcfb ;};
// SaveToFileAsTemplate writes the Presentation out to a file as a template.
func (_fec *Presentation )SaveToFileAsTemplate (path string )error {return _fec .saveToFile (path ,true )};
// GetTextBoxes returns a list of all text boxes from a slide.
func (_afef Slide )GetTextBoxes ()[]*TextBox {_cfbg :=[]*TextBox {};_efdb :=_afef ._dfbe .CSld .SpTree .Choice ;for _ ,_baee :=range _efdb {for _ ,_aagdg :=range _baee .Sp {if _aagdg .NvSpPr .CNvSpPr .TxBoxAttr !=nil &&*_aagdg .NvSpPr .CNvSpPr .TxBoxAttr {_cfbg =append (_cfbg ,&TextBox {_aagdg });};};};return _cfbg ;};
// SlideLayouts returns the slide layouts defined in the presentation.
func (_dcg *Presentation )SlideLayouts ()[]SlideLayout {_gceb :=[]SlideLayout {};for _ ,_cee :=range _dcg ._acgb {_gceb =append (_gceb ,SlideLayout {_cee });};return _gceb ;};
// AddImage adds an image textbox to a slide.
func (_gcc Slide )AddImage (img _bb .ImageRef )Image {_dgge :=_cg .NewCT_GroupShapeChoice ();_gcc ._dfbe .CSld .SpTree .Choice =append (_gcc ._dfbe .CSld .SpTree .Choice ,_dgge );_ccfe :=_cg .NewCT_Picture ();_dgge .Pic =append (_dgge .Pic ,_ccfe );_ccfe .NvPicPr .CNvPicPr =_ffd .NewCT_NonVisualPictureProperties ();_ccfe .NvPicPr .CNvPicPr .PicLocks =_ffd .NewCT_PictureLocking ();_ccfe .NvPicPr .CNvPicPr .PicLocks .NoChangeAspectAttr =_fa .Bool (true );_ccfe .BlipFill =_ffd .NewCT_BlipFillProperties ();_ccfe .BlipFill .Blip =_ffd .NewCT_Blip ();_eaag :=_gcc .AddImageToRels (img );_ccfe .BlipFill .Blip .EmbedAttr =_fa .String (_eaag );_ccfe .BlipFill .Stretch =_ffd .NewCT_StretchInfoProperties ();_ccfe .BlipFill .Stretch .FillRect =_ffd .NewCT_RelativeRect ();_ccfe .SpPr =_ffd .NewCT_ShapeProperties ();_ccfe .SpPr .PrstGeom =_ffd .NewCT_PresetGeometry2D ();_ccfe .SpPr .PrstGeom .PrstAttr =_ffd .ST_ShapeTypeRect ;_cdfb :=Image {_ccfe };_feff :=img .Size ();_cdfb .Properties ().SetWidth (_da .Distance (_feff .X )*_da .Pixel72 );_cdfb .Properties ().SetHeight (_da .Distance (_feff .Y )*_da .Pixel72 );_cdfb .Properties ().SetPosition (0,0);return _cdfb ;};
// SlideMasters returns the slide masters defined in the presentation.
func (_gec *Presentation )SlideMasters ()[]SlideMaster {_ffbag :=[]SlideMaster {};for _gdb ,_fef :=range _gec ._ecc {_ffbag =append (_ffbag ,SlideMaster {_gec ,_gec ._cfaa [_gdb ],_fef });};return _ffbag ;};
// X returns the inner wrapped XML type.
func (_beaf PlaceHolder )X ()*_cg .CT_Shape {return _beaf ._edbb };
// LastViewAttr returns the LastViewAttr property.
func (_fadd ViewProperties )LastViewAttr ()_cg .ST_ViewType {return _fadd ._decg .LastViewAttr };
// PresentationText is an array of extracted text items which has some methods for representing extracted text.
type PresentationText struct{Slides []*SlideText ;};
// AddDefaultSlideWithLayout tries to replicate what PowerPoint does when
// inserting a slide with a new style by clearing placeholder content and removing
// some placeholders. Use AddSlideWithLayout if you need more control.
func (_cbec *Presentation )AddDefaultSlideWithLayout (l SlideLayout )(Slide ,error ){_acgf ,_gga :=_cbec .AddSlideWithLayout (l );for _ ,_dae :=range _acgf .PlaceHolders (){_dae .Clear ();switch _dae .Type (){case _cg .ST_PlaceholderTypeFtr ,_cg .ST_PlaceholderTypeDt ,_cg .ST_PlaceholderTypeSldNum :_dae .Remove ();};};return _acgf ,_gga ;};func (_efeg *Presentation )saveToFile (_bce string ,_agaf bool )error {_fegb ,_gebg :=_bc .Create (_bce );if _gebg !=nil {return _gebg ;};defer _fegb .Close ();return _efeg .save (_fegb ,_agaf );};
// Less is for implementing sorting of two locations. Symbols share the same location if they are in the same paragraph or table. One location is 'less' than another first by y coordinate, if y coordinates are equal or differ by less than yEpsilon, then x coordinates are compared, then if they are also equal, indexes of locations in the table are compared, then positions of locations in a paragraph.
func (_gde sort2d )Less (i ,j int )bool {_dab ,_fce :=_gde [i ],_gde [j ];_ad ,_gbc :=_dab ._ae ,_fce ._ae ;_acf ,_cea :=len (_ad )-1,len (_gbc )-1;_geg ,_egf :=0,0;for {_fcd ,_bbf ,_gcfc ,_fgd ,_edb ,_bea ,_dafa ,_bbc :=_ad [_geg ]._daa ,_gbc [_egf ]._daa ,_ad [_geg ]._ebd ,_gbc [_egf ]._ebd ,_ad [_geg ]._baf ,_gbc [_egf ]._baf ,_ad [_geg ]._bf ,_gbc [_egf ]._bf ;if _fcd ==_bbf ||((_ce .Abs (float64 (_fcd )-float64 (_bbf ))< _gbg )&&((_fcd >=_bbf &&_fcd <=_fgd )||(_bbf >=_fcd &&_bbf <=_gcfc ))&&(_dafa < _bea ||_edb > _bbc )){if _edb ==_bea {if _geg < _acf &&_egf < _cea {_geg ++;_egf ++;continue ;};if _geg >=_acf &&_egf >=_cea {break ;};return _geg >=_acf ;}else {return _edb < _bea ;};}else {return _fcd < _bbf ;};};_fdg ,_bef ,_cceg ,_dfc :=_dab ._ea ,_fce ._ea ,_dab ._feg ,_fce ._feg ;if _fdg ==_bef {return _cceg <=_dfc ;};return _fdg < _bef ;};
// Slides returns the slides in the presentation.
func (_afgb *Presentation )Slides ()[]Slide {_gdc :=[]Slide {};for _edag ,_afgd :=range _afgb ._dgb {_gdc =append (_gdc ,Slide {_afgb ._ede .SldIdLst .SldId [_edag ],_afgd ,_afgb ,nil });};return _gdc ;};func (_bed *chart )X ()*_f .ChartSpace {return _bed ._gb };
// RemoveSlide removes a slide from a presentation.
func (_aegd *Presentation )RemoveSlide (s Slide )error {_fgf :=false ;_eed :=0;for _fcfc ,_affb :=range _aegd ._dgb {if _affb ==s ._dfbe {if _aegd ._ede .SldIdLst .SldId [_fcfc ]!=s ._fae {return _eb .New ("i\u006e\u0063\u006f\u006e\u0073\u0069s\u0074\u0065\u006e\u0063\u0079\u0020i\u006e\u0020\u0073\u006c\u0069\u0064\u0065s\u0020\u0061\u006e\u0064\u0020\u0049\u0044\u0020\u006c\u0069s\u0074");};copy (_aegd ._dgb [_fcfc :],_aegd ._dgb [_fcfc +1:]);_aegd ._dgb =_aegd ._dgb [0:len (_aegd ._dgb )-1];copy (_aegd ._fegc [_fcfc :],_aegd ._fegc [_fcfc +1:]);_aegd ._fegc =_aegd ._fegc [0:len (_aegd ._fegc )-1];copy (_aegd ._ede .SldIdLst .SldId [_fcfc :],_aegd ._ede .SldIdLst .SldId [_fcfc +1:]);_aegd ._ede .SldIdLst .SldId =_aegd ._ede .SldIdLst .SldId [0:len (_aegd ._ede .SldIdLst .SldId )-1];_fgf =true ;_eed =_fcfc ;};};if !_fgf {return _eb .New ("u\u006ea\u0062\u006c\u0065\u0020\u0074\u006f\u0020\u0066i\u006e\u0064\u0020\u0073li\u0064\u0065");};_ecb :=_fa .AbsoluteFilename (_fa .DocTypePresentation ,_fa .SlideType ,0);return _aegd .ContentTypes .RemoveOverrideByIndex (_ecb ,_eed );};
// GetChartSpaceByRelId returns a *crt.ChartSpace with the associated relation ID in the
// slide.
func (_bgbf *Slide )GetChartSpaceByRelId (relId string )*_f .ChartSpace {_efea :=_bgbf .getSlideRels ();if (_efea ==_bb .Relationships {}){return nil ;};_fee :=_efea .GetTargetByRelId (relId );for _ ,_cdfg :=range _bgbf ._eagc ._cff {if _fee ==_cdfg .Target (){return _cdfg ._gb ;};};return nil ;};
// X returns the inner wrapped XML type.
func (_gcfa SlideLayout )X ()*_cg .SldLayout {return _gcfa ._cef };
// X returns the inner wrapped XML type.
func (_fbg *Presentation )X ()*_cg .Presentation {return _fbg ._ede };
// NotesViewPr returns the NotesViewPr property.
func (_dgcad ViewProperties )NotesViewPr ()*_cg .CT_NotesViewProperties {return _dgcad ._decg .NotesViewPr ;};func (_bbde *Slide )getSlideRels ()_bb .Relationships {_caaa :=_bbde ._eagc ;for _eggc ,_ddf :=range _caaa .Slides (){if *_bbde ._dfbe ==*_ddf ._dfbe {return _caaa ._fegc [len (_caaa ._fegc )-_eggc -1];};};return _bb .Relationships {};};
// OpenTemplate opens a template file.
func OpenTemplate (fn string )(*Presentation ,error ){_eaf ,_bdg :=Open (fn );if _bdg !=nil {return nil ,_bdg ;};return _eaf ,nil ;};func _fg (_aag *Presentation ,_gcg []*_cg .CT_GroupShapeChoice ,_gcf []rectangle ,_ccc []*TextItem )[]*TextItem {for _ ,_fgb :=range _gcg {_daf :=append ([]rectangle {},_gcf ...);for _ ,_ab :=range _fgb .Sp {_ccc =append (_ccc ,_cf (_aag ,_ab ,nil ,nil ,_ab .SpPr .Xfrm ,0,_gcf ,_ab .TxBody .P )...);};for _ ,_aaa :=range _fgb .GraphicFrame {if _aaa !=nil &&_aaa .Graphic !=nil &&_aaa .Graphic .GraphicData !=nil {_ecf :=_aaa .Xfrm ;for _ ,_dc :=range _aaa .Graphic .GraphicData .Any {if _cd ,_bca :=_dc .(*_ffd .Tbl );_bca {_ccca :=&_cd .CT_Table ;_afg :=0;for _ac ,_bd :=range _cd .Tr {for _fc ,_ebdd :=range _bd .Tc {_ecfd :=&TableInfo {Table :_ccca ,Row :_bd ,Cell :_ebdd ,RowIndex :_ac ,ColIndex :_fc };_ccc =append (_ccc ,_cf (_aag ,nil ,_aaa ,_ecfd ,_ecf ,_afg ,_gcf ,_ebdd .TxBody .P )...);_afg ++;};};};};};};for _ ,_ceg :=range _fgb .GrpSp {if _ceg .GrpSpPr !=nil {_ccg :=_ceg .GrpSpPr .Xfrm ;var _gfd ,_ace int64 ;if _ccg .Off !=nil {_dg ,_aec :=_ccg .Off .XAttr .ST_CoordinateUnqualified ,_ccg .Off .YAttr .ST_CoordinateUnqualified ;if _dg !=nil &&_aec !=nil {if _gcgf :=_ccg .Ext ;_gcgf !=nil {_gfd ,_ace =_gcgf .CxAttr ,_gcgf .CyAttr ;};_daf =append (_daf ,rectangle {_baf :*_dg ,_daa :*_aec ,_bf :*_dg +_gfd ,_ebd :*_aec +_ace });};};};_ccc =_fg (_aag ,_ceg .Choice ,_daf ,_ccc );};};return _ccc ;};
// SaveToFile writes the Presentation out to a file.
func (_cad *Presentation )SaveToFile (path string )error {return _cad .saveToFile (path ,false )};
// AddSlide adds a new slide to the presentation.
func (_agg *Presentation )AddSlide ()Slide {_bbd :=_cg .NewCT_SlideIdListEntry ();_bbd .IdAttr =_agg .nextSlideID ();_agg ._ede .SldIdLst .SldId =append (_agg ._ede .SldIdLst .SldId ,_bbd );_baeb :=_cg .NewSld ();_baeb .CSld .SpTree .NvGrpSpPr .CNvPr .IdAttr =1;_baeb .CSld .SpTree .GrpSpPr .Xfrm =_ffd .NewCT_GroupTransform2D ();_baeb .CSld .SpTree .GrpSpPr .Xfrm .Off =_ffd .NewCT_Point2D ();_baeb .CSld .SpTree .GrpSpPr .Xfrm .Off .XAttr .ST_CoordinateUnqualified =_fa .Int64 (0);_baeb .CSld .SpTree .GrpSpPr .Xfrm .Off .YAttr .ST_CoordinateUnqualified =_fa .Int64 (0);_baeb .CSld .SpTree .GrpSpPr .Xfrm .Ext =_ffd .NewCT_PositiveSize2D ();_baeb .CSld .SpTree .GrpSpPr .Xfrm .Ext .CxAttr =int64 (0*_da .Point );_baeb .CSld .SpTree .GrpSpPr .Xfrm .Ext .CyAttr =int64 (0*_da .Point );_baeb .CSld .SpTree .GrpSpPr .Xfrm .ChOff =_baeb .CSld .SpTree .GrpSpPr .Xfrm .Off ;_baeb .CSld .SpTree .GrpSpPr .Xfrm .ChExt =_baeb .CSld .SpTree .GrpSpPr .Xfrm .Ext ;_agg ._dgb =append (_agg ._dgb ,_baeb );_dgca :=_agg ._aae .AddAutoRelationship (_fa .DocTypePresentation ,_fa .OfficeDocumentType ,len (_agg ._dgb ),_fa .SlideType );_bbd .RIdAttr =_dgca .ID ();_aeg :=_fa .AbsoluteFilename (_fa .DocTypePresentation ,_fa .SlideType ,len (_agg ._dgb ));_agg .ContentTypes .AddOverride (_aeg ,_fa .SlideContentType );_def :=_bb .NewRelationships ();_agg ._fegc =append (_agg ._fegc ,_def );_def .AddAutoRelationship (_fa .DocTypePresentation ,_fa .SlideType ,len (_agg ._acgb ),_fa .SlideLayoutType );return Slide {_bbd ,_baeb ,_agg ,nil };};
// ExtLst returns the ExtLst property.
func (_acb PresentationProperties )ExtLst ()*_cg .CT_ExtensionList {return _acb ._egg .ExtLst };
// ClearAll completely clears a placeholder. To be useable, at least one
// paragraph must be added after ClearAll via AddParagraph.
func (_ffg PlaceHolder )ClearAll (){_ffg ._edbb .SpPr =_ffd .NewCT_ShapeProperties ();_ffg ._edbb .TxBody =_ffd .NewCT_TextBody ();_ffg ._edbb .TxBody .LstStyle =_ffd .NewCT_TextListStyle ();};
// ExtractText returns text from a slide as a SlideText object.
func (_eab *Slide )ExtractText ()*SlideText {_fff :=_fg (_eab ._eagc ,_eab ._dfbe .CSld .SpTree .Choice ,[]rectangle {},[]*TextItem {});_bcc .Sort (sort2d (_fff ));return &SlideText {Items :_fff };};
// Image is an image within a slide.
type Image struct{_adf *_cg .CT_Picture };
// Open opens and reads a document from a file (.pptx).
func Open (filename string )(*Presentation ,error ){_bbb ,_gfa :=_bc .Open (filename );if _gfa !=nil {return nil ,_fag .Errorf ("e\u0072r\u006f\u0072\u0020\u006f\u0070\u0065\u006e\u0069n\u0067\u0020\u0025\u0073: \u0025\u0073",filename ,_gfa );};defer _bbb .Close ();_ccgb ,_gfa :=_bc .Stat (filename );if _gfa !=nil {return nil ,_fag .Errorf ("e\u0072r\u006f\u0072\u0020\u006f\u0070\u0065\u006e\u0069n\u0067\u0020\u0025\u0073: \u0025\u0073",filename ,_gfa );};_ =_ccgb ;return Read (_bbb ,_ccgb .Size ());};type rectangle struct{_baf int64 ;_daa int64 ;_bf int64 ;_ebd int64 ;};
// Close closes the presentation, removing any temporary files that might have been
// created when opening a document.
func (_cdfe *Presentation )Close ()error {if _cdfe .TmpPath !=""{return _c .RemoveAll (_cdfe .TmpPath );};return nil ;};
// Properties returns the properties of the TextBox.
func (_eca TextBox )Properties ()_eg .ShapeProperties {if _eca ._fdc .SpPr ==nil {_eca ._fdc .SpPr =_ffd .NewCT_ShapeProperties ();};return _eg .MakeShapeProperties (_eca ._fdc .SpPr );};
// AddTable adds an empty table to a slide.
func (_ffge Slide )AddTable ()*_bb .Table {_dbgb :=_cg .NewCT_GroupShapeChoice ();_ffge ._dfbe .CSld .SpTree .Choice =append (_ffge ._dfbe .CSld .SpTree .Choice ,_dbgb );_ded :=_cg .NewCT_GraphicalObjectFrame ();_dbgb .GraphicFrame =append (_dbgb .GraphicFrame ,_ded );_ded .Xfrm .Off =_ffd .NewCT_Point2D ();_bdd :=int64 (1);_ded .Xfrm .Off .XAttr =_ffd .ST_Coordinate {ST_CoordinateUnqualified :&_bdd };_ded .Xfrm .Off .YAttr =_ffd .ST_Coordinate {ST_CoordinateUnqualified :&_bdd };_abcg :=_ded .Graphic .CT_GraphicalObject .GraphicData ;_abcg .UriAttr ="\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073\u002eo\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073.\u006f\u0072\u0067\u002f\u0064\u0072\u0061\u0077\u0069\u006e\u0067\u006dl/\u0032\u0030\u0030\u0036\u002f\u0074\u0061\u0062\u006c\u0065";_cgcf :=_bb .NewTableWithXfrm (_ded .Xfrm );_abcg .Any =append (_abcg .Any ,_cgcf .X ());return _cgcf ;};func (_gac *Presentation )nextSlideID ()uint32 {_abe :=uint32 (256);for _ ,_ffc :=range _gac ._ede .SldIdLst .SldId {if _ffc .IdAttr >=_abe {_abe =_ffc .IdAttr +1;};};return _abe ;};func (_ag sort2d )Len ()int {return len (_ag )};
// SetTextAnchor controls the text anchoring
func (_eff TextBox )SetTextAnchor (a _ffd .ST_TextAnchoringType ){_eff ._fdc .TxBody .BodyPr =_ffd .NewCT_TextBodyProperties ();_eff ._fdc .TxBody .BodyPr .AnchorAttr =a ;};
// GridSpacing returns the GridSpacing property.
func (_cbc ViewProperties )GridSpacing ()*_ffd .CT_PositiveSize2D {return _cbc ._decg .GridSpacing };
// GetColorBySchemeColor returns *dml.CT_Color mapped to scheme colors like dk1, lt1 etc. depending on what theme is used in the presentation.
func (_fefe *Slide )GetColorBySchemeColor (schClr _ffd .ST_SchemeColorVal )*_ffd .CT_Color {_fefe .ensureClrMap ();_faef :=_fefe ._gfagd ;if _faef ==nil {return nil ;};var _dggec _ffd .ST_ColorSchemeIndex ;switch schClr .String (){case "\u0062\u0067\u0031":_dggec =_faef .Bg1Attr ;case "\u0062\u0067\u0032":_dggec =_faef .Bg2Attr ;case "\u0074\u0078\u0031":_dggec =_faef .Tx1Attr ;case "\u0074\u0078\u0032":_dggec =_faef .Tx2Attr ;case "\u0061c\u0063\u0065\u006e\u0074\u0031":_dggec =_faef .Accent1Attr ;case "\u0061c\u0063\u0065\u006e\u0074\u0032":_dggec =_faef .Accent2Attr ;case "\u0061c\u0063\u0065\u006e\u0074\u0033":_dggec =_faef .Accent3Attr ;case "\u0061c\u0063\u0065\u006e\u0074\u0034":_dggec =_faef .Accent4Attr ;case "\u0061c\u0063\u0065\u006e\u0074\u0035":_dggec =_faef .Accent5Attr ;case "\u0061c\u0063\u0065\u006e\u0074\u0036":_dggec =_faef .Accent6Attr ;case "\u0068\u006c\u0069n\u006b":_dggec =_faef .HlinkAttr ;case "\u0066\u006f\u006c\u0048\u006c\u0069\u006e\u006b":_dggec =_faef .FolHlinkAttr ;case "\u0064\u006b\u0031":_dggec =_ffd .ST_ColorSchemeIndexDk1 ;case "\u0064\u006b\u0032":_dggec =_ffd .ST_ColorSchemeIndexDk2 ;case "\u006c\u0074\u0031":_dggec =_ffd .ST_ColorSchemeIndexLt1 ;case "\u006c\u0074\u0032":_dggec =_ffd .ST_ColorSchemeIndexLt2 ;default:_dggec =_ffd .ST_ColorSchemeIndexUnset ;};_dgf :=_fefe ._eagc ._ffa [0];_gef :=_dgf .ThemeElements ;if _gef ==nil {return nil ;};var _afdg *_ffd .CT_Color ;_dbe :=_gef .ClrScheme ;switch _dggec .String (){case "\u0064\u006b\u0031":_afdg =_dbe .Dk1 ;case "\u0064\u006b\u0032":_afdg =_dbe .Dk2 ;case "\u006c\u0074\u0031":_afdg =_dbe .Lt1 ;case "\u006c\u0074\u0032":_afdg =_dbe .Lt2 ;case "\u0061c\u0063\u0065\u006e\u0074\u0031":_afdg =_dbe .Accent1 ;case "\u0061c\u0063\u0065\u006e\u0074\u0032":_afdg =_dbe .Accent2 ;case "\u0061c\u0063\u0065\u006e\u0074\u0033":_afdg =_dbe .Accent3 ;case "\u0061c\u0063\u0065\u006e\u0074\u0034":_afdg =_dbe .Accent4 ;case "\u0061c\u0063\u0065\u006e\u0074\u0035":_afdg =_dbe .Accent5 ;case "\u0061c\u0063\u0065\u006e\u0074\u0036":_afdg =_dbe .Accent6 ;case "\u0068\u006c\u0069n\u006b":_afdg =_dbe .Hlink ;case "\u0066\u006f\u006c\u0048\u006c\u0069\u006e\u006b":_afdg =_dbe .FolHlink ;default:return nil ;};return _afdg ;};
// NormalViewPr returns the NormalViewPr property.
func (_gag ViewProperties )NormalViewPr ()*_cg .CT_NormalViewProperties {return _gag ._decg .NormalViewPr ;};
// SlideMaster is the slide master for a presentation.
type SlideMaster struct{_ebddb *Presentation ;_ffcd _bb .Relationships ;_ebc *_cg .SldMaster ;};
// Name returns the name of the slide layout.
func (_fba SlideLayout )Name ()string {if _fba ._cef .CSld !=nil &&_fba ._cef .CSld .NameAttr !=nil {return *_fba ._cef .CSld .NameAttr ;};return "";};const _gbg float64 =500000;
// Slide represents a slide of a presentation.
type Slide struct{_fae *_cg .CT_SlideIdListEntry ;_dfbe *_cg .Sld ;_eagc *Presentation ;_gfagd *_ffd .CT_ColorMapping ;};
// Text returns text from a presentation as one string separated with line breaks.
func (_gdf *PresentationText )Text ()string {_dec :=_dd .NewBuffer ([]byte {});for _ ,_ggf :=range _gdf .Slides {_dec .WriteString (_ggf .Text ());};return _dec .String ();};
// WebPr returns the WebPr property.
func (_cb PresentationProperties )WebPr ()*_cg .CT_WebProperties {return _cb ._egg .WebPr };
// X returns the inner wrapped XML type.
func (_fcc SlideMaster )X ()*_cg .SldMaster {return _fcc ._ebc };func (_gded TextBox )getOff ()*_ffd .CT_Point2D {if _gded ._fdc .SpPr ==nil {_gded ._fdc .SpPr =_ffd .NewCT_ShapeProperties ();};if _gded ._fdc .SpPr .Xfrm ==nil {_gded ._fdc .SpPr .Xfrm =_ffd .NewCT_Transform2D ();};if _gded ._fdc .SpPr .Xfrm .Off ==nil {_gded ._fdc .SpPr .Xfrm .Off =_ffd .NewCT_Point2D ();};return _gded ._fdc .SpPr .Xfrm .Off ;};
// HtmlPubPr returns the HtmlPubPr property.
func (_ffb PresentationProperties )HtmlPubPr ()*_cg .CT_HtmlPublishProperties {return _ffb ._egg .HtmlPubPr ;};
// SetText sets the text of a placeholder for the initial paragraph. This is a
// shortcut method that is useful for things like titles which only contain a
// single paragraph.
func (_cde PlaceHolder )SetText (text string ){_cde .Clear ();_fcg :=_ffd .NewEG_TextRun ();_fcg .R =_ffd .NewCT_RegularTextRun ();_fcg .R .T =text ;if len (_cde ._edbb .TxBody .P )==0{_cde ._edbb .TxBody .P =append (_cde ._edbb .TxBody .P ,_ffd .NewCT_TextParagraph ());};_cde ._edbb .TxBody .P [0].EG_TextRun =nil ;_cde ._edbb .TxBody .P [0].EG_TextRun =append (_cde ._edbb .TxBody .P [0].EG_TextRun ,_fcg );};
// SlideLayouts returns a slice of all layouts in SlideMaster.
func (_aeb SlideMaster )SlideLayouts ()[]SlideLayout {_age :=map[string ]int {};_egd :=[]SlideLayout {};for _ ,_gfgc :=range _aeb ._ffcd .Relationships (){_dafc :=_a .Replace (_gfgc .Target (),".\u002e\u002f\u0073\u006c\u0069\u0064e\u004c\u0061\u0079\u006f\u0075\u0074\u0073\u002f\u0073l\u0069\u0064\u0065L\u0061y\u006f\u0075\u0074","",-1);_dafc =_a .Replace (_dafc ,"\u002e\u0078\u006d\u006c","",-1);if _gedd ,_feca :=_fe .ParseInt (_dafc ,10,32);_feca ==nil {_age [_gfgc .ID ()]=int (_gedd );};};for _ ,_fefb :=range _aeb ._ebc .SldLayoutIdLst .SldLayoutId {if _eec ,_ceaed :=_age [_fefb .RIdAttr ];_ceaed {_dbeg :=_aeb ._ebddb ._acgb [_eec -1];_egd =append (_egd ,SlideLayout {_dbeg });};};return _egd ;};
// PlaceHolder is a place holder from a slide.
type PlaceHolder struct{_edbb *_cg .CT_Shape ;_gegg *_cg .Sld ;};
// NotesTextViewPr returns the NotesTextViewPr property.
func (_egae ViewProperties )NotesTextViewPr ()*_cg .CT_NotesTextViewProperties {return _egae ._decg .NotesTextViewPr ;};
// GetSlideLayout returns a slide layout related to the slide.
func (_gbdc *Slide )GetSlideLayout ()*_cg .SldLayout {for _dbbg ,_bdb :=range _gbdc ._eagc .Slides (){if *_gbdc ==_bdb {return _gbdc ._eagc ._acgb [len (_gbdc ._eagc .Slides ())-_dbbg -1];};};return nil ;};
// X returns the inner wrapped XML type.
func (_gdd PresentationProperties )X ()*_cg .PresentationPr {return _gdd ._egg };
// GetColorBySchemeColor returns *dml.CT_Color mapped to scheme colors like dk1, lt1 etc. depending on what theme is used in the presentation.
func (_ddc *Presentation )GetColorBySchemeColor (schClr _ffd .ST_SchemeColorVal )*_ffd .CT_Color {if len (_ddc ._ecc )==0||len (_ddc ._ffa )==0{return nil ;};var _fddc _ffd .ST_ColorSchemeIndex ;_eccf :=_ddc ._ecc [0];_dcb :=_eccf .ClrMap ;switch schClr .String (){case "\u0062\u0067\u0031":_fddc =_dcb .Bg1Attr ;case "\u0062\u0067\u0032":_fddc =_dcb .Bg2Attr ;case "\u0074\u0078\u0031":_fddc =_dcb .Tx1Attr ;case "\u0074\u0078\u0032":_fddc =_dcb .Tx2Attr ;case "\u0061c\u0063\u0065\u006e\u0074\u0031":_fddc =_dcb .Accent1Attr ;case "\u0061c\u0063\u0065\u006e\u0074\u0032":_fddc =_dcb .Accent2Attr ;case "\u0061c\u0063\u0065\u006e\u0074\u0033":_fddc =_dcb .Accent3Attr ;case "\u0061c\u0063\u0065\u006e\u0074\u0034":_fddc =_dcb .Accent4Attr ;case "\u0061c\u0063\u0065\u006e\u0074\u0035":_fddc =_dcb .Accent5Attr ;case "\u0061c\u0063\u0065\u006e\u0074\u0036":_fddc =_dcb .Accent6Attr ;case "\u0068\u006c\u0069n\u006b":_fddc =_dcb .HlinkAttr ;case "\u0066\u006f\u006c\u0048\u006c\u0069\u006e\u006b":_fddc =_dcb .FolHlinkAttr ;case "\u0064\u006b\u0031":_fddc =_ffd .ST_ColorSchemeIndexDk1 ;case "\u0064\u006b\u0032":_fddc =_ffd .ST_ColorSchemeIndexDk2 ;case "\u006c\u0074\u0031":_fddc =_ffd .ST_ColorSchemeIndexLt1 ;case "\u006c\u0074\u0032":_fddc =_ffd .ST_ColorSchemeIndexLt2 ;default:_fddc =_ffd .ST_ColorSchemeIndexUnset ;};_ffdb :=_ddc ._ffa [0];_bbda :=_ffdb .ThemeElements ;if _bbda ==nil {return nil ;};var _cdea *_ffd .CT_Color ;_ecfc :=_bbda .ClrScheme ;switch _fddc .String (){case "\u0064\u006b\u0031":_cdea =_ecfc .Dk1 ;case "\u0064\u006b\u0032":_cdea =_ecfc .Dk2 ;case "\u006c\u0074\u0031":_cdea =_ecfc .Lt1 ;case "\u006c\u0074\u0032":_cdea =_ecfc .Lt2 ;case "\u0061c\u0063\u0065\u006e\u0074\u0031":_cdea =_ecfc .Accent1 ;case "\u0061c\u0063\u0065\u006e\u0074\u0032":_cdea =_ecfc .Accent2 ;case "\u0061c\u0063\u0065\u006e\u0074\u0033":_cdea =_ecfc .Accent3 ;case "\u0061c\u0063\u0065\u006e\u0074\u0034":_cdea =_ecfc .Accent4 ;case "\u0061c\u0063\u0065\u006e\u0074\u0035":_cdea =_ecfc .Accent5 ;case "\u0061c\u0063\u0065\u006e\u0074\u0036":_cdea =_ecfc .Accent6 ;case "\u0068\u006c\u0069n\u006b":_cdea =_ecfc .Hlink ;case "\u0066\u006f\u006c\u0048\u006c\u0069\u006e\u006b":_cdea =_ecfc .FolHlink ;default:return nil ;};return _cdea ;};func _cf (_acg *Presentation ,_cga *_cg .CT_Shape ,_bac *_cg .CT_GraphicalObjectFrame ,_ccf *TableInfo ,_ga *_ffd .CT_Transform2D ,_bae int ,_ed []rectangle ,_cfa []*_ffd .CT_TextParagraph )[]*TextItem {_bda :=[]*TextItem {};var _aff ,_gae ,_cce ,_dgc ,_beg ,_afd int64 ;_caa :=_ga ==nil ;_bdc :=0;for _ ,_ebb :=range _cfa {for _ ,_dcc :=range _ebb .EG_TextRun {if _cec :=_dcc .R ;_cec !=nil {if !_caa {if _ga .Off !=nil {if _fed :=_ga .Ext ;_fed !=nil {_beg ,_afd =_fed .CxAttr ,_fed .CyAttr ;};if _eabg :=_ga .Off .XAttr .ST_CoordinateUnqualified ;_eabg !=nil {_aff =*_eabg ;_gae =_aff +_beg ;_caa =true ;};if _abf :=_ga .Off .YAttr .ST_CoordinateUnqualified ;_abf !=nil {_cce =*_abf ;_dgc =_cce +_afd ;_caa =true ;};};};_bdad :=append ([]rectangle {},_ed ...);_bdad =append (_bdad ,rectangle {_baf :_aff ,_bf :_gae ,_daa :_cce ,_ebd :_dgc });_bda =append (_bda ,&TextItem {Presentation :_acg ,Shape :_cga ,GraphicFrame :_bac ,TableInfo :_ccf ,Paragraph :_ebb ,Run :_cec ,Text :_cec .T ,_ae :_bdad ,_ea :_bae ,_feg :_bdc });_bdc ++;};};};return _bda ;};
// SlideViewPr returns the SlideViewPr property.
func (_afeb ViewProperties )SlideViewPr ()*_cg .CT_SlideViewProperties {return _afeb ._decg .SlideViewPr };
// X returns the inner wrapped XML type.
func (_aeee ViewProperties )X ()*_cg .ViewPr {return _aeee ._decg };
// Presentation returns a slide's presentation.
func (_eaaa Slide )Presentation ()*Presentation {return _eaaa ._eagc };
// PlaceHolders returns all of the content place holders within a given slide.
func (_cgee Slide )PlaceHolders ()[]PlaceHolder {_edba :=[]PlaceHolder {};for _ ,_gaf :=range _cgee ._dfbe .CSld .SpTree .Choice {for _ ,_eccg :=range _gaf .Sp {if _eccg .NvSpPr !=nil &&_eccg .NvSpPr .NvPr !=nil &&_eccg .NvSpPr .NvPr .Ph !=nil {_edba =append (_edba ,PlaceHolder {_eccg ,_cgee ._dfbe });};};};return _edba ;};
// GetLayoutByName retrieves a slide layout given a layout name.
func (_gbcf *Presentation )GetLayoutByName (name string )(SlideLayout ,error ){for _ ,_dcfa :=range _gbcf ._acgb {if _dcfa .CSld .NameAttr !=nil &&name ==*_dcfa .CSld .NameAttr {return SlideLayout {_dcfa },nil ;};};return SlideLayout {},_eb .New ("\u0075\u006eab\u006c\u0065\u0020t\u006f\u0020\u0066\u0069nd \u006cay\u006f\u0075\u0074\u0020\u0077\u0069\u0074h \u0074\u0068\u0061\u0074\u0020\u006e\u0061m\u0065");};
// PrnPr returns the PrnPr property.
func (_cda PresentationProperties )PrnPr ()*_cg .CT_PrintProperties {return _cda ._egg .PrnPr };var _gfc =false ;
// SlideText is an array of extracted text items which has some methods for representing extracted text from a slide.
type SlideText struct{Items []*TextItem ;};
// SorterViewPr returns the SorterViewPr property.
func (_afff ViewProperties )SorterViewPr ()*_cg .CT_SlideSorterViewProperties {return _afff ._decg .SorterViewPr ;};
// NewViewProperties constructs a new ViewProperties.
func NewViewProperties ()ViewProperties {return ViewProperties {_decg :_cg .NewViewPr ()}};
// OutlineViewPr returns the OutlineViewPr property.
func (_begf ViewProperties )OutlineViewPr ()*_cg .CT_OutlineViewProperties {return _begf ._decg .OutlineViewPr ;};
// PresentationProperties contains document specific properties.
type PresentationProperties struct{_egg *_cg .PresentationPr };
// AddParagraph adds a new paragraph to a placeholder.
func (_agf PlaceHolder )AddParagraph ()_eg .Paragraph {_eabgb :=_eg .MakeParagraph (_ffd .NewCT_TextParagraph ());_agf ._edbb .TxBody .P =append (_agf ._edbb .TxBody .P ,_eabgb .X ());return _eabgb ;};
// Clear clears the placeholder contents and adds a single empty paragraph. The
// empty paragrah is required by PowerPoint or it will report the file as being
// invalid.
func (_ef PlaceHolder )Clear (){_ef .ClearAll ();_gbe :=_ffd .NewCT_TextParagraph ();_ef ._edbb .TxBody .P =[]*_ffd .CT_TextParagraph {_gbe };_gbe .EndParaRPr =_ffd .NewCT_TextCharacterProperties ();_gbe .EndParaRPr .LangAttr =_fa .String ("\u0065\u006e\u002dU\u0053");};
// ShowPr returns the ShowPr property.
func (_gcb PresentationProperties )ShowPr ()*_cg .CT_ShowProperties {return _gcb ._egg .ShowPr };
// ViewProperties contains presentation specific properties.
type ViewProperties struct{_decg *_cg .ViewPr };
// GetPlaceholderByIndex returns a placeholder given its index. If there are multiplace
// placeholders of the same index, this method returns the first one. You must use the
// PlaceHolders() method to access the others.
func (_ccff Slide )GetPlaceholderByIndex (idx uint32 )(PlaceHolder ,error ){for _ ,_cfcf :=range _ccff ._dfbe .CSld .SpTree .Choice {for _ ,_add :=range _cfcf .Sp {if _add .NvSpPr !=nil &&_add .NvSpPr .NvPr !=nil &&_add .NvSpPr .NvPr .Ph !=nil {if (idx ==0&&_add .NvSpPr .NvPr .Ph .IdxAttr ==nil )||(_add .NvSpPr .NvPr .Ph .IdxAttr !=nil &&*_add .NvSpPr .NvPr .Ph .IdxAttr ==idx ){return PlaceHolder {_add ,_ccff ._dfbe },nil ;};};};};return PlaceHolder {},_eb .New ("\u0075\u006e\u0061\u0062\u006c\u0065\u0020\u0074\u006f\u0020\u0066i\u006e\u0064\u0020\u0070\u006c\u0061\u0063\u0065\u0068\u006fl\u0064\u0065\u0072");};func (_bege *Presentation )save (_cgef _fb .Writer ,_dca bool )error {const _aee ="\u0050\u0072\u0065\u0073en\u0074\u0061\u0074\u0069\u006f\u006e\u003a\u0070\u002e\u0053\u0061\u0076\u0065";if _db :=_bege ._ede .Validate ();_db !=nil {_be .Log .Debug ("\u0076\u0061\u006c\u0069\u0064\u0061\u0074\u0069\u006f\u006e\u0020\u0065\u0072\u0072\u006fr\u0020i\u006e\u0020\u0064\u006f\u0063\u0075\u006d\u0065\u006e\u0074\u003a\u0020\u0025\u0073",_db );};if !_ba .GetLicenseKey ().IsLicensed ()&&!_gfc {_fag .Println ("\u0055\u006e\u006ci\u0063\u0065\u006e\u0073e\u0064\u0020\u0076\u0065\u0072\u0073\u0069o\u006e\u0020\u006f\u0066\u0020\u0055\u006e\u0069\u004f\u0066\u0066\u0069\u0063\u0065");_fag .Println ("\u002d\u0020\u0047e\u0074\u0020\u0061\u0020\u0074\u0072\u0069\u0061\u006c\u0020\u006c\u0069\u0063\u0065\u006e\u0073\u0065\u0020\u006f\u006e\u0020\u0068\u0074\u0074\u0070\u0073\u003a\u002f\u002fu\u006e\u0069\u0064\u006f\u0063\u002e\u0069\u006f");return _eb .New ("\u0075\u006e\u0069\u006f\u0066\u0066\u0069\u0063\u0065\u0020\u006ci\u0063\u0065\u006e\u0073\u0065\u0020\u0072\u0065\u0071\u0075i\u0072\u0065\u0064");};if len (_bege ._edbc )==0{_dda ,_bcf :=_ba .GenRefId ("\u0070\u0077");if _bcf !=nil {_be .Log .Error ("\u0045R\u0052\u004f\u0052\u003a\u0020\u0025v",_bcf );return _bcf ;};_bege ._edbc =_dda ;};if _cdf :=_ba .Track (_bege ._edbc ,_aee );_cdf !=nil {_be .Log .Error ("\u0045R\u0052\u004f\u0052\u003a\u0020\u0025v",_cdf );return _cdf ;};if _dca {_bege .ContentTypes .RemoveOverride ("\u0061\u0070\u0070\u006c\u0069\u0063\u0061t\u0069\u006f\u006e\u002f\u0076\u006e\u0064\u002e\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072m\u0061\u0074\u0073\u002d\u006ff\u0066\u0069\u0063\u0065\u0064\u006f\u0063\u0075\u006de\u006e\u0074\u002e\u0070\u0072\u0065\u0073\u0065\u006e\u0074\u0061\u0074\u0069\u006f\u006e\u006d\u006c\u002e\u0070\u0072\u0065\u0073\u0065\u006e\u0074\u0061\u0074\u0069\u006f\u006e\u002e\u006d\u0061\u0069\u006e\u002b\u0078\u006d\u006c");_bege .ContentTypes .EnsureOverride ("/\u0070\u0070\u0074\u002fpr\u0065s\u0065\u006e\u0074\u0061\u0074i\u006f\u006e\u002e\u0078\u006d\u006c","\u0061\u0070pl\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u0076\u006e\u0064\u002e\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066o\u0072\u006d\u0061\u0074s\u002d\u006f\u0066\u0066ic\u0065\u0064o\u0063u\u006d\u0065\u006e\u0074\u002e\u0070r\u0065\u0073\u0065n\u0074\u0061t\u0069\u006f\u006e\u006d\u006c\u002e\u0074\u0065\u006d\u0070\u006c\u0061\u0074\u0065.\u006d\u0061\u0069\u006e\u002b\u0078\u006d\u006c");}else {_bege .ContentTypes .RemoveOverride ("\u0061\u0070pl\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u0076\u006e\u0064\u002e\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066o\u0072\u006d\u0061\u0074s\u002d\u006f\u0066\u0066ic\u0065\u0064o\u0063u\u006d\u0065\u006e\u0074\u002e\u0070r\u0065\u0073\u0065n\u0074\u0061t\u0069\u006f\u006e\u006d\u006c\u002e\u0074\u0065\u006d\u0070\u006c\u0061\u0074\u0065.\u006d\u0061\u0069\u006e\u002b\u0078\u006d\u006c");_bege .ContentTypes .EnsureOverride ("/\u0070\u0070\u0074\u002fpr\u0065s\u0065\u006e\u0074\u0061\u0074i\u006f\u006e\u002e\u0078\u006d\u006c","\u0061\u0070\u0070\u006c\u0069\u0063\u0061t\u0069\u006f\u006e\u002f\u0076\u006e\u0064\u002e\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072m\u0061\u0074\u0073\u002d\u006ff\u0066\u0069\u0063\u0065\u0064\u006f\u0063\u0075\u006de\u006e\u0074\u002e\u0070\u0072\u0065\u0073\u0065\u006e\u0074\u0061\u0074\u0069\u006f\u006e\u006d\u006c\u002e\u0070\u0072\u0065\u0073\u0065\u006e\u0074\u0061\u0074\u0069\u006f\u006e\u002e\u006d\u0061\u0069\u006e\u002b\u0078\u006d\u006c");};_efa :=_fa .DocTypePresentation ;_ade :=_fbf .NewWriter (_cgef );defer _ade .Close ();if _afa :=_d .MarshalXML (_ade ,_fa .BaseRelsFilename ,_bege .Rels .X ());_afa !=nil {return _afa ;};if _egc :=_d .MarshalXMLByType (_ade ,_efa ,_fa .ExtendedPropertiesType ,_bege .AppProperties .X ());_egc !=nil {return _egc ;};if _fdd :=_d .MarshalXMLByType (_ade ,_efa ,_fa .CorePropertiesType ,_bege .CoreProperties .X ());_fdd !=nil {return _fdd ;};if _bec :=_d .MarshalXMLByType (_ade ,_efa ,_fa .PresentationPropertiesType ,_bege ._fcge .X ());_bec !=nil {return _bec ;};if _adg :=_d .MarshalXMLByType (_ade ,_efa ,_fa .ViewPropertiesType ,_bege ._dcd .X ());_adg !=nil {return _adg ;};if _bbe :=_d .MarshalXMLByType (_ade ,_efa ,_fa .TableStylesType ,_bege ._ceb .X ());_bbe !=nil {return _bbe ;};if _bege .CustomProperties .X ()!=nil {if _bega :=_d .MarshalXMLByType (_ade ,_efa ,_fa .CustomPropertiesType ,_bege .CustomProperties .X ());_bega !=nil {return _bega ;};};if _bege .Thumbnail !=nil {_cbab ,_fada :=_ade .Create ("\u0064\u006f\u0063Pr\u006f\u0070\u0073\u002f\u0074\u0068\u0075\u006d\u0062\u006e\u0061\u0069\u006c\u002e\u006a\u0070\u0065\u0067");if _fada !=nil {return _fada ;};if _dff :=_g .Encode (_cbab ,_bege .Thumbnail ,nil );_dff !=nil {return _dff ;};};_bdced :=_fa .AbsoluteFilename (_efa ,_fa .OfficeDocumentType ,0);if _aagf :=_d .MarshalXML (_ade ,_bdced ,_bege ._ede );_aagf !=nil {return _aagf ;};if _fac :=_d .MarshalXML (_ade ,_d .RelationsPathFor (_bdced ),_bege ._aae .X ());_fac !=nil {return _fac ;};for _dgd ,_ffbe :=range _bege ._dgb {_dafd :=_fa .AbsoluteFilename (_fa .DocTypePresentation ,_fa .SlideType ,_dgd +1);_d .MarshalXML (_ade ,_dafd ,_ffbe );if !_bege ._fegc [_dgd ].IsEmpty (){_bcg :=_d .RelationsPathFor (_dafd );_d .MarshalXML (_ade ,_bcg ,_bege ._fegc [_dgd ].X ());};};for _dfbd ,_efc :=range _bege ._ecc {_efe :=_fa .AbsoluteFilename (_fa .DocTypePresentation ,_fa .SlideMasterType ,_dfbd +1);_d .MarshalXML (_ade ,_efe ,_efc );if !_bege ._cfaa [_dfbd ].IsEmpty (){_fdgf :=_d .RelationsPathFor (_efe );_d .MarshalXML (_ade ,_fdgf ,_bege ._cfaa [_dfbd ].X ());};};for _dcf ,_cbfg :=range _bege ._acgb {_geb :=_fa .AbsoluteFilename (_fa .DocTypePresentation ,_fa .SlideLayoutType ,_dcf +1);_d .MarshalXML (_ade ,_geb ,_cbfg );if !_bege ._ecd [_dcf ].IsEmpty (){_bbdf :=_d .RelationsPathFor (_geb );_d .MarshalXML (_ade ,_bbdf ,_bege ._ecd [_dcf ].X ());};};for _cabf ,_aea :=range _bege ._ffa {_dfba :=_fa .AbsoluteFilename (_fa .DocTypePresentation ,_fa .ThemeType ,_cabf +1);_d .MarshalXML (_ade ,_dfba ,_aea );if !_bege ._cdb [_cabf ].IsEmpty (){_dea :=_d .RelationsPathFor (_dfba );_d .MarshalXML (_ade ,_dea ,_bege ._cdb [_cabf ].X ());};};for _fbe ,_cae :=range _bege ._cff {_bab :=_fa .AbsoluteFilename (_efa ,_fa .ChartType ,_fbe +1);_d .MarshalXML (_ade ,_bab ,_cae );};for _gce ,_bgg :=range _bege ._gaa {_gbd :=_fa .AbsoluteFilename (_efa ,_fa .HandoutMasterType ,_gce +1);_d .MarshalXML (_ade ,_gbd ,_bgg );};for _dafe ,_dcfe :=range _bege ._dad {_aagd :=_fa .AbsoluteFilename (_efa ,_fa .NotesMasterType ,_dafe +1);_d .MarshalXML (_ade ,_aagd ,_dcfe );};for _fbd ,_dde :=range _bege ._efb {_deb :=_fa .AbsoluteFilename (_efa ,_fa .CustomXMLType ,_fbd +1);_d .MarshalXML (_ade ,_deb ,_dde );};for _efg ,_dadc :=range _bege .Images {if _aecc :=_bb .AddImageToZip (_ade ,_dadc ,_efg +1,_fa .DocTypePresentation );_aecc !=nil {return _aecc ;};};_bege .ContentTypes .EnsureDefault ("\u0070\u006e\u0067","\u0069m\u0061\u0067\u0065\u002f\u0070\u006eg");_bege .ContentTypes .EnsureDefault ("\u006a\u0070\u0065\u0067","\u0069\u006d\u0061\u0067\u0065\u002f\u006a\u0070\u0065\u0067");_bege .ContentTypes .EnsureDefault ("\u006a\u0070\u0067","\u0069\u006d\u0061\u0067\u0065\u002f\u006a\u0070\u0065\u0067");_bege .ContentTypes .EnsureDefault ("\u0077\u006d\u0066","i\u006d\u0061\u0067\u0065\u002f\u0078\u002d\u0077\u006d\u0066");if _cca :=_d .MarshalXML (_ade ,_fa .ContentTypesFilename ,_bege .ContentTypes .X ());_cca !=nil {return _cca ;};if _ccef :=_bege .WriteExtraFiles (_ade );_ccef !=nil {return _ccef ;};return nil ;};
// AddParagraph adds a paragraph to the text box
func (_ddfg TextBox )AddParagraph ()_eg .Paragraph {_gfdc :=_ffd .NewCT_TextParagraph ();_ddfg ._fdc .TxBody .P =append (_ddfg ._fdc .TxBody .P ,_gfdc );return _eg .MakeParagraph (_gfdc );};
// Paragraphs returns the paragraphs defined in the placeholder.
func (_feb PlaceHolder )Paragraphs ()[]_eg .Paragraph {_gcgfe :=[]_eg .Paragraph {};for _ ,_fega :=range _feb ._edbb .TxBody .P {_gcgfe =append (_gcgfe ,_eg .MakeParagraph (_fega ));};return _gcgfe ;};
// ClrMru returns the ClrMru property.
func (_dfd PresentationProperties )ClrMru ()*_ffd .CT_ColorMRU {return _dfd ._egg .ClrMru };
// GetImageByRelID returns an ImageRef with the associated relation ID in the
// slide.
func (_bccae *Slide )GetImageByRelID (relID string )(_bb .ImageRef ,bool ){_ebaf :=_bccae .getSlideRels ();if (_ebaf ==_bb .Relationships {}){return _bb .ImageRef {},false ;};var _eaac string ;for _ ,_fbff :=range _ebaf .X ().Relationship {if _fbff .IdAttr ==relID {_eaac =_fbff .TargetAttr ;break ;};};for _ ,_fbea :=range _bccae ._eagc .Images {if _fbea .Target ()==_eaac {return _fbea ,true ;};};return _bb .ImageRef {},false ;};
// SetOffsetX sets horizontal offset of text box in distance units (see measurement package).
func (_cebf TextBox )SetOffsetX (offX float64 ){_cfbd :=_cebf .getOff ();_dddb :=_da .ToEMU (offX );_cfbd .XAttr =_ffd .ST_Coordinate {ST_CoordinateUnqualified :&_dddb };};
// Type returns the type of the slide layout.
func (_baac SlideLayout )Type ()_cg .ST_SlideLayoutType {return _baac ._cef .TypeAttr };
// TextBox is a text box within a slide.
type TextBox struct{_fdc *_cg .CT_Shape };
// SetOffsetY sets vertical offset of text box in distance units (see measurement package).
func (_egcea TextBox )SetOffsetY (offY float64 ){_ead :=_egcea .getOff ();_fdf :=_da .ToEMU (offY );_ead .YAttr =_ffd .ST_Coordinate {ST_CoordinateUnqualified :&_fdf };};
// AddImageToRels adds an image relationship to a slide without putting image on the slide.
func (_ebed Slide )AddImageToRels (img _bb .ImageRef )string {_agb :=0;for _ggb ,_dgbb :=range _ebed ._eagc .Images {if _dgbb ==img {_agb =_ggb +1;break ;};};var _cbed string ;for _fge ,_gedc :=range _ebed ._eagc .Slides (){if _gedc ._dfbe ==_ebed ._dfbe {_gfg :=_fag .Sprintf ("\u002e\u002e\u002f\u006ded\u0069\u0061\u002f\u0069\u006d\u0061\u0067\u0065\u0025\u0064\u002e\u0025\u0073",_agb ,img .Format ());_gbb :=_ebed ._eagc ._fegc [_fge ].AddRelationship (_gfg ,_fa .ImageType );_cbed =_gbb .ID ();};};return _cbed ;};
// GetTableStyleById returns *dml.CT_TableStyle by its style id.
func (_bcff *Presentation )GetTableStyleById (id string )*_ffd .CT_TableStyle {_fcgc :=_bcff ._ceb .TblStyle ();for _ ,_bdf :=range _fcgc {if _bdf .StyleIdAttr ==id {return _bdf ;};};return nil ;};