mirror of
https://github.com/unidoc/unioffice.git
synced 2025-04-27 13:48:54 +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 (_a "encoding/xml";_f "fmt";_c "github.com/unidoc/unioffice";_g "github.com/unidoc/unioffice/schema/soo/ofc/sharedTypes";_d "github.com/unidoc/unioffice/schema/urn/schemas_microsoft_com/office/excel";_bc "github.com/unidoc/unioffice/schema/urn/schemas_microsoft_com/vml";);
|
|
|
|
// NewCommentDrawing constructs a new comment drawing.
|
|
func NewCommentDrawing ()*Container {_ge :=NewContainer ();_ge .Layout =_bc .NewOfcShapelayout ();_ge .Layout .ExtAttr =_bc .ST_ExtEdit ;_ge .Layout .Idmap =_bc .NewOfcCT_IdMap ();_ge .Layout .Idmap .DataAttr =_c .String ("\u0031");_ge .Layout .Idmap .ExtAttr =_bc .ST_ExtEdit ;_ge .ShapeType =_bc .NewShapetype ();_ge .ShapeType .IdAttr =_c .String ("_\u0078\u0030\u0030\u0030\u0030\u005f\u0074\u0032\u0030\u0032");_ge .ShapeType .CoordsizeAttr =_c .String ("2\u0031\u0036\u0030\u0030\u002c\u0032\u0031\u0036\u0030\u0030");_ge .ShapeType .SptAttr =_c .Float32 (202);_ge .ShapeType .PathAttr =_c .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");_gd :=_bc .NewEG_ShapeElements ();_ge .ShapeType .EG_ShapeElements =append (_ge .ShapeType .EG_ShapeElements ,_gd );_gd .Path =_bc .NewPath ();_gd .Path .GradientshapeokAttr =_g .ST_TrueFalseT ;_gd .Path .ConnecttypeAttr =_bc .OfcST_ConnectTypeRect ;return _ge ;};func NewContainer ()*Container {return &Container {}};func (_bfa *Container )MarshalXML (e *_a .Encoder ,start _a .StartElement )error {start .Attr =append (start .Attr ,_a .Attr {Name :_a .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 ,_a .Attr {Name :_a .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 ,_a .Attr {Name :_a .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 _bfa .Layout !=nil {_dg :=_a .StartElement {Name :_a .Name {Local :"\u006f\u003a\u0073\u0068\u0061\u0070\u0065\u006c\u0061\u0079\u006f\u0075\u0074"}};e .EncodeElement (_bfa .Layout ,_dg );};if _bfa .ShapeType !=nil {_ea :=_a .StartElement {Name :_a .Name {Local :"v\u003a\u0073\u0068\u0061\u0070\u0065\u0074\u0079\u0070\u0065"}};e .EncodeElement (_bfa .ShapeType ,_ea );};for _ ,_de :=range _bfa .Shape {_ae :=_a .StartElement {Name :_a .Name {Local :"\u0076:\u0073\u0068\u0061\u0070\u0065"}};e .EncodeElement (_de ,_ae );};return e .EncodeToken (_a .EndElement {Name :start .Name });};func (_gg *Container )UnmarshalXML (d *_a .Decoder ,start _a .StartElement )error {_gg .Shape =nil ;_aee :for {_af ,_bff :=d .Token ();if _bff !=nil {return _bff ;};switch _bcg :=_af .(type ){case _a .StartElement :switch _bcg .Name .Local {case "s\u0068\u0061\u0070\u0065\u006c\u0061\u0079\u006f\u0075\u0074":_gg .Layout =_bc .NewOfcShapelayout ();if _da :=d .DecodeElement (_gg .Layout ,&_bcg );_da !=nil {return _da ;};case "\u0073h\u0061\u0070\u0065\u0074\u0079\u0070e":_gg .ShapeType =_bc .NewShapetype ();if _dd :=d .DecodeElement (_gg .ShapeType ,&_bcg );_dd !=nil {return _dd ;};case "\u0073\u0068\u0061p\u0065":_fg :=_bc .NewShape ();if _eg :=d .DecodeElement (_fg ,&_bcg );_eg !=nil {return _eg ;};_gg .Shape =append (_gg .Shape ,_fg );};case _a .EndElement :break _aee ;};};return nil ;};type Container struct{Layout *_bc .OfcShapelayout ;ShapeType *_bc .Shapetype ;Shape []*_bc .Shape ;};
|
|
|
|
// NewCommentShape creates a new comment shape for a given cell index. The
|
|
// indices here are zero based.
|
|
func NewCommentShape (col ,row int64 )*_bc .Shape {_be :=_bc .NewShape ();_be .IdAttr =_c .String (_f .Sprintf ("\u0063\u0073\u005f\u0025\u0064\u005f\u0025\u0064",col ,row ));_be .TypeAttr =_c .String ("\u0023\u005f\u00780\u0030\u0030\u0030\u005f\u0074\u0032\u0030\u0032");_be .StyleAttr =_c .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");_be .FillcolorAttr =_c .String ("\u0023f\u0062\u0066\u0036\u0064\u0036");_be .StrokecolorAttr =_c .String ("\u0023e\u0064\u0065\u0061\u0061\u0031");_bf :=_bc .NewEG_ShapeElements ();_bf .Fill =_bc .NewFill ();_bf .Fill .Color2Attr =_c .String ("\u0023f\u0062\u0066\u0065\u0038\u0032");_bf .Fill .AngleAttr =_c .Float64 (-180);_bf .Fill .TypeAttr =_bc .ST_FillTypeGradient ;_bf .Fill .Fill =_bc .NewOfcFill ();_bf .Fill .Fill .ExtAttr =_bc .ST_ExtView ;_bf .Fill .Fill .TypeAttr =_bc .OfcST_FillTypeGradientUnscaled ;_be .EG_ShapeElements =append (_be .EG_ShapeElements ,_bf );_ga :=_bc .NewEG_ShapeElements ();_ga .Shadow =_bc .NewShadow ();_ga .Shadow .OnAttr =_g .ST_TrueFalseT ;_ga .Shadow .ObscuredAttr =_g .ST_TrueFalseT ;_be .EG_ShapeElements =append (_be .EG_ShapeElements ,_ga );_e :=_bc .NewEG_ShapeElements ();_e .Path =_bc .NewPath ();_e .Path .ConnecttypeAttr =_bc .OfcST_ConnectTypeNone ;_be .EG_ShapeElements =append (_be .EG_ShapeElements ,_e );_fa :=_bc .NewEG_ShapeElements ();_fa .Textbox =_bc .NewTextbox ();_fa .Textbox .StyleAttr =_c .String ("\u006d\u0073\u006f\u002ddi\u0072\u0065\u0063\u0074\u0069\u006f\u006e\u002d\u0061\u006c\u0074\u003a\u0061\u0075t\u006f");_be .EG_ShapeElements =append (_be .EG_ShapeElements ,_fa );_gdf :=_bc .NewEG_ShapeElements ();_gdf .ClientData =_d .NewClientData ();_gdf .ClientData .ObjectTypeAttr =_d .ST_ObjectTypeNote ;_gdf .ClientData .MoveWithCells =_g .ST_TrueFalseBlankT ;_gdf .ClientData .SizeWithCells =_g .ST_TrueFalseBlankT ;_gdf .ClientData .Anchor =_c .String ("\u0031,\u0020\u0031\u0035\u002c\u0020\u0030\u002c\u0020\u0032\u002c\u00202\u002c\u0020\u0035\u0034\u002c\u0020\u0035\u002c\u0020\u0033");_gdf .ClientData .AutoFill =_g .ST_TrueFalseBlankFalse ;_gdf .ClientData .Row =_c .Int64 (row );_gdf .ClientData .Column =_c .Int64 (col );_be .EG_ShapeElements =append (_be .EG_ShapeElements ,_gdf );return _be ;}; |