unioffice/vmldrawing/vmldrawing.go
2021-05-31 16:22:30 +00:00

19 lines
7.1 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 vmldrawing ;import (_c "encoding/xml";_fe "fmt";_g "github.com/unidoc/unioffice";_d "github.com/unidoc/unioffice/schema/soo/ofc/sharedTypes";_a "github.com/unidoc/unioffice/schema/urn/schemas_microsoft_com/office/excel";_b "github.com/unidoc/unioffice/schema/urn/schemas_microsoft_com/vml";);
// NewCommentShape creates a new comment shape for a given cell index. The
// indices here are zero based.
func NewCommentShape (col ,row int64 )*_b .Shape {_bd :=_b .NewShape ();_bd .IdAttr =_g .String (_fe .Sprintf ("\u0063\u0073\u005f\u0025\u0064\u005f\u0025\u0064",col ,row ));_bd .TypeAttr =_g .String ("\u0023\u005f\u00780\u0030\u0030\u0030\u005f\u0074\u0032\u0030\u0032");_bd .StyleAttr =_g .String ("\u0070\u006f\u0073i\u0074\u0069\u006f\u006e\u003a\u0061\u0062\u0073\u006f\u006cu\u0074\u0065\u003b\u006d\u0061\u0072\u0067\u0069\u006e\u002d\u006c\u0065\u0066\u0074:\u0038\u0030\u0070\u0074;\u006d\u0061\u0072\u0067\u0069n-\u0074o\u0070\u003a\u0032pt\u003b\u0077\u0069\u0064\u0074\u0068\u003a1\u0030\u0034\u0070\u0074\u003b\u0068\u0065\u0069\u0067\u0068\u0074\u003a\u0037\u0036\u0070\u0074\u003b\u007a\u002d\u0069\u006e\u0064\u0065x\u003a\u0031\u003bv\u0069\u0073\u0069\u0062\u0069\u006c\u0069t\u0079\u003a\u0068\u0069\u0064\u0064\u0065\u006e");_bd .FillcolorAttr =_g .String ("\u0023f\u0062\u0066\u0036\u0064\u0036");_bd .StrokecolorAttr =_g .String ("\u0023e\u0064\u0065\u0061\u0061\u0031");_af :=_b .NewEG_ShapeElements ();_af .Fill =_b .NewFill ();_af .Fill .Color2Attr =_g .String ("\u0023f\u0062\u0066\u0065\u0038\u0032");_af .Fill .AngleAttr =_g .Float64 (-180);_af .Fill .TypeAttr =_b .ST_FillTypeGradient ;_af .Fill .Fill =_b .NewOfcFill ();_af .Fill .Fill .ExtAttr =_b .ST_ExtView ;_af .Fill .Fill .TypeAttr =_b .OfcST_FillTypeGradientUnscaled ;_bd .EG_ShapeElements =append (_bd .EG_ShapeElements ,_af );_aa :=_b .NewEG_ShapeElements ();_aa .Shadow =_b .NewShadow ();_aa .Shadow .OnAttr =_d .ST_TrueFalseT ;_aa .Shadow .ObscuredAttr =_d .ST_TrueFalseT ;_bd .EG_ShapeElements =append (_bd .EG_ShapeElements ,_aa );_afd :=_b .NewEG_ShapeElements ();_afd .Path =_b .NewPath ();_afd .Path .ConnecttypeAttr =_b .OfcST_ConnectTypeNone ;_bd .EG_ShapeElements =append (_bd .EG_ShapeElements ,_afd );_e :=_b .NewEG_ShapeElements ();_e .Textbox =_b .NewTextbox ();_e .Textbox .StyleAttr =_g .String ("\u006d\u0073\u006f\u002ddi\u0072\u0065\u0063\u0074\u0069\u006f\u006e\u002d\u0061\u006c\u0074\u003a\u0061\u0075t\u006f");_bd .EG_ShapeElements =append (_bd .EG_ShapeElements ,_e );_ff :=_b .NewEG_ShapeElements ();_ff .ClientData =_a .NewClientData ();_ff .ClientData .ObjectTypeAttr =_a .ST_ObjectTypeNote ;_ff .ClientData .MoveWithCells =_d .ST_TrueFalseBlankT ;_ff .ClientData .SizeWithCells =_d .ST_TrueFalseBlankT ;_ff .ClientData .Anchor =_g .String ("\u0031,\u0020\u0031\u0035\u002c\u0020\u0030\u002c\u0020\u0032\u002c\u00202\u002c\u0020\u0035\u0034\u002c\u0020\u0035\u002c\u0020\u0033");_ff .ClientData .AutoFill =_d .ST_TrueFalseBlankFalse ;_ff .ClientData .Row =_g .Int64 (row );_ff .ClientData .Column =_g .Int64 (col );_bd .EG_ShapeElements =append (_bd .EG_ShapeElements ,_ff );return _bd ;};type Container struct{Layout *_b .OfcShapelayout ;ShapeType *_b .Shapetype ;Shape []*_b .Shape ;};func NewContainer ()*Container {return &Container {}};func (_bgd *Container )UnmarshalXML (d *_c .Decoder ,start _c .StartElement )error {_bgd .Shape =nil ;_dc :for {_gc ,_afb :=d .Token ();if _afb !=nil {return _afb ;};switch _dd :=_gc .(type ){case _c .StartElement :switch _dd .Name .Local {case "s\u0068\u0061\u0070\u0065\u006c\u0061\u0079\u006f\u0075\u0074":_bgd .Layout =_b .NewOfcShapelayout ();if _bf :=d .DecodeElement (_bgd .Layout ,&_dd );_bf !=nil {return _bf ;};case "\u0073h\u0061\u0070\u0065\u0074\u0079\u0070e":_bgd .ShapeType =_b .NewShapetype ();if _da :=d .DecodeElement (_bgd .ShapeType ,&_dd );_da !=nil {return _da ;};case "\u0073\u0068\u0061p\u0065":_bab :=_b .NewShape ();if _be :=d .DecodeElement (_bab ,&_dd );_be !=nil {return _be ;};_bgd .Shape =append (_bgd .Shape ,_bab );};case _c .EndElement :break _dc ;};};return nil ;};
// NewCommentDrawing constructs a new comment drawing.
func NewCommentDrawing ()*Container {_ge :=NewContainer ();_ge .Layout =_b .NewOfcShapelayout ();_ge .Layout .ExtAttr =_b .ST_ExtEdit ;_ge .Layout .Idmap =_b .NewOfcCT_IdMap ();_ge .Layout .Idmap .DataAttr =_g .String ("\u0031");_ge .Layout .Idmap .ExtAttr =_b .ST_ExtEdit ;_ge .ShapeType =_b .NewShapetype ();_ge .ShapeType .IdAttr =_g .String ("_\u0078\u0030\u0030\u0030\u0030\u005f\u0074\u0032\u0030\u0032");_ge .ShapeType .CoordsizeAttr =_g .String ("2\u0031\u0036\u0030\u0030\u002c\u0032\u0031\u0036\u0030\u0030");_ge .ShapeType .SptAttr =_g .Float32 (202);_ge .ShapeType .PathAttr =_g .String ("\u006d\u0030\u002c0l\u0030\u002c\u0032\u0031\u0036\u0030\u0030\u002c\u00321\u00360\u0030,\u00321\u0036\u0030\u0030\u002c\u0032\u0031\u0036\u0030\u0030\u002c\u0030\u0078\u0065");_ad :=_b .NewEG_ShapeElements ();_ge .ShapeType .EG_ShapeElements =append (_ge .ShapeType .EG_ShapeElements ,_ad );_ad .Path =_b .NewPath ();_ad .Path .GradientshapeokAttr =_d .ST_TrueFalseT ;_ad .Path .ConnecttypeAttr =_b .OfcST_ConnectTypeRect ;return _ge ;};func (_ae *Container )MarshalXML (e *_c .Encoder ,start _c .StartElement )error {start .Attr =append (start .Attr ,_c .Attr {Name :_c .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u0076"},Value :"\u0075\u0072n\u003a\u0073\u0063\u0068\u0065\u006d\u0061\u0073\u002d\u006d\u0069\u0063\u0072\u006f\u0073\u006f\u0066\u0074\u002d\u0063\u006f\u006d:v\u006d\u006c"});start .Attr =append (start .Attr ,_c .Attr {Name :_c .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u006f"},Value :"\u0075\u0072\u006e\u003a\u0073\u0063\u0068\u0065\u006d\u0061\u0073\u002d\u006di\u0063\u0072\u006f\u0073\u006f\u0066t\u002d\u0063\u006f\u006d\u003a\u006f\u0066\u0066\u0069\u0063\u0065\u003a\u006ff\u0066\u0069\u0063\u0065"});start .Attr =append (start .Attr ,_c .Attr {Name :_c .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u0078"},Value :"\u0075\u0072\u006e\u003a\u0073\u0063\u0068\u0065\u006d\u0061\u0073\u002d\u006d\u0069\u0063\u0072\u006f\u0073\u006f\u0066\u0074\u002d\u0063\u006fm\u003a\u006f\u0066\u0066\u0069c\u0065\u003ae\u0078\u0063\u0065\u006c"});start .Name .Local ="\u0078\u006d\u006c";e .EncodeToken (start );if _ae .Layout !=nil {_ea :=_c .StartElement {Name :_c .Name {Local :"\u006f\u003a\u0073\u0068\u0061\u0070\u0065\u006c\u0061\u0079\u006f\u0075\u0074"}};e .EncodeElement (_ae .Layout ,_ea );};if _ae .ShapeType !=nil {_bg :=_c .StartElement {Name :_c .Name {Local :"v\u003a\u0073\u0068\u0061\u0070\u0065\u0074\u0079\u0070\u0065"}};e .EncodeElement (_ae .ShapeType ,_bg );};for _ ,_bga :=range _ae .Shape {_de :=_c .StartElement {Name :_c .Name {Local :"\u0076:\u0073\u0068\u0061\u0070\u0065"}};e .EncodeElement (_bga ,_de );};return e .EncodeToken (_c .EndElement {Name :start .Name });};