mirror of
https://github.com/unidoc/unioffice.git
synced 2025-04-25 13:48:53 +08:00
prepare release
This commit is contained in:
parent
180c248aec
commit
27dedcd877
@ -9,7 +9,7 @@
|
||||
// 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 algo ;import _d "strconv";func _gg (_f byte )bool {return _f >='0'&&_f <='9'};func RepeatString (s string ,cnt int )string {if cnt <=0{return "";};_bb :=make ([]byte ,len (s )*cnt );_dad :=[]byte (s );for _bbb :=0;_bbb < cnt ;_bbb ++{copy (_bb [_bbb :],_dad );};return string (_bb );};
|
||||
package algo ;import _d "strconv";func _e (_c byte )bool {return _c >='0'&&_c <='9'};func RepeatString (s string ,cnt int )string {if cnt <=0{return "";};_cc :=make ([]byte ,len (s )*cnt );_ba :=[]byte (s );for _dea :=0;_dea < cnt ;_dea ++{copy (_cc [_dea :],_ba );};return string (_cc );};
|
||||
|
||||
// NaturalLess compares two strings in a human manner so rId2 sorts less than rId10
|
||||
func NaturalLess (lhs ,rhs string )bool {_b ,_c :=0,0;for _b < len (lhs )&&_c < len (rhs ){_a :=lhs [_b ];_ad :=rhs [_c ];_e :=_gg (_a );_ed :=_gg (_ad );switch {case _e &&!_ed :return true ;case !_e &&_ed :return false ;case !_e &&!_ed :if _a !=_ad {return _a < _ad ;};_b ++;_c ++;default:_dd :=_b +1;_da :=_c +1;for _dd < len (lhs )&&_gg (lhs [_dd ]){_dd ++;};for _da < len (rhs )&&_gg (rhs [_da ]){_da ++;};_ce ,_ :=_d .ParseUint (lhs [_b :_dd ],10,64);_gf ,_ :=_d .ParseUint (rhs [_b :_da ],10,64);if _ce !=_gf {return _ce < _gf ;};_b =_dd ;_c =_da ;};};return len (lhs )< len (rhs );};
|
||||
func NaturalLess (lhs ,rhs string )bool {_eg ,_a :=0,0;for _eg < len (lhs )&&_a < len (rhs ){_g :=lhs [_eg ];_da :=rhs [_a ];_f :=_e (_g );_de :=_e (_da );switch {case _f &&!_de :return true ;case !_f &&_de :return false ;case !_f &&!_de :if _g !=_da {return _g < _da ;};_eg ++;_a ++;default:_cg :=_eg +1;_cd :=_a +1;for _cg < len (lhs )&&_e (lhs [_cg ]){_cg ++;};for _cd < len (rhs )&&_e (rhs [_cd ]){_cd ++;};_fb ,_ :=_d .ParseUint (lhs [_eg :_cg ],10,64);_ad ,_ :=_d .ParseUint (rhs [_eg :_cd ],10,64);if _fb !=_ad {return _fb < _ad ;};_eg =_cg ;_a =_cd ;};};return len (lhs )< len (rhs );};
|
968
chart/chart.go
968
chart/chart.go
File diff suppressed because it is too large
Load Diff
@ -11,27 +11,27 @@
|
||||
|
||||
// Package color provides color handling structures and functions for use across
|
||||
// all of the document types.
|
||||
package color ;import (_fe "fmt";_f "github.com/unidoc/unioffice";);var Cornsilk =Color {0xFF,0xF8,0xDC,255,false };var DarkOrchid =Color {0x99,0x32,0xCC,255,false };var DarkTurquoise =Color {0x00,0xCE,0xD1,255,false };var Indigo =Color {0x4B,0x00,0x82,255,false };var NavajoWhite =Color {0xFF,0xDE,0xAD,255,false };var Magenta =Color {0xFF,0x00,0xFF,255,false };var DarkBlue =Color {0x00,0x00,0x8B,255,false };var Tan =Color {0xD2,0xB4,0x8C,255,false };var LightSkyBlue =Color {0x87,0xCE,0xFA,255,false };var SteelBlue =Color {0x46,0x82,0xB4,255,false };var GoldenRod =Color {0xDA,0xA5,0x20,255,false };var DeepPink =Color {0xFF,0x14,0x93,255,false };var LavenderBlush =Color {0xFF,0xF0,0xF5,255,false };var PapayaWhip =Color {0xFF,0xEF,0xD5,255,false };
|
||||
package color ;import (_g "fmt";_c "github.com/unidoc/unioffice";);var MediumSpringGreen =Color {0x00,0xFA,0x9A,255,false };var Coral =Color {0xFF,0x7F,0x50,255,false };var DarkGoldenRod =Color {0xB8,0x86,0x0B,255,false };var Auto =Color {0,0,0,255,true };var SeaShell =Color {0xFF,0xF5,0xEE,255,false };var DarkSalmon =Color {0xE9,0x96,0x7A,255,false };var NavajoWhite =Color {0xFF,0xDE,0xAD,255,false };var LightGoldenRodYellow =Color {0xFA,0xFA,0xD2,255,false };var DarkMagenta =Color {0x8B,0x00,0x8B,255,false };var PaleTurquoise =Color {0xAF,0xEE,0xEE,255,false };
|
||||
|
||||
// AsRGBString is used by the various wrappers to return a pointer
|
||||
// to a string containing a six digit hex RGB value.
|
||||
func (_c Color )AsRGBString ()*string {return _f .Stringf ("\u0025\u0030\u0032x\u0025\u0030\u0032\u0078\u0025\u0030\u0032\u0078",_c ._b ,_c ._bg ,_c ._fc );};var PaleTurquoise =Color {0xAF,0xEE,0xEE,255,false };var LightCyan =Color {0xE0,0xFF,0xFF,255,false };var OliveDrab =Color {0x6B,0x8E,0x23,255,false };var CornflowerBlue =Color {0x64,0x95,0xED,255,false };var Blue =Color {0x00,0x00,0xFF,255,false };var FireBrick =Color {0xB2,0x22,0x22,255,false };var MediumSpringGreen =Color {0x00,0xFA,0x9A,255,false };var DarkGreen =Color {0x00,0x64,0x00,255,false };var Tomato =Color {0xFF,0x63,0x47,255,false };var DimGray =Color {0x69,0x69,0x69,255,false };var MediumTurquoise =Color {0x48,0xD1,0xCC,255,false };var Aqua =Color {0x00,0xFF,0xFF,255,false };var Salmon =Color {0xFA,0x80,0x72,255,false };var MediumOrchid =Color {0xBA,0x55,0xD3,255,false };var AliceBlue =Color {0xF0,0xF8,0xFF,255,false };var LemonChiffon =Color {0xFF,0xFA,0xCD,255,false };var Moccasin =Color {0xFF,0xE4,0xB5,255,false };var SlateBlue =Color {0x6A,0x5A,0xCD,255,false };var PowderBlue =Color {0xB0,0xE0,0xE6,255,false };var OldLace =Color {0xFD,0xF5,0xE6,255,false };var LightGreen =Color {0x90,0xEE,0x90,255,false };var GhostWhite =Color {0xF8,0xF8,0xFF,255,false };var DarkOliveGreen =Color {0x55,0x6B,0x2F,255,false };var LightPink =Color {0xFF,0xB6,0xC1,255,false };var DarkRed =Color {0x8B,0x00,0x00,255,false };var SlateGrey =Color {0x70,0x80,0x90,255,false };var CadetBlue =Color {0x5F,0x9E,0xA0,255,false };var Purple =Color {0x80,0x00,0x80,255,false };var Black =Color {0x00,0x00,0x00,255,false };var DarkMagenta =Color {0x8B,0x00,0x8B,255,false };var Azure =Color {0xF0,0xFF,0xFF,255,false };var LightSalmon =Color {0xFF,0xA0,0x7A,255,false };var Olive =Color {0x80,0x80,0x00,255,false };var Plum =Color {0xDD,0xA0,0xDD,255,false };var Green =Color {0x00,0x80,0x00,255,false };var SpringGreen =Color {0x00,0xFF,0x7F,255,false };var LawnGreen =Color {0x7C,0xFC,0x00,255,false };var PaleGoldenRod =Color {0xEE,0xE8,0xAA,255,false };var DarkKhaki =Color {0xBD,0xB7,0x6B,255,false };var IndianRed =Color {0xCD,0x5C,0x5C,255,false };var MediumSeaGreen =Color {0x3C,0xB3,0x71,255,false };var PaleGreen =Color {0x98,0xFB,0x98,255,false };var Linen =Color {0xFA,0xF0,0xE6,255,false };var BurlyWood =Color {0xDE,0xB8,0x87,255,false };var DarkGoldenRod =Color {0xB8,0x86,0x0B,255,false };var MediumBlue =Color {0x00,0x00,0xCD,255,false };var Khaki =Color {0xF0,0xE6,0x8C,255,false };var HotPink =Color {0xFF,0x69,0xB4,255,false };var Teal =Color {0x00,0x80,0x80,255,false };var Ivory =Color {0xFF,0xFF,0xF0,255,false };var RebeccaPurple =Color {0x66,0x33,0x99,255,false };var Lavender =Color {0xE6,0xE6,0xFA,255,false };
|
||||
|
||||
// IsAuto returns true if the color is the 'Auto' type. If the
|
||||
// field doesn't support an Auto color, then black is used.
|
||||
func (_d Color )IsAuto ()bool {return _d ._gd };var SeaGreen =Color {0x2E,0x8B,0x57,255,false };var Bisque =Color {0xFF,0xE4,0xC4,255,false };var BlanchedAlmond =Color {0xFF,0xEB,0xCD,255,false };var MidnightBlue =Color {0x19,0x19,0x70,255,false };var MediumVioletRed =Color {0xC7,0x15,0x85,255,false };var Lime =Color {0x00,0xFF,0x00,255,false };var SuccessGreen =Color {0x00,0xCC,0x00,255,false };var Beige =Color {0xF5,0xF5,0xDC,255,false };var Snow =Color {0xFF,0xFA,0xFA,255,false };var DarkSeaGreen =Color {0x8F,0xBC,0x8F,255,false };var PaleVioletRed =Color {0xDB,0x70,0x93,255,false };var DarkGray =Color {0xA9,0xA9,0xA9,255,false };var LightSteelBlue =Color {0xB0,0xC4,0xDE,255,false };var OrangeRed =Color {0xFF,0x45,0x00,255,false };var GreenYellow =Color {0xAD,0xFF,0x2F,255,false };var LightSlateGrey =Color {0x77,0x88,0x99,255,false };var DarkViolet =Color {0x94,0x00,0xD3,255,false };var DarkSlateBlue =Color {0x48,0x3D,0x8B,255,false };var Orange =Color {0xFF,0xA5,0x00,255,false };var DodgerBlue =Color {0x1E,0x90,0xFF,255,false };var Chocolate =Color {0xD2,0x69,0x1E,255,false };var SaddleBrown =Color {0x8B,0x45,0x13,255,false };var LightYellow =Color {0xFF,0xFF,0xE0,255,false };var SeaShell =Color {0xFF,0xF5,0xEE,255,false };var Wheat =Color {0xF5,0xDE,0xB3,255,false };var White =Color {0xFF,0xFF,0xFF,255,false };
|
||||
|
||||
// RGB constructs a new RGB color with a given red, green and blue value.
|
||||
func RGB (r ,g ,b uint8 )Color {return Color {r ,g ,b ,255,false }};var Brown =Color {0xA5,0x2A,0x2A,255,false };func FromHex (s string )Color {if len (s )==0{return Auto ;};if s [0]=='#'{s =s [1:];};var _bf ,_ed ,_fa uint8 ;_gf ,_ :=_fe .Sscanf (s ,"\u0025\u0030\u0032x\u0025\u0030\u0032\u0078\u0025\u0030\u0032\u0078",&_bf ,&_ed ,&_fa );if _gf ==3{return RGB (_bf ,_ed ,_fa );};return Auto ;};var RoyalBlue =Color {0x41,0x69,0xE1,255,false };var Red =Color {0xFF,0x00,0x00,255,false };var MediumSlateBlue =Color {0x7B,0x68,0xEE,255,false };var LightGrey =Color {0xD3,0xD3,0xD3,255,false };var LightBlue =Color {0xAD,0xD8,0xE6,255,false };var Crimson =Color {0xDC,0x14,0x3C,255,false };var SandyBrown =Color {0xF4,0xA4,0x60,255,false };var LightGoldenRodYellow =Color {0xFA,0xFA,0xD2,255,false };var Peru =Color {0xCD,0x85,0x3F,255,false };var BlueViolet =Color {0x8A,0x2B,0xE2,255,false };var Orchid =Color {0xDA,0x70,0xD6,255,false };var DarkSalmon =Color {0xE9,0x96,0x7A,255,false };var Pink =Color {0xFF,0xC0,0xCB,255,false };var Silver =Color {0xC0,0xC0,0xC0,255,false };var Turquoise =Color {0x40,0xE0,0xD0,255,false };var Thistle =Color {0xD8,0xBF,0xD8,255,false };var MintCream =Color {0xF5,0xFF,0xFA,255,false };var DarkSlateGray =Color {0x2F,0x4F,0x4F,255,false };var LimeGreen =Color {0x32,0xCD,0x32,255,false };var Coral =Color {0xFF,0x7F,0x50,255,false };var SkyBlue =Color {0x87,0xCE,0xEB,255,false };var Gainsboro =Color {0xDC,0xDC,0xDC,255,false };var RosyBrown =Color {0xBC,0x8F,0x8F,255,false };var DarkSlateGrey =Color {0x2F,0x4F,0x4F,255,false };var DarkGrey =Color {0xA9,0xA9,0xA9,255,false };var LightSeaGreen =Color {0x20,0xB2,0xAA,255,false };var DimGrey =Color {0x69,0x69,0x69,255,false };var DarkOrange =Color {0xFF,0x8C,0x00,255,false };var YellowGreen =Color {0x9A,0xCD,0x32,255,false };var Sienna =Color {0xA0,0x52,0x2D,255,false };
|
||||
func (_dc Color )AsRGBString ()*string {return _c .Stringf ("\u0025\u0030\u0032x\u0025\u0030\u0032\u0078\u0025\u0030\u0032\u0078",_dc ._f ,_dc ._cf ,_dc ._a );};var Teal =Color {0x00,0x80,0x80,255,false };var LightSlateGrey =Color {0x77,0x88,0x99,255,false };var MidnightBlue =Color {0x19,0x19,0x70,255,false };var OliveDrab =Color {0x6B,0x8E,0x23,255,false };var Brown =Color {0xA5,0x2A,0x2A,255,false };var Black =Color {0x00,0x00,0x00,255,false };var Moccasin =Color {0xFF,0xE4,0xB5,255,false };var SandyBrown =Color {0xF4,0xA4,0x60,255,false };var LightBlue =Color {0xAD,0xD8,0xE6,255,false };var Cornsilk =Color {0xFF,0xF8,0xDC,255,false };var PapayaWhip =Color {0xFF,0xEF,0xD5,255,false };var Silver =Color {0xC0,0xC0,0xC0,255,false };var OldLace =Color {0xFD,0xF5,0xE6,255,false };var GhostWhite =Color {0xF8,0xF8,0xFF,255,false };var SuccessGreen =Color {0x00,0xCC,0x00,255,false };var PaleGreen =Color {0x98,0xFB,0x98,255,false };var Fuchsia =Color {0xFF,0x00,0xFF,255,false };var SlateBlue =Color {0x6A,0x5A,0xCD,255,false };var DarkTurquoise =Color {0x00,0xCE,0xD1,255,false };var MediumAquaMarine =Color {0x66,0xCD,0xAA,255,false };var LightSteelBlue =Color {0xB0,0xC4,0xDE,255,false };var LightYellow =Color {0xFF,0xFF,0xE0,255,false };var Snow =Color {0xFF,0xFA,0xFA,255,false };var Gold =Color {0xFF,0xD7,0x00,255,false };var LightCyan =Color {0xE0,0xFF,0xFF,255,false };
|
||||
|
||||
// Color is a 24 bit color that can be converted to
|
||||
// internal ECMA-376 formats as needed.
|
||||
type Color struct{_b ,_bg ,_fc ,_e uint8 ;_gd bool ;};var LightGray =Color {0xD3,0xD3,0xD3,255,false };
|
||||
type Color struct{_f ,_cf ,_a ,_ag uint8 ;_d bool ;};var Crimson =Color {0xDC,0x14,0x3C,255,false };var Plum =Color {0xDD,0xA0,0xDD,255,false };var LightPink =Color {0xFF,0xB6,0xC1,255,false };var DarkOliveGreen =Color {0x55,0x6B,0x2F,255,false };var Linen =Color {0xFA,0xF0,0xE6,255,false };var Pink =Color {0xFF,0xC0,0xCB,255,false };var Khaki =Color {0xF0,0xE6,0x8C,255,false };var DeepSkyBlue =Color {0x00,0xBF,0xFF,255,false };var LightSalmon =Color {0xFF,0xA0,0x7A,255,false };var Salmon =Color {0xFA,0x80,0x72,255,false };var Gray =Color {0x80,0x80,0x80,255,false };var DarkKhaki =Color {0xBD,0xB7,0x6B,255,false };
|
||||
|
||||
// IsAuto returns true if the color is the 'Auto' type. If the
|
||||
// field doesn't support an Auto color, then black is used.
|
||||
func (_ea Color )IsAuto ()bool {return _ea ._d };var Aqua =Color {0x00,0xFF,0xFF,255,false };var GoldenRod =Color {0xDA,0xA5,0x20,255,false };var GreenYellow =Color {0xAD,0xFF,0x2F,255,false };var Yellow =Color {0xFF,0xFF,0x00,255,false };var Orchid =Color {0xDA,0x70,0xD6,255,false };var MediumVioletRed =Color {0xC7,0x15,0x85,255,false };var LightSkyBlue =Color {0x87,0xCE,0xFA,255,false };var MediumOrchid =Color {0xBA,0x55,0xD3,255,false };var LightSeaGreen =Color {0x20,0xB2,0xAA,255,false };var LightSlateGray =Color {0x77,0x88,0x99,255,false };var DarkOrchid =Color {0x99,0x32,0xCC,255,false };var SkyBlue =Color {0x87,0xCE,0xEB,255,false };var DarkBlue =Color {0x00,0x00,0x8B,255,false };var DarkGray =Color {0xA9,0xA9,0xA9,255,false };var DarkSlateBlue =Color {0x48,0x3D,0x8B,255,false };var DarkSeaGreen =Color {0x8F,0xBC,0x8F,255,false };var DeepPink =Color {0xFF,0x14,0x93,255,false };var AntiqueWhite =Color {0xFA,0xEB,0xD7,255,false };func FromHex (s string )Color {if len (s )==0{return Auto ;};if s [0]=='#'{s =s [1:];};var _ae ,_ce ,_fd uint8 ;_db ,_ :=_g .Sscanf (s ,"\u0025\u0030\u0032x\u0025\u0030\u0032\u0078\u0025\u0030\u0032\u0078",&_ae ,&_ce ,&_fd );if _db ==3{return RGB (_ae ,_ce ,_fd );};return Auto ;};var PeachPuff =Color {0xFF,0xDA,0xB9,255,false };var Navy =Color {0x00,0x00,0x80,255,false };var DimGray =Color {0x69,0x69,0x69,255,false };var BurlyWood =Color {0xDE,0xB8,0x87,255,false };var White =Color {0xFF,0xFF,0xFF,255,false };var DodgerBlue =Color {0x1E,0x90,0xFF,255,false };var Maroon =Color {0x80,0x00,0x00,255,false };var LightGray =Color {0xD3,0xD3,0xD3,255,false };
|
||||
|
||||
// RGBA constructs a new RGBA color with a given red, green, blue and alpha
|
||||
// value.
|
||||
func RGBA (r ,g ,b ,a uint8 )Color {return Color {r ,g ,b ,a ,false }};var DarkCyan =Color {0x00,0x8B,0x8B,255,false };var Cyan =Color {0x00,0xFF,0xFF,255,false };var MediumAquaMarine =Color {0x66,0xCD,0xAA,255,false };var MediumPurple =Color {0x93,0x70,0xDB,255,false };var LightCoral =Color {0xF0,0x80,0x80,255,false };var AntiqueWhite =Color {0xFA,0xEB,0xD7,255,false };var Gold =Color {0xFF,0xD7,0x00,255,false };var Fuchsia =Color {0xFF,0x00,0xFF,255,false };var FloralWhite =Color {0xFF,0xFA,0xF0,255,false };var DeepSkyBlue =Color {0x00,0xBF,0xFF,255,false };var Auto =Color {0,0,0,255,true };var Chartreuse =Color {0x7F,0xFF,0x00,255,false };
|
||||
func RGBA (r ,g ,b ,a uint8 )Color {return Color {r ,g ,b ,a ,false }};var WhiteSmoke =Color {0xF5,0xF5,0xF5,255,false };var BlanchedAlmond =Color {0xFF,0xEB,0xCD,255,false };var Bisque =Color {0xFF,0xE4,0xC4,255,false };var DarkSlateGrey =Color {0x2F,0x4F,0x4F,255,false };var Lime =Color {0x00,0xFF,0x00,255,false };var RoyalBlue =Color {0x41,0x69,0xE1,255,false };var Purple =Color {0x80,0x00,0x80,255,false };var Violet =Color {0xEE,0x82,0xEE,255,false };var LemonChiffon =Color {0xFF,0xFA,0xCD,255,false };var MediumBlue =Color {0x00,0x00,0xCD,255,false };var DarkOrange =Color {0xFF,0x8C,0x00,255,false };var MediumTurquoise =Color {0x48,0xD1,0xCC,255,false };var Azure =Color {0xF0,0xFF,0xFF,255,false };var LightGreen =Color {0x90,0xEE,0x90,255,false };var YellowGreen =Color {0x9A,0xCD,0x32,255,false };var ForestGreen =Color {0x22,0x8B,0x22,255,false };var Indigo =Color {0x4B,0x00,0x82,255,false };var MediumPurple =Color {0x93,0x70,0xDB,255,false };var FloralWhite =Color {0xFF,0xFA,0xF0,255,false };var SlateGrey =Color {0x70,0x80,0x90,255,false };var Wheat =Color {0xF5,0xDE,0xB3,255,false };var LightCoral =Color {0xF0,0x80,0x80,255,false };var Magenta =Color {0xFF,0x00,0xFF,255,false };var MediumSeaGreen =Color {0x3C,0xB3,0x71,255,false };var DarkViolet =Color {0x94,0x00,0xD3,255,false };var Red =Color {0xFF,0x00,0x00,255,false };var SlateGray =Color {0x70,0x80,0x90,255,false };var Orange =Color {0xFF,0xA5,0x00,255,false };var Tomato =Color {0xFF,0x63,0x47,255,false };var MintCream =Color {0xF5,0xFF,0xFA,255,false };var DarkGreen =Color {0x00,0x64,0x00,255,false };var SeaGreen =Color {0x2E,0x8B,0x57,255,false };var HoneyDew =Color {0xF0,0xFF,0xF0,255,false };var OrangeRed =Color {0xFF,0x45,0x00,255,false };var Tan =Color {0xD2,0xB4,0x8C,255,false };var CadetBlue =Color {0x5F,0x9E,0xA0,255,false };var Lavender =Color {0xE6,0xE6,0xFA,255,false };var SaddleBrown =Color {0x8B,0x45,0x13,255,false };var IndianRed =Color {0xCD,0x5C,0x5C,255,false };var Turquoise =Color {0x40,0xE0,0xD0,255,false };var Peru =Color {0xCD,0x85,0x3F,255,false };var PowderBlue =Color {0xB0,0xE0,0xE6,255,false };var Chartreuse =Color {0x7F,0xFF,0x00,255,false };var LavenderBlush =Color {0xFF,0xF0,0xF5,255,false };var DarkSlateGray =Color {0x2F,0x4F,0x4F,255,false };var RebeccaPurple =Color {0x66,0x33,0x99,255,false };var DimGrey =Color {0x69,0x69,0x69,255,false };var Cyan =Color {0x00,0xFF,0xFF,255,false };var LawnGreen =Color {0x7C,0xFC,0x00,255,false };var RosyBrown =Color {0xBC,0x8F,0x8F,255,false };var PaleVioletRed =Color {0xDB,0x70,0x93,255,false };var AliceBlue =Color {0xF0,0xF8,0xFF,255,false };var Olive =Color {0x80,0x80,0x00,255,false };var LimeGreen =Color {0x32,0xCD,0x32,255,false };var Thistle =Color {0xD8,0xBF,0xD8,255,false };var Gainsboro =Color {0xDC,0xDC,0xDC,255,false };var Ivory =Color {0xFF,0xFF,0xF0,255,false };var FireBrick =Color {0xB2,0x22,0x22,255,false };var BlueViolet =Color {0x8A,0x2B,0xE2,255,false };var MediumSlateBlue =Color {0x7B,0x68,0xEE,255,false };var CornflowerBlue =Color {0x64,0x95,0xED,255,false };var Chocolate =Color {0xD2,0x69,0x1E,255,false };var Beige =Color {0xF5,0xF5,0xDC,255,false };var MistyRose =Color {0xFF,0xE4,0xE1,255,false };var Aquamarine =Color {0x7F,0xFF,0xD4,255,false };var SpringGreen =Color {0x00,0xFF,0x7F,255,false };var DarkRed =Color {0x8B,0x00,0x00,255,false };var DarkGrey =Color {0xA9,0xA9,0xA9,255,false };var Green =Color {0x00,0x80,0x00,255,false };var Blue =Color {0x00,0x00,0xFF,255,false };var HotPink =Color {0xFF,0x69,0xB4,255,false };var LightGrey =Color {0xD3,0xD3,0xD3,255,false };
|
||||
|
||||
// RGB constructs a new RGB color with a given red, green and blue value.
|
||||
func RGB (r ,g ,b uint8 )Color {return Color {r ,g ,b ,255,false }};var DarkCyan =Color {0x00,0x8B,0x8B,255,false };var Sienna =Color {0xA0,0x52,0x2D,255,false };var SteelBlue =Color {0x46,0x82,0xB4,255,false };
|
||||
|
||||
// AsRGBAString is used by the various wrappers to return a pointer
|
||||
// to a string containing a six digit hex RGB value.
|
||||
func (_bb Color )AsRGBAString ()*string {return _f .Stringf ("\u0025\u00302\u0078\u0025\u00302\u0078\u0025\u0030\u0032\u0078\u0025\u0030\u0032\u0078",_bb ._e ,_bb ._b ,_bb ._bg ,_bb ._fc );};var Aquamarine =Color {0x7F,0xFF,0xD4,255,false };var Gray =Color {0x80,0x80,0x80,255,false };var SlateGray =Color {0x70,0x80,0x90,255,false };var ForestGreen =Color {0x22,0x8B,0x22,255,false };var Navy =Color {0x00,0x00,0x80,255,false };var Yellow =Color {0xFF,0xFF,0x00,255,false };var PeachPuff =Color {0xFF,0xDA,0xB9,255,false };var HoneyDew =Color {0xF0,0xFF,0xF0,255,false };var MistyRose =Color {0xFF,0xE4,0xE1,255,false };var LightSlateGray =Color {0x77,0x88,0x99,255,false };var WhiteSmoke =Color {0xF5,0xF5,0xF5,255,false };var Maroon =Color {0x80,0x00,0x00,255,false };var Violet =Color {0xEE,0x82,0xEE,255,false };
|
||||
func (_b Color )AsRGBAString ()*string {return _c .Stringf ("\u0025\u00302\u0078\u0025\u00302\u0078\u0025\u0030\u0032\u0078\u0025\u0030\u0032\u0078",_b ._ag ,_b ._f ,_b ._cf ,_b ._a );};var PaleGoldenRod =Color {0xEE,0xE8,0xAA,255,false };
|
650
common/common.go
650
common/common.go
@ -13,395 +13,395 @@
|
||||
// OOXML document formats.
|
||||
//
|
||||
// Package common contains common properties used by the subpackages.
|
||||
package common ;import (_c "archive/zip";_gdd "bytes";_f "encoding/xml";_bd "errors";_ce "fmt";_bbb "github.com/unidoc/unioffice";_bb "github.com/unidoc/unioffice/common/tempstorage";_fg "github.com/unidoc/unioffice/common/tempstorage/diskstore";_ddf "github.com/unidoc/unioffice/measurement";_gc "github.com/unidoc/unioffice/schema/soo/dml";_cfb "github.com/unidoc/unioffice/schema/soo/ofc/custom_properties";_de "github.com/unidoc/unioffice/schema/soo/ofc/docPropsVTypes";_fd "github.com/unidoc/unioffice/schema/soo/ofc/extended_properties";_gde "github.com/unidoc/unioffice/schema/soo/pkg/content_types";_df "github.com/unidoc/unioffice/schema/soo/pkg/metadata/core_properties";_fga "github.com/unidoc/unioffice/schema/soo/pkg/relationships";_fag "github.com/unidoc/unioffice/zippkg";_ag "image";_ "image/gif";_ "image/jpeg";_ "image/png";_gd "os";_g "reflect";_fa "regexp";_dg "strconv";_cf "strings";_dd "time";);func (_acf CustomProperties )SetPropertyAsR8 (name string ,r8 float64 ){_gddgd :=_acf .getNewProperty (name );_gddgd .R8 =&r8 ;_acf .setOrReplaceProperty (_gddgd );};
|
||||
package common ;import (_cd "archive/zip";_d "bytes";_cda "encoding/xml";_fe "errors";_dc "fmt";_eg "github.com/unidoc/unioffice";_bc "github.com/unidoc/unioffice/common/tempstorage";_ae "github.com/unidoc/unioffice/common/tempstorage/diskstore";_acg "github.com/unidoc/unioffice/measurement";_b "github.com/unidoc/unioffice/schema/soo/dml";_ef "github.com/unidoc/unioffice/schema/soo/ofc/custom_properties";_ac "github.com/unidoc/unioffice/schema/soo/ofc/docPropsVTypes";_ab "github.com/unidoc/unioffice/schema/soo/ofc/extended_properties";_bb "github.com/unidoc/unioffice/schema/soo/pkg/content_types";_gc "github.com/unidoc/unioffice/schema/soo/pkg/metadata/core_properties";_df "github.com/unidoc/unioffice/schema/soo/pkg/relationships";_gg "github.com/unidoc/unioffice/zippkg";_de "image";_ "image/gif";_ "image/jpeg";_ "image/png";_g "os";_f "reflect";_ec "regexp";_aa "strconv";_a "strings";_ffc "time";);var _aga =_fe .New ("\u0069\u006d\u0061\u0067\u0065\u0020\u006e\u006f\u0074\u0020\u0066o\u0075\u006e\u0064\u0020\u0069\u006e\u0020\u0073\u0074\u006fr\u0061\u0067\u0065");
|
||||
|
||||
// NewCustomProperties constructs a new CustomProperties.
|
||||
func NewCustomProperties ()CustomProperties {return CustomProperties {_faf :_cfb .NewProperties ()}};
|
||||
// SetLanguage records the language of the document.
|
||||
func (_edc CoreProperties )SetLanguage (s string ){_edc ._ecb .Language =&_eg .XSDAny {XMLName :_cda .Name {Local :"d\u0063\u003a\u006c\u0061\u006e\u0067\u0075\u0061\u0067\u0065"}};_edc ._ecb .Language .Data =[]byte (s );};
|
||||
|
||||
// Path returns the path to an image file, if any.
|
||||
func (_cece ImageRef )Path ()string {return _cece ._dbf .Path };func (_bgf CustomProperties )setProperty (_fbba *_cfb .CT_Property ){_bgf .setPropertyHelper (_fbba ,false );};const _cbgcd ="\u0032\u0020\u004aan\u0075\u0061\u0072\u0079\u0020\u0032\u0030\u0030\u0036\u0020\u0061\u0074\u0020\u0031\u0035\u003a\u0030\u0034";
|
||||
// WriteExtraFiles writes the extra files to the zip package.
|
||||
func (_edec *DocBase )WriteExtraFiles (z *_cd .Writer )error {for _ ,_gfba :=range _edec .ExtraFiles {if _bgb :=_gg .AddFileFromDisk (z ,_gfba .ZipPath ,_gfba .DiskPath );_bgb !=nil {return _bgb ;};};return nil ;};
|
||||
|
||||
// Category returns the category of the document
|
||||
func (_dadb CoreProperties )Category ()string {if _dadb ._bfg .Category !=nil {return *_dadb ._bfg .Category ;};return "";};
|
||||
|
||||
// MakeImageRef constructs an image reference which is a reference to a
|
||||
// particular image file inside a document. The same image can be used multiple
|
||||
// times in a document by re-use the ImageRef.
|
||||
func MakeImageRef (img Image ,d *DocBase ,rels Relationships )ImageRef {return ImageRef {_dbf :img ,_afad :d ,_fcg :rels };};func (_ffbd CustomProperties )SetPropertyAsI8 (name string ,i8 int64 ){_gb :=_ffbd .getNewProperty (name );_gb .I8 =&i8 ;_ffbd .setOrReplaceProperty (_gb );};
|
||||
|
||||
// AddImageToZip adds an image (either from bytes or from disk) and adds it to the zip file.
|
||||
func AddImageToZip (z *_c .Writer ,img ImageRef ,imageNum int ,dt _bbb .DocType )error {_cacf :=_bbb .AbsoluteImageFilename (dt ,imageNum ,_cf .ToLower (img .Format ()));if img .Data ()!=nil &&len (*img .Data ())> 0{if _cdde :=_fag .AddFileFromBytes (z ,_cacf ,*img .Data ());_cdde !=nil {return _cdde ;};}else if img .Path ()!=""{if _eded :=_fag .AddFileFromDisk (z ,_cacf ,img .Path ());_eded !=nil {return _eded ;};}else {return _ce .Errorf ("\u0075\u006es\u0075\u0070\u0070\u006f\u0072\u0074\u0065\u0064\u0020\u0069\u006d\u0061\u0067\u0065\u0020\u0073\u006f\u0075\u0072\u0063\u0065\u003a %\u002b\u0076",img );};return nil ;};
|
||||
|
||||
// SetDescription records the description of the document.
|
||||
func (_adf CoreProperties )SetDescription (s string ){if _adf ._bfg .Description ==nil {_adf ._bfg .Description =&_bbb .XSDAny {XMLName :_f .Name {Local :"\u0064\u0063\u003a\u0064\u0065\u0073\u0063\u0072\u0069p\u0074\u0069\u006f\u006e"}};};_adf ._bfg .Description .Data =[]byte (s );};const _cgd =7;func (_dgd CustomProperties )SetPropertyAsInt (name string ,i int ){_bdd :=_dgd .getNewProperty (name );_eccd :=int32 (i );_bdd .Int =&_eccd ;_dgd .setOrReplaceProperty (_bdd );};
|
||||
|
||||
// EnsureOverride ensures that an override for the given path exists, adding it if necessary
|
||||
func (_daf ContentTypes )EnsureOverride (path ,contentType string ){for _ ,_aed :=range _daf ._ffb .Override {if _aed .PartNameAttr ==path {if _cf .HasPrefix (contentType ,"\u0068\u0074\u0074\u0070"){_bbb .Log ("\u0063\u006f\u006e\u0074\u0065\u006et\u0020\u0074\u0079p\u0065\u0020\u0027%\u0073\u0027\u0020\u0069\u0073\u0020\u0069\u006e\u0063\u006fr\u0072\u0065\u0063\u0074\u002c m\u0075\u0073\u0074\u0020\u006e\u006f\u0074\u0020\u0073\u0074\u0061\u0072\u0074\u0020\u0077\u0069\u0074\u0068\u0020\u0068\u0074\u0074\u0070",contentType );};_aed .ContentTypeAttr =contentType ;return ;};};_daf .AddOverride (path ,contentType );};
|
||||
|
||||
// Data returns the data of an image file, if any.
|
||||
func (_gbb ImageRef )Data ()*[]byte {return _gbb ._dbf .Data };
|
||||
// NewRelationshipsCopy creates a new relationships wrapper as a copy of passed in instance.
|
||||
func NewRelationshipsCopy (rels Relationships )Relationships {_ffda :=*rels ._fcec ;return Relationships {_fcec :&_ffda };};func (_fbb CustomProperties )getNewProperty (_aeca string )*_ef .CT_Property {_cbe :=_fbb ._adb .Property ;_fgf :=int32 (1);for _ ,_afe :=range _cbe {if _afe .PidAttr > _fgf {_fgf =_afe .PidAttr ;};};_ced :=_ef .NewCT_Property ();_ced .NameAttr =&_aeca ;_ced .PidAttr =_fgf +1;_ced .FmtidAttr ="\u007b\u0044\u0035\u0043\u0044\u0044\u0035\u0030\u0035\u002d\u0032\u0045\u0039\u0043\u002d\u0031\u0030\u0031\u0042\u002d\u0039\u0033\u0039\u0037-\u0030\u0038\u0030\u0030\u0032B\u0032\u0043F\u0039\u0041\u0045\u007d";return _ced ;};
|
||||
|
||||
// RelativeHeight returns the relative height of an image given a fixed width.
|
||||
// This is used when setting image to a fixed width to calculate the height
|
||||
// required to keep the same image aspect ratio.
|
||||
func (_eaaa ImageRef )RelativeHeight (w _ddf .Distance )_ddf .Distance {_ddde :=float64 (_eaaa .Size ().Y )/float64 (_eaaa .Size ().X );return w *_ddf .Distance (_ddde );};
|
||||
func (_febf ImageRef )RelativeHeight (w _acg .Distance )_acg .Distance {_aecdb :=float64 (_febf .Size ().Y )/float64 (_febf .Size ().X );return w *_acg .Distance (_aecdb );};func (_dbe CustomProperties )SetPropertyAsOstream (name string ,ostream string ){_dced :=_dbe .getNewProperty (name );_dced .Ostream =&ostream ;_dbe .setOrReplaceProperty (_dced );};
|
||||
|
||||
// TableCol represents a column in a table.
|
||||
type TableCol struct{_gcbf *_gc .CT_TableCol };
|
||||
// CustomProperties contains document specific properties.
|
||||
type CustomProperties struct{_adb *_ef .Properties };
|
||||
|
||||
// Image is a container for image information. It's used as we need format and
|
||||
// and size information to use images.
|
||||
// It contains either the filesystem path to the image, or the image itself.
|
||||
type Image struct{Size _ag .Point ;Format string ;Path string ;Data *[]byte ;};
|
||||
|
||||
// Relationship is a relationship within a .rels file.
|
||||
type Relationship struct{_bdcd *_fga .Relationship };func (_fgfa CustomProperties )SetPropertyAsDate (name string ,date _dd .Time ){date =date .UTC ();_bdc ,_acc ,_dcba :=date .Date ();_ede ,_eac ,_bcff :=date .Clock ();_ggb :=_dd .Date (_bdc ,_acc ,_dcba ,_ede ,_eac ,_bcff ,0,_dd .UTC );_gce :=_fgfa .getNewProperty (name );_gce .Filetime =&_ggb ;_fgfa .setOrReplaceProperty (_gce );};func UtcTimeFormat (t _dd .Time )string {return t .Format (_cbgcd )+"\u0020\u0055\u0054\u0043"};
|
||||
|
||||
// SetStyle assigns TableStyle to a table.
|
||||
func (_ebab Table )SetStyle (style *_gc .CT_TableStyle ){if _ebab ._efcc .TblPr ==nil {_ebab ._efcc .TblPr =_gc .NewCT_TableProperties ();};if _ebab ._efcc .TblPr .Choice ==nil {_ebab ._efcc .TblPr .Choice =_gc .NewCT_TablePropertiesChoice ();};_ebab ._efcc .TblPr .Choice .TableStyle =style ;};
|
||||
|
||||
// FindRIDForN returns the relationship ID for the i'th relationship of type t.
|
||||
func (_ega Relationships )FindRIDForN (i int ,t string )string {for _ ,_cff :=range _ega ._dedb .CT_Relationships .Relationship {if _cff .TypeAttr ==t {if i ==0{return _cff .IdAttr ;};i --;};};return "";};func _af (_ad *_bbb .XSDAny )_dd .Time {if _ad ==nil {return _dd .Time {};};_cg ,_cec :=_dd .Parse (_aeb ,string (_ad .Data ));if _cec !=nil {_bbb .Log ("\u0065\u0072\u0072\u006f\u0072\u0020\u0070\u0061\u0072\u0073i\u006e\u0067\u0020\u0074\u0069\u006d\u0065 \u0066\u0072\u006f\u006d\u0020\u0025\u0073\u003a\u0020\u0025\u0073",string (_ad .Data ),_cec );};return _cg ;};const _gfc =2021;
|
||||
|
||||
// Table represents a table in the document.
|
||||
type Table struct{_efcc *_gc .Tbl ;_ggba *_gc .CT_Transform2D ;};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_fac Relationship )X ()*_fga .Relationship {return _fac ._bdcd };
|
||||
// SetLinksUpToDate sets the links up to date flag.
|
||||
func (_bade AppProperties )SetLinksUpToDate (v bool ){_bade ._ad .LinksUpToDate =_eg .Bool (v )};
|
||||
|
||||
// X returns the inner raw content types.
|
||||
func (_dga ContentTypes )X ()*_gde .Types {return _dga ._ffb };
|
||||
|
||||
// AddExtraFileFromZip is used when reading an unsupported file from an OOXML
|
||||
// file. This ensures that unsupported file content will at least round-trip
|
||||
// correctly.
|
||||
func (_deg *DocBase )AddExtraFileFromZip (f *_c .File )error {_dffd ,_bbeg :=_fag .ExtractToDiskTmp (f ,_deg .TmpPath );if _bbeg !=nil {return _ce .Errorf ("\u0065\u0072r\u006f\u0072\u0020\u0065x\u0074\u0072a\u0063\u0074\u0069\u006e\u0067\u0020\u0075\u006es\u0075\u0070\u0070\u006f\u0072\u0074\u0065\u0064\u0020\u0066\u0069\u006ce\u003a\u0020\u0025\u0073",_bbeg );};_deg .ExtraFiles =append (_deg .ExtraFiles ,ExtraFile {ZipPath :f .Name ,DiskPath :_dffd });return nil ;};
|
||||
|
||||
// ImageRef is a reference to an image within a document.
|
||||
type ImageRef struct{_afad *DocBase ;_fcg Relationships ;_dbf Image ;_gec string ;_fcag string ;};
|
||||
|
||||
// TableRow represents a row in a table.
|
||||
type TableRow struct{_gcec *_gc .CT_TableRow };
|
||||
|
||||
// SetApplication sets the name of the application that created the document.
|
||||
func (_ggcc AppProperties )SetApplication (s string ){_ggcc ._bff .Application =&s };
|
||||
|
||||
// GetImageBytesByTarget returns Image object with Data bytes read from its target.
|
||||
func (_babb *DocBase )GetImageBytesByTarget (target string )(Image ,error ){if target !=""{target ="\u0077\u006f\u0072d\u002f"+target ;for _ ,_eccf :=range _babb .Images {if _eccf .Target ()==target {return ImageFromStorage (_eccf .Path ());};};};return Image {},_ddca ;};
|
||||
|
||||
// RemoveOverrideByIndex removes an override given a path and override index.
|
||||
func (_gddb ContentTypes )RemoveOverrideByIndex (path string ,indexToFind int )error {_dedg :=path [0:len (path )-5];if !_cf .HasPrefix (_dedg ,"\u002f"){_dedg ="\u002f"+_dedg ;};_cac ,_gdcc :=_fa .Compile (_dedg +"\u0028\u005b\u0030-\u0039\u005d\u002b\u0029\u002e\u0078\u006d\u006c");if _gdcc !=nil {return _gdcc ;};_fbaa :=0;_acg :=-1;for _acb ,_dfa :=range _gddb ._ffb .Override {if _ecc :=_cac .FindStringSubmatch (_dfa .PartNameAttr );len (_ecc )> 1{if _fbaa ==indexToFind {_acg =_acb ;}else if _fbaa > indexToFind {_eb ,_ :=_dg .Atoi (_ecc [1]);_eb --;_dfa .PartNameAttr =_ce .Sprintf ("\u0025\u0073\u0025\u0064\u002e\u0078\u006d\u006c",_dedg ,_eb );};_fbaa ++;};};if _acg > -1{copy (_gddb ._ffb .Override [_acg :],_gddb ._ffb .Override [_acg +1:]);_gddb ._ffb .Override =_gddb ._ffb .Override [0:len (_gddb ._ffb .Override )-1];};return nil ;};
|
||||
|
||||
// CopyOverride copies override content type for a given `path` and puts it with a path `newPath`.
|
||||
func (_bfa ContentTypes )CopyOverride (path ,newPath string ){if !_cf .HasPrefix (path ,"\u002f"){path ="\u002f"+path ;};if !_cf .HasPrefix (newPath ,"\u002f"){newPath ="\u002f"+newPath ;};for _efd :=range _bfa ._ffb .Override {if _bfa ._ffb .Override [_efd ].PartNameAttr ==path {_gca :=*_bfa ._ffb .Override [_efd ];_gca .PartNameAttr =newPath ;_bfa ._ffb .Override =append (_bfa ._ffb .Override ,&_gca );};};};func (_fgae CustomProperties )SetPropertyAsLpwstr (name string ,lpwstr string ){_eaf :=_fgae .getNewProperty (name );_eaf .Lpwstr =&lpwstr ;_fgae .setOrReplaceProperty (_eaf );};
|
||||
|
||||
// Relationships represents a .rels file.
|
||||
type Relationships struct{_dedb *_fga .Relationships };func (_dde CustomProperties )SetPropertyAsVector (name string ,vector *_de .Vector ){_gf :=_dde .getNewProperty (name );_gf .Vector =vector ;_dde .setOrReplaceProperty (_gf );};
|
||||
|
||||
// PropertiesList returns the list of all custom properties of the document.
|
||||
func (_gcbg CustomProperties )PropertiesList ()[]*_cfb .CT_Property {return _gcbg ._faf .Property };
|
||||
func (_fgg ContentTypes )X ()*_bb .Types {return _fgg ._aaa };func (_cdgb *ImageRef )SetRelID (id string ){_cdgb ._ffa =id };func (_cbef CustomProperties )SetPropertyAsOstorage (name string ,ostorage string ){_gffb :=_cbef .getNewProperty (name );_gffb .Ostorage =&ostorage ;_cbef .setOrReplaceProperty (_gffb );};
|
||||
|
||||
// Properties returns table properties.
|
||||
func (_edf Table )Properties ()*_gc .CT_TableProperties {return _edf ._efcc .TblPr };func (_dff CustomProperties )SetPropertyAsLpstr (name string ,lpstr string ){_fdbc :=_dff .getNewProperty (name );_fdbc .Lpstr =&lpstr ;_dff .setOrReplaceProperty (_fdbc );};
|
||||
func (_fcdc Table )Grid ()*_b .CT_TableGrid {return _fcdc ._bbce .TblGrid };
|
||||
|
||||
// Description returns the description of the document
|
||||
func (_afa CoreProperties )Description ()string {if _afa ._bfg .Description !=nil {return string (_afa ._bfg .Description .Data );};return "";};
|
||||
|
||||
// X returns the underlying raw XML data.
|
||||
func (_gfac Relationships )X ()*_fga .Relationships {return _gfac ._dedb };func (_dab CustomProperties )SetPropertyAsI4 (name string ,i4 int32 ){_deb :=_dab .getNewProperty (name );_deb .I4 =&i4 ;_dab .setOrReplaceProperty (_deb );};
|
||||
|
||||
// SetApplicationVersion sets the version of the application that created the
|
||||
// document. Per MS, the verison string mut be in the form 'XX.YYYY'.
|
||||
func (_beb AppProperties )SetApplicationVersion (s string ){_beb ._bff .AppVersion =&s };
|
||||
|
||||
// CopyRelationship copies the relationship.
|
||||
func (_ddda Relationships )CopyRelationship (idAttr string )(Relationship ,bool ){for _cgee :=range _ddda ._dedb .Relationship {if _ddda ._dedb .Relationship [_cgee ].IdAttr ==idAttr {_ffc :=*_ddda ._dedb .Relationship [_cgee ];_fea :=len (_ddda ._dedb .Relationship )+1;_fbe :=map[string ]struct{}{};for _ ,_dffc :=range _ddda ._dedb .Relationship {_fbe [_dffc .IdAttr ]=struct{}{};};for _ ,_cfe :=_fbe [_ce .Sprintf ("\u0072\u0049\u0064%\u0064",_fea )];_cfe ;_ ,_cfe =_fbe [_ce .Sprintf ("\u0072\u0049\u0064%\u0064",_fea )]{_fea ++;};_ffc .IdAttr =_ce .Sprintf ("\u0072\u0049\u0064%\u0064",_fea );_ddda ._dedb .Relationship =append (_ddda ._dedb .Relationship ,&_ffc );return Relationship {_bdcd :&_ffc },true ;};};return Relationship {},false ;};
|
||||
|
||||
// SetAuthor records the author of the document.
|
||||
func (_fe CoreProperties )SetAuthor (s string ){if _fe ._bfg .Creator ==nil {_fe ._bfg .Creator =&_bbb .XSDAny {XMLName :_f .Name {Local :"\u0064\u0063\u003a\u0063\u0072\u0065\u0061\u0074\u006f\u0072"}};};_fe ._bfg .Creator .Data =[]byte (s );};
|
||||
|
||||
// RelativeWidth returns the relative width of an image given a fixed height.
|
||||
// This is used when setting image to a fixed height to calculate the width
|
||||
// required to keep the same image aspect ratio.
|
||||
func (_eff ImageRef )RelativeWidth (h _ddf .Distance )_ddf .Distance {_gbg :=float64 (_eff .Size ().X )/float64 (_eff .Size ().Y );return h *_ddf .Distance (_gbg );};
|
||||
|
||||
// SetOffsetX sets horizontal offset of a table in distance units (see measurement package).
|
||||
func (_dggf Table )SetOffsetX (offX float64 ){if _dggf ._ggba .Off ==nil {_dggf ._ggba .Off =_gc .NewCT_Point2D ();_debg :=int64 (0);_dggf ._ggba .Off .YAttr =_gc .ST_Coordinate {ST_CoordinateUnqualified :&_debg };};_beef :=_ddf .ToEMU (offX );_dggf ._ggba .Off .XAttr =_gc .ST_Coordinate {ST_CoordinateUnqualified :&_beef };};
|
||||
|
||||
// ExtraFile is an unsupported file type extracted from, or to be written to a
|
||||
// zip package
|
||||
type ExtraFile struct{ZipPath string ;DiskPath string ;};func (_gfa CustomProperties )SetPropertyAsClsid (name string ,clsid string ){_cfdd :=_gfa .getNewProperty (name );_cfdd .Clsid =&clsid ;_gfa .setOrReplaceProperty (_cfdd );};func (_fge CustomProperties )SetPropertyAsR4 (name string ,r4 float32 ){_ecb :=_fge .getNewProperty (name );_ecb .R4 =&r4 ;_fge .setOrReplaceProperty (_ecb );};
|
||||
|
||||
// AddCustomRelationships adds relationships related to custom properties to the document.
|
||||
func (_cagd *DocBase )AddCustomRelationships (){_cagd .ContentTypes .AddOverride ("/\u0064o\u0063\u0050\u0072\u006f\u0070\u0073\u002f\u0063u\u0073\u0074\u006f\u006d.x\u006d\u006c","\u0061\u0070\u0070\u006c\u0069\u0063a\u0074\u0069\u006f\u006e\u002fv\u006e\u0064\u002e\u006f\u0070\u0065n\u0078\u006d\u006c\u0066\u006fr\u006d\u0061\u0074\u0073\u002d\u006f\u0066\u0066\u0069\u0063\u0065\u0064o\u0063\u0075\u006d\u0065\u006e\u0074\u002e\u0063\u0075\u0073\u0074\u006f\u006d\u002d\u0070r\u006f\u0070\u0065\u0072\u0074\u0069\u0065\u0073+\u0078\u006d\u006c");_cagd .Rels .AddRelationship ("\u0064\u006f\u0063\u0050ro\u0070\u0073\u002f\u0063\u0075\u0073\u0074\u006f\u006d\u002e\u0078\u006d\u006c",_bbb .CustomPropertiesType );};
|
||||
|
||||
// AddHyperlink adds an external hyperlink relationship.
|
||||
func (_afada Relationships )AddHyperlink (target string )Hyperlink {_cfc :=_afada .AddRelationship (target ,_bbb .HyperLinkType );_cfc ._bdcd .TargetModeAttr =_fga .ST_TargetModeExternal ;return Hyperlink (_cfc );};
|
||||
|
||||
// NewContentTypes returns a wrapper around a newly constructed content-types.
|
||||
func NewContentTypes ()ContentTypes {_dce :=ContentTypes {_ffb :_gde .NewTypes ()};_dce .AddDefault ("\u0078\u006d\u006c","\u0061p\u0070l\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u0078\u006d\u006c");_dce .AddDefault ("\u0072\u0065\u006c\u0073","\u0061\u0070\u0070\u006c\u0069\u0063a\u0074\u0069\u006fn\u002f\u0076\u006ed\u002e\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006fr\u006d\u0061\u0074\u0073\u002dpa\u0063\u006b\u0061\u0067\u0065\u002e\u0072\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073\u002b\u0078\u006d\u006c");_dce .AddDefault ("\u0070\u006e\u0067","\u0069m\u0061\u0067\u0065\u002f\u0070\u006eg");_dce .AddDefault ("\u006a\u0070\u0065\u0067","\u0069\u006d\u0061\u0067\u0065\u002f\u006a\u0070\u0065\u0067");_dce .AddDefault ("\u006a\u0070\u0067","\u0069m\u0061\u0067\u0065\u002f\u006a\u0070g");_dce .AddDefault ("\u0077\u006d\u0066","i\u006d\u0061\u0067\u0065\u002f\u0078\u002d\u0077\u006d\u0066");_dce .AddOverride ("\u002fd\u006fc\u0050\u0072\u006f\u0070\u0073/\u0063\u006fr\u0065\u002e\u0078\u006d\u006c","\u0061\u0070\u0070\u006c\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u0076\u006e\u0064\u002e\u006f\u0070\u0065\u006ex\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073-\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002e\u0063\u006f\u0072\u0065\u002dp\u0072\u006f\u0070\u0065\u0072\u0074i\u0065\u0073\u002bx\u006d\u006c");_dce .AddOverride ("\u002f\u0064\u006f\u0063\u0050\u0072\u006f\u0070\u0073\u002f\u0061\u0070p\u002e\u0078\u006d\u006c","a\u0070\u0070l\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u0076\u006e\u0064\u002e\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066o\u0072\u006d\u0061\u0074\u0073\u002d\u006f\u0066\u0066\u0069\u0063\u0065\u0064\u006f\u0063\u0075m\u0065\u006e\u0074\u002e\u0065\u0078\u0074\u0065\u006e\u0064\u0065\u0064\u002dp\u0072\u006f\u0070\u0065\u0072\u0074\u0069\u0065\u0073\u002b\u0078m\u006c");return _dce ;};const _aeb ="2\u00300\u0036\u002d\u0030\u0031\u002d\u0030\u0032\u00541\u0035\u003a\u0030\u0034:0\u0035\u005a";
|
||||
|
||||
// CreateCustomProperties creates the custom properties of the document.
|
||||
func (_aag *DocBase )CreateCustomProperties (){_aag .CustomProperties =NewCustomProperties ();_aag .AddCustomRelationships ();};
|
||||
|
||||
// SetTarget changes the target attribute of the image reference (e.g. in the case of the creation of the reference or if the image which the reference is related to was moved from one location to another).
|
||||
func (_fbbf *ImageRef )SetTarget (target string ){_fbbf ._fcag =target };func (_cge CustomProperties )setPropertyHelper (_ddd *_cfb .CT_Property ,_dedc bool ){_gdf :=_cge .GetPropertyByName (*_ddd .NameAttr );if (_gdf ==CustomProperty {}){_cge ._faf .Property =append (_cge ._faf .Property ,_ddd );}else if _dedc {_ddd .FmtidAttr =_gdf ._fcd .FmtidAttr ;if _gdf ._fcd .PidAttr ==0{_ddd .PidAttr =_gdf ._fcd .PidAttr ;};_ddd .LinkTargetAttr =_gdf ._fcd .LinkTargetAttr ;*_gdf ._fcd =*_ddd ;};};
|
||||
|
||||
// Target returns the target (path) of a relationship.
|
||||
func (_dbd Relationship )Target ()string {return _dbd ._bdcd .TargetAttr };
|
||||
// Size returns the size of an image
|
||||
func (_agb ImageRef )Size ()_de .Point {return _agb ._ccfb .Size };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_agg CoreProperties )X ()*_df .CoreProperties {return _agg ._bfg };
|
||||
func (_ee CustomProperties )X ()*_ef .Properties {return _ee ._adb };func (_fbfdg CustomProperties )setOrReplaceProperty (_dcg *_ef .CT_Property ){_fbfdg .setPropertyHelper (_dcg ,true );};
|
||||
|
||||
// GetPropertyByName returns a custom property selected by it's name.
|
||||
func (_dadf CustomProperties )GetPropertyByName (name string )CustomProperty {_ffe :=_dadf ._faf .Property ;for _ ,_gdgb :=range _ffe {if *_gdgb .NameAttr ==name {return CustomProperty {_fcd :_gdgb };};};return CustomProperty {};};
|
||||
// EnsureOverride ensures that an override for the given path exists, adding it if necessary
|
||||
func (_bfcg ContentTypes )EnsureOverride (path ,contentType string ){for _ ,_ffd :=range _bfcg ._aaa .Override {if _ffd .PartNameAttr ==path {if _a .HasPrefix (contentType ,"\u0068\u0074\u0074\u0070"){_eg .Log ("\u0063\u006f\u006e\u0074\u0065\u006et\u0020\u0074\u0079p\u0065\u0020\u0027%\u0073\u0027\u0020\u0069\u0073\u0020\u0069\u006e\u0063\u006fr\u0072\u0065\u0063\u0074\u002c m\u0075\u0073\u0074\u0020\u006e\u006f\u0074\u0020\u0073\u0074\u0061\u0072\u0074\u0020\u0077\u0069\u0074\u0068\u0020\u0068\u0074\u0074\u0070",contentType );};_ffd .ContentTypeAttr =contentType ;return ;};};_bfcg .AddOverride (path ,contentType );};func (_eda CustomProperties )SetPropertyAsEmpty (name string ){_fbg :=_eda .getNewProperty (name );_fbg .Empty =_ac .NewEmpty ();_eda .setOrReplaceProperty (_fbg );};const _bbfg ="\u0032\u0020\u004aan\u0075\u0061\u0072\u0079\u0020\u0032\u0030\u0030\u0036\u0020\u0061\u0074\u0020\u0031\u0035\u003a\u0030\u0034";
|
||||
|
||||
// Clear removes any existing relationships.
|
||||
func (_eed Relationships )Clear (){_eed ._dedb .Relationship =nil };
|
||||
|
||||
// Modified returns the time that the document was modified.
|
||||
func (_baa CoreProperties )Modified ()_dd .Time {return _af (_baa ._bfg .Modified )};
|
||||
|
||||
// Format returns the format of the underlying image
|
||||
func (_caab ImageRef )Format ()string {return _caab ._dbf .Format };
|
||||
|
||||
// AppProperties contains properties specific to the document and the
|
||||
// application that created it.
|
||||
type AppProperties struct{_bff *_fd .Properties };
|
||||
|
||||
// AddCol adds a column to a table.
|
||||
func (_bag Table )AddCol ()*TableCol {_dbfa :=_gc .NewCT_TableCol ();_bag ._efcc .TblGrid .GridCol =append (_bag ._efcc .TblGrid .GridCol ,_dbfa );for _ ,_gdaf :=range _bag ._efcc .Tr {_aab :=_gc .NewCT_TableCell ();_gdaf .Tc =append (_gdaf .Tc ,_aab );};return &TableCol {_gcbf :_dbfa };};func (_fbde CustomProperties )SetPropertyAsUi1 (name string ,ui1 uint8 ){_bgfe :=_fbde .getNewProperty (name );_bgfe .Ui1 =&ui1 ;_fbde .setOrReplaceProperty (_bgfe );};const _eadb =15;
|
||||
|
||||
// NewRelationship constructs a new relationship.
|
||||
func NewRelationship ()Relationship {return Relationship {_bdcd :_fga .NewRelationship ()}};
|
||||
|
||||
// AddOverride adds an override content type for a given path name.
|
||||
func (_dcf ContentTypes )AddOverride (path ,contentType string ){if !_cf .HasPrefix (path ,"\u002f"){path ="\u002f"+path ;};if _cf .HasPrefix (contentType ,"\u0068\u0074\u0074\u0070"){_bbb .Log ("\u0063\u006f\u006e\u0074\u0065\u006et\u0020\u0074\u0079p\u0065\u0020\u0027%\u0073\u0027\u0020\u0069\u0073\u0020\u0069\u006e\u0063\u006fr\u0072\u0065\u0063\u0074\u002c m\u0075\u0073\u0074\u0020\u006e\u006f\u0074\u0020\u0073\u0074\u0061\u0072\u0074\u0020\u0077\u0069\u0074\u0068\u0020\u0068\u0074\u0074\u0070",contentType );};for _ ,_cbgg :=range _dcf ._ffb .Override {if _cbgg .PartNameAttr ==path &&_cbgg .ContentTypeAttr ==contentType {return ;};};_dcb :=_gde .NewOverride ();_dcb .PartNameAttr =path ;_dcb .ContentTypeAttr =contentType ;_dcf ._ffb .Override =append (_dcf ._ffb .Override ,_dcb );};
|
||||
|
||||
// DocBase is the type embedded in in the Document/Workbook/Presentation types
|
||||
// that contains members common to all.
|
||||
type DocBase struct{ContentTypes ContentTypes ;AppProperties AppProperties ;Rels Relationships ;CoreProperties CoreProperties ;CustomProperties CustomProperties ;Thumbnail _ag .Image ;Images []ImageRef ;ExtraFiles []ExtraFile ;TmpPath string ;};
|
||||
|
||||
// Properties returns table properties.
|
||||
func (_aedg Table )Grid ()*_gc .CT_TableGrid {return _aedg ._efcc .TblGrid };const _bddf =30;
|
||||
|
||||
// Relationships returns a slice of all of the relationships.
|
||||
func (_bfc Relationships )Relationships ()[]Relationship {_bgc :=[]Relationship {};for _ ,_cba :=range _bfc ._dedb .Relationship {_bgc =append (_bgc ,Relationship {_bdcd :_cba });};return _bgc ;};
|
||||
|
||||
// AddDefault registers a default content type for a given file extension.
|
||||
func (_gdc ContentTypes )AddDefault (fileExtension string ,contentType string ){fileExtension =_cf .ToLower (fileExtension );for _ ,_bed :=range _gdc ._ffb .Default {if _bed .ExtensionAttr ==fileExtension &&_bed .ContentTypeAttr ==contentType {return ;};};_deea :=_gde .NewDefault ();_deea .ExtensionAttr =fileExtension ;_deea .ContentTypeAttr =contentType ;_gdc ._ffb .Default =append (_gdc ._ffb .Default ,_deea );};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_fgc TableStyles )X ()*_gc .TblStyleLst {return _fgc ._egfa };
|
||||
|
||||
// CustomProperty contains document specific property.
|
||||
// Using of this type is deprecated.
|
||||
type CustomProperty struct{_fcd *_cfb .CT_Property };
|
||||
|
||||
// NewTableStyles constructs a new TableStyles.
|
||||
func NewTableStyles ()TableStyles {return TableStyles {_egfa :_gc .NewTblStyleLst ()}};func (_eg CustomProperties )SetPropertyAsUi4 (name string ,ui4 uint32 ){_gcc :=_eg .getNewProperty (name );_gcc .Ui4 =&ui4 ;_eg .setOrReplaceProperty (_gcc );};func (_ed CustomProperties )SetPropertyAsCy (name string ,cy string ){_bdb :=_ed .getNewProperty (name );_bdb .Cy =&cy ;_ed .setOrReplaceProperty (_bdb );};func (_fbbg CustomProperties )SetPropertyAsI2 (name string ,i2 int16 ){_cc :=_fbbg .getNewProperty (name );_cc .I2 =&i2 ;_fbbg .setOrReplaceProperty (_cc );};
|
||||
|
||||
// SetDocSecurity sets the document security flag.
|
||||
func (_ec AppProperties )SetDocSecurity (v int32 ){_ec ._bff .DocSecurity =_bbb .Int32 (v )};
|
||||
// SetStyle assigns TableStyle to a table.
|
||||
func (_cece Table )SetStyle (style *_b .CT_TableStyle ){if _cece ._bbce .TblPr ==nil {_cece ._bbce .TblPr =_b .NewCT_TableProperties ();};if _cece ._bbce .TblPr .Choice ==nil {_cece ._bbce .TblPr .Choice =_b .NewCT_TablePropertiesChoice ();};_cece ._bbce .TblPr .Choice .TableStyle =style ;};
|
||||
|
||||
// ImageFromStorage reads an image using the currently set
|
||||
// temporary storage mechanism (see tempstorage). You can also
|
||||
// construct an Image directly if the file and size are known.
|
||||
func ImageFromStorage (path string )(Image ,error ){_gdfc :=Image {};_cae ,_cga :=_bb .Open (path );if _cga !=nil {return _gdfc ,_ce .Errorf ("\u0065\u0072\u0072or\u0020\u0072\u0065\u0061\u0064\u0069\u006e\u0067\u0020\u0069\u006d\u0061\u0067\u0065\u003a\u0020\u0025\u0073",_cga );};defer _cae .Close ();_afc ,_bffg ,_cga :=_ag .Decode (_cae );if _cga !=nil {return _gdfc ,_ce .Errorf ("\u0075n\u0061\u0062\u006c\u0065 \u0074\u006f\u0020\u0070\u0061r\u0073e\u0020i\u006d\u0061\u0067\u0065\u003a\u0020\u0025s",_cga );};_gdfc .Path =path ;_gdfc .Format =_bffg ;_gdfc .Size =_afc .Bounds ().Size ();return _gdfc ,nil ;};func (_fbd CustomProperties )setOrReplaceProperty (_afab *_cfb .CT_Property ){_fbd .setPropertyHelper (_afab ,true );};
|
||||
func ImageFromStorage (path string )(Image ,error ){_fcb :=Image {};_aeb ,_ffe :=_bc .Open (path );if _ffe !=nil {return _fcb ,_dc .Errorf ("\u0065\u0072\u0072or\u0020\u0072\u0065\u0061\u0064\u0069\u006e\u0067\u0020\u0069\u006d\u0061\u0067\u0065\u003a\u0020\u0025\u0073",_ffe );};defer _aeb .Close ();_cdad ,_dbdf ,_ffe :=_de .Decode (_aeb );if _ffe !=nil {return _fcb ,_dc .Errorf ("\u0075n\u0061\u0062\u006c\u0065 \u0074\u006f\u0020\u0070\u0061r\u0073e\u0020i\u006d\u0061\u0067\u0065\u003a\u0020\u0025s",_ffe );};_fcb .Path =path ;_fcb .Format =_dbdf ;_fcb .Size =_cdad .Bounds ().Size ();return _fcb ,nil ;};func (_cecc CustomProperties )SetPropertyAsVector (name string ,vector *_ac .Vector ){_cef :=_cecc .getNewProperty (name );_cef .Vector =vector ;_cecc .setOrReplaceProperty (_cef );};
|
||||
|
||||
// LastModifiedBy returns the name of the last person to modify the document
|
||||
func (_bcg CoreProperties )LastModifiedBy ()string {if _bcg ._bfg .LastModifiedBy !=nil {return *_bcg ._bfg .LastModifiedBy ;};return "";};func (_gda CustomProperties )getNewProperty (_bbbb string )*_cfb .CT_Property {_cgf :=_gda ._faf .Property ;_cdg :=int32 (1);for _ ,_fbg :=range _cgf {if _fbg .PidAttr > _cdg {_cdg =_fbg .PidAttr ;};};_dcfe :=_cfb .NewCT_Property ();_dcfe .NameAttr =&_bbbb ;_dcfe .PidAttr =_cdg +1;_dcfe .FmtidAttr ="\u007b\u0044\u0035\u0043\u0044\u0044\u0035\u0030\u0035\u002d\u0032\u0045\u0039\u0043\u002d\u0031\u0030\u0031\u0042\u002d\u0039\u0033\u0039\u0037-\u0030\u0038\u0030\u0030\u0032B\u0032\u0043F\u0039\u0041\u0045\u007d";return _dcfe ;};func (_eee CustomProperties )SetPropertyAsVstream (name string ,vstream *_de .Vstream ){_afbd :=_eee .getNewProperty (name );_afbd .Vstream =vstream ;_eee .setOrReplaceProperty (_afbd );};
|
||||
// Table represents a table in the document.
|
||||
type Table struct{_bbce *_b .Tbl ;_acag *_b .CT_Transform2D ;};
|
||||
|
||||
// SetWidth sets column width, see measurement package.
|
||||
func (_eab TableCol )SetWidth (m _ddf .Distance ){_dgb :=_ddf .ToEMU (float64 (m ));_eab ._gcbf .WAttr =_gc .ST_Coordinate {ST_CoordinateUnqualified :&_dgb };};func (_fagc CustomProperties )SetPropertyAsI1 (name string ,i1 int8 ){_ceb :=_fagc .getNewProperty (name );_ceb .I1 =&i1 ;_fagc .setOrReplaceProperty (_ceb );};var ReleasedAt =_dd .Date (_gfc ,_cgd ,_edg ,_eadb ,_bddf ,0,0,_dd .UTC );
|
||||
// Category returns the category of the document
|
||||
func (_fgc CoreProperties )Category ()string {if _fgc ._ecb .Category !=nil {return *_fgc ._ecb .Category ;};return "";};
|
||||
|
||||
// NewTable makes a new table.
|
||||
func NewTable ()*Table {_gab :=_gc .NewTbl ();_gab .TblPr =_gc .NewCT_TableProperties ();return &Table {_efcc :_gab };};
|
||||
// NewTableWithXfrm makes a new table with a pointer to its parent Xfrm for changing its offset and size.
|
||||
func NewTableWithXfrm (xfrm *_b .CT_Transform2D )*Table {_bead :=_b .NewTbl ();_bead .TblPr =_b .NewCT_TableProperties ();return &Table {_bbce :_bead ,_acag :xfrm };};func (_gfa CustomProperties )SetPropertyAsFiletime (name string ,filetime _ffc .Time ){_dad :=_gfa .getNewProperty (name );_dad .Filetime =&filetime ;_gfa .setOrReplaceProperty (_dad );};
|
||||
|
||||
// NewRelationshipsCopy creates a new relationships wrapper as a copy of passed in instance.
|
||||
func NewRelationshipsCopy (rels Relationships )Relationships {_efc :=*rels ._dedb ;return Relationships {_dedb :&_efc };};
|
||||
// AddRow adds a row to a table.
|
||||
func (_aed Table )AddRow ()*TableRow {_bgd :=_b .NewCT_TableRow ();for _ebbb :=0;_ebbb < len (_aed ._bbce .TblGrid .GridCol );_ebbb ++{_bgd .Tc =append (_bgd .Tc ,_b .NewCT_TableCell ());};_aed ._bbce .Tr =append (_aed ._bbce .Tr ,_bgd );return &TableRow {_cbc :_bgd };};
|
||||
|
||||
// IsEmpty returns true if there are no relationships.
|
||||
func (_beea Relationships )IsEmpty ()bool {return _beea ._dedb ==nil ||len (_beea ._dedb .Relationship )==0;};
|
||||
// CreateCustomProperties creates the custom properties of the document.
|
||||
func (_abfb *DocBase )CreateCustomProperties (){_abfb .CustomProperties =NewCustomProperties ();_abfb .AddCustomRelationships ();};func (_fbba CustomProperties )SetPropertyAsCy (name string ,cy string ){_aaac :=_fbba .getNewProperty (name );_aaac .Cy =&cy ;_fbba .setOrReplaceProperty (_aaac );};
|
||||
|
||||
// NewRelationships creates a new relationship wrapper.
|
||||
func NewRelationships ()Relationships {return Relationships {_dedb :_fga .NewRelationships ()}};func (_dfb CustomProperties )SetPropertyAsBlob (name ,blob string ){_bfge :=_dfb .getNewProperty (name );_bfge .Blob =&blob ;_dfb .setOrReplaceProperty (_bfge );};func (_afbf CustomProperties )SetPropertyAsStream (name string ,stream string ){_egb :=_afbf .getNewProperty (name );_egb .Stream =&stream ;_afbf .setOrReplaceProperty (_egb );};
|
||||
// AddOverride adds an override content type for a given path name.
|
||||
func (_bbf ContentTypes )AddOverride (path ,contentType string ){if !_a .HasPrefix (path ,"\u002f"){path ="\u002f"+path ;};if _a .HasPrefix (contentType ,"\u0068\u0074\u0074\u0070"){_eg .Log ("\u0063\u006f\u006e\u0074\u0065\u006et\u0020\u0074\u0079p\u0065\u0020\u0027%\u0073\u0027\u0020\u0069\u0073\u0020\u0069\u006e\u0063\u006fr\u0072\u0065\u0063\u0074\u002c m\u0075\u0073\u0074\u0020\u006e\u006f\u0074\u0020\u0073\u0074\u0061\u0072\u0074\u0020\u0077\u0069\u0074\u0068\u0020\u0068\u0074\u0074\u0070",contentType );};for _ ,_bfb :=range _bbf ._aaa .Override {if _bfb .PartNameAttr ==path &&_bfb .ContentTypeAttr ==contentType {return ;};};_geg :=_bb .NewOverride ();_geg .PartNameAttr =path ;_geg .ContentTypeAttr =contentType ;_bbf ._aaa .Override =append (_bbf ._aaa .Override ,_geg );};func (_bge CustomProperties )setProperty (_abbf *_ef .CT_Property ){_bge .setPropertyHelper (_abbf ,false );};
|
||||
|
||||
// SetOffsetY sets vertical offset of a table in distance units (see measurement package).
|
||||
func (_acca Table )SetOffsetY (offY float64 ){if _acca ._ggba .Off ==nil {_acca ._ggba .Off =_gc .NewCT_Point2D ();_dadc :=int64 (0);_acca ._ggba .Off .XAttr =_gc .ST_Coordinate {ST_CoordinateUnqualified :&_dadc };};_eca :=_ddf .ToEMU (offY );_acca ._ggba .Off .YAttr =_gc .ST_Coordinate {ST_CoordinateUnqualified :&_eca };};func (_fgf CustomProperties )SetPropertyAsUint (name string ,ui uint ){_add :=_fgf .getNewProperty (name );_fca :=uint32 (ui );_add .Uint =&_fca ;_fgf .setOrReplaceProperty (_add );};func (_eaaf *ImageRef )SetRelID (id string ){_eaaf ._gec =id };
|
||||
// Theme is a drawingml theme.
|
||||
type Theme struct{_deba *_b .Theme };func _fbc (_ded *_eg .XSDAny )_ffc .Time {if _ded ==nil {return _ffc .Time {};};_aeg ,_ecac :=_ffc .Parse (_gdf ,string (_ded .Data ));if _ecac !=nil {_eg .Log ("\u0065\u0072\u0072\u006f\u0072\u0020\u0070\u0061\u0072\u0073i\u006e\u0067\u0020\u0074\u0069\u006d\u0065 \u0066\u0072\u006f\u006d\u0020\u0025\u0073\u003a\u0020\u0025\u0073",string (_ded .Data ),_ecac );};return _aeg ;};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_bcee Table )X ()*_gc .Tbl {return _bcee ._efcc };
|
||||
// CopyOverride copies override content type for a given `path` and puts it with a path `newPath`.
|
||||
func (_ede ContentTypes )CopyOverride (path ,newPath string ){if !_a .HasPrefix (path ,"\u002f"){path ="\u002f"+path ;};if !_a .HasPrefix (newPath ,"\u002f"){newPath ="\u002f"+newPath ;};for _dd :=range _ede ._aaa .Override {if _ede ._aaa .Override [_dd ].PartNameAttr ==path {_ged :=*_ede ._aaa .Override [_dd ];_ged .PartNameAttr =newPath ;_ede ._aaa .Override =append (_ede ._aaa .Override ,&_ged );};};};func (_cbed CustomProperties )SetPropertyAsUi1 (name string ,ui1 uint8 ){_ebb :=_cbed .getNewProperty (name );_ebb .Ui1 =&ui1 ;_cbed .setOrReplaceProperty (_ebb );};func (_adg CustomProperties )setPropertyHelper (_aecd *_ef .CT_Property ,_bag bool ){_dcf :=_adg .GetPropertyByName (*_aecd .NameAttr );if (_dcf ==CustomProperty {}){_adg ._adb .Property =append (_adg ._adb .Property ,_aecd );}else if _bag {_aecd .FmtidAttr =_dcf ._eagg .FmtidAttr ;if _dcf ._eagg .PidAttr ==0{_aecd .PidAttr =_dcf ._eagg .PidAttr ;};_aecd .LinkTargetAttr =_dcf ._eagg .LinkTargetAttr ;*_dcf ._eagg =*_aecd ;};};
|
||||
|
||||
// GetTargetByRelId returns a target path with the associated relation ID.
|
||||
func (_gcae Relationships )GetTargetByRelId (idAttr string )string {for _ ,_feaa :=range _gcae ._dedb .Relationship {if _feaa .IdAttr ==idAttr {return _feaa .TargetAttr ;};};return "";};var _ddca =_bd .New ("\u0069\u006d\u0061\u0067\u0065\u0020\u006e\u006f\u0074\u0020\u0066o\u0075\u006e\u0064\u0020\u0069\u006e\u0020\u0073\u0074\u006fr\u0061\u0067\u0065");
|
||||
// Application returns the name of the application that created the document.
|
||||
// For unioffice created documents, it defaults to github.com/unidoc/unioffice
|
||||
func (_ceb AppProperties )Application ()string {if _ceb ._ad .Application !=nil {return *_ceb ._ad .Application ;};return "";};
|
||||
|
||||
// NewCoreProperties constructs a new CoreProperties.
|
||||
func NewCoreProperties ()CoreProperties {return CoreProperties {_bfg :_df .NewCoreProperties ()}};
|
||||
// ImageRef is a reference to an image within a document.
|
||||
type ImageRef struct{_dde *DocBase ;_aegd Relationships ;_ccfb Image ;_ffa string ;_bgg string ;};
|
||||
|
||||
// NewContentTypes returns a wrapper around a newly constructed content-types.
|
||||
func NewContentTypes ()ContentTypes {_bbg :=ContentTypes {_aaa :_bb .NewTypes ()};_bbg .AddDefault ("\u0078\u006d\u006c","\u0061p\u0070l\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u0078\u006d\u006c");_bbg .AddDefault ("\u0072\u0065\u006c\u0073","\u0061\u0070\u0070\u006c\u0069\u0063a\u0074\u0069\u006fn\u002f\u0076\u006ed\u002e\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006fr\u006d\u0061\u0074\u0073\u002dpa\u0063\u006b\u0061\u0067\u0065\u002e\u0072\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073\u002b\u0078\u006d\u006c");_bbg .AddDefault ("\u0070\u006e\u0067","\u0069m\u0061\u0067\u0065\u002f\u0070\u006eg");_bbg .AddDefault ("\u006a\u0070\u0065\u0067","\u0069\u006d\u0061\u0067\u0065\u002f\u006a\u0070\u0065\u0067");_bbg .AddDefault ("\u006a\u0070\u0067","\u0069m\u0061\u0067\u0065\u002f\u006a\u0070g");_bbg .AddDefault ("\u0077\u006d\u0066","i\u006d\u0061\u0067\u0065\u002f\u0078\u002d\u0077\u006d\u0066");_bbg .AddOverride ("\u002fd\u006fc\u0050\u0072\u006f\u0070\u0073/\u0063\u006fr\u0065\u002e\u0078\u006d\u006c","\u0061\u0070\u0070\u006c\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u0076\u006e\u0064\u002e\u006f\u0070\u0065\u006ex\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073-\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002e\u0063\u006f\u0072\u0065\u002dp\u0072\u006f\u0070\u0065\u0072\u0074i\u0065\u0073\u002bx\u006d\u006c");_bbg .AddOverride ("\u002f\u0064\u006f\u0063\u0050\u0072\u006f\u0070\u0073\u002f\u0061\u0070p\u002e\u0078\u006d\u006c","a\u0070\u0070l\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u0076\u006e\u0064\u002e\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066o\u0072\u006d\u0061\u0074\u0073\u002d\u006f\u0066\u0066\u0069\u0063\u0065\u0064\u006f\u0063\u0075m\u0065\u006e\u0074\u002e\u0065\u0078\u0074\u0065\u006e\u0064\u0065\u0064\u002dp\u0072\u006f\u0070\u0065\u0072\u0074\u0069\u0065\u0073\u002b\u0078m\u006c");return _bbg ;};
|
||||
|
||||
// SetHeight sets row height, see measurement package.
|
||||
func (_cecc TableRow )SetHeight (m _ddf .Distance ){_fbfc :=_ddf .ToEMU (float64 (m ));_cecc ._gcec .HAttr =_gc .ST_Coordinate {ST_CoordinateUnqualified :&_fbfc };};
|
||||
func (_acee TableRow )SetHeight (m _acg .Distance ){_fgec :=_acg .ToEMU (float64 (m ));_acee ._cbc .HAttr =_b .ST_Coordinate {ST_CoordinateUnqualified :&_fgec };};
|
||||
|
||||
// Append appends DocBase part of an office document to another DocBase.
|
||||
func (_e DocBase )Append (docBase1 DocBase )DocBase {_da :=docBase1 .ContentTypes .X ();for _ ,_ab :=range _da .Default {_e .ContentTypes .AddDefault (_ab .ExtensionAttr ,_ab .ContentTypeAttr );};for _ ,_bg :=range _da .Override {_e .ContentTypes .AddOverride (_bg .PartNameAttr ,_bg .ContentTypeAttr );};_agb :=_e .AppProperties .X ();_bbe :=docBase1 .AppProperties .X ();if _agb .Pages !=nil {if _bbe .Pages !=nil {*_agb .Pages +=*_bbe .Pages ;};}else if _bbe .Pages !=nil {_agb .Pages =_bbe .Pages ;};if _agb .Words !=nil {if _bbe .Words !=nil {*_agb .Words +=*_bbe .Words ;};}else if _bbe .Words !=nil {_agb .Words =_bbe .Words ;};if _agb .Characters !=nil {if _bbe .Characters !=nil {*_agb .Characters +=*_bbe .Characters ;};}else if _bbe .Characters !=nil {_agb .Characters =_bbe .Characters ;};if _agb .Lines !=nil {if _bbe .Lines !=nil {*_agb .Lines +=*_bbe .Lines ;};}else if _bbe .Lines !=nil {_agb .Lines =_bbe .Lines ;};if _agb .Paragraphs !=nil {if _bbe .Paragraphs !=nil {*_agb .Paragraphs +=*_bbe .Paragraphs ;};}else if _bbe .Paragraphs !=nil {_agb .Paragraphs =_bbe .Paragraphs ;};if _agb .Notes !=nil {if _bbe .Notes !=nil {*_agb .Notes +=*_bbe .Notes ;};}else if _bbe .Notes !=nil {_agb .Notes =_bbe .Notes ;};if _agb .HiddenSlides !=nil {if _bbe .HiddenSlides !=nil {*_agb .HiddenSlides +=*_bbe .HiddenSlides ;};}else if _bbe .HiddenSlides !=nil {_agb .HiddenSlides =_bbe .HiddenSlides ;};if _agb .MMClips !=nil {if _bbe .MMClips !=nil {*_agb .MMClips +=*_bbe .MMClips ;};}else if _bbe .MMClips !=nil {_agb .MMClips =_bbe .MMClips ;};if _agb .LinksUpToDate !=nil {if _bbe .LinksUpToDate !=nil {*_agb .LinksUpToDate =*_agb .LinksUpToDate &&*_bbe .LinksUpToDate ;};}else if _bbe .LinksUpToDate !=nil {_agb .LinksUpToDate =_bbe .LinksUpToDate ;};if _agb .CharactersWithSpaces !=nil {if _bbe .CharactersWithSpaces !=nil {*_agb .CharactersWithSpaces +=*_bbe .CharactersWithSpaces ;};}else if _bbe .CharactersWithSpaces !=nil {_agb .CharactersWithSpaces =_bbe .CharactersWithSpaces ;};if _agb .SharedDoc !=nil {if _bbe .SharedDoc !=nil {*_agb .SharedDoc =*_agb .SharedDoc ||*_bbe .SharedDoc ;};}else if _bbe .SharedDoc !=nil {_agb .SharedDoc =_bbe .SharedDoc ;};if _agb .HyperlinksChanged !=nil {if _bbe .HyperlinksChanged !=nil {*_agb .HyperlinksChanged =*_agb .HyperlinksChanged ||*_bbe .HyperlinksChanged ;};}else if _bbe .HyperlinksChanged !=nil {_agb .HyperlinksChanged =_bbe .HyperlinksChanged ;};_agb .DigSig =nil ;if _agb .TitlesOfParts ==nil &&_bbe .TitlesOfParts !=nil {_agb .TitlesOfParts =_bbe .TitlesOfParts ;};if _agb .HeadingPairs !=nil {if _bbe .HeadingPairs !=nil {_dad :=_agb .HeadingPairs .Vector ;_cd :=_bbe .HeadingPairs .Vector ;_fc :=_dad .Variant ;_gcb :=_cd .Variant ;_dfd :=[]*_de .Variant {};for _fb :=0;_fb < len (_gcb );_fb +=2{_gge :=_gcb [_fb ].Lpstr ;_bc :=false ;for _def :=0;_def < len (_fc );_def +=2{_fad :=_fc [_def ].Lpstr ;if _fad !=nil &&_gge !=nil &&*_fad ==*_gge {*_fc [_def +1].I4 =*_fc [_def +1].I4 +*_gcb [_fb +1].I4 ;_bc =true ;break ;};};if !_bc {_dfd =append (_dfd ,&_de .Variant {CT_Variant :_de .CT_Variant {Lpstr :_gcb [_fb ].Lpstr }});_dfd =append (_dfd ,&_de .Variant {CT_Variant :_de .CT_Variant {I4 :_gcb [_fb ].I4 }});};};_fc =append (_fc ,_dfd ...);_dad .SizeAttr =uint32 (len (_fc ));};}else if _bbe .HeadingPairs !=nil {_agb .HeadingPairs =_bbe .HeadingPairs ;};if _agb .HLinks !=nil {if _bbe .HLinks !=nil {_ded :=_agb .HLinks .Vector ;_ddc :=_bbe .HLinks .Vector ;_abf :=_ded .Variant ;_aba :=_ddc .Variant ;for _ ,_dee :=range _aba {_cdd :=true ;for _ ,_fbf :=range _abf {if _g .DeepEqual (_fbf ,_dee ){_cdd =false ;break ;};};if _cdd {_abf =append (_abf ,_dee );_ded .SizeAttr ++;};};};}else if _bbe .HLinks !=nil {_agb .HLinks =_bbe .HLinks ;};_ba :=_e .GetOrCreateCustomProperties ();_ga :=docBase1 .GetOrCreateCustomProperties ();for _ ,_ac :=range _ga .PropertiesList (){_ba .setProperty (_ac );};_e .CustomProperties =_ba ;_abg :=_e .Rels .X ().Relationship ;for _ ,_bf :=range docBase1 .Rels .X ().Relationship {_cb :=true ;for _ ,_ae :=range _abg {if _ae .TargetAttr ==_bf .TargetAttr &&_ae .TypeAttr ==_bf .TypeAttr {_cb =false ;break ;};};if _cb {_e .Rels .AddRelationship (_bf .TargetAttr ,_bf .TypeAttr );};};for _ ,_ggc :=range docBase1 .ExtraFiles {_dbe :=_ggc .ZipPath ;_be :=true ;for _ ,_agd :=range _e .ExtraFiles {if _agd .ZipPath ==_dbe {_be =false ;break ;};};if _be {_e .ExtraFiles =append (_e .ExtraFiles ,_ggc );};};return _e ;};
|
||||
|
||||
// CoreProperties contains document specific properties.
|
||||
type CoreProperties struct{_bfg *_df .CoreProperties };
|
||||
|
||||
// Pages returns total number of pages which are saved by the text editor which produced the document.
|
||||
// For unioffice created documents, it is 0.
|
||||
func (_cbg AppProperties )Pages ()int32 {if _cbg ._bff .Pages !=nil {return *_cbg ._bff .Pages ;};return 0;};
|
||||
|
||||
// Cells returns an array of row cells.
|
||||
func (_bfd TableRow )Cells ()[]*_gc .CT_TableCell {return _bfd ._gcec .Tc };
|
||||
|
||||
// NewTheme constructs a new theme.
|
||||
func NewTheme ()Theme {return Theme {_gc .NewTheme ()}};
|
||||
|
||||
// SetCategory records the category of the document.
|
||||
func (_bee CoreProperties )SetCategory (s string ){_bee ._bfg .Category =&s };func (_cbgc CustomProperties )SetPropertyAsOstream (name string ,ostream string ){_egf :=_cbgc .getNewProperty (name );_egf .Ostream =&ostream ;_cbgc .setOrReplaceProperty (_egf );};
|
||||
|
||||
// TableStyles contains document specific properties.
|
||||
type TableStyles struct{_egfa *_gc .TblStyleLst };
|
||||
|
||||
// EnsureDefault esnures that an extension and default content type exist,
|
||||
// adding it if necessary.
|
||||
func (_dbb ContentTypes )EnsureDefault (ext ,contentType string ){ext =_cf .ToLower (ext );for _ ,_ee :=range _dbb ._ffb .Default {if _ee .ExtensionAttr ==ext {_ee .ContentTypeAttr =contentType ;return ;};};_fff :=&_gde .Default {};_fff .ContentTypeAttr =contentType ;_fff .ExtensionAttr =ext ;_dbb ._ffb .Default =append (_dbb ._ffb .Default ,_fff );};
|
||||
|
||||
// WriteExtraFiles writes the extra files to the zip package.
|
||||
func (_gae *DocBase )WriteExtraFiles (z *_c .Writer )error {for _ ,_fae :=range _gae .ExtraFiles {if _abc :=_fag .AddFileFromDisk (z ,_fae .ZipPath ,_fae .DiskPath );_abc !=nil {return _abc ;};};return nil ;};
|
||||
|
||||
// Hyperlink is just an appropriately configured relationship.
|
||||
type Hyperlink Relationship ;
|
||||
|
||||
// ContentTypes is the top level "[Content_Types].xml" in a zip package.
|
||||
type ContentTypes struct{_ffb *_gde .Types };
|
||||
// TableRow represents a row in a table.
|
||||
type TableRow struct{_cbc *_b .CT_TableRow };
|
||||
|
||||
// Company returns the name of the company that created the document.
|
||||
// For unioffice created documents, it defaults to github.com/unidoc/unioffice
|
||||
func (_eag AppProperties )Company ()string {if _eag ._bff .Company !=nil {return *_eag ._bff .Company ;};return "";};
|
||||
func (_ga AppProperties )Company ()string {if _ga ._ad .Company !=nil {return *_ga ._ad .Company ;};return "";};const _gdf ="2\u00300\u0036\u002d\u0030\u0031\u002d\u0030\u0032\u00541\u0035\u003a\u0030\u0034:0\u0035\u005a";func (_efef CustomProperties )SetPropertyAsBstr (name string ,bstr string ){_cdfc :=_efef .getNewProperty (name );_cdfc .Bstr =&bstr ;_efef .setOrReplaceProperty (_cdfc );};func (_cddfb CustomProperties )SetPropertyAsLpwstr (name string ,lpwstr string ){_egg :=_cddfb .getNewProperty (name );_egg .Lpwstr =&lpwstr ;_cddfb .setOrReplaceProperty (_egg );};
|
||||
|
||||
// X returns the inner wrapped XML type of CustomProperty.
|
||||
func (_cde CustomProperty )X ()*_cfb .CT_Property {return _cde ._fcd };func _afb (_dgaa _dd .Time ,_abgd string )*_bbb .XSDAny {_adc :=&_bbb .XSDAny {XMLName :_f .Name {Local :_abgd }};_adc .Attrs =append (_adc .Attrs ,_f .Attr {Name :_f .Name {Local :"\u0078\u0073\u0069\u003a\u0074\u0079\u0070\u0065"},Value :"\u0064\u0063\u0074\u0065\u0072\u006d\u0073\u003a\u00573\u0043\u0044\u0054\u0046"});_adc .Attrs =append (_adc .Attrs ,_f .Attr {Name :_f .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u0078\u0073i"},Value :"\u0068\u0074\u0074\u0070\u003a/\u002f\u0077\u0077\u0077\u002e\u0077\u0033\u002e\u006f\u0072\u0067\u002f\u00320\u0030\u0031\u002f\u0058\u004d\u004c\u0053\u0063\u0068\u0065\u006d\u0061\u002d\u0069\u006e\u0073\u0074\u0061\u006e\u0063\u0065"});_adc .Attrs =append (_adc .Attrs ,_f .Attr {Name :_f .Name {Local :"\u0078\u006d\u006c\u006e\u0073\u003a\u0064\u0063\u0074\u0065\u0072\u006d\u0073"},Value :"\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/"});_adc .Data =[]byte (_dgaa .Format (_aeb ));return _adc ;};
|
||||
// Description returns the description of the document
|
||||
func (_bga CoreProperties )Description ()string {if _bga ._ecb .Description !=nil {return string (_bga ._ecb .Description .Data );};return "";};
|
||||
|
||||
// NewAppProperties constructs a new AppProperties.
|
||||
func NewAppProperties ()AppProperties {_cbc :=AppProperties {_bff :_fd .NewProperties ()};_cbc .SetCompany ("\u0046\u006f\u0078\u0079\u0055\u0074\u0069\u006c\u0073\u0020\u0065\u0068\u0066");_cbc .SetApplication ("g\u0069\u0074\u0068\u0075\u0062\u002ec\u006f\u006d\u002f\u0075\u006e\u0069\u0064\u006f\u0063/\u0075\u006e\u0069o\u0066f\u0069\u0063\u0065");_cbc .SetDocSecurity (0);_cbc .SetLinksUpToDate (false );var _dcg ,_gga ,_gcd int64 ;_ce .Sscanf (Version ,"\u0025\u0064\u002e\u0025\u0064\u002e\u0025\u0064",&_dcg ,&_gga ,&_gcd );_gcg :=float64 (_dcg )+float64 (_gga )/10000.0;_cbc .SetApplicationVersion (_ce .Sprintf ("\u0025\u0030\u0037\u002e\u0034\u0066",_gcg ));return _cbc ;};
|
||||
|
||||
// ContentStatus returns the content status of the document (e.g. "Final", "Draft")
|
||||
func (_eeb CoreProperties )ContentStatus ()string {if _eeb ._bfg .ContentStatus !=nil {return *_eeb ._bfg .ContentStatus ;};return "";};
|
||||
// Pages returns total number of pages which are saved by the text editor which produced the document.
|
||||
// For unioffice created documents, it is 0.
|
||||
func (_cff AppProperties )Pages ()int32 {if _cff ._ad .Pages !=nil {return *_cff ._ad .Pages ;};return 0;};
|
||||
|
||||
// Target returns the target attrubute of the image reference (a path where the image file is located in the document structure).
|
||||
func (_dcae *ImageRef )Target ()string {return _dcae ._fcag };
|
||||
func (_dcfa *ImageRef )Target ()string {return _dcfa ._bgg };
|
||||
|
||||
// GetImageBytesByTarget returns Image object with Data bytes read from its target.
|
||||
func (_dcb *DocBase )GetImageBytesByTarget (target string )(Image ,error ){if target !=""{target ="\u0077\u006f\u0072d\u002f"+target ;for _ ,_ggf :=range _dcb .Images {if _ggf .Target ()==target {return ImageFromStorage (_ggf .Path ());};};};return Image {},_aga ;};
|
||||
|
||||
// FindRIDForN returns the relationship ID for the i'th relationship of type t.
|
||||
func (_fad Relationships )FindRIDForN (i int ,t string )string {for _ ,_ebc :=range _fad ._fcec .CT_Relationships .Relationship {if _ebc .TypeAttr ==t {if i ==0{return _ebc .IdAttr ;};i --;};};return "";};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_gdff Table )X ()*_b .Tbl {return _gdff ._bbce };
|
||||
|
||||
// SetApplication sets the name of the application that created the document.
|
||||
func (_cdd AppProperties )SetApplication (s string ){_cdd ._ad .Application =&s };func (_fc CustomProperties )SetPropertyAsArray (name string ,array *_ac .Array ){_bde :=_fc .getNewProperty (name );_bde .Array =array ;_fc .setOrReplaceProperty (_bde );};
|
||||
|
||||
// EnsureDefault esnures that an extension and default content type exist,
|
||||
// adding it if necessary.
|
||||
func (_ed ContentTypes )EnsureDefault (ext ,contentType string ){ext =_a .ToLower (ext );for _ ,_feca :=range _ed ._aaa .Default {if _feca .ExtensionAttr ==ext {_feca .ContentTypeAttr =contentType ;return ;};};_efgc :=&_bb .Default {};_efgc .ContentTypeAttr =contentType ;_efgc .ExtensionAttr =ext ;_ed ._aaa .Default =append (_ed ._aaa .Default ,_efgc );};
|
||||
|
||||
// SetTarget set the target (path) of a relationship.
|
||||
func (_agf Relationship )SetTarget (s string ){_agf ._eae .TargetAttr =s };func (_bagb CustomProperties )SetPropertyAsR4 (name string ,r4 float32 ){_gcf :=_bagb .getNewProperty (name );_gcf .R4 =&r4 ;_bagb .setOrReplaceProperty (_gcf );};
|
||||
|
||||
// AppProperties contains properties specific to the document and the
|
||||
// application that created it.
|
||||
type AppProperties struct{_ad *_ab .Properties };func (_efba CustomProperties )SetPropertyAsStorage (name string ,storage string ){_aaea :=_efba .getNewProperty (name );_aaea .Storage =&storage ;_efba .setOrReplaceProperty (_aaea );};func (_bdd TableRow )addCell ()*_b .CT_TableCell {_gddc :=_b .NewCT_TableCell ();_bdd ._cbc .Tc =append (_bdd ._cbc .Tc ,_gddc );return _gddc ;};
|
||||
|
||||
// AddRelationship adds a relationship.
|
||||
func (_fcd Relationships )AddRelationship (target ,ctype string )Relationship {if !_a .HasPrefix (ctype ,"\u0068t\u0074\u0070\u003a\u002f\u002f"){_eg .Log ("\u0072\u0065\u006c\u0061\u0074\u0069\u006f\u006es\u0068\u0069\u0070 t\u0079\u0070\u0065\u0020\u0025\u0073 \u0073\u0068\u006f\u0075\u006c\u0064\u0020\u0073\u0074\u0061\u0072\u0074\u0020\u0077\u0069t\u0068\u0020\u0027\u0068\u0074\u0074\u0070\u003a/\u002f\u0027",ctype );};_ecdf :=_df .NewRelationship ();_dfe :=len (_fcd ._fcec .Relationship )+1;_dfa :=map[string ]struct{}{};for _ ,_ddf :=range _fcd ._fcec .Relationship {_dfa [_ddf .IdAttr ]=struct{}{};};for _ ,_dgd :=_dfa [_dc .Sprintf ("\u0072\u0049\u0064%\u0064",_dfe )];_dgd ;_ ,_dgd =_dfa [_dc .Sprintf ("\u0072\u0049\u0064%\u0064",_dfe )]{_dfe ++;};_ecdf .IdAttr =_dc .Sprintf ("\u0072\u0049\u0064%\u0064",_dfe );_ecdf .TargetAttr =target ;_ecdf .TypeAttr =ctype ;_fcd ._fcec .Relationship =append (_fcd ._fcec .Relationship ,_ecdf );return Relationship {_eae :_ecdf };};
|
||||
|
||||
// Relationships returns a slice of all of the relationships.
|
||||
func (_ccce Relationships )Relationships ()[]Relationship {_fbca :=[]Relationship {};for _ ,_edcd :=range _ccce ._fcec .Relationship {_fbca =append (_fbca ,Relationship {_eae :_edcd });};return _fbca ;};
|
||||
|
||||
// AddImageToZip adds an image (either from bytes or from disk) and adds it to the zip file.
|
||||
func AddImageToZip (z *_cd .Writer ,img ImageRef ,imageNum int ,dt _eg .DocType )error {_cga :=_eg .AbsoluteImageFilename (dt ,imageNum ,_a .ToLower (img .Format ()));if img .Data ()!=nil &&len (*img .Data ())> 0{if _bea :=_gg .AddFileFromBytes (z ,_cga ,*img .Data ());_bea !=nil {return _bea ;};}else if img .Path ()!=""{if _badf :=_gg .AddFileFromDisk (z ,_cga ,img .Path ());_badf !=nil {return _badf ;};}else {return _dc .Errorf ("\u0075\u006es\u0075\u0070\u0070\u006f\u0072\u0074\u0065\u0064\u0020\u0069\u006d\u0061\u0067\u0065\u0020\u0073\u006f\u0075\u0072\u0063\u0065\u003a %\u002b\u0076",img );};return nil ;};func UtcTimeFormat (t _ffc .Time )string {return t .Format (_bbfg )+"\u0020\u0055\u0054\u0043"};
|
||||
|
||||
// Relationships represents a .rels file.
|
||||
type Relationships struct{_fcec *_df .Relationships };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_fae TableStyles )X ()*_b .TblStyleLst {return _fae ._abbg };
|
||||
|
||||
// DefAttr returns the DefAttr property.
|
||||
func (_gbf TableStyles )DefAttr ()string {return _gbf ._abbg .DefAttr };
|
||||
|
||||
// Target returns the target (path) of a relationship.
|
||||
func (_gbd Relationship )Target ()string {return _gbd ._eae .TargetAttr };
|
||||
|
||||
// Remove removes an existing relationship.
|
||||
func (_degd Relationships )Remove (rel Relationship )bool {for _cdbg ,_gbc :=range _degd ._fcec .Relationship {if _gbc ==rel ._eae {copy (_degd ._fcec .Relationship [_cdbg :],_degd ._fcec .Relationship [_cdbg +1:]);_degd ._fcec .Relationship =_degd ._fcec .Relationship [0:len (_degd ._fcec .Relationship )-1];return true ;};};return false ;};
|
||||
|
||||
// Type returns the type of a relationship.
|
||||
func (_efbb Relationship )Type ()string {return _efbb ._eae .TypeAttr };
|
||||
|
||||
// Modified returns the time that the document was modified.
|
||||
func (_fdf CoreProperties )Modified ()_ffc .Time {return _fbc (_fdf ._ecb .Modified )};
|
||||
|
||||
// ContentTypes is the top level "[Content_Types].xml" in a zip package.
|
||||
type ContentTypes struct{_aaa *_bb .Types };func (_ccc CustomProperties )SetPropertyAsI4 (name string ,i4 int32 ){_bdaf :=_ccc .getNewProperty (name );_bdaf .I4 =&i4 ;_ccc .setOrReplaceProperty (_bdaf );};
|
||||
|
||||
// AddAutoRelationship adds a relationship with an automatically generated
|
||||
// filename based off of the type. It should be preferred over AddRelationship
|
||||
// to ensure consistent filenames are maintained.
|
||||
func (_bffb Relationships )AddAutoRelationship (dt _bbb .DocType ,src string ,idx int ,ctype string )Relationship {return _bffb .AddRelationship (_bbb .RelativeFilename (dt ,src ,ctype ,idx ),ctype );};func (_fdb CustomProperties )SetPropertyAsNull (name string ){_cag :=_fdb .getNewProperty (name );_cag .Null =_de .NewNull ();_fdb .setOrReplaceProperty (_cag );};func (_gfaa CustomProperties )SetPropertyAsBool (name string ,b bool ){_gbf :=_gfaa .getNewProperty (name );_gbf .Bool =&b ;_gfaa .setOrReplaceProperty (_gbf );};
|
||||
func (_cggc Relationships )AddAutoRelationship (dt _eg .DocType ,src string ,idx int ,ctype string )Relationship {return _cggc .AddRelationship (_eg .RelativeFilename (dt ,src ,ctype ,idx ),ctype );};
|
||||
|
||||
// Theme is a drawingml theme.
|
||||
type Theme struct{_gafg *_gc .Theme };const _edg =30;func (_gcgb Relationship )String ()string {return _ce .Sprintf ("\u007b\u0049\u0044\u003a \u0025\u0073\u0020\u0054\u0061\u0072\u0067\u0065\u0074\u003a \u0025s\u0020\u0054\u0079\u0070\u0065\u003a\u0020%\u0073\u007d",_gcgb .ID (),_gcgb .Target (),_gcgb .Type ());};
|
||||
|
||||
// SetLanguage records the language of the document.
|
||||
func (_bbed CoreProperties )SetLanguage (s string ){_bbed ._bfg .Language =&_bbb .XSDAny {XMLName :_f .Name {Local :"d\u0063\u003a\u006c\u0061\u006e\u0067\u0075\u0061\u0067\u0065"}};_bbed ._bfg .Language .Data =[]byte (s );};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_gage CustomProperties )X ()*_cfb .Properties {return _gage ._faf };
|
||||
|
||||
// Remove removes an existing relationship.
|
||||
func (_cadd Relationships )Remove (rel Relationship )bool {for _abfbe ,_eaag :=range _cadd ._dedb .Relationship {if _eaag ==rel ._bdcd {copy (_cadd ._dedb .Relationship [_abfbe :],_cadd ._dedb .Relationship [_abfbe +1:]);_cadd ._dedb .Relationship =_cadd ._dedb .Relationship [0:len (_cadd ._dedb .Relationship )-1];return true ;};};return false ;};
|
||||
// MakeImageRef constructs an image reference which is a reference to a
|
||||
// particular image file inside a document. The same image can be used multiple
|
||||
// times in a document by re-use the ImageRef.
|
||||
func MakeImageRef (img Image ,d *DocBase ,rels Relationships )ImageRef {return ImageRef {_ccfb :img ,_dde :d ,_aegd :rels };};func (_eaa CustomProperties )SetPropertyAsStream (name string ,stream string ){_efed :=_eaa .getNewProperty (name );_efed .Stream =&stream ;_eaa .setOrReplaceProperty (_efed );};
|
||||
|
||||
// Title returns the Title of the document
|
||||
func (_cdf CoreProperties )Title ()string {if _cdf ._bfg .Title !=nil {return string (_cdf ._bfg .Title .Data );};return "";};func (_ggd CustomProperties )SetPropertyAsBstr (name string ,bstr string ){_bef :=_ggd .getNewProperty (name );_bef .Bstr =&bstr ;_ggd .setOrReplaceProperty (_bef );};
|
||||
|
||||
// SetCreated sets the time that the document was created.
|
||||
func (_feed CoreProperties )SetCreated (t _dd .Time ){_feed ._bfg .Created =_afb (t ,"\u0064c\u0074e\u0072\u006d\u0073\u003a\u0063\u0072\u0065\u0061\u0074\u0065\u0064");};
|
||||
|
||||
// TblStyle returns the TblStyle property.
|
||||
func (_ced TableStyles )TblStyle ()[]*_gc .CT_TableStyle {return _ced ._egfa .TblStyle };
|
||||
|
||||
// CustomProperties contains document specific properties.
|
||||
type CustomProperties struct{_faf *_cfb .Properties };func (_cad CustomProperties )SetPropertyAsDecimal (name string ,decimal float64 ){_fged :=_cad .getNewProperty (name );_fged .Decimal =&decimal ;_cad .setOrReplaceProperty (_fged );};
|
||||
|
||||
// Type returns the type of a relationship.
|
||||
func (_agde Relationship )Type ()string {return _agde ._bdcd .TypeAttr };
|
||||
|
||||
// AddRow adds a row to a table.
|
||||
func (_bcb Table )AddRow ()*TableRow {_daff :=_gc .NewCT_TableRow ();for _cacb :=0;_cacb < len (_bcb ._efcc .TblGrid .GridCol );_cacb ++{_daff .Tc =append (_daff .Tc ,_gc .NewCT_TableCell ());};_bcb ._efcc .Tr =append (_bcb ._efcc .Tr ,_daff );return &TableRow {_gcec :_daff };};func init (){_fg .SetAsStorage ()};
|
||||
|
||||
// ApplicationVersion returns the version of the application that created the
|
||||
// document.
|
||||
func (_ca AppProperties )ApplicationVersion ()string {if _ca ._bff .AppVersion !=nil {return *_ca ._bff .AppVersion ;};return "";};
|
||||
|
||||
// Rows returns all table rows.
|
||||
func (_cbgd Table )Rows ()[]*TableRow {_dbac :=_cbgd ._efcc .Tr ;_ddg :=[]*TableRow {};for _ ,_fbbd :=range _dbac {_ddg =append (_ddg ,&TableRow {_gcec :_fbbd });};return _ddg ;};func (_abgf CustomProperties )SetPropertyAsFiletime (name string ,filetime _dd .Time ){_bcc :=_abgf .getNewProperty (name );_bcc .Filetime =&filetime ;_abgf .setOrReplaceProperty (_bcc );};
|
||||
|
||||
// Created returns the time that the document was created.
|
||||
func (_fee CoreProperties )Created ()_dd .Time {return _af (_fee ._bfg .Created )};
|
||||
|
||||
// ImageFromBytes returns an Image struct for an in-memory image. You can also
|
||||
// construct an Image directly if the file and size are known.
|
||||
func ImageFromBytes (data []byte )(Image ,error ){_adfg :=Image {};_age ,_edd ,_gbc :=_ag .Decode (_gdd .NewReader (data ));if _gbc !=nil {return _adfg ,_ce .Errorf ("\u0075n\u0061\u0062\u006c\u0065 \u0074\u006f\u0020\u0070\u0061r\u0073e\u0020i\u006d\u0061\u0067\u0065\u003a\u0020\u0025s",_gbc );};_adfg .Data =&data ;_adfg .Format =_edd ;_adfg .Size =_age .Bounds ().Size ();return _adfg ,nil ;};
|
||||
|
||||
// DefAttr returns the DefAttr property.
|
||||
func (_cade TableStyles )DefAttr ()string {return _cade ._egfa .DefAttr };
|
||||
|
||||
// RelID returns the relationship ID.
|
||||
func (_dea ImageRef )RelID ()string {return _dea ._gec };
|
||||
|
||||
// ID returns the ID of a relationship.
|
||||
func (_ddfb Relationship )ID ()string {return _ddfb ._bdcd .IdAttr };
|
||||
|
||||
// SetModified sets the time that the document was modified.
|
||||
func (_eba CoreProperties )SetModified (t _dd .Time ){_eba ._bfg .Modified =_afb (t ,"\u0064\u0063t\u0065\u0072\u006ds\u003a\u006d\u006f\u0064\u0069\u0066\u0069\u0065\u0064");};func (_ge CustomProperties )SetPropertyAsStorage (name string ,storage string ){_abfb :=_ge .getNewProperty (name );_abfb .Storage =&storage ;_ge .setOrReplaceProperty (_abfb );};func (_ace CustomProperties )SetPropertyAsOstorage (name string ,ostorage string ){_ggaa :=_ace .getNewProperty (name );_ggaa .Ostorage =&ostorage ;_ace .setOrReplaceProperty (_ggaa );};
|
||||
|
||||
// SetContentStatus records the content status of the document.
|
||||
func (_fde CoreProperties )SetContentStatus (s string ){_fde ._bfg .ContentStatus =&s };
|
||||
|
||||
// SetLinksUpToDate sets the links up to date flag.
|
||||
func (_fba AppProperties )SetLinksUpToDate (v bool ){_fba ._bff .LinksUpToDate =_bbb .Bool (v )};
|
||||
|
||||
// SetLastModifiedBy records the last person to modify the document.
|
||||
func (_bcf CoreProperties )SetLastModifiedBy (s string ){_bcf ._bfg .LastModifiedBy =&s };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_bbede Theme )X ()*_gc .Theme {return _bbede ._gafg };
|
||||
|
||||
// SetTitle records the title of the document.
|
||||
func (_caa CoreProperties )SetTitle (s string ){if _caa ._bfg .Title ==nil {_caa ._bfg .Title =&_bbb .XSDAny {XMLName :_f .Name {Local :"\u0064\u0063\u003a\u0074\u0069\u0074\u006c\u0065"}};};_caa ._bfg .Title .Data =[]byte (s );};
|
||||
func (_acgg CoreProperties )Title ()string {if _acgg ._ecb .Title !=nil {return string (_acgg ._ecb .Title .Data );};return "";};func (_ecg CustomProperties )SetPropertyAsI1 (name string ,i1 int8 ){_cdbc :=_ecg .getNewProperty (name );_cdbc .I1 =&i1 ;_ecg .setOrReplaceProperty (_cdbc );};
|
||||
|
||||
// ImageFromFile reads an image from a file on disk. It doesn't keep the image
|
||||
// in memory and only reads it to determine the format and size. You can also
|
||||
// construct an Image directly if the file and size are known.
|
||||
// NOTE: See also ImageFromStorage.
|
||||
func ImageFromFile (path string )(Image ,error ){_gdge ,_ccb :=_gd .Open (path );_dba :=Image {};if _ccb !=nil {return _dba ,_ce .Errorf ("\u0065\u0072\u0072or\u0020\u0072\u0065\u0061\u0064\u0069\u006e\u0067\u0020\u0069\u006d\u0061\u0067\u0065\u003a\u0020\u0025\u0073",_ccb );};defer _gdge .Close ();_edb ,_ddag ,_ccb :=_ag .Decode (_gdge );if _ccb !=nil {return _dba ,_ce .Errorf ("\u0075n\u0061\u0062\u006c\u0065 \u0074\u006f\u0020\u0070\u0061r\u0073e\u0020i\u006d\u0061\u0067\u0065\u003a\u0020\u0025s",_ccb );};_dba .Path =path ;_dba .Format =_ddag ;_dba .Size =_edb .Bounds ().Size ();return _dba ,nil ;};func (_bac CustomProperties )SetPropertyAsUi8 (name string ,ui8 uint64 ){_bab :=_bac .getNewProperty (name );_bab .Ui8 =&ui8 ;_bac .setOrReplaceProperty (_bab );};
|
||||
func ImageFromFile (path string )(Image ,error ){_abg ,_bbe :=_g .Open (path );_cbda :=Image {};if _bbe !=nil {return _cbda ,_dc .Errorf ("\u0065\u0072\u0072or\u0020\u0072\u0065\u0061\u0064\u0069\u006e\u0067\u0020\u0069\u006d\u0061\u0067\u0065\u003a\u0020\u0025\u0073",_bbe );};defer _abg .Close ();_dfg ,_fdcea ,_bbe :=_de .Decode (_abg );if _bbe !=nil {return _cbda ,_dc .Errorf ("\u0075n\u0061\u0062\u006c\u0065 \u0074\u006f\u0020\u0070\u0061r\u0073e\u0020i\u006d\u0061\u0067\u0065\u003a\u0020\u0025s",_bbe );};_cbda .Path =path ;_cbda .Format =_fdcea ;_cbda .Size =_dfg .Bounds ().Size ();return _cbda ,nil ;};func (_agfe Relationship )String ()string {return _dc .Sprintf ("\u007b\u0049\u0044\u003a \u0025\u0073\u0020\u0054\u0061\u0072\u0067\u0065\u0074\u003a \u0025s\u0020\u0054\u0079\u0070\u0065\u003a\u0020%\u0073\u007d",_agfe .ID (),_agfe .Target (),_agfe .Type ());};var ReleasedAt =_ffc .Date (_bef ,_cfd ,_edbf ,_ecbe ,_eagd ,0,0,_ffc .UTC );func (_ace CustomProperties )SetPropertyAsInt (name string ,i int ){_bgaf :=_ace .getNewProperty (name );_eagb :=int32 (i );_bgaf .Int =&_eagb ;_ace .setOrReplaceProperty (_bgaf );};func (_afc CustomProperties )SetPropertyAsUi2 (name string ,ui2 uint16 ){_abbfg :=_afc .getNewProperty (name );_abbfg .Ui2 =&ui2 ;_afc .setOrReplaceProperty (_abbfg );};
|
||||
|
||||
// Application returns the name of the application that created the document.
|
||||
// For unioffice created documents, it defaults to github.com/unidoc/unioffice
|
||||
func (_gafe AppProperties )Application ()string {if _gafe ._bff .Application !=nil {return *_gafe ._bff .Application ;};return "";};func (_ade TableRow )addCell ()*_gc .CT_TableCell {_dgc :=_gc .NewCT_TableCell ();_ade ._gcec .Tc =append (_ade ._gcec .Tc ,_dgc );return _dgc ;};func (_dec CustomProperties )SetPropertyAsError (name string ,error string ){_gcdb :=_dec .getNewProperty (name );_gcdb .Error =&error ;_dec .setOrReplaceProperty (_gcdb );};const Version ="\u0031\u002e\u0031\u0033\u002e\u0030";
|
||||
// RemoveOverrideByIndex removes an override given a path and override index.
|
||||
func (_cb ContentTypes )RemoveOverrideByIndex (path string ,indexToFind int )error {_edb :=path [0:len (path )-5];if !_a .HasPrefix (_edb ,"\u002f"){_edb ="\u002f"+_edb ;};_ceec ,_gfb :=_ec .Compile (_edb +"\u0028\u005b\u0030-\u0039\u005d\u002b\u0029\u002e\u0078\u006d\u006c");if _gfb !=nil {return _gfb ;};_dec :=0;_ccfa :=-1;for _aad ,_cbb :=range _cb ._aaa .Override {if _bca :=_ceec .FindStringSubmatch (_cbb .PartNameAttr );len (_bca )> 1{if _dec ==indexToFind {_ccfa =_aad ;}else if _dec > indexToFind {_gdd ,_ :=_aa .Atoi (_bca [1]);_gdd --;_cbb .PartNameAttr =_dc .Sprintf ("\u0025\u0073\u0025\u0064\u002e\u0078\u006d\u006c",_edb ,_gdd );};_dec ++;};};if _ccfa > -1{copy (_cb ._aaa .Override [_ccfa :],_cb ._aaa .Override [_ccfa +1:]);_cb ._aaa .Override =_cb ._aaa .Override [0:len (_cb ._aaa .Override )-1];};return nil ;};
|
||||
|
||||
// RemoveOverride removes an override given a path.
|
||||
func (_cfd ContentTypes )RemoveOverride (path string ){if !_cf .HasPrefix (path ,"\u002f"){path ="\u002f"+path ;};for _ddb ,_gag :=range _cfd ._ffb .Override {if _gag .PartNameAttr ==path {copy (_cfd ._ffb .Override [_ddb :],_cfd ._ffb .Override [_ddb +1:]);_cfd ._ffb .Override =_cfd ._ffb .Override [0:len (_cfd ._ffb .Override )-1];};};};func (_ecf CustomProperties )SetPropertyAsArray (name string ,array *_de .Array ){_fgb :=_ecf .getNewProperty (name );_fgb .Array =array ;_ecf .setOrReplaceProperty (_fgb );};
|
||||
// Image is a container for image information. It's used as we need format and
|
||||
// and size information to use images.
|
||||
// It contains either the filesystem path to the image, or the image itself.
|
||||
type Image struct{Size _de .Point ;Format string ;Path string ;Data *[]byte ;};
|
||||
|
||||
// SetDocSecurity sets the document security flag.
|
||||
func (_fecb AppProperties )SetDocSecurity (v int32 ){_fecb ._ad .DocSecurity =_eg .Int32 (v )};
|
||||
|
||||
// CoreProperties contains document specific properties.
|
||||
type CoreProperties struct{_ecb *_gc .CoreProperties };
|
||||
|
||||
// SetOffsetY sets vertical offset of a table in distance units (see measurement package).
|
||||
func (_bcfb Table )SetOffsetY (offY float64 ){if _bcfb ._acag .Off ==nil {_bcfb ._acag .Off =_b .NewCT_Point2D ();_fggf :=int64 (0);_bcfb ._acag .Off .XAttr =_b .ST_Coordinate {ST_CoordinateUnqualified :&_fggf };};_agag :=_acg .ToEMU (offY );_bcfb ._acag .Off .YAttr =_b .ST_Coordinate {ST_CoordinateUnqualified :&_agag };};
|
||||
|
||||
// SetCreated sets the time that the document was created.
|
||||
func (_aee CoreProperties )SetCreated (t _ffc .Time ){_aee ._ecb .Created =_cdf (t ,"\u0064c\u0074e\u0072\u006d\u0073\u003a\u0063\u0072\u0065\u0061\u0074\u0065\u0064");};func (_fab CustomProperties )SetPropertyAsI2 (name string ,i2 int16 ){_dfd :=_fab .getNewProperty (name );_dfd .I2 =&i2 ;_fab .setOrReplaceProperty (_dfd );};func (_cfe CustomProperties )SetPropertyAsBlob (name ,blob string ){_gfe :=_cfe .getNewProperty (name );_gfe .Blob =&blob ;_cfe .setOrReplaceProperty (_gfe );};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_dfde AppProperties )X ()*_fd .Properties {return _dfde ._bff };func (_cee CustomProperties )SetPropertyAsOblob (name ,oblob string ){_eaa :=_cee .getNewProperty (name );_eaa .Oblob =&oblob ;_cee .setOrReplaceProperty (_eaa );};
|
||||
func (_bggc Theme )X ()*_b .Theme {return _bggc ._deba };
|
||||
|
||||
// SetTarget set the target (path) of a relationship.
|
||||
func (_feb Relationship )SetTarget (s string ){_feb ._bdcd .TargetAttr =s };
|
||||
// AddHyperlink adds an external hyperlink relationship.
|
||||
func (_beg Relationships )AddHyperlink (target string )Hyperlink {_edag :=_beg .AddRelationship (target ,_eg .HyperLinkType );_edag ._eae .TargetModeAttr =_df .ST_TargetModeExternal ;return Hyperlink (_edag );};
|
||||
|
||||
// Size returns the size of an image
|
||||
func (_feeg ImageRef )Size ()_ag .Point {return _feeg ._dbf .Size };
|
||||
// TblStyle returns the TblStyle property.
|
||||
func (_bbcf TableStyles )TblStyle ()[]*_b .CT_TableStyle {return _bbcf ._abbg .TblStyle };
|
||||
|
||||
// NewTableWithXfrm makes a new table with a pointer to its parent Xfrm for changing its offset and size.
|
||||
func NewTableWithXfrm (xfrm *_gc .CT_Transform2D )*Table {_ebac :=_gc .NewTbl ();_ebac .TblPr =_gc .NewCT_TableProperties ();return &Table {_efcc :_ebac ,_ggba :xfrm };};func (_aca CustomProperties )SetPropertyAsUi2 (name string ,ui2 uint16 ){_gbe :=_aca .getNewProperty (name );_gbe .Ui2 =&ui2 ;_aca .setOrReplaceProperty (_gbe );};
|
||||
// Properties returns table properties.
|
||||
func (_gdb Table )Properties ()*_b .CT_TableProperties {return _gdb ._bbce .TblPr };func (_eafb CustomProperties )SetPropertyAsDate (name string ,date _ffc .Time ){date =date .UTC ();_fdce ,_bab ,_dcda :=date .Date ();_bdef ,_fcg ,_eaff :=date .Clock ();_daf :=_ffc .Date (_fdce ,_bab ,_dcda ,_bdef ,_fcg ,_eaff ,0,_ffc .UTC );_badd :=_eafb .getNewProperty (name );_badd .Filetime =&_daf ;_eafb .setOrReplaceProperty (_badd );};
|
||||
|
||||
// Author returns the author of the document
|
||||
func (_gdgf CoreProperties )Author ()string {if _gdgf ._bfg .Creator !=nil {return string (_gdgf ._bfg .Creator .Data );};return "";};func (_acgf CustomProperties )SetPropertyAsEmpty (name string ){_daa :=_acgf .getNewProperty (name );_daa .Empty =_de .NewEmpty ();_acgf .setOrReplaceProperty (_daa );};
|
||||
// SetTitle records the title of the document.
|
||||
func (_egc CoreProperties )SetTitle (s string ){if _egc ._ecb .Title ==nil {_egc ._ecb .Title =&_eg .XSDAny {XMLName :_cda .Name {Local :"\u0064\u0063\u003a\u0074\u0069\u0074\u006c\u0065"}};};_egc ._ecb .Title .Data =[]byte (s );};func _cdf (_cde _ffc .Time ,_eag string )*_eg .XSDAny {_cbdc :=&_eg .XSDAny {XMLName :_cda .Name {Local :_eag }};_cbdc .Attrs =append (_cbdc .Attrs ,_cda .Attr {Name :_cda .Name {Local :"\u0078\u0073\u0069\u003a\u0074\u0079\u0070\u0065"},Value :"\u0064\u0063\u0074\u0065\u0072\u006d\u0073\u003a\u00573\u0043\u0044\u0054\u0046"});_cbdc .Attrs =append (_cbdc .Attrs ,_cda .Attr {Name :_cda .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u0078\u0073i"},Value :"\u0068\u0074\u0074\u0070\u003a/\u002f\u0077\u0077\u0077\u002e\u0077\u0033\u002e\u006f\u0072\u0067\u002f\u00320\u0030\u0031\u002f\u0058\u004d\u004c\u0053\u0063\u0068\u0065\u006d\u0061\u002d\u0069\u006e\u0073\u0074\u0061\u006e\u0063\u0065"});_cbdc .Attrs =append (_cbdc .Attrs ,_cda .Attr {Name :_cda .Name {Local :"\u0078\u006d\u006c\u006e\u0073\u003a\u0064\u0063\u0074\u0065\u0072\u006d\u0073"},Value :"\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/"});_cbdc .Data =[]byte (_cde .Format (_gdf ));return _cbdc ;};
|
||||
|
||||
// AddRelationship adds a relationship.
|
||||
func (_ead Relationships )AddRelationship (target ,ctype string )Relationship {if !_cf .HasPrefix (ctype ,"\u0068t\u0074\u0070\u003a\u002f\u002f"){_bbb .Log ("\u0072\u0065\u006c\u0061\u0074\u0069\u006f\u006es\u0068\u0069\u0070 t\u0079\u0070\u0065\u0020\u0025\u0073 \u0073\u0068\u006f\u0075\u006c\u0064\u0020\u0073\u0074\u0061\u0072\u0074\u0020\u0077\u0069t\u0068\u0020\u0027\u0068\u0074\u0074\u0070\u003a/\u002f\u0027",ctype );};_agda :=_fga .NewRelationship ();_fbaf :=len (_ead ._dedb .Relationship )+1;_effc :=map[string ]struct{}{};for _ ,_effe :=range _ead ._dedb .Relationship {_effc [_effe .IdAttr ]=struct{}{};};for _ ,_dgg :=_effc [_ce .Sprintf ("\u0072\u0049\u0064%\u0064",_fbaf )];_dgg ;_ ,_dgg =_effc [_ce .Sprintf ("\u0072\u0049\u0064%\u0064",_fbaf )]{_fbaf ++;};_agda .IdAttr =_ce .Sprintf ("\u0072\u0049\u0064%\u0064",_fbaf );_agda .TargetAttr =target ;_agda .TypeAttr =ctype ;_ead ._dedb .Relationship =append (_ead ._dedb .Relationship ,_agda );return Relationship {_bdcd :_agda };};
|
||||
// ID returns the ID of a relationship.
|
||||
func (_bdab Relationship )ID ()string {return _bdab ._eae .IdAttr };
|
||||
|
||||
// Relationship is a relationship within a .rels file.
|
||||
type Relationship struct{_eae *_df .Relationship };
|
||||
|
||||
// IsEmpty returns true if there are no relationships.
|
||||
func (_aebd Relationships )IsEmpty ()bool {return _aebd ._fcec ==nil ||len (_aebd ._fcec .Relationship )==0;};
|
||||
|
||||
// SetAuthor records the author of the document.
|
||||
func (_ccfac CoreProperties )SetAuthor (s string ){if _ccfac ._ecb .Creator ==nil {_ccfac ._ecb .Creator =&_eg .XSDAny {XMLName :_cda .Name {Local :"\u0064\u0063\u003a\u0063\u0072\u0065\u0061\u0074\u006f\u0072"}};};_ccfac ._ecb .Creator .Data =[]byte (s );};func (_fcf CustomProperties )SetPropertyAsLpstr (name string ,lpstr string ){_adc :=_fcf .getNewProperty (name );_adc .Lpstr =&lpstr ;_fcf .setOrReplaceProperty (_adc );};func (_eaf CustomProperties )SetPropertyAsR8 (name string ,r8 float64 ){_abf :=_eaf .getNewProperty (name );_abf .R8 =&r8 ;_eaf .setOrReplaceProperty (_abf );};const _bef =2021;
|
||||
|
||||
// SetDescription records the description of the document.
|
||||
func (_gdg CoreProperties )SetDescription (s string ){if _gdg ._ecb .Description ==nil {_gdg ._ecb .Description =&_eg .XSDAny {XMLName :_cda .Name {Local :"\u0064\u0063\u003a\u0064\u0065\u0073\u0063\u0072\u0069p\u0074\u0069\u006f\u006e"}};};_gdg ._ecb .Description .Data =[]byte (s );};
|
||||
|
||||
// SetWidth sets column width, see measurement package.
|
||||
func (_cacf TableCol )SetWidth (m _acg .Distance ){_gfc :=_acg .ToEMU (float64 (m ));_cacf ._fecba .WAttr =_b .ST_Coordinate {ST_CoordinateUnqualified :&_gfc };};
|
||||
|
||||
// Data returns the data of an image file, if any.
|
||||
func (_fbfa ImageRef )Data ()*[]byte {return _fbfa ._ccfb .Data };
|
||||
|
||||
// SetContentStatus records the content status of the document.
|
||||
func (_cgg CoreProperties )SetContentStatus (s string ){_cgg ._ecb .ContentStatus =&s };
|
||||
|
||||
// SetCategory records the category of the document.
|
||||
func (_efe CoreProperties )SetCategory (s string ){_efe ._ecb .Category =&s };
|
||||
|
||||
// GetPropertyByName returns a custom property selected by it's name.
|
||||
func (_cdab CustomProperties )GetPropertyByName (name string )CustomProperty {_ddb :=_cdab ._adb .Property ;for _ ,_ega :=range _ddb {if *_ega .NameAttr ==name {return CustomProperty {_eagg :_ega };};};return CustomProperty {};};func (_dag CustomProperties )SetPropertyAsUi8 (name string ,ui8 uint64 ){_abec :=_dag .getNewProperty (name );_abec .Ui8 =&ui8 ;_dag .setOrReplaceProperty (_abec );};
|
||||
|
||||
// PropertiesList returns the list of all custom properties of the document.
|
||||
func (_ffdf CustomProperties )PropertiesList ()[]*_ef .CT_Property {return _ffdf ._adb .Property };
|
||||
|
||||
// RelativeWidth returns the relative width of an image given a fixed height.
|
||||
// This is used when setting image to a fixed height to calculate the width
|
||||
// required to keep the same image aspect ratio.
|
||||
func (_gegg ImageRef )RelativeWidth (h _acg .Distance )_acg .Distance {_ebe :=float64 (_gegg .Size ().X )/float64 (_gegg .Size ().Y );return h *_acg .Distance (_ebe );};
|
||||
|
||||
// NewTheme constructs a new theme.
|
||||
func NewTheme ()Theme {return Theme {_b .NewTheme ()}};
|
||||
|
||||
// SetLastModifiedBy records the last person to modify the document.
|
||||
func (_ag CoreProperties )SetLastModifiedBy (s string ){_ag ._ecb .LastModifiedBy =&s };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_cdce Relationship )X ()*_df .Relationship {return _cdce ._eae };
|
||||
|
||||
// SetOffsetX sets horizontal offset of a table in distance units (see measurement package).
|
||||
func (_gea Table )SetOffsetX (offX float64 ){if _gea ._acag .Off ==nil {_gea ._acag .Off =_b .NewCT_Point2D ();_baa :=int64 (0);_gea ._acag .Off .YAttr =_b .ST_Coordinate {ST_CoordinateUnqualified :&_baa };};_ege :=_acg .ToEMU (offX );_gea ._acag .Off .XAttr =_b .ST_Coordinate {ST_CoordinateUnqualified :&_ege };};const _ecbe =15;const Version ="\u0031\u002e\u0031\u0034\u002e\u0030";
|
||||
|
||||
// Cells returns an array of row cells.
|
||||
func (_cffd TableRow )Cells ()[]*_b .CT_TableCell {return _cffd ._cbc .Tc };
|
||||
|
||||
// SetTarget changes the target attribute of the image reference (e.g. in the case of the creation of the reference or if the image which the reference is related to was moved from one location to another).
|
||||
func (_fgb *ImageRef )SetTarget (target string ){_fgb ._bgg =target };
|
||||
|
||||
// TableStyles contains document specific properties.
|
||||
type TableStyles struct{_abbg *_b .TblStyleLst };
|
||||
|
||||
// TableCol represents a column in a table.
|
||||
type TableCol struct{_fecba *_b .CT_TableCol };
|
||||
|
||||
// ContentStatus returns the content status of the document (e.g. "Final", "Draft")
|
||||
func (_cec CoreProperties )ContentStatus ()string {if _cec ._ecb .ContentStatus !=nil {return *_cec ._ecb .ContentStatus ;};return "";};const _edbf =23;func (_daef CustomProperties )SetPropertyAsError (name string ,error string ){_fgee :=_daef .getNewProperty (name );_fgee .Error =&error ;_daef .setOrReplaceProperty (_fgee );};
|
||||
|
||||
// NewCustomProperties constructs a new CustomProperties.
|
||||
func NewCustomProperties ()CustomProperties {return CustomProperties {_adb :_ef .NewProperties ()}};
|
||||
|
||||
// AddDefault registers a default content type for a given file extension.
|
||||
func (_fggd ContentTypes )AddDefault (fileExtension string ,contentType string ){fileExtension =_a .ToLower (fileExtension );for _ ,_baeg :=range _fggd ._aaa .Default {if _baeg .ExtensionAttr ==fileExtension &&_baeg .ContentTypeAttr ==contentType {return ;};};_gef :=_bb .NewDefault ();_gef .ExtensionAttr =fileExtension ;_gef .ContentTypeAttr =contentType ;_fggd ._aaa .Default =append (_fggd ._aaa .Default ,_gef );};func (_gb CustomProperties )SetPropertyAsUi4 (name string ,ui4 uint32 ){_eab :=_gb .getNewProperty (name );_eab .Ui4 =&ui4 ;_gb .setOrReplaceProperty (_eab );};
|
||||
|
||||
// Rows returns all table rows.
|
||||
func (_fbbae Table )Rows ()[]*TableRow {_cgc :=_fbbae ._bbce .Tr ;_gdfg :=[]*TableRow {};for _ ,_debd :=range _cgc {_gdfg =append (_gdfg ,&TableRow {_cbc :_debd });};return _gdfg ;};
|
||||
|
||||
// GetTargetByRelId returns a target path with the associated relation ID.
|
||||
func (_gcg Relationships )GetTargetByRelId (idAttr string )string {for _ ,_gece :=range _gcg ._fcec .Relationship {if _gece .IdAttr ==idAttr {return _gece .TargetAttr ;};};return "";};
|
||||
|
||||
// Created returns the time that the document was created.
|
||||
func (_cbd CoreProperties )Created ()_ffc .Time {return _fbc (_cbd ._ecb .Created )};const _cfd =8;func (_fdc CustomProperties )SetPropertyAsNull (name string ){_dca :=_fdc .getNewProperty (name );_dca .Null =_ac .NewNull ();_fdc .setOrReplaceProperty (_dca );};
|
||||
|
||||
// X returns the inner wrapped XML type of CustomProperty.
|
||||
func (_dae CustomProperty )X ()*_ef .CT_Property {return _dae ._eagg };func (_bfcf CustomProperties )SetPropertyAsI8 (name string ,i8 int64 ){_fbcd :=_bfcf .getNewProperty (name );_fbcd .I8 =&i8 ;_bfcf .setOrReplaceProperty (_fbcd );};
|
||||
|
||||
// Append appends DocBase part of an office document to another DocBase.
|
||||
func (_deg DocBase )Append (docBase1 DocBase )DocBase {_bf :=docBase1 .ContentTypes .X ();for _ ,_gd :=range _bf .Default {_deg .ContentTypes .AddDefault (_gd .ExtensionAttr ,_gd .ContentTypeAttr );};for _ ,_ge :=range _bf .Override {_deg .ContentTypes .AddOverride (_ge .PartNameAttr ,_ge .ContentTypeAttr );};_eb :=_deg .AppProperties .X ();_abb :=docBase1 .AppProperties .X ();if _eb .Pages !=nil {if _abb .Pages !=nil {*_eb .Pages +=*_abb .Pages ;};}else if _abb .Pages !=nil {_eb .Pages =_abb .Pages ;};if _eb .Words !=nil {if _abb .Words !=nil {*_eb .Words +=*_abb .Words ;};}else if _abb .Words !=nil {_eb .Words =_abb .Words ;};if _eb .Characters !=nil {if _abb .Characters !=nil {*_eb .Characters +=*_abb .Characters ;};}else if _abb .Characters !=nil {_eb .Characters =_abb .Characters ;};if _eb .Lines !=nil {if _abb .Lines !=nil {*_eb .Lines +=*_abb .Lines ;};}else if _abb .Lines !=nil {_eb .Lines =_abb .Lines ;};if _eb .Paragraphs !=nil {if _abb .Paragraphs !=nil {*_eb .Paragraphs +=*_abb .Paragraphs ;};}else if _abb .Paragraphs !=nil {_eb .Paragraphs =_abb .Paragraphs ;};if _eb .Notes !=nil {if _abb .Notes !=nil {*_eb .Notes +=*_abb .Notes ;};}else if _abb .Notes !=nil {_eb .Notes =_abb .Notes ;};if _eb .HiddenSlides !=nil {if _abb .HiddenSlides !=nil {*_eb .HiddenSlides +=*_abb .HiddenSlides ;};}else if _abb .HiddenSlides !=nil {_eb .HiddenSlides =_abb .HiddenSlides ;};if _eb .MMClips !=nil {if _abb .MMClips !=nil {*_eb .MMClips +=*_abb .MMClips ;};}else if _abb .MMClips !=nil {_eb .MMClips =_abb .MMClips ;};if _eb .LinksUpToDate !=nil {if _abb .LinksUpToDate !=nil {*_eb .LinksUpToDate =*_eb .LinksUpToDate &&*_abb .LinksUpToDate ;};}else if _abb .LinksUpToDate !=nil {_eb .LinksUpToDate =_abb .LinksUpToDate ;};if _eb .CharactersWithSpaces !=nil {if _abb .CharactersWithSpaces !=nil {*_eb .CharactersWithSpaces +=*_abb .CharactersWithSpaces ;};}else if _abb .CharactersWithSpaces !=nil {_eb .CharactersWithSpaces =_abb .CharactersWithSpaces ;};if _eb .SharedDoc !=nil {if _abb .SharedDoc !=nil {*_eb .SharedDoc =*_eb .SharedDoc ||*_abb .SharedDoc ;};}else if _abb .SharedDoc !=nil {_eb .SharedDoc =_abb .SharedDoc ;};if _eb .HyperlinksChanged !=nil {if _abb .HyperlinksChanged !=nil {*_eb .HyperlinksChanged =*_eb .HyperlinksChanged ||*_abb .HyperlinksChanged ;};}else if _abb .HyperlinksChanged !=nil {_eb .HyperlinksChanged =_abb .HyperlinksChanged ;};_eb .DigSig =nil ;if _eb .TitlesOfParts ==nil &&_abb .TitlesOfParts !=nil {_eb .TitlesOfParts =_abb .TitlesOfParts ;};if _eb .HeadingPairs !=nil {if _abb .HeadingPairs !=nil {_abe :=_eb .HeadingPairs .Vector ;_efb :=_abb .HeadingPairs .Vector ;_bg :=_abe .Variant ;_fec :=_efb .Variant ;_egd :=[]*_ac .Variant {};for _dg :=0;_dg < len (_fec );_dg +=2{_dce :=_fec [_dg ].Lpstr ;_fg :=false ;for _ba :=0;_ba < len (_bg );_ba +=2{_bcf :=_bg [_ba ].Lpstr ;if _bcf !=nil &&_dce !=nil &&*_bcf ==*_dce {*_bg [_ba +1].I4 =*_bg [_ba +1].I4 +*_fec [_dg +1].I4 ;_fg =true ;break ;};};if !_fg {_egd =append (_egd ,&_ac .Variant {CT_Variant :_ac .CT_Variant {Lpstr :_fec [_dg ].Lpstr }});_egd =append (_egd ,&_ac .Variant {CT_Variant :_ac .CT_Variant {I4 :_fec [_dg ].I4 }});};};_bg =append (_bg ,_egd ...);_abe .SizeAttr =uint32 (len (_bg ));};}else if _abb .HeadingPairs !=nil {_eb .HeadingPairs =_abb .HeadingPairs ;};if _eb .HLinks !=nil {if _abb .HLinks !=nil {_bce :=_eb .HLinks .Vector ;_bfc :=_abb .HLinks .Vector ;_ebf :=_bce .Variant ;_dcd :=_bfc .Variant ;for _ ,_gf :=range _dcd {_bfd :=true ;for _ ,_cf :=range _ebf {if _f .DeepEqual (_cf ,_gf ){_bfd =false ;break ;};};if _bfd {_ebf =append (_ebf ,_gf );_bce .SizeAttr ++;};};};}else if _abb .HLinks !=nil {_eb .HLinks =_abb .HLinks ;};_gfd :=_deg .GetOrCreateCustomProperties ();_ccf :=docBase1 .GetOrCreateCustomProperties ();for _ ,_fge :=range _ccf .PropertiesList (){_gfd .setProperty (_fge );};_deg .CustomProperties =_gfd ;_cca :=_deg .Rels .X ().Relationship ;for _ ,_ca :=range docBase1 .Rels .X ().Relationship {_db :=true ;for _ ,_fd :=range _cca {if _fd .TargetAttr ==_ca .TargetAttr &&_fd .TypeAttr ==_ca .TypeAttr {_db =false ;break ;};};if _db {_deg .Rels .AddRelationship (_ca .TargetAttr ,_ca .TypeAttr );};};for _ ,_bad :=range docBase1 .ExtraFiles {_ccg :=_bad .ZipPath ;_ggb :=true ;for _ ,_dbd :=range _deg .ExtraFiles {if _dbd .ZipPath ==_ccg {_ggb =false ;break ;};};if _ggb {_deg .ExtraFiles =append (_deg .ExtraFiles ,_bad );};};return _deg ;};
|
||||
|
||||
// NewTable makes a new table.
|
||||
func NewTable ()*Table {_deb :=_b .NewTbl ();_deb .TblPr =_b .NewCT_TableProperties ();return &Table {_bbce :_deb };};
|
||||
|
||||
// SetApplicationVersion sets the version of the application that created the
|
||||
// document. Per MS, the verison string mut be in the form 'XX.YYYY'.
|
||||
func (_be AppProperties )SetApplicationVersion (s string ){_be ._ad .AppVersion =&s };func init (){_ae .SetAsStorage ()};
|
||||
|
||||
// ExtraFile is an unsupported file type extracted from, or to be written to a
|
||||
// zip package
|
||||
type ExtraFile struct{ZipPath string ;DiskPath string ;};
|
||||
|
||||
// AddCol adds a column to a table.
|
||||
func (_ceac Table )AddCol ()*TableCol {_cge :=_b .NewCT_TableCol ();_ceac ._bbce .TblGrid .GridCol =append (_ceac ._bbce .TblGrid .GridCol ,_cge );for _ ,_ddcf :=range _ceac ._bbce .Tr {_fedc :=_b .NewCT_TableCell ();_ddcf .Tc =append (_ddcf .Tc ,_fedc );};return &TableCol {_fecba :_cge };};
|
||||
|
||||
// AddCustomRelationships adds relationships related to custom properties to the document.
|
||||
func (_baea *DocBase )AddCustomRelationships (){_baea .ContentTypes .AddOverride ("/\u0064o\u0063\u0050\u0072\u006f\u0070\u0073\u002f\u0063u\u0073\u0074\u006f\u006d.x\u006d\u006c","\u0061\u0070\u0070\u006c\u0069\u0063a\u0074\u0069\u006f\u006e\u002fv\u006e\u0064\u002e\u006f\u0070\u0065n\u0078\u006d\u006c\u0066\u006fr\u006d\u0061\u0074\u0073\u002d\u006f\u0066\u0066\u0069\u0063\u0065\u0064o\u0063\u0075\u006d\u0065\u006e\u0074\u002e\u0063\u0075\u0073\u0074\u006f\u006d\u002d\u0070r\u006f\u0070\u0065\u0072\u0074\u0069\u0065\u0073+\u0078\u006d\u006c");_baea .Rels .AddRelationship ("\u0064\u006f\u0063\u0050ro\u0070\u0073\u002f\u0063\u0075\u0073\u0074\u006f\u006d\u002e\u0078\u006d\u006c",_eg .CustomPropertiesType );};
|
||||
|
||||
// SetModified sets the time that the document was modified.
|
||||
func (_gec CoreProperties )SetModified (t _ffc .Time ){_gec ._ecb .Modified =_cdf (t ,"\u0064\u0063t\u0065\u0072\u006ds\u003a\u006d\u006f\u0064\u0069\u0066\u0069\u0065\u0064");};
|
||||
|
||||
// AddExtraFileFromZip is used when reading an unsupported file from an OOXML
|
||||
// file. This ensures that unsupported file content will at least round-trip
|
||||
// correctly.
|
||||
func (_cgb *DocBase )AddExtraFileFromZip (f *_cd .File )error {_ffg ,_cfg :=_gg .ExtractToDiskTmp (f ,_cgb .TmpPath );if _cfg !=nil {return _dc .Errorf ("\u0065\u0072r\u006f\u0072\u0020\u0065x\u0074\u0072a\u0063\u0074\u0069\u006e\u0067\u0020\u0075\u006es\u0075\u0070\u0070\u006f\u0072\u0074\u0065\u0064\u0020\u0066\u0069\u006ce\u003a\u0020\u0025\u0073",_cfg );};_cgb .ExtraFiles =append (_cgb .ExtraFiles ,ExtraFile {ZipPath :f .Name ,DiskPath :_ffg });return nil ;};
|
||||
|
||||
// RelID returns the relationship ID.
|
||||
func (_bgac ImageRef )RelID ()string {return _bgac ._ffa };func (_abc CustomProperties )SetPropertyAsClsid (name string ,clsid string ){_fce :=_abc .getNewProperty (name );_fce .Clsid =&clsid ;_abc .setOrReplaceProperty (_fce );};
|
||||
|
||||
// Format returns the format of the underlying image
|
||||
func (_dafc ImageRef )Format ()string {return _dafc ._ccfb .Format };func (_gbb CustomProperties )SetPropertyAsDecimal (name string ,decimal float64 ){_gff :=_gbb .getNewProperty (name );_gff .Decimal =&decimal ;_gbb .setOrReplaceProperty (_gff );};
|
||||
|
||||
// LastModifiedBy returns the name of the last person to modify the document
|
||||
func (_bbc CoreProperties )LastModifiedBy ()string {if _bbc ._ecb .LastModifiedBy !=nil {return *_bbc ._ecb .LastModifiedBy ;};return "";};const _eagd =30;
|
||||
|
||||
// CustomProperty contains document specific property.
|
||||
// Using of this type is deprecated.
|
||||
type CustomProperty struct{_eagg *_ef .CT_Property };
|
||||
|
||||
// GetOrCreateCustomProperties returns the custom properties of the document (and if they not exist yet, creating them first).
|
||||
func (_ecca *DocBase )GetOrCreateCustomProperties ()CustomProperties {if _ecca .CustomProperties .X ()==nil {_ecca .CreateCustomProperties ();};return _ecca .CustomProperties ;};
|
||||
func (_bfca *DocBase )GetOrCreateCustomProperties ()CustomProperties {if _bfca .CustomProperties .X ()==nil {_bfca .CreateCustomProperties ();};return _bfca .CustomProperties ;};
|
||||
|
||||
// Path returns the path to an image file, if any.
|
||||
func (_dagg ImageRef )Path ()string {return _dagg ._ccfb .Path };
|
||||
|
||||
// NewCoreProperties constructs a new CoreProperties.
|
||||
func NewCoreProperties ()CoreProperties {return CoreProperties {_ecb :_gc .NewCoreProperties ()}};
|
||||
|
||||
// NewTableStyles constructs a new TableStyles.
|
||||
func NewTableStyles ()TableStyles {return TableStyles {_abbg :_b .NewTblStyleLst ()}};
|
||||
|
||||
// SetCompany sets the name of the company that created the document.
|
||||
func (_fbb AppProperties )SetCompany (s string ){_fbb ._bff .Company =&s };
|
||||
func (_fbfd AppProperties )SetCompany (s string ){_fbfd ._ad .Company =&s };
|
||||
|
||||
// Hyperlink is just an appropriately configured relationship.
|
||||
type Hyperlink Relationship ;
|
||||
|
||||
// RemoveOverride removes an override given a path.
|
||||
func (_dcea ContentTypes )RemoveOverride (path string ){if !_a .HasPrefix (path ,"\u002f"){path ="\u002f"+path ;};for _bda ,_ea :=range _dcea ._aaa .Override {if _ea .PartNameAttr ==path {copy (_dcea ._aaa .Override [_bda :],_dcea ._aaa .Override [_bda +1:]);_dcea ._aaa .Override =_dcea ._aaa .Override [0:len (_dcea ._aaa .Override )-1];};};};
|
||||
|
||||
// X returns the underlying raw XML data.
|
||||
func (_ggg Relationships )X ()*_df .Relationships {return _ggg ._fcec };
|
||||
|
||||
// ImageFromBytes returns an Image struct for an in-memory image. You can also
|
||||
// construct an Image directly if the file and size are known.
|
||||
func ImageFromBytes (data []byte )(Image ,error ){_gae :=Image {};_cded ,_cdc ,_cdedd :=_de .Decode (_d .NewReader (data ));if _cdedd !=nil {return _gae ,_dc .Errorf ("\u0075n\u0061\u0062\u006c\u0065 \u0074\u006f\u0020\u0070\u0061r\u0073e\u0020i\u006d\u0061\u0067\u0065\u003a\u0020\u0025s",_cdedd );};_gae .Data =&data ;_gae .Format =_cdc ;_gae .Size =_cded .Bounds ().Size ();return _gae ,nil ;};
|
||||
|
||||
// CopyRelationship copies the relationship.
|
||||
func (_cdbe Relationships )CopyRelationship (idAttr string )(Relationship ,bool ){for _bcg :=range _cdbe ._fcec .Relationship {if _cdbe ._fcec .Relationship [_bcg ].IdAttr ==idAttr {_ddc :=*_cdbe ._fcec .Relationship [_bcg ];_dede :=len (_cdbe ._fcec .Relationship )+1;_bceg :=map[string ]struct{}{};for _ ,_cac :=range _cdbe ._fcec .Relationship {_bceg [_cac .IdAttr ]=struct{}{};};for _ ,_bec :=_bceg [_dc .Sprintf ("\u0072\u0049\u0064%\u0064",_dede )];_bec ;_ ,_bec =_bceg [_dc .Sprintf ("\u0072\u0049\u0064%\u0064",_dede )]{_dede ++;};_ddc .IdAttr =_dc .Sprintf ("\u0072\u0049\u0064%\u0064",_dede );_cdbe ._fcec .Relationship =append (_cdbe ._fcec .Relationship ,&_ddc );return Relationship {_eae :&_ddc },true ;};};return Relationship {},false ;};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_cg AppProperties )X ()*_ab .Properties {return _cg ._ad };
|
||||
|
||||
// NewAppProperties constructs a new AppProperties.
|
||||
func NewAppProperties ()AppProperties {_cee :=AppProperties {_ad :_ab .NewProperties ()};_cee .SetCompany ("\u0046\u006f\u0078\u0079\u0055\u0074\u0069\u006c\u0073\u0020\u0065\u0068\u0066");_cee .SetApplication ("g\u0069\u0074\u0068\u0075\u0062\u002ec\u006f\u006d\u002f\u0075\u006e\u0069\u0064\u006f\u0063/\u0075\u006e\u0069o\u0066f\u0069\u0063\u0065");_cee .SetDocSecurity (0);_cee .SetLinksUpToDate (false );var _fbf ,_fa ,_efg int64 ;_dc .Sscanf (Version ,"\u0025\u0064\u002e\u0025\u0064\u002e\u0025\u0064",&_fbf ,&_fa ,&_efg );_eff :=float64 (_fbf )+float64 (_fa )/10000.0;_cee .SetApplicationVersion (_dc .Sprintf ("\u0025\u0030\u0037\u002e\u0034\u0066",_eff ));return _cee ;};
|
||||
|
||||
// Author returns the author of the document
|
||||
func (_bdg CoreProperties )Author ()string {if _bdg ._ecb .Creator !=nil {return string (_bdg ._ecb .Creator .Data );};return "";};
|
||||
|
||||
// NewRelationship constructs a new relationship.
|
||||
func NewRelationship ()Relationship {return Relationship {_eae :_df .NewRelationship ()}};func (_ecd CustomProperties )SetPropertyAsUint (name string ,ui uint ){_cdde :=_ecd .getNewProperty (name );_cgf :=uint32 (ui );_cdde .Uint =&_cgf ;_ecd .setOrReplaceProperty (_cdde );};func (_edeb CustomProperties )SetPropertyAsVstream (name string ,vstream *_ac .Vstream ){_cba :=_edeb .getNewProperty (name );_cba .Vstream =vstream ;_edeb .setOrReplaceProperty (_cba );};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_cce CoreProperties )X ()*_gc .CoreProperties {return _cce ._ecb };
|
||||
|
||||
// DocBase is the type embedded in in the Document/Workbook/Presentation types
|
||||
// that contains members common to all.
|
||||
type DocBase struct{ContentTypes ContentTypes ;AppProperties AppProperties ;Rels Relationships ;CoreProperties CoreProperties ;CustomProperties CustomProperties ;Thumbnail _de .Image ;Images []ImageRef ;ExtraFiles []ExtraFile ;TmpPath string ;};func (_cddf CustomProperties )SetPropertyAsOblob (name ,oblob string ){_def :=_cddf .getNewProperty (name );_def .Oblob =&oblob ;_cddf .setOrReplaceProperty (_def );};func (_ebd CustomProperties )SetPropertyAsBool (name string ,b bool ){_dga :=_ebd .getNewProperty (name );_dga .Bool =&b ;_ebd .setOrReplaceProperty (_dga );};
|
||||
|
||||
// ApplicationVersion returns the version of the application that created the
|
||||
// document.
|
||||
func (_baf AppProperties )ApplicationVersion ()string {if _baf ._ad .AppVersion !=nil {return *_baf ._ad .AppVersion ;};return "";};
|
||||
|
||||
// Clear removes any existing relationships.
|
||||
func (_dea Relationships )Clear (){_dea ._fcec .Relationship =nil };
|
||||
|
||||
// NewRelationships creates a new relationship wrapper.
|
||||
func NewRelationships ()Relationships {return Relationships {_fcec :_df .NewRelationships ()}};
|
@ -13,32 +13,32 @@
|
||||
// are valid for the version of UniOffice used.
|
||||
package license ;import _f "github.com/unidoc/unioffice/internal/license";
|
||||
|
||||
// SetLicenseKey sets and validates the license key.
|
||||
func SetLicenseKey (content string ,customerName string )error {return _f .SetLicenseKey (content ,customerName );};
|
||||
|
||||
// GetLicenseKey returns the currently loaded license key.
|
||||
func GetLicenseKey ()*LicenseKey {return _f .GetLicenseKey ()};
|
||||
|
||||
// LegacyLicense holds the old-style unioffice license information.
|
||||
type LegacyLicense =_f .LegacyLicense ;
|
||||
|
||||
// MakeUnlicensedKey returns a default key.
|
||||
func MakeUnlicensedKey ()*LicenseKey {return _f .MakeUnlicensedKey ()};
|
||||
|
||||
// SetLegacyLicenseKey installs a legacy license code. License codes issued prior to June 2019.
|
||||
// Will be removed at some point in a future major version.
|
||||
func SetLegacyLicenseKey (s string )error {return _f .SetLegacyLicenseKey (s )};const (LicenseTierUnlicensed =_f .LicenseTierUnlicensed ;LicenseTierCommunity =_f .LicenseTierCommunity ;LicenseTierIndividual =_f .LicenseTierIndividual ;LicenseTierBusiness =_f .LicenseTierBusiness ;);
|
||||
|
||||
// SetMeteredKey sets the metered License API key required for SaaS operation.
|
||||
// Document usage is reported periodically for the product to function correctly.
|
||||
func SetMeteredKey (apiKey string )error {return _f .SetMeteredKey (apiKey )};
|
||||
|
||||
// LegacyLicenseType is the type of license
|
||||
type LegacyLicenseType =_f .LegacyLicenseType ;
|
||||
|
||||
// SetLicenseKey sets and validates the license key.
|
||||
func SetLicenseKey (content string ,customerName string )error {return _f .SetLicenseKey (content ,customerName );};const (LicenseTierUnlicensed =_f .LicenseTierUnlicensed ;LicenseTierCommunity =_f .LicenseTierCommunity ;LicenseTierIndividual =_f .LicenseTierIndividual ;LicenseTierBusiness =_f .LicenseTierBusiness ;);
|
||||
|
||||
// GetMeteredState checks the currently used metered document usage status,
|
||||
// documents used and credits available.
|
||||
func GetMeteredState ()(_f .MeteredStatus ,error ){return _f .GetMeteredState ()};
|
||||
|
||||
// GetLicenseKey returns the currently loaded license key.
|
||||
func GetLicenseKey ()*LicenseKey {return _f .GetLicenseKey ()};
|
||||
|
||||
// SetLegacyLicenseKey installs a legacy license code. License codes issued prior to June 2019.
|
||||
// Will be removed at some point in a future major version.
|
||||
func SetLegacyLicenseKey (s string )error {return _f .SetLegacyLicenseKey (s )};
|
||||
|
||||
// LicenseKey represents a loaded license key.
|
||||
type LicenseKey =_f .LicenseKey ;
|
||||
|
||||
// GetMeteredState checks the currently used metered document usage status,
|
||||
// documents used and credits available.
|
||||
func GetMeteredState ()(_f .MeteredStatus ,error ){return _f .GetMeteredState ()};
|
||||
// SetMeteredKey sets the metered License API key required for SaaS operation.
|
||||
// Document usage is reported periodically for the product to function correctly.
|
||||
func SetMeteredKey (apiKey string )error {return _f .SetMeteredKey (apiKey )};
|
@ -11,22 +11,22 @@
|
||||
|
||||
// Package diskstore implements tempStorage interface
|
||||
// by using disk as a storage
|
||||
package diskstore ;import (_de "github.com/unidoc/unioffice/common/tempstorage";_e "io/ioutil";_ec "os";_d "strings";);
|
||||
|
||||
// SetAsStorage sets temp storage as a disk storage
|
||||
func SetAsStorage (){_g :=diskStorage {};_de .SetAsStorage (&_g )};
|
||||
|
||||
// RemoveAll removes all files in the directory
|
||||
func (_a diskStorage )RemoveAll (dir string )error {if _d .HasPrefix (dir ,_ec .TempDir ()){return _ec .RemoveAll (dir );};return nil ;};
|
||||
|
||||
// TempFile creates a new temp file by calling ioutil TempFile
|
||||
func (_db diskStorage )TempFile (dir ,pattern string )(_de .File ,error ){return _e .TempFile (dir ,pattern );};
|
||||
|
||||
// TempFile creates a new temp directory by calling ioutil TempDir
|
||||
func (_df diskStorage )TempDir (pattern string )(string ,error ){return _e .TempDir ("",pattern )};type diskStorage struct{};
|
||||
|
||||
// Open opens file from disk according to a path
|
||||
func (_dc diskStorage )Open (path string )(_de .File ,error ){return _ec .Open (path )};
|
||||
package diskstore ;import (_a "github.com/unidoc/unioffice/common/tempstorage";_b "io/ioutil";_ba "os";_e "strings";);
|
||||
|
||||
// Add is not applicable in the diskstore implementation
|
||||
func (_c diskStorage )Add (path string )error {return nil };
|
||||
func (_de diskStorage )Add (path string )error {return nil };
|
||||
|
||||
// RemoveAll removes all files in the directory
|
||||
func (_f diskStorage )RemoveAll (dir string )error {if _e .HasPrefix (dir ,_ba .TempDir ()){return _ba .RemoveAll (dir );};return nil ;};type diskStorage struct{};
|
||||
|
||||
// TempFile creates a new temp directory by calling ioutil TempDir
|
||||
func (_bg diskStorage )TempDir (pattern string )(string ,error ){return _b .TempDir ("",pattern )};
|
||||
|
||||
// SetAsStorage sets temp storage as a disk storage
|
||||
func SetAsStorage (){_d :=diskStorage {};_a .SetAsStorage (&_d )};
|
||||
|
||||
// TempFile creates a new temp file by calling ioutil TempFile
|
||||
func (_eg diskStorage )TempFile (dir ,pattern string )(_a .File ,error ){return _b .TempFile (dir ,pattern );};
|
||||
|
||||
// Open opens file from disk according to a path
|
||||
func (_bf diskStorage )Open (path string )(_a .File ,error ){return _ba .Open (path )};
|
@ -11,34 +11,34 @@
|
||||
|
||||
// Package memstore implements tempStorage interface
|
||||
// by using memory as a storage
|
||||
package memstore ;import (_d "encoding/hex";_gf "errors";_c "fmt";_a "github.com/unidoc/unioffice/common/tempstorage";_f "io";_gd "io/ioutil";_g "math/rand";_b "sync";);
|
||||
|
||||
// Close is not applicable in this implementation
|
||||
func (_bdf *memFile )Close ()error {return nil };func _ceb (_ffe int )(string ,error ){_eca :=make ([]byte ,_ffe );if _ ,_ga :=_g .Read (_eca );_ga !=nil {return "",_ga ;};return _d .EncodeToString (_eca ),nil ;};type memFile struct{_cd *memDataCell ;_bd int64 ;};
|
||||
|
||||
// TempDir creates a name for a new temp directory using a pattern argument
|
||||
func (_adc *memStorage )TempDir (pattern string )(string ,error ){return _cb (pattern ),nil };type memDataCell struct{_ee string ;_cg []byte ;_ea int64 ;};
|
||||
|
||||
// RemoveAll removes all files according to the dir argument prefix
|
||||
func (_fba *memStorage )RemoveAll (dir string )error {_fba ._bb .Range (func (_bfc ,_ec interface{})bool {_fba ._bb .Delete (_bfc );return true });return nil ;};func _cb (_ab string )string {_gc ,_ :=_ceb (6);return _ab +_gc };
|
||||
|
||||
// Open returns tempstorage File object by name
|
||||
func (_af *memStorage )Open (path string )(_a .File ,error ){_deec ,_fb :=_af ._bb .Load (path );if !_fb {return nil ,_gf .New (_c .Sprintf ("\u0043\u0061\u006eno\u0074\u0020\u006f\u0070\u0065\u006e\u0020\u0074\u0068\u0065\u0020\u0066\u0069\u006c\u0065\u0020\u0025\u0073",path ));};return &memFile {_cd :_deec .(*memDataCell )},nil ;};
|
||||
|
||||
// Add reads a file from a disk and adds it to the storage
|
||||
func (_fg *memStorage )Add (path string )error {_ ,_ag :=_fg ._bb .Load (path );if _ag {return nil ;};_cdd ,_fe :=_gd .ReadFile (path );if _fe !=nil {return _fe ;};_fg ._bb .Store (path ,&memDataCell {_ee :path ,_cg :_cdd ,_ea :int64 (len (_cdd ))});return nil ;};
|
||||
|
||||
// Name returns the filename of the underlying memDataCell
|
||||
func (_ge *memFile )Name ()string {return _ge ._cd ._ee };
|
||||
|
||||
// Write writes to the end of the underlying memDataCell in order to implement Writer interface
|
||||
func (_ca *memFile )Write (p []byte )(int ,error ){_ca ._cd ._cg =append (_ca ._cd ._cg ,p ...);_ca ._cd ._ea +=int64 (len (p ));return len (p ),nil ;};
|
||||
|
||||
// Read reads from the underlying memDataCell in order to implement Reader interface
|
||||
func (_gfe *memFile )Read (p []byte )(int ,error ){_gfg :=_gfe ._bd ;_de :=_gfe ._cd ._ea ;_eg :=int64 (len (p ));if _eg > _de {_eg =_de ;p =p [:_eg ];};if _gfg >=_de {return 0,_f .EOF ;};_bf :=_gfg +_eg ;if _bf >=_de {_bf =_de ;};_dee :=copy (p ,_gfe ._cd ._cg [_gfg :_bf ]);_gfe ._bd =_bf ;return _dee ,nil ;};
|
||||
|
||||
// SetAsStorage sets temp storage as a memory storage
|
||||
func SetAsStorage (){_eb :=memStorage {_bb :_b .Map {}};_a .SetAsStorage (&_eb )};type memStorage struct{_bb _b .Map };
|
||||
package memstore ;import (_gc "encoding/hex";_f "errors";_cb "fmt";_fg "github.com/unidoc/unioffice/common/tempstorage";_cd "io";_cdc "io/ioutil";_g "math/rand";_d "sync";);
|
||||
|
||||
// TempFile creates a new empty file in the storage and returns it
|
||||
func (_ad *memStorage )TempFile (dir ,pattern string )(_a .File ,error ){_ae :=dir +"\u002f"+_cb (pattern );_dg :=&memDataCell {_ee :_ae ,_cg :[]byte {}};_ff :=&memFile {_cd :_dg };_ad ._bb .Store (_ae ,_dg );return _ff ,nil ;};
|
||||
func (_ba *memStorage )TempFile (dir ,pattern string )(_fg .File ,error ){_bcc :=dir +"\u002f"+_gea (pattern );_db :=&memDataCell {_fgd :_bcc ,_bc :[]byte {}};_af :=&memFile {_a :_db };_ba ._bb .Store (_bcc ,_db );return _af ,nil ;};
|
||||
|
||||
// Name returns the filename of the underlying memDataCell
|
||||
func (_dd *memFile )Name ()string {return _dd ._a ._fgd };func _gea (_ca string )string {_fce ,_ :=_cag (6);return _ca +_fce };
|
||||
|
||||
// Open returns tempstorage File object by name
|
||||
func (_bf *memStorage )Open (path string )(_fg .File ,error ){_be ,_cdb :=_bf ._bb .Load (path );if !_cdb {return nil ,_f .New (_cb .Sprintf ("\u0043\u0061\u006eno\u0074\u0020\u006f\u0070\u0065\u006e\u0020\u0074\u0068\u0065\u0020\u0066\u0069\u006c\u0065\u0020\u0025\u0073",path ));};return &memFile {_a :_be .(*memDataCell )},nil ;};type memStorage struct{_bb _d .Map };type memDataCell struct{_fgd string ;_bc []byte ;_gg int64 ;};
|
||||
|
||||
// TempDir creates a name for a new temp directory using a pattern argument
|
||||
func (_cf *memStorage )TempDir (pattern string )(string ,error ){return _gea (pattern ),nil };
|
||||
|
||||
// SetAsStorage sets temp storage as a memory storage
|
||||
func SetAsStorage (){_ada :=memStorage {_bb :_d .Map {}};_fg .SetAsStorage (&_ada )};func _cag (_aee int )(string ,error ){_bdb :=make ([]byte ,_aee );if _ ,_caf :=_g .Read (_bdb );_caf !=nil {return "",_caf ;};return _gc .EncodeToString (_bdb ),nil ;};
|
||||
|
||||
// RemoveAll removes all files according to the dir argument prefix
|
||||
func (_da *memStorage )RemoveAll (dir string )error {_da ._bb .Range (func (_ggb ,_de interface{})bool {_da ._bb .Delete (_ggb );return true });return nil ;};
|
||||
|
||||
// Add reads a file from a disk and adds it to the storage
|
||||
func (_df *memStorage )Add (path string )error {_ ,_bd :=_df ._bb .Load (path );if _bd {return nil ;};_ed ,_fc :=_cdc .ReadFile (path );if _fc !=nil {return _fc ;};_df ._bb .Store (path ,&memDataCell {_fgd :path ,_bc :_ed ,_gg :int64 (len (_ed ))});return nil ;};
|
||||
|
||||
// Write writes to the end of the underlying memDataCell in order to implement Writer interface
|
||||
func (_b *memFile )Write (p []byte )(int ,error ){_b ._a ._bc =append (_b ._a ._bc ,p ...);_b ._a ._gg +=int64 (len (p ));return len (p ),nil ;};
|
||||
|
||||
// Read reads from the underlying memDataCell in order to implement Reader interface
|
||||
func (_e *memFile )Read (p []byte )(int ,error ){_ce :=_e ._ae ;_gcc :=_e ._a ._gg ;_ge :=int64 (len (p ));if _ge > _gcc {_ge =_gcc ;p =p [:_ge ];};if _ce >=_gcc {return 0,_cd .EOF ;};_ad :=_ce +_ge ;if _ad >=_gcc {_ad =_gcc ;};_eg :=copy (p ,_e ._a ._bc [_ce :_ad ]);_e ._ae =_ad ;return _eg ,nil ;};
|
||||
|
||||
// Close is not applicable in this implementation
|
||||
func (_ef *memFile )Close ()error {return nil };type memFile struct{_a *memDataCell ;_ae int64 ;};
|
@ -9,26 +9,26 @@
|
||||
// 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 tempstorage ;import _g "io";
|
||||
|
||||
// TempDir creates a name for a new temp directory using a pattern argument.
|
||||
func TempDir (pattern string )(string ,error ){return _a .TempDir (pattern )};type storage interface{Open (_d string )(File ,error );TempFile (_dg ,_da string )(File ,error );TempDir (_df string )(string ,error );RemoveAll (_ce string )error ;Add (_f string )error ;};
|
||||
|
||||
// TempFile creates new empty file in the storage and returns it.
|
||||
func TempFile (dir ,pattern string )(File ,error ){return _a .TempFile (dir ,pattern )};
|
||||
package tempstorage ;import _a "io";
|
||||
|
||||
// SetAsStorage changes temporary storage to newStorage.
|
||||
func SetAsStorage (newStorage storage ){_a =newStorage };var _a storage ;
|
||||
func SetAsStorage (newStorage storage ){_ad =newStorage };
|
||||
|
||||
// RemoveAll removes all files according to the dir argument prefix.
|
||||
func RemoveAll (dir string )error {return _a .RemoveAll (dir )};
|
||||
func RemoveAll (dir string )error {return _ad .RemoveAll (dir )};
|
||||
|
||||
// TempFile creates new empty file in the storage and returns it.
|
||||
func TempFile (dir ,pattern string )(File ,error ){return _ad .TempFile (dir ,pattern )};
|
||||
|
||||
// Open returns tempstorage File object by name.
|
||||
func Open (path string )(File ,error ){return _ad .Open (path )};
|
||||
|
||||
// TempDir creates a name for a new temp directory using a pattern argument.
|
||||
func TempDir (pattern string )(string ,error ){return _ad .TempDir (pattern )};
|
||||
|
||||
// Add reads a file from a disk and adds it to the storage.
|
||||
func Add (path string )error {return _ad .Add (path )};var _ad storage ;type storage interface{Open (_g string )(File ,error );TempFile (_c ,_e string )(File ,error );TempDir (_ca string )(string ,error );RemoveAll (_b string )error ;Add (_ee string )error ;};
|
||||
|
||||
// File is a representation of a storage file
|
||||
// with Read, Write, Close and Name methods identical to os.File.
|
||||
type File interface{_g .Reader ;_g .Writer ;_g .Closer ;Name ()string ;};
|
||||
|
||||
// Open returns tempstorage File object by name.
|
||||
func Open (path string )(File ,error ){return _a .Open (path )};
|
||||
|
||||
// Add reads a file from a disk and adds it to the storage.
|
||||
func Add (path string )error {return _a .Add (path )};
|
||||
type File interface{_a .Reader ;_a .Writer ;_a .Closer ;Name ()string ;};
|
File diff suppressed because one or more lines are too long
2905
document/document.go
2905
document/document.go
File diff suppressed because one or more lines are too long
@ -9,119 +9,119 @@
|
||||
// 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 drawing ;import (_a "github.com/unidoc/unioffice";_b "github.com/unidoc/unioffice/color";_af "github.com/unidoc/unioffice/measurement";_ae "github.com/unidoc/unioffice/schema/soo/dml";);func (_c LineProperties )clearFill (){_c ._d .NoFill =nil ;_c ._d .GradFill =nil ;_c ._d .SolidFill =nil ;_c ._d .PattFill =nil ;};
|
||||
package drawing ;import (_c "github.com/unidoc/unioffice";_e "github.com/unidoc/unioffice/color";_d "github.com/unidoc/unioffice/measurement";_b "github.com/unidoc/unioffice/schema/soo/dml";);
|
||||
|
||||
// SetNumbered controls if bullets are numbered or not.
|
||||
func (_be ParagraphProperties )SetNumbered (scheme _ae .ST_TextAutonumberScheme ){if scheme ==_ae .ST_TextAutonumberSchemeUnset {_be ._aag .BuAutoNum =nil ;}else {_be ._aag .BuAutoNum =_ae .NewCT_TextAutonumberBullet ();_be ._aag .BuAutoNum .TypeAttr =scheme ;};};func (_cc ShapeProperties )clearFill (){_cc ._ea .NoFill =nil ;_cc ._ea .BlipFill =nil ;_cc ._ea .GradFill =nil ;_cc ._ea .GrpFill =nil ;_cc ._ea .SolidFill =nil ;_cc ._ea .PattFill =nil ;};func (_bc ShapeProperties )SetSolidFill (c _b .Color ){_bc .clearFill ();_bc ._ea .SolidFill =_ae .NewCT_SolidColorFillProperties ();_bc ._ea .SolidFill .SrgbClr =_ae .NewCT_SRgbColor ();_bc ._ea .SolidFill .SrgbClr .ValAttr =*c .AsRGBString ();};
|
||||
|
||||
// RunProperties controls the run properties.
|
||||
type RunProperties struct{_fa *_ae .CT_TextCharacterProperties ;};
|
||||
|
||||
// Run is a run within a paragraph.
|
||||
type Run struct{_fg *_ae .EG_TextRun };
|
||||
|
||||
// SetGeometry sets the shape type of the shape
|
||||
func (_fgg ShapeProperties )SetGeometry (g _ae .ST_ShapeType ){if _fgg ._ea .PrstGeom ==nil {_fgg ._ea .PrstGeom =_ae .NewCT_PresetGeometry2D ();};_fgg ._ea .PrstGeom .PrstAttr =g ;};
|
||||
|
||||
// SetBulletChar sets the bullet character for the paragraph.
|
||||
func (_eg ParagraphProperties )SetBulletChar (c string ){if c ==""{_eg ._aag .BuChar =nil ;}else {_eg ._aag .BuChar =_ae .NewCT_TextCharBullet ();_eg ._aag .BuChar .CharAttr =c ;};};
|
||||
|
||||
// SetSize sets the width and height of the shape.
|
||||
func (_ef ShapeProperties )SetSize (w ,h _af .Distance ){_ef .SetWidth (w );_ef .SetHeight (h )};const (LineJoinRound LineJoin =iota ;LineJoinBevel ;LineJoinMiter ;);
|
||||
|
||||
// SetHeight sets the height of the shape.
|
||||
func (_fe ShapeProperties )SetHeight (h _af .Distance ){_fe .ensureXfrm ();if _fe ._ea .Xfrm .Ext ==nil {_fe ._ea .Xfrm .Ext =_ae .NewCT_PositiveSize2D ();};_fe ._ea .Xfrm .Ext .CyAttr =int64 (h /_af .EMU );};func (_ag LineProperties )SetSolidFill (c _b .Color ){_ag .clearFill ();_ag ._d .SolidFill =_ae .NewCT_SolidColorFillProperties ();_ag ._d .SolidFill .SrgbClr =_ae .NewCT_SRgbColor ();_ag ._d .SolidFill .SrgbClr .ValAttr =*c .AsRGBString ();};
|
||||
|
||||
// MakeParagraphProperties constructs a new ParagraphProperties wrapper.
|
||||
func MakeParagraphProperties (x *_ae .CT_TextParagraphProperties )ParagraphProperties {return ParagraphProperties {x };};
|
||||
|
||||
// ParagraphProperties allows controlling paragraph properties.
|
||||
type ParagraphProperties struct{_aag *_ae .CT_TextParagraphProperties ;};
|
||||
|
||||
// SetFlipVertical controls if the shape is flipped vertically.
|
||||
func (_ac ShapeProperties )SetFlipVertical (b bool ){_ac .ensureXfrm ();if !b {_ac ._ea .Xfrm .FlipVAttr =nil ;}else {_ac ._ea .Xfrm .FlipVAttr =_a .Bool (true );};};
|
||||
|
||||
// AddBreak adds a new line break to a paragraph.
|
||||
func (_ab Paragraph )AddBreak (){_eb :=_ae .NewEG_TextRun ();_eb .Br =_ae .NewCT_TextLineBreak ();_ab ._ca .EG_TextRun =append (_ab ._ca .EG_TextRun ,_eb );};type ShapeProperties struct{_ea *_ae .CT_ShapeProperties };
|
||||
|
||||
// Properties returns the run's properties.
|
||||
func (_bde Run )Properties ()RunProperties {if _bde ._fg .R ==nil {_bde ._fg .R =_ae .NewCT_RegularTextRun ();};if _bde ._fg .R .RPr ==nil {_bde ._fg .R .RPr =_ae .NewCT_TextCharacterProperties ();};return RunProperties {_bde ._fg .R .RPr };};
|
||||
|
||||
// MakeRunProperties constructs a new RunProperties wrapper.
|
||||
func MakeRunProperties (x *_ae .CT_TextCharacterProperties )RunProperties {return RunProperties {x }};
|
||||
|
||||
// SetAlign controls the paragraph alignment
|
||||
func (_cae ParagraphProperties )SetAlign (a _ae .ST_TextAlignType ){_cae ._aag .AlgnAttr =a };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_faa ShapeProperties )X ()*_ae .CT_ShapeProperties {return _faa ._ea };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_aad Paragraph )X ()*_ae .CT_TextParagraph {return _aad ._ca };
|
||||
|
||||
// SetFlipHorizontal controls if the shape is flipped horizontally.
|
||||
func (_aagg ShapeProperties )SetFlipHorizontal (b bool ){_aagg .ensureXfrm ();if !b {_aagg ._ea .Xfrm .FlipHAttr =nil ;}else {_aagg ._ea .Xfrm .FlipHAttr =_a .Bool (true );};};func (_bb ShapeProperties )LineProperties ()LineProperties {if _bb ._ea .Ln ==nil {_bb ._ea .Ln =_ae .NewCT_LineProperties ();};return LineProperties {_bb ._ea .Ln };};
|
||||
|
||||
// SetFont controls the font of a run.
|
||||
func (_ce RunProperties )SetFont (s string ){_ce ._fa .Latin =_ae .NewCT_TextFont ();_ce ._fa .Latin .TypefaceAttr =s ;};
|
||||
|
||||
// SetText sets the run's text contents.
|
||||
func (_ebg Run )SetText (s string ){_ebg ._fg .Br =nil ;_ebg ._fg .Fld =nil ;if _ebg ._fg .R ==nil {_ebg ._fg .R =_ae .NewCT_RegularTextRun ();};_ebg ._fg .R .T =s ;};func MakeShapeProperties (x *_ae .CT_ShapeProperties )ShapeProperties {return ShapeProperties {x }};
|
||||
|
||||
// SetPosition sets the position of the shape.
|
||||
func (_ad ShapeProperties )SetPosition (x ,y _af .Distance ){_ad .ensureXfrm ();if _ad ._ea .Xfrm .Off ==nil {_ad ._ea .Xfrm .Off =_ae .NewCT_Point2D ();};_ad ._ea .Xfrm .Off .XAttr .ST_CoordinateUnqualified =_a .Int64 (int64 (x /_af .EMU ));_ad ._ea .Xfrm .Off .YAttr .ST_CoordinateUnqualified =_a .Int64 (int64 (y /_af .EMU ));};
|
||||
|
||||
// MakeRun constructs a new Run wrapper.
|
||||
func MakeRun (x *_ae .EG_TextRun )Run {return Run {x }};
|
||||
// Properties returns the paragraph properties.
|
||||
func (_bg Paragraph )Properties ()ParagraphProperties {if _bg ._df .PPr ==nil {_bg ._df .PPr =_b .NewCT_TextParagraphProperties ();};return MakeParagraphProperties (_bg ._df .PPr );};
|
||||
|
||||
// SetBold controls the bolding of a run.
|
||||
func (_dfa RunProperties )SetBold (b bool ){_dfa ._fa .BAttr =_a .Bool (b )};
|
||||
func (_ef RunProperties )SetBold (b bool ){_ef ._bb .BAttr =_c .Bool (b )};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_eb Run )X ()*_b .EG_TextRun {return _eb ._ga };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_dc ParagraphProperties )X ()*_b .CT_TextParagraphProperties {return _dc ._ad };
|
||||
|
||||
// SetSolidFill controls the text color of a run.
|
||||
func (_gd RunProperties )SetSolidFill (c _e .Color ){_gd ._bb .NoFill =nil ;_gd ._bb .BlipFill =nil ;_gd ._bb .GradFill =nil ;_gd ._bb .GrpFill =nil ;_gd ._bb .PattFill =nil ;_gd ._bb .SolidFill =_b .NewCT_SolidColorFillProperties ();_gd ._bb .SolidFill .SrgbClr =_b .NewCT_SRgbColor ();_gd ._bb .SolidFill .SrgbClr .ValAttr =*c .AsRGBString ();};const (LineJoinRound LineJoin =iota ;LineJoinBevel ;LineJoinMiter ;);
|
||||
|
||||
// MakeRunProperties constructs a new RunProperties wrapper.
|
||||
func MakeRunProperties (x *_b .CT_TextCharacterProperties )RunProperties {return RunProperties {x }};
|
||||
|
||||
// ParagraphProperties allows controlling paragraph properties.
|
||||
type ParagraphProperties struct{_ad *_b .CT_TextParagraphProperties ;};func (_dd ShapeProperties )LineProperties ()LineProperties {if _dd ._af .Ln ==nil {_dd ._af .Ln =_b .NewCT_LineProperties ();};return LineProperties {_dd ._af .Ln };};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_fa ShapeProperties )X ()*_b .CT_ShapeProperties {return _fa ._af };
|
||||
|
||||
// SetBulletFont controls the font for the bullet character.
|
||||
func (_cba ParagraphProperties )SetBulletFont (f string ){if f ==""{_cba ._ad .BuFont =nil ;}else {_cba ._ad .BuFont =_b .NewCT_TextFont ();_cba ._ad .BuFont .TypefaceAttr =f ;};};
|
||||
|
||||
// SetText sets the run's text contents.
|
||||
func (_fg Run )SetText (s string ){_fg ._ga .Br =nil ;_fg ._ga .Fld =nil ;if _fg ._ga .R ==nil {_fg ._ga .R =_b .NewCT_RegularTextRun ();};_fg ._ga .R .T =s ;};func MakeShapeProperties (x *_b .CT_ShapeProperties )ShapeProperties {return ShapeProperties {x }};type ShapeProperties struct{_af *_b .CT_ShapeProperties };
|
||||
|
||||
// AddRun adds a new run to a paragraph.
|
||||
func (_ea Paragraph )AddRun ()Run {_ae :=MakeRun (_b .NewEG_TextRun ());_ea ._df .EG_TextRun =append (_ea ._df .EG_TextRun ,_ae .X ());return _ae ;};
|
||||
|
||||
// SetJoin sets the line join style.
|
||||
func (_bc LineProperties )SetJoin (e LineJoin ){_bc ._eg .Round =nil ;_bc ._eg .Miter =nil ;_bc ._eg .Bevel =nil ;switch e {case LineJoinRound :_bc ._eg .Round =_b .NewCT_LineJoinRound ();case LineJoinBevel :_bc ._eg .Bevel =_b .NewCT_LineJoinBevel ();case LineJoinMiter :_bc ._eg .Miter =_b .NewCT_LineJoinMiterProperties ();};};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_f LineProperties )X ()*_b .CT_LineProperties {return _f ._eg };
|
||||
|
||||
// MakeParagraph constructs a new paragraph wrapper.
|
||||
func MakeParagraph (x *_b .CT_TextParagraph )Paragraph {return Paragraph {x }};func (_dgc ShapeProperties )ensureXfrm (){if _dgc ._af .Xfrm ==nil {_dgc ._af .Xfrm =_b .NewCT_Transform2D ();};};
|
||||
|
||||
// MakeRun constructs a new Run wrapper.
|
||||
func MakeRun (x *_b .EG_TextRun )Run {return Run {x }};func (_cc LineProperties )SetNoFill (){_cc .clearFill ();_cc ._eg .NoFill =_b .NewCT_NoFillProperties ()};func (_de ShapeProperties )clearFill (){_de ._af .NoFill =nil ;_de ._af .BlipFill =nil ;_de ._af .GradFill =nil ;_de ._af .GrpFill =nil ;_de ._af .SolidFill =nil ;_de ._af .PattFill =nil ;};
|
||||
|
||||
// SetBulletChar sets the bullet character for the paragraph.
|
||||
func (_dgb ParagraphProperties )SetBulletChar (c string ){if c ==""{_dgb ._ad .BuChar =nil ;}else {_dgb ._ad .BuChar =_b .NewCT_TextCharBullet ();_dgb ._ad .BuChar .CharAttr =c ;};};func (_a LineProperties )clearFill (){_a ._eg .NoFill =nil ;_a ._eg .GradFill =nil ;_a ._eg .SolidFill =nil ;_a ._eg .PattFill =nil ;};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_fe Paragraph )X ()*_b .CT_TextParagraph {return _fe ._df };
|
||||
|
||||
// MakeParagraphProperties constructs a new ParagraphProperties wrapper.
|
||||
func MakeParagraphProperties (x *_b .CT_TextParagraphProperties )ParagraphProperties {return ParagraphProperties {x };};
|
||||
|
||||
// SetSize sets the font size of the run text
|
||||
func (_ee RunProperties )SetSize (sz _d .Distance ){_ee ._bb .SzAttr =_c .Int32 (int32 (sz /_d .HundredthPoint ));};
|
||||
|
||||
// SetPosition sets the position of the shape.
|
||||
func (_fc ShapeProperties )SetPosition (x ,y _d .Distance ){_fc .ensureXfrm ();if _fc ._af .Xfrm .Off ==nil {_fc ._af .Xfrm .Off =_b .NewCT_Point2D ();};_fc ._af .Xfrm .Off .XAttr .ST_CoordinateUnqualified =_c .Int64 (int64 (x /_d .EMU ));_fc ._af .Xfrm .Off .YAttr .ST_CoordinateUnqualified =_c .Int64 (int64 (y /_d .EMU ));};func (_dg LineProperties )SetSolidFill (c _e .Color ){_dg .clearFill ();_dg ._eg .SolidFill =_b .NewCT_SolidColorFillProperties ();_dg ._eg .SolidFill .SrgbClr =_b .NewCT_SRgbColor ();_dg ._eg .SolidFill .SrgbClr .ValAttr =*c .AsRGBString ();};
|
||||
|
||||
// SetSize sets the width and height of the shape.
|
||||
func (_cef ShapeProperties )SetSize (w ,h _d .Distance ){_cef .SetWidth (w );_cef .SetHeight (h )};type LineProperties struct{_eg *_b .CT_LineProperties };
|
||||
|
||||
// SetWidth sets the width of the shape.
|
||||
func (_ag ShapeProperties )SetWidth (w _d .Distance ){_ag .ensureXfrm ();if _ag ._af .Xfrm .Ext ==nil {_ag ._af .Xfrm .Ext =_b .NewCT_PositiveSize2D ();};_ag ._af .Xfrm .Ext .CxAttr =int64 (w /_d .EMU );};
|
||||
|
||||
// SetFlipHorizontal controls if the shape is flipped horizontally.
|
||||
func (_dce ShapeProperties )SetFlipHorizontal (b bool ){_dce .ensureXfrm ();if !b {_dce ._af .Xfrm .FlipHAttr =nil ;}else {_dce ._af .Xfrm .FlipHAttr =_c .Bool (true );};};
|
||||
|
||||
// SetWidth sets the line width, MS products treat zero as the minimum width
|
||||
// that can be displayed.
|
||||
func (_cb LineProperties )SetWidth (w _d .Distance ){_cb ._eg .WAttr =_c .Int32 (int32 (w /_d .EMU ))};
|
||||
|
||||
// Properties returns the run's properties.
|
||||
func (_gb Run )Properties ()RunProperties {if _gb ._ga .R ==nil {_gb ._ga .R =_b .NewCT_RegularTextRun ();};if _gb ._ga .R .RPr ==nil {_gb ._ga .R .RPr =_b .NewCT_TextCharacterProperties ();};return RunProperties {_gb ._ga .R .RPr };};
|
||||
|
||||
// AddBreak adds a new line break to a paragraph.
|
||||
func (_cbe Paragraph )AddBreak (){_ed :=_b .NewEG_TextRun ();_ed .Br =_b .NewCT_TextLineBreak ();_cbe ._df .EG_TextRun =append (_cbe ._df .EG_TextRun ,_ed );};func (_cce ShapeProperties )SetNoFill (){_cce .clearFill ();_cce ._af .NoFill =_b .NewCT_NoFillProperties ();};func (_adf ShapeProperties )SetSolidFill (c _e .Color ){_adf .clearFill ();_adf ._af .SolidFill =_b .NewCT_SolidColorFillProperties ();_adf ._af .SolidFill .SrgbClr =_b .NewCT_SRgbColor ();_adf ._af .SolidFill .SrgbClr .ValAttr =*c .AsRGBString ();};
|
||||
|
||||
// GetPosition gets the position of the shape in EMU.
|
||||
func (_da ShapeProperties )GetPosition ()(int64 ,int64 ){_da .ensureXfrm ();if _da ._af .Xfrm .Off ==nil {_da ._af .Xfrm .Off =_b .NewCT_Point2D ();};return *_da ._af .Xfrm .Off .XAttr .ST_CoordinateUnqualified ,*_da ._af .Xfrm .Off .YAttr .ST_CoordinateUnqualified ;};
|
||||
|
||||
// SetFont controls the font of a run.
|
||||
func (_dcd RunProperties )SetFont (s string ){_dcd ._bb .Latin =_b .NewCT_TextFont ();_dcd ._bb .Latin .TypefaceAttr =s ;};
|
||||
|
||||
// SetHeight sets the height of the shape.
|
||||
func (_edg ShapeProperties )SetHeight (h _d .Distance ){_edg .ensureXfrm ();if _edg ._af .Xfrm .Ext ==nil {_edg ._af .Xfrm .Ext =_b .NewCT_PositiveSize2D ();};_edg ._af .Xfrm .Ext .CyAttr =int64 (h /_d .EMU );};
|
||||
|
||||
// SetFlipVertical controls if the shape is flipped vertically.
|
||||
func (_ff ShapeProperties )SetFlipVertical (b bool ){_ff .ensureXfrm ();if !b {_ff ._af .Xfrm .FlipVAttr =nil ;}else {_ff ._af .Xfrm .FlipVAttr =_c .Bool (true );};};
|
||||
|
||||
// LineJoin is the type of line join
|
||||
type LineJoin byte ;
|
||||
|
||||
// SetSolidFill controls the text color of a run.
|
||||
func (_fgd RunProperties )SetSolidFill (c _b .Color ){_fgd ._fa .NoFill =nil ;_fgd ._fa .BlipFill =nil ;_fgd ._fa .GradFill =nil ;_fgd ._fa .GrpFill =nil ;_fgd ._fa .PattFill =nil ;_fgd ._fa .SolidFill =_ae .NewCT_SolidColorFillProperties ();_fgd ._fa .SolidFill .SrgbClr =_ae .NewCT_SRgbColor ();_fgd ._fa .SolidFill .SrgbClr .ValAttr =*c .AsRGBString ();};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_ge Run )X ()*_ae .EG_TextRun {return _ge ._fg };
|
||||
|
||||
// SetJoin sets the line join style.
|
||||
func (_df LineProperties )SetJoin (e LineJoin ){_df ._d .Round =nil ;_df ._d .Miter =nil ;_df ._d .Bevel =nil ;switch e {case LineJoinRound :_df ._d .Round =_ae .NewCT_LineJoinRound ();case LineJoinBevel :_df ._d .Bevel =_ae .NewCT_LineJoinBevel ();case LineJoinMiter :_df ._d .Miter =_ae .NewCT_LineJoinMiterProperties ();};};
|
||||
|
||||
// Properties returns the paragraph properties.
|
||||
func (_gaf Paragraph )Properties ()ParagraphProperties {if _gaf ._ca .PPr ==nil {_gaf ._ca .PPr =_ae .NewCT_TextParagraphProperties ();};return MakeParagraphProperties (_gaf ._ca .PPr );};
|
||||
|
||||
// MakeParagraph constructs a new paragraph wrapper.
|
||||
func MakeParagraph (x *_ae .CT_TextParagraph )Paragraph {return Paragraph {x }};
|
||||
|
||||
// SetWidth sets the width of the shape.
|
||||
func (_fc ShapeProperties )SetWidth (w _af .Distance ){_fc .ensureXfrm ();if _fc ._ea .Xfrm .Ext ==nil {_fc ._ea .Xfrm .Ext =_ae .NewCT_PositiveSize2D ();};_fc ._ea .Xfrm .Ext .CxAttr =int64 (w /_af .EMU );};
|
||||
|
||||
// AddRun adds a new run to a paragraph.
|
||||
func (_e Paragraph )AddRun ()Run {_dfd :=MakeRun (_ae .NewEG_TextRun ());_e ._ca .EG_TextRun =append (_e ._ca .EG_TextRun ,_dfd .X ());return _dfd ;};func (_bdc ShapeProperties )SetNoFill (){_bdc .clearFill ();_bdc ._ea .NoFill =_ae .NewCT_NoFillProperties ();};type LineProperties struct{_d *_ae .CT_LineProperties };
|
||||
|
||||
// Paragraph is a paragraph within a document.
|
||||
type Paragraph struct{_ca *_ae .CT_TextParagraph };
|
||||
// SetAlign controls the paragraph alignment
|
||||
func (_dcg ParagraphProperties )SetAlign (a _b .ST_TextAlignType ){_dcg ._ad .AlgnAttr =a };
|
||||
|
||||
// SetLevel sets the level of indentation of a paragraph.
|
||||
func (_bd ParagraphProperties )SetLevel (idx int32 ){_bd ._aag .LvlAttr =_a .Int32 (idx )};
|
||||
func (_aa ParagraphProperties )SetLevel (idx int32 ){_aa ._ad .LvlAttr =_c .Int32 (idx )};
|
||||
|
||||
// SetBulletFont controls the font for the bullet character.
|
||||
func (_afd ParagraphProperties )SetBulletFont (f string ){if f ==""{_afd ._aag .BuFont =nil ;}else {_afd ._aag .BuFont =_ae .NewCT_TextFont ();_afd ._aag .BuFont .TypefaceAttr =f ;};};
|
||||
// Run is a run within a paragraph.
|
||||
type Run struct{_ga *_b .EG_TextRun };
|
||||
|
||||
// SetWidth sets the line width, MS products treat zero as the minimum width
|
||||
// that can be displayed.
|
||||
func (_aa LineProperties )SetWidth (w _af .Distance ){_aa ._d .WAttr =_a .Int32 (int32 (w /_af .EMU ))};
|
||||
// SetGeometry sets the shape type of the shape
|
||||
func (_fed ShapeProperties )SetGeometry (g _b .ST_ShapeType ){if _fed ._af .PrstGeom ==nil {_fed ._af .PrstGeom =_b .NewCT_PresetGeometry2D ();};_fed ._af .PrstGeom .PrstAttr =g ;};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_gf LineProperties )X ()*_ae .CT_LineProperties {return _gf ._d };func (_cb ShapeProperties )ensureXfrm (){if _cb ._ea .Xfrm ==nil {_cb ._ea .Xfrm =_ae .NewCT_Transform2D ();};};
|
||||
// Paragraph is a paragraph within a document.
|
||||
type Paragraph struct{_df *_b .CT_TextParagraph };
|
||||
|
||||
// GetPosition gets the position of the shape in EMU.
|
||||
func (_egc ShapeProperties )GetPosition ()(int64 ,int64 ){_egc .ensureXfrm ();if _egc ._ea .Xfrm .Off ==nil {_egc ._ea .Xfrm .Off =_ae .NewCT_Point2D ();};return *_egc ._ea .Xfrm .Off .XAttr .ST_CoordinateUnqualified ,*_egc ._ea .Xfrm .Off .YAttr .ST_CoordinateUnqualified ;};
|
||||
// SetNumbered controls if bullets are numbered or not.
|
||||
func (_ce ParagraphProperties )SetNumbered (scheme _b .ST_TextAutonumberScheme ){if scheme ==_b .ST_TextAutonumberSchemeUnset {_ce ._ad .BuAutoNum =nil ;}else {_ce ._ad .BuAutoNum =_b .NewCT_TextAutonumberBullet ();_ce ._ad .BuAutoNum .TypeAttr =scheme ;};};
|
||||
|
||||
// SetSize sets the font size of the run text
|
||||
func (_gfb RunProperties )SetSize (sz _af .Distance ){_gfb ._fa .SzAttr =_a .Int32 (int32 (sz /_af .HundredthPoint ));};func (_ga LineProperties )SetNoFill (){_ga .clearFill ();_ga ._d .NoFill =_ae .NewCT_NoFillProperties ()};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_f ParagraphProperties )X ()*_ae .CT_TextParagraphProperties {return _f ._aag };
|
||||
// RunProperties controls the run properties.
|
||||
type RunProperties struct{_bb *_b .CT_TextCharacterProperties ;};
|
6
go.mod
6
go.mod
@ -3,7 +3,7 @@ module github.com/unidoc/unioffice
|
||||
go 1.13
|
||||
|
||||
require (
|
||||
github.com/stretchr/testify v1.6.1
|
||||
github.com/unidoc/unipdf/v3 v3.22.0
|
||||
github.com/unidoc/unitype v0.2.1 // indirect
|
||||
github.com/stretchr/testify v1.7.0
|
||||
github.com/unidoc/unipdf/v3 v3.28.0
|
||||
github.com/unidoc/unitype v0.2.1
|
||||
)
|
||||
|
12
internal/convertutils/convertutils.go
Normal file
12
internal/convertutils/convertutils.go
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -9,4 +9,4 @@
|
||||
// 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 mergesort ;func MergeSort (array []float64 )[]float64 {if len (array )<=1{_a :=make ([]float64 ,len (array ));copy (_a ,array );return _a ;};_f :=len (array )/2;_bb :=MergeSort (array [:_f ]);_bbf :=MergeSort (array [_f :]);_fe :=make ([]float64 ,len (array ));_d :=0;_e :=0;_dd :=0;for _e < len (_bb )&&_dd < len (_bbf ){if _bb [_e ]<=_bbf [_dd ]{_fe [_d ]=_bb [_e ];_e ++;}else {_fe [_d ]=_bbf [_dd ];_dd ++;};_d ++;};for _e < len (_bb ){_fe [_d ]=_bb [_e ];_e ++;_d ++;};for _dd < len (_bbf ){_fe [_d ]=_bbf [_dd ];_dd ++;_d ++;};return _fe ;};
|
||||
package mergesort ;func MergeSort (array []float64 )[]float64 {if len (array )<=1{_dd :=make ([]float64 ,len (array ));copy (_dd ,array );return _dd ;};_f :=len (array )/2;_g :=MergeSort (array [:_f ]);_a :=MergeSort (array [_f :]);_b :=make ([]float64 ,len (array ));_gg :=0;_e :=0;_fb :=0;for _e < len (_g )&&_fb < len (_a ){if _g [_e ]<=_a [_fb ]{_b [_gg ]=_g [_e ];_e ++;}else {_b [_gg ]=_a [_fb ];_fb ++;};_gg ++;};for _e < len (_g ){_b [_gg ]=_g [_e ];_e ++;_gg ++;};for _fb < len (_a ){_b [_gg ]=_a [_fb ];_fb ++;_gg ++;};return _b ;};
|
@ -9,4 +9,4 @@
|
||||
// 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 wildcard ;func Index (pattern ,name string )(_bg int ){if pattern ==""||pattern =="\u002a"{return 0;};_dfb :=make ([]rune ,0,len (name ));_bc :=make ([]rune ,0,len (pattern ));for _ ,_ff :=range name {_dfb =append (_dfb ,_ff );};for _ ,_edg :=range pattern {_bc =append (_bc ,_edg );};return _ffg (_dfb ,_bc ,0);};func MatchSimple (pattern ,name string )bool {if pattern ==""{return name ==pattern ;};if pattern =="\u002a"{return true ;};_a :=make ([]rune ,0,len (name ));_ab :=make ([]rune ,0,len (pattern ));for _ ,_ag :=range name {_a =append (_a ,_ag );};for _ ,_ac :=range pattern {_ab =append (_ab ,_ac );};_fa :=true ;return _df (_a ,_ab ,_fa );};func _ffg (_eb ,_ede []rune ,_ad int )int {for len (_ede )> 0{switch _ede [0]{default:if len (_eb )==0{return -1;};if _eb [0]!=_ede [0]{return _ffg (_eb [1:],_ede ,_ad +1);};case '?':if len (_eb )==0{return -1;};case '*':if len (_eb )==0{return -1;};_ebd :=_ffg (_eb ,_ede [1:],_ad );if _ebd !=-1{return _ad ;}else {_ebd =_ffg (_eb [1:],_ede ,_ad );if _ebd !=-1{return _ad ;}else {return -1;};};};_eb =_eb [1:];_ede =_ede [1:];};return _ad ;};func Match (pattern ,name string )(_be bool ){if pattern ==""{return name ==pattern ;};if pattern =="\u002a"{return true ;};_e :=make ([]rune ,0,len (name ));_bb :=make ([]rune ,0,len (pattern ));for _ ,_d :=range name {_e =append (_e ,_d );};for _ ,_bd :=range pattern {_bb =append (_bb ,_bd );};_fb :=false ;return _df (_e ,_bb ,_fb );};func _df (_ca ,_ed []rune ,_cc bool )bool {for len (_ed )> 0{switch _ed [0]{default:if len (_ca )==0||_ca [0]!=_ed [0]{return false ;};case '?':if len (_ca )==0&&!_cc {return false ;};case '*':return _df (_ca ,_ed [1:],_cc )||(len (_ca )> 0&&_df (_ca [1:],_ed ,_cc ));};_ca =_ca [1:];_ed =_ed [1:];};return len (_ca )==0&&len (_ed )==0;};
|
||||
package wildcard ;func _cae (_cf ,_fee []rune ,_gb bool )bool {for len (_fee )> 0{switch _fee [0]{default:if len (_cf )==0||_cf [0]!=_fee [0]{return false ;};case '?':if len (_cf )==0&&!_gb {return false ;};case '*':return _cae (_cf ,_fee [1:],_gb )||(len (_cf )> 0&&_cae (_cf [1:],_fee ,_gb ));};_cf =_cf [1:];_fee =_fee [1:];};return len (_cf )==0&&len (_fee )==0;};func Index (pattern ,name string )(_bbb int ){if pattern ==""||pattern =="\u002a"{return 0;};_ge :=make ([]rune ,0,len (name ));_df :=make ([]rune ,0,len (pattern ));for _ ,_be :=range name {_ge =append (_ge ,_be );};for _ ,_ec :=range pattern {_df =append (_df ,_ec );};return _fff (_ge ,_df ,0);};func MatchSimple (pattern ,name string )bool {if pattern ==""{return name ==pattern ;};if pattern =="\u002a"{return true ;};_c :=make ([]rune ,0,len (name ));_g :=make ([]rune ,0,len (pattern ));for _ ,_e :=range name {_c =append (_c ,_e );};for _ ,_f :=range pattern {_g =append (_g ,_f );};_dg :=true ;return _cae (_c ,_g ,_dg );};func _fff (_ee ,_fa []rune ,_eb int )int {for len (_fa )> 0{switch _fa [0]{default:if len (_ee )==0{return -1;};if _ee [0]!=_fa [0]{return _fff (_ee [1:],_fa ,_eb +1);};case '?':if len (_ee )==0{return -1;};case '*':if len (_ee )==0{return -1;};_cg :=_fff (_ee ,_fa [1:],_eb );if _cg !=-1{return _eb ;}else {_cg =_fff (_ee [1:],_fa ,_eb );if _cg !=-1{return _eb ;}else {return -1;};};};_ee =_ee [1:];_fa =_fa [1:];};return _eb ;};func Match (pattern ,name string )(_fg bool ){if pattern ==""{return name ==pattern ;};if pattern =="\u002a"{return true ;};_bb :=make ([]rune ,0,len (name ));_fe :=make ([]rune ,0,len (pattern ));for _ ,_ed :=range name {_bb =append (_bb ,_ed );};for _ ,_fed :=range pattern {_fe =append (_fe ,_fed );};_ff :=false ;return _cae (_bb ,_fe ,_ff );};
|
@ -11,12 +11,12 @@
|
||||
|
||||
package measurement ;const (Zero Distance =0;Point =1;Pixel72 =1.0/72.0*Inch ;Pixel96 =1.0/96.0*Inch ;HalfPoint =1.0/2.0*Point ;Character =7*Point ;Millimeter =2.83465*Point ;Centimeter =10*Millimeter ;Inch =72*Point ;Foot =12*Inch ;Twips =1.0/20.0*Point ;EMU =1.0/914400.0*Inch ;HundredthPoint =1/100.0;Dxa =Twips ;);
|
||||
|
||||
// ToEMU converts float64 distance units to int64 EMU.
|
||||
func ToEMU (m float64 )int64 {return int64 (914400.0/Inch *m )};
|
||||
// FromEMU converts int64 ENU units to float64 distance units.
|
||||
func FromEMU (emu int64 )float64 {return float64 (emu )/914400*Inch };
|
||||
|
||||
// Distance represents a distance and is automatically converted
|
||||
// to the units needed internally in the various ECMA 376 formats.
|
||||
type Distance float64 ;
|
||||
|
||||
// FromEMU converts int64 ENU units to float64 distance units.
|
||||
func FromEMU (emu int64 )float64 {return float64 (emu )/914400*Inch };
|
||||
// ToEMU converts float64 distance units to int64 EMU.
|
||||
func ToEMU (m float64 )int64 {return int64 (914400.0/Inch *m )};
|
File diff suppressed because one or more lines are too long
@ -9,34 +9,34 @@
|
||||
// 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 elements ;import (_df "encoding/xml";_g "fmt";_a "github.com/unidoc/unioffice";);
|
||||
|
||||
// ValidateWithPath validates the ElementsGroup and its children, prefixing error messages with path
|
||||
func (_af *ElementsGroup )ValidateWithPath (path string )error {for _feb ,_fde :=range _af .Choice {if _gf :=_fde .ValidateWithPath (_g .Sprintf ("\u0025\u0073\u002f\u0043\u0068\u006f\u0069\u0063\u0065\u005b\u0025\u0064\u005d",path ,_feb ));_gf !=nil {return _gf ;};};return nil ;};func NewElementsGroupChoice ()*ElementsGroupChoice {_gcc :=&ElementsGroupChoice {};return _gcc };func (_ge *Any )MarshalXML (e *_df .Encoder ,start _df .StartElement )error {return _ge .SimpleLiteral .MarshalXML (e ,start );};
|
||||
|
||||
// ValidateWithPath validates the SimpleLiteral and its children, prefixing error messages with path
|
||||
func (_geg *SimpleLiteral )ValidateWithPath (path string )error {return nil };func (_ag *ElementContainer )MarshalXML (e *_df .Encoder ,start _df .StartElement )error {start .Name .Local ="\u0065\u006ce\u006d\u0065\u006et\u0043\u006f\u006e\u0074\u0061\u0069\u006e\u0065\u0072";e .EncodeToken (start );if _ag .Choice !=nil {for _ ,_bf :=range _ag .Choice {_bf .MarshalXML (e ,_df .StartElement {});};};e .EncodeToken (_df .EndElement {Name :start .Name });return nil ;};func NewAny ()*Any {_de :=&Any {};_de .SimpleLiteral =*NewSimpleLiteral ();return _de };
|
||||
|
||||
// ValidateWithPath validates the Any and its children, prefixing error messages with path
|
||||
func (_dee *Any )ValidateWithPath (path string )error {if _dd :=_dee .SimpleLiteral .ValidateWithPath (path );_dd !=nil {return _dd ;};return nil ;};func (_cf *ElementsGroupChoice )UnmarshalXML (d *_df .Decoder ,start _df .StartElement )error {_gg :for {_ebb ,_ee :=d .Token ();if _ee !=nil {return _ee ;};switch _adb :=_ebb .(type ){case _df .StartElement :switch _adb .Name {case _df .Name {Space :"\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0072\u0067/\u0064c\u002f\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u002f\u0031\u002e\u0031\u002f",Local :"\u0061\u006e\u0079"}:_afg :=NewAny ();if _gba :=d .DecodeElement (_afg ,&_adb );_gba !=nil {return _gba ;};_cf .Any =append (_cf .Any ,_afg );default:_a .Log ("\u0073\u006b\u0069\u0070\u0070\u0069\u006e\u0067\u0020\u0075\u006e\u0073\u0075\u0070\u0070o\u0072\u0074\u0065\u0064\u0020\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0020o\u006e\u0020\u0045\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u0047\u0072ou\u0070\u0043\u0068\u006f\u0069\u0063\u0065\u0020\u0025\u0076",_adb .Name );if _bcc :=d .Skip ();_bcc !=nil {return _bcc ;};};case _df .EndElement :break _gg ;case _df .CharData :};};return nil ;};type Any struct{SimpleLiteral };
|
||||
|
||||
// Validate validates the ElementContainer and its children
|
||||
func (_eb *ElementContainer )Validate ()error {return _eb .ValidateWithPath ("\u0045\u006ce\u006d\u0065\u006et\u0043\u006f\u006e\u0074\u0061\u0069\u006e\u0065\u0072");};func (_fec *ElementsGroup )MarshalXML (e *_df .Encoder ,start _df .StartElement )error {if _fec .Choice !=nil {for _ ,_agf :=range _fec .Choice {_agf .MarshalXML (e ,_df .StartElement {});};};return nil ;};
|
||||
|
||||
// Validate validates the Any and its children
|
||||
func (_b *Any )Validate ()error {return _b .ValidateWithPath ("\u0041\u006e\u0079")};func NewElementsGroup ()*ElementsGroup {_bc :=&ElementsGroup {};return _bc };func NewSimpleLiteral ()*SimpleLiteral {_edc :=&SimpleLiteral {};return _edc };func (_abe *SimpleLiteral )UnmarshalXML (d *_df .Decoder ,start _df .StartElement )error {for {_gbe ,_ddd :=d .Token ();if _ddd !=nil {return _g .Errorf ("\u0070a\u0072\u0073\u0069\u006eg\u0020\u0053\u0069\u006d\u0070l\u0065L\u0069t\u0065\u0072\u0061\u006c\u003a\u0020\u0025s",_ddd );};if _ecb ,_aa :=_gbe .(_df .EndElement );_aa &&_ecb .Name ==start .Name {break ;};};return nil ;};
|
||||
package elements ;import (_d "encoding/xml";_ad "fmt";_ag "github.com/unidoc/unioffice";);
|
||||
|
||||
// ValidateWithPath validates the ElementsGroupChoice and its children, prefixing error messages with path
|
||||
func (_bbd *ElementsGroupChoice )ValidateWithPath (path string )error {for _fef ,_eec :=range _bbd .Any {if _cbe :=_eec .ValidateWithPath (_g .Sprintf ("\u0025\u0073\u002f\u0041\u006e\u0079\u005b\u0025\u0064\u005d",path ,_fef ));_cbe !=nil {return _cbe ;};};return nil ;};func (_e *ElementContainer )UnmarshalXML (d *_df .Decoder ,start _df .StartElement )error {_ddc :for {_fb ,_dg :=d .Token ();if _dg !=nil {return _dg ;};switch _dff :=_fb .(type ){case _df .StartElement :switch _dff .Name {case _df .Name {Space :"\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0072\u0067/\u0064c\u002f\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u002f\u0031\u002e\u0031\u002f",Local :"\u0061\u006e\u0079"}:_ec :=NewElementsGroupChoice ();if _ff :=d .DecodeElement (&_ec .Any ,&_dff );_ff !=nil {return _ff ;};_e .Choice =append (_e .Choice ,_ec );default:_a .Log ("\u0073\u006b\u0069\u0070\u0070i\u006e\u0067\u0020\u0075\u006e\u0073\u0075\u0070\u0070\u006f\u0072\u0074\u0065d\u0020\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0020\u006f\u006e\u0020\u0045\u006c\u0065\u006d\u0065\u006e\u0074\u0043\u006f\u006e\u0074\u0061\u0069\u006e\u0065\u0072\u0020\u0025v",_dff .Name );if _bb :=d .Skip ();_bb !=nil {return _bb ;};};case _df .EndElement :break _ddc ;case _df .CharData :};};return nil ;};
|
||||
func (_ge *ElementsGroupChoice )ValidateWithPath (path string )error {for _gade ,_ec :=range _ge .Any {if _bda :=_ec .ValidateWithPath (_ad .Sprintf ("\u0025\u0073\u002f\u0041\u006e\u0079\u005b\u0025\u0064\u005d",path ,_gade ));_bda !=nil {return _bda ;};};return nil ;};
|
||||
|
||||
// Validate validates the ElementsGroup and its children
|
||||
func (_bee *ElementsGroup )Validate ()error {return _bee .ValidateWithPath ("\u0045\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u0047\u0072\u006f\u0075\u0070");};
|
||||
|
||||
// Validate validates the SimpleLiteral and its children
|
||||
func (_bfe *SimpleLiteral )Validate ()error {return _bfe .ValidateWithPath ("\u0053\u0069\u006d\u0070\u006c\u0065\u004c\u0069\u0074\u0065\u0072\u0061\u006c");};func (_eab *ElementsGroupChoice )MarshalXML (e *_df .Encoder ,start _df .StartElement )error {if _eab .Any !=nil {_ad :=_df .StartElement {Name :_df .Name {Local :"\u0064\u0063\u003a\u0061\u006e\u0079"}};for _ ,_ced :=range _eab .Any {e .EncodeElement (_ced ,_ad );};};return nil ;};type SimpleLiteral struct{};func (_ga *ElementsGroup )UnmarshalXML (d *_df .Decoder ,start _df .StartElement )error {_dea :for {_ce ,_ed :=d .Token ();if _ed !=nil {return _ed ;};switch _cc :=_ce .(type ){case _df .StartElement :switch _cc .Name {case _df .Name {Space :"\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0072\u0067/\u0064c\u002f\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u002f\u0031\u002e\u0031\u002f",Local :"\u0061\u006e\u0079"}:_fd :=NewElementsGroupChoice ();if _eg :=d .DecodeElement (&_fd .Any ,&_cc );_eg !=nil {return _eg ;};_ga .Choice =append (_ga .Choice ,_fd );default:_a .Log ("\u0073\u006b\u0069\u0070\u0070\u0069\u006e\u0067 \u0075\u006e\u0073up\u0070\u006f\u0072\u0074\u0065\u0064 \u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0020\u006f\u006e\u0020\u0045\u006c\u0065\u006de\u006e\u0074\u0073\u0047\u0072\u006f\u0075\u0070 \u0025\u0076",_cc .Name );if _ea :=d .Skip ();_ea !=nil {return _ea ;};};case _df .EndElement :break _dea ;case _df .CharData :};};return nil ;};func (_ab *Any )UnmarshalXML (d *_df .Decoder ,start _df .StartElement )error {_ab .SimpleLiteral =*NewSimpleLiteral ();for {_c ,_dc :=d .Token ();if _dc !=nil {return _g .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0041\u006e\u0079\u003a\u0020\u0025\u0073",_dc );};if _f ,_fe :=_c .(_df .EndElement );_fe &&_f .Name ==start .Name {break ;};};return nil ;};
|
||||
|
||||
// ValidateWithPath validates the ElementContainer and its children, prefixing error messages with path
|
||||
func (_ae *ElementContainer )ValidateWithPath (path string )error {for _dec ,_gc :=range _ae .Choice {if _dfd :=_gc .ValidateWithPath (_g .Sprintf ("\u0025\u0073\u002f\u0043\u0068\u006f\u0069\u0063\u0065\u005b\u0025\u0064\u005d",path ,_dec ));_dfd !=nil {return _dfd ;};};return nil ;};type ElementsGroupChoice struct{Any []*Any ;};type ElementContainer struct{Choice []*ElementsGroupChoice ;};func (_ba *SimpleLiteral )MarshalXML (e *_df .Encoder ,start _df .StartElement )error {e .EncodeToken (start );e .EncodeToken (_df .EndElement {Name :start .Name });return nil ;};
|
||||
// ValidateWithPath validates the ElementsGroup and its children, prefixing error messages with path
|
||||
func (_agf *ElementsGroup )ValidateWithPath (path string )error {for _daea ,_bd :=range _agf .Choice {if _ba :=_bd .ValidateWithPath (_ad .Sprintf ("\u0025\u0073\u002f\u0043\u0068\u006f\u0069\u0063\u0065\u005b\u0025\u0064\u005d",path ,_daea ));_ba !=nil {return _ba ;};};return nil ;};type ElementsGroup struct{Choice []*ElementsGroupChoice ;};func (_ea *ElementContainer )MarshalXML (e *_d .Encoder ,start _d .StartElement )error {start .Name .Local ="\u0065\u006ce\u006d\u0065\u006et\u0043\u006f\u006e\u0074\u0061\u0069\u006e\u0065\u0072";e .EncodeToken (start );if _ea .Choice !=nil {for _ ,_cd :=range _ea .Choice {_cd .MarshalXML (e ,_d .StartElement {});};};e .EncodeToken (_d .EndElement {Name :start .Name });return nil ;};
|
||||
|
||||
// Validate validates the ElementsGroupChoice and its children
|
||||
func (_bfb *ElementsGroupChoice )Validate ()error {return _bfb .ValidateWithPath ("\u0045\u006c\u0065\u006den\u0074\u0073\u0047\u0072\u006f\u0075\u0070\u0043\u0068\u006f\u0069\u0063\u0065");};type ElementsGroup struct{Choice []*ElementsGroupChoice ;};func NewElementContainer ()*ElementContainer {_fg :=&ElementContainer {};return _fg };func init (){_a .RegisterConstructor ("\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0072\u0067/\u0064c\u002f\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u002f\u0031\u002e\u0031\u002f","\u0053\u0069\u006d\u0070\u006c\u0065\u004c\u0069\u0074\u0065\u0072\u0061\u006c",NewSimpleLiteral );_a .RegisterConstructor ("\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0072\u0067/\u0064c\u002f\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u002f\u0031\u002e\u0031\u002f","\u0065\u006ce\u006d\u0065\u006et\u0043\u006f\u006e\u0074\u0061\u0069\u006e\u0065\u0072",NewElementContainer );_a .RegisterConstructor ("\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0072\u0067/\u0064c\u002f\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u002f\u0031\u002e\u0031\u002f","\u0061\u006e\u0079",NewAny );_a .RegisterConstructor ("\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0072\u0067/\u0064c\u002f\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u002f\u0031\u002e\u0031\u002f","\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u0047\u0072\u006f\u0075\u0070",NewElementsGroup );};
|
||||
func (_be *ElementsGroupChoice )Validate ()error {return _be .ValidateWithPath ("\u0045\u006c\u0065\u006den\u0074\u0073\u0047\u0072\u006f\u0075\u0070\u0043\u0068\u006f\u0069\u0063\u0065");};
|
||||
|
||||
// ValidateWithPath validates the ElementContainer and its children, prefixing error messages with path
|
||||
func (_ab *ElementContainer )ValidateWithPath (path string )error {for _gad ,_agg :=range _ab .Choice {if _cc :=_agg .ValidateWithPath (_ad .Sprintf ("\u0025\u0073\u002f\u0043\u0068\u006f\u0069\u0063\u0065\u005b\u0025\u0064\u005d",path ,_gad ));_cc !=nil {return _cc ;};};return nil ;};
|
||||
|
||||
// Validate validates the ElementContainer and its children
|
||||
func (_fa *ElementContainer )Validate ()error {return _fa .ValidateWithPath ("\u0045\u006ce\u006d\u0065\u006et\u0043\u006f\u006e\u0074\u0061\u0069\u006e\u0065\u0072");};func NewElementsGroup ()*ElementsGroup {_fg :=&ElementsGroup {};return _fg };
|
||||
|
||||
// ValidateWithPath validates the Any and its children, prefixing error messages with path
|
||||
func (_bg *Any )ValidateWithPath (path string )error {if _dd :=_bg .SimpleLiteral .ValidateWithPath (path );_dd !=nil {return _dd ;};return nil ;};func (_de *ElementsGroupChoice )UnmarshalXML (d *_d .Decoder ,start _d .StartElement )error {_gd :for {_dff ,_dee :=d .Token ();if _dee !=nil {return _dee ;};switch _aab :=_dff .(type ){case _d .StartElement :switch _aab .Name {case _d .Name {Space :"\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0072\u0067/\u0064c\u002f\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u002f\u0031\u002e\u0031\u002f",Local :"\u0061\u006e\u0079"}:_fb :=NewAny ();if _cgb :=d .DecodeElement (_fb ,&_aab );_cgb !=nil {return _cgb ;};_de .Any =append (_de .Any ,_fb );default:_ag .Log ("\u0073\u006b\u0069\u0070\u0070\u0069\u006e\u0067\u0020\u0075\u006e\u0073\u0075\u0070\u0070o\u0072\u0074\u0065\u0064\u0020\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0020o\u006e\u0020\u0045\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u0047\u0072ou\u0070\u0043\u0068\u006f\u0069\u0063\u0065\u0020\u0025\u0076",_aab .Name );if _cgc :=d .Skip ();_cgc !=nil {return _cgc ;};};case _d .EndElement :break _gd ;case _d .CharData :};};return nil ;};
|
||||
|
||||
// Validate validates the Any and its children
|
||||
func (_gb *Any )Validate ()error {return _gb .ValidateWithPath ("\u0041\u006e\u0079")};func (_ca *ElementsGroupChoice )MarshalXML (e *_d .Encoder ,start _d .StartElement )error {if _ca .Any !=nil {_bf :=_d .StartElement {Name :_d .Name {Local :"\u0064\u0063\u003a\u0061\u006e\u0079"}};for _ ,_ddb :=range _ca .Any {e .EncodeElement (_ddb ,_bf );};};return nil ;};
|
||||
|
||||
// Validate validates the SimpleLiteral and its children
|
||||
func (_fe *SimpleLiteral )Validate ()error {return _fe .ValidateWithPath ("\u0053\u0069\u006d\u0070\u006c\u0065\u004c\u0069\u0074\u0065\u0072\u0061\u006c");};func (_caf *SimpleLiteral )MarshalXML (e *_d .Encoder ,start _d .StartElement )error {e .EncodeToken (start );e .EncodeToken (_d .EndElement {Name :start .Name });return nil ;};func NewElementsGroupChoice ()*ElementsGroupChoice {_ffa :=&ElementsGroupChoice {};return _ffa };func (_dc *Any )MarshalXML (e *_d .Encoder ,start _d .StartElement )error {return _dc .SimpleLiteral .MarshalXML (e ,start );};
|
||||
|
||||
// Validate validates the ElementsGroup and its children
|
||||
func (_cbc *ElementsGroup )Validate ()error {return _cbc .ValidateWithPath ("\u0045\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u0047\u0072\u006f\u0075\u0070");};type SimpleLiteral struct{};func (_b *Any )UnmarshalXML (d *_d .Decoder ,start _d .StartElement )error {_b .SimpleLiteral =*NewSimpleLiteral ();for {_g ,_ga :=d .Token ();if _ga !=nil {return _ad .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0041\u006e\u0079\u003a\u0020\u0025\u0073",_ga );};if _cb ,_e :=_g .(_d .EndElement );_e &&_cb .Name ==start .Name {break ;};};return nil ;};type ElementsGroupChoice struct{Any []*Any ;};func NewSimpleLiteral ()*SimpleLiteral {_geb :=&SimpleLiteral {};return _geb };func (_f *ElementContainer )UnmarshalXML (d *_d .Decoder ,start _d .StartElement )error {_ff :for {_dca ,_age :=d .Token ();if _age !=nil {return _age ;};switch _ade :=_dca .(type ){case _d .StartElement :switch _ade .Name {case _d .Name {Space :"\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0072\u0067/\u0064c\u002f\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u002f\u0031\u002e\u0031\u002f",Local :"\u0061\u006e\u0079"}:_gac :=NewElementsGroupChoice ();if _dg :=d .DecodeElement (&_gac .Any ,&_ade );_dg !=nil {return _dg ;};_f .Choice =append (_f .Choice ,_gac );default:_ag .Log ("\u0073\u006b\u0069\u0070\u0070i\u006e\u0067\u0020\u0075\u006e\u0073\u0075\u0070\u0070\u006f\u0072\u0074\u0065d\u0020\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0020\u006f\u006e\u0020\u0045\u006c\u0065\u006d\u0065\u006e\u0074\u0043\u006f\u006e\u0074\u0061\u0069\u006e\u0065\u0072\u0020\u0025v",_ade .Name );if _eg :=d .Skip ();_eg !=nil {return _eg ;};};case _d .EndElement :break _ff ;case _d .CharData :};};return nil ;};
|
||||
|
||||
// ValidateWithPath validates the SimpleLiteral and its children, prefixing error messages with path
|
||||
func (_bad *SimpleLiteral )ValidateWithPath (path string )error {return nil };func (_bef *SimpleLiteral )UnmarshalXML (d *_d .Decoder ,start _d .StartElement )error {for {_fga ,_eab :=d .Token ();if _eab !=nil {return _ad .Errorf ("\u0070a\u0072\u0073\u0069\u006eg\u0020\u0053\u0069\u006d\u0070l\u0065L\u0069t\u0065\u0072\u0061\u006c\u003a\u0020\u0025s",_eab );};if _dad ,_ae :=_fga .(_d .EndElement );_ae &&_dad .Name ==start .Name {break ;};};return nil ;};func (_gc *ElementsGroup )UnmarshalXML (d *_d .Decoder ,start _d .StartElement )error {_fae :for {_cf ,_ege :=d .Token ();if _ege !=nil {return _ege ;};switch _aa :=_cf .(type ){case _d .StartElement :switch _aa .Name {case _d .Name {Space :"\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0072\u0067/\u0064c\u002f\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u002f\u0031\u002e\u0031\u002f",Local :"\u0061\u006e\u0079"}:_ddd :=NewElementsGroupChoice ();if _df :=d .DecodeElement (&_ddd .Any ,&_aa );_df !=nil {return _df ;};_gc .Choice =append (_gc .Choice ,_ddd );default:_ag .Log ("\u0073\u006b\u0069\u0070\u0070\u0069\u006e\u0067 \u0075\u006e\u0073up\u0070\u006f\u0072\u0074\u0065\u0064 \u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0020\u006f\u006e\u0020\u0045\u006c\u0065\u006de\u006e\u0074\u0073\u0047\u0072\u006f\u0075\u0070 \u0025\u0076",_aa .Name );if _gbe :=d .Skip ();_gbe !=nil {return _gbe ;};};case _d .EndElement :break _fae ;case _d .CharData :};};return nil ;};func NewAny ()*Any {_c :=&Any {};_c .SimpleLiteral =*NewSimpleLiteral ();return _c };func NewElementContainer ()*ElementContainer {_da :=&ElementContainer {};return _da };type ElementContainer struct{Choice []*ElementsGroupChoice ;};type Any struct{SimpleLiteral };func (_ee *ElementsGroup )MarshalXML (e *_d .Encoder ,start _d .StartElement )error {if _ee .Choice !=nil {for _ ,_cbb :=range _ee .Choice {_cbb .MarshalXML (e ,_d .StartElement {});};};return nil ;};func init (){_ag .RegisterConstructor ("\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0072\u0067/\u0064c\u002f\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u002f\u0031\u002e\u0031\u002f","\u0053\u0069\u006d\u0070\u006c\u0065\u004c\u0069\u0074\u0065\u0072\u0061\u006c",NewSimpleLiteral );_ag .RegisterConstructor ("\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0072\u0067/\u0064c\u002f\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u002f\u0031\u002e\u0031\u002f","\u0065\u006ce\u006d\u0065\u006et\u0043\u006f\u006e\u0074\u0061\u0069\u006e\u0065\u0072",NewElementContainer );_ag .RegisterConstructor ("\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0072\u0067/\u0064c\u002f\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u002f\u0031\u002e\u0031\u002f","\u0061\u006e\u0079",NewAny );_ag .RegisterConstructor ("\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0072\u0067/\u0064c\u002f\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u002f\u0031\u002e\u0031\u002f","\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u0047\u0072\u006f\u0075\u0070",NewElementsGroup );};
|
@ -9,124 +9,124 @@
|
||||
// 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 terms ;import (_g "encoding/xml";_a "fmt";_f "github.com/unidoc/unioffice";_d "github.com/unidoc/unioffice/schema/purl.org/dc/elements";);type ElementsAndRefinementsGroup struct{Choice []*ElementsAndRefinementsGroupChoice ;};
|
||||
|
||||
// Validate validates the UDC and its children
|
||||
func (_abc *UDC )Validate ()error {return _abc .ValidateWithPath ("\u0055\u0044\u0043")};func NewMESH ()*MESH {_ecb :=&MESH {};return _ecb };
|
||||
|
||||
// ValidateWithPath validates the ElementOrRefinementContainer and its children, prefixing error messages with path
|
||||
func (_ba *ElementOrRefinementContainer )ValidateWithPath (path string )error {for _bae ,_ecef :=range _ba .Choice {if _eb :=_ecef .ValidateWithPath (_a .Sprintf ("\u0025\u0073\u002f\u0043\u0068\u006f\u0069\u0063\u0065\u005b\u0025\u0064\u005d",path ,_bae ));_eb !=nil {return _eb ;};};return nil ;};func (_be *IMT )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_baee ,_bdg :=d .Token ();if _bdg !=nil {return _a .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0049\u004d\u0054\u003a\u0020\u0025\u0073",_bdg );};if _cd ,_cbc :=_baee .(_g .EndElement );_cbc &&_cd .Name ==start .Name {break ;};};return nil ;};type ElementsAndRefinementsGroupChoice struct{Any []*_d .Any ;};func NewElementOrRefinementContainer ()*ElementOrRefinementContainer {_ac :=&ElementOrRefinementContainer {};return _ac ;};func (_aec *ISO639_2 )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_gcfc ,_efe :=d .Token ();if _efe !=nil {return _a .Errorf ("p\u0061r\u0073\u0069\u006e\u0067\u0020\u0049\u0053\u004f6\u0033\u0039\u005f\u0032: \u0025\u0073",_efe );};if _dbc ,_cdd :=_gcfc .(_g .EndElement );_cdd &&_dbc .Name ==start .Name {break ;};};return nil ;};type IMT struct{};
|
||||
|
||||
// ValidateWithPath validates the RFC1766 and its children, prefixing error messages with path
|
||||
func (_eaf *RFC1766 )ValidateWithPath (path string )error {return nil };func (_cg *DCMIType )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0044\u0043\u004d\u0049\u0054\u0079\u0070\u0065";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};func (_bc *TGN )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0054\u0047\u004e";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};
|
||||
|
||||
// Validate validates the DDC and its children
|
||||
func (_gfc *DDC )Validate ()error {return _gfc .ValidateWithPath ("\u0044\u0044\u0043")};
|
||||
|
||||
// Validate validates the DCMIType and its children
|
||||
func (_dd *DCMIType )Validate ()error {return _dd .ValidateWithPath ("\u0044\u0043\u004d\u0049\u0054\u0079\u0070\u0065");};func (_ea *Box )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0042\u006f\u0078";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};func (_aag *RFC1766 )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0052F\u0043\u0031\u0037\u0036\u0036";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};type MESH struct{};
|
||||
|
||||
// ValidateWithPath validates the W3CDTF and its children, prefixing error messages with path
|
||||
func (_dffc *W3CDTF )ValidateWithPath (path string )error {return nil };func (_acg *ElementsAndRefinementsGroup )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {_bba :for {_fef ,_dab :=d .Token ();if _dab !=nil {return _dab ;};switch _fba :=_fef .(type ){case _g .StartElement :switch _fba .Name {case _g .Name {Space :"\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0072\u0067/\u0064c\u002f\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u002f\u0031\u002e\u0031\u002f",Local :"\u0061\u006e\u0079"}:_adc :=NewElementsAndRefinementsGroupChoice ();if _cbf :=d .DecodeElement (&_adc .Any ,&_fba );_cbf !=nil {return _cbf ;};_acg .Choice =append (_acg .Choice ,_adc );default:_f .Log ("\u0073\u006b\u0069\u0070\u0070\u0069\u006e\u0067\u0020\u0075\u006e\u0073\u0075\u0070\u0070\u006f\u0072\u0074ed\u0020e\u006c\u0065\u006d\u0065\u006e\u0074\u0020\u006f\u006e\u0020\u0045\u006ce\u006d\u0065\u006e\u0074\u0073\u0041\u006e\u0064\u0052\u0065\u0066\u0069\u006e\u0065\u006d\u0065\u006et\u0073\u0047\u0072\u006f\u0075\u0070\u0020\u0025\u0076",_fba .Name );if _ffe :=d .Skip ();_ffe !=nil {return _ffe ;};};case _g .EndElement :break _bba ;case _g .CharData :};};return nil ;};func NewRFC3066 ()*RFC3066 {_bbf :=&RFC3066 {};return _bbf };func (_bdc *TGN )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_bbde ,_efd :=d .Token ();if _efd !=nil {return _a .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0054\u0047\u004e\u003a\u0020\u0025\u0073",_efd );};if _edd ,_aab :=_bbde .(_g .EndElement );_aab &&_edd .Name ==start .Name {break ;};};return nil ;};func (_agf *MESH )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u004d\u0045\u0053\u0048";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};
|
||||
|
||||
// ValidateWithPath validates the DDC and its children, prefixing error messages with path
|
||||
func (_bg *DDC )ValidateWithPath (path string )error {return nil };func (_gdce *Point )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0050\u006f\u0069n\u0074";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};
|
||||
|
||||
// Validate validates the ElementsAndRefinementsGroupChoice and its children
|
||||
func (_ega *ElementsAndRefinementsGroupChoice )Validate ()error {return _ega .ValidateWithPath ("\u0045\u006c\u0065\u006d\u0065\u006et\u0073\u0041\u006e\u0064\u0052\u0065\u0066\u0069\u006e\u0065\u006d\u0065\u006et\u0073\u0047\u0072\u006f\u0075\u0070\u0043h\u006f\u0069\u0063\u0065");};func (_bfg *LCSH )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u004c\u0043\u0053\u0048";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};
|
||||
|
||||
// Validate validates the RFC3066 and its children
|
||||
func (_cfa *RFC3066 )Validate ()error {return _cfa .ValidateWithPath ("\u0052F\u0043\u0033\u0030\u0036\u0036");};
|
||||
|
||||
// Validate validates the Point and its children
|
||||
func (_adf *Point )Validate ()error {return _adf .ValidateWithPath ("\u0050\u006f\u0069n\u0074")};type RFC3066 struct{};func (_caca *LCC )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_cda ,_ebg :=d .Token ();if _ebg !=nil {return _a .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u004c\u0043\u0043\u003a\u0020\u0025\u0073",_ebg );};if _cgd ,_fcd :=_cda .(_g .EndElement );_fcd &&_cgd .Name ==start .Name {break ;};};return nil ;};type LCC struct{};type Box struct{};
|
||||
|
||||
// Validate validates the ISO639_2 and its children
|
||||
func (_egf *ISO639_2 )Validate ()error {return _egf .ValidateWithPath ("\u0049\u0053\u004f\u0036\u0033\u0039\u005f\u0032");};func (_ccc *LCSH )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_adb ,_cdcc :=d .Token ();if _cdcc !=nil {return _a .Errorf ("\u0070\u0061r\u0073\u0069\u006eg\u0020\u004c\u0043\u0053\u0048\u003a\u0020\u0025\u0073",_cdcc );};if _ccfd ,_fa :=_adb .(_g .EndElement );_fa &&_ccfd .Name ==start .Name {break ;};};return nil ;};func NewPeriod ()*Period {_dec :=&Period {};return _dec };func NewUDC ()*UDC {_aad :=&UDC {};return _aad };
|
||||
|
||||
// ValidateWithPath validates the Box and its children, prefixing error messages with path
|
||||
func (_cc *Box )ValidateWithPath (path string )error {return nil };
|
||||
|
||||
// ValidateWithPath validates the ISO639_2 and its children, prefixing error messages with path
|
||||
func (_bdb *ISO639_2 )ValidateWithPath (path string )error {return nil };func (_gd *DDC )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0044\u0044\u0043";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};type ISO639_2 struct{};
|
||||
|
||||
// ValidateWithPath validates the URI and its children, prefixing error messages with path
|
||||
func (_bfcb *URI )ValidateWithPath (path string )error {return nil };type TGN struct{};type RFC1766 struct{};func NewISO639_2 ()*ISO639_2 {_ebd :=&ISO639_2 {};return _ebd };
|
||||
|
||||
// Validate validates the ElementsAndRefinementsGroup and its children
|
||||
func (_gdb *ElementsAndRefinementsGroup )Validate ()error {return _gdb .ValidateWithPath ("E\u006c\u0065\u006d\u0065\u006e\u0074s\u0041\u006e\u0064\u0052\u0065\u0066\u0069\u006e\u0065m\u0065\u006e\u0074s\u0047r\u006f\u0075\u0070");};func (_fca *ElementOrRefinementContainer )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0065\u006c\u0065\u006de\u006e\u0074\u004f\u0072\u0052\u0065\u0066\u0069\u006e\u0065m\u0065n\u0074\u0043\u006f\u006e\u0074\u0061\u0069n\u0065\u0072";e .EncodeToken (start );if _fca .Choice !=nil {for _ ,_de :=range _fca .Choice {_de .MarshalXML (e ,_g .StartElement {});};};e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};func (_eda *URI )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0055\u0052\u0049";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};
|
||||
|
||||
// Validate validates the MESH and its children
|
||||
func (_cdb *MESH )Validate ()error {return _cdb .ValidateWithPath ("\u004d\u0045\u0053\u0048")};func (_fg *ElementsAndRefinementsGroupChoice )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {if _fg .Any !=nil {_ccef :=_g .StartElement {Name :_g .Name {Local :"\u0064\u0063\u003a\u0061\u006e\u0079"}};for _ ,_ecf :=range _fg .Any {e .EncodeElement (_ecf ,_ccef );};};return nil ;};func NewDDC ()*DDC {_ff :=&DDC {};return _ff };
|
||||
|
||||
// ValidateWithPath validates the LCC and its children, prefixing error messages with path
|
||||
func (_cbg *LCC )ValidateWithPath (path string )error {return nil };type Period struct{};func NewIMT ()*IMT {_cec :=&IMT {};return _cec };
|
||||
|
||||
// ValidateWithPath validates the MESH and its children, prefixing error messages with path
|
||||
func (_ggg *MESH )ValidateWithPath (path string )error {return nil };func (_gac *URI )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_bge ,_efg :=d .Token ();if _efg !=nil {return _a .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0055\u0052\u0049\u003a\u0020\u0025\u0073",_efg );};if _cdcf ,_abb :=_bge .(_g .EndElement );_abb &&_cdcf .Name ==start .Name {break ;};};return nil ;};type UDC struct{};func (_dc *ISO3166 )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_daf ,_caf :=d .Token ();if _caf !=nil {return _a .Errorf ("\u0070\u0061\u0072\u0073in\u0067\u0020\u0049\u0053\u004f\u0033\u0031\u0036\u0036\u003a\u0020\u0025\u0073",_caf );};if _bed ,_bea :=_daf .(_g .EndElement );_bea &&_bed .Name ==start .Name {break ;};};return nil ;};func NewElementsAndRefinementsGroup ()*ElementsAndRefinementsGroup {_gdc :=&ElementsAndRefinementsGroup {};return _gdc ;};
|
||||
|
||||
// Validate validates the Period and its children
|
||||
func (_aff *Period )Validate ()error {return _aff .ValidateWithPath ("\u0050\u0065\u0072\u0069\u006f\u0064");};
|
||||
|
||||
// Validate validates the RFC1766 and its children
|
||||
func (_dbd *RFC1766 )Validate ()error {return _dbd .ValidateWithPath ("\u0052F\u0043\u0031\u0037\u0036\u0036");};func NewISO3166 ()*ISO3166 {_eac :=&ISO3166 {};return _eac };
|
||||
|
||||
// ValidateWithPath validates the LCSH and its children, prefixing error messages with path
|
||||
func (_egc *LCSH )ValidateWithPath (path string )error {return nil };
|
||||
|
||||
// Validate validates the ISO3166 and its children
|
||||
func (_ffd *ISO3166 )Validate ()error {return _ffd .ValidateWithPath ("\u0049S\u004f\u0033\u0031\u0036\u0036");};type ISO3166 struct{};func (_cacg *W3CDTF )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_adff ,_cef :=d .Token ();if _cef !=nil {return _a .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u00573\u0043\u0044T\u0046\u003a\u0020\u0025\u0073",_cef );};if _cff ,_dffa :=_adff .(_g .EndElement );_dffa &&_cff .Name ==start .Name {break ;};};return nil ;};type DDC struct{};func (_daa *LCC )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u004c\u0043\u0043";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};type LCSH struct{};func (_cfe *UDC )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_aaf ,_ccd :=d .Token ();if _ccd !=nil {return _a .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0055\u0044\u0043\u003a\u0020\u0025\u0073",_ccd );};if _bgg ,_ddcg :=_aaf .(_g .EndElement );_ddcg &&_bgg .Name ==start .Name {break ;};};return nil ;};func (_cbed *UDC )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0055\u0044\u0043";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};type ElementOrRefinementContainer struct{Choice []*ElementsAndRefinementsGroupChoice ;};
|
||||
|
||||
// ValidateWithPath validates the RFC3066 and its children, prefixing error messages with path
|
||||
func (_cge *RFC3066 )ValidateWithPath (path string )error {return nil };func (_gge *RFC3066 )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_bfc ,_gaa :=d .Token ();if _gaa !=nil {return _a .Errorf ("\u0070\u0061\u0072\u0073in\u0067\u0020\u0052\u0046\u0043\u0033\u0030\u0036\u0036\u003a\u0020\u0025\u0073",_gaa );};if _ee ,_cea :=_bfc .(_g .EndElement );_cea &&_ee .Name ==start .Name {break ;};};return nil ;};type W3CDTF struct{};func NewLCC ()*LCC {_ccf :=&LCC {};return _ccf };type Point struct{};func NewElementsAndRefinementsGroupChoice ()*ElementsAndRefinementsGroupChoice {_dff :=&ElementsAndRefinementsGroupChoice {};return _dff ;};
|
||||
|
||||
// ValidateWithPath validates the UDC and its children, prefixing error messages with path
|
||||
func (_gae *UDC )ValidateWithPath (path string )error {return nil };
|
||||
|
||||
// ValidateWithPath validates the ElementsAndRefinementsGroupChoice and its children, prefixing error messages with path
|
||||
func (_dfd *ElementsAndRefinementsGroupChoice )ValidateWithPath (path string )error {for _bf ,_gg :=range _dfd .Any {if _bd :=_gg .ValidateWithPath (_a .Sprintf ("\u0025\u0073\u002f\u0041\u006e\u0079\u005b\u0025\u0064\u005d",path ,_bf ));_bd !=nil {return _bd ;};};return nil ;};
|
||||
|
||||
// ValidateWithPath validates the ElementsAndRefinementsGroup and its children, prefixing error messages with path
|
||||
func (_fd *ElementsAndRefinementsGroup )ValidateWithPath (path string )error {for _ag ,_dfe :=range _fd .Choice {if _eaa :=_dfe .ValidateWithPath (_a .Sprintf ("\u0025\u0073\u002f\u0043\u0068\u006f\u0069\u0063\u0065\u005b\u0025\u0064\u005d",path ,_ag ));_eaa !=nil {return _eaa ;};};return nil ;};
|
||||
package terms ;import (_g "encoding/xml";_c "fmt";_cc "github.com/unidoc/unioffice";_gg "github.com/unidoc/unioffice/schema/purl.org/dc/elements";);
|
||||
|
||||
// Validate validates the LCC and its children
|
||||
func (_bec *LCC )Validate ()error {return _bec .ValidateWithPath ("\u004c\u0043\u0043")};func (_gb *ElementsAndRefinementsGroupChoice )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {_gff :for {_cbe ,_abf :=d .Token ();if _abf !=nil {return _abf ;};switch _ceb :=_cbe .(type ){case _g .StartElement :switch _ceb .Name {case _g .Name {Space :"\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0072\u0067/\u0064c\u002f\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u002f\u0031\u002e\u0031\u002f",Local :"\u0061\u006e\u0079"}:_bbd :=_d .NewAny ();if _gdcb :=d .DecodeElement (_bbd ,&_ceb );_gdcb !=nil {return _gdcb ;};_gb .Any =append (_gb .Any ,_bbd );default:_f .Log ("\u0073\u006b\u0069\u0070\u0070\u0069\u006e\u0067\u0020\u0075\u006e\u0073\u0075\u0070\u0070\u006f\u0072\u0074\u0065\u0064 \u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0020\u006f\u006e\u0020\u0045\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u0041\u006ed\u0052\u0065\u0066\u0069\u006e\u0065\u006d\u0065\u006e\u0074\u0073\u0047\u0072\u006fu\u0070\u0043\u0068o\u0069\u0063\u0065\u0020\u0025\u0076",_ceb .Name );if _fdf :=d .Skip ();_fdf !=nil {return _fdf ;};};case _g .EndElement :break _gff ;case _g .CharData :};};return nil ;};
|
||||
|
||||
// Validate validates the LCSH and its children
|
||||
func (_beb *LCSH )Validate ()error {return _beb .ValidateWithPath ("\u004c\u0043\u0053\u0048")};type DCMIType struct{};func (_gbf *IMT )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0049\u004d\u0054";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};func NewTGN ()*TGN {_abe :=&TGN {};return _abe };func (_ffb *DDC )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_gad ,_gc :=d .Token ();if _gc !=nil {return _a .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0044\u0044\u0043\u003a\u0020\u0025\u0073",_gc );};if _db ,_bb :=_gad .(_g .EndElement );_bb &&_db .Name ==start .Name {break ;};};return nil ;};func NewLCSH ()*LCSH {_aed :=&LCSH {};return _aed };
|
||||
|
||||
// ValidateWithPath validates the Period and its children, prefixing error messages with path
|
||||
func (_cbbd *Period )ValidateWithPath (path string )error {return nil };
|
||||
|
||||
// ValidateWithPath validates the IMT and its children, prefixing error messages with path
|
||||
func (_cee *IMT )ValidateWithPath (path string )error {return nil };type URI struct{};
|
||||
|
||||
// ValidateWithPath validates the Point and its children, prefixing error messages with path
|
||||
func (_aeg *Point )ValidateWithPath (path string )error {return nil };func (_b *Box )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_c ,_ec :=d .Token ();if _ec !=nil {return _a .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0042\u006f\u0078\u003a\u0020\u0025\u0073",_ec );};if _ga ,_fb :=_c .(_g .EndElement );_fb &&_ga .Name ==start .Name {break ;};};return nil ;};func (_cad *RFC1766 )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_gcgg ,_ed :=d .Token ();if _ed !=nil {return _a .Errorf ("\u0070\u0061\u0072\u0073in\u0067\u0020\u0052\u0046\u0043\u0031\u0037\u0036\u0036\u003a\u0020\u0025\u0073",_ed );};if _adbf ,_ccb :=_gcgg .(_g .EndElement );_ccb &&_adbf .Name ==start .Name {break ;};};return nil ;};func (_af *ElementOrRefinementContainer )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {_ca :for {_gcg ,_fe :=d .Token ();if _fe !=nil {return _fe ;};switch _ae :=_gcg .(type ){case _g .StartElement :switch _ae .Name {case _g .Name {Space :"\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0072\u0067/\u0064c\u002f\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u002f\u0031\u002e\u0031\u002f",Local :"\u0061\u006e\u0079"}:_dde :=NewElementsAndRefinementsGroupChoice ();if _cac :=d .DecodeElement (&_dde .Any ,&_ae );_cac !=nil {return _cac ;};_af .Choice =append (_af .Choice ,_dde );default:_f .Log ("\u0073k\u0069\u0070\u0070\u0069\u006e\u0067\u0020un\u0073\u0075\u0070\u0070\u006f\u0072\u0074\u0065\u0064\u0020\u0065\u006c\u0065\u006de\u006e\u0074 \u006f\u006e\u0020E\u006c\u0065\u006d\u0065\u006e\u0074\u004f\u0072\u0052\u0065\u0066\u0069\u006e\u0065\u006d\u0065n\u0074\u0043on\u0074\u0061\u0069n\u0065\u0072\u0020\u0025\u0076",_ae .Name );if _eg :=d .Skip ();_eg !=nil {return _eg ;};};case _g .EndElement :break _ca ;case _g .CharData :};};return nil ;};
|
||||
|
||||
// ValidateWithPath validates the ISO3166 and its children, prefixing error messages with path
|
||||
func (_cf *ISO3166 )ValidateWithPath (path string )error {return nil };
|
||||
|
||||
// ValidateWithPath validates the DCMIType and its children, prefixing error messages with path
|
||||
func (_ead *DCMIType )ValidateWithPath (path string )error {return nil };func (_fge *Point )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_gfdg ,_ccg :=d .Token ();if _ccg !=nil {return _a .Errorf ("\u0070\u0061\u0072\u0073\u0069\u006e\u0067\u0020\u0050\u006f\u0069\u006et\u003a\u0020\u0025\u0073",_ccg );};if _cfc ,_daag :=_gfdg .(_g .EndElement );_daag &&_cfc .Name ==start .Name {break ;};};return nil ;};func (_ef *ISO3166 )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0049S\u004f\u0033\u0031\u0036\u0036";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};func NewBox ()*Box {_gf :=&Box {};return _gf };
|
||||
|
||||
// Validate validates the IMT and its children
|
||||
func (_cdc *IMT )Validate ()error {return _cdc .ValidateWithPath ("\u0049\u004d\u0054")};func NewW3CDTF ()*W3CDTF {_fcf :=&W3CDTF {};return _fcf };func NewURI ()*URI {_aca :=&URI {};return _aca };func NewDCMIType ()*DCMIType {_df :=&DCMIType {};return _df };
|
||||
|
||||
// Validate validates the URI and its children
|
||||
func (_cca *URI )Validate ()error {return _cca .ValidateWithPath ("\u0055\u0052\u0049")};func (_ad *ElementsAndRefinementsGroup )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {if _ad .Choice !=nil {for _ ,_gcf :=range _ad .Choice {_gcf .MarshalXML (e ,_g .StartElement {});};};return nil ;};
|
||||
|
||||
// Validate validates the Box and its children
|
||||
func (_fbf *Box )Validate ()error {return _fbf .ValidateWithPath ("\u0042\u006f\u0078")};func (_ggc *ISO639_2 )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0049\u0053\u004f\u0036\u0033\u0039\u002d\u0032";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};func (_gaf *W3CDTF )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0057\u0033\u0043\u0044\u0054\u0046";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};func (_fag *Period )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0050\u0065\u0072\u0069\u006f\u0064";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};func (_ddg *RFC3066 )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0052F\u0043\u0033\u0030\u0036\u0036";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};
|
||||
|
||||
// ValidateWithPath validates the TGN and its children, prefixing error messages with path
|
||||
func (_fce *TGN )ValidateWithPath (path string )error {return nil };func (_fc *DCMIType )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_da ,_fbfc :=d .Token ();if _fbfc !=nil {return _a .Errorf ("p\u0061r\u0073\u0069\u006e\u0067\u0020\u0044\u0043\u004dI\u0054\u0079\u0070\u0065: \u0025\u0073",_fbfc );};if _ece ,_ce :=_da .(_g .EndElement );_ce &&_ece .Name ==start .Name {break ;};};return nil ;};
|
||||
|
||||
// Validate validates the ElementOrRefinementContainer and its children
|
||||
func (_dae *ElementOrRefinementContainer )Validate ()error {return _dae .ValidateWithPath ("\u0045\u006c\u0065\u006de\u006e\u0074\u004f\u0072\u0052\u0065\u0066\u0069\u006e\u0065m\u0065n\u0074\u0043\u006f\u006e\u0074\u0061\u0069n\u0065\u0072");};func NewRFC1766 ()*RFC1766 {_dege :=&RFC1766 {};return _dege };
|
||||
func (_eeca *LCC )Validate ()error {return _eeca .ValidateWithPath ("\u004c\u0043\u0043")};func NewW3CDTF ()*W3CDTF {_gag :=&W3CDTF {};return _gag };func (_bdbe *TGN )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_abae ,_dge :=d .Token ();if _dge !=nil {return _c .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0054\u0047\u004e\u003a\u0020\u0025\u0073",_dge );};if _bff ,_cca :=_abae .(_g .EndElement );_cca &&_bff .Name ==start .Name {break ;};};return nil ;};func (_ece *Point )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0050\u006f\u0069n\u0074";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};
|
||||
|
||||
// Validate validates the TGN and its children
|
||||
func (_dfc *TGN )Validate ()error {return _dfc .ValidateWithPath ("\u0054\u0047\u004e")};func (_ffdb *MESH )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_cde ,_def :=d .Token ();if _def !=nil {return _a .Errorf ("\u0070\u0061r\u0073\u0069\u006eg\u0020\u004d\u0045\u0053\u0048\u003a\u0020\u0025\u0073",_def );};if _aa ,_cbb :=_cde .(_g .EndElement );_cbb &&_aa .Name ==start .Name {break ;};};return nil ;};func NewPoint ()*Point {_bfa :=&Point {};return _bfa };
|
||||
func (_dad *TGN )Validate ()error {return _dad .ValidateWithPath ("\u0054\u0047\u004e")};func NewElementOrRefinementContainer ()*ElementOrRefinementContainer {_ab :=&ElementOrRefinementContainer {};return _ab ;};type LCC struct{};
|
||||
|
||||
// ValidateWithPath validates the LCC and its children, prefixing error messages with path
|
||||
func (_bgf *LCC )ValidateWithPath (path string )error {return nil };func (_b *Box )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0042\u006f\u0078";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};
|
||||
|
||||
// ValidateWithPath validates the ElementsAndRefinementsGroupChoice and its children, prefixing error messages with path
|
||||
func (_gbd *ElementsAndRefinementsGroupChoice )ValidateWithPath (path string )error {for _cgcf ,_fgd :=range _gbd .Any {if _dcg :=_fgd .ValidateWithPath (_c .Sprintf ("\u0025\u0073\u002f\u0041\u006e\u0079\u005b\u0025\u0064\u005d",path ,_cgcf ));_dcg !=nil {return _dcg ;};};return nil ;};
|
||||
|
||||
// Validate validates the DCMIType and its children
|
||||
func (_ee *DCMIType )Validate ()error {return _ee .ValidateWithPath ("\u0044\u0043\u004d\u0049\u0054\u0079\u0070\u0065");};func (_bce *ElementsAndRefinementsGroup )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {_dc :for {_gbe ,_bde :=d .Token ();if _bde !=nil {return _bde ;};switch _dd :=_gbe .(type ){case _g .StartElement :switch _dd .Name {case _g .Name {Space :"\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0072\u0067/\u0064c\u002f\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u002f\u0031\u002e\u0031\u002f",Local :"\u0061\u006e\u0079"}:_be :=NewElementsAndRefinementsGroupChoice ();if _cda :=d .DecodeElement (&_be .Any ,&_dd );_cda !=nil {return _cda ;};_bce .Choice =append (_bce .Choice ,_be );default:_cc .Log ("\u0073\u006b\u0069\u0070\u0070\u0069\u006e\u0067\u0020\u0075\u006e\u0073\u0075\u0070\u0070\u006f\u0072\u0074ed\u0020e\u006c\u0065\u006d\u0065\u006e\u0074\u0020\u006f\u006e\u0020\u0045\u006ce\u006d\u0065\u006e\u0074\u0073\u0041\u006e\u0064\u0052\u0065\u0066\u0069\u006e\u0065\u006d\u0065\u006et\u0073\u0047\u0072\u006f\u0075\u0070\u0020\u0025\u0076",_dd .Name );if _ed :=d .Skip ();_ed !=nil {return _ed ;};};case _g .EndElement :break _dc ;case _g .CharData :};};return nil ;};func (_gb *ElementOrRefinementContainer )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0065\u006c\u0065\u006de\u006e\u0074\u004f\u0072\u0052\u0065\u0066\u0069\u006e\u0065m\u0065n\u0074\u0043\u006f\u006e\u0074\u0061\u0069n\u0065\u0072";e .EncodeToken (start );if _gb .Choice !=nil {for _ ,_eea :=range _gb .Choice {_eea .MarshalXML (e ,_g .StartElement {});};};e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};type LCSH struct{};func (_fca *ISO639_2 )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0049\u0053\u004f\u0036\u0033\u0039\u002d\u0032";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};
|
||||
|
||||
// ValidateWithPath validates the Period and its children, prefixing error messages with path
|
||||
func (_bec *Period )ValidateWithPath (path string )error {return nil };
|
||||
|
||||
// ValidateWithPath validates the LCSH and its children, prefixing error messages with path
|
||||
func (_aca *LCSH )ValidateWithPath (path string )error {return nil };
|
||||
|
||||
// Validate validates the IMT and its children
|
||||
func (_cdfba *IMT )Validate ()error {return _cdfba .ValidateWithPath ("\u0049\u004d\u0054")};func (_ffd *IMT )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0049\u004d\u0054";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};type Box struct{};
|
||||
|
||||
// ValidateWithPath validates the DCMIType and its children, prefixing error messages with path
|
||||
func (_ad *DCMIType )ValidateWithPath (path string )error {return nil };type Point struct{};
|
||||
|
||||
// ValidateWithPath validates the Box and its children, prefixing error messages with path
|
||||
func (_fc *Box )ValidateWithPath (path string )error {return nil };
|
||||
|
||||
// Validate validates the Box and its children
|
||||
func (_ggd *Box )Validate ()error {return _ggd .ValidateWithPath ("\u0042\u006f\u0078")};func (_cabg *LCSH )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u004c\u0043\u0053\u0048";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};
|
||||
|
||||
// ValidateWithPath validates the ElementsAndRefinementsGroup and its children, prefixing error messages with path
|
||||
func (_ec *ElementsAndRefinementsGroup )ValidateWithPath (path string )error {for _ccd ,_bda :=range _ec .Choice {if _cab :=_bda .ValidateWithPath (_c .Sprintf ("\u0025\u0073\u002f\u0043\u0068\u006f\u0069\u0063\u0065\u005b\u0025\u0064\u005d",path ,_ccd ));_cab !=nil {return _cab ;};};return nil ;};func NewMESH ()*MESH {_ffaf :=&MESH {};return _ffaf };type URI struct{};func NewISO639_2 ()*ISO639_2 {_abe :=&ISO639_2 {};return _abe };func (_adde *URI )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0055\u0052\u0049";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};func (_efb *RFC3066 )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0052F\u0043\u0033\u0030\u0036\u0036";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};func NewDDC ()*DDC {_acg :=&DDC {};return _acg };type ElementsAndRefinementsGroup struct{Choice []*ElementsAndRefinementsGroupChoice ;};func (_ebag *Point )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_dda ,_bb :=d .Token ();if _bb !=nil {return _c .Errorf ("\u0070\u0061\u0072\u0073\u0069\u006e\u0067\u0020\u0050\u006f\u0069\u006et\u003a\u0020\u0025\u0073",_bb );};if _bgg ,_addd :=_dda .(_g .EndElement );_addd &&_bgg .Name ==start .Name {break ;};};return nil ;};type IMT struct{};func (_cec *ISO639_2 )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_dee ,_ebeb :=d .Token ();if _ebeb !=nil {return _c .Errorf ("p\u0061r\u0073\u0069\u006e\u0067\u0020\u0049\u0053\u004f6\u0033\u0039\u005f\u0032: \u0025\u0073",_ebeb );};if _gac ,_bg :=_dee .(_g .EndElement );_bg &&_gac .Name ==start .Name {break ;};};return nil ;};
|
||||
|
||||
// ValidateWithPath validates the ISO3166 and its children, prefixing error messages with path
|
||||
func (_eeb *ISO3166 )ValidateWithPath (path string )error {return nil };type DCMIType struct{};
|
||||
|
||||
// ValidateWithPath validates the IMT and its children, prefixing error messages with path
|
||||
func (_fe *IMT )ValidateWithPath (path string )error {return nil };
|
||||
|
||||
// Validate validates the MESH and its children
|
||||
func (_cdc *MESH )Validate ()error {return _cdc .ValidateWithPath ("\u004d\u0045\u0053\u0048")};type Period struct{};
|
||||
|
||||
// ValidateWithPath validates the UDC and its children, prefixing error messages with path
|
||||
func (_fab *UDC )ValidateWithPath (path string )error {return nil };func (_bcb *ElementOrRefinementContainer )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {_eg :for {_ca ,_aa :=d .Token ();if _aa !=nil {return _aa ;};switch _bf :=_ca .(type ){case _g .StartElement :switch _bf .Name {case _g .Name {Space :"\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0072\u0067/\u0064c\u002f\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u002f\u0031\u002e\u0031\u002f",Local :"\u0061\u006e\u0079"}:_de :=NewElementsAndRefinementsGroupChoice ();if _bfb :=d .DecodeElement (&_de .Any ,&_bf );_bfb !=nil {return _bfb ;};_bcb .Choice =append (_bcb .Choice ,_de );default:_cc .Log ("\u0073k\u0069\u0070\u0070\u0069\u006e\u0067\u0020un\u0073\u0075\u0070\u0070\u006f\u0072\u0074\u0065\u0064\u0020\u0065\u006c\u0065\u006de\u006e\u0074 \u006f\u006e\u0020E\u006c\u0065\u006d\u0065\u006e\u0074\u004f\u0072\u0052\u0065\u0066\u0069\u006e\u0065\u006d\u0065n\u0074\u0043on\u0074\u0061\u0069n\u0065\u0072\u0020\u0025\u0076",_bf .Name );if _bd :=d .Skip ();_bd !=nil {return _bd ;};};case _g .EndElement :break _eg ;case _g .CharData :};};return nil ;};func (_ae *ElementsAndRefinementsGroupChoice )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {if _ae .Any !=nil {_bdb :=_g .StartElement {Name :_g .Name {Local :"\u0064\u0063\u003a\u0061\u006e\u0079"}};for _ ,_ag :=range _ae .Any {e .EncodeElement (_ag ,_bdb );};};return nil ;};type UDC struct{};func (_caf *MESH )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_bdd ,_efd :=d .Token ();if _efd !=nil {return _c .Errorf ("\u0070\u0061r\u0073\u0069\u006eg\u0020\u004d\u0045\u0053\u0048\u003a\u0020\u0025\u0073",_efd );};if _baa ,_gae :=_bdd .(_g .EndElement );_gae &&_baa .Name ==start .Name {break ;};};return nil ;};func (_add *DDC )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_af ,_ebe :=d .Token ();if _ebe !=nil {return _c .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0044\u0044\u0043\u003a\u0020\u0025\u0073",_ebe );};if _fa ,_gfd :=_af .(_g .EndElement );_gfd &&_fa .Name ==start .Name {break ;};};return nil ;};
|
||||
|
||||
// Validate validates the Point and its children
|
||||
func (_cac *Point )Validate ()error {return _cac .ValidateWithPath ("\u0050\u006f\u0069n\u0074")};func (_df *LCC )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u004c\u0043\u0043";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};func (_bac *UDC )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0055\u0044\u0043";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};
|
||||
|
||||
// Validate validates the ISO639_2 and its children
|
||||
func (_eecb *ISO639_2 )Validate ()error {return _eecb .ValidateWithPath ("\u0049\u0053\u004f\u0036\u0033\u0039\u005f\u0032");};
|
||||
|
||||
// ValidateWithPath validates the TGN and its children, prefixing error messages with path
|
||||
func (_bef *TGN )ValidateWithPath (path string )error {return nil };func NewPeriod ()*Period {_faf :=&Period {};return _faf };type MESH struct{};func NewBox ()*Box {_d :=&Box {};return _d };
|
||||
|
||||
// ValidateWithPath validates the RFC3066 and its children, prefixing error messages with path
|
||||
func (_acad *RFC3066 )ValidateWithPath (path string )error {return nil };type W3CDTF struct{};func (_ea *ISO3166 )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0049S\u004f\u0033\u0031\u0036\u0036";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};type DDC struct{};
|
||||
|
||||
// ValidateWithPath validates the DDC and its children, prefixing error messages with path
|
||||
func (_fbd *DDC )ValidateWithPath (path string )error {return nil };func (_cgc *ElementsAndRefinementsGroupChoice )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {_ega :for {_gfa ,_edb :=d .Token ();if _edb !=nil {return _edb ;};switch _aec :=_gfa .(type ){case _g .StartElement :switch _aec .Name {case _g .Name {Space :"\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0072\u0067/\u0064c\u002f\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u002f\u0031\u002e\u0031\u002f",Local :"\u0061\u006e\u0079"}:_ba :=_gg .NewAny ();if _ccf :=d .DecodeElement (_ba ,&_aec );_ccf !=nil {return _ccf ;};_cgc .Any =append (_cgc .Any ,_ba );default:_cc .Log ("\u0073\u006b\u0069\u0070\u0070\u0069\u006e\u0067\u0020\u0075\u006e\u0073\u0075\u0070\u0070\u006f\u0072\u0074\u0065\u0064 \u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0020\u006f\u006e\u0020\u0045\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u0041\u006ed\u0052\u0065\u0066\u0069\u006e\u0065\u006d\u0065\u006e\u0074\u0073\u0047\u0072\u006fu\u0070\u0043\u0068o\u0069\u0063\u0065\u0020\u0025\u0076",_aec .Name );if _fg :=d .Skip ();_fg !=nil {return _fg ;};};case _g .EndElement :break _ega ;case _g .CharData :};};return nil ;};func (_adc *RFC1766 )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_fbe ,_gbc :=d .Token ();if _gbc !=nil {return _c .Errorf ("\u0070\u0061\u0072\u0073in\u0067\u0020\u0052\u0046\u0043\u0031\u0037\u0036\u0036\u003a\u0020\u0025\u0073",_gbc );};if _cgd ,_cf :=_fbe .(_g .EndElement );_cf &&_cgd .Name ==start .Name {break ;};};return nil ;};func NewElementsAndRefinementsGroup ()*ElementsAndRefinementsGroup {_bcc :=&ElementsAndRefinementsGroup {};return _bcc ;};
|
||||
|
||||
// ValidateWithPath validates the RFC1766 and its children, prefixing error messages with path
|
||||
func (_bfbf *RFC1766 )ValidateWithPath (path string )error {return nil };func (_fb *DCMIType )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0044\u0043\u004d\u0049\u0054\u0079\u0070\u0065";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};
|
||||
|
||||
// Validate validates the W3CDTF and its children
|
||||
func (_edf *W3CDTF )Validate ()error {return _edf .ValidateWithPath ("\u0057\u0033\u0043\u0044\u0054\u0046");};func (_ebdc *Period )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_aaa ,_gfd :=d .Token ();if _gfd !=nil {return _a .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0050e\u0072\u0069o\u0064\u003a\u0020\u0025\u0073",_gfd );};if _ddc ,_deg :=_aaa .(_g .EndElement );_deg &&_ddc .Name ==start .Name {break ;};};return nil ;};func init (){_f .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u004c\u0043\u0053\u0048",NewLCSH );_f .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u004d\u0045\u0053\u0048",NewMESH );_f .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0044\u0044\u0043",NewDDC );_f .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u004c\u0043\u0043",NewLCC );_f .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0055\u0044\u0043",NewUDC );_f .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0050\u0065\u0072\u0069\u006f\u0064",NewPeriod );_f .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0057\u0033\u0043\u0044\u0054\u0046",NewW3CDTF );_f .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0044\u0043\u004d\u0049\u0054\u0079\u0070\u0065",NewDCMIType );_f .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0049\u004d\u0054",NewIMT );_f .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0055\u0052\u0049",NewURI );_f .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0049\u0053\u004f\u0036\u0033\u0039\u002d\u0032",NewISO639_2 );_f .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0052F\u0043\u0031\u0037\u0036\u0036",NewRFC1766 );_f .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0052F\u0043\u0033\u0030\u0036\u0036",NewRFC3066 );_f .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0050\u006f\u0069n\u0074",NewPoint );_f .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0049S\u004f\u0033\u0031\u0036\u0036",NewISO3166 );_f .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0042\u006f\u0078",NewBox );_f .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0054\u0047\u004e",NewTGN );_f .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0065\u006c\u0065\u006de\u006e\u0074\u004f\u0072\u0052\u0065\u0066\u0069\u006e\u0065m\u0065n\u0074\u0043\u006f\u006e\u0074\u0061\u0069n\u0065\u0072",NewElementOrRefinementContainer );_f .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","e\u006c\u0065\u006d\u0065\u006e\u0074s\u0041\u006e\u0064\u0052\u0065\u0066\u0069\u006e\u0065m\u0065\u006e\u0074s\u0047r\u006f\u0075\u0070",NewElementsAndRefinementsGroup );};
|
||||
func (_fabc *W3CDTF )Validate ()error {return _fabc .ValidateWithPath ("\u0057\u0033\u0043\u0044\u0054\u0046");};
|
||||
|
||||
// Validate validates the LCSH and its children
|
||||
func (_ffa *LCSH )Validate ()error {return _ffa .ValidateWithPath ("\u004c\u0043\u0053\u0048")};func (_def *URI )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_faec ,_bbd :=d .Token ();if _bbd !=nil {return _c .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0055\u0052\u0049\u003a\u0020\u0025\u0073",_bbd );};if _dbb ,_agg :=_faec .(_g .EndElement );_agg &&_dbb .Name ==start .Name {break ;};};return nil ;};func (_ebc *LCSH )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_gfdf ,_bcbe :=d .Token ();if _bcbe !=nil {return _c .Errorf ("\u0070\u0061r\u0073\u0069\u006eg\u0020\u004c\u0043\u0053\u0048\u003a\u0020\u0025\u0073",_bcbe );};if _egc ,_ced :=_gfdf .(_g .EndElement );_ced &&_egc .Name ==start .Name {break ;};};return nil ;};
|
||||
|
||||
// ValidateWithPath validates the ISO639_2 and its children, prefixing error messages with path
|
||||
func (_aag *ISO639_2 )ValidateWithPath (path string )error {return nil };
|
||||
|
||||
// Validate validates the ElementsAndRefinementsGroupChoice and its children
|
||||
func (_ccc *ElementsAndRefinementsGroupChoice )Validate ()error {return _ccc .ValidateWithPath ("\u0045\u006c\u0065\u006d\u0065\u006et\u0073\u0041\u006e\u0064\u0052\u0065\u0066\u0069\u006e\u0065\u006d\u0065\u006et\u0073\u0047\u0072\u006f\u0075\u0070\u0043h\u006f\u0069\u0063\u0065");};func NewURI ()*URI {_aad :=&URI {};return _aad };func NewDCMIType ()*DCMIType {_ggc :=&DCMIType {};return _ggc };func (_ade *Period )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_egb ,_dff :=d .Token ();if _dff !=nil {return _c .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0050e\u0072\u0069o\u0064\u003a\u0020\u0025\u0073",_dff );};if _acd ,_agb :=_egb .(_g .EndElement );_agb &&_acd .Name ==start .Name {break ;};};return nil ;};func NewTGN ()*TGN {_ddag :=&TGN {};return _ddag };type ISO639_2 struct{};func (_adf *ISO3166 )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_ce ,_eba :=d .Token ();if _eba !=nil {return _c .Errorf ("\u0070\u0061\u0072\u0073in\u0067\u0020\u0049\u0053\u004f\u0033\u0031\u0036\u0036\u003a\u0020\u0025\u0073",_eba );};if _aba ,_edg :=_ce .(_g .EndElement );_edg &&_aba .Name ==start .Name {break ;};};return nil ;};func NewRFC1766 ()*RFC1766 {_fba :=&RFC1766 {};return _fba };
|
||||
|
||||
// ValidateWithPath validates the ElementOrRefinementContainer and its children, prefixing error messages with path
|
||||
func (_gad *ElementOrRefinementContainer )ValidateWithPath (path string )error {for _cce ,_gggc :=range _gad .Choice {if _ef :=_gggc .ValidateWithPath (_c .Sprintf ("\u0025\u0073\u002f\u0043\u0068\u006f\u0069\u0063\u0065\u005b\u0025\u0064\u005d",path ,_cce ));_ef !=nil {return _ef ;};};return nil ;};
|
||||
|
||||
// Validate validates the DDC and its children
|
||||
func (_ga *DDC )Validate ()error {return _ga .ValidateWithPath ("\u0044\u0044\u0043")};func (_ggg *Box )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_ac ,_f :=d .Token ();if _f !=nil {return _c .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0042\u006f\u0078\u003a\u0020\u0025\u0073",_f );};if _e ,_ff :=_ac .(_g .EndElement );_ff &&_e .Name ==start .Name {break ;};};return nil ;};func (_aac *MESH )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u004d\u0045\u0053\u0048";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};func (_eb *DCMIType )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_cg ,_cd :=d .Token ();if _cd !=nil {return _c .Errorf ("p\u0061r\u0073\u0069\u006e\u0067\u0020\u0044\u0043\u004dI\u0054\u0079\u0070\u0065: \u0025\u0073",_cd );};if _ffg ,_gf :=_cg .(_g .EndElement );_gf &&_ffg .Name ==start .Name {break ;};};return nil ;};func (_fcc *TGN )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0054\u0047\u004e";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};func NewRFC3066 ()*RFC3066 {_fgad :=&RFC3066 {};return _fgad };func (_eebc *Period )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0050\u0065\u0072\u0069\u006f\u0064";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};
|
||||
|
||||
// Validate validates the RFC3066 and its children
|
||||
func (_ege *RFC3066 )Validate ()error {return _ege .ValidateWithPath ("\u0052F\u0043\u0033\u0030\u0036\u0036");};
|
||||
|
||||
// ValidateWithPath validates the MESH and its children, prefixing error messages with path
|
||||
func (_fac *MESH )ValidateWithPath (path string )error {return nil };
|
||||
|
||||
// ValidateWithPath validates the URI and its children, prefixing error messages with path
|
||||
func (_dcf *URI )ValidateWithPath (path string )error {return nil };func (_dcb *LCC )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_dgg ,_aaa :=d .Token ();if _aaa !=nil {return _c .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u004c\u0043\u0043\u003a\u0020\u0025\u0073",_aaa );};if _gc ,_bfe :=_dgg .(_g .EndElement );_bfe &&_gc .Name ==start .Name {break ;};};return nil ;};type TGN struct{};
|
||||
|
||||
// Validate validates the RFC1766 and its children
|
||||
func (_fd *RFC1766 )Validate ()error {return _fd .ValidateWithPath ("\u0052F\u0043\u0031\u0037\u0036\u0036");};func (_gfb *ElementsAndRefinementsGroup )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {if _gfb .Choice !=nil {for _ ,_cdfb :=range _gfb .Choice {_cdfb .MarshalXML (e ,_g .StartElement {});};};return nil ;};type ElementsAndRefinementsGroupChoice struct{Any []*_gg .Any ;};
|
||||
|
||||
// Validate validates the ElementsAndRefinementsGroup and its children
|
||||
func (_fae *ElementsAndRefinementsGroup )Validate ()error {return _fae .ValidateWithPath ("E\u006c\u0065\u006d\u0065\u006e\u0074s\u0041\u006e\u0064\u0052\u0065\u0066\u0069\u006e\u0065m\u0065\u006e\u0074s\u0047r\u006f\u0075\u0070");};func NewUDC ()*UDC {_ada :=&UDC {};return _ada };
|
||||
|
||||
// Validate validates the URI and its children
|
||||
func (_dce *URI )Validate ()error {return _dce .ValidateWithPath ("\u0055\u0052\u0049")};func (_addc *UDC )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_ddac ,_cfg :=d .Token ();if _cfg !=nil {return _c .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0055\u0044\u0043\u003a\u0020\u0025\u0073",_cfg );};if _fcb ,_bcd :=_ddac .(_g .EndElement );_bcd &&_fcb .Name ==start .Name {break ;};};return nil ;};func NewPoint ()*Point {_eeae :=&Point {};return _eeae };
|
||||
|
||||
// Validate validates the ISO3166 and its children
|
||||
func (_fea *ISO3166 )Validate ()error {return _fea .ValidateWithPath ("\u0049S\u004f\u0033\u0031\u0036\u0036");};func NewISO3166 ()*ISO3166 {_gd :=&ISO3166 {};return _gd };func NewIMT ()*IMT {_ggb :=&IMT {};return _ggb };func (_gcc *RFC1766 )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0052F\u0043\u0031\u0037\u0036\u0036";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};func NewLCSH ()*LCSH {_gfbf :=&LCSH {};return _gfbf };type ISO3166 struct{};func NewElementsAndRefinementsGroupChoice ()*ElementsAndRefinementsGroupChoice {_da :=&ElementsAndRefinementsGroupChoice {};return _da ;};
|
||||
|
||||
// Validate validates the UDC and its children
|
||||
func (_bbf *UDC )Validate ()error {return _bbf .ValidateWithPath ("\u0055\u0044\u0043")};func (_gfe *DDC )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0044\u0044\u0043";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};
|
||||
|
||||
// ValidateWithPath validates the Point and its children, prefixing error messages with path
|
||||
func (_bgc *Point )ValidateWithPath (path string )error {return nil };func (_gfg *W3CDTF )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0057\u0033\u0043\u0044\u0054\u0046";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};func NewLCC ()*LCC {_dg :=&LCC {};return _dg };
|
||||
|
||||
// ValidateWithPath validates the W3CDTF and its children, prefixing error messages with path
|
||||
func (_beg *W3CDTF )ValidateWithPath (path string )error {return nil };
|
||||
|
||||
// Validate validates the ElementOrRefinementContainer and its children
|
||||
func (_cdf *ElementOrRefinementContainer )Validate ()error {return _cdf .ValidateWithPath ("\u0045\u006c\u0065\u006de\u006e\u0074\u004f\u0072\u0052\u0065\u0066\u0069\u006e\u0065m\u0065n\u0074\u0043\u006f\u006e\u0074\u0061\u0069n\u0065\u0072");};type RFC1766 struct{};func (_gaa *IMT )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_bcbc ,_fga :=d .Token ();if _fga !=nil {return _c .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0049\u004d\u0054\u003a\u0020\u0025\u0073",_fga );};if _eef ,_dba :=_bcbc .(_g .EndElement );_dba &&_eef .Name ==start .Name {break ;};};return nil ;};func (_bea *W3CDTF )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_cdg ,_feae :=d .Token ();if _feae !=nil {return _c .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u00573\u0043\u0044T\u0046\u003a\u0020\u0025\u0073",_feae );};if _ebg ,_abec :=_cdg .(_g .EndElement );_abec &&_ebg .Name ==start .Name {break ;};};return nil ;};type RFC3066 struct{};func (_dcd *RFC3066 )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_dca ,_ffdb :=d .Token ();if _ffdb !=nil {return _c .Errorf ("\u0070\u0061\u0072\u0073in\u0067\u0020\u0052\u0046\u0043\u0033\u0030\u0036\u0036\u003a\u0020\u0025\u0073",_ffdb );};if _gce ,_cea :=_dca .(_g .EndElement );_cea &&_gce .Name ==start .Name {break ;};};return nil ;};type ElementOrRefinementContainer struct{Choice []*ElementsAndRefinementsGroupChoice ;};
|
||||
|
||||
// Validate validates the Period and its children
|
||||
func (_eae *Period )Validate ()error {return _eae .ValidateWithPath ("\u0050\u0065\u0072\u0069\u006f\u0064");};func init (){_cc .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u004c\u0043\u0053\u0048",NewLCSH );_cc .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u004d\u0045\u0053\u0048",NewMESH );_cc .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0044\u0044\u0043",NewDDC );_cc .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u004c\u0043\u0043",NewLCC );_cc .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0055\u0044\u0043",NewUDC );_cc .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0050\u0065\u0072\u0069\u006f\u0064",NewPeriod );_cc .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0057\u0033\u0043\u0044\u0054\u0046",NewW3CDTF );_cc .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0044\u0043\u004d\u0049\u0054\u0079\u0070\u0065",NewDCMIType );_cc .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0049\u004d\u0054",NewIMT );_cc .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0055\u0052\u0049",NewURI );_cc .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0049\u0053\u004f\u0036\u0033\u0039\u002d\u0032",NewISO639_2 );_cc .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0052F\u0043\u0031\u0037\u0036\u0036",NewRFC1766 );_cc .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0052F\u0043\u0033\u0030\u0036\u0036",NewRFC3066 );_cc .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0050\u006f\u0069n\u0074",NewPoint );_cc .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0049S\u004f\u0033\u0031\u0036\u0036",NewISO3166 );_cc .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0042\u006f\u0078",NewBox );_cc .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0054\u0047\u004e",NewTGN );_cc .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0065\u006c\u0065\u006de\u006e\u0074\u004f\u0072\u0052\u0065\u0066\u0069\u006e\u0065m\u0065n\u0074\u0043\u006f\u006e\u0074\u0061\u0069n\u0065\u0072",NewElementOrRefinementContainer );_cc .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","e\u006c\u0065\u006d\u0065\u006e\u0074s\u0041\u006e\u0064\u0052\u0065\u0066\u0069\u006e\u0065m\u0065\u006e\u0074s\u0047r\u006f\u0075\u0070",NewElementsAndRefinementsGroup );};
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -9,10 +9,10 @@
|
||||
// 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 lockedCanvas ;import (_e "encoding/xml";_f "fmt";_a "github.com/unidoc/unioffice";_fg "github.com/unidoc/unioffice/schema/soo/dml";);type LockedCanvas struct{_fg .CT_GvmlGroupShape };
|
||||
|
||||
// ValidateWithPath validates the LockedCanvas and its children, prefixing error messages with path
|
||||
func (_gd *LockedCanvas )ValidateWithPath (path string )error {if _cc :=_gd .CT_GvmlGroupShape .ValidateWithPath (path );_cc !=nil {return _cc ;};return nil ;};func (_ed *LockedCanvas )MarshalXML (e *_e .Encoder ,start _e .StartElement )error {start .Attr =append (start .Attr ,_e .Attr {Name :_e .Name {Local :"\u0078\u006d\u006cn\u0073"},Value :"h\u0074\u0074\u0070\u003a\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073\u002e\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061t\u0073.\u006f\u0072\u0067\u002fd\u0072\u0061w\u0069\u006e\u0067\u006d\u006c\u002f\u0032\u0030\u0030\u0036\u002f\u006c\u006f\u0063\u006b\u0065\u0064\u0043\u0061\u006e\u0076\u0061\u0073"});start .Attr =append (start .Attr ,_e .Attr {Name :_e .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"});start .Name .Local ="\u006c\u006f\u0063k\u0065\u0064\u0043\u0061\u006e\u0076\u0061\u0073";return _ed .CT_GvmlGroupShape .MarshalXML (e ,start );};
|
||||
package lockedCanvas ;import (_e "encoding/xml";_f "fmt";_a "github.com/unidoc/unioffice";_fg "github.com/unidoc/unioffice/schema/soo/dml";);
|
||||
|
||||
// Validate validates the LockedCanvas and its children
|
||||
func (_cd *LockedCanvas )Validate ()error {return _cd .ValidateWithPath ("\u004c\u006f\u0063k\u0065\u0064\u0043\u0061\u006e\u0076\u0061\u0073");};func NewLockedCanvas ()*LockedCanvas {_ef :=&LockedCanvas {};_ef .CT_GvmlGroupShape =*_fg .NewCT_GvmlGroupShape ();return _ef ;};func (_ac *LockedCanvas )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {_ac .CT_GvmlGroupShape =*_fg .NewCT_GvmlGroupShape ();for {_ga ,_fb :=d .Token ();if _fb !=nil {return _f .Errorf ("\u0070a\u0072\u0073\u0069\u006e\u0067\u0020\u004c\u006f\u0063\u006b\u0065d\u0043\u0061\u006e\u0076\u0061\u0073\u003a\u0020\u0025\u0073",_fb );};if _ge ,_c :=_ga .(_e .EndElement );_c &&_ge .Name ==start .Name {break ;};};return nil ;};func init (){_a .RegisterConstructor ("h\u0074\u0074\u0070\u003a\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073\u002e\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061t\u0073.\u006f\u0072\u0067\u002fd\u0072\u0061w\u0069\u006e\u0067\u006d\u006c\u002f\u0032\u0030\u0030\u0036\u002f\u006c\u006f\u0063\u006b\u0065\u0064\u0043\u0061\u006e\u0076\u0061\u0073","\u006c\u006f\u0063k\u0065\u0064\u0043\u0061\u006e\u0076\u0061\u0073",NewLockedCanvas );};
|
||||
func (_bb *LockedCanvas )Validate ()error {return _bb .ValidateWithPath ("\u004c\u006f\u0063k\u0065\u0064\u0043\u0061\u006e\u0076\u0061\u0073");};
|
||||
|
||||
// ValidateWithPath validates the LockedCanvas and its children, prefixing error messages with path
|
||||
func (_cd *LockedCanvas )ValidateWithPath (path string )error {if _aege :=_cd .CT_GvmlGroupShape .ValidateWithPath (path );_aege !=nil {return _aege ;};return nil ;};func NewLockedCanvas ()*LockedCanvas {_ea :=&LockedCanvas {};_ea .CT_GvmlGroupShape =*_fg .NewCT_GvmlGroupShape ();return _ea ;};func (_ee *LockedCanvas )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {_ee .CT_GvmlGroupShape =*_fg .NewCT_GvmlGroupShape ();for {_d ,_cg :=d .Token ();if _cg !=nil {return _f .Errorf ("\u0070a\u0072\u0073\u0069\u006e\u0067\u0020\u004c\u006f\u0063\u006b\u0065d\u0043\u0061\u006e\u0076\u0061\u0073\u003a\u0020\u0025\u0073",_cg );};if _ae ,_aeg :=_d .(_e .EndElement );_aeg &&_ae .Name ==start .Name {break ;};};return nil ;};func (_b *LockedCanvas )MarshalXML (e *_e .Encoder ,start _e .StartElement )error {start .Attr =append (start .Attr ,_e .Attr {Name :_e .Name {Local :"\u0078\u006d\u006cn\u0073"},Value :"h\u0074\u0074\u0070\u003a\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073\u002e\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061t\u0073.\u006f\u0072\u0067\u002fd\u0072\u0061w\u0069\u006e\u0067\u006d\u006c\u002f\u0032\u0030\u0030\u0036\u002f\u006c\u006f\u0063\u006b\u0065\u0064\u0043\u0061\u006e\u0076\u0061\u0073"});start .Attr =append (start .Attr ,_e .Attr {Name :_e .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"});start .Name .Local ="\u006c\u006f\u0063k\u0065\u0064\u0043\u0061\u006e\u0076\u0061\u0073";return _b .CT_GvmlGroupShape .MarshalXML (e ,start );};type LockedCanvas struct{_fg .CT_GvmlGroupShape };func init (){_a .RegisterConstructor ("h\u0074\u0074\u0070\u003a\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073\u002e\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061t\u0073.\u006f\u0072\u0067\u002fd\u0072\u0061w\u0069\u006e\u0067\u006d\u006c\u002f\u0032\u0030\u0030\u0036\u002f\u006c\u006f\u0063\u006b\u0065\u0064\u0043\u0061\u006e\u0076\u0061\u0073","\u006c\u006f\u0063k\u0065\u0064\u0043\u0061\u006e\u0076\u0061\u0073",NewLockedCanvas );};
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
14484
schema/soo/sml/sml.go
14484
schema/soo/sml/sml.go
File diff suppressed because one or more lines are too long
11198
schema/soo/wml/wml.go
11198
schema/soo/wml/wml.go
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -9,28 +9,28 @@
|
||||
// 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 powerpoint ;import (_c "encoding/xml";_f "fmt";_fa "github.com/unidoc/unioffice";);
|
||||
|
||||
// ValidateWithPath validates the CT_Empty and its children, prefixing error messages with path
|
||||
func (_ff *CT_Empty )ValidateWithPath (path string )error {return nil };func (_bf *Iscomment )MarshalXML (e *_c .Encoder ,start _c .StartElement )error {start .Attr =append (start .Attr ,_c .Attr {Name :_c .Name {Local :"\u0078\u006d\u006cn\u0073"},Value :"\u0075\u0072\u006e\u003a\u0073\u0063\u0068e\u006d\u0061\u0073-\u006d\u0069\u0063\u0072o\u0073\u006f\u0066\u0074\u002d\u0063\u006f\u006d\u003a\u006f\u0066\u0066\u0069\u0063\u0065\u003a\u0070\u006f\u0077\u0065\u0072\u0070\u006f\u0069\u006e\u0074"});start .Attr =append (start .Attr ,_c .Attr {Name :_c .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"});start .Name .Local ="\u0069s\u0063\u006f\u006d\u006d\u0065\u006et";return _bf .CT_Empty .MarshalXML (e ,start );};type Iscomment struct{CT_Empty };func NewCT_Rel ()*CT_Rel {_dd :=&CT_Rel {};return _dd };
|
||||
|
||||
// Validate validates the CT_Empty and its children
|
||||
func (_dg *CT_Empty )Validate ()error {return _dg .ValidateWithPath ("\u0043\u0054\u005f\u0045\u006d\u0070\u0074\u0079");};type CT_Rel struct{IdAttr *string ;};
|
||||
|
||||
// ValidateWithPath validates the Iscomment and its children, prefixing error messages with path
|
||||
func (_dfa *Iscomment )ValidateWithPath (path string )error {if _ag :=_dfa .CT_Empty .ValidateWithPath (path );_ag !=nil {return _ag ;};return nil ;};func (_df *CT_Rel )MarshalXML (e *_c .Encoder ,start _c .StartElement )error {if _df .IdAttr !=nil {start .Attr =append (start .Attr ,_c .Attr {Name :_c .Name {Local :"\u0069\u0064"},Value :_f .Sprintf ("\u0025\u0076",*_df .IdAttr )});};e .EncodeToken (start );e .EncodeToken (_c .EndElement {Name :start .Name });return nil ;};func (_bd *CT_Rel )UnmarshalXML (d *_c .Decoder ,start _c .StartElement )error {for _ ,_ce :=range start .Attr {if _ce .Name .Local =="\u0069\u0064"{_ad ,_db :=_ce .Value ,error (nil );if _db !=nil {return _db ;};_bd .IdAttr =&_ad ;continue ;};};for {_bcc ,_fgd :=d .Token ();if _fgd !=nil {return _f .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0043T\u005f\u0052e\u006c\u003a\u0020\u0025\u0073",_fgd );};if _aa ,_e :=_bcc .(_c .EndElement );_e &&_aa .Name ==start .Name {break ;};};return nil ;};func NewCT_Empty ()*CT_Empty {_fe :=&CT_Empty {};return _fe };
|
||||
|
||||
// ValidateWithPath validates the CT_Rel and its children, prefixing error messages with path
|
||||
func (_cg *CT_Rel )ValidateWithPath (path string )error {return nil };func (_cd *Textdata )MarshalXML (e *_c .Encoder ,start _c .StartElement )error {start .Attr =append (start .Attr ,_c .Attr {Name :_c .Name {Local :"\u0078\u006d\u006cn\u0073"},Value :"\u0075\u0072\u006e\u003a\u0073\u0063\u0068e\u006d\u0061\u0073-\u006d\u0069\u0063\u0072o\u0073\u006f\u0066\u0074\u002d\u0063\u006f\u006d\u003a\u006f\u0066\u0066\u0069\u0063\u0065\u003a\u0070\u006f\u0077\u0065\u0072\u0070\u006f\u0069\u006e\u0074"});start .Attr =append (start .Attr ,_c .Attr {Name :_c .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"});start .Name .Local ="\u0074\u0065\u0078\u0074\u0064\u0061\u0074\u0061";return _cd .CT_Rel .MarshalXML (e ,start );};
|
||||
|
||||
// Validate validates the CT_Rel and its children
|
||||
func (_ga *CT_Rel )Validate ()error {return _ga .ValidateWithPath ("\u0043\u0054\u005f\u0052\u0065\u006c");};func NewTextdata ()*Textdata {_cc :=&Textdata {};_cc .CT_Rel =*NewCT_Rel ();return _cc };type Textdata struct{CT_Rel };
|
||||
|
||||
// ValidateWithPath validates the Textdata and its children, prefixing error messages with path
|
||||
func (_eg *Textdata )ValidateWithPath (path string )error {if _cf :=_eg .CT_Rel .ValidateWithPath (path );_cf !=nil {return _cf ;};return nil ;};func (_agf *Textdata )UnmarshalXML (d *_c .Decoder ,start _c .StartElement )error {_agf .CT_Rel =*NewCT_Rel ();for _ ,_gff :=range start .Attr {if _gff .Name .Local =="\u0069\u0064"{_cgb ,_ccc :=_gff .Value ,error (nil );if _ccc !=nil {return _ccc ;};_agf .IdAttr =&_cgb ;continue ;};};for {_aaa ,_bb :=d .Token ();if _bb !=nil {return _f .Errorf ("p\u0061r\u0073\u0069\u006e\u0067\u0020\u0054\u0065\u0078t\u0064\u0061\u0074\u0061: \u0025\u0073",_bb );};if _beb ,_ea :=_aaa .(_c .EndElement );_ea &&_beb .Name ==start .Name {break ;};};return nil ;};func (_a *CT_Empty )MarshalXML (e *_c .Encoder ,start _c .StartElement )error {e .EncodeToken (start );e .EncodeToken (_c .EndElement {Name :start .Name });return nil ;};func NewIscomment ()*Iscomment {_fgf :=&Iscomment {};_fgf .CT_Empty =*NewCT_Empty ();return _fgf };type CT_Empty struct{};func (_bce *Iscomment )UnmarshalXML (d *_c .Decoder ,start _c .StartElement )error {_bce .CT_Empty =*NewCT_Empty ();for {_acb ,_fc :=d .Token ();if _fc !=nil {return _f .Errorf ("p\u0061\u0072\u0073\u0069ng\u0020I\u0073\u0063\u006f\u006d\u006de\u006e\u0074\u003a\u0020\u0025\u0073",_fc );};if _da ,_ffe :=_acb .(_c .EndElement );_ffe &&_da .Name ==start .Name {break ;};};return nil ;};func (_bc *CT_Empty )UnmarshalXML (d *_c .Decoder ,start _c .StartElement )error {for {_fg ,_be :=d .Token ();if _be !=nil {return _f .Errorf ("p\u0061r\u0073\u0069\u006e\u0067\u0020\u0043\u0054\u005fE\u006d\u0070\u0074\u0079: \u0025\u0073",_be );};if _d ,_ac :=_fg .(_c .EndElement );_ac &&_d .Name ==start .Name {break ;};};return nil ;};
|
||||
package powerpoint ;import (_f "encoding/xml";_e "fmt";_a "github.com/unidoc/unioffice";);func (_eb *CT_Empty )UnmarshalXML (d *_f .Decoder ,start _f .StartElement )error {for {_dc ,_b :=d .Token ();if _b !=nil {return _e .Errorf ("p\u0061r\u0073\u0069\u006e\u0067\u0020\u0043\u0054\u005fE\u006d\u0070\u0074\u0079: \u0025\u0073",_b );};if _bg ,_fa :=_dc .(_f .EndElement );_fa &&_bg .Name ==start .Name {break ;};};return nil ;};
|
||||
|
||||
// Validate validates the Iscomment and its children
|
||||
func (_cb *Iscomment )Validate ()error {return _cb .ValidateWithPath ("\u0049s\u0063\u006f\u006d\u006d\u0065\u006et");};
|
||||
func (_bdb *Iscomment )Validate ()error {return _bdb .ValidateWithPath ("\u0049s\u0063\u006f\u006d\u006d\u0065\u006et");};func (_dab *Textdata )UnmarshalXML (d *_f .Decoder ,start _f .StartElement )error {_dab .CT_Rel =*NewCT_Rel ();for _ ,_bb :=range start .Attr {if _bb .Name .Local =="\u0069\u0064"{_ebf ,_db :=_bb .Value ,error (nil );if _db !=nil {return _db ;};_dab .IdAttr =&_ebf ;continue ;};};for {_gb ,_cc :=d .Token ();if _cc !=nil {return _e .Errorf ("p\u0061r\u0073\u0069\u006e\u0067\u0020\u0054\u0065\u0078t\u0064\u0061\u0074\u0061: \u0025\u0073",_cc );};if _ba ,_eae :=_gb .(_f .EndElement );_eae &&_ba .Name ==start .Name {break ;};};return nil ;};
|
||||
|
||||
// Validate validates the CT_Rel and its children
|
||||
func (_ad *CT_Rel )Validate ()error {return _ad .ValidateWithPath ("\u0043\u0054\u005f\u0052\u0065\u006c");};func (_ab *CT_Empty )MarshalXML (e *_f .Encoder ,start _f .StartElement )error {e .EncodeToken (start );e .EncodeToken (_f .EndElement {Name :start .Name });return nil ;};func NewCT_Empty ()*CT_Empty {_d :=&CT_Empty {};return _d };func NewCT_Rel ()*CT_Rel {_be :=&CT_Rel {};return _be };func (_bc *Iscomment )UnmarshalXML (d *_f .Decoder ,start _f .StartElement )error {_bc .CT_Empty =*NewCT_Empty ();for {_bd ,_cdd :=d .Token ();if _cdd !=nil {return _e .Errorf ("p\u0061\u0072\u0073\u0069ng\u0020I\u0073\u0063\u006f\u006d\u006de\u006e\u0074\u003a\u0020\u0025\u0073",_cdd );};if _ac ,_ea :=_bd .(_f .EndElement );_ea &&_ac .Name ==start .Name {break ;};};return nil ;};func (_ca *CT_Rel )MarshalXML (e *_f .Encoder ,start _f .StartElement )error {if _ca .IdAttr !=nil {start .Attr =append (start .Attr ,_f .Attr {Name :_f .Name {Local :"\u0069\u0064"},Value :_e .Sprintf ("\u0025\u0076",*_ca .IdAttr )});};e .EncodeToken (start );e .EncodeToken (_f .EndElement {Name :start .Name });return nil ;};type CT_Empty struct{};
|
||||
|
||||
// Validate validates the CT_Empty and its children
|
||||
func (_eg *CT_Empty )Validate ()error {return _eg .ValidateWithPath ("\u0043\u0054\u005f\u0045\u006d\u0070\u0074\u0079");};type CT_Rel struct{IdAttr *string ;};type Textdata struct{CT_Rel };type Iscomment struct{CT_Empty };
|
||||
|
||||
// Validate validates the Textdata and its children
|
||||
func (_ca *Textdata )Validate ()error {return _ca .ValidateWithPath ("\u0054\u0065\u0078\u0074\u0064\u0061\u0074\u0061");};func init (){_fa .RegisterConstructor ("\u0075\u0072\u006e\u003a\u0073\u0063\u0068e\u006d\u0061\u0073-\u006d\u0069\u0063\u0072o\u0073\u006f\u0066\u0074\u002d\u0063\u006f\u006d\u003a\u006f\u0066\u0066\u0069\u0063\u0065\u003a\u0070\u006f\u0077\u0065\u0072\u0070\u006f\u0069\u006e\u0074","\u0043\u0054\u005f\u0045\u006d\u0070\u0074\u0079",NewCT_Empty );_fa .RegisterConstructor ("\u0075\u0072\u006e\u003a\u0073\u0063\u0068e\u006d\u0061\u0073-\u006d\u0069\u0063\u0072o\u0073\u006f\u0066\u0074\u002d\u0063\u006f\u006d\u003a\u006f\u0066\u0066\u0069\u0063\u0065\u003a\u0070\u006f\u0077\u0065\u0072\u0070\u006f\u0069\u006e\u0074","\u0043\u0054\u005f\u0052\u0065\u006c",NewCT_Rel );_fa .RegisterConstructor ("\u0075\u0072\u006e\u003a\u0073\u0063\u0068e\u006d\u0061\u0073-\u006d\u0069\u0063\u0072o\u0073\u006f\u0066\u0074\u002d\u0063\u006f\u006d\u003a\u006f\u0066\u0066\u0069\u0063\u0065\u003a\u0070\u006f\u0077\u0065\u0072\u0070\u006f\u0069\u006e\u0074","\u0069s\u0063\u006f\u006d\u006d\u0065\u006et",NewIscomment );_fa .RegisterConstructor ("\u0075\u0072\u006e\u003a\u0073\u0063\u0068e\u006d\u0061\u0073-\u006d\u0069\u0063\u0072o\u0073\u006f\u0066\u0074\u002d\u0063\u006f\u006d\u003a\u006f\u0066\u0066\u0069\u0063\u0065\u003a\u0070\u006f\u0077\u0065\u0072\u0070\u006f\u0069\u006e\u0074","\u0074\u0065\u0078\u0074\u0064\u0061\u0074\u0061",NewTextdata );};
|
||||
func (_ff *Textdata )Validate ()error {return _ff .ValidateWithPath ("\u0054\u0065\u0078\u0074\u0064\u0061\u0074\u0061");};func NewIscomment ()*Iscomment {_g :=&Iscomment {};_g .CT_Empty =*NewCT_Empty ();return _g };
|
||||
|
||||
// ValidateWithPath validates the CT_Rel and its children, prefixing error messages with path
|
||||
func (_adg *CT_Rel )ValidateWithPath (path string )error {return nil };func (_dg *Textdata )MarshalXML (e *_f .Encoder ,start _f .StartElement )error {start .Attr =append (start .Attr ,_f .Attr {Name :_f .Name {Local :"\u0078\u006d\u006cn\u0073"},Value :"\u0075\u0072\u006e\u003a\u0073\u0063\u0068e\u006d\u0061\u0073-\u006d\u0069\u0063\u0072o\u0073\u006f\u0066\u0074\u002d\u0063\u006f\u006d\u003a\u006f\u0066\u0066\u0069\u0063\u0065\u003a\u0070\u006f\u0077\u0065\u0072\u0070\u006f\u0069\u006e\u0074"});start .Attr =append (start .Attr ,_f .Attr {Name :_f .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"});start .Name .Local ="\u0074\u0065\u0078\u0074\u0064\u0061\u0074\u0061";return _dg .CT_Rel .MarshalXML (e ,start );};
|
||||
|
||||
// ValidateWithPath validates the Textdata and its children, prefixing error messages with path
|
||||
func (_bgac *Textdata )ValidateWithPath (path string )error {if _gc :=_bgac .CT_Rel .ValidateWithPath (path );_gc !=nil {return _gc ;};return nil ;};func (_cf *CT_Rel )UnmarshalXML (d *_f .Decoder ,start _f .StartElement )error {for _ ,_bga :=range start .Attr {if _bga .Name .Local =="\u0069\u0064"{_ce ,_ag :=_bga .Value ,error (nil );if _ag !=nil {return _ag ;};_cf .IdAttr =&_ce ;continue ;};};for {_ed ,_da :=d .Token ();if _da !=nil {return _e .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0043T\u005f\u0052e\u006c\u003a\u0020\u0025\u0073",_da );};if _ebd ,_cg :=_ed .(_f .EndElement );_cg &&_ebd .Name ==start .Name {break ;};};return nil ;};
|
||||
|
||||
// ValidateWithPath validates the CT_Empty and its children, prefixing error messages with path
|
||||
func (_fg *CT_Empty )ValidateWithPath (path string )error {return nil };func (_cd *Iscomment )MarshalXML (e *_f .Encoder ,start _f .StartElement )error {start .Attr =append (start .Attr ,_f .Attr {Name :_f .Name {Local :"\u0078\u006d\u006cn\u0073"},Value :"\u0075\u0072\u006e\u003a\u0073\u0063\u0068e\u006d\u0061\u0073-\u006d\u0069\u0063\u0072o\u0073\u006f\u0066\u0074\u002d\u0063\u006f\u006d\u003a\u006f\u0066\u0066\u0069\u0063\u0065\u003a\u0070\u006f\u0077\u0065\u0072\u0070\u006f\u0069\u006e\u0074"});start .Attr =append (start .Attr ,_f .Attr {Name :_f .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"});start .Name .Local ="\u0069s\u0063\u006f\u006d\u006d\u0065\u006et";return _cd .CT_Empty .MarshalXML (e ,start );};
|
||||
|
||||
// ValidateWithPath validates the Iscomment and its children, prefixing error messages with path
|
||||
func (_dd *Iscomment )ValidateWithPath (path string )error {if _fgf :=_dd .CT_Empty .ValidateWithPath (path );_fgf !=nil {return _fgf ;};return nil ;};func NewTextdata ()*Textdata {_cfa :=&Textdata {};_cfa .CT_Rel =*NewCT_Rel ();return _cfa };func init (){_a .RegisterConstructor ("\u0075\u0072\u006e\u003a\u0073\u0063\u0068e\u006d\u0061\u0073-\u006d\u0069\u0063\u0072o\u0073\u006f\u0066\u0074\u002d\u0063\u006f\u006d\u003a\u006f\u0066\u0066\u0069\u0063\u0065\u003a\u0070\u006f\u0077\u0065\u0072\u0070\u006f\u0069\u006e\u0074","\u0043\u0054\u005f\u0045\u006d\u0070\u0074\u0079",NewCT_Empty );_a .RegisterConstructor ("\u0075\u0072\u006e\u003a\u0073\u0063\u0068e\u006d\u0061\u0073-\u006d\u0069\u0063\u0072o\u0073\u006f\u0066\u0074\u002d\u0063\u006f\u006d\u003a\u006f\u0066\u0066\u0069\u0063\u0065\u003a\u0070\u006f\u0077\u0065\u0072\u0070\u006f\u0069\u006e\u0074","\u0043\u0054\u005f\u0052\u0065\u006c",NewCT_Rel );_a .RegisterConstructor ("\u0075\u0072\u006e\u003a\u0073\u0063\u0068e\u006d\u0061\u0073-\u006d\u0069\u0063\u0072o\u0073\u006f\u0066\u0074\u002d\u0063\u006f\u006d\u003a\u006f\u0066\u0066\u0069\u0063\u0065\u003a\u0070\u006f\u0077\u0065\u0072\u0070\u006f\u0069\u006e\u0074","\u0069s\u0063\u006f\u006d\u006d\u0065\u006et",NewIscomment );_a .RegisterConstructor ("\u0075\u0072\u006e\u003a\u0073\u0063\u0068e\u006d\u0061\u0073-\u006d\u0069\u0063\u0072o\u0073\u006f\u0066\u0074\u002d\u0063\u006f\u006d\u003a\u006f\u0066\u0066\u0069\u0063\u0065\u003a\u0070\u006f\u0077\u0065\u0072\u0070\u006f\u0069\u006e\u0074","\u0074\u0065\u0078\u0074\u0064\u0061\u0074\u0061",NewTextdata );};
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
24
spreadsheet/convert/convert.go
Normal file
24
spreadsheet/convert/convert.go
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -9,46 +9,46 @@
|
||||
// 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 reference ;import (_b "errors";_bc "fmt";_ae "github.com/unidoc/unioffice/spreadsheet/update";_d "regexp";_g "strconv";_be "strings";);
|
||||
|
||||
// ParseColumnReference parses a column reference of the form 'Sheet1!A' and splits it
|
||||
// into sheet name and column segments.
|
||||
func ParseColumnReference (s string )(ColumnReference ,error ){s =_be .TrimSpace (s );if len (s )< 1{return ColumnReference {},_b .New ("\u0063\u006f\u006c\u0075\u006d\u006e \u0072\u0065\u0066\u0065\u0072\u0065\u006e\u0063\u0065\u0020\u006d\u0075\u0073\u0074\u0020\u0068\u0061\u0076\u0065\u0020a\u0074\u0020\u006c\u0065\u0061\u0073\u0074\u0020\u006f\u006e\u0065\u0020\u0063\u0068a\u0072a\u0063\u0074\u0065\u0072");};_ee :=ColumnReference {};_cf ,_gb ,_cd :=_aeg (s );if _cd !=nil {return ColumnReference {},_cd ;};if _cf !=""{_ee .SheetName =_cf ;};if _gb [0]=='$'{_ee .AbsoluteColumn =true ;_gb =_gb [1:];};if !_fc .MatchString (_gb ){return ColumnReference {},_b .New ("\u0063\u006f\u006c\u0075\u006dn\u0020\u0072\u0065\u0066\u0065\u0072\u0065\u006e\u0063\u0065\u0020\u006d\u0075s\u0074\u0020\u0062\u0065\u0020\u0062\u0065\u0074\u0077\u0065\u0065\u006e\u0020\u0041\u0020\u0061\u006e\u0064\u0020\u005a\u005a");};_ee .Column =_gb ;_ee .ColumnIdx =ColumnToIndex (_ee .Column );return _ee ,nil ;};
|
||||
|
||||
// ParseRangeReference splits a range reference of the form "A1:B5" into its
|
||||
// components.
|
||||
func ParseRangeReference (s string )(_bd ,_dd CellReference ,_fb error ){_aegd ,_ea ,_fb :=_aeg (s );if _fb !=nil {return CellReference {},CellReference {},_fb ;};_gg :=_be .Split (_ea ,"\u003a");if len (_gg )!=2{return CellReference {},CellReference {},_b .New ("i\u006ev\u0061\u006c\u0069\u0064\u0020\u0072\u0061\u006eg\u0065\u0020\u0066\u006frm\u0061\u0074");};if _aegd !=""{_gg [0]=_aegd +"\u0021"+_gg [0];_gg [1]=_aegd +"\u0021"+_gg [1];};_ed ,_fb :=ParseCellReference (_gg [0]);if _fb !=nil {return CellReference {},CellReference {},_fb ;};_fdd ,_fb :=ParseCellReference (_gg [1]);if _fb !=nil {return CellReference {},CellReference {},_fb ;};return _ed ,_fdd ,nil ;};
|
||||
|
||||
// String returns a string representation of CellReference.
|
||||
func (_f CellReference )String ()string {_fa :=make ([]byte ,0,4);if _f .AbsoluteColumn {_fa =append (_fa ,'$');};_fa =append (_fa ,_f .Column ...);if _f .AbsoluteRow {_fa =append (_fa ,'$');};_fa =_g .AppendInt (_fa ,int64 (_f .RowIdx ),10);return string (_fa );};
|
||||
|
||||
// String returns a string representation of ColumnReference.
|
||||
func (_aba ColumnReference )String ()string {_e :=make ([]byte ,0,4);if _aba .AbsoluteColumn {_e =append (_e ,'$');};_e =append (_e ,_aba .Column ...);return string (_e );};
|
||||
package reference ;import (_d "errors";_e "fmt";_b "github.com/unidoc/unioffice/spreadsheet/update";_g "regexp";_df "strconv";_ge "strings";);
|
||||
|
||||
// ParseCellReference parses a cell reference of the form 'A10' and splits it
|
||||
// into column/row segments.
|
||||
func ParseCellReference (s string )(CellReference ,error ){s =_be .TrimSpace (s );if len (s )< 2{return CellReference {},_b .New ("\u0063\u0065\u006c\u006c\u0020\u0072\u0065\u0066e\u0072\u0065\u006ece\u0020\u006d\u0075\u0073\u0074\u0020h\u0061\u0076\u0065\u0020\u0061\u0074\u0020\u006c\u0065\u0061\u0073\u0074\u0020\u0074\u0077o\u0020\u0063\u0068\u0061\u0072\u0061\u0063\u0074e\u0072\u0073");};_de :=CellReference {};_c ,_fd ,_db :=_aeg (s );if _db !=nil {return CellReference {},_db ;};if _c !=""{_de .SheetName =_c ;};if s [0]=='$'{_de .AbsoluteColumn =true ;_fd =_fd [1:];};_ce :=-1;_bcc :for _dc :=0;_dc < len (_fd );_dc ++{switch {case _fd [_dc ]>='0'&&_fd [_dc ]<='9'||_fd [_dc ]=='$':_ce =_dc ;break _bcc ;};};switch _ce {case 0:return CellReference {},_bc .Errorf ("\u006e\u006f\u0020\u006cet\u0074\u0065\u0072\u0020\u0070\u0072\u0065\u0066\u0069\u0078\u0020\u0069\u006e\u0020%\u0073",_fd );case -1:return CellReference {},_bc .Errorf ("\u006eo\u0020d\u0069\u0067\u0069\u0074\u0073\u0020\u0069\u006e\u0020\u0025\u0073",_fd );};_de .Column =_fd [0:_ce ];if _fd [_ce ]=='$'{_de .AbsoluteRow =true ;_ce ++;};_de .ColumnIdx =ColumnToIndex (_de .Column );_ab ,_db :=_g .ParseUint (_fd [_ce :],10,32);if _db !=nil {return CellReference {},_bc .Errorf ("e\u0072\u0072\u006f\u0072 p\u0061r\u0073\u0069\u006e\u0067\u0020r\u006f\u0077\u003a\u0020\u0025\u0073",_db );};if _ab ==0{return CellReference {},_bc .Errorf ("\u0065\u0072\u0072\u006f\u0072\u0020\u0070\u0061\u0072\u0073i\u006e\u0067\u0020\u0072\u006f\u0077\u003a \u0063\u0061\u006e\u006e\u006f\u0074\u0020\u0062\u0065\u0020\u0030");};_de .RowIdx =uint32 (_ab );return _de ,nil ;};
|
||||
func ParseCellReference (s string )(CellReference ,error ){s =_ge .TrimSpace (s );if len (s )< 2{return CellReference {},_d .New ("\u0063\u0065\u006c\u006c\u0020\u0072\u0065\u0066e\u0072\u0065\u006ece\u0020\u006d\u0075\u0073\u0074\u0020h\u0061\u0076\u0065\u0020\u0061\u0074\u0020\u006c\u0065\u0061\u0073\u0074\u0020\u0074\u0077o\u0020\u0063\u0068\u0061\u0072\u0061\u0063\u0074e\u0072\u0073");};_ba :=CellReference {};_ec ,_gec ,_ff :=_aa (s );if _ff !=nil {return CellReference {},_ff ;};if _ec !=""{_ba .SheetName =_ec ;};if s [0]=='$'{_ba .AbsoluteColumn =true ;_gec =_gec [1:];};_cc :=-1;_cd :for _fc :=0;_fc < len (_gec );_fc ++{switch {case _gec [_fc ]>='0'&&_gec [_fc ]<='9'||_gec [_fc ]=='$':_cc =_fc ;break _cd ;};};switch _cc {case 0:return CellReference {},_e .Errorf ("\u006e\u006f\u0020\u006cet\u0074\u0065\u0072\u0020\u0070\u0072\u0065\u0066\u0069\u0078\u0020\u0069\u006e\u0020%\u0073",_gec );case -1:return CellReference {},_e .Errorf ("\u006eo\u0020d\u0069\u0067\u0069\u0074\u0073\u0020\u0069\u006e\u0020\u0025\u0073",_gec );};_ba .Column =_gec [0:_cc ];if _gec [_cc ]=='$'{_ba .AbsoluteRow =true ;_cc ++;};_ba .ColumnIdx =ColumnToIndex (_ba .Column );_cg ,_ff :=_df .ParseUint (_gec [_cc :],10,32);if _ff !=nil {return CellReference {},_e .Errorf ("e\u0072\u0072\u006f\u0072 p\u0061r\u0073\u0069\u006e\u0067\u0020r\u006f\u0077\u003a\u0020\u0025\u0073",_ff );};if _cg ==0{return CellReference {},_e .Errorf ("\u0065\u0072\u0072\u006f\u0072\u0020\u0070\u0061\u0072\u0073i\u006e\u0067\u0020\u0072\u006f\u0077\u003a \u0063\u0061\u006e\u006e\u006f\u0074\u0020\u0062\u0065\u0020\u0030");};_ba .RowIdx =uint32 (_cg );return _ba ,nil ;};
|
||||
|
||||
// IndexToColumn maps a column number to a column name (e.g. 0 = A, 1 = B, 26 = AA)
|
||||
func IndexToColumn (col uint32 )string {var _bad [64+1]byte ;_bg :=len (_bad );_dbc :=col ;const _gd =26;for _dbc >=_gd {_bg --;_ff :=_dbc /_gd ;_bad [_bg ]=byte ('A'+uint (_dbc -_ff *_gd ));_dbc =_ff -1;};_bg --;_bad [_bg ]=byte ('A'+uint (_dbc ));return string (_bad [_bg :]);};
|
||||
|
||||
// Update updates reference to point one of the neighboring columns with respect to the update type after removing a row/column.
|
||||
func (_fac *ColumnReference )Update (updateType _ae .UpdateAction )*ColumnReference {switch updateType {case _ae .UpdateActionRemoveColumn :_aa :=_fac ;_aa .ColumnIdx =_fac .ColumnIdx -1;_aa .Column =IndexToColumn (_aa .ColumnIdx );return _aa ;default:return _fac ;};};var _fc =_d .MustCompile ("^\u005b\u0061\u002d\u007aA-\u005a]\u0028\u005b\u0061\u002d\u007aA\u002d\u005a\u005d\u003f\u0029\u0024");
|
||||
|
||||
// CellReference is a parsed reference to a cell. Input is of the form 'A1',
|
||||
// '$C$2', etc.
|
||||
type CellReference struct{RowIdx uint32 ;ColumnIdx uint32 ;Column string ;AbsoluteColumn bool ;AbsoluteRow bool ;SheetName string ;};
|
||||
|
||||
// ColumnToIndex maps a column to a zero based index (e.g. A = 0, B = 1, AA = 26)
|
||||
func ColumnToIndex (col string )uint32 {col =_be .ToUpper (col );_ba :=uint32 (0);for _ ,_ge :=range col {_ba *=26;_ba +=uint32 (_ge -'A'+1);};return _ba -1;};
|
||||
// Update updates reference to point one of the neighboring cells with respect to the update type after removing a row/column.
|
||||
func (_ccg *CellReference )Update (updateType _b .UpdateAction )*CellReference {switch updateType {case _b .UpdateActionRemoveColumn :_a :=_ccg ;_a .ColumnIdx =_ccg .ColumnIdx -1;_a .Column =IndexToColumn (_a .ColumnIdx );return _a ;default:return _ccg ;};};
|
||||
|
||||
// ColumnReference is a parsed reference to a column. Input is of the form 'A',
|
||||
// '$C', etc.
|
||||
type ColumnReference struct{ColumnIdx uint32 ;Column string ;AbsoluteColumn bool ;SheetName string ;};
|
||||
|
||||
// Update updates reference to point one of the neighboring columns with respect to the update type after removing a row/column.
|
||||
func (_bf *ColumnReference )Update (updateType _b .UpdateAction )*ColumnReference {switch updateType {case _b .UpdateActionRemoveColumn :_ae :=_bf ;_ae .ColumnIdx =_bf .ColumnIdx -1;_ae .Column =IndexToColumn (_ae .ColumnIdx );return _ae ;default:return _bf ;};};
|
||||
|
||||
// String returns a string representation of ColumnReference.
|
||||
func (_cgd ColumnReference )String ()string {_gb :=make ([]byte ,0,4);if _cgd .AbsoluteColumn {_gb =append (_gb ,'$');};_gb =append (_gb ,_cgd .Column ...);return string (_gb );};
|
||||
|
||||
// CellReference is a parsed reference to a cell. Input is of the form 'A1',
|
||||
// '$C$2', etc.
|
||||
type CellReference struct{RowIdx uint32 ;ColumnIdx uint32 ;Column string ;AbsoluteColumn bool ;AbsoluteRow bool ;SheetName string ;};
|
||||
|
||||
// ParseColumnReference parses a column reference of the form 'Sheet1!A' and splits it
|
||||
// into sheet name and column segments.
|
||||
func ParseColumnReference (s string )(ColumnReference ,error ){s =_ge .TrimSpace (s );if len (s )< 1{return ColumnReference {},_d .New ("\u0063\u006f\u006c\u0075\u006d\u006e \u0072\u0065\u0066\u0065\u0072\u0065\u006e\u0063\u0065\u0020\u006d\u0075\u0073\u0074\u0020\u0068\u0061\u0076\u0065\u0020a\u0074\u0020\u006c\u0065\u0061\u0073\u0074\u0020\u006f\u006e\u0065\u0020\u0063\u0068a\u0072a\u0063\u0074\u0065\u0072");};_ea :=ColumnReference {};_ee ,_ab ,_cb :=_aa (s );if _cb !=nil {return ColumnReference {},_cb ;};if _ee !=""{_ea .SheetName =_ee ;};if _ab [0]=='$'{_ea .AbsoluteColumn =true ;_ab =_ab [1:];};if !_bb .MatchString (_ab ){return ColumnReference {},_d .New ("\u0063\u006f\u006c\u0075\u006dn\u0020\u0072\u0065\u0066\u0065\u0072\u0065\u006e\u0063\u0065\u0020\u006d\u0075s\u0074\u0020\u0062\u0065\u0020\u0062\u0065\u0074\u0077\u0065\u0065\u006e\u0020\u0041\u0020\u0061\u006e\u0064\u0020\u005a\u005a");};_ea .Column =_ab ;_ea .ColumnIdx =ColumnToIndex (_ea .Column );return _ea ,nil ;};func _aa (_ac string )(string ,string ,error ){_de :="";_db :=_ge .LastIndex (_ac ,"\u0021");if _db > -1{_de =_ac [:_db ];_ac =_ac [_db +1:];if _de ==""{return "","",_d .New ("\u0049n\u0076a\u006c\u0069\u0064\u0020\u0073h\u0065\u0065t\u0020\u006e\u0061\u006d\u0065");};};return _de ,_ac ,nil ;};var _bb =_g .MustCompile ("^\u005b\u0061\u002d\u007aA-\u005a]\u0028\u005b\u0061\u002d\u007aA\u002d\u005a\u005d\u003f\u0029\u0024");
|
||||
|
||||
// IndexToColumn maps a column number to a column name (e.g. 0 = A, 1 = B, 26 = AA)
|
||||
func IndexToColumn (col uint32 )string {var _fcf [64+1]byte ;_ag :=len (_fcf );_bd :=col ;const _cde =26;for _bd >=_cde {_ag --;_ffe :=_bd /_cde ;_fcf [_ag ]=byte ('A'+uint (_bd -_ffe *_cde ));_bd =_ffe -1;};_ag --;_fcf [_ag ]=byte ('A'+uint (_bd ));return string (_fcf [_ag :]);};
|
||||
|
||||
// String returns a string representation of CellReference.
|
||||
func (_f CellReference )String ()string {_fa :=make ([]byte ,0,4);if _f .AbsoluteColumn {_fa =append (_fa ,'$');};_fa =append (_fa ,_f .Column ...);if _f .AbsoluteRow {_fa =append (_fa ,'$');};_fa =_df .AppendInt (_fa ,int64 (_f .RowIdx ),10);return string (_fa );};
|
||||
|
||||
// ParseColumnRangeReference splits a range reference of the form "A:B" into its
|
||||
// components.
|
||||
func ParseColumnRangeReference (s string )(_adf ,_fff ColumnReference ,_dbe error ){_cea :="";_ag :=_be .Split (s ,"\u0021");if len (_ag )==2{_cea =_ag [0];s =_ag [1];};_eg :=_be .Split (s ,"\u003a");if len (_eg )!=2{return ColumnReference {},ColumnReference {},_b .New ("i\u006ev\u0061\u006c\u0069\u0064\u0020\u0072\u0061\u006eg\u0065\u0020\u0066\u006frm\u0061\u0074");};if _cea !=""{_eg [0]=_cea +"\u0021"+_eg [0];_eg [1]=_cea +"\u0021"+_eg [1];};_gbf ,_dbe :=ParseColumnReference (_eg [0]);if _dbe !=nil {return ColumnReference {},ColumnReference {},_dbe ;};_ca ,_dbe :=ParseColumnReference (_eg [1]);if _dbe !=nil {return ColumnReference {},ColumnReference {},_dbe ;};return _gbf ,_ca ,nil ;};func _aeg (_aaa string )(string ,string ,error ){_ffa :="";_ad :=_be .LastIndex (_aaa ,"\u0021");if _ad > -1{_ffa =_aaa [:_ad ];_aaa =_aaa [_ad +1:];if _ffa ==""{return "","",_b .New ("\u0049n\u0076a\u006c\u0069\u0064\u0020\u0073h\u0065\u0065t\u0020\u006e\u0061\u006d\u0065");};};return _ffa ,_aaa ,nil ;};
|
||||
func ParseColumnRangeReference (s string )(_eg ,_fd ColumnReference ,_gc error ){_gba :="";_ggb :=_ge .Split (s ,"\u0021");if len (_ggb )==2{_gba =_ggb [0];s =_ggb [1];};_cda :=_ge .Split (s ,"\u003a");if len (_cda )!=2{return ColumnReference {},ColumnReference {},_d .New ("i\u006ev\u0061\u006c\u0069\u0064\u0020\u0072\u0061\u006eg\u0065\u0020\u0066\u006frm\u0061\u0074");};if _gba !=""{_cda [0]=_gba +"\u0021"+_cda [0];_cda [1]=_gba +"\u0021"+_cda [1];};_cf ,_gc :=ParseColumnReference (_cda [0]);if _gc !=nil {return ColumnReference {},ColumnReference {},_gc ;};_fb ,_gc :=ParseColumnReference (_cda [1]);if _gc !=nil {return ColumnReference {},ColumnReference {},_gc ;};return _cf ,_fb ,nil ;};
|
||||
|
||||
// Update updates reference to point one of the neighboring cells with respect to the update type after removing a row/column.
|
||||
func (_beg *CellReference )Update (updateType _ae .UpdateAction )*CellReference {switch updateType {case _ae .UpdateActionRemoveColumn :_dbb :=_beg ;_dbb .ColumnIdx =_beg .ColumnIdx -1;_dbb .Column =IndexToColumn (_dbb .ColumnIdx );return _dbb ;default:return _beg ;};};
|
||||
// ColumnToIndex maps a column to a zero based index (e.g. A = 0, B = 1, AA = 26)
|
||||
func ColumnToIndex (col string )uint32 {col =_ge .ToUpper (col );_gg :=uint32 (0);for _ ,_ffb :=range col {_gg *=26;_gg +=uint32 (_ffb -'A'+1);};return _gg -1;};
|
||||
|
||||
// ParseRangeReference splits a range reference of the form "A1:B5" into its
|
||||
// components.
|
||||
func ParseRangeReference (s string )(_bc ,_dbb CellReference ,_bfe error ){_dee ,_bbc ,_bfe :=_aa (s );if _bfe !=nil {return CellReference {},CellReference {},_bfe ;};_fe :=_ge .Split (_bbc ,"\u003a");if len (_fe )!=2{return CellReference {},CellReference {},_d .New ("i\u006ev\u0061\u006c\u0069\u0064\u0020\u0072\u0061\u006eg\u0065\u0020\u0066\u006frm\u0061\u0074");};if _dee !=""{_fe [0]=_dee +"\u0021"+_fe [0];_fe [1]=_dee +"\u0021"+_fe [1];};_ecd ,_bfe :=ParseCellReference (_fe [0]);if _bfe !=nil {return CellReference {},CellReference {},_bfe ;};_dbe ,_bfe :=ParseCellReference (_fe [1]);if _bfe !=nil {return CellReference {},CellReference {},_bfe ;};return _ecd ,_dbe ,nil ;};
|
File diff suppressed because one or more lines are too long
@ -13,7 +13,7 @@
|
||||
package update ;
|
||||
|
||||
// UpdateAction is the type for update types constants.
|
||||
type UpdateAction byte ;
|
||||
type UpdateAction byte ;const (UpdateActionRemoveColumn UpdateAction =iota ;);
|
||||
|
||||
// UpdateQuery contains terms of how to update references after removing row/column.
|
||||
type UpdateQuery struct{
|
||||
@ -28,4 +28,4 @@ ColumnIdx uint32 ;
|
||||
SheetToUpdate string ;
|
||||
|
||||
// UpdateCurrentSheet is true if references without sheet prefix should be updated as well.
|
||||
UpdateCurrentSheet bool ;};const (UpdateActionRemoveColumn UpdateAction =iota ;);
|
||||
UpdateCurrentSheet bool ;};
|
122
unioffice.go
122
unioffice.go
File diff suppressed because one or more lines are too long
@ -9,68 +9,68 @@
|
||||
// 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";_b "fmt";_g "github.com/unidoc/unioffice";_c "github.com/unidoc/unioffice/schema/soo/ofc/sharedTypes";_bd "github.com/unidoc/unioffice/schema/urn/schemas_microsoft_com/office/excel";_eb "github.com/unidoc/unioffice/schema/urn/schemas_microsoft_com/vml";_bf "strconv";_ag "strings";);
|
||||
package vmldrawing ;import (_ce "encoding/xml";_f "fmt";_b "github.com/unidoc/unioffice";_gb "github.com/unidoc/unioffice/schema/soo/ofc/sharedTypes";_e "github.com/unidoc/unioffice/schema/urn/schemas_microsoft_com/office/excel";_ga "github.com/unidoc/unioffice/schema/urn/schemas_microsoft_com/vml";_c "strconv";_g "strings";);
|
||||
|
||||
// NewShapeStyle accept value of string style attribute in v:shape and format it to generate ShapeStyle.
|
||||
func NewShapeStyle (style string )ShapeStyle {_be :=ShapeStyle {_fg :0,_bad :0};_geg :=_ag .Split (style ,"\u003b");for _ ,_dd :=range _geg {_ed :=_ag .Split (_dd ,"\u003a");if len (_ed )!=2{continue ;};switch _ed [0]{case "\u0070\u006f\u0073\u0069\u0074\u0069\u006f\u006e":_be ._ec =_ed [1];break ;case "m\u0061\u0072\u0067\u0069\u006e\u002d\u006c\u0065\u0066\u0074":_be ._bb ,_ =_bf .ParseInt (_ed [1],10,64);break ;case "\u006d\u0061\u0072\u0067\u0069\u006e\u002d\u0074\u006f\u0070":_be ._dc ,_ =_bf .ParseInt (_ed [1],10,64);break ;case "\u0077\u0069\u0064t\u0068":_be ._fg ,_ =_bf .ParseInt (_ag .ReplaceAll (_ed [1],"\u0070\u0074",""),10,64);break ;case "\u0068\u0065\u0069\u0067\u0068\u0074":_be ._bad ,_ =_bf .ParseInt (_ag .ReplaceAll (_ed [1],"\u0070\u0074",""),10,64);break ;case "\u007a-\u0069\u006e\u0064\u0065\u0078":_be ._gaa ,_ =_bf .ParseInt (_ed [1],10,64);break ;case "\u006d\u0073\u006f-p\u006f\u0073\u0069\u0074\u0069\u006f\u006e\u002d\u0068\u006f\u0072\u0069\u007a\u006f\u006e\u0074\u0061\u006c":_be ._ad =_ed [1];break ;case "\u006d\u0073\u006f\u002d\u0070\u006f\u0073\u0069\u0074\u0069\u006f\u006e\u002d\u0068\u006fr\u0069z\u006f\u006e\u0074\u0061\u006c\u002d\u0072\u0065\u006c\u0061\u0074\u0069\u0076\u0065":_be ._bab =_ed [1];break ;case "m\u0073\u006f\u002d\u0070os\u0069t\u0069\u006f\u006e\u002d\u0076e\u0072\u0074\u0069\u0063\u0061\u006c":_be ._fgd =_ed [1];break ;case "\u006d\u0073\u006f\u002d\u0070\u006f\u0073\u0069\u0074\u0069o\u006e\u002d\u0076\u0065\u0072\u0074\u0069c\u0061\u006c\u002d\u0072\u0065\u006c\u0061\u0074\u0069\u0076\u0065":_be ._dcb =_ed [1];break ;};};return _be ;};
|
||||
// ToString generate string of TextpathStyle.
|
||||
func (_gd *TextpathStyle )String ()string {_be :="";_be +=_f .Sprintf ("\u0066o\u006et\u002d\u0066\u0061\u006d\u0069\u006c\u0079\u003a\u0025\u0073\u003b",_gd ._aae );_be +=_f .Sprintf ("\u0066o\u006et\u002d\u0073\u0069\u007a\u0065\u003a\u0025\u0064\u0070\u0074\u003b",_gd ._bad );if _gd ._deac {_be +=_f .Sprintf ("\u0066o\u006et\u002d\u0073\u0074\u0079\u006ce\u003a\u0069t\u0061\u006c\u0069\u0063\u003b");};if _gd ._dga {_be +=_f .Sprintf ("\u0066\u006f\u006e\u0074\u002d\u0077\u0065\u0069\u0067\u0068\u0074\u003ab\u006f\u006c\u0064\u003b");};return _be ;};
|
||||
|
||||
// CreateFormula creates F element for typeFormulas.
|
||||
func CreateFormula (s string )*_eb .CT_F {_cac :=_eb .NewCT_F ();_cac .EqnAttr =&s ;return _cac };
|
||||
func CreateFormula (s string )*_ga .CT_F {_fdd :=_ga .NewCT_F ();_fdd .EqnAttr =&s ;return _fdd };func (_ad *Container )MarshalXML (e *_ce .Encoder ,start _ce .StartElement )error {start .Attr =append (start .Attr ,_ce .Attr {Name :_ce .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 ,_ce .Attr {Name :_ce .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 ,_ce .Attr {Name :_ce .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 _ad .Layout !=nil {_de :=_ce .StartElement {Name :_ce .Name {Local :"\u006f\u003a\u0073\u0068\u0061\u0070\u0065\u006c\u0061\u0079\u006f\u0075\u0074"}};e .EncodeElement (_ad .Layout ,_de );};if _ad .ShapeType !=nil {_ec :=_ce .StartElement {Name :_ce .Name {Local :"v\u003a\u0073\u0068\u0061\u0070\u0065\u0074\u0079\u0070\u0065"}};e .EncodeElement (_ad .ShapeType ,_ec );};for _ ,_dd :=range _ad .Shape {_db :=_ce .StartElement {Name :_ce .Name {Local :"\u0076:\u0073\u0068\u0061\u0070\u0065"}};e .EncodeElement (_dd ,_db );};return e .EncodeToken (_ce .EndElement {Name :start .Name });};
|
||||
|
||||
// ToString formatting ShapeStyle to string.
|
||||
func (_dbb *ShapeStyle )String ()string {_fge :="";_fge +=_b .Sprintf ("\u0070\u006f\u0073i\u0074\u0069\u006f\u006e\u003a\u0025\u0073\u003b",_dbb ._ec );_fge +=_b .Sprintf ("\u006da\u0072g\u0069\u006e\u002d\u006c\u0065\u0066\u0074\u003a\u0025\u0064\u003b",_dbb ._bb );_fge +=_b .Sprintf ("\u006d\u0061\u0072\u0067\u0069\u006e\u002d\u0074\u006fp\u003a\u0025\u0064\u003b",_dbb ._dc );_fge +=_b .Sprintf ("w\u0069\u0064\u0074\u0068\u003a\u0025\u0064\u0070\u0074\u003b",_dbb ._fg );_fge +=_b .Sprintf ("\u0068\u0065\u0069g\u0068\u0074\u003a\u0025\u0064\u0070\u0074\u003b",_dbb ._bad );_fge +=_b .Sprintf ("z\u002d\u0069\u006e\u0064\u0065\u0078\u003a\u0025\u0064\u003b",_dbb ._gaa );_fge +=_b .Sprintf ("m\u0073\u006f\u002d\u0070\u006f\u0073i\u0074\u0069\u006f\u006e\u002d\u0068\u006f\u0072\u0069z\u006f\u006e\u0074a\u006c:\u0025\u0073\u003b",_dbb ._ad );_fge +=_b .Sprintf ("\u006d\u0073o-\u0070\u006f\u0073i\u0074\u0069\u006f\u006e-ho\u0072iz\u006f\u006e\u0074\u0061\u006c\u002d\u0072el\u0061\u0074\u0069\u0076\u0065\u003a\u0025s\u003b",_dbb ._bab );_fge +=_b .Sprintf ("\u006ds\u006f\u002d\u0070\u006fs\u0069\u0074\u0069\u006f\u006e-\u0076e\u0072t\u0069\u0063\u0061\u006c\u003a\u0025\u0073;",_dbb ._fgd );_fge +=_b .Sprintf ("\u006d\u0073\u006f-p\u006f\u0073\u0069\u0074\u0069\u006f\u006e\u002d\u0076e\u0072t\u0069c\u0061l\u002d\u0072\u0065\u006c\u0061\u0074\u0069\u0076\u0065\u003a\u0025\u0073\u003b",_dbb ._dcb );return _fge ;};
|
||||
|
||||
// NewCommentDrawing constructs a new comment drawing.
|
||||
func NewCommentDrawing ()*Container {_ab :=NewContainer ();_ab .Layout =_eb .NewOfcShapelayout ();_ab .Layout .ExtAttr =_eb .ST_ExtEdit ;_ab .Layout .Idmap =_eb .NewOfcCT_IdMap ();_ab .Layout .Idmap .DataAttr =_g .String ("\u0031");_ab .Layout .Idmap .ExtAttr =_eb .ST_ExtEdit ;_ab .ShapeType =_eb .NewShapetype ();_ab .ShapeType .IdAttr =_g .String ("_\u0078\u0030\u0030\u0030\u0030\u005f\u0074\u0032\u0030\u0032");_ab .ShapeType .CoordsizeAttr =_g .String ("2\u0031\u0036\u0030\u0030\u002c\u0032\u0031\u0036\u0030\u0030");_ab .ShapeType .SptAttr =_g .Float32 (202);_ab .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");_ca :=_eb .NewEG_ShapeElements ();_ab .ShapeType .EG_ShapeElements =append (_ab .ShapeType .EG_ShapeElements ,_ca );_ca .Path =_eb .NewPath ();_ca .Path .GradientshapeokAttr =_c .ST_TrueFalseT ;_ca .Path .ConnecttypeAttr =_eb .OfcST_ConnectTypeRect ;return _ab ;};
|
||||
|
||||
// SetWidth set width of shape.
|
||||
func (_bbe *ShapeStyle )SetWidth (width int64 ){_bbe ._fg =width };func NewContainer ()*Container {return &Container {}};
|
||||
|
||||
// TextpathStyle is style attribute of element v:textpath.
|
||||
type TextpathStyle struct{_gdga string ;_gb int64 ;_cd bool ;_gdc bool ;};
|
||||
|
||||
// IsBold returns true if text is bold.
|
||||
func (_fgdc *TextpathStyle )IsBold ()bool {return _fgdc ._cd };
|
||||
// FontSize returns fontSize of the text.
|
||||
func (_gc *TextpathStyle )FontSize ()int64 {return _gc ._bad };
|
||||
|
||||
// Width return width of shape.
|
||||
func (_dda *ShapeStyle )Width ()int64 {return _dda ._fg };
|
||||
func (_gaa *ShapeStyle )Width ()int64 {return _gaa ._ef };
|
||||
|
||||
// SetFontSize sets text's fontSize.
|
||||
func (_eec *TextpathStyle )SetFontSize (fontSize int64 ){_eec ._bad =fontSize };
|
||||
|
||||
// NewCommentShape creates a new comment shape for a given cell index. The
|
||||
// indices here are zero based.
|
||||
func NewCommentShape (col ,row int64 )*_eb .Shape {_agg :=_eb .NewShape ();_agg .IdAttr =_g .String (_b .Sprintf ("\u0063\u0073\u005f\u0025\u0064\u005f\u0025\u0064",col ,row ));_agg .TypeAttr =_g .String ("\u0023\u005f\u00780\u0030\u0030\u0030\u005f\u0074\u0032\u0030\u0032");_agg .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");_agg .FillcolorAttr =_g .String ("\u0023f\u0062\u0066\u0036\u0064\u0036");_agg .StrokecolorAttr =_g .String ("\u0023e\u0064\u0065\u0061\u0061\u0031");_ga :=_eb .NewEG_ShapeElements ();_ga .Fill =_eb .NewFill ();_ga .Fill .Color2Attr =_g .String ("\u0023f\u0062\u0066\u0065\u0038\u0032");_ga .Fill .AngleAttr =_g .Float64 (-180);_ga .Fill .TypeAttr =_eb .ST_FillTypeGradient ;_ga .Fill .Fill =_eb .NewOfcFill ();_ga .Fill .Fill .ExtAttr =_eb .ST_ExtView ;_ga .Fill .Fill .TypeAttr =_eb .OfcST_FillTypeGradientUnscaled ;_agg .EG_ShapeElements =append (_agg .EG_ShapeElements ,_ga );_bdb :=_eb .NewEG_ShapeElements ();_bdb .Shadow =_eb .NewShadow ();_bdb .Shadow .OnAttr =_c .ST_TrueFalseT ;_bdb .Shadow .ObscuredAttr =_c .ST_TrueFalseT ;_agg .EG_ShapeElements =append (_agg .EG_ShapeElements ,_bdb );_ebd :=_eb .NewEG_ShapeElements ();_ebd .Path =_eb .NewPath ();_ebd .Path .ConnecttypeAttr =_eb .OfcST_ConnectTypeNone ;_agg .EG_ShapeElements =append (_agg .EG_ShapeElements ,_ebd );_aa :=_eb .NewEG_ShapeElements ();_aa .Textbox =_eb .NewTextbox ();_aa .Textbox .StyleAttr =_g .String ("\u006d\u0073\u006f\u002ddi\u0072\u0065\u0063\u0074\u0069\u006f\u006e\u002d\u0061\u006c\u0074\u003a\u0061\u0075t\u006f");_agg .EG_ShapeElements =append (_agg .EG_ShapeElements ,_aa );_cb :=_eb .NewEG_ShapeElements ();_cb .ClientData =_bd .NewClientData ();_cb .ClientData .ObjectTypeAttr =_bd .ST_ObjectTypeNote ;_cb .ClientData .MoveWithCells =_c .ST_TrueFalseBlankT ;_cb .ClientData .SizeWithCells =_c .ST_TrueFalseBlankT ;_cb .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");_cb .ClientData .AutoFill =_c .ST_TrueFalseBlankFalse ;_cb .ClientData .Row =_g .Int64 (row );_cb .ClientData .Column =_g .Int64 (col );_agg .EG_ShapeElements =append (_agg .EG_ShapeElements ,_cb );return _agg ;};type Container struct{Layout *_eb .OfcShapelayout ;ShapeType *_eb .Shapetype ;Shape []*_eb .Shape ;};
|
||||
func NewCommentShape (col ,row int64 )*_ga .Shape {_a :=_ga .NewShape ();_a .IdAttr =_b .String (_f .Sprintf ("\u0063\u0073\u005f\u0025\u0064\u005f\u0025\u0064",col ,row ));_a .TypeAttr =_b .String ("\u0023\u005f\u00780\u0030\u0030\u0030\u005f\u0074\u0032\u0030\u0032");_a .StyleAttr =_b .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");_a .FillcolorAttr =_b .String ("\u0023f\u0062\u0066\u0036\u0064\u0036");_a .StrokecolorAttr =_b .String ("\u0023e\u0064\u0065\u0061\u0061\u0031");_fd :=_ga .NewEG_ShapeElements ();_fd .Fill =_ga .NewFill ();_fd .Fill .Color2Attr =_b .String ("\u0023f\u0062\u0066\u0065\u0038\u0032");_fd .Fill .AngleAttr =_b .Float64 (-180);_fd .Fill .TypeAttr =_ga .ST_FillTypeGradient ;_fd .Fill .Fill =_ga .NewOfcFill ();_fd .Fill .Fill .ExtAttr =_ga .ST_ExtView ;_fd .Fill .Fill .TypeAttr =_ga .OfcST_FillTypeGradientUnscaled ;_a .EG_ShapeElements =append (_a .EG_ShapeElements ,_fd );_bb :=_ga .NewEG_ShapeElements ();_bb .Shadow =_ga .NewShadow ();_bb .Shadow .OnAttr =_gb .ST_TrueFalseT ;_bb .Shadow .ObscuredAttr =_gb .ST_TrueFalseT ;_a .EG_ShapeElements =append (_a .EG_ShapeElements ,_bb );_ff :=_ga .NewEG_ShapeElements ();_ff .Path =_ga .NewPath ();_ff .Path .ConnecttypeAttr =_ga .OfcST_ConnectTypeNone ;_a .EG_ShapeElements =append (_a .EG_ShapeElements ,_ff );_gf :=_ga .NewEG_ShapeElements ();_gf .Textbox =_ga .NewTextbox ();_gf .Textbox .StyleAttr =_b .String ("\u006d\u0073\u006f\u002ddi\u0072\u0065\u0063\u0074\u0069\u006f\u006e\u002d\u0061\u006c\u0074\u003a\u0061\u0075t\u006f");_a .EG_ShapeElements =append (_a .EG_ShapeElements ,_gf );_ba :=_ga .NewEG_ShapeElements ();_ba .ClientData =_e .NewClientData ();_ba .ClientData .ObjectTypeAttr =_e .ST_ObjectTypeNote ;_ba .ClientData .MoveWithCells =_gb .ST_TrueFalseBlankT ;_ba .ClientData .SizeWithCells =_gb .ST_TrueFalseBlankT ;_ba .ClientData .Anchor =_b .String ("\u0031,\u0020\u0031\u0035\u002c\u0020\u0030\u002c\u0020\u0032\u002c\u00202\u002c\u0020\u0035\u0034\u002c\u0020\u0035\u002c\u0020\u0033");_ba .ClientData .AutoFill =_gb .ST_TrueFalseBlankFalse ;_ba .ClientData .Row =_b .Int64 (row );_ba .ClientData .Column =_b .Int64 (col );_a .EG_ShapeElements =append (_a .EG_ShapeElements ,_ba );return _a ;};
|
||||
|
||||
// ToString generate string of TextpathStyle.
|
||||
func (_cad *TextpathStyle )String ()string {_gde :="";_gde +=_b .Sprintf ("\u0066o\u006et\u002d\u0066\u0061\u006d\u0069\u006c\u0079\u003a\u0025\u0073\u003b",_cad ._gdga );_gde +=_b .Sprintf ("\u0066o\u006et\u002d\u0073\u0069\u007a\u0065\u003a\u0025\u0064\u0070\u0074\u003b",_cad ._gb );if _cad ._gdc {_gde +=_b .Sprintf ("\u0066o\u006et\u002d\u0073\u0074\u0079\u006ce\u003a\u0069t\u0061\u006c\u0069\u0063\u003b");};if _cad ._cd {_gde +=_b .Sprintf ("\u0066\u006f\u006e\u0074\u002d\u0077\u0065\u0069\u0067\u0068\u0074\u003ab\u006f\u006c\u0064\u003b");};return _gde ;};
|
||||
// ToString formatting ShapeStyle to string.
|
||||
func (_bfg *ShapeStyle )String ()string {_deg :="";_deg +=_f .Sprintf ("\u0070\u006f\u0073i\u0074\u0069\u006f\u006e\u003a\u0025\u0073\u003b",_bfg ._fae );_deg +=_f .Sprintf ("\u006da\u0072g\u0069\u006e\u002d\u006c\u0065\u0066\u0074\u003a\u0025\u0064\u003b",_bfg ._ab );_deg +=_f .Sprintf ("\u006d\u0061\u0072\u0067\u0069\u006e\u002d\u0074\u006fp\u003a\u0025\u0064\u003b",_bfg ._ccb );_deg +=_f .Sprintf ("w\u0069\u0064\u0074\u0068\u003a\u0025\u0064\u0070\u0074\u003b",_bfg ._ef );_deg +=_f .Sprintf ("\u0068\u0065\u0069g\u0068\u0074\u003a\u0025\u0064\u0070\u0074\u003b",_bfg ._ac );_deg +=_f .Sprintf ("z\u002d\u0069\u006e\u0064\u0065\u0078\u003a\u0025\u0064\u003b",_bfg ._cce );_deg +=_f .Sprintf ("m\u0073\u006f\u002d\u0070\u006f\u0073i\u0074\u0069\u006f\u006e\u002d\u0068\u006f\u0072\u0069z\u006f\u006e\u0074a\u006c:\u0025\u0073\u003b",_bfg ._adb );_deg +=_f .Sprintf ("\u006d\u0073o-\u0070\u006f\u0073i\u0074\u0069\u006f\u006e-ho\u0072iz\u006f\u006e\u0074\u0061\u006c\u002d\u0072el\u0061\u0074\u0069\u0076\u0065\u003a\u0025s\u003b",_bfg ._aa );_deg +=_f .Sprintf ("\u006ds\u006f\u002d\u0070\u006fs\u0069\u0074\u0069\u006f\u006e-\u0076e\u0072t\u0069\u0063\u0061\u006c\u003a\u0025\u0073;",_bfg ._ca );_deg +=_f .Sprintf ("\u006d\u0073\u006f-p\u006f\u0073\u0069\u0074\u0069\u006f\u006e\u002d\u0076e\u0072t\u0069c\u0061l\u002d\u0072\u0065\u006c\u0061\u0074\u0069\u0076\u0065\u003a\u0025\u0073\u003b",_bfg ._eb );return _deg ;};
|
||||
|
||||
// NewTextpathStyle accept value of string style attribute of element v:textpath and format it to generate TextpathStyle.
|
||||
func NewTextpathStyle (style string )TextpathStyle {_bdc :=TextpathStyle {_gdga :"\u0022C\u0061\u006c\u0069\u0062\u0072\u0069\"",_gb :44,_cd :false ,_gdc :false };_fc :=_ag .Split (style ,"\u003b");for _ ,_fd :=range _fc {_adb :=_ag .Split (_fd ,"\u003a");if len (_adb )!=2{continue ;};switch _adb [0]{case "f\u006f\u006e\u0074\u002d\u0066\u0061\u006d\u0069\u006c\u0079":_bdc ._gdga =_adb [1];break ;case "\u0066o\u006e\u0074\u002d\u0073\u0069\u007ae":_bdc ._gb ,_ =_bf .ParseInt (_ag .ReplaceAll (_adb [1],"\u0070\u0074",""),10,64);break ;case "f\u006f\u006e\u0074\u002d\u0077\u0065\u0069\u0067\u0068\u0074":_bdc ._cd =_adb [1]=="\u0062\u006f\u006c\u0064";break ;case "\u0066\u006f\u006e\u0074\u002d\u0073\u0074\u0079\u006c\u0065":_bdc ._gdc =_adb [1]=="\u0069\u0074\u0061\u006c\u0069\u0063";break ;};};return _bdc ;};func (_f *Container )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {_f .Shape =nil ;_bc :for {_ce ,_cc :=d .Token ();if _cc !=nil {return _cc ;};switch _ccd :=_ce .(type ){case _e .StartElement :switch _ccd .Name .Local {case "s\u0068\u0061\u0070\u0065\u006c\u0061\u0079\u006f\u0075\u0074":_f .Layout =_eb .NewOfcShapelayout ();if _gd :=d .DecodeElement (_f .Layout ,&_ccd );_gd !=nil {return _gd ;};case "\u0073h\u0061\u0070\u0065\u0074\u0079\u0070e":_f .ShapeType =_eb .NewShapetype ();if _ge :=d .DecodeElement (_f .ShapeType ,&_ccd );_ge !=nil {return _ge ;};case "\u0073\u0068\u0061p\u0065":_gae :=_eb .NewShape ();if _db :=d .DecodeElement (_gae ,&_ccd );_db !=nil {return _db ;};_f .Shape =append (_f .Shape ,_gae );};case _e .EndElement :break _bc ;};};return nil ;};
|
||||
|
||||
// SetHeight set height of shape.
|
||||
func (_gdg *ShapeStyle )SetHeight (height int64 ){_gdg ._bad =height };
|
||||
|
||||
// FontFamily returns fontFamily of the text.
|
||||
func (_bada *TextpathStyle )FontFamily ()string {return _bada ._gdga };
|
||||
|
||||
// IsItalic returns true if text is italic.
|
||||
func (_de *TextpathStyle )IsItalic ()bool {return _de ._gdc };
|
||||
|
||||
// SetFontSize sets text's fontSize.
|
||||
func (_bg *TextpathStyle )SetFontSize (fontSize int64 ){_bg ._gb =fontSize };
|
||||
|
||||
// Height return height of shape.
|
||||
func (_dab *ShapeStyle )Height ()int64 {return _dab ._bad };
|
||||
|
||||
// FontSize returns fontSize of the text.
|
||||
func (_cab *TextpathStyle )FontSize ()int64 {return _cab ._gb };
|
||||
|
||||
// SetItalic sets text to italic.
|
||||
func (_ae *TextpathStyle )SetItalic (italic bool ){_ae ._gdc =italic };
|
||||
|
||||
// ShapeStyle is style attribute of v:shape element.
|
||||
type ShapeStyle struct{_ec string ;_bb int64 ;_dc int64 ;_fg int64 ;_bad int64 ;_gaa int64 ;_ad string ;_bab string ;_fgd string ;_dcb string ;};
|
||||
|
||||
// SetBold sets text to bold.
|
||||
func (_afe *TextpathStyle )SetBold (bold bool ){_afe ._cd =bold };func (_ba *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 _ba .Layout !=nil {_cbg :=_e .StartElement {Name :_e .Name {Local :"\u006f\u003a\u0073\u0068\u0061\u0070\u0065\u006c\u0061\u0079\u006f\u0075\u0074"}};e .EncodeElement (_ba .Layout ,_cbg );};if _ba .ShapeType !=nil {_af :=_e .StartElement {Name :_e .Name {Local :"v\u003a\u0073\u0068\u0061\u0070\u0065\u0074\u0079\u0070\u0065"}};e .EncodeElement (_ba .ShapeType ,_af );};for _ ,_ac :=range _ba .Shape {_da :=_e .StartElement {Name :_e .Name {Local :"\u0076:\u0073\u0068\u0061\u0070\u0065"}};e .EncodeElement (_ac ,_da );};return e .EncodeToken (_e .EndElement {Name :start .Name });};
|
||||
// NewShapeStyle accept value of string style attribute in v:shape and format it to generate ShapeStyle.
|
||||
func NewShapeStyle (style string )ShapeStyle {_bd :=ShapeStyle {_ef :0,_ac :0};_bfd :=_g .Split (style ,"\u003b");for _ ,_dae :=range _bfd {_dea :=_g .Split (_dae ,"\u003a");if len (_dea )!=2{continue ;};switch _dea [0]{case "\u0070\u006f\u0073\u0069\u0074\u0069\u006f\u006e":_bd ._fae =_dea [1];break ;case "m\u0061\u0072\u0067\u0069\u006e\u002d\u006c\u0065\u0066\u0074":_bd ._ab ,_ =_c .ParseInt (_dea [1],10,64);break ;case "\u006d\u0061\u0072\u0067\u0069\u006e\u002d\u0074\u006f\u0070":_bd ._ccb ,_ =_c .ParseInt (_dea [1],10,64);break ;case "\u0077\u0069\u0064t\u0068":_bd ._ef ,_ =_c .ParseInt (_g .ReplaceAll (_dea [1],"\u0070\u0074",""),10,64);break ;case "\u0068\u0065\u0069\u0067\u0068\u0074":_bd ._ac ,_ =_c .ParseInt (_g .ReplaceAll (_dea [1],"\u0070\u0074",""),10,64);break ;case "\u007a-\u0069\u006e\u0064\u0065\u0078":_bd ._cce ,_ =_c .ParseInt (_dea [1],10,64);break ;case "\u006d\u0073\u006f-p\u006f\u0073\u0069\u0074\u0069\u006f\u006e\u002d\u0068\u006f\u0072\u0069\u007a\u006f\u006e\u0074\u0061\u006c":_bd ._adb =_dea [1];break ;case "\u006d\u0073\u006f\u002d\u0070\u006f\u0073\u0069\u0074\u0069\u006f\u006e\u002d\u0068\u006fr\u0069z\u006f\u006e\u0074\u0061\u006c\u002d\u0072\u0065\u006c\u0061\u0074\u0069\u0076\u0065":_bd ._aa =_dea [1];break ;case "m\u0073\u006f\u002d\u0070os\u0069t\u0069\u006f\u006e\u002d\u0076e\u0072\u0074\u0069\u0063\u0061\u006c":_bd ._ca =_dea [1];break ;case "\u006d\u0073\u006f\u002d\u0070\u006f\u0073\u0069\u0074\u0069o\u006e\u002d\u0076\u0065\u0072\u0074\u0069c\u0061\u006c\u002d\u0072\u0065\u006c\u0061\u0074\u0069\u0076\u0065":_bd ._eb =_dea [1];break ;};};return _bd ;};func NewContainer ()*Container {return &Container {}};
|
||||
|
||||
// SetFontFamily sets text's fontFamily.
|
||||
func (_eg *TextpathStyle )SetFontFamily (fontFamily string ){_eg ._gdga =fontFamily };
|
||||
func (_fb *TextpathStyle )SetFontFamily (fontFamily string ){_fb ._aae =fontFamily };
|
||||
|
||||
// NewCommentDrawing constructs a new comment drawing.
|
||||
func NewCommentDrawing ()*Container {_cc :=NewContainer ();_cc .Layout =_ga .NewOfcShapelayout ();_cc .Layout .ExtAttr =_ga .ST_ExtEdit ;_cc .Layout .Idmap =_ga .NewOfcCT_IdMap ();_cc .Layout .Idmap .DataAttr =_b .String ("\u0031");_cc .Layout .Idmap .ExtAttr =_ga .ST_ExtEdit ;_cc .ShapeType =_ga .NewShapetype ();_cc .ShapeType .IdAttr =_b .String ("_\u0078\u0030\u0030\u0030\u0030\u005f\u0074\u0032\u0030\u0032");_cc .ShapeType .CoordsizeAttr =_b .String ("2\u0031\u0036\u0030\u0030\u002c\u0032\u0031\u0036\u0030\u0030");_cc .ShapeType .SptAttr =_b .Float32 (202);_cc .ShapeType .PathAttr =_b .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");_dg :=_ga .NewEG_ShapeElements ();_cc .ShapeType .EG_ShapeElements =append (_cc .ShapeType .EG_ShapeElements ,_dg );_dg .Path =_ga .NewPath ();_dg .Path .GradientshapeokAttr =_gb .ST_TrueFalseT ;_dg .Path .ConnecttypeAttr =_ga .OfcST_ConnectTypeRect ;return _cc ;};
|
||||
|
||||
// SetItalic sets text to italic.
|
||||
func (_adg *TextpathStyle )SetItalic (italic bool ){_adg ._deac =italic };
|
||||
|
||||
// NewTextpathStyle accept value of string style attribute of element v:textpath and format it to generate TextpathStyle.
|
||||
func NewTextpathStyle (style string )TextpathStyle {_dc :=TextpathStyle {_aae :"\u0022C\u0061\u006c\u0069\u0062\u0072\u0069\"",_bad :44,_dga :false ,_deac :false };_ebc :=_g .Split (style ,"\u003b");for _ ,_bbe :=range _ebc {_cf :=_g .Split (_bbe ,"\u003a");if len (_cf )!=2{continue ;};switch _cf [0]{case "f\u006f\u006e\u0074\u002d\u0066\u0061\u006d\u0069\u006c\u0079":_dc ._aae =_cf [1];break ;case "\u0066o\u006e\u0074\u002d\u0073\u0069\u007ae":_dc ._bad ,_ =_c .ParseInt (_g .ReplaceAll (_cf [1],"\u0070\u0074",""),10,64);break ;case "f\u006f\u006e\u0074\u002d\u0077\u0065\u0069\u0067\u0068\u0074":_dc ._dga =_cf [1]=="\u0062\u006f\u006c\u0064";break ;case "\u0066\u006f\u006e\u0074\u002d\u0073\u0074\u0079\u006c\u0065":_dc ._deac =_cf [1]=="\u0069\u0074\u0061\u006c\u0069\u0063";break ;};};return _dc ;};
|
||||
|
||||
// Height return height of shape.
|
||||
func (_cd *ShapeStyle )Height ()int64 {return _cd ._ac };func (_cg *Container )UnmarshalXML (d *_ce .Decoder ,start _ce .StartElement )error {_cg .Shape =nil ;_ag :for {_fe ,_df :=d .Token ();if _df !=nil {return _df ;};switch _fa :=_fe .(type ){case _ce .StartElement :switch _fa .Name .Local {case "s\u0068\u0061\u0070\u0065\u006c\u0061\u0079\u006f\u0075\u0074":_cg .Layout =_ga .NewOfcShapelayout ();if _ffd :=d .DecodeElement (_cg .Layout ,&_fa );_ffd !=nil {return _ffd ;};case "\u0073h\u0061\u0070\u0065\u0074\u0079\u0070e":_cg .ShapeType =_ga .NewShapetype ();if _bf :=d .DecodeElement (_cg .ShapeType ,&_fa );_bf !=nil {return _bf ;};case "\u0073\u0068\u0061p\u0065":_fef :=_ga .NewShape ();if _bfb :=d .DecodeElement (_fef ,&_fa );_bfb !=nil {return _bfb ;};_cg .Shape =append (_cg .Shape ,_fef );};case _ce .EndElement :break _ag ;};};return nil ;};
|
||||
|
||||
// IsBold returns true if text is bold.
|
||||
func (_afb *TextpathStyle )IsBold ()bool {return _afb ._dga };
|
||||
|
||||
// SetBold sets text to bold.
|
||||
func (_abg *TextpathStyle )SetBold (bold bool ){_abg ._dga =bold };
|
||||
|
||||
// TextpathStyle is style attribute of element v:textpath.
|
||||
type TextpathStyle struct{_aae string ;_bad int64 ;_dga bool ;_deac bool ;};
|
||||
|
||||
// SetHeight set height of shape.
|
||||
func (_cge *ShapeStyle )SetHeight (height int64 ){_cge ._ac =height };type Container struct{Layout *_ga .OfcShapelayout ;ShapeType *_ga .Shapetype ;Shape []*_ga .Shape ;};
|
||||
|
||||
// ShapeStyle is style attribute of v:shape element.
|
||||
type ShapeStyle struct{_fae string ;_ab int64 ;_ccb int64 ;_ef int64 ;_ac int64 ;_cce int64 ;_adb string ;_aa string ;_ca string ;_eb string ;};
|
||||
|
||||
// FontFamily returns fontFamily of the text.
|
||||
func (_bg *TextpathStyle )FontFamily ()string {return _bg ._aae };
|
||||
|
||||
// IsItalic returns true if text is italic.
|
||||
func (_eg *TextpathStyle )IsItalic ()bool {return _eg ._deac };
|
||||
|
||||
// SetWidth set width of shape.
|
||||
func (_fg *ShapeStyle )SetWidth (width int64 ){_fg ._ef =width };
|
@ -9,51 +9,51 @@
|
||||
// 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 zippkg ;import (_eb "archive/zip";_ag "bytes";_ed "encoding/xml";_g "fmt";_acc "github.com/unidoc/unioffice";_d "github.com/unidoc/unioffice/algo";_ab "github.com/unidoc/unioffice/common/tempstorage";_gf "github.com/unidoc/unioffice/schema/soo/pkg/relationships";_ac "io";_bd "path";_b "sort";_a "strings";_ec "time";);
|
||||
package zippkg ;import (_d "archive/zip";_a "bytes";_ee "encoding/xml";_dg "fmt";_db "github.com/unidoc/unioffice";_be "github.com/unidoc/unioffice/algo";_bc "github.com/unidoc/unioffice/common/tempstorage";_ff "github.com/unidoc/unioffice/schema/soo/pkg/relationships";_ea "io";_f "path";_b "sort";_df "strings";_e "time";);var _fcf =[]byte {'/','>'};var _gcf =[]byte {'\r','\n'};
|
||||
|
||||
// RelationsPathFor returns the relations path for a given filename.
|
||||
func RelationsPathFor (path string )string {_gff :=_a .Split (path ,"\u002f");_fb :=_a .Join (_gff [0:len (_gff )-1],"\u002f");_gffb :=_gff [len (_gff )-1];_fb +="\u002f_\u0072\u0065\u006c\u0073\u002f";_gffb +="\u002e\u0072\u0065l\u0073";return _fb +_gffb ;};func (_ge SelfClosingWriter )Write (b []byte )(int ,error ){_efb :=0;_bad :=0;for _abfc :=0;_abfc < len (b )-2;_abfc ++{if b [_abfc ]=='>'&&b [_abfc +1]=='<'&&b [_abfc +2]=='/'{_fab :=[]byte {};_daga :=_abfc ;for _agg :=_abfc ;_agg >=0;_agg --{if b [_agg ]==' '{_daga =_agg ;}else if b [_agg ]=='<'{_fab =b [_agg +1:_daga ];break ;};};_ade :=[]byte {};for _fe :=_abfc +3;_fe < len (b );_fe ++{if b [_fe ]=='>'{_ade =b [_abfc +3:_fe ];break ;};};if !_ag .Equal (_fab ,_ade ){continue ;};_badb ,_gbf :=_ge .W .Write (b [_efb :_abfc ]);if _gbf !=nil {return _bad +_badb ,_gbf ;};_bad +=_badb ;_ ,_gbf =_ge .W .Write (_cf );if _gbf !=nil {return _bad ,_gbf ;};_bad +=3;for _dcb :=_abfc +2;_dcb < len (b )&&b [_dcb ]!='>';_dcb ++{_bad ++;_efb =_dcb +2;_abfc =_efb ;};};};_bgc ,_ebga :=_ge .W .Write (b [_efb :]);return _bgc +_bad ,_ebga ;};func MarshalXMLByType (z *_eb .Writer ,dt _acc .DocType ,typ string ,v interface{})error {_ddf :=_acc .AbsoluteFilename (dt ,typ ,0);return MarshalXML (z ,_ddf ,v );};type Target struct{Path string ;Typ string ;Ifc interface{};Index uint32 ;};func (_ad *DecodeMap )IndexFor (path string )int {return _ad ._ba [path ]};var _gbe =[]byte {'\r','\n'};
|
||||
// DecodeMap is used to walk a tree of relationships, decoding files and passing
|
||||
// control back to the document.
|
||||
type DecodeMap struct{_bec map[string ]Target ;_aa map[*_ff .Relationships ]string ;_cf []Target ;_ag OnNewRelationshipFunc ;_cg map[string ]struct{};_bf map[string ]int ;};
|
||||
|
||||
// Decode unmarshals the content of a *zip.File as XML to a given destination.
|
||||
func Decode (f *_eb .File ,dest interface{})error {_acf ,_ggf :=f .Open ();if _ggf !=nil {return _g .Errorf ("e\u0072r\u006f\u0072\u0020\u0072\u0065\u0061\u0064\u0069n\u0067\u0020\u0025\u0073: \u0025\u0073",f .Name ,_ggf );};defer _acf .Close ();_df :=_ed .NewDecoder (_acf );if _cgc :=_df .Decode (dest );_cgc !=nil {return _g .Errorf ("e\u0072\u0072\u006f\u0072 d\u0065c\u006f\u0064\u0069\u006e\u0067 \u0025\u0073\u003a\u0020\u0025\u0073",f .Name ,_cgc );};if _ebc ,_bg :=dest .(*_gf .Relationships );_bg {for _bef ,_ee :=range _ebc .Relationship {switch _ee .TypeAttr {case _acc .OfficeDocumentTypeStrict :_ebc .Relationship [_bef ].TypeAttr =_acc .OfficeDocumentType ;case _acc .StylesTypeStrict :_ebc .Relationship [_bef ].TypeAttr =_acc .StylesType ;case _acc .ThemeTypeStrict :_ebc .Relationship [_bef ].TypeAttr =_acc .ThemeType ;case _acc .ControlTypeStrict :_ebc .Relationship [_bef ].TypeAttr =_acc .ControlType ;case _acc .SettingsTypeStrict :_ebc .Relationship [_bef ].TypeAttr =_acc .SettingsType ;case _acc .ImageTypeStrict :_ebc .Relationship [_bef ].TypeAttr =_acc .ImageType ;case _acc .CommentsTypeStrict :_ebc .Relationship [_bef ].TypeAttr =_acc .CommentsType ;case _acc .ThumbnailTypeStrict :_ebc .Relationship [_bef ].TypeAttr =_acc .ThumbnailType ;case _acc .DrawingTypeStrict :_ebc .Relationship [_bef ].TypeAttr =_acc .DrawingType ;case _acc .ChartTypeStrict :_ebc .Relationship [_bef ].TypeAttr =_acc .ChartType ;case _acc .ExtendedPropertiesTypeStrict :_ebc .Relationship [_bef ].TypeAttr =_acc .ExtendedPropertiesType ;case _acc .CustomXMLTypeStrict :_ebc .Relationship [_bef ].TypeAttr =_acc .CustomXMLType ;case _acc .WorksheetTypeStrict :_ebc .Relationship [_bef ].TypeAttr =_acc .WorksheetType ;case _acc .SharedStringsTypeStrict :_ebc .Relationship [_bef ].TypeAttr =_acc .SharedStringsType ;case _acc .TableTypeStrict :_ebc .Relationship [_bef ].TypeAttr =_acc .TableType ;case _acc .HeaderTypeStrict :_ebc .Relationship [_bef ].TypeAttr =_acc .HeaderType ;case _acc .FooterTypeStrict :_ebc .Relationship [_bef ].TypeAttr =_acc .FooterType ;case _acc .NumberingTypeStrict :_ebc .Relationship [_bef ].TypeAttr =_acc .NumberingType ;case _acc .FontTableTypeStrict :_ebc .Relationship [_bef ].TypeAttr =_acc .FontTableType ;case _acc .WebSettingsTypeStrict :_ebc .Relationship [_bef ].TypeAttr =_acc .WebSettingsType ;case _acc .FootNotesTypeStrict :_ebc .Relationship [_bef ].TypeAttr =_acc .FootNotesType ;case _acc .EndNotesTypeStrict :_ebc .Relationship [_bef ].TypeAttr =_acc .EndNotesType ;case _acc .SlideTypeStrict :_ebc .Relationship [_bef ].TypeAttr =_acc .SlideType ;case _acc .VMLDrawingTypeStrict :_ebc .Relationship [_bef ].TypeAttr =_acc .VMLDrawingType ;};};_b .Slice (_ebc .Relationship ,func (_fbb ,_ecf int )bool {_dfc :=_ebc .Relationship [_fbb ];_dd :=_ebc .Relationship [_ecf ];return _d .NaturalLess (_dfc .IdAttr ,_dd .IdAttr );});};return nil ;};func (_abe *DecodeMap )RecordIndex (path string ,idx int ){_abe ._ba [path ]=idx };func MarshalXMLByTypeIndex (z *_eb .Writer ,dt _acc .DocType ,typ string ,idx int ,v interface{})error {_dab :=_acc .AbsoluteFilename (dt ,typ ,idx );return MarshalXML (z ,_dab ,v );};
|
||||
// AddFileFromBytes takes a byte array and adds it at a given path to a zip file.
|
||||
func AddFileFromBytes (z *_d .Writer ,zipPath string ,data []byte )error {_aaa ,_bcd :=z .Create (zipPath );if _bcd !=nil {return _dg .Errorf ("e\u0072\u0072\u006f\u0072 c\u0072e\u0061\u0074\u0069\u006e\u0067 \u0025\u0073\u003a\u0020\u0025\u0073",zipPath ,_bcd );};_ ,_bcd =_ea .Copy (_aaa ,_a .NewReader (data ));return _bcd ;};const XMLHeader ="\u003c\u003f\u0078\u006d\u006c\u0020\u0076e\u0072\u0073\u0069o\u006e\u003d\u00221\u002e\u0030\"\u0020\u0065\u006e\u0063\u006f\u0064i\u006eg=\u0022\u0055\u0054\u0046\u002d\u0038\u0022\u0020\u0073\u0074\u0061\u006e\u0064\u0061\u006c\u006f\u006e\u0065\u003d\u0022\u0079\u0065\u0073\u0022\u003f\u003e"+"\u000a";
|
||||
|
||||
// SelfClosingWriter wraps a writer and replaces XML tags of the
|
||||
// type <foo></foo> with <foo/>
|
||||
type SelfClosingWriter struct{W _ea .Writer ;};type Target struct{Path string ;Typ string ;Ifc interface{};Index uint32 ;};func MarshalXMLByType (z *_d .Writer ,dt _db .DocType ,typ string ,v interface{})error {_bed :=_db .AbsoluteFilename (dt ,typ ,0);return MarshalXML (z ,_bed ,v );};
|
||||
|
||||
// SetOnNewRelationshipFunc sets the function to be called when a new
|
||||
// relationship has been discovered.
|
||||
func (_ga *DecodeMap )SetOnNewRelationshipFunc (fn OnNewRelationshipFunc ){_ga ._ag =fn };func (_ffc SelfClosingWriter )Write (b []byte )(int ,error ){_egc :=0;_def :=0;for _ebf :=0;_ebf < len (b )-2;_ebf ++{if b [_ebf ]=='>'&&b [_ebf +1]=='<'&&b [_ebf +2]=='/'{_agd :=[]byte {};_daf :=_ebf ;for _dc :=_ebf ;_dc >=0;_dc --{if b [_dc ]==' '{_daf =_dc ;}else if b [_dc ]=='<'{_agd =b [_dc +1:_daf ];break ;};};_gaf :=[]byte {};for _bcb :=_ebf +3;_bcb < len (b );_bcb ++{if b [_bcb ]=='>'{_gaf =b [_ebf +3:_bcb ];break ;};};if !_a .Equal (_agd ,_gaf ){continue ;};_aadd ,_dgg :=_ffc .W .Write (b [_egc :_ebf ]);if _dgg !=nil {return _def +_aadd ,_dgg ;};_def +=_aadd ;_ ,_dgg =_ffc .W .Write (_fcf );if _dgg !=nil {return _def ,_dgg ;};_def +=3;for _defe :=_ebf +2;_defe < len (b )&&b [_defe ]!='>';_defe ++{_def ++;_egc =_defe +2;_ebf =_egc ;};};};_fea ,_faa :=_ffc .W .Write (b [_egc :]);return _fea +_def ,_faa ;};
|
||||
|
||||
// ExtractToDiskTmp extracts a zip file to a temporary file in a given path,
|
||||
// returning the name of the file.
|
||||
func ExtractToDiskTmp (f *_d .File ,path string )(string ,error ){_caf ,_ddd :=_bc .TempFile (path ,"\u007a\u007a");if _ddd !=nil {return "",_ddd ;};defer _caf .Close ();_egg ,_ddd :=f .Open ();if _ddd !=nil {return "",_ddd ;};defer _egg .Close ();_ ,_ddd =_ea .Copy (_caf ,_egg );if _ddd !=nil {return "",_ddd ;};return _caf .Name (),nil ;};
|
||||
|
||||
// Decode loops decoding targets registered with AddTarget and calling th
|
||||
func (_dgd *DecodeMap )Decode (files []*_d .File )error {_ge :=1;for _ge > 0{for len (_dgd ._cf )> 0{_cc :=_dgd ._cf [0];_dgd ._cf =_dgd ._cf [1:];_ef :=_cc .Ifc .(*_ff .Relationships );for _ ,_fc :=range _ef .Relationship {_fff ,_ :=_dgd ._aa [_ef ];_dgd ._ag (_dgd ,_fff +_fc .TargetAttr ,_fc .TypeAttr ,files ,_fc ,_cc );};};for _aege ,_dff :=range files {if _dff ==nil {continue ;};if _eg ,_dfe :=_dgd ._bec [_dff .Name ];_dfe {delete (_dgd ._bec ,_dff .Name );if _bb :=Decode (_dff ,_eg .Ifc );_bb !=nil {return _bb ;};files [_aege ]=nil ;if _dda ,_dgf :=_eg .Ifc .(*_ff .Relationships );_dgf {_dgd ._cf =append (_dgd ._cf ,_eg );_gd ,_ :=_f .Split (_f .Clean (_dff .Name +"\u002f\u002e\u002e\u002f"));_dgd ._aa [_dda ]=_gd ;_ge ++;};};};_ge --;};return nil ;};func (_af *DecodeMap )IndexFor (path string )int {return _af ._bf [path ]};
|
||||
|
||||
// AddFileFromDisk reads a file from internal storage and adds it at a given path to a zip file.
|
||||
// TODO: Rename to AddFileFromStorage in next major version release (v2).
|
||||
// NOTE: If disk storage cannot be used, memory storage can be used instead by calling memstore.SetAsStorage().
|
||||
func AddFileFromDisk (z *_eb .Writer ,zipPath ,storagePath string )error {_cdg ,_abf :=z .Create (zipPath );if _abf !=nil {return _g .Errorf ("e\u0072\u0072\u006f\u0072 c\u0072e\u0061\u0074\u0069\u006e\u0067 \u0025\u0073\u003a\u0020\u0025\u0073",zipPath ,_abf );};_bee ,_abf :=_ab .Open (storagePath );if _abf !=nil {return _g .Errorf ("e\u0072r\u006f\u0072\u0020\u006f\u0070\u0065\u006e\u0069n\u0067\u0020\u0025\u0073: \u0025\u0073",storagePath ,_abf );};defer _bee .Close ();_ ,_abf =_ac .Copy (_cdg ,_bee );return _abf ;};var _cf =[]byte {'/','>'};
|
||||
func AddFileFromDisk (z *_d .Writer ,zipPath ,storagePath string )error {_bfa ,_fb :=z .Create (zipPath );if _fb !=nil {return _dg .Errorf ("e\u0072\u0072\u006f\u0072 c\u0072e\u0061\u0074\u0069\u006e\u0067 \u0025\u0073\u003a\u0020\u0025\u0073",zipPath ,_fb );};_gad ,_fb :=_bc .Open (storagePath );if _fb !=nil {return _dg .Errorf ("e\u0072r\u006f\u0072\u0020\u006f\u0070\u0065\u006e\u0069n\u0067\u0020\u0025\u0073: \u0025\u0073",storagePath ,_fb );};defer _gad .Close ();_ ,_fb =_ea .Copy (_bfa ,_gad );return _fb ;};
|
||||
|
||||
// Decode unmarshals the content of a *zip.File as XML to a given destination.
|
||||
func Decode (f *_d .File ,dest interface{})error {_fdc ,_eea :=f .Open ();if _eea !=nil {return _dg .Errorf ("e\u0072r\u006f\u0072\u0020\u0072\u0065\u0061\u0064\u0069n\u0067\u0020\u0025\u0073: \u0025\u0073",f .Name ,_eea );};defer _fdc .Close ();_gf :=_ee .NewDecoder (_fdc );if _afc :=_gf .Decode (dest );_afc !=nil {return _dg .Errorf ("e\u0072\u0072\u006f\u0072 d\u0065c\u006f\u0064\u0069\u006e\u0067 \u0025\u0073\u003a\u0020\u0025\u0073",f .Name ,_afc );};if _cfa ,_gcb :=dest .(*_ff .Relationships );_gcb {for _afce ,_aeb :=range _cfa .Relationship {switch _aeb .TypeAttr {case _db .OfficeDocumentTypeStrict :_cfa .Relationship [_afce ].TypeAttr =_db .OfficeDocumentType ;case _db .StylesTypeStrict :_cfa .Relationship [_afce ].TypeAttr =_db .StylesType ;case _db .ThemeTypeStrict :_cfa .Relationship [_afce ].TypeAttr =_db .ThemeType ;case _db .ControlTypeStrict :_cfa .Relationship [_afce ].TypeAttr =_db .ControlType ;case _db .SettingsTypeStrict :_cfa .Relationship [_afce ].TypeAttr =_db .SettingsType ;case _db .ImageTypeStrict :_cfa .Relationship [_afce ].TypeAttr =_db .ImageType ;case _db .CommentsTypeStrict :_cfa .Relationship [_afce ].TypeAttr =_db .CommentsType ;case _db .ThumbnailTypeStrict :_cfa .Relationship [_afce ].TypeAttr =_db .ThumbnailType ;case _db .DrawingTypeStrict :_cfa .Relationship [_afce ].TypeAttr =_db .DrawingType ;case _db .ChartTypeStrict :_cfa .Relationship [_afce ].TypeAttr =_db .ChartType ;case _db .ExtendedPropertiesTypeStrict :_cfa .Relationship [_afce ].TypeAttr =_db .ExtendedPropertiesType ;case _db .CustomXMLTypeStrict :_cfa .Relationship [_afce ].TypeAttr =_db .CustomXMLType ;case _db .WorksheetTypeStrict :_cfa .Relationship [_afce ].TypeAttr =_db .WorksheetType ;case _db .SharedStringsTypeStrict :_cfa .Relationship [_afce ].TypeAttr =_db .SharedStringsType ;case _db .TableTypeStrict :_cfa .Relationship [_afce ].TypeAttr =_db .TableType ;case _db .HeaderTypeStrict :_cfa .Relationship [_afce ].TypeAttr =_db .HeaderType ;case _db .FooterTypeStrict :_cfa .Relationship [_afce ].TypeAttr =_db .FooterType ;case _db .NumberingTypeStrict :_cfa .Relationship [_afce ].TypeAttr =_db .NumberingType ;case _db .FontTableTypeStrict :_cfa .Relationship [_afce ].TypeAttr =_db .FontTableType ;case _db .WebSettingsTypeStrict :_cfa .Relationship [_afce ].TypeAttr =_db .WebSettingsType ;case _db .FootNotesTypeStrict :_cfa .Relationship [_afce ].TypeAttr =_db .FootNotesType ;case _db .EndNotesTypeStrict :_cfa .Relationship [_afce ].TypeAttr =_db .EndNotesType ;case _db .SlideTypeStrict :_cfa .Relationship [_afce ].TypeAttr =_db .SlideType ;case _db .VMLDrawingTypeStrict :_cfa .Relationship [_afce ].TypeAttr =_db .VMLDrawingType ;};};_b .Slice (_cfa .Relationship ,func (_fe ,_da int )bool {_fa :=_cfa .Relationship [_fe ];_bee :=_cfa .Relationship [_da ];return _be .NaturalLess (_fa .IdAttr ,_bee .IdAttr );});};return nil ;};
|
||||
|
||||
// MarshalXML creates a file inside of a zip and marshals an object as xml, prefixing it
|
||||
// with a standard XML header.
|
||||
func MarshalXML (z *_d .Writer ,filename string ,v interface{})error {_aee :=&_d .FileHeader {};_aee .Method =_d .Deflate ;_aee .Name =filename ;_aee .SetModTime (_e .Now ());_gfd ,_cbe :=z .CreateHeader (_aee );if _cbe !=nil {return _dg .Errorf ("\u0063\u0072\u0065\u0061ti\u006e\u0067\u0020\u0025\u0073\u0020\u0069\u006e\u0020\u007a\u0069\u0070\u003a\u0020%\u0073",filename ,_cbe );};_ ,_cbe =_gfd .Write ([]byte (XMLHeader ));if _cbe !=nil {return _dg .Errorf ("\u0063\u0072e\u0061\u0074\u0069\u006e\u0067\u0020\u0078\u006d\u006c\u0020\u0068\u0065\u0061\u0064\u0065\u0072\u0020\u0074\u006f\u0020\u0025\u0073: \u0025\u0073",filename ,_cbe );};if _cbe =_ee .NewEncoder (SelfClosingWriter {_gfd }).Encode (v );_cbe !=nil {return _dg .Errorf ("\u006d\u0061\u0072\u0073\u0068\u0061\u006c\u0069\u006e\u0067\u0020\u0025s\u003a\u0020\u0025\u0073",filename ,_cbe );};_ ,_cbe =_gfd .Write (_gcf );return _cbe ;};
|
||||
|
||||
// AddTarget allows documents to register decode targets. Path is a path that
|
||||
// will be found in the zip file and ifc is an XML element that the file will be
|
||||
// unmarshaled to. filePath is the absolute path to the target, ifc is the
|
||||
// object to decode into, sourceFileType is the type of file that the reference
|
||||
// was discovered in, and index is the index of the source file type.
|
||||
func (_ae *DecodeMap )AddTarget (filePath string ,ifc interface{},sourceFileType string ,idx uint32 )bool {if _ae ._gc ==nil {_ae ._gc =make (map[string ]Target );_ae ._ga =make (map[*_gf .Relationships ]string );_ae ._fd =make (map[string ]struct{});_ae ._ba =make (map[string ]int );};_ff :=_bd .Clean (filePath );if _ ,_bc :=_ae ._fd [_ff ];_bc {return false ;};_ae ._fd [_ff ]=struct{}{};_ae ._gc [_ff ]=Target {Path :filePath ,Typ :sourceFileType ,Ifc :ifc ,Index :idx };return true ;};
|
||||
func (_ec *DecodeMap )AddTarget (filePath string ,ifc interface{},sourceFileType string ,idx uint32 )bool {if _ec ._bec ==nil {_ec ._bec =make (map[string ]Target );_ec ._aa =make (map[*_ff .Relationships ]string );_ec ._cg =make (map[string ]struct{});_ec ._bf =make (map[string ]int );};_cfb :=_f .Clean (filePath );if _ ,_gb :=_ec ._cg [_cfb ];_gb {return false ;};_ec ._cg [_cfb ]=struct{}{};_ec ._bec [_cfb ]=Target {Path :filePath ,Typ :sourceFileType ,Ifc :ifc ,Index :idx };return true ;};func (_aeg *DecodeMap )RecordIndex (path string ,idx int ){_aeg ._bf [path ]=idx };func MarshalXMLByTypeIndex (z *_d .Writer ,dt _db .DocType ,typ string ,idx int ,v interface{})error {_aad :=_db .AbsoluteFilename (dt ,typ ,idx );return MarshalXML (z ,_aad ,v );};
|
||||
|
||||
// SelfClosingWriter wraps a writer and replaces XML tags of the
|
||||
// type <foo></foo> with <foo/>
|
||||
type SelfClosingWriter struct{W _ac .Writer ;};
|
||||
|
||||
// DecodeMap is used to walk a tree of relationships, decoding files and passing
|
||||
// control back to the document.
|
||||
type DecodeMap struct{_gc map[string ]Target ;_ga map[*_gf .Relationships ]string ;_dg []Target ;_cd OnNewRelationshipFunc ;_fd map[string ]struct{};_ba map[string ]int ;};
|
||||
|
||||
// Decode loops decoding targets registered with AddTarget and calling th
|
||||
func (_ef *DecodeMap )Decode (files []*_eb .File )error {_gfe :=1;for _gfe > 0{for len (_ef ._dg )> 0{_gcb :=_ef ._dg [len (_ef ._dg )-1];_ef ._dg =_ef ._dg [0:len (_ef ._dg )-1];_be :=_gcb .Ifc .(*_gf .Relationships );for _ ,_ffe :=range _be .Relationship {_ca ,_ :=_ef ._ga [_be ];_ef ._cd (_ef ,_ca +_ffe .TargetAttr ,_ffe .TypeAttr ,files ,_ffe ,_gcb );};};for _ebg ,_eca :=range files {if _eca ==nil {continue ;};if _dc ,_edc :=_ef ._gc [_eca .Name ];_edc {delete (_ef ._gc ,_eca .Name );if _ffb :=Decode (_eca ,_dc .Ifc );_ffb !=nil {return _ffb ;};files [_ebg ]=nil ;if _gae ,_gab :=_dc .Ifc .(*_gf .Relationships );_gab {_ef ._dg =append (_ef ._dg ,_dc );_gbc ,_ :=_bd .Split (_bd .Clean (_eca .Name +"\u002f\u002e\u002e\u002f"));_ef ._ga [_gae ]=_gbc ;_gfe ++;};};};_gfe --;};return nil ;};
|
||||
|
||||
// MarshalXML creates a file inside of a zip and marshals an object as xml, prefixing it
|
||||
// with a standard XML header.
|
||||
func MarshalXML (z *_eb .Writer ,filename string ,v interface{})error {_gabd :=&_eb .FileHeader {};_gabd .Method =_eb .Deflate ;_gabd .Name =filename ;_gabd .SetModTime (_ec .Now ());_gad ,_gbb :=z .CreateHeader (_gabd );if _gbb !=nil {return _g .Errorf ("\u0063\u0072\u0065\u0061ti\u006e\u0067\u0020\u0025\u0073\u0020\u0069\u006e\u0020\u007a\u0069\u0070\u003a\u0020%\u0073",filename ,_gbb );};_ ,_gbb =_gad .Write ([]byte (XMLHeader ));if _gbb !=nil {return _g .Errorf ("\u0063\u0072e\u0061\u0074\u0069\u006e\u0067\u0020\u0078\u006d\u006c\u0020\u0068\u0065\u0061\u0064\u0065\u0072\u0020\u0074\u006f\u0020\u0025\u0073: \u0025\u0073",filename ,_gbb );};if _gbb =_ed .NewEncoder (SelfClosingWriter {_gad }).Encode (v );_gbb !=nil {return _g .Errorf ("\u006d\u0061\u0072\u0073\u0068\u0061\u006c\u0069\u006e\u0067\u0020\u0025s\u003a\u0020\u0025\u0073",filename ,_gbb );};_ ,_gbb =_gad .Write (_gbe );return _gbb ;};
|
||||
|
||||
// SetOnNewRelationshipFunc sets the function to be called when a new
|
||||
// relationship has been discovered.
|
||||
func (_eg *DecodeMap )SetOnNewRelationshipFunc (fn OnNewRelationshipFunc ){_eg ._cd =fn };const XMLHeader ="\u003c\u003f\u0078\u006d\u006c\u0020\u0076e\u0072\u0073\u0069o\u006e\u003d\u00221\u002e\u0030\"\u0020\u0065\u006e\u0063\u006f\u0064i\u006eg=\u0022\u0055\u0054\u0046\u002d\u0038\u0022\u0020\u0073\u0074\u0061\u006e\u0064\u0061\u006c\u006f\u006e\u0065\u003d\u0022\u0079\u0065\u0073\u0022\u003f\u003e"+"\u000a";
|
||||
|
||||
// AddFileFromBytes takes a byte array and adds it at a given path to a zip file.
|
||||
func AddFileFromBytes (z *_eb .Writer ,zipPath string ,data []byte )error {_aa ,_dde :=z .Create (zipPath );if _dde !=nil {return _g .Errorf ("e\u0072\u0072\u006f\u0072 c\u0072e\u0061\u0074\u0069\u006e\u0067 \u0025\u0073\u003a\u0020\u0025\u0073",zipPath ,_dde );};_ ,_dde =_ac .Copy (_aa ,_ag .NewReader (data ));return _dde ;};
|
||||
|
||||
// ExtractToDiskTmp extracts a zip file to a temporary file in a given path,
|
||||
// returning the name of the file.
|
||||
func ExtractToDiskTmp (f *_eb .File ,path string )(string ,error ){_dag ,_fbf :=_ab .TempFile (path ,"\u007a\u007a");if _fbf !=nil {return "",_fbf ;};defer _dag .Close ();_fa ,_fbf :=f .Open ();if _fbf !=nil {return "",_fbf ;};defer _fa .Close ();_ ,_fbf =_ac .Copy (_dag ,_fa );if _fbf !=nil {return "",_fbf ;};return _dag .Name (),nil ;};
|
||||
// RelationsPathFor returns the relations path for a given filename.
|
||||
func RelationsPathFor (path string )string {_ca :=_df .Split (path ,"\u002f");_gac :=_df .Join (_ca [0:len (_ca )-1],"\u002f");_gc :=_ca [len (_ca )-1];_gac +="\u002f_\u0072\u0065\u006c\u0073\u002f";_gc +="\u002e\u0072\u0065l\u0073";return _gac +_gc ;};
|
||||
|
||||
// OnNewRelationshipFunc is called when a new relationship has been discovered.
|
||||
//
|
||||
@ -67,4 +67,4 @@ func ExtractToDiskTmp (f *_eb .File ,path string )(string ,error ){_dag ,_fbf :=
|
||||
// target doesn't match where unioffice will write the file (e.g. read in
|
||||
// 'xl/worksheets/MyWorksheet.xml' and we'll write out
|
||||
// 'xl/worksheets/sheet1.xml')
|
||||
type OnNewRelationshipFunc func (_f *DecodeMap ,_fg ,_gb string ,_ebb []*_eb .File ,_c *_gf .Relationship ,_ce Target )error ;
|
||||
type OnNewRelationshipFunc func (_c *DecodeMap ,_ac ,_ae string ,_de []*_d .File ,_dd *_ff .Relationship ,_gg Target )error ;
|
Loading…
x
Reference in New Issue
Block a user