mirror of
https://github.com/unidoc/unioffice.git
synced 2025-04-25 13:48:53 +08:00
19 lines
7.1 KiB
Go
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 (_e "encoding/xml";_fc "fmt";_g "github.com/unidoc/unioffice";_cc "github.com/unidoc/unioffice/schema/soo/ofc/sharedTypes";_c "github.com/unidoc/unioffice/schema/urn/schemas_microsoft_com/office/excel";_gb "github.com/unidoc/unioffice/schema/urn/schemas_microsoft_com/vml";);func (_ef *Container )MarshalXML (e *_e .Encoder ,start _e .StartElement )error {start .Attr =append (start .Attr ,_e .Attr {Name :_e .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 ,_e .Attr {Name :_e .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 ,_e .Attr {Name :_e .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 _ef .Layout !=nil {_cff :=_e .StartElement {Name :_e .Name {Local :"\u006f\u003a\u0073\u0068\u0061\u0070\u0065\u006c\u0061\u0079\u006f\u0075\u0074"}};e .EncodeElement (_ef .Layout ,_cff );};if _ef .ShapeType !=nil {_ad :=_e .StartElement {Name :_e .Name {Local :"v\u003a\u0073\u0068\u0061\u0070\u0065\u0074\u0079\u0070\u0065"}};e .EncodeElement (_ef .ShapeType ,_ad );};for _ ,_ac :=range _ef .Shape {_fg :=_e .StartElement {Name :_e .Name {Local :"\u0076:\u0073\u0068\u0061\u0070\u0065"}};e .EncodeElement (_ac ,_fg );};return e .EncodeToken (_e .EndElement {Name :start .Name });};
|
|
|
|
// NewCommentDrawing constructs a new comment drawing.
|
|
func NewCommentDrawing ()*Container {_gd :=NewContainer ();_gd .Layout =_gb .NewOfcShapelayout ();_gd .Layout .ExtAttr =_gb .ST_ExtEdit ;_gd .Layout .Idmap =_gb .NewOfcCT_IdMap ();_gd .Layout .Idmap .DataAttr =_g .String ("\u0031");_gd .Layout .Idmap .ExtAttr =_gb .ST_ExtEdit ;_gd .ShapeType =_gb .NewShapetype ();_gd .ShapeType .IdAttr =_g .String ("_\u0078\u0030\u0030\u0030\u0030\u005f\u0074\u0032\u0030\u0032");_gd .ShapeType .CoordsizeAttr =_g .String ("2\u0031\u0036\u0030\u0030\u002c\u0032\u0031\u0036\u0030\u0030");_gd .ShapeType .SptAttr =_g .Float32 (202);_gd .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");_a :=_gb .NewEG_ShapeElements ();_gd .ShapeType .EG_ShapeElements =append (_gd .ShapeType .EG_ShapeElements ,_a );_a .Path =_gb .NewPath ();_a .Path .GradientshapeokAttr =_cc .ST_TrueFalseT ;_a .Path .ConnecttypeAttr =_gb .OfcST_ConnectTypeRect ;return _gd ;};func (_d *Container )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {_d .Shape =nil ;_b :for {_da ,_ag :=d .Token ();if _ag !=nil {return _ag ;};switch _fa :=_da .(type ){case _e .StartElement :switch _fa .Name .Local {case "s\u0068\u0061\u0070\u0065\u006c\u0061\u0079\u006f\u0075\u0074":_d .Layout =_gb .NewOfcShapelayout ();if _gf :=d .DecodeElement (_d .Layout ,&_fa );_gf !=nil {return _gf ;};case "\u0073h\u0061\u0070\u0065\u0074\u0079\u0070e":_d .ShapeType =_gb .NewShapetype ();if _ccb :=d .DecodeElement (_d .ShapeType ,&_fa );_ccb !=nil {return _ccb ;};case "\u0073\u0068\u0061p\u0065":_cb :=_gb .NewShape ();if _bb :=d .DecodeElement (_cb ,&_fa );_bb !=nil {return _bb ;};_d .Shape =append (_d .Shape ,_cb );};case _e .EndElement :break _b ;};};return nil ;};type Container struct{Layout *_gb .OfcShapelayout ;ShapeType *_gb .Shapetype ;Shape []*_gb .Shape ;};
|
|
|
|
// NewCommentShape creates a new comment shape for a given cell index. The
|
|
// indices here are zero based.
|
|
func NewCommentShape (col ,row int64 )*_gb .Shape {_ff :=_gb .NewShape ();_ff .IdAttr =_g .String (_fc .Sprintf ("\u0063\u0073\u005f\u0025\u0064\u005f\u0025\u0064",col ,row ));_ff .TypeAttr =_g .String ("\u0023\u005f\u00780\u0030\u0030\u0030\u005f\u0074\u0032\u0030\u0032");_ff .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");_ff .FillcolorAttr =_g .String ("\u0023f\u0062\u0066\u0036\u0064\u0036");_ff .StrokecolorAttr =_g .String ("\u0023e\u0064\u0065\u0061\u0061\u0031");_ed :=_gb .NewEG_ShapeElements ();_ed .Fill =_gb .NewFill ();_ed .Fill .Color2Attr =_g .String ("\u0023f\u0062\u0066\u0065\u0038\u0032");_ed .Fill .AngleAttr =_g .Float64 (-180);_ed .Fill .TypeAttr =_gb .ST_FillTypeGradient ;_ed .Fill .Fill =_gb .NewOfcFill ();_ed .Fill .Fill .ExtAttr =_gb .ST_ExtView ;_ed .Fill .Fill .TypeAttr =_gb .OfcST_FillTypeGradientUnscaled ;_ff .EG_ShapeElements =append (_ff .EG_ShapeElements ,_ed );_cf :=_gb .NewEG_ShapeElements ();_cf .Shadow =_gb .NewShadow ();_cf .Shadow .OnAttr =_cc .ST_TrueFalseT ;_cf .Shadow .ObscuredAttr =_cc .ST_TrueFalseT ;_ff .EG_ShapeElements =append (_ff .EG_ShapeElements ,_cf );_aa :=_gb .NewEG_ShapeElements ();_aa .Path =_gb .NewPath ();_aa .Path .ConnecttypeAttr =_gb .OfcST_ConnectTypeNone ;_ff .EG_ShapeElements =append (_ff .EG_ShapeElements ,_aa );_gbf :=_gb .NewEG_ShapeElements ();_gbf .Textbox =_gb .NewTextbox ();_gbf .Textbox .StyleAttr =_g .String ("\u006d\u0073\u006f\u002ddi\u0072\u0065\u0063\u0074\u0069\u006f\u006e\u002d\u0061\u006c\u0074\u003a\u0061\u0075t\u006f");_ff .EG_ShapeElements =append (_ff .EG_ShapeElements ,_gbf );_fb :=_gb .NewEG_ShapeElements ();_fb .ClientData =_c .NewClientData ();_fb .ClientData .ObjectTypeAttr =_c .ST_ObjectTypeNote ;_fb .ClientData .MoveWithCells =_cc .ST_TrueFalseBlankT ;_fb .ClientData .SizeWithCells =_cc .ST_TrueFalseBlankT ;_fb .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");_fb .ClientData .AutoFill =_cc .ST_TrueFalseBlankFalse ;_fb .ClientData .Row =_g .Int64 (row );_fb .ClientData .Column =_g .Int64 (col );_ff .EG_ShapeElements =append (_ff .EG_ShapeElements ,_fb );return _ff ;};func NewContainer ()*Container {return &Container {}}; |