Merge pull request #486 from unidoc-build/prep-rc-v1.23.0

This commit is contained in:
Gunnsteinn Hall 2023-04-15 19:24:15 +00:00 committed by GitHub
commit 736109cdc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
59 changed files with 24947 additions and 24947 deletions

View File

@ -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 _b "strconv";func _g (_e byte )bool {return _e >='0'&&_e <='9'};func RepeatString (s string ,cnt int )string {if cnt <=0{return "";};_af :=make ([]byte ,len (s )*cnt );_c :=[]byte (s );for _de :=0;_de < cnt ;_de ++{copy (_af [_de :],_c );};return string (_af );};
package algo ;import _e "strconv";
// NaturalLess compares two strings in a human manner so rId2 sorts less than rId10
func NaturalLess (lhs ,rhs string )bool {_bf ,_bd :=0,0;for _bf < len (lhs )&&_bd < len (rhs ){_gd :=lhs [_bf ];_gg :=rhs [_bd ];_d :=_g (_gd );_gdb :=_g (_gg );switch {case _d &&!_gdb :return true ;case !_d &&_gdb :return false ;case !_d &&!_gdb :if _gd !=_gg {return _gd < _gg ;};_bf ++;_bd ++;default:_ggb :=_bf +1;_eb :=_bd +1;for _ggb < len (lhs )&&_g (lhs [_ggb ]){_ggb ++;};for _eb < len (rhs )&&_g (rhs [_eb ]){_eb ++;};_ge ,_ :=_b .ParseUint (lhs [_bf :_ggb ],10,64);_da ,_ :=_b .ParseUint (rhs [_bf :_eb ],10,64);if _ge !=_da {return _ge < _da ;};_bf =_ggb ;_bd =_eb ;};};return len (lhs )< len (rhs );};
func NaturalLess (lhs ,rhs string )bool {_g ,_c :=0,0;for _g < len (lhs )&&_c < len (rhs ){_fa :=lhs [_g ];_ge :=rhs [_c ];_a :=_fg (_fa );_eed :=_fg (_ge );switch {case _a &&!_eed :return true ;case !_a &&_eed :return false ;case !_a &&!_eed :if _fa !=_ge {return _fa < _ge ;};_g ++;_c ++;default:_ag :=_g +1;_b :=_c +1;for _ag < len (lhs )&&_fg (lhs [_ag ]){_ag ++;};for _b < len (rhs )&&_fg (rhs [_b ]){_b ++;};_ce ,_ :=_e .ParseUint (lhs [_g :_ag ],10,64);_cd ,_ :=_e .ParseUint (rhs [_g :_b ],10,64);if _ce !=_cd {return _ce < _cd ;};_g =_ag ;_c =_b ;};};return len (lhs )< len (rhs );};func _fg (_ee byte )bool {return _ee >='0'&&_ee <='9'};func RepeatString (s string ,cnt int )string {if cnt <=0{return "";};_bdc :=make ([]byte ,len (s )*cnt );_d :=[]byte (s );for _gg :=0;_gg < cnt ;_gg ++{copy (_bdc [_gg :],_d );};return string (_bdc );};

File diff suppressed because it is too large Load Diff

View File

@ -11,27 +11,27 @@
// Package color provides color handling structures and functions for use across
// all of the document types.
package color ;import (_gb "fmt";_g "github.com/unidoc/unioffice";);var DarkSlateBlue =Color {0x48,0x3D,0x8B,255,false };var Blue =Color {0x00,0x00,0xFF,255,false };var Chartreuse =Color {0x7F,0xFF,0x00,255,false };var Magenta =Color {0xFF,0x00,0xFF,255,false };var Wheat =Color {0xF5,0xDE,0xB3,255,false };var Silver =Color {0xC0,0xC0,0xC0,255,false };var CornflowerBlue =Color {0x64,0x95,0xED,255,false };var WhiteSmoke =Color {0xF5,0xF5,0xF5,255,false };var HoneyDew =Color {0xF0,0xFF,0xF0,255,false };var DarkViolet =Color {0x94,0x00,0xD3,255,false };var Thistle =Color {0xD8,0xBF,0xD8,255,false };var PapayaWhip =Color {0xFF,0xEF,0xD5,255,false };var HotPink =Color {0xFF,0x69,0xB4,255,false };var LawnGreen =Color {0x7C,0xFC,0x00,255,false };var LightPink =Color {0xFF,0xB6,0xC1,255,false };var DarkOrange =Color {0xFF,0x8C,0x00,255,false };var Fuchsia =Color {0xFF,0x00,0xFF,255,false };var MediumSpringGreen =Color {0x00,0xFA,0x9A,255,false };var CadetBlue =Color {0x5F,0x9E,0xA0,255,false };var DarkGrey =Color {0xA9,0xA9,0xA9,255,false };var Moccasin =Color {0xFF,0xE4,0xB5,255,false };var Chocolate =Color {0xD2,0x69,0x1E,255,false };var SeaGreen =Color {0x2E,0x8B,0x57,255,false };var FloralWhite =Color {0xFF,0xFA,0xF0,255,false };var SandyBrown =Color {0xF4,0xA4,0x60,255,false };var DarkCyan =Color {0x00,0x8B,0x8B,255,false };var PaleGoldenRod =Color {0xEE,0xE8,0xAA,255,false };var SaddleBrown =Color {0x8B,0x45,0x13,255,false };var Ivory =Color {0xFF,0xFF,0xF0,255,false };var DarkTurquoise =Color {0x00,0xCE,0xD1,255,false };var Brown =Color {0xA5,0x2A,0x2A,255,false };var LightSeaGreen =Color {0x20,0xB2,0xAA,255,false };
// Color is a 24 bit color that can be converted to
// internal ECMA-376 formats as needed.
type Color struct{_f ,_a ,_af ,_e uint8 ;_c bool ;};var DarkGreen =Color {0x00,0x64,0x00,255,false };var LemonChiffon =Color {0xFF,0xFA,0xCD,255,false };var DarkRed =Color {0x8B,0x00,0x00,255,false };
package color ;import (_ec "fmt";_b "github.com/unidoc/unioffice";);var LightGoldenRodYellow =Color {0xFA,0xFA,0xD2,255,false };var DarkKhaki =Color {0xBD,0xB7,0x6B,255,false };var Magenta =Color {0xFF,0x00,0xFF,255,false };var IndianRed =Color {0xCD,0x5C,0x5C,255,false };var AliceBlue =Color {0xF0,0xF8,0xFF,255,false };var LightSeaGreen =Color {0x20,0xB2,0xAA,255,false };var Tomato =Color {0xFF,0x63,0x47,255,false };var DarkGray =Color {0xA9,0xA9,0xA9,255,false };var Aquamarine =Color {0x7F,0xFF,0xD4,255,false };var DeepSkyBlue =Color {0x00,0xBF,0xFF,255,false };var BurlyWood =Color {0xDE,0xB8,0x87,255,false };var DarkOliveGreen =Color {0x55,0x6B,0x2F,255,false };var MediumPurple =Color {0x93,0x70,0xDB,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 AliceBlue =Color {0xF0,0xF8,0xFF,255,false };var LightCoral =Color {0xF0,0x80,0x80,255,false };var RoyalBlue =Color {0x41,0x69,0xE1,255,false };var AntiqueWhite =Color {0xFA,0xEB,0xD7,255,false };var Lime =Color {0x00,0xFF,0x00,255,false };var MediumSeaGreen =Color {0x3C,0xB3,0x71,255,false };var Tomato =Color {0xFF,0x63,0x47,255,false };var SlateGrey =Color {0x70,0x80,0x90,255,false };var OldLace =Color {0xFD,0xF5,0xE6,255,false };var Teal =Color {0x00,0x80,0x80,255,false };var DimGray =Color {0x69,0x69,0x69,255,false };var YellowGreen =Color {0x9A,0xCD,0x32,255,false };var Maroon =Color {0x80,0x00,0x00,255,false };var Cornsilk =Color {0xFF,0xF8,0xDC,255,false };var Crimson =Color {0xDC,0x14,0x3C,255,false };var IndianRed =Color {0xCD,0x5C,0x5C,255,false };var MediumSlateBlue =Color {0x7B,0x68,0xEE,255,false };var LightYellow =Color {0xFF,0xFF,0xE0,255,false };var DarkGray =Color {0xA9,0xA9,0xA9,255,false };var FireBrick =Color {0xB2,0x22,0x22,255,false };var Plum =Color {0xDD,0xA0,0xDD,255,false };var LightSlateGrey =Color {0x77,0x88,0x99,255,false };var BlueViolet =Color {0x8A,0x2B,0xE2,255,false };var Linen =Color {0xFA,0xF0,0xE6,255,false };var LightSlateGray =Color {0x77,0x88,0x99,255,false };var SkyBlue =Color {0x87,0xCE,0xEB,255,false };var RebeccaPurple =Color {0x66,0x33,0x99,255,false };var LightSalmon =Color {0xFF,0xA0,0x7A,255,false };var DarkOliveGreen =Color {0x55,0x6B,0x2F,255,false };var Purple =Color {0x80,0x00,0x80,255,false };var PaleTurquoise =Color {0xAF,0xEE,0xEE,255,false };var MidnightBlue =Color {0x19,0x19,0x70,255,false };var LightSteelBlue =Color {0xB0,0xC4,0xDE,255,false };var DeepSkyBlue =Color {0x00,0xBF,0xFF,255,false };var Olive =Color {0x80,0x80,0x00,255,false };var MediumAquaMarine =Color {0x66,0xCD,0xAA,255,false };var DodgerBlue =Color {0x1E,0x90,0xFF,255,false };var MediumPurple =Color {0x93,0x70,0xDB,255,false };var GreenYellow =Color {0xAD,0xFF,0x2F,255,false };var LimeGreen =Color {0x32,0xCD,0x32,255,false };var LightGreen =Color {0x90,0xEE,0x90,255,false };var Yellow =Color {0xFF,0xFF,0x00,255,false };var Coral =Color {0xFF,0x7F,0x50,255,false };
func RGBA (r ,g ,b ,a uint8 )Color {return Color {r ,g ,b ,a ,false }};var Auto =Color {0,0,0,255,true };var Cornsilk =Color {0xFF,0xF8,0xDC,255,false };var DarkSlateGray =Color {0x2F,0x4F,0x4F,255,false };var FloralWhite =Color {0xFF,0xFA,0xF0,255,false };var SlateBlue =Color {0x6A,0x5A,0xCD,255,false };var PaleTurquoise =Color {0xAF,0xEE,0xEE,255,false };var DarkTurquoise =Color {0x00,0xCE,0xD1,255,false };var AntiqueWhite =Color {0xFA,0xEB,0xD7,255,false };var Thistle =Color {0xD8,0xBF,0xD8,255,false };var Yellow =Color {0xFF,0xFF,0x00,255,false };var ForestGreen =Color {0x22,0x8B,0x22,255,false };var Khaki =Color {0xF0,0xE6,0x8C,255,false };var Sienna =Color {0xA0,0x52,0x2D,255,false };var DarkGreen =Color {0x00,0x64,0x00,255,false };var Orange =Color {0xFF,0xA5,0x00,255,false };var LimeGreen =Color {0x32,0xCD,0x32,255,false };var LightYellow =Color {0xFF,0xFF,0xE0,255,false };var MintCream =Color {0xF5,0xFF,0xFA,255,false };var LightGray =Color {0xD3,0xD3,0xD3,255,false };var LightSlateGrey =Color {0x77,0x88,0x99,255,false };var SeaGreen =Color {0x2E,0x8B,0x57,255,false };var DarkSeaGreen =Color {0x8F,0xBC,0x8F,255,false };var Salmon =Color {0xFA,0x80,0x72,255,false };var Tan =Color {0xD2,0xB4,0x8C,255,false };var SuccessGreen =Color {0x00,0xCC,0x00,255,false };var DarkSlateBlue =Color {0x48,0x3D,0x8B,255,false };var Bisque =Color {0xFF,0xE4,0xC4,255,false };var Pink =Color {0xFF,0xC0,0xCB,255,false };var Olive =Color {0x80,0x80,0x00,255,false };var DeepPink =Color {0xFF,0x14,0x93,255,false };var PowderBlue =Color {0xB0,0xE0,0xE6,255,false };var Orchid =Color {0xDA,0x70,0xD6,255,false };var LightSteelBlue =Color {0xB0,0xC4,0xDE,255,false };var LightSlateGray =Color {0x77,0x88,0x99,255,false };var PaleGoldenRod =Color {0xEE,0xE8,0xAA,255,false };var HoneyDew =Color {0xF0,0xFF,0xF0,255,false };var Cyan =Color {0x00,0xFF,0xFF,255,false };var LightCoral =Color {0xF0,0x80,0x80,255,false };var OrangeRed =Color {0xFF,0x45,0x00,255,false };var DarkViolet =Color {0x94,0x00,0xD3,255,false };var Indigo =Color {0x4B,0x00,0x82,255,false };var Red =Color {0xFF,0x00,0x00,255,false };var PaleVioletRed =Color {0xDB,0x70,0x93,255,false };var PeachPuff =Color {0xFF,0xDA,0xB9,255,false };var LightBlue =Color {0xAD,0xD8,0xE6,255,false };var Moccasin =Color {0xFF,0xE4,0xB5,255,false };var Ivory =Color {0xFF,0xFF,0xF0,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 MediumBlue =Color {0x00,0x00,0xCD,255,false };var Orchid =Color {0xDA,0x70,0xD6,255,false };var BurlyWood =Color {0xDE,0xB8,0x87,255,false };var Auto =Color {0,0,0,255,true };var ForestGreen =Color {0x22,0x8B,0x22,255,false };var Khaki =Color {0xF0,0xE6,0x8C,255,false };var MistyRose =Color {0xFF,0xE4,0xE1,255,false };var PaleVioletRed =Color {0xDB,0x70,0x93,255,false };var LightBlue =Color {0xAD,0xD8,0xE6,255,false };var PaleGreen =Color {0x98,0xFB,0x98,255,false };var Violet =Color {0xEE,0x82,0xEE,255,false };var Bisque =Color {0xFF,0xE4,0xC4,255,false };var MediumVioletRed =Color {0xC7,0x15,0x85,255,false };func FromHex (s string )Color {if len (s )==0{return Auto ;};if s [0]=='#'{s =s [1:];};var _ebe ,_gbd ,_b uint8 ;_ef ,_ :=_gb .Sscanf (s ,"\u0025\u0030\u0032x\u0025\u0030\u0032\u0078\u0025\u0030\u0032\u0078",&_ebe ,&_gbd ,&_b );if _ef ==3{return RGB (_ebe ,_gbd ,_b );};return Auto ;};var DarkKhaki =Color {0xBD,0xB7,0x6B,255,false };var Turquoise =Color {0x40,0xE0,0xD0,255,false };var OliveDrab =Color {0x6B,0x8E,0x23,255,false };var Cyan =Color {0x00,0xFF,0xFF,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 ._c };var DeepPink =Color {0xFF,0x14,0x93,255,false };var LightGoldenRodYellow =Color {0xFA,0xFA,0xD2,255,false };var Green =Color {0x00,0x80,0x00,255,false };
// Color is a 24 bit color that can be converted to
// internal ECMA-376 formats as needed.
type Color struct{_d ,_f ,_a ,_ecb uint8 ;_eg bool ;};var Wheat =Color {0xF5,0xDE,0xB3,255,false };var DarkOrange =Color {0xFF,0x8C,0x00,255,false };var SlateGrey =Color {0x70,0x80,0x90,255,false };var DarkGrey =Color {0xA9,0xA9,0xA9,255,false };var Blue =Color {0x00,0x00,0xFF,255,false };var LavenderBlush =Color {0xFF,0xF0,0xF5,255,false };var LightGrey =Color {0xD3,0xD3,0xD3,255,false };var Lime =Color {0x00,0xFF,0x00,255,false };var Azure =Color {0xF0,0xFF,0xFF,255,false };var Linen =Color {0xFA,0xF0,0xE6,255,false };var SandyBrown =Color {0xF4,0xA4,0x60,255,false };var GoldenRod =Color {0xDA,0xA5,0x20,255,false };var RebeccaPurple =Color {0x66,0x33,0x99,255,false };var LightGreen =Color {0x90,0xEE,0x90,255,false };var LightSkyBlue =Color {0x87,0xCE,0xFA,255,false };var Maroon =Color {0x80,0x00,0x00,255,false };var Purple =Color {0x80,0x00,0x80,255,false };var GhostWhite =Color {0xF8,0xF8,0xFF,255,false };var MediumAquaMarine =Color {0x66,0xCD,0xAA,255,false };var BlanchedAlmond =Color {0xFF,0xEB,0xCD,255,false };var DimGrey =Color {0x69,0x69,0x69,255,false };var DarkGoldenRod =Color {0xB8,0x86,0x0B,255,false };var Lavender =Color {0xE6,0xE6,0xFA,255,false };var Beige =Color {0xF5,0xF5,0xDC,255,false };var MidnightBlue =Color {0x19,0x19,0x70,255,false };var HotPink =Color {0xFF,0x69,0xB4,255,false };var Violet =Color {0xEE,0x82,0xEE,255,false };var SkyBlue =Color {0x87,0xCE,0xEB,255,false };var Teal =Color {0x00,0x80,0x80,255,false };var NavajoWhite =Color {0xFF,0xDE,0xAD,255,false };var MediumOrchid =Color {0xBA,0x55,0xD3,255,false };var DarkMagenta =Color {0x8B,0x00,0x8B,255,false };
// AsRGBString is used by the various wrappers to return a pointer
// to a string containing a six digit hex RGB value.
func (_eb Color )AsRGBString ()*string {return _g .Stringf ("\u0025\u0030\u0032x\u0025\u0030\u0032\u0078\u0025\u0030\u0032\u0078",_eb ._f ,_eb ._a ,_eb ._af );};var Tan =Color {0xD2,0xB4,0x8C,255,false };var GhostWhite =Color {0xF8,0xF8,0xFF,255,false };var DarkSeaGreen =Color {0x8F,0xBC,0x8F,255,false };var DarkSlateGray =Color {0x2F,0x4F,0x4F,255,false };var Salmon =Color {0xFA,0x80,0x72,255,false };var SteelBlue =Color {0x46,0x82,0xB4,255,false };var Indigo =Color {0x4B,0x00,0x82,255,false };var NavajoWhite =Color {0xFF,0xDE,0xAD,255,false };var SpringGreen =Color {0x00,0xFF,0x7F,255,false };var Aquamarine =Color {0x7F,0xFF,0xD4,255,false };var DimGrey =Color {0x69,0x69,0x69,255,false };var MediumOrchid =Color {0xBA,0x55,0xD3,255,false };var Peru =Color {0xCD,0x85,0x3F,255,false };var LavenderBlush =Color {0xFF,0xF0,0xF5,255,false };var RosyBrown =Color {0xBC,0x8F,0x8F,255,false };var SlateBlue =Color {0x6A,0x5A,0xCD,255,false };var PowderBlue =Color {0xB0,0xE0,0xE6,255,false };var Lavender =Color {0xE6,0xE6,0xFA,255,false };var SuccessGreen =Color {0x00,0xCC,0x00,255,false };var White =Color {0xFF,0xFF,0xFF,255,false };var Orange =Color {0xFF,0xA5,0x00,255,false };var DarkGoldenRod =Color {0xB8,0x86,0x0B,255,false };var OrangeRed =Color {0xFF,0x45,0x00,255,false };var Sienna =Color {0xA0,0x52,0x2D,255,false };var Gray =Color {0x80,0x80,0x80,255,false };var DarkMagenta =Color {0x8B,0x00,0x8B,255,false };var Gainsboro =Color {0xDC,0xDC,0xDC,255,false };var LightCyan =Color {0xE0,0xFF,0xFF,255,false };var GoldenRod =Color {0xDA,0xA5,0x20,255,false };var MintCream =Color {0xF5,0xFF,0xFA,255,false };var Pink =Color {0xFF,0xC0,0xCB,255,false };var LightGray =Color {0xD3,0xD3,0xD3,255,false };var LightGrey =Color {0xD3,0xD3,0xD3,255,false };var Red =Color {0xFF,0x00,0x00,255,false };var MediumTurquoise =Color {0x48,0xD1,0xCC,255,false };var SlateGray =Color {0x70,0x80,0x90,255,false };var BlanchedAlmond =Color {0xFF,0xEB,0xCD,255,false };var Snow =Color {0xFF,0xFA,0xFA,255,false };var DarkSlateGrey =Color {0x2F,0x4F,0x4F,255,false };var DarkSalmon =Color {0xE9,0x96,0x7A,255,false };var Black =Color {0x00,0x00,0x00,255,false };var Aqua =Color {0x00,0xFF,0xFF,255,false };var SeaShell =Color {0xFF,0xF5,0xEE,255,false };var DarkOrchid =Color {0x99,0x32,0xCC,255,false };var Azure =Color {0xF0,0xFF,0xFF,255,false };var PeachPuff =Color {0xFF,0xDA,0xB9,255,false };var Navy =Color {0x00,0x00,0x80,255,false };
func (_db Color )AsRGBString ()*string {return _b .Stringf ("\u0025\u0030\u0032x\u0025\u0030\u0032\u0078\u0025\u0030\u0032\u0078",_db ._d ,_db ._f ,_db ._a );};var Navy =Color {0x00,0x00,0x80,255,false };var Plum =Color {0xDD,0xA0,0xDD,255,false };var DarkBlue =Color {0x00,0x00,0x8B,255,false };var Brown =Color {0xA5,0x2A,0x2A,255,false };var Gray =Color {0x80,0x80,0x80,255,false };var Fuchsia =Color {0xFF,0x00,0xFF,255,false };var RoyalBlue =Color {0x41,0x69,0xE1,255,false };var Snow =Color {0xFF,0xFA,0xFA,255,false };var RosyBrown =Color {0xBC,0x8F,0x8F,255,false };var OldLace =Color {0xFD,0xF5,0xE6,255,false };var LemonChiffon =Color {0xFF,0xFA,0xCD,255,false };var YellowGreen =Color {0x9A,0xCD,0x32,255,false };var Gold =Color {0xFF,0xD7,0x00,255,false };var DarkSlateGrey =Color {0x2F,0x4F,0x4F,255,false };var PaleGreen =Color {0x98,0xFB,0x98,255,false };var CornflowerBlue =Color {0x64,0x95,0xED,255,false };func FromHex (s string )Color {if len (s )==0{return Auto ;};if s [0]=='#'{s =s [1:];};var _bb ,_dbe ,_ac uint8 ;_bef ,_ :=_ec .Sscanf (s ,"\u0025\u0030\u0032x\u0025\u0030\u0032\u0078\u0025\u0030\u0032\u0078",&_bb ,&_dbe ,&_ac );if _bef ==3{return RGB (_bb ,_dbe ,_ac );};return Auto ;};var MediumTurquoise =Color {0x48,0xD1,0xCC,255,false };var FireBrick =Color {0xB2,0x22,0x22,255,false };var OliveDrab =Color {0x6B,0x8E,0x23,255,false };var Silver =Color {0xC0,0xC0,0xC0,255,false };var CadetBlue =Color {0x5F,0x9E,0xA0,255,false };var DodgerBlue =Color {0x1E,0x90,0xFF,255,false };var SlateGray =Color {0x70,0x80,0x90,255,false };var Black =Color {0x00,0x00,0x00,255,false };var Crimson =Color {0xDC,0x14,0x3C,255,false };var White =Color {0xFF,0xFF,0xFF,255,false };var Chocolate =Color {0xD2,0x69,0x1E,255,false };var MediumVioletRed =Color {0xC7,0x15,0x85,255,false };var LightSalmon =Color {0xFF,0xA0,0x7A,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 (_be Color )IsAuto ()bool {return _be ._eg };var MistyRose =Color {0xFF,0xE4,0xE1,255,false };var SaddleBrown =Color {0x8B,0x45,0x13,255,false };var Peru =Color {0xCD,0x85,0x3F,255,false };var DarkSalmon =Color {0xE9,0x96,0x7A,255,false };var DimGray =Color {0x69,0x69,0x69,255,false };var Aqua =Color {0x00,0xFF,0xFF,255,false };var Green =Color {0x00,0x80,0x00,255,false };var Turquoise =Color {0x40,0xE0,0xD0,255,false };var SpringGreen =Color {0x00,0xFF,0x7F,255,false };var DarkRed =Color {0x8B,0x00,0x00,255,false };var Coral =Color {0xFF,0x7F,0x50,255,false };var MediumSeaGreen =Color {0x3C,0xB3,0x71,255,false };var BlueViolet =Color {0x8A,0x2B,0xE2,255,false };var MediumSlateBlue =Color {0x7B,0x68,0xEE,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 LightCyan =Color {0xE0,0xFF,0xFF,255,false };var GreenYellow =Color {0xAD,0xFF,0x2F,255,false };var SeaShell =Color {0xFF,0xF5,0xEE,255,false };var PapayaWhip =Color {0xFF,0xEF,0xD5,255,false };var Gainsboro =Color {0xDC,0xDC,0xDC,255,false };var SteelBlue =Color {0x46,0x82,0xB4,255,false };var MediumBlue =Color {0x00,0x00,0xCD,255,false };var LawnGreen =Color {0x7C,0xFC,0x00,255,false };var DarkOrchid =Color {0x99,0x32,0xCC,255,false };var LightPink =Color {0xFF,0xB6,0xC1,255,false };var WhiteSmoke =Color {0xF5,0xF5,0xF5,255,false };var MediumSpringGreen =Color {0x00,0xFA,0x9A,255,false };
// AsRGBAString is used by the various wrappers to return a pointer
// to a string containing a six digit hex RGB value.
func (_fa Color )AsRGBAString ()*string {return _g .Stringf ("\u0025\u00302\u0078\u0025\u00302\u0078\u0025\u0030\u0032\u0078\u0025\u0030\u0032\u0078",_fa ._e ,_fa ._f ,_fa ._a ,_fa ._af );};var Beige =Color {0xF5,0xF5,0xDC,255,false };var DarkBlue =Color {0x00,0x00,0x8B,255,false };var Gold =Color {0xFF,0xD7,0x00,255,false };var LightSkyBlue =Color {0x87,0xCE,0xFA,255,false };
func (_c Color )AsRGBAString ()*string {return _b .Stringf ("\u0025\u00302\u0078\u0025\u00302\u0078\u0025\u0030\u0032\u0078\u0025\u0030\u0032\u0078",_c ._ecb ,_c ._d ,_c ._f ,_c ._a );};var DarkCyan =Color {0x00,0x8B,0x8B,255,false };var Chartreuse =Color {0x7F,0xFF,0x00,255,false };

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -13,21 +13,8 @@
// are valid for the version of UniOffice used.
package license ;import _a "github.com/unidoc/unioffice/internal/license";
// GetMeteredState checks the currently used metered document usage status,
// documents used and credits available.
func GetMeteredState ()(_a .MeteredStatus ,error ){return _a .GetMeteredState ()};
// SetMeteredKeyPersistentCache sets the metered License API Key persistent cache.
// Default value `true`, set to `false` will report the usage immediately to license server,
// this can be used when there's no access to persistent data storage.
func SetMeteredKeyPersistentCache (val bool ){_a .SetMeteredKeyPersistentCache (val )};const (LicenseTierUnlicensed =_a .LicenseTierUnlicensed ;LicenseTierCommunity =_a .LicenseTierCommunity ;LicenseTierIndividual =_a .LicenseTierIndividual ;LicenseTierBusiness =_a .LicenseTierBusiness ;);
// LegacyLicense holds the old-style unioffice license information.
type LegacyLicense =_a .LegacyLicense ;
// 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 _a .SetLegacyLicenseKey (s )};
// MakeUnlicensedKey returns a default key.
func MakeUnlicensedKey ()*LicenseKey {return _a .MakeUnlicensedKey ()};const (LicenseTierUnlicensed =_a .LicenseTierUnlicensed ;LicenseTierCommunity =_a .LicenseTierCommunity ;LicenseTierIndividual =_a .LicenseTierIndividual ;LicenseTierBusiness =_a .LicenseTierBusiness ;);
// LicenseKey represents a loaded license key.
type LicenseKey =_a .LicenseKey ;
@ -36,14 +23,27 @@ type LicenseKey =_a .LicenseKey ;
// Document usage is reported periodically for the product to function correctly.
func SetMeteredKey (apiKey string )error {return _a .SetMeteredKey (apiKey )};
// 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 _a .SetLegacyLicenseKey (s )};
// LegacyLicenseType is the type of license
type LegacyLicenseType =_a .LegacyLicenseType ;
// SetLicenseKey sets and validates the license key.
func SetLicenseKey (content string ,customerName string )error {return _a .SetLicenseKey (content ,customerName );};
// LegacyLicense holds the old-style unioffice license information.
type LegacyLicense =_a .LegacyLicense ;
// SetMeteredKeyPersistentCache sets the metered License API Key persistent cache.
// Default value `true`, set to `false` will report the usage immediately to license server,
// this can be used when there's no access to persistent data storage.
func SetMeteredKeyPersistentCache (val bool ){_a .SetMeteredKeyPersistentCache (val )};
// GetLicenseKey returns the currently loaded license key.
func GetLicenseKey ()*LicenseKey {return _a .GetLicenseKey ()};
// MakeUnlicensedKey returns a default key.
func MakeUnlicensedKey ()*LicenseKey {return _a .MakeUnlicensedKey ()};
// SetLicenseKey sets and validates the license key.
func SetLicenseKey (content string ,customerName string )error {return _a .SetLicenseKey (content ,customerName );};
// GetMeteredState checks the currently used metered document usage status,
// documents used and credits available.
func GetMeteredState ()(_a .MeteredStatus ,error ){return _a .GetMeteredState ()};

View File

@ -9,93 +9,93 @@
// 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 logger ;import (_c "fmt";_g "io";_a "os";_cg "path/filepath";_eb "runtime";);
// Trace logs trace message.
func (_dbe WriterLogger )Trace (format string ,args ...interface{}){if _dbe .LogLevel >=LogLevelTrace {_bfd :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_dbe .logToWriter (_dbe .Output ,_bfd ,format ,args ...);};};
// ConsoleLogger is a logger that writes logs to the 'os.Stdout'
type ConsoleLogger struct{LogLevel LogLevel ;};
// Trace does nothing for dummy logger.
func (DummyLogger )Trace (format string ,args ...interface{}){};
// Debug logs debug message.
func (_agc ConsoleLogger )Debug (format string ,args ...interface{}){if _agc .LogLevel >=LogLevelDebug {_ggd :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_agc .output (_a .Stdout ,_ggd ,format ,args ...);};};
// DummyLogger does nothing.
type DummyLogger struct{};
// IsLogLevel returns true if log level is greater or equal than `level`.
// Can be used to avoid resource intensive calls to loggers.
func (_aca WriterLogger )IsLogLevel (level LogLevel )bool {return _aca .LogLevel >=level };
// Notice does nothing for dummy logger.
func (DummyLogger )Notice (format string ,args ...interface{}){};
// SetLogger sets 'logger' to be used by the unidoc unipdf library.
func SetLogger (logger Logger ){Log =logger };
// LogLevel is the verbosity level for logging.
type LogLevel int ;
// IsLogLevel returns true if log level is greater or equal than `level`.
// Can be used to avoid resource intensive calls to loggers.
func (_bac ConsoleLogger )IsLogLevel (level LogLevel )bool {return _bac .LogLevel >=level };const (LogLevelTrace LogLevel =5;LogLevelDebug LogLevel =4;LogLevelInfo LogLevel =3;LogLevelNotice LogLevel =2;LogLevelWarning LogLevel =1;LogLevelError LogLevel =0;);func (_caf WriterLogger )logToWriter (_df _g .Writer ,_da string ,_ffb string ,_aaa ...interface{}){_dfa (_df ,_da ,_ffb ,_aaa );};
// Warning logs warning message.
func (_ad ConsoleLogger )Warning (format string ,args ...interface{}){if _ad .LogLevel >=LogLevelWarning {_aa :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_ad .output (_a .Stdout ,_aa ,format ,args ...);};};var Log Logger =DummyLogger {};
// Debug logs debug message.
func (_bcbd WriterLogger )Debug (format string ,args ...interface{}){if _bcbd .LogLevel >=LogLevelDebug {_fag :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_bcbd .logToWriter (_bcbd .Output ,_fag ,format ,args ...);};};
// NewWriterLogger creates new 'writer' logger.
func NewWriterLogger (logLevel LogLevel ,writer _g .Writer )*WriterLogger {logger :=WriterLogger {Output :writer ,LogLevel :logLevel };return &logger ;};
// Error does nothing for dummy logger.
func (DummyLogger )Error (format string ,args ...interface{}){};func (_ge ConsoleLogger )output (_fc _g .Writer ,_dd string ,_gc string ,_db ...interface{}){_dfa (_fc ,_dd ,_gc ,_db ...);};
// Info does nothing for dummy logger.
func (DummyLogger )Info (format string ,args ...interface{}){};
// Trace logs trace message.
func (_ff ConsoleLogger )Trace (format string ,args ...interface{}){if _ff .LogLevel >=LogLevelTrace {_bbd :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_ff .output (_a .Stdout ,_bbd ,format ,args ...);};};
// Notice logs notice message.
func (_gg ConsoleLogger )Notice (format string ,args ...interface{}){if _gg .LogLevel >=LogLevelNotice {_ga :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_gg .output (_a .Stdout ,_ga ,format ,args ...);};};func _dfa (_ef _g .Writer ,_fde string ,_ace string ,_cga ...interface{}){_ ,_fda ,_fdf ,_cba :=_eb .Caller (3);if !_cba {_fda ="\u003f\u003f\u003f";_fdf =0;}else {_fda =_cg .Base (_fda );};_ed :=_c .Sprintf ("\u0025s\u0020\u0025\u0073\u003a\u0025\u0064 ",_fde ,_fda ,_fdf )+_ace +"\u000a";_c .Fprintf (_ef ,_ed ,_cga ...);};
// Warning does nothing for dummy logger.
func (DummyLogger )Warning (format string ,args ...interface{}){};
// Info logs info message.
func (_gb ConsoleLogger )Info (format string ,args ...interface{}){if _gb .LogLevel >=LogLevelInfo {_cb :="\u005bI\u004e\u0046\u004f\u005d\u0020";_gb .output (_a .Stdout ,_cb ,format ,args ...);};};
// Error logs error message.
func (_fce WriterLogger )Error (format string ,args ...interface{}){if _fce .LogLevel >=LogLevelError {_fdc :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_fce .logToWriter (_fce .Output ,_fdc ,format ,args ...);};};
// Logger is the interface used for logging in the unipdf package.
type Logger interface{Error (_ce string ,_b ...interface{});Warning (_bc string ,_ac ...interface{});Notice (_f string ,_d ...interface{});Info (_ag string ,_bb ...interface{});Debug (_agd string ,_ca ...interface{});Trace (_cae string ,_dc ...interface{});IsLogLevel (_ba LogLevel )bool ;};
// WriterLogger is the logger that writes data to the Output writer
type WriterLogger struct{LogLevel LogLevel ;Output _g .Writer ;};
// Error logs error message.
func (_bf ConsoleLogger )Error (format string ,args ...interface{}){if _bf .LogLevel >=LogLevelError {_fa :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_bf .output (_a .Stdout ,_fa ,format ,args ...);};};
// Notice logs notice message.
func (_ae WriterLogger )Notice (format string ,args ...interface{}){if _ae .LogLevel >=LogLevelNotice {_fe :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_ae .logToWriter (_ae .Output ,_fe ,format ,args ...);};};
// IsLogLevel returns true from dummy logger.
func (DummyLogger )IsLogLevel (level LogLevel )bool {return true };
// Warning logs warning message.
func (_cf WriterLogger )Warning (format string ,args ...interface{}){if _cf .LogLevel >=LogLevelWarning {_bcb :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_cf .logToWriter (_cf .Output ,_bcb ,format ,args ...);};};
package logger ;import (_f "fmt";_ga "io";_g "os";_d "path/filepath";_ed "runtime";);
// NewConsoleLogger creates new console logger.
func NewConsoleLogger (logLevel LogLevel )*ConsoleLogger {return &ConsoleLogger {LogLevel :logLevel }};
// Info does nothing for dummy logger.
func (DummyLogger )Info (format string ,args ...interface{}){};
// LogLevel is the verbosity level for logging.
type LogLevel int ;
// Notice logs notice message.
func (_dg ConsoleLogger )Notice (format string ,args ...interface{}){if _dg .LogLevel >=LogLevelNotice {_a :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_dg .output (_g .Stdout ,_a ,format ,args ...);};};
// SetLogger sets 'logger' to be used by the unidoc unipdf library.
func SetLogger (logger Logger ){Log =logger };
// Error logs error message.
func (_fc ConsoleLogger )Error (format string ,args ...interface{}){if _fc .LogLevel >=LogLevelError {_ee :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_fc .output (_g .Stdout ,_ee ,format ,args ...);};};
// Trace logs trace message.
func (_eec ConsoleLogger )Trace (format string ,args ...interface{}){if _eec .LogLevel >=LogLevelTrace {_db :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_eec .output (_g .Stdout ,_db ,format ,args ...);};};
// Error logs error message.
func (_fcd WriterLogger )Error (format string ,args ...interface{}){if _fcd .LogLevel >=LogLevelError {_gce :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_fcd .logToWriter (_fcd .Output ,_gce ,format ,args ...);};};
// Warning does nothing for dummy logger.
func (DummyLogger )Warning (format string ,args ...interface{}){};func (_gdg ConsoleLogger )output (_fg _ga .Writer ,_fae string ,_gc string ,_bb ...interface{}){_efc (_fg ,_fae ,_gc ,_bb ...);};var Log Logger =DummyLogger {};
// IsLogLevel returns true if log level is greater or equal than `level`.
// Can be used to avoid resource intensive calls to loggers.
func (_cf WriterLogger )IsLogLevel (level LogLevel )bool {return _cf .LogLevel >=level };
// Warning logs warning message.
func (_da ConsoleLogger )Warning (format string ,args ...interface{}){if _da .LogLevel >=LogLevelWarning {_eb :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_da .output (_g .Stdout ,_eb ,format ,args ...);};};func (_ebd WriterLogger )logToWriter (_cd _ga .Writer ,_fgf string ,_ggg string ,_fcg ...interface{}){_efc (_cd ,_fgf ,_ggg ,_fcg );};
// Notice logs notice message.
func (_ce WriterLogger )Notice (format string ,args ...interface{}){if _ce .LogLevel >=LogLevelNotice {_ec :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_ce .logToWriter (_ce .Output ,_ec ,format ,args ...);};};
// ConsoleLogger is a logger that writes logs to the 'os.Stdout'
type ConsoleLogger struct{LogLevel LogLevel ;};
// IsLogLevel returns true from dummy logger.
func (DummyLogger )IsLogLevel (level LogLevel )bool {return true };
// WriterLogger is the logger that writes data to the Output writer
type WriterLogger struct{LogLevel LogLevel ;Output _ga .Writer ;};const (LogLevelTrace LogLevel =5;LogLevelDebug LogLevel =4;LogLevelInfo LogLevel =3;LogLevelNotice LogLevel =2;LogLevelWarning LogLevel =1;LogLevelError LogLevel =0;);
// Info logs info message.
func (_fcc WriterLogger )Info (format string ,args ...interface{}){if _fcc .LogLevel >=LogLevelInfo {_gf :="\u005bI\u004e\u0046\u004f\u005d\u0020";_fcc .logToWriter (_fcc .Output ,_gf ,format ,args ...);};};
// Trace logs trace message.
func (_ddg WriterLogger )Trace (format string ,args ...interface{}){if _ddg .LogLevel >=LogLevelTrace {_fdaf :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_ddg .logToWriter (_ddg .Output ,_fdaf ,format ,args ...);};};
// Info logs info message.
func (_fa ConsoleLogger )Info (format string ,args ...interface{}){if _fa .LogLevel >=LogLevelInfo {_cb :="\u005bI\u004e\u0046\u004f\u005d\u0020";_fa .output (_g .Stdout ,_cb ,format ,args ...);};};
// Notice does nothing for dummy logger.
func (DummyLogger )Notice (format string ,args ...interface{}){};
// Warning logs warning message.
func (_fgc WriterLogger )Warning (format string ,args ...interface{}){if _fgc .LogLevel >=LogLevelWarning {_cfc :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_fgc .logToWriter (_fgc .Output ,_cfc ,format ,args ...);};};
// NewWriterLogger creates new 'writer' logger.
func NewWriterLogger (logLevel LogLevel ,writer _ga .Writer )*WriterLogger {logger :=WriterLogger {Output :writer ,LogLevel :logLevel };return &logger ;};
// Debug does nothing for dummy logger.
func (DummyLogger )Debug (format string ,args ...interface{}){};
// Info logs info message.
func (_fdd WriterLogger )Info (format string ,args ...interface{}){if _fdd .LogLevel >=LogLevelInfo {_bg :="\u005bI\u004e\u0046\u004f\u005d\u0020";_fdd .logToWriter (_fdd .Output ,_bg ,format ,args ...);};};
// Debug logs debug message.
func (_bf ConsoleLogger )Debug (format string ,args ...interface{}){if _bf .LogLevel >=LogLevelDebug {_eea :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_bf .output (_g .Stdout ,_eea ,format ,args ...);};};
// Logger is the interface used for logging in the unipdf package.
type Logger interface{Error (_fd string ,_c ...interface{});Warning (_df string ,_b ...interface{});Notice (_fda string ,_gd ...interface{});Info (_gdf string ,_bc ...interface{});Debug (_dd string ,_gg ...interface{});Trace (_ba string ,_cc ...interface{});IsLogLevel (_ea LogLevel )bool ;};
// Debug logs debug message.
func (_ef WriterLogger )Debug (format string ,args ...interface{}){if _ef .LogLevel >=LogLevelDebug {_bfc :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_ef .logToWriter (_ef .Output ,_bfc ,format ,args ...);};};func _efc (_fe _ga .Writer ,_gfc string ,_fgcc string ,_gfcb ...interface{}){_ ,_cdc ,_eba ,_ad :=_ed .Caller (3);if !_ad {_cdc ="\u003f\u003f\u003f";_eba =0;}else {_cdc =_d .Base (_cdc );};_gcc :=_f .Sprintf ("\u0025s\u0020\u0025\u0073\u003a\u0025\u0064 ",_gfc ,_cdc ,_eba )+_fgcc +"\u000a";_f .Fprintf (_fe ,_gcc ,_gfcb ...);};
// Error does nothing for dummy logger.
func (DummyLogger )Error (format string ,args ...interface{}){};
// IsLogLevel returns true if log level is greater or equal than `level`.
// Can be used to avoid resource intensive calls to loggers.
func (_gdd ConsoleLogger )IsLogLevel (level LogLevel )bool {return _gdd .LogLevel >=level };
// DummyLogger does nothing.
type DummyLogger struct{};
// Trace does nothing for dummy logger.
func (DummyLogger )Trace (format string ,args ...interface{}){};

View File

@ -11,22 +11,22 @@
// Package diskstore implements tempStorage interface
// by using disk as a storage
package diskstore ;import (_b "github.com/unidoc/unioffice/common/tempstorage";_c "io/ioutil";_ga "os";_f "strings";);
// TempFile creates a new temp directory by calling ioutil TempDir
func (_d diskStorage )TempDir (pattern string )(string ,error ){return _c .TempDir ("",pattern )};
// TempFile creates a new temp file by calling ioutil TempFile
func (_e diskStorage )TempFile (dir ,pattern string )(_b .File ,error ){return _c .TempFile (dir ,pattern );};
// Open opens file from disk according to a path
func (_a diskStorage )Open (path string )(_b .File ,error ){return _ga .OpenFile (path ,_ga .O_RDWR ,0644)};
// Add is not applicable in the diskstore implementation
func (_fe diskStorage )Add (path string )error {return nil };
// SetAsStorage sets temp storage as a disk storage
func SetAsStorage (){_bd :=diskStorage {};_b .SetAsStorage (&_bd )};
package diskstore ;import (_dc "github.com/unidoc/unioffice/common/tempstorage";_fb "io/ioutil";_d "os";_c "strings";);
// RemoveAll removes all files in the directory
func (_gg diskStorage )RemoveAll (dir string )error {if _f .HasPrefix (dir ,_ga .TempDir ()){return _ga .RemoveAll (dir );};return nil ;};type diskStorage struct{};
func (_a diskStorage )RemoveAll (dir string )error {if _c .HasPrefix (dir ,_d .TempDir ()){return _d .RemoveAll (dir );};return nil ;};
// Add is not applicable in the diskstore implementation
func (_b diskStorage )Add (path string )error {return nil };
// TempFile creates a new temp file by calling ioutil TempFile
func (_g diskStorage )TempFile (dir ,pattern string )(_dc .File ,error ){return _fb .TempFile (dir ,pattern );};
// TempFile creates a new temp directory by calling ioutil TempDir
func (_e diskStorage )TempDir (pattern string )(string ,error ){return _fb .TempDir ("",pattern )};type diskStorage struct{};
// Open opens file from disk according to a path
func (_df diskStorage )Open (path string )(_dc .File ,error ){return _d .OpenFile (path ,_d .O_RDWR ,0644)};
// SetAsStorage sets temp storage as a disk storage
func SetAsStorage (){_de :=diskStorage {};_dc .SetAsStorage (&_de )};

View File

@ -11,38 +11,38 @@
// Package memstore implements tempStorage interface
// by using memory as a storage
package memstore ;import (_e "encoding/hex";_ag "errors";_be "fmt";_fa "github.com/unidoc/unioffice/common/tempstorage";_b "io";_f "io/ioutil";_d "math/rand";_g "sync";);
package memstore ;import (_gd "encoding/hex";_e "errors";_c "fmt";_eb "github.com/unidoc/unioffice/common/tempstorage";_g "io";_ge "io/ioutil";_f "math/rand";_gb "sync";);
// SetAsStorage sets temp storage as a memory storage
func SetAsStorage (){_be :=memStorage {_bd :_gb .Map {}};_eb .SetAsStorage (&_be )};
// TempDir creates a name for a new temp directory using a pattern argument
func (_bb *memStorage )TempDir (pattern string )(string ,error ){return _da (pattern ),nil };func _aaf (_fca int )(string ,error ){_bcf :=make ([]byte ,_fca );if _ ,_cba :=_f .Read (_bcf );_cba !=nil {return "",_cba ;};return _gd .EncodeToString (_bcf ),nil ;};
// Add reads a file from a disk and adds it to the storage
func (_fc *memStorage )Add (path string )error {_ ,_ea :=_fc ._bd .Load (path );if _ea {return nil ;};_aad ,_ga :=_ge .ReadFile (path );if _ga !=nil {return _ga ;};_fc ._bd .Store (path ,&memDataCell {_aeg :path ,_cfc :_aad ,_ff :int64 (len (_aad ))});return nil ;};func _da (_fce string )string {_bfg ,_ :=_aaf (6);return _fce +_bfg };
// ReadAt reads from the underlying memDataCell at an offset provided in order to implement ReaderAt interface.
// It does not affect f.readOffset.
func (_ee *memFile )ReadAt (p []byte ,readOffset int64 )(int ,error ){_c :=_ee ._ea ._ac ;_ce :=int64 (len (p ));if _ce > _c {_ce =_c ;p =p [:_ce ];};if readOffset >=_c {return 0,_b .EOF ;};_db :=readOffset +_ce ;if _db >=_c {_db =_c ;};_eb :=copy (p ,_ee ._ea ._gf [readOffset :_db ]);return _eb ,nil ;};type memDataCell struct{_ga string ;_gf []byte ;_ac int64 ;};type memStorage struct{_daa _g .Map };
// Write writes to the end of the underlying memDataCell in order to implement Writer interface
func (_gef *memFile )Write (p []byte )(int ,error ){_gef ._ea ._gf =append (_gef ._ea ._gf ,p ...);_gef ._ea ._ac +=int64 (len (p ));return len (p ),nil ;};func _fee (_cc int )(string ,error ){_eaf :=make ([]byte ,_cc );if _ ,_bb :=_d .Read (_eaf );_bb !=nil {return "",_bb ;};return _e .EncodeToString (_eaf ),nil ;};
// Add reads a file from a disk and adds it to the storage
func (_dda *memStorage )Add (path string )error {_ ,_ecg :=_dda ._daa .Load (path );if _ecg {return nil ;};_ded ,_fae :=_f .ReadFile (path );if _fae !=nil {return _fae ;};_dda ._daa .Store (path ,&memDataCell {_ga :path ,_gf :_ded ,_ac :int64 (len (_ded ))});return nil ;};
func (_bfa *memFile )ReadAt (p []byte ,readOffset int64 )(int ,error ){_d :=_bfa ._fb ._ff ;_gdd :=int64 (len (p ));if _gdd > _d {_gdd =_d ;p =p [:_gdd ];};if readOffset >=_d {return 0,_g .EOF ;};_fbb :=readOffset +_gdd ;if _fbb >=_d {_fbb =_d ;};_cd :=copy (p ,_bfa ._fb ._cfc [readOffset :_fbb ]);return _cd ,nil ;};type memDataCell struct{_aeg string ;_cfc []byte ;_ff int64 ;};
// Close is not applicable in this implementation
func (_efd *memFile )Close ()error {return nil };
// TempDir creates a name for a new temp directory using a pattern argument
func (_ec *memStorage )TempDir (pattern string )(string ,error ){return _cf (pattern ),nil };
// Open returns tempstorage File object by name
func (_aca *memStorage )Open (path string )(_fa .File ,error ){_eed ,_dg :=_aca ._daa .Load (path );if !_dg {return nil ,_ag .New (_be .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 {_ea :_eed .(*memDataCell )},nil ;};
// Name returns the filename of the underlying memDataCell
func (_dd *memFile )Name ()string {return _dd ._ea ._ga };
// RemoveAll removes all files according to the dir argument prefix
func (_bee *memStorage )RemoveAll (dir string )error {_bee ._daa .Range (func (_faa ,_geb interface{})bool {_bee ._daa .Delete (_faa );return true });return nil ;};type memFile struct{_ea *memDataCell ;_ed int64 ;};func _cf (_fe string )string {_bag ,_ :=_fee (6);return _fe +_bag };
// TempFile creates a new empty file in the storage and returns it
func (_acc *memStorage )TempFile (dir ,pattern string )(_fa .File ,error ){_ff :=dir +"\u002f"+_cf (pattern );_ae :=&memDataCell {_ga :_ff ,_gf :[]byte {}};_ba :=&memFile {_ea :_ae };_acc ._daa .Store (_ff ,_ae );return _ba ,nil ;};
func (_ee *memFile )Close ()error {return nil };
// Read reads from the underlying memDataCell in order to implement Reader interface
func (_ge *memFile )Read (p []byte )(int ,error ){_gc :=_ge ._ed ;_fd :=_ge ._ea ._ac ;_da :=int64 (len (p ));if _da > _fd {_da =_fd ;p =p [:_da ];};if _gc >=_fd {return 0,_b .EOF ;};_de :=_gc +_da ;if _de >=_fd {_de =_fd ;};_ef :=copy (p ,_ge ._ea ._gf [_gc :_de ]);_ge ._ed =_de ;return _ef ,nil ;};
func (_b *memFile )Read (p []byte )(int ,error ){_ae :=_b ._fe ;_bf :=_b ._fb ._ff ;_cf :=int64 (len (p ));if _cf > _bf {_cf =_bf ;p =p [:_cf ];};if _ae >=_bf {return 0,_g .EOF ;};_cb :=_ae +_cf ;if _cb >=_bf {_cb =_bf ;};_ec :=copy (p ,_b ._fb ._cfc [_ae :_cb ]);_b ._fe =_cb ;return _ec ,nil ;};
// SetAsStorage sets temp storage as a memory storage
func SetAsStorage (){_acb :=memStorage {_daa :_g .Map {}};_fa .SetAsStorage (&_acb )};
// RemoveAll removes all files according to the dir argument prefix
func (_bfaa *memStorage )RemoveAll (dir string )error {_bfaa ._bd .Range (func (_dg ,_bc interface{})bool {_bfaa ._bd .Delete (_dg );return true });return nil ;};
// Write writes to the end of the underlying memDataCell in order to implement Writer interface
func (_ca *memFile )Write (p []byte )(int ,error ){_ca ._fb ._cfc =append (_ca ._fb ._cfc ,p ...);_ca ._fb ._ff +=int64 (len (p ));return len (p ),nil ;};type memStorage struct{_bd _gb .Map };
// TempFile creates a new empty file in the storage and returns it
func (_afg *memStorage )TempFile (dir ,pattern string )(_eb .File ,error ){_beb :=dir +"\u002f"+_da (pattern );_cfb :=&memDataCell {_aeg :_beb ,_cfc :[]byte {}};_aa :=&memFile {_fb :_cfb };_afg ._bd .Store (_beb ,_cfb );return _aa ,nil ;};
// Open returns tempstorage File object by name
func (_fbbc *memStorage )Open (path string )(_eb .File ,error ){_af ,_bfe :=_fbbc ._bd .Load (path );if !_bfe {return nil ,_e .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 {_fb :_af .(*memDataCell )},nil ;};type memFile struct{_fb *memDataCell ;_fe int64 ;};
// Name returns the filename of the underlying memDataCell
func (_ac *memFile )Name ()string {return _ac ._fb ._aeg };

View File

@ -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 _af "io";
// Open returns tempstorage File object by name.
func Open (path string )(File ,error ){return _ca .Open (path )};
package tempstorage ;import _a "io";
// TempFile creates new empty file in the storage and returns it.
func TempFile (dir ,pattern string )(File ,error ){return _ca .TempFile (dir ,pattern )};
func TempFile (dir ,pattern string )(File ,error ){return _b .TempFile (dir ,pattern )};
// TempDir creates a name for a new temp directory using a pattern argument.
func TempDir (pattern string )(string ,error ){return _ca .TempDir (pattern )};
func TempDir (pattern string )(string ,error ){return _b .TempDir (pattern )};type storage interface{Open (_f string )(File ,error );TempFile (_g ,_d string )(File ,error );TempDir (_ea string )(string ,error );RemoveAll (_ab string )error ;Add (_fa string )error ;};
// Add reads a file from a disk and adds it to the storage.
func Add (path string )error {return _b .Add (path )};
// SetAsStorage changes temporary storage to newStorage.
func SetAsStorage (newStorage storage ){_ca =newStorage };
func SetAsStorage (newStorage storage ){_b =newStorage };
// File is a representation of a storage file
// with Read, Write, Close and Name methods identical to os.File.
type File interface{_af .Reader ;_af .ReaderAt ;_af .Writer ;_af .Closer ;Name ()string ;};
type File interface{_a .Reader ;_a .ReaderAt ;_a .Writer ;_a .Closer ;Name ()string ;};
// RemoveAll removes all files according to the dir argument prefix.
func RemoveAll (dir string )error {return _ca .RemoveAll (dir )};var _ca storage ;type storage interface{Open (_c string )(File ,error );TempFile (_d ,_f string )(File ,error );TempDir (_cf string )(string ,error );RemoveAll (_ad string )error ;Add (_e string )error ;};
func RemoveAll (dir string )error {return _b .RemoveAll (dir )};var _b storage ;
// Add reads a file from a disk and adds it to the storage.
func Add (path string )error {return _ca .Add (path )};
// Open returns tempstorage File object by name.
func Open (path string )(File ,error ){return _b .Open (path )};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -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 (_d "github.com/unidoc/unioffice";_a "github.com/unidoc/unioffice/color";_cc "github.com/unidoc/unioffice/measurement";_c "github.com/unidoc/unioffice/schema/soo/dml";);
// SetLevel sets the level of indentation of a paragraph.
func (_ae ParagraphProperties )SetLevel (idx int32 ){_ae ._ge .LvlAttr =_d .Int32 (idx )};
package drawing ;import (_d "github.com/unidoc/unioffice";_dd "github.com/unidoc/unioffice/color";_b "github.com/unidoc/unioffice/measurement";_f "github.com/unidoc/unioffice/schema/soo/dml";);func (_g LineProperties )SetSolidFill (c _dd .Color ){_g .clearFill ();_g ._e .SolidFill =_f .NewCT_SolidColorFillProperties ();_g ._e .SolidFill .SrgbClr =_f .NewCT_SRgbColor ();_g ._e .SolidFill .SrgbClr .ValAttr =*c .AsRGBString ();};
// SetFlipVertical controls if the shape is flipped vertically.
func (_abc ShapeProperties )SetFlipVertical (b bool ){_abc .ensureXfrm ();if !b {_abc ._df .Xfrm .FlipVAttr =nil ;}else {_abc ._df .Xfrm .FlipVAttr =_d .Bool (true );};};func (_ab ShapeProperties )clearFill (){_ab ._df .NoFill =nil ;_ab ._df .BlipFill =nil ;_ab ._df .GradFill =nil ;_ab ._df .GrpFill =nil ;_ab ._df .SolidFill =nil ;_ab ._df .PattFill =nil ;};type ShapeProperties struct{_df *_c .CT_ShapeProperties };
func (_eae ShapeProperties )SetFlipVertical (b bool ){_eae .ensureXfrm ();if !b {_eae ._bg .Xfrm .FlipVAttr =nil ;}else {_eae ._bg .Xfrm .FlipVAttr =_d .Bool (true );};};func (_fc LineProperties )SetNoFill (){_fc .clearFill ();_fc ._e .NoFill =_f .NewCT_NoFillProperties ()};
// X returns the inner wrapped XML type.
func (_ba Paragraph )X ()*_c .CT_TextParagraph {return _ba ._fg };func (_da LineProperties )SetNoFill (){_da .clearFill ();_da ._f .NoFill =_c .NewCT_NoFillProperties ()};func (_daf ShapeProperties )SetSolidFill (c _a .Color ){_daf .clearFill ();_daf ._df .SolidFill =_c .NewCT_SolidColorFillProperties ();_daf ._df .SolidFill .SrgbClr =_c .NewCT_SRgbColor ();_daf ._df .SolidFill .SrgbClr .ValAttr =*c .AsRGBString ();};
// MakeRunProperties constructs a new RunProperties wrapper.
func MakeRunProperties (x *_c .CT_TextCharacterProperties )RunProperties {return RunProperties {x }};func (_cdd ShapeProperties )LineProperties ()LineProperties {if _cdd ._df .Ln ==nil {_cdd ._df .Ln =_c .NewCT_LineProperties ();};return LineProperties {_cdd ._df .Ln };};
// X returns the inner wrapped XML type.
func (_cff ShapeProperties )X ()*_c .CT_ShapeProperties {return _cff ._df };
// Properties returns the paragraph properties.
func (_cd Paragraph )Properties ()ParagraphProperties {if _cd ._fg .PPr ==nil {_cd ._fg .PPr =_c .NewCT_TextParagraphProperties ();};return MakeParagraphProperties (_cd ._fg .PPr );};
// SetFont controls the font of a run.
func (_de RunProperties )SetFont (s string ){_de ._bad .Latin =_c .NewCT_TextFont ();_de ._bad .Latin .TypefaceAttr =s ;};
// SetSize sets the width and height of the shape.
func (_fe ShapeProperties )SetSize (w ,h _cc .Distance ){_fe .SetWidth (w );_fe .SetHeight (h )};
// SetJoin sets the line join style.
func (_g LineProperties )SetJoin (e LineJoin ){_g ._f .Round =nil ;_g ._f .Miter =nil ;_g ._f .Bevel =nil ;switch e {case LineJoinRound :_g ._f .Round =_c .NewCT_LineJoinRound ();case LineJoinBevel :_g ._f .Bevel =_c .NewCT_LineJoinBevel ();case LineJoinMiter :_g ._f .Miter =_c .NewCT_LineJoinMiterProperties ();};};func (_dg LineProperties )SetSolidFill (c _a .Color ){_dg .clearFill ();_dg ._f .SolidFill =_c .NewCT_SolidColorFillProperties ();_dg ._f .SolidFill .SrgbClr =_c .NewCT_SRgbColor ();_dg ._f .SolidFill .SrgbClr .ValAttr =*c .AsRGBString ();};
// X returns the inner wrapped XML type.
func (_b LineProperties )X ()*_c .CT_LineProperties {return _b ._f };
// SetNumbered controls if bullets are numbered or not.
func (_gg ParagraphProperties )SetNumbered (scheme _c .ST_TextAutonumberScheme ){if scheme ==_c .ST_TextAutonumberSchemeUnset {_gg ._ge .BuAutoNum =nil ;}else {_gg ._ge .BuAutoNum =_c .NewCT_TextAutonumberBullet ();_gg ._ge .BuAutoNum .TypeAttr =scheme ;};};
// MakeParagraphProperties constructs a new ParagraphProperties wrapper.
func MakeParagraphProperties (x *_c .CT_TextParagraphProperties )ParagraphProperties {return ParagraphProperties {x };};
// SetBulletFont controls the font for the bullet character.
func (_fd ParagraphProperties )SetBulletFont (f string ){if f ==""{_fd ._ge .BuFont =nil ;}else {_fd ._ge .BuFont =_c .NewCT_TextFont ();_fd ._ge .BuFont .TypefaceAttr =f ;};};const (LineJoinRound LineJoin =iota ;LineJoinBevel ;LineJoinMiter ;);
// SetWidth sets the width of the shape.
func (_aa ShapeProperties )SetWidth (w _cc .Distance ){_aa .ensureXfrm ();if _aa ._df .Xfrm .Ext ==nil {_aa ._df .Xfrm .Ext =_c .NewCT_PositiveSize2D ();};_aa ._df .Xfrm .Ext .CxAttr =int64 (w /_cc .EMU );};
// Run is a run within a paragraph.
type Run struct{_fgc *_c .EG_TextRun };
// SetFlipHorizontal controls if the shape is flipped horizontally.
func (_fba ShapeProperties )SetFlipHorizontal (b bool ){_fba .ensureXfrm ();if !b {_fba ._df .Xfrm .FlipHAttr =nil ;}else {_fba ._df .Xfrm .FlipHAttr =_d .Bool (true );};};
// SetText sets the run's text contents.
func (_dgb Run )SetText (s string ){_dgb ._fgc .Br =nil ;_dgb ._fgc .Fld =nil ;if _dgb ._fgc .R ==nil {_dgb ._fgc .R =_c .NewCT_RegularTextRun ();};_dgb ._fgc .R .T =s ;};
func (_a LineProperties )X ()*_f .CT_LineProperties {return _a ._e };type LineProperties struct{_e *_f .CT_LineProperties };
// SetPosition sets the position of the shape.
func (_bb ShapeProperties )SetPosition (x ,y _cc .Distance ){_bb .ensureXfrm ();if _bb ._df .Xfrm .Off ==nil {_bb ._df .Xfrm .Off =_c .NewCT_Point2D ();};_bb ._df .Xfrm .Off .XAttr .ST_CoordinateUnqualified =_d .Int64 (int64 (x /_cc .EMU ));_bb ._df .Xfrm .Off .YAttr .ST_CoordinateUnqualified =_d .Int64 (int64 (y /_cc .EMU ));};func (_fb LineProperties )clearFill (){_fb ._f .NoFill =nil ;_fb ._f .GradFill =nil ;_fb ._f .SolidFill =nil ;_fb ._f .PattFill =nil ;};
// Paragraph is a paragraph within a document.
type Paragraph struct{_fg *_c .CT_TextParagraph };
// Properties returns the run's properties.
func (_ebb Run )Properties ()RunProperties {if _ebb ._fgc .R ==nil {_ebb ._fgc .R =_c .NewCT_RegularTextRun ();};if _ebb ._fgc .R .RPr ==nil {_ebb ._fgc .R .RPr =_c .NewCT_TextCharacterProperties ();};return RunProperties {_ebb ._fgc .R .RPr };};
// ParagraphProperties allows controlling paragraph properties.
type ParagraphProperties struct{_ge *_c .CT_TextParagraphProperties ;};
// X returns the inner wrapped XML type.
func (_eb Run )X ()*_c .EG_TextRun {return _eb ._fgc };
// MakeRun constructs a new Run wrapper.
func MakeRun (x *_c .EG_TextRun )Run {return Run {x }};
// SetBold controls the bolding of a run.
func (_eba RunProperties )SetBold (b bool ){_eba ._bad .BAttr =_d .Bool (b )};func MakeShapeProperties (x *_c .CT_ShapeProperties )ShapeProperties {return ShapeProperties {x }};type LineProperties struct{_f *_c .CT_LineProperties };func (_dagf ShapeProperties )ensureXfrm (){if _dagf ._df .Xfrm ==nil {_dagf ._df .Xfrm =_c .NewCT_Transform2D ();};};
func (_dac ShapeProperties )SetPosition (x ,y _b .Distance ){_dac .ensureXfrm ();if _dac ._bg .Xfrm .Off ==nil {_dac ._bg .Xfrm .Off =_f .NewCT_Point2D ();};_dac ._bg .Xfrm .Off .XAttr .ST_CoordinateUnqualified =_d .Int64 (int64 (x /_b .EMU ));_dac ._bg .Xfrm .Off .YAttr .ST_CoordinateUnqualified =_d .Int64 (int64 (y /_b .EMU ));};
// SetHeight sets the height of the shape.
func (_fc ShapeProperties )SetHeight (h _cc .Distance ){_fc .ensureXfrm ();if _fc ._df .Xfrm .Ext ==nil {_fc ._df .Xfrm .Ext =_c .NewCT_PositiveSize2D ();};_fc ._df .Xfrm .Ext .CyAttr =int64 (h /_cc .EMU );};
func (_db ShapeProperties )SetHeight (h _b .Distance ){_db .ensureXfrm ();if _db ._bg .Xfrm .Ext ==nil {_db ._bg .Xfrm .Ext =_f .NewCT_PositiveSize2D ();};_db ._bg .Xfrm .Ext .CyAttr =int64 (h /_b .EMU );};
// SetGeometry sets the shape type of the shape
func (_aef ShapeProperties )SetGeometry (g _c .ST_ShapeType ){if _aef ._df .PrstGeom ==nil {_aef ._df .PrstGeom =_c .NewCT_PresetGeometry2D ();};_aef ._df .PrstGeom .PrstAttr =g ;};
// Properties returns the run's properties.
func (_cge Run )Properties ()RunProperties {if _cge ._ege .R ==nil {_cge ._ege .R =_f .NewCT_RegularTextRun ();};if _cge ._ege .R .RPr ==nil {_cge ._ege .R .RPr =_f .NewCT_TextCharacterProperties ();};return RunProperties {_cge ._ege .R .RPr };};
// SetWidth sets the line width, MS products treat zero as the minimum width
// that can be displayed.
func (_eg LineProperties )SetWidth (w _cc .Distance ){_eg ._f .WAttr =_d .Int32 (int32 (w /_cc .EMU ))};
// Properties returns the paragraph properties.
func (_cf Paragraph )Properties ()ParagraphProperties {if _cf ._bf .PPr ==nil {_cf ._bf .PPr =_f .NewCT_TextParagraphProperties ();};return MakeParagraphProperties (_cf ._bf .PPr );};func (_cd ShapeProperties )SetSolidFill (c _dd .Color ){_cd .clearFill ();_cd ._bg .SolidFill =_f .NewCT_SolidColorFillProperties ();_cd ._bg .SolidFill .SrgbClr =_f .NewCT_SRgbColor ();_cd ._bg .SolidFill .SrgbClr .ValAttr =*c .AsRGBString ();};
// SetBulletChar sets the bullet character for the paragraph.
func (_fge ParagraphProperties )SetBulletChar (c string ){if c ==""{_fge ._ge .BuChar =nil ;}else {_fge ._ge .BuChar =_c .NewCT_TextCharBullet ();_fge ._ge .BuChar .CharAttr =c ;};};
// X returns the inner wrapped XML type.
func (_age Run )X ()*_f .EG_TextRun {return _age ._ege };
// AddRun adds a new run to a paragraph.
func (_cb Paragraph )AddRun ()Run {_be :=MakeRun (_c .NewEG_TextRun ());_cb ._fg .EG_TextRun =append (_cb ._fg .EG_TextRun ,_be .X ());return _be ;};
// X returns the inner wrapped XML type.
func (_ff ShapeProperties )X ()*_f .CT_ShapeProperties {return _ff ._bg };func MakeShapeProperties (x *_f .CT_ShapeProperties )ShapeProperties {return ShapeProperties {x }};
// GetPosition gets the position of the shape in EMU.
func (_fea ShapeProperties )GetPosition ()(int64 ,int64 ){_fea .ensureXfrm ();if _fea ._df .Xfrm .Off ==nil {_fea ._df .Xfrm .Off =_c .NewCT_Point2D ();};return *_fea ._df .Xfrm .Off .XAttr .ST_CoordinateUnqualified ,*_fea ._df .Xfrm .Off .YAttr .ST_CoordinateUnqualified ;};
// SetAlign controls the paragraph alignment
func (_df ParagraphProperties )SetAlign (a _f .ST_TextAlignType ){_df ._ad .AlgnAttr =a };
// RunProperties controls the run properties.
type RunProperties struct{_gce *_f .CT_TextCharacterProperties ;};
// LineJoin is the type of line join
type LineJoin byte ;
// AddBreak adds a new line break to a paragraph.
func (_ccf Paragraph )AddBreak (){_egg :=_c .NewEG_TextRun ();_egg .Br =_c .NewCT_TextLineBreak ();_ccf ._fg .EG_TextRun =append (_ccf ._fg .EG_TextRun ,_egg );};
// SetAlign controls the paragraph alignment
func (_gcd ParagraphProperties )SetAlign (a _c .ST_TextAlignType ){_gcd ._ge .AlgnAttr =a };
// RunProperties controls the run properties.
type RunProperties struct{_bad *_c .CT_TextCharacterProperties ;};
// MakeParagraph constructs a new paragraph wrapper.
func MakeParagraph (x *_c .CT_TextParagraph )Paragraph {return Paragraph {x }};
// X returns the inner wrapped XML type.
func (_gc ParagraphProperties )X ()*_c .CT_TextParagraphProperties {return _gc ._ge };func (_dc ShapeProperties )SetNoFill (){_dc .clearFill ();_dc ._df .NoFill =_c .NewCT_NoFillProperties ()};
func (_cg ParagraphProperties )X ()*_f .CT_TextParagraphProperties {return _cg ._ad };func (_fa ShapeProperties )LineProperties ()LineProperties {if _fa ._bg .Ln ==nil {_fa ._bg .Ln =_f .NewCT_LineProperties ();};return LineProperties {_fa ._bg .Ln };};
// SetSize sets the font size of the run text
func (_cf RunProperties )SetSize (sz _cc .Distance ){_cf ._bad .SzAttr =_d .Int32 (int32 (sz /_cc .HundredthPoint ));};
func (_af RunProperties )SetSize (sz _b .Distance ){_af ._gce .SzAttr =_d .Int32 (int32 (sz /_b .HundredthPoint ));};
// MakeParagraphProperties constructs a new ParagraphProperties wrapper.
func MakeParagraphProperties (x *_f .CT_TextParagraphProperties )ParagraphProperties {return ParagraphProperties {x };};type ShapeProperties struct{_bg *_f .CT_ShapeProperties };
// SetGeometry sets the shape type of the shape
func (_gf ShapeProperties )SetGeometry (g _f .ST_ShapeType ){if _gf ._bg .PrstGeom ==nil {_gf ._bg .PrstGeom =_f .NewCT_PresetGeometry2D ();};_gf ._bg .PrstGeom .PrstAttr =g ;};
// AddRun adds a new run to a paragraph.
func (_bfg Paragraph )AddRun ()Run {_da :=MakeRun (_f .NewEG_TextRun ());_bfg ._bf .EG_TextRun =append (_bfg ._bf .EG_TextRun ,_da .X ());return _da ;};
// AddBreak adds a new line break to a paragraph.
func (_ce Paragraph )AddBreak (){_dg :=_f .NewEG_TextRun ();_dg .Br =_f .NewCT_TextLineBreak ();_ce ._bf .EG_TextRun =append (_ce ._bf .EG_TextRun ,_dg );};
// SetFont controls the font of a run.
func (_ge RunProperties )SetFont (s string ){_ge ._gce .Latin =_f .NewCT_TextFont ();_ge ._gce .Latin .TypefaceAttr =s ;};
// ParagraphProperties allows controlling paragraph properties.
type ParagraphProperties struct{_ad *_f .CT_TextParagraphProperties ;};
// GetPosition gets the position of the shape in EMU.
func (_ced ShapeProperties )GetPosition ()(int64 ,int64 ){_ced .ensureXfrm ();if _ced ._bg .Xfrm .Off ==nil {_ced ._bg .Xfrm .Off =_f .NewCT_Point2D ();};return *_ced ._bg .Xfrm .Off .XAttr .ST_CoordinateUnqualified ,*_ced ._bg .Xfrm .Off .YAttr .ST_CoordinateUnqualified ;};
// MakeRunProperties constructs a new RunProperties wrapper.
func MakeRunProperties (x *_f .CT_TextCharacterProperties )RunProperties {return RunProperties {x }};
// SetWidth sets the line width, MS products treat zero as the minimum width
// that can be displayed.
func (_ag LineProperties )SetWidth (w _b .Distance ){_ag ._e .WAttr =_d .Int32 (int32 (w /_b .EMU ))};
// MakeRun constructs a new Run wrapper.
func MakeRun (x *_f .EG_TextRun )Run {return Run {x }};
// SetBulletChar sets the bullet character for the paragraph.
func (_fg ParagraphProperties )SetBulletChar (c string ){if c ==""{_fg ._ad .BuChar =nil ;}else {_fg ._ad .BuChar =_f .NewCT_TextCharBullet ();_fg ._ad .BuChar .CharAttr =c ;};};func (_ea LineProperties )clearFill (){_ea ._e .NoFill =nil ;_ea ._e .GradFill =nil ;_ea ._e .SolidFill =nil ;_ea ._e .PattFill =nil ;};
// Run is a run within a paragraph.
type Run struct{_ege *_f .EG_TextRun };
// SetWidth sets the width of the shape.
func (_bag ShapeProperties )SetWidth (w _b .Distance ){_bag .ensureXfrm ();if _bag ._bg .Xfrm .Ext ==nil {_bag ._bg .Xfrm .Ext =_f .NewCT_PositiveSize2D ();};_bag ._bg .Xfrm .Ext .CxAttr =int64 (w /_b .EMU );};func (_ca ShapeProperties )ensureXfrm (){if _ca ._bg .Xfrm ==nil {_ca ._bg .Xfrm =_f .NewCT_Transform2D ();};};
// SetBold controls the bolding of a run.
func (_fb RunProperties )SetBold (b bool ){_fb ._gce .BAttr =_d .Bool (b )};
// SetSize sets the width and height of the shape.
func (_afc ShapeProperties )SetSize (w ,h _b .Distance ){_afc .SetWidth (w );_afc .SetHeight (h )};
// X returns the inner wrapped XML type.
func (_gc Paragraph )X ()*_f .CT_TextParagraph {return _gc ._bf };func (_gee ShapeProperties )clearFill (){_gee ._bg .NoFill =nil ;_gee ._bg .BlipFill =nil ;_gee ._bg .GradFill =nil ;_gee ._bg .GrpFill =nil ;_gee ._bg .SolidFill =nil ;_gee ._bg .PattFill =nil ;};const (LineJoinRound LineJoin =iota ;LineJoinBevel ;LineJoinMiter ;);
// SetSolidFill controls the text color of a run.
func (_dag RunProperties )SetSolidFill (c _a .Color ){_dag ._bad .NoFill =nil ;_dag ._bad .BlipFill =nil ;_dag ._bad .GradFill =nil ;_dag ._bad .GrpFill =nil ;_dag ._bad .PattFill =nil ;_dag ._bad .SolidFill =_c .NewCT_SolidColorFillProperties ();_dag ._bad .SolidFill .SrgbClr =_c .NewCT_SRgbColor ();_dag ._bad .SolidFill .SrgbClr .ValAttr =*c .AsRGBString ();};
func (_ba RunProperties )SetSolidFill (c _dd .Color ){_ba ._gce .NoFill =nil ;_ba ._gce .BlipFill =nil ;_ba ._gce .GradFill =nil ;_ba ._gce .GrpFill =nil ;_ba ._gce .PattFill =nil ;_ba ._gce .SolidFill =_f .NewCT_SolidColorFillProperties ();_ba ._gce .SolidFill .SrgbClr =_f .NewCT_SRgbColor ();_ba ._gce .SolidFill .SrgbClr .ValAttr =*c .AsRGBString ();};
// SetFlipHorizontal controls if the shape is flipped horizontally.
func (_gg ShapeProperties )SetFlipHorizontal (b bool ){_gg .ensureXfrm ();if !b {_gg ._bg .Xfrm .FlipHAttr =nil ;}else {_gg ._bg .Xfrm .FlipHAttr =_d .Bool (true );};};
// SetBulletFont controls the font for the bullet character.
func (_eg ParagraphProperties )SetBulletFont (f string ){if f ==""{_eg ._ad .BuFont =nil ;}else {_eg ._ad .BuFont =_f .NewCT_TextFont ();_eg ._ad .BuFont .TypefaceAttr =f ;};};
// Paragraph is a paragraph within a document.
type Paragraph struct{_bf *_f .CT_TextParagraph };
// SetLevel sets the level of indentation of a paragraph.
func (_ae ParagraphProperties )SetLevel (idx int32 ){_ae ._ad .LvlAttr =_d .Int32 (idx )};
// SetJoin sets the line join style.
func (_ef LineProperties )SetJoin (e LineJoin ){_ef ._e .Round =nil ;_ef ._e .Miter =nil ;_ef ._e .Bevel =nil ;switch e {case LineJoinRound :_ef ._e .Round =_f .NewCT_LineJoinRound ();case LineJoinBevel :_ef ._e .Bevel =_f .NewCT_LineJoinBevel ();case LineJoinMiter :_ef ._e .Miter =_f .NewCT_LineJoinMiterProperties ();};};
// SetNumbered controls if bullets are numbered or not.
func (_bc ParagraphProperties )SetNumbered (scheme _f .ST_TextAutonumberScheme ){if scheme ==_f .ST_TextAutonumberSchemeUnset {_bc ._ad .BuAutoNum =nil ;}else {_bc ._ad .BuAutoNum =_f .NewCT_TextAutonumberBullet ();_bc ._ad .BuAutoNum .TypeAttr =scheme ;};};
// SetText sets the run's text contents.
func (_egd Run )SetText (s string ){_egd ._ege .Br =nil ;_egd ._ege .Fld =nil ;if _egd ._ege .R ==nil {_egd ._ege .R =_f .NewCT_RegularTextRun ();};_egd ._ege .R .T =s ;};func (_bge ShapeProperties )SetNoFill (){_bge .clearFill ();_bge ._bg .NoFill =_f .NewCT_NoFillProperties ();};
// MakeParagraph constructs a new paragraph wrapper.
func MakeParagraph (x *_f .CT_TextParagraph )Paragraph {return Paragraph {x }};

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

View File

@ -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{_c :=make ([]float64 ,len (array ));copy (_c ,array );return _c ;};_d :=len (array )/2;_cd :=MergeSort (array [:_d ]);_b :=MergeSort (array [_d :]);_g :=make ([]float64 ,len (array ));_ef :=0;_ba :=0;_f :=0;for _ba < len (_cd )&&_f < len (_b ){if _cd [_ba ]<=_b [_f ]{_g [_ef ]=_cd [_ba ];_ba ++;}else {_g [_ef ]=_b [_f ];_f ++;};_ef ++;};for _ba < len (_cd ){_g [_ef ]=_cd [_ba ];_ba ++;_ef ++;};for _f < len (_b ){_g [_ef ]=_b [_f ];_f ++;_ef ++;};return _g ;};
package mergesort ;func MergeSort (array []float64 )[]float64 {if len (array )<=1{_g :=make ([]float64 ,len (array ));copy (_g ,array );return _g ;};_e :=len (array )/2;_d :=MergeSort (array [:_e ]);_f :=MergeSort (array [_e :]);_ge :=make ([]float64 ,len (array ));_b :=0;_eg :=0;_bf :=0;for _eg < len (_d )&&_bf < len (_f ){if _d [_eg ]<=_f [_bf ]{_ge [_b ]=_d [_eg ];_eg ++;}else {_ge [_b ]=_f [_bf ];_bf ++;};_b ++;};for _eg < len (_d ){_ge [_b ]=_d [_eg ];_eg ++;_b ++;};for _bf < len (_f ){_ge [_b ]=_f [_bf ];_bf ++;_b ++;};return _ge ;};

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

View File

@ -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 Match (pattern ,name string )(_c bool ){if pattern ==""{return name ==pattern ;};if pattern =="\u002a"{return true ;};_ag :=make ([]rune ,0,len (name ));_bc :=make ([]rune ,0,len (pattern ));for _ ,_fd :=range name {_ag =append (_ag ,_fd );};for _ ,_ce :=range pattern {_bc =append (_bc ,_ce );};_bf :=false ;return _fcb (_ag ,_bc ,_bf );};func _fcb (_fdg ,_cb []rune ,_bd bool )bool {for len (_cb )> 0{switch _cb [0]{default:if len (_fdg )==0||_fdg [0]!=_cb [0]{return false ;};case '?':if len (_fdg )==0&&!_bd {return false ;};case '*':return _fcb (_fdg ,_cb [1:],_bd )||(len (_fdg )> 0&&_fcb (_fdg [1:],_cb ,_bd ));};_fdg =_fdg [1:];_cb =_cb [1:];};return len (_fdg )==0&&len (_cb )==0;};func MatchSimple (pattern ,name string )bool {if pattern ==""{return name ==pattern ;};if pattern =="\u002a"{return true ;};_b :=make ([]rune ,0,len (name ));_a :=make ([]rune ,0,len (pattern ));for _ ,_ba :=range name {_b =append (_b ,_ba );};for _ ,_fb :=range pattern {_a =append (_a ,_fb );};_fc :=true ;return _fcb (_b ,_a ,_fc );};func Index (pattern ,name string )(_fbd int ){if pattern ==""||pattern =="\u002a"{return 0;};_ccb :=make ([]rune ,0,len (name ));_bdf :=make ([]rune ,0,len (pattern ));for _ ,_bab :=range name {_ccb =append (_ccb ,_bab );};for _ ,_ff :=range pattern {_bdf =append (_bdf ,_ff );};return _d (_ccb ,_bdf ,0);};func _d (_gff ,_be []rune ,_aa int )int {for len (_be )> 0{switch _be [0]{default:if len (_gff )==0{return -1;};if _gff [0]!=_be [0]{return _d (_gff [1:],_be ,_aa +1);};case '?':if len (_gff )==0{return -1;};case '*':if len (_gff )==0{return -1;};_ac :=_d (_gff ,_be [1:],_aa );if _ac !=-1{return _aa ;}else {_ac =_d (_gff [1:],_be ,_aa );if _ac !=-1{return _aa ;}else {return -1;};};};_gff =_gff [1:];_be =_be [1:];};return _aa ;};
package wildcard ;func Index (pattern ,name string )(_ef int ){if pattern ==""||pattern =="\u002a"{return 0;};_c :=make ([]rune ,0,len (name ));_af :=make ([]rune ,0,len (pattern ));for _ ,_dac :=range name {_c =append (_c ,_dac );};for _ ,_bcee :=range pattern {_af =append (_af ,_bcee );};return _afb (_c ,_af ,0);};func Match (pattern ,name string )(_fe bool ){if pattern ==""{return name ==pattern ;};if pattern =="\u002a"{return true ;};_ea :=make ([]rune ,0,len (name ));_ab :=make ([]rune ,0,len (pattern ));for _ ,_da :=range name {_ea =append (_ea ,_da );};for _ ,_ee :=range pattern {_ab =append (_ab ,_ee );};_ac :=false ;return _dba (_ea ,_ab ,_ac );};func _afb (_bg ,_gaa []rune ,_fb int )int {for len (_gaa )> 0{switch _gaa [0]{default:if len (_bg )==0{return -1;};if _bg [0]!=_gaa [0]{return _afb (_bg [1:],_gaa ,_fb +1);};case '?':if len (_bg )==0{return -1;};case '*':if len (_bg )==0{return -1;};_ce :=_afb (_bg ,_gaa [1:],_fb );if _ce !=-1{return _fb ;}else {_ce =_afb (_bg [1:],_gaa ,_fb );if _ce !=-1{return _fb ;}else {return -1;};};};_bg =_bg [1:];_gaa =_gaa [1:];};return _fb ;};func MatchSimple (pattern ,name string )bool {if pattern ==""{return name ==pattern ;};if pattern =="\u002a"{return true ;};_d :=make ([]rune ,0,len (name ));_f :=make ([]rune ,0,len (pattern ));for _ ,_db :=range name {_d =append (_d ,_db );};for _ ,_a :=range pattern {_f =append (_f ,_a );};_g :=true ;return _dba (_d ,_f ,_g );};func _dba (_fg ,_bb []rune ,_ge bool )bool {for len (_bb )> 0{switch _bb [0]{default:if len (_fg )==0||_fg [0]!=_bb [0]{return false ;};case '?':if len (_fg )==0&&!_ge {return false ;};case '*':return _dba (_fg ,_bb [1:],_ge )||(len (_fg )> 0&&_dba (_fg [1:],_bb ,_ge ));};_fg =_fg [1:];_bb =_bb [1:];};return len (_fg )==0&&len (_bb )==0;};

View File

@ -9,13 +9,13 @@
// 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 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 ;);
package measurement ;
// 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 };
func FromEMU (emu int64 )float64 {return float64 (emu )/914400*Inch };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 ;);
// Distance represents a distance and is automatically converted
// to the units needed internally in the various ECMA 376 formats.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -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 (_d "encoding/xml";_f "fmt";_b "github.com/unidoc/unioffice";_a "github.com/unidoc/unioffice/common/logger";);func NewElementsGroup ()*ElementsGroup {_gg :=&ElementsGroup {};return _gg };func (_ed *Any )MarshalXML (e *_d .Encoder ,start _d .StartElement )error {return _ed .SimpleLiteral .MarshalXML (e ,start );};
// Validate validates the SimpleLiteral and its children
func (_cca *SimpleLiteral )Validate ()error {return _cca .ValidateWithPath ("\u0053\u0069\u006d\u0070\u006c\u0065\u004c\u0069\u0074\u0065\u0072\u0061\u006c");};func NewAny ()*Any {_ad :=&Any {};_ad .SimpleLiteral =*NewSimpleLiteral ();return _ad };
// ValidateWithPath validates the Any and its children, prefixing error messages with path
func (_ec *Any )ValidateWithPath (path string )error {if _bf :=_ec .SimpleLiteral .ValidateWithPath (path );_bf !=nil {return _bf ;};return nil ;};func (_fde *ElementContainer )UnmarshalXML (d *_d .Decoder ,start _d .StartElement )error {_ag :for {_be ,_fc :=d .Token ();if _fc !=nil {return _fc ;};switch _bfd :=_be .(type ){case _d .StartElement :switch _bfd .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"}:_ac :=NewElementsGroupChoice ();if _gf :=d .DecodeElement (&_ac .Any ,&_bfd );_gf !=nil {return _gf ;};_fde .Choice =append (_fde .Choice ,_ac );default:_a .Log .Debug ("\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",_bfd .Name );if _bfe :=d .Skip ();_bfe !=nil {return _bfe ;};};case _d .EndElement :break _ag ;case _d .CharData :};};return nil ;};func (_fca *ElementsGroup )UnmarshalXML (d *_d .Decoder ,start _d .StartElement )error {_ee :for {_fg ,_eb :=d .Token ();if _eb !=nil {return _eb ;};switch _db :=_fg .(type ){case _d .StartElement :switch _db .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"}:_ccg :=NewElementsGroupChoice ();if _fdg :=d .DecodeElement (&_ccg .Any ,&_db );_fdg !=nil {return _fdg ;};_fca .Choice =append (_fca .Choice ,_ccg );default:_a .Log .Debug ("\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",_db .Name );if _ff :=d .Skip ();_ff !=nil {return _ff ;};};case _d .EndElement :break _ee ;case _d .CharData :};};return nil ;};
// Validate validates the ElementContainer and its children
func (_ecd *ElementContainer )Validate ()error {return _ecd .ValidateWithPath ("\u0045\u006ce\u006d\u0065\u006et\u0043\u006f\u006e\u0074\u0061\u0069\u006e\u0065\u0072");};func (_gfc *ElementsGroupChoice )MarshalXML (e *_d .Encoder ,start _d .StartElement )error {if _gfc .Any !=nil {_ecb :=_d .StartElement {Name :_d .Name {Local :"\u0064\u0063\u003a\u0061\u006e\u0079"}};for _ ,_eef :=range _gfc .Any {e .EncodeElement (_eef ,_ecb );};};return nil ;};func (_ceg *ElementsGroupChoice )UnmarshalXML (d *_d .Decoder ,start _d .StartElement )error {_eda :for {_geb ,_eca :=d .Token ();if _eca !=nil {return _eca ;};switch _dfg :=_geb .(type ){case _d .StartElement :switch _dfg .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"}:_eea :=NewAny ();if _cg :=d .DecodeElement (_eea ,&_dfg );_cg !=nil {return _cg ;};_ceg .Any =append (_ceg .Any ,_eea );default:_a .Log .Debug ("\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",_dfg .Name );if _ca :=d .Skip ();_ca !=nil {return _ca ;};};case _d .EndElement :break _eda ;case _d .CharData :};};return nil ;};
// Validate validates the Any and its children
func (_fd *Any )Validate ()error {return _fd .ValidateWithPath ("\u0041\u006e\u0079")};func (_eff *SimpleLiteral )UnmarshalXML (d *_d .Decoder ,start _d .StartElement )error {for {_ga ,_ced :=d .Token ();if _ced !=nil {return _f .Errorf ("\u0070a\u0072\u0073\u0069\u006eg\u0020\u0053\u0069\u006d\u0070l\u0065L\u0069t\u0065\u0072\u0061\u006c\u003a\u0020\u0025s",_ced );};if _bd ,_dfgd :=_ga .(_d .EndElement );_dfgd &&_bd .Name ==start .Name {break ;};};return nil ;};func NewElementsGroupChoice ()*ElementsGroupChoice {_ef :=&ElementsGroupChoice {};return _ef };func (_cc *ElementsGroup )MarshalXML (e *_d .Encoder ,start _d .StartElement )error {if _cc .Choice !=nil {for _ ,_adb :=range _cc .Choice {_adb .MarshalXML (e ,_d .StartElement {});};};return nil ;};
package elements ;import (_g "encoding/xml";_a "fmt";_e "github.com/unidoc/unioffice";_gg "github.com/unidoc/unioffice/common/logger";);type Any struct{SimpleLiteral };
// Validate validates the ElementsGroup and its children
func (_dda *ElementsGroup )Validate ()error {return _dda .ValidateWithPath ("\u0045\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u0047\u0072\u006f\u0075\u0070");};func (_g *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 _g .Choice !=nil {for _ ,_c :=range _g .Choice {_c .MarshalXML (e ,_d .StartElement {});};};e .EncodeToken (_d .EndElement {Name :start .Name });return nil ;};func (_ba *Any )UnmarshalXML (d *_d .Decoder ,start _d .StartElement )error {_ba .SimpleLiteral =*NewSimpleLiteral ();for {_da ,_ede :=d .Token ();if _ede !=nil {return _f .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0041\u006e\u0079\u003a\u0020\u0025\u0073",_ede );};if _dd ,_adc :=_da .(_d .EndElement );_adc &&_dd .Name ==start .Name {break ;};};return nil ;};func NewSimpleLiteral ()*SimpleLiteral {_dfe :=&SimpleLiteral {};return _dfe };type ElementsGroupChoice struct{Any []*Any ;};type SimpleLiteral struct{};
func (_gea *ElementsGroup )Validate ()error {return _gea .ValidateWithPath ("\u0045\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u0047\u0072\u006f\u0075\u0070");};func (_ba *ElementsGroup )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {if _ba .Choice !=nil {for _ ,_cde :=range _ba .Choice {_cde .MarshalXML (e ,_g .StartElement {});};};return nil ;};func NewElementsGroup ()*ElementsGroup {_bd :=&ElementsGroup {};return _bd };func (_af *ElementsGroup )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {_gc :for {_ded ,_bg :=d .Token ();if _bg !=nil {return _bg ;};switch _bc :=_ded .(type ){case _g .StartElement :switch _bc .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"}:_gec :=NewElementsGroupChoice ();if _eg :=d .DecodeElement (&_gec .Any ,&_bc );_eg !=nil {return _eg ;};_af .Choice =append (_af .Choice ,_gec );default:_gg .Log .Debug ("\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",_bc .Name );if _faf :=d .Skip ();_faf !=nil {return _faf ;};};case _g .EndElement :break _gc ;case _g .CharData :};};return nil ;};func (_afg *ElementsGroupChoice )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {if _afg .Any !=nil {_cb :=_g .StartElement {Name :_g .Name {Local :"\u0064\u0063\u003a\u0061\u006e\u0079"}};for _ ,_fc :=range _afg .Any {e .EncodeElement (_fc ,_cb );};};return nil ;};func NewElementContainer ()*ElementContainer {_f :=&ElementContainer {};return _f };func (_eee *ElementsGroupChoice )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {_ga :for {_ag ,_ggb :=d .Token ();if _ggb !=nil {return _ggb ;};switch _deg :=_ag .(type ){case _g .StartElement :switch _deg .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"}:_fe :=NewAny ();if _ff :=d .DecodeElement (_fe ,&_deg );_ff !=nil {return _ff ;};_eee .Any =append (_eee .Any ,_fe );default:_gg .Log .Debug ("\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",_deg .Name );if _dbb :=d .Skip ();_dbb !=nil {return _dbb ;};};case _g .EndElement :break _ga ;case _g .CharData :};};return nil ;};func (_be *ElementContainer )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {_cd :for {_cef ,_abe :=d .Token ();if _abe !=nil {return _abe ;};switch _fg :=_cef .(type ){case _g .StartElement :switch _fg .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"}:_fa :=NewElementsGroupChoice ();if _de :=d .DecodeElement (&_fa .Any ,&_fg );_de !=nil {return _de ;};_be .Choice =append (_be .Choice ,_fa );default:_gg .Log .Debug ("\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",_fg .Name );if _db :=d .Skip ();_db !=nil {return _db ;};};case _g .EndElement :break _cd ;case _g .CharData :};};return nil ;};
// ValidateWithPath validates the SimpleLiteral and its children, prefixing error messages with path
func (_dbb *SimpleLiteral )ValidateWithPath (path string )error {return nil };
func (_eeaa *SimpleLiteral )ValidateWithPath (path string )error {return nil };type ElementsGroup struct{Choice []*ElementsGroupChoice ;};type ElementsGroupChoice struct{Any []*Any ;};type ElementContainer struct{Choice []*ElementsGroupChoice ;};
// Validate validates the ElementsGroupChoice and its children
func (_ab *ElementsGroupChoice )Validate ()error {return _ab .ValidateWithPath ("\u0045\u006c\u0065\u006den\u0074\u0073\u0047\u0072\u006f\u0075\u0070\u0043\u0068\u006f\u0069\u0063\u0065");};type ElementsGroup struct{Choice []*ElementsGroupChoice ;};type Any struct{SimpleLiteral };type ElementContainer struct{Choice []*ElementsGroupChoice ;};
// Validate validates the Any and its children
func (_cac *Any )Validate ()error {return _cac .ValidateWithPath ("\u0041\u006e\u0079")};
// ValidateWithPath validates the ElementsGroupChoice and its children, prefixing error messages with path
func (_dce *ElementsGroupChoice )ValidateWithPath (path string )error {for _baa ,_fdd :=range _dce .Any {if _egd :=_fdd .ValidateWithPath (_f .Sprintf ("\u0025\u0073\u002f\u0041\u006e\u0079\u005b\u0025\u0064\u005d",path ,_baa ));_egd !=nil {return _egd ;};};return nil ;};
func (_ec *ElementsGroupChoice )ValidateWithPath (path string )error {for _afgf ,_bag :=range _ec .Any {if _agdd :=_bag .ValidateWithPath (_a .Sprintf ("\u0025\u0073\u002f\u0041\u006e\u0079\u005b\u0025\u0064\u005d",path ,_afgf ));_agdd !=nil {return _agdd ;};};return nil ;};func NewElementsGroupChoice ()*ElementsGroupChoice {_eea :=&ElementsGroupChoice {};return _eea };
// ValidateWithPath validates the ElementContainer and its children, prefixing error messages with path
func (_cb *ElementContainer )ValidateWithPath (path string )error {for _ce ,_eg :=range _cb .Choice {if _fcf :=_eg .ValidateWithPath (_f .Sprintf ("\u0025\u0073\u002f\u0043\u0068\u006f\u0069\u0063\u0065\u005b\u0025\u0064\u005d",path ,_ce ));_fcf !=nil {return _fcf ;};};return nil ;};func NewElementContainer ()*ElementContainer {_bb :=&ElementContainer {};return _bb };
// ValidateWithPath validates the Any and its children, prefixing error messages with path
func (_ab *Any )ValidateWithPath (path string )error {if _dc :=_ab .SimpleLiteral .ValidateWithPath (path );_dc !=nil {return _dc ;};return nil ;};type SimpleLiteral struct{};
// Validate validates the ElementContainer and its children
func (_gd *ElementContainer )Validate ()error {return _gd .ValidateWithPath ("\u0045\u006ce\u006d\u0065\u006et\u0043\u006f\u006e\u0074\u0061\u0069\u006e\u0065\u0072");};func (_cfa *SimpleLiteral )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_ddg ,_dbe :=d .Token ();if _dbe !=nil {return _a .Errorf ("\u0070a\u0072\u0073\u0069\u006eg\u0020\u0053\u0069\u006d\u0070l\u0065L\u0069t\u0065\u0072\u0061\u006c\u003a\u0020\u0025s",_dbe );};if _cge ,_aaf :=_ddg .(_g .EndElement );_aaf &&_cge .Name ==start .Name {break ;};};return nil ;};func NewAny ()*Any {_b :=&Any {};_b .SimpleLiteral =*NewSimpleLiteral ();return _b };
// Validate validates the ElementsGroupChoice and its children
func (_agd *ElementsGroupChoice )Validate ()error {return _agd .ValidateWithPath ("\u0045\u006c\u0065\u006den\u0074\u0073\u0047\u0072\u006f\u0075\u0070\u0043\u0068\u006f\u0069\u0063\u0065");};func (_ca *Any )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {return _ca .SimpleLiteral .MarshalXML (e ,start );};
// ValidateWithPath validates the ElementsGroup and its children, prefixing error messages with path
func (_df *ElementsGroup )ValidateWithPath (path string )error {for _dg ,_cbg :=range _df .Choice {if _dc :=_cbg .ValidateWithPath (_f .Sprintf ("\u0025\u0073\u002f\u0043\u0068\u006f\u0069\u0063\u0065\u005b\u0025\u0064\u005d",path ,_dg ));_dc !=nil {return _dc ;};};return nil ;};func (_fa *SimpleLiteral )MarshalXML (e *_d .Encoder ,start _d .StartElement )error {e .EncodeToken (start );e .EncodeToken (_d .EndElement {Name :start .Name });return nil ;};func init (){_b .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 );_b .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 );_b .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 );_b .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 (_gda *ElementsGroup )ValidateWithPath (path string )error {for _fd ,_gcb :=range _gda .Choice {if _aa :=_gcb .ValidateWithPath (_a .Sprintf ("\u0025\u0073\u002f\u0043\u0068\u006f\u0069\u0063\u0065\u005b\u0025\u0064\u005d",path ,_fd ));_aa !=nil {return _aa ;};};return nil ;};func NewSimpleLiteral ()*SimpleLiteral {_gb :=&SimpleLiteral {};return _gb };func (_gcd *SimpleLiteral )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};
// Validate validates the SimpleLiteral and its children
func (_cbd *SimpleLiteral )Validate ()error {return _cbd .ValidateWithPath ("\u0053\u0069\u006d\u0070\u006c\u0065\u004c\u0069\u0074\u0065\u0072\u0061\u006c");};func (_d *Any )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {_d .SimpleLiteral =*NewSimpleLiteral ();for {_dd ,_ce :=d .Token ();if _ce !=nil {return _a .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0041\u006e\u0079\u003a\u0020\u0025\u0073",_ce );};if _cg ,_ge :=_dd .(_g .EndElement );_ge &&_cg .Name ==start .Name {break ;};};return nil ;};func (_ac *ElementContainer )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0065\u006ce\u006d\u0065\u006et\u0043\u006f\u006e\u0074\u0061\u0069\u006e\u0065\u0072";e .EncodeToken (start );if _ac .Choice !=nil {for _ ,_dcg :=range _ac .Choice {_dcg .MarshalXML (e ,_g .StartElement {});};};e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};
// ValidateWithPath validates the ElementContainer and its children, prefixing error messages with path
func (_ee *ElementContainer )ValidateWithPath (path string )error {for _cea ,_bf :=range _ee .Choice {if _cfc :=_bf .ValidateWithPath (_a .Sprintf ("\u0025\u0073\u002f\u0043\u0068\u006f\u0069\u0063\u0065\u005b\u0025\u0064\u005d",path ,_cea ));_cfc !=nil {return _cfc ;};};return nil ;};func init (){_e .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 );_e .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 );_e .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 );_e .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 );};

View File

@ -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 (_c "encoding/xml";_f "fmt";_dg "github.com/unidoc/unioffice";_d "github.com/unidoc/unioffice/common/logger";_fb "github.com/unidoc/unioffice/schema/purl.org/dc/elements";);func (_bafg *LCSH )MarshalXML (e *_c .Encoder ,start _c .StartElement )error {start .Name .Local ="\u004c\u0043\u0053\u0048";e .EncodeToken (start );e .EncodeToken (_c .EndElement {Name :start .Name });return nil ;};func (_ccf *MESH )UnmarshalXML (d *_c .Decoder ,start _c .StartElement )error {for {_bda ,_aab :=d .Token ();if _aab !=nil {return _f .Errorf ("\u0070\u0061r\u0073\u0069\u006eg\u0020\u004d\u0045\u0053\u0048\u003a\u0020\u0025\u0073",_aab );};if _age ,_fed :=_bda .(_c .EndElement );_fed &&_age .Name ==start .Name {break ;};};return nil ;};func NewUDC ()*UDC {_edgf :=&UDC {};return _edgf };
// Validate validates the IMT and its children
func (_abg *IMT )Validate ()error {return _abg .ValidateWithPath ("\u0049\u004d\u0054")};func (_fg *ISO3166 )MarshalXML (e *_c .Encoder ,start _c .StartElement )error {start .Name .Local ="\u0049S\u004f\u0033\u0031\u0036\u0036";e .EncodeToken (start );e .EncodeToken (_c .EndElement {Name :start .Name });return nil ;};
// Validate validates the RFC1766 and its children
func (_gfff *RFC1766 )Validate ()error {return _gfff .ValidateWithPath ("\u0052F\u0043\u0031\u0037\u0036\u0036");};func (_fd *DCMIType )MarshalXML (e *_c .Encoder ,start _c .StartElement )error {start .Name .Local ="\u0044\u0043\u004d\u0049\u0054\u0079\u0070\u0065";e .EncodeToken (start );e .EncodeToken (_c .EndElement {Name :start .Name });return nil ;};func (_egg *RFC3066 )MarshalXML (e *_c .Encoder ,start _c .StartElement )error {start .Name .Local ="\u0052F\u0043\u0033\u0030\u0036\u0036";e .EncodeToken (start );e .EncodeToken (_c .EndElement {Name :start .Name });return nil ;};func (_da *ElementsAndRefinementsGroupChoice )UnmarshalXML (d *_c .Decoder ,start _c .StartElement )error {_ace :for {_eag ,_aff :=d .Token ();if _aff !=nil {return _aff ;};switch _dc :=_eag .(type ){case _c .StartElement :switch _dc .Name {case _c .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"}:_gg :=_fb .NewAny ();if _efg :=d .DecodeElement (_gg ,&_dc );_efg !=nil {return _efg ;};_da .Any =append (_da .Any ,_gg );default:_d .Log .Debug ("\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",_dc .Name );if _fba :=d .Skip ();_fba !=nil {return _fba ;};};case _c .EndElement :break _ace ;case _c .CharData :};};return nil ;};func (_ea *ElementsAndRefinementsGroupChoice )MarshalXML (e *_c .Encoder ,start _c .StartElement )error {if _ea .Any !=nil {_fe :=_c .StartElement {Name :_c .Name {Local :"\u0064\u0063\u003a\u0061\u006e\u0079"}};for _ ,_gcc :=range _ea .Any {e .EncodeElement (_gcc ,_fe );};};return nil ;};func (_ccfg *W3CDTF )UnmarshalXML (d *_c .Decoder ,start _c .StartElement )error {for {_gdff ,_gfd :=d .Token ();if _gfd !=nil {return _f .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u00573\u0043\u0044T\u0046\u003a\u0020\u0025\u0073",_gfd );};if _cba ,_bgfa :=_gdff .(_c .EndElement );_bgfa &&_cba .Name ==start .Name {break ;};};return nil ;};
// Validate validates the DDC and its children
func (_df *DDC )Validate ()error {return _df .ValidateWithPath ("\u0044\u0044\u0043")};
// ValidateWithPath validates the DDC and its children, prefixing error messages with path
func (_fbg *DDC )ValidateWithPath (path string )error {return nil };
// Validate validates the Period and its children
func (_dgd *Period )Validate ()error {return _dgd .ValidateWithPath ("\u0050\u0065\u0072\u0069\u006f\u0064");};
// Validate validates the Point and its children
func (_bbga *Point )Validate ()error {return _bbga .ValidateWithPath ("\u0050\u006f\u0069n\u0074")};func NewDCMIType ()*DCMIType {_g :=&DCMIType {};return _g };func NewElementOrRefinementContainer ()*ElementOrRefinementContainer {_ae :=&ElementOrRefinementContainer {};return _ae ;};type ISO3166 struct{};func (_gf *DDC )MarshalXML (e *_c .Encoder ,start _c .StartElement )error {start .Name .Local ="\u0044\u0044\u0043";e .EncodeToken (start );e .EncodeToken (_c .EndElement {Name :start .Name });return nil ;};func (_ffa *UDC )MarshalXML (e *_c .Encoder ,start _c .StartElement )error {start .Name .Local ="\u0055\u0044\u0043";e .EncodeToken (start );e .EncodeToken (_c .EndElement {Name :start .Name });return nil ;};func (_edg *LCSH )UnmarshalXML (d *_c .Decoder ,start _c .StartElement )error {for {_bgf ,_dbc :=d .Token ();if _dbc !=nil {return _f .Errorf ("\u0070\u0061r\u0073\u0069\u006eg\u0020\u004c\u0043\u0053\u0048\u003a\u0020\u0025\u0073",_dbc );};if _ead ,_dfaf :=_bgf .(_c .EndElement );_dfaf &&_ead .Name ==start .Name {break ;};};return nil ;};
// ValidateWithPath validates the ISO639_2 and its children, prefixing error messages with path
func (_gaf *ISO639_2 )ValidateWithPath (path string )error {return nil };func (_gbde *TGN )UnmarshalXML (d *_c .Decoder ,start _c .StartElement )error {for {_fgf ,_ddca :=d .Token ();if _ddca !=nil {return _f .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0054\u0047\u004e\u003a\u0020\u0025\u0073",_ddca );};if _ebg ,_gdb :=_fgf .(_c .EndElement );_gdb &&_ebg .Name ==start .Name {break ;};};return nil ;};func NewPoint ()*Point {_ceb :=&Point {};return _ceb };func NewRFC3066 ()*RFC3066 {_bdc :=&RFC3066 {};return _bdc };func NewMESH ()*MESH {_edd :=&MESH {};return _edd };
// Validate validates the MESH and its children
func (_acg *MESH )Validate ()error {return _acg .ValidateWithPath ("\u004d\u0045\u0053\u0048")};func (_de *Period )MarshalXML (e *_c .Encoder ,start _c .StartElement )error {start .Name .Local ="\u0050\u0065\u0072\u0069\u006f\u0064";e .EncodeToken (start );e .EncodeToken (_c .EndElement {Name :start .Name });return nil ;};type LCSH struct{};func (_bgc *ISO639_2 )UnmarshalXML (d *_c .Decoder ,start _c .StartElement )error {for {_fca ,_cg :=d .Token ();if _cg !=nil {return _f .Errorf ("p\u0061r\u0073\u0069\u006e\u0067\u0020\u0049\u0053\u004f6\u0033\u0039\u005f\u0032: \u0025\u0073",_cg );};if _aef ,_ccg :=_fca .(_c .EndElement );_ccg &&_aef .Name ==start .Name {break ;};};return nil ;};
// Validate validates the DCMIType and its children
func (_ag *DCMIType )Validate ()error {return _ag .ValidateWithPath ("\u0044\u0043\u004d\u0049\u0054\u0079\u0070\u0065");};func (_aad *URI )UnmarshalXML (d *_c .Decoder ,start _c .StartElement )error {for {_gac ,_fedb :=d .Token ();if _fedb !=nil {return _f .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0055\u0052\u0049\u003a\u0020\u0025\u0073",_fedb );};if _aaf ,_gcee :=_gac .(_c .EndElement );_gcee &&_aaf .Name ==start .Name {break ;};};return nil ;};
// ValidateWithPath validates the RFC3066 and its children, prefixing error messages with path
func (_efgg *RFC3066 )ValidateWithPath (path string )error {return nil };
// ValidateWithPath validates the LCC and its children, prefixing error messages with path
func (_fac *LCC )ValidateWithPath (path string )error {return nil };
// ValidateWithPath validates the Point and its children, prefixing error messages with path
func (_dee *Point )ValidateWithPath (path string )error {return nil };func (_dbb *LCC )MarshalXML (e *_c .Encoder ,start _c .StartElement )error {start .Name .Local ="\u004c\u0043\u0043";e .EncodeToken (start );e .EncodeToken (_c .EndElement {Name :start .Name });return nil ;};
// ValidateWithPath validates the TGN and its children, prefixing error messages with path
func (_ebd *TGN )ValidateWithPath (path string )error {return nil };
// ValidateWithPath validates the ElementOrRefinementContainer and its children, prefixing error messages with path
func (_agg *ElementOrRefinementContainer )ValidateWithPath (path string )error {for _dgfb ,_eg :=range _agg .Choice {if _bf :=_eg .ValidateWithPath (_f .Sprintf ("\u0025\u0073\u002f\u0043\u0068\u006f\u0069\u0063\u0065\u005b\u0025\u0064\u005d",path ,_dgfb ));_bf !=nil {return _bf ;};};return nil ;};func (_cd *DDC )UnmarshalXML (d *_c .Decoder ,start _c .StartElement )error {for {_dge ,_bg :=d .Token ();if _bg !=nil {return _f .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0044\u0044\u0043\u003a\u0020\u0025\u0073",_bg );};if _dda ,_dgf :=_dge .(_c .EndElement );_dgf &&_dda .Name ==start .Name {break ;};};return nil ;};
// ValidateWithPath validates the UDC and its children, prefixing error messages with path
func (_cfe *UDC )ValidateWithPath (path string )error {return nil };func NewElementsAndRefinementsGroupChoice ()*ElementsAndRefinementsGroupChoice {_ga :=&ElementsAndRefinementsGroupChoice {};return _ga ;};
// Validate validates the ISO3166 and its children
func (_cf *ISO3166 )Validate ()error {return _cf .ValidateWithPath ("\u0049S\u004f\u0033\u0031\u0036\u0036");};func (_bggb *ElementsAndRefinementsGroup )MarshalXML (e *_c .Encoder ,start _c .StartElement )error {if _bggb .Choice !=nil {for _ ,_ab :=range _bggb .Choice {_ab .MarshalXML (e ,_c .StartElement {});};};return nil ;};type TGN struct{};func (_ad *ElementOrRefinementContainer )MarshalXML (e *_c .Encoder ,start _c .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 _ad .Choice !=nil {for _ ,_ff :=range _ad .Choice {_ff .MarshalXML (e ,_c .StartElement {});};};e .EncodeToken (_c .EndElement {Name :start .Name });return nil ;};func (_dgfc *Point )MarshalXML (e *_c .Encoder ,start _c .StartElement )error {start .Name .Local ="\u0050\u006f\u0069n\u0074";e .EncodeToken (start );e .EncodeToken (_c .EndElement {Name :start .Name });return nil ;};
// ValidateWithPath validates the RFC1766 and its children, prefixing error messages with path
func (_acc *RFC1766 )ValidateWithPath (path string )error {return nil };
// Validate validates the UDC and its children
func (_fdg *UDC )Validate ()error {return _fdg .ValidateWithPath ("\u0055\u0044\u0043")};type ISO639_2 struct{};type IMT struct{};func NewDDC ()*DDC {_fbd :=&DDC {};return _fbd };func (_fda *ElementOrRefinementContainer )UnmarshalXML (d *_c .Decoder ,start _c .StartElement )error {_bge :for {_dgc ,_bgg :=d .Token ();if _bgg !=nil {return _bgg ;};switch _gb :=_dgc .(type ){case _c .StartElement :switch _gb .Name {case _c .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"}:_bgb :=NewElementsAndRefinementsGroupChoice ();if _ffe :=d .DecodeElement (&_bgb .Any ,&_gb );_ffe !=nil {return _ffe ;};_fda .Choice =append (_fda .Choice ,_bgb );default:_d .Log .Debug ("\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",_gb .Name );if _ada :=d .Skip ();_ada !=nil {return _ada ;};};case _c .EndElement :break _bge ;case _c .CharData :};};return nil ;};
// Validate validates the RFC3066 and its children
func (_edc *RFC3066 )Validate ()error {return _edc .ValidateWithPath ("\u0052F\u0043\u0033\u0030\u0036\u0036");};func (_ddb *Point )UnmarshalXML (d *_c .Decoder ,start _c .StartElement )error {for {_bce ,_aeag :=d .Token ();if _aeag !=nil {return _f .Errorf ("\u0070\u0061\u0072\u0073\u0069\u006e\u0067\u0020\u0050\u006f\u0069\u006et\u003a\u0020\u0025\u0073",_aeag );};if _fag ,_cdc :=_bce .(_c .EndElement );_cdc &&_fag .Name ==start .Name {break ;};};return nil ;};func NewBox ()*Box {_fc :=&Box {};return _fc };
// ValidateWithPath validates the ISO3166 and its children, prefixing error messages with path
func (_dbf *ISO3166 )ValidateWithPath (path string )error {return nil };
// ValidateWithPath validates the DCMIType and its children, prefixing error messages with path
func (_gc *DCMIType )ValidateWithPath (path string )error {return nil };
// ValidateWithPath validates the LCSH and its children, prefixing error messages with path
func (_ddc *LCSH )ValidateWithPath (path string )error {return nil };
// Validate validates the TGN and its children
func (_ceag *TGN )Validate ()error {return _ceag .ValidateWithPath ("\u0054\u0047\u004e")};func (_fff *TGN )MarshalXML (e *_c .Encoder ,start _c .StartElement )error {start .Name .Local ="\u0054\u0047\u004e";e .EncodeToken (start );e .EncodeToken (_c .EndElement {Name :start .Name });return nil ;};type DCMIType struct{};
// ValidateWithPath validates the IMT and its children, prefixing error messages with path
func (_ge *IMT )ValidateWithPath (path string )error {return nil };func (_gcce *UDC )UnmarshalXML (d *_c .Decoder ,start _c .StartElement )error {for {_aagd ,_ddag :=d .Token ();if _ddag !=nil {return _f .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0055\u0044\u0043\u003a\u0020\u0025\u0073",_ddag );};if _afb ,_ded :=_aagd .(_c .EndElement );_ded &&_afb .Name ==start .Name {break ;};};return nil ;};type ElementOrRefinementContainer struct{Choice []*ElementsAndRefinementsGroupChoice ;};func (_gbdg *RFC1766 )MarshalXML (e *_c .Encoder ,start _c .StartElement )error {start .Name .Local ="\u0052F\u0043\u0031\u0037\u0036\u0036";e .EncodeToken (start );e .EncodeToken (_c .EndElement {Name :start .Name });return nil ;};type Box struct{};func NewPeriod ()*Period {_edgb :=&Period {};return _edgb };type UDC struct{};func NewIMT ()*IMT {_dgbd :=&IMT {};return _dgbd };
// Validate validates the URI and its children
func (_affd *URI )Validate ()error {return _affd .ValidateWithPath ("\u0055\u0052\u0049")};func (_gff *RFC1766 )UnmarshalXML (d *_c .Decoder ,start _c .StartElement )error {for {_gdfc ,_fgc :=d .Token ();if _fgc !=nil {return _f .Errorf ("\u0070\u0061\u0072\u0073in\u0067\u0020\u0052\u0046\u0043\u0031\u0037\u0036\u0036\u003a\u0020\u0025\u0073",_fgc );};if _eda ,_gaa :=_gdfc .(_c .EndElement );_gaa &&_eda .Name ==start .Name {break ;};};return nil ;};func NewTGN ()*TGN {_gga :=&TGN {};return _gga };
// Validate validates the ISO639_2 and its children
func (_cedf *ISO639_2 )Validate ()error {return _cedf .ValidateWithPath ("\u0049\u0053\u004f\u0036\u0033\u0039\u005f\u0032");};func NewRFC1766 ()*RFC1766 {_dgfcf :=&RFC1766 {};return _dgfcf };func NewLCC ()*LCC {_baf :=&LCC {};return _baf };
// Validate validates the W3CDTF and its children
func (_cbe *W3CDTF )Validate ()error {return _cbe .ValidateWithPath ("\u0057\u0033\u0043\u0044\u0054\u0046");};
// Validate validates the ElementsAndRefinementsGroupChoice and its children
func (_ddf *ElementsAndRefinementsGroupChoice )Validate ()error {return _ddf .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 {_gab :=&URI {};return _gab };type RFC1766 struct{};
// ValidateWithPath validates the W3CDTF and its children, prefixing error messages with path
func (_aaa *W3CDTF )ValidateWithPath (path string )error {return nil };type Point struct{};
// Validate validates the ElementOrRefinementContainer and its children
func (_agd *ElementOrRefinementContainer )Validate ()error {return _agd .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 NewISO639_2 ()*ISO639_2 {_acd :=&ISO639_2 {};return _acd };type ElementsAndRefinementsGroupChoice struct{Any []*_fb .Any ;};type ElementsAndRefinementsGroup struct{Choice []*ElementsAndRefinementsGroupChoice ;};
// ValidateWithPath validates the Box and its children, prefixing error messages with path
func (_dd *Box )ValidateWithPath (path string )error {return nil };type LCC struct{};func (_bbg *LCC )UnmarshalXML (d *_c .Decoder ,start _c .StartElement )error {for {_afg ,_dfa :=d .Token ();if _dfa !=nil {return _f .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u004c\u0043\u0043\u003a\u0020\u0025\u0073",_dfa );};if _gcg ,_ccgc :=_afg .(_c .EndElement );_ccgc &&_gcg .Name ==start .Name {break ;};};return nil ;};func (_bb *Box )UnmarshalXML (d *_c .Decoder ,start _c .StartElement )error {for {_ce ,_bba :=d .Token ();if _bba !=nil {return _f .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0042\u006f\u0078\u003a\u0020\u0025\u0073",_bba );};if _e ,_db :=_ce .(_c .EndElement );_db &&_e .Name ==start .Name {break ;};};return nil ;};
// ValidateWithPath validates the Period and its children, prefixing error messages with path
func (_cea *Period )ValidateWithPath (path string )error {return nil };func (_ac *ElementsAndRefinementsGroup )UnmarshalXML (d *_c .Decoder ,start _c .StartElement )error {_aa :for {_bbe ,_cc :=d .Token ();if _cc !=nil {return _cc ;};switch _cdg :=_bbe .(type ){case _c .StartElement :switch _cdg .Name {case _c .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"}:_fcc :=NewElementsAndRefinementsGroupChoice ();if _fbf :=d .DecodeElement (&_fcc .Any ,&_cdg );_fbf !=nil {return _fbf ;};_ac .Choice =append (_ac .Choice ,_fcc );default:_d .Log .Debug ("\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",_cdg .Name );if _fdc :=d .Skip ();_fdc !=nil {return _fdc ;};};case _c .EndElement :break _aa ;case _c .CharData :};};return nil ;};func (_bc *IMT )UnmarshalXML (d *_c .Decoder ,start _c .StartElement )error {for {_aag ,_gdf :=d .Token ();if _gdf !=nil {return _f .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0049\u004d\u0054\u003a\u0020\u0025\u0073",_gdf );};if _dcg ,_bcb :=_aag .(_c .EndElement );_bcb &&_dcg .Name ==start .Name {break ;};};return nil ;};
// Validate validates the ElementsAndRefinementsGroup and its children
func (_egd *ElementsAndRefinementsGroup )Validate ()error {return _egd .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 (_gge *Period )UnmarshalXML (d *_c .Decoder ,start _c .StartElement )error {for {_bgce ,_dca :=d .Token ();if _dca !=nil {return _f .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0050e\u0072\u0069o\u0064\u003a\u0020\u0025\u0073",_dca );};if _fdd ,_gae :=_bgce .(_c .EndElement );_gae &&_fdd .Name ==start .Name {break ;};};return nil ;};
package terms ;import (_e "encoding/xml";_g "fmt";_ea "github.com/unidoc/unioffice";_d "github.com/unidoc/unioffice/common/logger";_ed "github.com/unidoc/unioffice/schema/purl.org/dc/elements";);func (_cab *ISO639_2 )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {for {_agb ,_bfd :=d .Token ();if _bfd !=nil {return _g .Errorf ("p\u0061r\u0073\u0069\u006e\u0067\u0020\u0049\u0053\u004f6\u0033\u0039\u005f\u0032: \u0025\u0073",_bfd );};if _eab ,_cdg :=_agb .(_e .EndElement );_cdg &&_eab .Name ==start .Name {break ;};};return nil ;};func NewDCMIType ()*DCMIType {_ab :=&DCMIType {};return _ab };
// ValidateWithPath validates the ElementsAndRefinementsGroupChoice and its children, prefixing error messages with path
func (_dgfg *ElementsAndRefinementsGroupChoice )ValidateWithPath (path string )error {for _gbf ,_gd :=range _dgfg .Any {if _ec :=_gd .ValidateWithPath (_f .Sprintf ("\u0025\u0073\u002f\u0041\u006e\u0079\u005b\u0025\u0064\u005d",path ,_gbf ));_ec !=nil {return _ec ;};};return nil ;};func NewElementsAndRefinementsGroup ()*ElementsAndRefinementsGroup {_gbd :=&ElementsAndRefinementsGroup {};return _gbd ;};func (_gcb *W3CDTF )MarshalXML (e *_c .Encoder ,start _c .StartElement )error {start .Name .Local ="\u0057\u0033\u0043\u0044\u0054\u0046";e .EncodeToken (start );e .EncodeToken (_c .EndElement {Name :start .Name });return nil ;};
func (_fca *ElementsAndRefinementsGroupChoice )ValidateWithPath (path string )error {for _gg ,_aab :=range _fca .Any {if _gde :=_aab .ValidateWithPath (_g .Sprintf ("\u0025\u0073\u002f\u0041\u006e\u0079\u005b\u0025\u0064\u005d",path ,_gg ));_gde !=nil {return _gde ;};};return nil ;};
// Validate validates the ISO3166 and its children
func (_eeb *ISO3166 )Validate ()error {return _eeb .ValidateWithPath ("\u0049S\u004f\u0033\u0031\u0036\u0036");};
// Validate validates the MESH and its children
func (_acg *MESH )Validate ()error {return _acg .ValidateWithPath ("\u004d\u0045\u0053\u0048")};func NewElementsAndRefinementsGroupChoice ()*ElementsAndRefinementsGroupChoice {_gadg :=&ElementsAndRefinementsGroupChoice {};return _gadg ;};type ElementsAndRefinementsGroup struct{Choice []*ElementsAndRefinementsGroupChoice ;};
// Validate validates the LCSH and its children
func (_dgcd *LCSH )Validate ()error {return _dgcd .ValidateWithPath ("\u004c\u0043\u0053\u0048")};
func (_ade *LCSH )Validate ()error {return _ade .ValidateWithPath ("\u004c\u0043\u0053\u0048")};func NewURI ()*URI {_gcc :=&URI {};return _gcc };func NewW3CDTF ()*W3CDTF {_dagf :=&W3CDTF {};return _dagf };func (_ebcg *W3CDTF )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {for {_cfc ,_adcb :=d .Token ();if _adcb !=nil {return _g .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u00573\u0043\u0044T\u0046\u003a\u0020\u0025\u0073",_adcb );};if _gff ,_bdc :=_cfc .(_e .EndElement );_bdc &&_gff .Name ==start .Name {break ;};};return nil ;};
// Validate validates the LCC and its children
func (_fgd *LCC )Validate ()error {return _fgd .ValidateWithPath ("\u004c\u0043\u0043")};
// ValidateWithPath validates the RFC3066 and its children, prefixing error messages with path
func (_dgg *RFC3066 )ValidateWithPath (path string )error {return nil };func (_be *DDC )MarshalXML (e *_e .Encoder ,start _e .StartElement )error {start .Name .Local ="\u0044\u0044\u0043";e .EncodeToken (start );e .EncodeToken (_e .EndElement {Name :start .Name });return nil ;};type TGN struct{};func (_fcb *Point )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {for {_ec ,_aaba :=d .Token ();if _aaba !=nil {return _g .Errorf ("\u0070\u0061\u0072\u0073\u0069\u006e\u0067\u0020\u0050\u006f\u0069\u006et\u003a\u0020\u0025\u0073",_aaba );};if _deb ,_acd :=_ec .(_e .EndElement );_acd &&_deb .Name ==start .Name {break ;};};return nil ;};func (_de *LCC )MarshalXML (e *_e .Encoder ,start _e .StartElement )error {start .Name .Local ="\u004c\u0043\u0043";e .EncodeToken (start );e .EncodeToken (_e .EndElement {Name :start .Name });return nil ;};
// Validate validates the Box and its children
func (_ee *Box )Validate ()error {return _ee .ValidateWithPath ("\u0042\u006f\u0078")};type RFC3066 struct{};func (_ca *Box )MarshalXML (e *_c .Encoder ,start _c .StartElement )error {start .Name .Local ="\u0042\u006f\u0078";e .EncodeToken (start );e .EncodeToken (_c .EndElement {Name :start .Name });return nil ;};func (_efd *URI )MarshalXML (e *_c .Encoder ,start _c .StartElement )error {start .Name .Local ="\u0055\u0052\u0049";e .EncodeToken (start );e .EncodeToken (_c .EndElement {Name :start .Name });return nil ;};
// ValidateWithPath validates the LCC and its children, prefixing error messages with path
func (_cgda *LCC )ValidateWithPath (path string )error {return nil };func (_bg *ElementsAndRefinementsGroup )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {_fa :for {_fd ,_dag :=d .Token ();if _dag !=nil {return _dag ;};switch _aec :=_fd .(type ){case _e .StartElement :switch _aec .Name {case _e .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"}:_ged :=NewElementsAndRefinementsGroupChoice ();if _abe :=d .DecodeElement (&_ged .Any ,&_aec );_abe !=nil {return _abe ;};_bg .Choice =append (_bg .Choice ,_ged );default:_d .Log .Debug ("\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",_aec .Name );if _abd :=d .Skip ();_abd !=nil {return _abd ;};};case _e .EndElement :break _fa ;case _e .CharData :};};return nil ;};func (_cdf *ISO3166 )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {for {_cec ,_adc :=d .Token ();if _adc !=nil {return _g .Errorf ("\u0070\u0061\u0072\u0073in\u0067\u0020\u0049\u0053\u004f\u0033\u0031\u0036\u0036\u003a\u0020\u0025\u0073",_adc );};if _abeg ,_fbd :=_cec .(_e .EndElement );_fbd &&_abeg .Name ==start .Name {break ;};};return nil ;};func NewBox ()*Box {_c :=&Box {};return _c };type Box struct{};func (_aadg *TGN )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {for {_edc ,_gac :=d .Token ();if _gac !=nil {return _g .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0054\u0047\u004e\u003a\u0020\u0025\u0073",_gac );};if _dcb ,_gdae :=_edc .(_e .EndElement );_gdae &&_dcb .Name ==start .Name {break ;};};return nil ;};func (_cd *ElementsAndRefinementsGroup )MarshalXML (e *_e .Encoder ,start _e .StartElement )error {if _cd .Choice !=nil {for _ ,_fe :=range _cd .Choice {_fe .MarshalXML (e ,_e .StartElement {});};};return nil ;};
// ValidateWithPath validates the MESH and its children, prefixing error messages with path
func (_ccd *MESH )ValidateWithPath (path string )error {return nil };func NewW3CDTF ()*W3CDTF {_ged :=&W3CDTF {};return _ged };type Period struct{};
// ValidateWithPath validates the W3CDTF and its children, prefixing error messages with path
func (_cdgg *W3CDTF )ValidateWithPath (path string )error {return nil };func (_df *DCMIType )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {for {_f ,_ead :=d .Token ();if _ead !=nil {return _g .Errorf ("p\u0061r\u0073\u0069\u006e\u0067\u0020\u0044\u0043\u004dI\u0054\u0079\u0070\u0065: \u0025\u0073",_ead );};if _dc ,_af :=_f .(_e .EndElement );_af &&_dc .Name ==start .Name {break ;};};return nil ;};
// ValidateWithPath validates the ElementsAndRefinementsGroup and its children, prefixing error messages with path
func (_af *ElementsAndRefinementsGroup )ValidateWithPath (path string )error {for _gce ,_gfa :=range _af .Choice {if _dfg :=_gfa .ValidateWithPath (_f .Sprintf ("\u0025\u0073\u002f\u0043\u0068\u006f\u0069\u0063\u0065\u005b\u0025\u0064\u005d",path ,_gce ));_dfg !=nil {return _dfg ;};};return nil ;};func NewLCSH ()*LCSH {_aeae :=&LCSH {};return _aeae };func (_feb *ISO639_2 )MarshalXML (e *_c .Encoder ,start _c .StartElement )error {start .Name .Local ="\u0049\u0053\u004f\u0036\u0033\u0039\u002d\u0032";e .EncodeToken (start );e .EncodeToken (_c .EndElement {Name :start .Name });return nil ;};type W3CDTF struct{};func (_fec *MESH )MarshalXML (e *_c .Encoder ,start _c .StartElement )error {start .Name .Local ="\u004d\u0045\u0053\u0048";e .EncodeToken (start );e .EncodeToken (_c .EndElement {Name :start .Name });return nil ;};func (_aea *ISO3166 )UnmarshalXML (d *_c .Decoder ,start _c .StartElement )error {for {_daf ,_bff :=d .Token ();if _bff !=nil {return _f .Errorf ("\u0070\u0061\u0072\u0073in\u0067\u0020\u0049\u0053\u004f\u0033\u0031\u0036\u0036\u003a\u0020\u0025\u0073",_bff );};if _bd ,_ced :=_daf .(_c .EndElement );_ced &&_bd .Name ==start .Name {break ;};};return nil ;};type DDC struct{};type URI struct{};func (_dgb *DCMIType )UnmarshalXML (d *_c .Decoder ,start _c .StartElement )error {for {_a ,_ef :=d .Token ();if _ef !=nil {return _f .Errorf ("p\u0061r\u0073\u0069\u006e\u0067\u0020\u0044\u0043\u004dI\u0054\u0079\u0070\u0065: \u0025\u0073",_ef );};if _ba ,_fa :=_a .(_c .EndElement );_fa &&_ba .Name ==start .Name {break ;};};return nil ;};type MESH struct{};func (_ggc *RFC3066 )UnmarshalXML (d *_c .Decoder ,start _c .StartElement )error {for {_fcd ,_bgbg :=d .Token ();if _bgbg !=nil {return _f .Errorf ("\u0070\u0061\u0072\u0073in\u0067\u0020\u0052\u0046\u0043\u0033\u0030\u0036\u0036\u003a\u0020\u0025\u0073",_bgbg );};if _eb ,_baa :=_fcd .(_c .EndElement );_baa &&_eb .Name ==start .Name {break ;};};return nil ;};
// ValidateWithPath validates the ISO3166 and its children, prefixing error messages with path
func (_adf *ISO3166 )ValidateWithPath (path string )error {return nil };type RFC1766 struct{};
// Validate validates the ElementsAndRefinementsGroup and its children
func (_aa *ElementsAndRefinementsGroup )Validate ()error {return _aa .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 (_fcf *ElementOrRefinementContainer )MarshalXML (e *_e .Encoder ,start _e .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 _fcf .Choice !=nil {for _ ,_da :=range _fcf .Choice {_da .MarshalXML (e ,_e .StartElement {});};};e .EncodeToken (_e .EndElement {Name :start .Name });return nil ;};type DDC struct{};func (_dba *RFC1766 )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {for {_bge ,_cgc :=d .Token ();if _cgc !=nil {return _g .Errorf ("\u0070\u0061\u0072\u0073in\u0067\u0020\u0052\u0046\u0043\u0031\u0037\u0036\u0036\u003a\u0020\u0025\u0073",_cgc );};if _fdeg ,_fdb :=_bge .(_e .EndElement );_fdb &&_fdeg .Name ==start .Name {break ;};};return nil ;};func (_bbe *ISO639_2 )MarshalXML (e *_e .Encoder ,start _e .StartElement )error {start .Name .Local ="\u0049\u0053\u004f\u0036\u0033\u0039\u002d\u0032";e .EncodeToken (start );e .EncodeToken (_e .EndElement {Name :start .Name });return nil ;};func (_dfg *LCSH )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {for {_gdf ,_aff :=d .Token ();if _aff !=nil {return _g .Errorf ("\u0070\u0061r\u0073\u0069\u006eg\u0020\u004c\u0043\u0053\u0048\u003a\u0020\u0025\u0073",_aff );};if _cfg ,_gdb :=_gdf .(_e .EndElement );_gdb &&_cfg .Name ==start .Name {break ;};};return nil ;};
// ValidateWithPath validates the URI and its children, prefixing error messages with path
func (_bdd *URI )ValidateWithPath (path string )error {return nil };func (_dbd *IMT )MarshalXML (e *_c .Encoder ,start _c .StartElement )error {start .Name .Local ="\u0049\u004d\u0054";e .EncodeToken (start );e .EncodeToken (_c .EndElement {Name :start .Name });return nil ;};func NewISO3166 ()*ISO3166 {_cb :=&ISO3166 {};return _cb };func init (){_dg .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 );_dg .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 );_dg .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0044\u0044\u0043",NewDDC );_dg .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u004c\u0043\u0043",NewLCC );_dg .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0055\u0044\u0043",NewUDC );_dg .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 );_dg .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 );_dg .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 );_dg .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0049\u004d\u0054",NewIMT );_dg .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0055\u0052\u0049",NewURI );_dg .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 );_dg .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 );_dg .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 );_dg .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 );_dg .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 );_dg .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0042\u006f\u0078",NewBox );_dg .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0054\u0047\u004e",NewTGN );_dg .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 );_dg .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 (_eac *URI )ValidateWithPath (path string )error {return nil };func NewISO639_2 ()*ISO639_2 {_cbbc :=&ISO639_2 {};return _cbbc };func NewPeriod ()*Period {_gaf :=&Period {};return _gaf };
// Validate validates the IMT and its children
func (_abc *IMT )Validate ()error {return _abc .ValidateWithPath ("\u0049\u004d\u0054")};
// ValidateWithPath validates the RFC1766 and its children, prefixing error messages with path
func (_ega *RFC1766 )ValidateWithPath (path string )error {return nil };func (_cgd *IMT )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {for {_fde ,_ca :=d .Token ();if _ca !=nil {return _g .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0049\u004d\u0054\u003a\u0020\u0025\u0073",_ca );};if _bfgg ,_dab :=_fde .(_e .EndElement );_dab &&_bfgg .Name ==start .Name {break ;};};return nil ;};
// Validate validates the TGN and its children
func (_bfgf *TGN )Validate ()error {return _bfgf .ValidateWithPath ("\u0054\u0047\u004e")};type MESH struct{};type ElementOrRefinementContainer struct{Choice []*ElementsAndRefinementsGroupChoice ;};
// ValidateWithPath validates the UDC and its children, prefixing error messages with path
func (_cdgb *UDC )ValidateWithPath (path string )error {return nil };type UDC struct{};func (_gc *RFC1766 )MarshalXML (e *_e .Encoder ,start _e .StartElement )error {start .Name .Local ="\u0052F\u0043\u0031\u0037\u0036\u0036";e .EncodeToken (start );e .EncodeToken (_e .EndElement {Name :start .Name });return nil ;};func (_dfeg *Point )MarshalXML (e *_e .Encoder ,start _e .StartElement )error {start .Name .Local ="\u0050\u006f\u0069n\u0074";e .EncodeToken (start );e .EncodeToken (_e .EndElement {Name :start .Name });return nil ;};func NewLCSH ()*LCSH {_aef :=&LCSH {};return _aef };type ISO3166 struct{};func NewMESH ()*MESH {_edda :=&MESH {};return _edda };type LCSH struct{};func NewTGN ()*TGN {_bgf :=&TGN {};return _bgf };
// Validate validates the ISO639_2 and its children
func (_ede *ISO639_2 )Validate ()error {return _ede .ValidateWithPath ("\u0049\u0053\u004f\u0036\u0033\u0039\u005f\u0032");};
// Validate validates the RFC3066 and its children
func (_caf *RFC3066 )Validate ()error {return _caf .ValidateWithPath ("\u0052F\u0043\u0033\u0030\u0036\u0036");};
// ValidateWithPath validates the IMT and its children, prefixing error messages with path
func (_cge *IMT )ValidateWithPath (path string )error {return nil };
// ValidateWithPath validates the DDC and its children, prefixing error messages with path
func (_ge *DDC )ValidateWithPath (path string )error {return nil };func (_egb *LCC )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {for {_geb ,_dfc :=d .Token ();if _dfc !=nil {return _g .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u004c\u0043\u0043\u003a\u0020\u0025\u0073",_dfc );};if _ceb ,_aad :=_geb .(_e .EndElement );_aad &&_ceb .Name ==start .Name {break ;};};return nil ;};
// ValidateWithPath validates the ElementOrRefinementContainer and its children, prefixing error messages with path
func (_db *ElementOrRefinementContainer )ValidateWithPath (path string )error {for _ebg ,_ad :=range _db .Choice {if _ee :=_ad .ValidateWithPath (_g .Sprintf ("\u0025\u0073\u002f\u0043\u0068\u006f\u0069\u0063\u0065\u005b\u0025\u0064\u005d",path ,_ebg ));_ee !=nil {return _ee ;};};return nil ;};type ElementsAndRefinementsGroupChoice struct{Any []*_ed .Any ;};func (_dg *RFC3066 )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {for {_cag ,_fgc :=d .Token ();if _fgc !=nil {return _g .Errorf ("\u0070\u0061\u0072\u0073in\u0067\u0020\u0052\u0046\u0043\u0033\u0030\u0036\u0036\u003a\u0020\u0025\u0073",_fgc );};if _efg ,_aabf :=_cag .(_e .EndElement );_aabf &&_efg .Name ==start .Name {break ;};};return nil ;};func (_fcfe *ElementOrRefinementContainer )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {_fb :for {_eg ,_bba :=d .Token ();if _bba !=nil {return _bba ;};switch _fba :=_eg .(type ){case _e .StartElement :switch _fba .Name {case _e .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"}:_cfa :=NewElementsAndRefinementsGroupChoice ();if _fcd :=d .DecodeElement (&_cfa .Any ,&_fba );_fcd !=nil {return _fcd ;};_fcfe .Choice =append (_fcfe .Choice ,_cfa );default:_d .Log .Debug ("\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",_fba .Name );if _bfg :=d .Skip ();_bfg !=nil {return _bfg ;};};case _e .EndElement :break _fb ;case _e .CharData :};};return nil ;};
// Validate validates the Period and its children
func (_efc *Period )Validate ()error {return _efc .ValidateWithPath ("\u0050\u0065\u0072\u0069\u006f\u0064");};func (_ce *Box )MarshalXML (e *_e .Encoder ,start _e .StartElement )error {start .Name .Local ="\u0042\u006f\u0078";e .EncodeToken (start );e .EncodeToken (_e .EndElement {Name :start .Name });return nil ;};func (_bga *ElementsAndRefinementsGroupChoice )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {_fbf :for {_ebd ,_afb :=d .Token ();if _afb !=nil {return _afb ;};switch _faa :=_ebd .(type ){case _e .StartElement :switch _faa .Name {case _e .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"}:_dcf :=_ed .NewAny ();if _ag :=d .DecodeElement (_dcf ,&_faa );_ag !=nil {return _ag ;};_bga .Any =append (_bga .Any ,_dcf );default:_d .Log .Debug ("\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",_faa .Name );if _cbg :=d .Skip ();_cbg !=nil {return _cbg ;};};case _e .EndElement :break _fbf ;case _e .CharData :};};return nil ;};func (_efb *IMT )MarshalXML (e *_e .Encoder ,start _e .StartElement )error {start .Name .Local ="\u0049\u004d\u0054";e .EncodeToken (start );e .EncodeToken (_e .EndElement {Name :start .Name });return nil ;};func (_ga *Box )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {for {_b ,_dd :=d .Token ();if _dd !=nil {return _g .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0042\u006f\u0078\u003a\u0020\u0025\u0073",_dd );};if _cb ,_gad :=_b .(_e .EndElement );_gad &&_cb .Name ==start .Name {break ;};};return nil ;};type RFC3066 struct{};func (_dad *ISO3166 )MarshalXML (e *_e .Encoder ,start _e .StartElement )error {start .Name .Local ="\u0049S\u004f\u0033\u0031\u0036\u0036";e .EncodeToken (start );e .EncodeToken (_e .EndElement {Name :start .Name });return nil ;};
// Validate validates the UDC and its children
func (_dadg *UDC )Validate ()error {return _dadg .ValidateWithPath ("\u0055\u0044\u0043")};func NewIMT ()*IMT {_ebc :=&IMT {};return _ebc };func NewRFC1766 ()*RFC1766 {_gggc :=&RFC1766 {};return _gggc };type LCC struct{};func (_aca *TGN )MarshalXML (e *_e .Encoder ,start _e .StartElement )error {start .Name .Local ="\u0054\u0047\u004e";e .EncodeToken (start );e .EncodeToken (_e .EndElement {Name :start .Name });return nil ;};func (_bbd *RFC3066 )MarshalXML (e *_e .Encoder ,start _e .StartElement )error {start .Name .Local ="\u0052F\u0043\u0033\u0030\u0036\u0036";e .EncodeToken (start );e .EncodeToken (_e .EndElement {Name :start .Name });return nil ;};
// ValidateWithPath validates the ISO639_2 and its children, prefixing error messages with path
func (_aeeg *ISO639_2 )ValidateWithPath (path string )error {return nil };
// Validate validates the DCMIType and its children
func (_ae *DCMIType )Validate ()error {return _ae .ValidateWithPath ("\u0044\u0043\u004d\u0049\u0054\u0079\u0070\u0065");};func (_gda *Period )MarshalXML (e *_e .Encoder ,start _e .StartElement )error {start .Name .Local ="\u0050\u0065\u0072\u0069\u006f\u0064";e .EncodeToken (start );e .EncodeToken (_e .EndElement {Name :start .Name });return nil ;};func (_agbd *Period )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {for {_dcfc ,_acge :=d .Token ();if _acge !=nil {return _g .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0050e\u0072\u0069o\u0064\u003a\u0020\u0025\u0073",_acge );};if _afd ,_cbgg :=_dcfc .(_e .EndElement );_cbgg &&_afd .Name ==start .Name {break ;};};return nil ;};
// ValidateWithPath validates the Period and its children, prefixing error messages with path
func (_ggg *Period )ValidateWithPath (path string )error {return nil };
// Validate validates the W3CDTF and its children
func (_aaa *W3CDTF )Validate ()error {return _aaa .ValidateWithPath ("\u0057\u0033\u0043\u0044\u0054\u0046");};
// Validate validates the ElementOrRefinementContainer and its children
func (_cg *ElementOrRefinementContainer )Validate ()error {return _cg .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 (_afbe *UDC )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {for {_deg ,_ceg :=d .Token ();if _ceg !=nil {return _g .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0055\u0044\u0043\u003a\u0020\u0025\u0073",_ceg );};if _ggd ,_eca :=_deg .(_e .EndElement );_eca &&_ggd .Name ==start .Name {break ;};};return nil ;};
// ValidateWithPath validates the MESH and its children, prefixing error messages with path
func (_ege *MESH )ValidateWithPath (path string )error {return nil };func NewElementsAndRefinementsGroup ()*ElementsAndRefinementsGroup {_bc :=&ElementsAndRefinementsGroup {};return _bc ;};type IMT struct{};
// ValidateWithPath validates the DCMIType and its children, prefixing error messages with path
func (_ef *DCMIType )ValidateWithPath (path string )error {return nil };func (_gf *ElementsAndRefinementsGroupChoice )MarshalXML (e *_e .Encoder ,start _e .StartElement )error {if _gf .Any !=nil {_fag :=_e .StartElement {Name :_e .Name {Local :"\u0064\u0063\u003a\u0061\u006e\u0079"}};for _ ,_feb :=range _gf .Any {e .EncodeElement (_feb ,_fag );};};return nil ;};type DCMIType struct{};type ISO639_2 struct{};func (_ccaa *UDC )MarshalXML (e *_e .Encoder ,start _e .StartElement )error {start .Name .Local ="\u0055\u0044\u0043";e .EncodeToken (start );e .EncodeToken (_e .EndElement {Name :start .Name });return nil ;};
// Validate validates the LCC and its children
func (_fcae *LCC )Validate ()error {return _fcae .ValidateWithPath ("\u004c\u0043\u0043")};func (_eb *DCMIType )MarshalXML (e *_e .Encoder ,start _e .StartElement )error {start .Name .Local ="\u0044\u0043\u004d\u0049\u0054\u0079\u0070\u0065";e .EncodeToken (start );e .EncodeToken (_e .EndElement {Name :start .Name });return nil ;};func (_fgg *W3CDTF )MarshalXML (e *_e .Encoder ,start _e .StartElement )error {start .Name .Local ="\u0057\u0033\u0043\u0044\u0054\u0046";e .EncodeToken (start );e .EncodeToken (_e .EndElement {Name :start .Name });return nil ;};type Period struct{};func NewUDC ()*UDC {_ccc :=&UDC {};return _ccc };func NewLCC ()*LCC {_bfb :=&LCC {};return _bfb };
// Validate validates the DDC and its children
func (_afg *DDC )Validate ()error {return _afg .ValidateWithPath ("\u0044\u0044\u0043")};func NewElementOrRefinementContainer ()*ElementOrRefinementContainer {_bef :=&ElementOrRefinementContainer {};return _bef ;};func NewISO3166 ()*ISO3166 {_efbb :=&ISO3166 {};return _efbb };
// Validate validates the URI and its children
func (_dbf *URI )Validate ()error {return _dbf .ValidateWithPath ("\u0055\u0052\u0049")};
// Validate validates the Point and its children
func (_gea *Point )Validate ()error {return _gea .ValidateWithPath ("\u0050\u006f\u0069n\u0074")};
// ValidateWithPath validates the Box and its children, prefixing error messages with path
func (_cc *Box )ValidateWithPath (path string )error {return nil };func NewRFC3066 ()*RFC3066 {_ebe :=&RFC3066 {};return _ebe };
// ValidateWithPath validates the ElementsAndRefinementsGroup and its children, prefixing error messages with path
func (_cbb *ElementsAndRefinementsGroup )ValidateWithPath (path string )error {for _gd ,_ac :=range _cbb .Choice {if _bed :=_ac .ValidateWithPath (_g .Sprintf ("\u0025\u0073\u002f\u0043\u0068\u006f\u0069\u0063\u0065\u005b\u0025\u0064\u005d",path ,_gd ));_bed !=nil {return _bed ;};};return nil ;};func NewPoint ()*Point {_dff :=&Point {};return _dff };
// ValidateWithPath validates the LCSH and its children, prefixing error messages with path
func (_fdg *LCSH )ValidateWithPath (path string )error {return nil };type URI struct{};func (_gebe *MESH )MarshalXML (e *_e .Encoder ,start _e .StartElement )error {start .Name .Local ="\u004d\u0045\u0053\u0048";e .EncodeToken (start );e .EncodeToken (_e .EndElement {Name :start .Name });return nil ;};func (_acc *LCSH )MarshalXML (e *_e .Encoder ,start _e .StartElement )error {start .Name .Local ="\u004c\u0043\u0053\u0048";e .EncodeToken (start );e .EncodeToken (_e .EndElement {Name :start .Name });return nil ;};func (_bd *DDC )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {for {_edd ,_cf :=d .Token ();if _cf !=nil {return _g .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0044\u0044\u0043\u003a\u0020\u0025\u0073",_cf );};if _bb ,_cbc :=_edd .(_e .EndElement );_cbc &&_bb .Name ==start .Name {break ;};};return nil ;};func (_eae *URI )MarshalXML (e *_e .Encoder ,start _e .StartElement )error {start .Name .Local ="\u0055\u0052\u0049";e .EncodeToken (start );e .EncodeToken (_e .EndElement {Name :start .Name });return nil ;};
// Validate validates the RFC1766 and its children
func (_gdc *RFC1766 )Validate ()error {return _gdc .ValidateWithPath ("\u0052F\u0043\u0031\u0037\u0036\u0036");};
// Validate validates the Box and its children
func (_bf *Box )Validate ()error {return _bf .ValidateWithPath ("\u0042\u006f\u0078")};
// ValidateWithPath validates the Point and its children, prefixing error messages with path
func (_bgd *Point )ValidateWithPath (path string )error {return nil };func NewDDC ()*DDC {_fc :=&DDC {};return _fc };
// Validate validates the ElementsAndRefinementsGroupChoice and its children
func (_aee *ElementsAndRefinementsGroupChoice )Validate ()error {return _aee .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");};type Point struct{};
// ValidateWithPath validates the TGN and its children, prefixing error messages with path
func (_bbaa *TGN )ValidateWithPath (path string )error {return nil };type W3CDTF struct{};func (_dcg *MESH )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {for {_ba ,_cgb :=d .Token ();if _cgb !=nil {return _g .Errorf ("\u0070\u0061r\u0073\u0069\u006eg\u0020\u004d\u0045\u0053\u0048\u003a\u0020\u0025\u0073",_cgb );};if _ggc ,_fg :=_ba .(_e .EndElement );_fg &&_ggc .Name ==start .Name {break ;};};return nil ;};func (_bec *URI )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {for {_gb ,_efd :=d .Token ();if _efd !=nil {return _g .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0055\u0052\u0049\u003a\u0020\u0025\u0073",_efd );};if _fbfc ,_bac :=_gb .(_e .EndElement );_bac &&_fbfc .Name ==start .Name {break ;};};return nil ;};func init (){_ea .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 );_ea .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 );_ea .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0044\u0044\u0043",NewDDC );_ea .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u004c\u0043\u0043",NewLCC );_ea .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0055\u0044\u0043",NewUDC );_ea .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 );_ea .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 );_ea .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 );_ea .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0049\u004d\u0054",NewIMT );_ea .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0055\u0052\u0049",NewURI );_ea .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 );_ea .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 );_ea .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 );_ea .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 );_ea .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 );_ea .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0042\u006f\u0078",NewBox );_ea .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0054\u0047\u004e",NewTGN );_ea .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 );_ea .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

View File

@ -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 (_a "encoding/xml";_b "fmt";_ad "github.com/unidoc/unioffice";_d "github.com/unidoc/unioffice/schema/soo/dml";);func (_dc *LockedCanvas )UnmarshalXML (d *_a .Decoder ,start _a .StartElement )error {_dc .CT_GvmlGroupShape =*_d .NewCT_GvmlGroupShape ();for {_cb ,_ade :=d .Token ();if _ade !=nil {return _b .Errorf ("\u0070a\u0072\u0073\u0069\u006e\u0067\u0020\u004c\u006f\u0063\u006b\u0065d\u0043\u0061\u006e\u0076\u0061\u0073\u003a\u0020\u0025\u0073",_ade );};if _bb ,_g :=_cb .(_a .EndElement );_g &&_bb .Name ==start .Name {break ;};};return nil ;};func NewLockedCanvas ()*LockedCanvas {_c :=&LockedCanvas {};_c .CT_GvmlGroupShape =*_d .NewCT_GvmlGroupShape ();return _c ;};func (_e *LockedCanvas )MarshalXML (e *_a .Encoder ,start _a .StartElement )error {start .Attr =append (start .Attr ,_a .Attr {Name :_a .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 ,_a .Attr {Name :_a .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 _e .CT_GvmlGroupShape .MarshalXML (e ,start );};
package lockedCanvas ;import (_b "encoding/xml";_a "fmt";_ea "github.com/unidoc/unioffice";_e "github.com/unidoc/unioffice/schema/soo/dml";);
// ValidateWithPath validates the LockedCanvas and its children, prefixing error messages with path
func (_ag *LockedCanvas )ValidateWithPath (path string )error {if _agg :=_ag .CT_GvmlGroupShape .ValidateWithPath (path );_agg !=nil {return _agg ;};return nil ;};
func (_f *LockedCanvas )ValidateWithPath (path string )error {if _ed :=_f .CT_GvmlGroupShape .ValidateWithPath (path );_ed !=nil {return _ed ;};return nil ;};func (_bc *LockedCanvas )MarshalXML (e *_b .Encoder ,start _b .StartElement )error {start .Attr =append (start .Attr ,_b .Attr {Name :_b .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 ,_b .Attr {Name :_b .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 _bc .CT_GvmlGroupShape .MarshalXML (e ,start );};func (_ca *LockedCanvas )UnmarshalXML (d *_b .Decoder ,start _b .StartElement )error {_ca .CT_GvmlGroupShape =*_e .NewCT_GvmlGroupShape ();for {_bf ,_bg :=d .Token ();if _bg !=nil {return _a .Errorf ("\u0070a\u0072\u0073\u0069\u006e\u0067\u0020\u004c\u006f\u0063\u006b\u0065d\u0043\u0061\u006e\u0076\u0061\u0073\u003a\u0020\u0025\u0073",_bg );};if _bb ,_d :=_bf .(_b .EndElement );_d &&_bb .Name ==start .Name {break ;};};return nil ;};func NewLockedCanvas ()*LockedCanvas {_ef :=&LockedCanvas {};_ef .CT_GvmlGroupShape =*_e .NewCT_GvmlGroupShape ();return _ef ;};type LockedCanvas struct{_e .CT_GvmlGroupShape };
// Validate validates the LockedCanvas and its children
func (_fd *LockedCanvas )Validate ()error {return _fd .ValidateWithPath ("\u004c\u006f\u0063k\u0065\u0064\u0043\u0061\u006e\u0076\u0061\u0073");};type LockedCanvas struct{_d .CT_GvmlGroupShape };func init (){_ad .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 (_bbd *LockedCanvas )Validate ()error {return _bbd .ValidateWithPath ("\u004c\u006f\u0063k\u0065\u0064\u0043\u0061\u006e\u0076\u0061\u0073");};func init (){_ea .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

View File

@ -9,40 +9,40 @@
// 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 content_types ;import (_b "encoding/xml";_dc "fmt";_g "github.com/unidoc/unioffice";_c "github.com/unidoc/unioffice/common/logger";_a "regexp";);func (_da *CT_Default )MarshalXML (e *_b .Encoder ,start _b .StartElement )error {start .Attr =append (start .Attr ,_b .Attr {Name :_b .Name {Local :"\u0045x\u0074\u0065\u006e\u0073\u0069\u006fn"},Value :_dc .Sprintf ("\u0025\u0076",_da .ExtensionAttr )});start .Attr =append (start .Attr ,_b .Attr {Name :_b .Name {Local :"C\u006f\u006e\u0074\u0065\u006e\u0074\u0054\u0079\u0070\u0065"},Value :_dc .Sprintf ("\u0025\u0076",_da .ContentTypeAttr )});e .EncodeToken (start );e .EncodeToken (_b .EndElement {Name :start .Name });return nil ;};func (_adc *Default )UnmarshalXML (d *_b .Decoder ,start _b .StartElement )error {_adc .CT_Default =*NewCT_Default ();for _ ,_eaa :=range start .Attr {if _eaa .Name .Local =="\u0045x\u0074\u0065\u006e\u0073\u0069\u006fn"{_db ,_eg :=_eaa .Value ,error (nil );if _eg !=nil {return _eg ;};_adc .ExtensionAttr =_db ;continue ;};if _eaa .Name .Local =="C\u006f\u006e\u0074\u0065\u006e\u0074\u0054\u0079\u0070\u0065"{_cfe ,_gc :=_eaa .Value ,error (nil );if _gc !=nil {return _gc ;};_adc .ContentTypeAttr =_cfe ;continue ;};};for {_dab ,_ee :=d .Token ();if _ee !=nil {return _dc .Errorf ("\u0070\u0061\u0072\u0073in\u0067\u0020\u0044\u0065\u0066\u0061\u0075\u006c\u0074\u003a\u0020\u0025\u0073",_ee );};if _ae ,_gd :=_dab .(_b .EndElement );_gd &&_ae .Name ==start .Name {break ;};};return nil ;};func NewCT_Types ()*CT_Types {_ed :=&CT_Types {};return _ed };func NewCT_Override ()*CT_Override {_fe :=&CT_Override {};_fe .ContentTypeAttr ="\u0061p\u0070l\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u0078\u006d\u006c";return _fe ;};func (_ef *CT_Override )UnmarshalXML (d *_b .Decoder ,start _b .StartElement )error {_ef .ContentTypeAttr ="\u0061p\u0070l\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u0078\u006d\u006c";for _ ,_efe :=range start .Attr {if _efe .Name .Local =="C\u006f\u006e\u0074\u0065\u006e\u0074\u0054\u0079\u0070\u0065"{_ddf ,_af :=_efe .Value ,error (nil );if _af !=nil {return _af ;};_ef .ContentTypeAttr =_ddf ;continue ;};if _efe .Name .Local =="\u0050\u0061\u0072\u0074\u004e\u0061\u006d\u0065"{_bda ,_cc :=_efe .Value ,error (nil );if _cc !=nil {return _cc ;};_ef .PartNameAttr =_bda ;continue ;};};for {_dca ,_eb :=d .Token ();if _eb !=nil {return _dc .Errorf ("\u0070\u0061\u0072si\u006e\u0067\u0020\u0043\u0054\u005f\u004f\u0076\u0065\u0072\u0072\u0069\u0064\u0065\u003a\u0020\u0025\u0073",_eb );};if _ba ,_ebg :=_dca .(_b .EndElement );_ebg &&_ba .Name ==start .Name {break ;};};return nil ;};
// ValidateWithPath validates the Default and its children, prefixing error messages with path
func (_dcef *Default )ValidateWithPath (path string )error {if _ebc :=_dcef .CT_Default .ValidateWithPath (path );_ebc !=nil {return _ebc ;};return nil ;};
// ValidateWithPath validates the Types and its children, prefixing error messages with path
func (_bgf *Types )ValidateWithPath (path string )error {if _ede :=_bgf .CT_Types .ValidateWithPath (path );_ede !=nil {return _ede ;};return nil ;};type CT_Types struct{Default []*Default ;Override []*Override ;};type CT_Override struct{ContentTypeAttr string ;PartNameAttr string ;};func (_ea *CT_Override )MarshalXML (e *_b .Encoder ,start _b .StartElement )error {start .Attr =append (start .Attr ,_b .Attr {Name :_b .Name {Local :"C\u006f\u006e\u0074\u0065\u006e\u0074\u0054\u0079\u0070\u0065"},Value :_dc .Sprintf ("\u0025\u0076",_ea .ContentTypeAttr )});start .Attr =append (start .Attr ,_b .Attr {Name :_b .Name {Local :"\u0050\u0061\u0072\u0074\u004e\u0061\u006d\u0065"},Value :_dc .Sprintf ("\u0025\u0076",_ea .PartNameAttr )});e .EncodeToken (start );e .EncodeToken (_b .EndElement {Name :start .Name });return nil ;};const ST_ExtensionPattern ="\u0028\u005b\u0021\u0024\u0026\u0027\\\u0028\u005c\u0029\u005c\u002a\\\u002b\u002c\u003a\u003d\u005d\u007c(\u0025\u005b\u0030\u002d\u0039a\u002d\u0066\u0041\u002d\u0046\u005d\u005b\u0030\u002d\u0039\u0061\u002df\u0041\u002d\u0046\u005d\u0029\u007c\u005b\u003a\u0040\u005d\u007c\u005b\u0061\u002d\u007aA\u002d\u005a\u0030\u002d\u0039\u005c\u002d\u005f~\u005d\u0029\u002b";func (_fdf *Default )MarshalXML (e *_b .Encoder ,start _b .StartElement )error {return _fdf .CT_Default .MarshalXML (e ,start );};
// ValidateWithPath validates the CT_Override and its children, prefixing error messages with path
func (_fg *CT_Override )ValidateWithPath (path string )error {if !ST_ContentTypePatternRe .MatchString (_fg .ContentTypeAttr ){return _dc .Errorf ("\u0025\u0073/\u006d\u002e\u0043\u006f\u006e\u0074\u0065\u006e\u0074\u0054\u0079\u0070\u0065\u0041\u0074\u0074\u0072\u0020\u006d\u0075\u0073\u0074\u0020\u006d\u0061\u0074\u0063\u0068\u0020\u0027\u0025\u0073\u0027\u0020\u0028\u0068\u0061\u0076\u0065\u0020\u0025\u0076\u0029",path ,ST_ContentTypePatternRe ,_fg .ContentTypeAttr );};return nil ;};func (_adf *Types )UnmarshalXML (d *_b .Decoder ,start _b .StartElement )error {_adf .CT_Types =*NewCT_Types ();_ffd :for {_gg ,_egg :=d .Token ();if _egg !=nil {return _egg ;};switch _fafb :=_gg .(type ){case _b .StartElement :switch _fafb .Name {case _b .Name {Space :"ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s",Local :"\u0044e\u0066\u0061\u0075\u006c\u0074"}:_agf :=NewDefault ();if _bdf :=d .DecodeElement (_agf ,&_fafb );_bdf !=nil {return _bdf ;};_adf .Default =append (_adf .Default ,_agf );case _b .Name {Space :"ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s",Local :"\u004f\u0076\u0065\u0072\u0072\u0069\u0064\u0065"}:_fcc :=NewOverride ();if _ddc :=d .DecodeElement (_fcc ,&_fafb );_ddc !=nil {return _ddc ;};_adf .Override =append (_adf .Override ,_fcc );default:_c .Log .Debug ("s\u006b\u0069\u0070\u0070\u0069\u006e\u0067\u0020\u0075\u006e\u0073\u0075\u0070\u0070\u006f\u0072\u0074\u0065d\u0020\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0020\u006fn \u0054\u0079\u0070e\u0073 \u0025\u0076",_fafb .Name );if _gae :=d .Skip ();_gae !=nil {return _gae ;};};case _b .EndElement :break _ffd ;case _b .CharData :};};return nil ;};
// ValidateWithPath validates the CT_Default and its children, prefixing error messages with path
func (_cf *CT_Default )ValidateWithPath (path string )error {if !ST_ExtensionPatternRe .MatchString (_cf .ExtensionAttr ){return _dc .Errorf ("\u0025s\u002f\u006d.\u0045\u0078\u0074\u0065n\u0073\u0069\u006fn\u0041\u0074\u0074\u0072\u0020\u006d\u0075\u0073\u0074 m\u0061\u0074\u0063h\u0020\u0027%\u0073\u0027\u0020\u0028\u0068\u0061v\u0065\u0020%\u0076\u0029",path ,ST_ExtensionPatternRe ,_cf .ExtensionAttr );};if !ST_ContentTypePatternRe .MatchString (_cf .ContentTypeAttr ){return _dc .Errorf ("\u0025\u0073/\u006d\u002e\u0043\u006f\u006e\u0074\u0065\u006e\u0074\u0054\u0079\u0070\u0065\u0041\u0074\u0074\u0072\u0020\u006d\u0075\u0073\u0074\u0020\u006d\u0061\u0074\u0063\u0068\u0020\u0027\u0025\u0073\u0027\u0020\u0028\u0068\u0061\u0076\u0065\u0020\u0025\u0076\u0029",path ,ST_ContentTypePatternRe ,_cf .ContentTypeAttr );};return nil ;};type Override struct{CT_Override };
// Validate validates the CT_Types and its children
func (_bae *CT_Types )Validate ()error {return _bae .ValidateWithPath ("\u0043\u0054\u005f\u0054\u0079\u0070\u0065\u0073");};func (_ege *Override )MarshalXML (e *_b .Encoder ,start _b .StartElement )error {return _ege .CT_Override .MarshalXML (e ,start );};
// Validate validates the Override and its children
func (_bgb *Override )Validate ()error {return _bgb .ValidateWithPath ("\u004f\u0076\u0065\u0072\u0072\u0069\u0064\u0065");};func NewTypes ()*Types {_ffb :=&Types {};_ffb .CT_Types =*NewCT_Types ();return _ffb };const ST_ContentTypePattern ="\u005e\\\u0070{\u004c\u0061\u0074\u0069\u006e\u007d\u002b\u002f\u002e\u002a\u0024";
// ValidateWithPath validates the Override and its children, prefixing error messages with path
func (_dbb *Override )ValidateWithPath (path string )error {if _dfe :=_dbb .CT_Override .ValidateWithPath (path );_dfe !=nil {return _dfe ;};return nil ;};func (_ffba *Types )MarshalXML (e *_b .Encoder ,start _b .StartElement )error {start .Attr =append (start .Attr ,_b .Attr {Name :_b .Name {Local :"\u0078\u006d\u006cn\u0073"},Value :"ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s"});start .Attr =append (start .Attr ,_b .Attr {Name :_b .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 ="\u0054\u0079\u0070e\u0073";return _ffba .CT_Types .MarshalXML (e ,start );};func NewCT_Default ()*CT_Default {_f :=&CT_Default {};_f .ExtensionAttr ="\u0078\u006d\u006c";_f .ContentTypeAttr ="\u0061p\u0070l\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u0078\u006d\u006c";return _f ;};
// Validate validates the Default and its children
func (_ga *Default )Validate ()error {return _ga .ValidateWithPath ("\u0044e\u0066\u0061\u0075\u006c\u0074");};type Types struct{CT_Types };func (_dde *CT_Types )UnmarshalXML (d *_b .Decoder ,start _b .StartElement )error {_afd :for {_gb ,_ca :=d .Token ();if _ca !=nil {return _ca ;};switch _ff :=_gb .(type ){case _b .StartElement :switch _ff .Name {case _b .Name {Space :"ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s",Local :"\u0044e\u0066\u0061\u0075\u006c\u0074"}:_ddd :=NewDefault ();if _dgf :=d .DecodeElement (_ddd ,&_ff );_dgf !=nil {return _dgf ;};_dde .Default =append (_dde .Default ,_ddd );case _b .Name {Space :"ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s",Local :"\u004f\u0076\u0065\u0072\u0072\u0069\u0064\u0065"}:_ead :=NewOverride ();if _ffe :=d .DecodeElement (_ead ,&_ff );_ffe !=nil {return _ffe ;};_dde .Override =append (_dde .Override ,_ead );default:_c .Log .Debug ("\u0073\u006b\u0069\u0070\u0070\u0069\u006eg\u0020\u0075\u006es\u0075\u0070\u0070\u006fr\u0074\u0065\u0064\u0020\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0020\u006f\u006e\u0020\u0043\u0054\u005f\u0054\u0079\u0070\u0065\u0073\u0020\u0025\u0076",_ff .Name );if _ag :=d .Skip ();_ag !=nil {return _ag ;};};case _b .EndElement :break _afd ;case _b .CharData :};};return nil ;};var ST_ContentTypePatternRe =_a .MustCompile (ST_ContentTypePattern );func (_cg *CT_Default )UnmarshalXML (d *_b .Decoder ,start _b .StartElement )error {_cg .ExtensionAttr ="\u0078\u006d\u006c";_cg .ContentTypeAttr ="\u0061p\u0070l\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u0078\u006d\u006c";for _ ,_bd :=range start .Attr {if _bd .Name .Local =="\u0045x\u0074\u0065\u006e\u0073\u0069\u006fn"{_cb ,_e :=_bd .Value ,error (nil );if _e !=nil {return _e ;};_cg .ExtensionAttr =_cb ;continue ;};if _bd .Name .Local =="C\u006f\u006e\u0074\u0065\u006e\u0074\u0054\u0079\u0070\u0065"{_fa ,_df :=_bd .Value ,error (nil );if _df !=nil {return _df ;};_cg .ContentTypeAttr =_fa ;continue ;};};for {_dg ,_ab :=d .Token ();if _ab !=nil {return _dc .Errorf ("\u0070\u0061\u0072\u0073in\u0067\u0020\u0043\u0054\u005f\u0044\u0065\u0066\u0061\u0075\u006c\u0074\u003a\u0020%\u0073",_ab );};if _cgd ,_dd :=_dg .(_b .EndElement );_dd &&_cgd .Name ==start .Name {break ;};};return nil ;};type CT_Default struct{ExtensionAttr string ;ContentTypeAttr string ;};func NewDefault ()*Default {_gbf :=&Default {};_gbf .CT_Default =*NewCT_Default ();return _gbf };
// Validate validates the CT_Override and its children
func (_dfb *CT_Override )Validate ()error {return _dfb .ValidateWithPath ("C\u0054\u005f\u004f\u0076\u0065\u0072\u0072\u0069\u0064\u0065");};func (_bf *Override )UnmarshalXML (d *_b .Decoder ,start _b .StartElement )error {_bf .CT_Override =*NewCT_Override ();for _ ,_gbeb :=range start .Attr {if _gbeb .Name .Local =="C\u006f\u006e\u0074\u0065\u006e\u0074\u0054\u0079\u0070\u0065"{_ebcc ,_ddea :=_gbeb .Value ,error (nil );if _ddea !=nil {return _ddea ;};_bf .ContentTypeAttr =_ebcc ;continue ;};if _gbeb .Name .Local =="\u0050\u0061\u0072\u0074\u004e\u0061\u006d\u0065"{_de ,_efed :=_gbeb .Value ,error (nil );if _efed !=nil {return _efed ;};_bf .PartNameAttr =_de ;continue ;};};for {_fcf ,_bdb :=d .Token ();if _bdb !=nil {return _dc .Errorf ("p\u0061r\u0073\u0069\u006e\u0067\u0020\u004f\u0076\u0065r\u0072\u0069\u0064\u0065: \u0025\u0073",_bdb );};if _bfb ,_afa :=_fcf .(_b .EndElement );_afa &&_bfb .Name ==start .Name {break ;};};return nil ;};func NewOverride ()*Override {_ffef :=&Override {};_ffef .CT_Override =*NewCT_Override ();return _ffef ;};var ST_ExtensionPatternRe =_a .MustCompile (ST_ExtensionPattern );
// Validate validates the Types and its children
func (_fcg *Types )Validate ()error {return _fcg .ValidateWithPath ("\u0054\u0079\u0070e\u0073")};
package content_types ;import (_f "encoding/xml";_bc "fmt";_cc "github.com/unidoc/unioffice";_c "github.com/unidoc/unioffice/common/logger";_g "regexp";);type Override struct{CT_Override };func NewCT_Override ()*CT_Override {_a :=&CT_Override {};_a .ContentTypeAttr ="\u0061p\u0070l\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u0078\u006d\u006c";return _a ;};type Default struct{CT_Default };
// Validate validates the CT_Default and its children
func (_faf *CT_Default )Validate ()error {return _faf .ValidateWithPath ("\u0043\u0054\u005f\u0044\u0065\u0066\u0061\u0075\u006c\u0074");};type Default struct{CT_Default };
func (_ea *CT_Default )Validate ()error {return _ea .ValidateWithPath ("\u0043\u0054\u005f\u0044\u0065\u0066\u0061\u0075\u006c\u0074");};func (_bcd *CT_Default )UnmarshalXML (d *_f .Decoder ,start _f .StartElement )error {_bcd .ExtensionAttr ="\u0078\u006d\u006c";_bcd .ContentTypeAttr ="\u0061p\u0070l\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u0078\u006d\u006c";for _ ,_de :=range start .Attr {if _de .Name .Local =="\u0045x\u0074\u0065\u006e\u0073\u0069\u006fn"{_db ,_gb :=_de .Value ,error (nil );if _gb !=nil {return _gb ;};_bcd .ExtensionAttr =_db ;continue ;};if _de .Name .Local =="C\u006f\u006e\u0074\u0065\u006e\u0074\u0054\u0079\u0070\u0065"{_gc ,_ge :=_de .Value ,error (nil );if _ge !=nil {return _ge ;};_bcd .ContentTypeAttr =_gc ;continue ;};};for {_ba ,_ce :=d .Token ();if _ce !=nil {return _bc .Errorf ("\u0070\u0061\u0072\u0073in\u0067\u0020\u0043\u0054\u005f\u0044\u0065\u0066\u0061\u0075\u006c\u0074\u003a\u0020%\u0073",_ce );};if _cec ,_bab :=_ba .(_f .EndElement );_bab &&_cec .Name ==start .Name {break ;};};return nil ;};
// Validate validates the Override and its children
func (_cce *Override )Validate ()error {return _cce .ValidateWithPath ("\u004f\u0076\u0065\u0072\u0072\u0069\u0064\u0065");};func NewTypes ()*Types {_gefa :=&Types {};_gefa .CT_Types =*NewCT_Types ();return _gefa };func (_fa *CT_Default )MarshalXML (e *_f .Encoder ,start _f .StartElement )error {start .Attr =append (start .Attr ,_f .Attr {Name :_f .Name {Local :"\u0045x\u0074\u0065\u006e\u0073\u0069\u006fn"},Value :_bc .Sprintf ("\u0025\u0076",_fa .ExtensionAttr )});start .Attr =append (start .Attr ,_f .Attr {Name :_f .Name {Local :"C\u006f\u006e\u0074\u0065\u006e\u0074\u0054\u0079\u0070\u0065"},Value :_bc .Sprintf ("\u0025\u0076",_fa .ContentTypeAttr )});e .EncodeToken (start );e .EncodeToken (_f .EndElement {Name :start .Name });return nil ;};func NewDefault ()*Default {_ac :=&Default {};_ac .CT_Default =*NewCT_Default ();return _ac };
// ValidateWithPath validates the CT_Default and its children, prefixing error messages with path
func (_cf *CT_Default )ValidateWithPath (path string )error {if !ST_ExtensionPatternRe .MatchString (_cf .ExtensionAttr ){return _bc .Errorf ("\u0025s\u002f\u006d.\u0045\u0078\u0074\u0065n\u0073\u0069\u006fn\u0041\u0074\u0074\u0072\u0020\u006d\u0075\u0073\u0074 m\u0061\u0074\u0063h\u0020\u0027%\u0073\u0027\u0020\u0028\u0068\u0061v\u0065\u0020%\u0076\u0029",path ,ST_ExtensionPatternRe ,_cf .ExtensionAttr );};if !ST_ContentTypePatternRe .MatchString (_cf .ContentTypeAttr ){return _bc .Errorf ("\u0025\u0073/\u006d\u002e\u0043\u006f\u006e\u0074\u0065\u006e\u0074\u0054\u0079\u0070\u0065\u0041\u0074\u0074\u0072\u0020\u006d\u0075\u0073\u0074\u0020\u006d\u0061\u0074\u0063\u0068\u0020\u0027\u0025\u0073\u0027\u0020\u0028\u0068\u0061\u0076\u0065\u0020\u0025\u0076\u0029",path ,ST_ContentTypePatternRe ,_cf .ContentTypeAttr );};return nil ;};type CT_Types struct{Default []*Default ;Override []*Override ;};
// ValidateWithPath validates the Types and its children, prefixing error messages with path
func (_ccc *Types )ValidateWithPath (path string )error {if _adbg :=_ccc .CT_Types .ValidateWithPath (path );_adbg !=nil {return _adbg ;};return nil ;};func (_fba *Override )MarshalXML (e *_f .Encoder ,start _f .StartElement )error {return _fba .CT_Override .MarshalXML (e ,start );};func (_ccde *Types )MarshalXML (e *_f .Encoder ,start _f .StartElement )error {start .Attr =append (start .Attr ,_f .Attr {Name :_f .Name {Local :"\u0078\u006d\u006cn\u0073"},Value :"ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s"});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 ="\u0054\u0079\u0070e\u0073";return _ccde .CT_Types .MarshalXML (e ,start );};func (_fc *Default )UnmarshalXML (d *_f .Decoder ,start _f .StartElement )error {_fc .CT_Default =*NewCT_Default ();for _ ,_bac :=range start .Attr {if _bac .Name .Local =="\u0045x\u0074\u0065\u006e\u0073\u0069\u006fn"{_eab ,_fbd :=_bac .Value ,error (nil );if _fbd !=nil {return _fbd ;};_fc .ExtensionAttr =_eab ;continue ;};if _bac .Name .Local =="C\u006f\u006e\u0074\u0065\u006e\u0074\u0054\u0079\u0070\u0065"{_ad ,_dbc :=_bac .Value ,error (nil );if _dbc !=nil {return _dbc ;};_fc .ContentTypeAttr =_ad ;continue ;};};for {_edf ,_fgd :=d .Token ();if _fgd !=nil {return _bc .Errorf ("\u0070\u0061\u0072\u0073in\u0067\u0020\u0044\u0065\u0066\u0061\u0075\u006c\u0074\u003a\u0020\u0025\u0073",_fgd );};if _bda ,_cb :=_edf .(_f .EndElement );_cb &&_bda .Name ==start .Name {break ;};};return nil ;};
// Validate validates the Types and its children
func (_cde *Types )Validate ()error {return _cde .ValidateWithPath ("\u0054\u0079\u0070e\u0073")};const ST_ContentTypePattern ="\u005e\\\u0070{\u004c\u0061\u0074\u0069\u006e\u007d\u002b\u002f\u002e\u002a\u0024";
// ValidateWithPath validates the Override and its children, prefixing error messages with path
func (_da *Override )ValidateWithPath (path string )error {if _efc :=_da .CT_Override .ValidateWithPath (path );_efc !=nil {return _efc ;};return nil ;};
// ValidateWithPath validates the Default and its children, prefixing error messages with path
func (_dg *Default )ValidateWithPath (path string )error {if _efa :=_dg .CT_Default .ValidateWithPath (path );_efa !=nil {return _efa ;};return nil ;};
// Validate validates the CT_Override and its children
func (_gd *CT_Override )Validate ()error {return _gd .ValidateWithPath ("C\u0054\u005f\u004f\u0076\u0065\u0072\u0072\u0069\u0064\u0065");};func (_bad *Types )UnmarshalXML (d *_f .Decoder ,start _f .StartElement )error {_bad .CT_Types =*NewCT_Types ();_faaa :for {_fbe ,_cdb :=d .Token ();if _cdb !=nil {return _cdb ;};switch _dbd :=_fbe .(type ){case _f .StartElement :switch _dbd .Name {case _f .Name {Space :"ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s",Local :"\u0044e\u0066\u0061\u0075\u006c\u0074"}:_dde :=NewDefault ();if _cfa :=d .DecodeElement (_dde ,&_dbd );_cfa !=nil {return _cfa ;};_bad .Default =append (_bad .Default ,_dde );case _f .Name {Space :"ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s",Local :"\u004f\u0076\u0065\u0072\u0072\u0069\u0064\u0065"}:_dgb :=NewOverride ();if _fcf :=d .DecodeElement (_dgb ,&_dbd );_fcf !=nil {return _fcf ;};_bad .Override =append (_bad .Override ,_dgb );default:_c .Log .Debug ("s\u006b\u0069\u0070\u0070\u0069\u006e\u0067\u0020\u0075\u006e\u0073\u0075\u0070\u0070\u006f\u0072\u0074\u0065d\u0020\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0020\u006fn \u0054\u0079\u0070e\u0073 \u0025\u0076",_dbd .Name );if _adb :=d .Skip ();_adb !=nil {return _adb ;};};case _f .EndElement :break _faaa ;case _f .CharData :};};return nil ;};func (_df *Default )MarshalXML (e *_f .Encoder ,start _f .StartElement )error {return _df .CT_Default .MarshalXML (e ,start );};func (_ab *CT_Override )MarshalXML (e *_f .Encoder ,start _f .StartElement )error {start .Attr =append (start .Attr ,_f .Attr {Name :_f .Name {Local :"C\u006f\u006e\u0074\u0065\u006e\u0074\u0054\u0079\u0070\u0065"},Value :_bc .Sprintf ("\u0025\u0076",_ab .ContentTypeAttr )});start .Attr =append (start .Attr ,_f .Attr {Name :_f .Name {Local :"\u0050\u0061\u0072\u0074\u004e\u0061\u006d\u0065"},Value :_bc .Sprintf ("\u0025\u0076",_ab .PartNameAttr )});e .EncodeToken (start );e .EncodeToken (_f .EndElement {Name :start .Name });return nil ;};type CT_Default struct{ExtensionAttr string ;ContentTypeAttr string ;};
// Validate validates the Default and its children
func (_gcb *Default )Validate ()error {return _gcb .ValidateWithPath ("\u0044e\u0066\u0061\u0075\u006c\u0074");};func (_cege *CT_Types )UnmarshalXML (d *_f .Decoder ,start _f .StartElement )error {_bce :for {_bg ,_bca :=d .Token ();if _bca !=nil {return _bca ;};switch _gdb :=_bg .(type ){case _f .StartElement :switch _gdb .Name {case _f .Name {Space :"ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s",Local :"\u0044e\u0066\u0061\u0075\u006c\u0074"}:_ff :=NewDefault ();if _dba :=d .DecodeElement (_ff ,&_gdb );_dba !=nil {return _dba ;};_cege .Default =append (_cege .Default ,_ff );case _f .Name {Space :"ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s",Local :"\u004f\u0076\u0065\u0072\u0072\u0069\u0064\u0065"}:_ga :=NewOverride ();if _ag :=d .DecodeElement (_ga ,&_gdb );_ag !=nil {return _ag ;};_cege .Override =append (_cege .Override ,_ga );default:_c .Log .Debug ("\u0073\u006b\u0069\u0070\u0070\u0069\u006eg\u0020\u0075\u006es\u0075\u0070\u0070\u006fr\u0074\u0065\u0064\u0020\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0020\u006f\u006e\u0020\u0043\u0054\u005f\u0054\u0079\u0070\u0065\u0073\u0020\u0025\u0076",_gdb .Name );if _gea :=d .Skip ();_gea !=nil {return _gea ;};};case _f .EndElement :break _bce ;case _f .CharData :};};return nil ;};const ST_ExtensionPattern ="\u0028\u005b\u0021\u0024\u0026\u0027\\\u0028\u005c\u0029\u005c\u002a\\\u002b\u002c\u003a\u003d\u005d\u007c(\u0025\u005b\u0030\u002d\u0039a\u002d\u0066\u0041\u002d\u0046\u005d\u005b\u0030\u002d\u0039\u0061\u002df\u0041\u002d\u0046\u005d\u0029\u007c\u005b\u003a\u0040\u005d\u007c\u005b\u0061\u002d\u007aA\u002d\u005a\u0030\u002d\u0039\u005c\u002d\u005f~\u005d\u0029\u002b";func (_fbb *Override )UnmarshalXML (d *_f .Decoder ,start _f .StartElement )error {_fbb .CT_Override =*NewCT_Override ();for _ ,_acb :=range start .Attr {if _acb .Name .Local =="C\u006f\u006e\u0074\u0065\u006e\u0074\u0054\u0079\u0070\u0065"{_faa ,_eff :=_acb .Value ,error (nil );if _eff !=nil {return _eff ;};_fbb .ContentTypeAttr =_faa ;continue ;};if _acb .Name .Local =="\u0050\u0061\u0072\u0074\u004e\u0061\u006d\u0065"{_edb ,_caa :=_acb .Value ,error (nil );if _caa !=nil {return _caa ;};_fbb .PartNameAttr =_edb ;continue ;};};for {_dd ,_bgc :=d .Token ();if _bgc !=nil {return _bc .Errorf ("p\u0061r\u0073\u0069\u006e\u0067\u0020\u004f\u0076\u0065r\u0072\u0069\u0064\u0065: \u0025\u0073",_bgc );};if _bb ,_fbbg :=_dd .(_f .EndElement );_fbbg &&_bb .Name ==start .Name {break ;};};return nil ;};var ST_ContentTypePatternRe =_g .MustCompile (ST_ContentTypePattern );
// ValidateWithPath validates the CT_Override and its children, prefixing error messages with path
func (_eaf *CT_Override )ValidateWithPath (path string )error {if !ST_ContentTypePatternRe .MatchString (_eaf .ContentTypeAttr ){return _bc .Errorf ("\u0025\u0073/\u006d\u002e\u0043\u006f\u006e\u0074\u0065\u006e\u0074\u0054\u0079\u0070\u0065\u0041\u0074\u0074\u0072\u0020\u006d\u0075\u0073\u0074\u0020\u006d\u0061\u0074\u0063\u0068\u0020\u0027\u0025\u0073\u0027\u0020\u0028\u0068\u0061\u0076\u0065\u0020\u0025\u0076\u0029",path ,ST_ContentTypePatternRe ,_eaf .ContentTypeAttr );};return nil ;};func NewCT_Types ()*CT_Types {_fgf :=&CT_Types {};return _fgf };var ST_ExtensionPatternRe =_g .MustCompile (ST_ExtensionPattern );func NewCT_Default ()*CT_Default {_e :=&CT_Default {};_e .ExtensionAttr ="\u0078\u006d\u006c";_e .ContentTypeAttr ="\u0061p\u0070l\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u0078\u006d\u006c";return _e ;};type CT_Override struct{ContentTypeAttr string ;PartNameAttr string ;};type Types struct{CT_Types };func NewOverride ()*Override {_aa :=&Override {};_aa .CT_Override =*NewCT_Override ();return _aa };func (_gbd *CT_Types )MarshalXML (e *_f .Encoder ,start _f .StartElement )error {e .EncodeToken (start );if _gbd .Default !=nil {_abb :=_f .StartElement {Name :_f .Name {Local :"\u0044e\u0066\u0061\u0075\u006c\u0074"}};for _ ,_eg :=range _gbd .Default {e .EncodeElement (_eg ,_abb );};};if _gbd .Override !=nil {_efe :=_f .StartElement {Name :_f .Name {Local :"\u004f\u0076\u0065\u0072\u0072\u0069\u0064\u0065"}};for _ ,_ccd :=range _gbd .Override {e .EncodeElement (_ccd ,_efe );};};e .EncodeToken (_f .EndElement {Name :start .Name });return nil ;};func (_dea *CT_Override )UnmarshalXML (d *_f .Decoder ,start _f .StartElement )error {_dea .ContentTypeAttr ="\u0061p\u0070l\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u0078\u006d\u006c";for _ ,_ef :=range start .Attr {if _ef .Name .Local =="C\u006f\u006e\u0074\u0065\u006e\u0074\u0054\u0079\u0070\u0065"{_abc ,_fg :=_ef .Value ,error (nil );if _fg !=nil {return _fg ;};_dea .ContentTypeAttr =_abc ;continue ;};if _ef .Name .Local =="\u0050\u0061\u0072\u0074\u004e\u0061\u006d\u0065"{_cea ,_fb :=_ef .Value ,error (nil );if _fb !=nil {return _fb ;};_dea .PartNameAttr =_cea ;continue ;};};for {_ceg ,_ca :=d .Token ();if _ca !=nil {return _bc .Errorf ("\u0070\u0061\u0072si\u006e\u0067\u0020\u0043\u0054\u005f\u004f\u0076\u0065\u0072\u0072\u0069\u0064\u0065\u003a\u0020\u0025\u0073",_ca );};if _fd ,_af :=_ceg .(_f .EndElement );_af &&_fd .Name ==start .Name {break ;};};return nil ;};
// Validate validates the CT_Types and its children
func (_ccg *CT_Types )Validate ()error {return _ccg .ValidateWithPath ("\u0043\u0054\u005f\u0054\u0079\u0070\u0065\u0073");};
// ValidateWithPath validates the CT_Types and its children, prefixing error messages with path
func (_bg *CT_Types )ValidateWithPath (path string )error {for _ad ,_cd :=range _bg .Default {if _dgfe :=_cd .ValidateWithPath (_dc .Sprintf ("\u0025\u0073\u002f\u0044\u0065\u0066\u0061\u0075\u006ct\u005b\u0025\u0064\u005d",path ,_ad ));_dgfe !=nil {return _dgfe ;};};for _gba ,_gbg :=range _bg .Override {if _ddg :=_gbg .ValidateWithPath (_dc .Sprintf ("\u0025s\u002fO\u0076\u0065\u0072\u0072\u0069\u0064\u0065\u005b\u0025\u0064\u005d",path ,_gba ));_ddg !=nil {return _ddg ;};};return nil ;};func (_bde *CT_Types )MarshalXML (e *_b .Encoder ,start _b .StartElement )error {e .EncodeToken (start );if _bde .Default !=nil {_cce :=_b .StartElement {Name :_b .Name {Local :"\u0044e\u0066\u0061\u0075\u006c\u0074"}};for _ ,_dce :=range _bde .Default {e .EncodeElement (_dce ,_cce );};};if _bde .Override !=nil {_fd :=_b .StartElement {Name :_b .Name {Local :"\u004f\u0076\u0065\u0072\u0072\u0069\u0064\u0065"}};for _ ,_eag :=range _bde .Override {e .EncodeElement (_eag ,_fd );};};e .EncodeToken (_b .EndElement {Name :start .Name });return nil ;};func init (){_g .RegisterConstructor ("ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s","\u0043\u0054\u005f\u0054\u0079\u0070\u0065\u0073",NewCT_Types );_g .RegisterConstructor ("ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s","\u0043\u0054\u005f\u0044\u0065\u0066\u0061\u0075\u006c\u0074",NewCT_Default );_g .RegisterConstructor ("ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s","C\u0054\u005f\u004f\u0076\u0065\u0072\u0072\u0069\u0064\u0065",NewCT_Override );_g .RegisterConstructor ("ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s","\u0054\u0079\u0070e\u0073",NewTypes );_g .RegisterConstructor ("ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s","\u0044e\u0066\u0061\u0075\u006c\u0074",NewDefault );_g .RegisterConstructor ("ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s","\u004f\u0076\u0065\u0072\u0072\u0069\u0064\u0065",NewOverride );};
func (_ege *CT_Types )ValidateWithPath (path string )error {for _bd ,_gac :=range _ege .Default {if _deg :=_gac .ValidateWithPath (_bc .Sprintf ("\u0025\u0073\u002f\u0044\u0065\u0066\u0061\u0075\u006ct\u005b\u0025\u0064\u005d",path ,_bd ));_deg !=nil {return _deg ;};};for _fe ,_ed :=range _ege .Override {if _eac :=_ed .ValidateWithPath (_bc .Sprintf ("\u0025s\u002fO\u0076\u0065\u0072\u0072\u0069\u0064\u0065\u005b\u0025\u0064\u005d",path ,_fe ));_eac !=nil {return _eac ;};};return nil ;};func init (){_cc .RegisterConstructor ("ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s","\u0043\u0054\u005f\u0054\u0079\u0070\u0065\u0073",NewCT_Types );_cc .RegisterConstructor ("ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s","\u0043\u0054\u005f\u0044\u0065\u0066\u0061\u0075\u006c\u0074",NewCT_Default );_cc .RegisterConstructor ("ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s","C\u0054\u005f\u004f\u0076\u0065\u0072\u0072\u0069\u0064\u0065",NewCT_Override );_cc .RegisterConstructor ("ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s","\u0054\u0079\u0070e\u0073",NewTypes );_cc .RegisterConstructor ("ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s","\u0044e\u0066\u0061\u0075\u006c\u0074",NewDefault );_cc .RegisterConstructor ("ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s","\u004f\u0076\u0065\u0072\u0072\u0069\u0064\u0065",NewOverride );};

File diff suppressed because one or more lines are too long

View File

@ -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 relationships ;import (_g "encoding/xml";_b "fmt";_a "github.com/unidoc/unioffice";_d "github.com/unidoc/unioffice/common/logger";);func NewCT_Relationships ()*CT_Relationships {_ee :=&CT_Relationships {};return _ee };
// Validate validates the CT_Relationships and its children
func (_gf *CT_Relationships )Validate ()error {return _gf .ValidateWithPath ("\u0043\u0054_\u0052\u0065\u006ca\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073");};
// ValidateWithPath validates the Relationship and its children, prefixing error messages with path
func (_cf *Relationship )ValidateWithPath (path string )error {if _eea :=_cf .CT_Relationship .ValidateWithPath (path );_eea !=nil {return _eea ;};return nil ;};
// Validate validates the CT_Relationship and its children
func (_ed *CT_Relationship )Validate ()error {return _ed .ValidateWithPath ("\u0043T\u005fR\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070");};func (_aac *Relationship )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {_aac .CT_Relationship =*NewCT_Relationship ();for _ ,_ca :=range start .Attr {if _ca .Name .Local =="\u0054\u0061\u0072\u0067\u0065\u0074\u004d\u006f\u0064\u0065"{_aac .TargetModeAttr .UnmarshalXMLAttr (_ca );continue ;};if _ca .Name .Local =="\u0054\u0061\u0072\u0067\u0065\u0074"{_gef ,_beg :=_ca .Value ,error (nil );if _beg !=nil {return _beg ;};_aac .TargetAttr =_gef ;continue ;};if _ca .Name .Local =="\u0054\u0079\u0070\u0065"{_ffd ,_dea :=_ca .Value ,error (nil );if _dea !=nil {return _dea ;};_aac .TypeAttr =_ffd ;continue ;};if _ca .Name .Local =="\u0049\u0064"{_eec ,_dfe :=_ca .Value ,error (nil );if _dfe !=nil {return _dfe ;};_aac .IdAttr =_eec ;continue ;};};for {_ce ,_ced :=d .Token ();if _ced !=nil {return _b .Errorf ("\u0070a\u0072\u0073\u0069\u006e\u0067\u0020\u0052\u0065\u006c\u0061\u0074i\u006f\u006e\u0073\u0068\u0069\u0070\u003a\u0020\u0025\u0073",_ced );};if _fga ,_bda :=_ce .(_g .EndElement );_bda &&_fga .Name ==start .Name {break ;};};return nil ;};func (_bef ST_TargetMode )MarshalXMLAttr (name _g .Name )(_g .Attr ,error ){_fef :=_g .Attr {};_fef .Name =name ;switch _bef {case ST_TargetModeUnset :_fef .Value ="";case ST_TargetModeExternal :_fef .Value ="\u0045\u0078\u0074\u0065\u0072\u006e\u0061\u006c";case ST_TargetModeInternal :_fef .Value ="\u0049\u006e\u0074\u0065\u0072\u006e\u0061\u006c";};return _fef ,nil ;};func NewRelationships ()*Relationships {_aed :=&Relationships {};_aed .CT_Relationships =*NewCT_Relationships ();return _aed ;};func (_fe *CT_Relationships )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {e .EncodeToken (start );if _fe .Relationship !=nil {_cc :=_g .StartElement {Name :_g .Name {Local :"\u0052\u0065\u006ca\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070"}};for _ ,_cgd :=range _fe .Relationship {e .EncodeElement (_cgd ,_cc );};};e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};func (_dcb *Relationship )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {return _dcb .CT_Relationship .MarshalXML (e ,start );};func (_edad ST_TargetMode )Validate ()error {return _edad .ValidateWithPath ("")};type Relationship struct{CT_Relationship };const (ST_TargetModeUnset ST_TargetMode =0;ST_TargetModeExternal ST_TargetMode =1;ST_TargetModeInternal ST_TargetMode =2;);
// Validate validates the Relationship and its children
func (_bgc *Relationship )Validate ()error {return _bgc .ValidateWithPath ("\u0052\u0065\u006ca\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070");};func (_bc *CT_Relationship )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for _ ,_de :=range start .Attr {if _de .Name .Local =="\u0054\u0061\u0072\u0067\u0065\u0074\u004d\u006f\u0064\u0065"{_bc .TargetModeAttr .UnmarshalXMLAttr (_de );continue ;};if _de .Name .Local =="\u0054\u0061\u0072\u0067\u0065\u0074"{_bce ,_cb :=_de .Value ,error (nil );if _cb !=nil {return _cb ;};_bc .TargetAttr =_bce ;continue ;};if _de .Name .Local =="\u0054\u0079\u0070\u0065"{_bcc ,_be :=_de .Value ,error (nil );if _be !=nil {return _be ;};_bc .TypeAttr =_bcc ;continue ;};if _de .Name .Local =="\u0049\u0064"{_f ,_af :=_de .Value ,error (nil );if _af !=nil {return _af ;};_bc .IdAttr =_f ;continue ;};};for {_cg ,_df :=d .Token ();if _df !=nil {return _b .Errorf ("p\u0061\u0072\u0073\u0069\u006e\u0067 \u0043\u0054\u005f\u0052\u0065\u006c\u0061\u0074\u0069o\u006e\u0073\u0068i\u0070:\u0020\u0025\u0073",_df );};if _ac ,_ab :=_cg .(_g .CharData );_ab {_bc .Content =string (_ac );};if _ag ,_gd :=_cg .(_g .EndElement );_gd &&_ag .Name ==start .Name {break ;};};return nil ;};type Relationships struct{CT_Relationships };func (_bf *Relationships )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {_bf .CT_Relationships =*NewCT_Relationships ();_adfg :for {_dbf ,_ebg :=d .Token ();if _ebg !=nil {return _ebg ;};switch _ffe :=_dbf .(type ){case _g .StartElement :switch _ffe .Name {case _g .Name {Space :"ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0072\u0065\u006c\u0061\u0074\u0069\u006fn\u0073h\u0069\u0070s",Local :"\u0052\u0065\u006ca\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070"}:_eff :=NewRelationship ();if _acf :=d .DecodeElement (_eff ,&_ffe );_acf !=nil {return _acf ;};_bf .Relationship =append (_bf .Relationship ,_eff );default:_d .Log .Debug ("\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\u0052\u0065\u006c\u0061t\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073 \u0025\u0076",_ffe .Name );if _agg :=d .Skip ();_agg !=nil {return _agg ;};};case _g .EndElement :break _adfg ;case _g .CharData :};};return nil ;};
package relationships ;import (_g "encoding/xml";_d "fmt";_dg "github.com/unidoc/unioffice";_c "github.com/unidoc/unioffice/common/logger";);func (_gbg *ST_TargetMode )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {_ccf ,_cee :=d .Token ();if _cee !=nil {return _cee ;};if _gfc ,_add :=_ccf .(_g .EndElement );_add &&_gfc .Name ==start .Name {*_gbg =1;return nil ;};if _ae ,_bab :=_ccf .(_g .CharData );!_bab {return _d .Errorf ("\u0065\u0078\u0070\u0065\u0063\u0074\u0065\u0064\u0020\u0063\u0068a\u0072\u0020\u0064\u0061\u0074\u0061\u002c\u0020\u0067\u006ft\u0020\u0025\u0054",_ccf );}else {switch string (_ae ){case "":*_gbg =0;case "\u0045\u0078\u0074\u0065\u0072\u006e\u0061\u006c":*_gbg =1;case "\u0049\u006e\u0074\u0065\u0072\u006e\u0061\u006c":*_gbg =2;};};_ccf ,_cee =d .Token ();if _cee !=nil {return _cee ;};if _geab ,_gbe :=_ccf .(_g .EndElement );_gbe &&_geab .Name ==start .Name {return nil ;};return _d .Errorf ("\u0065\u0078\u0070\u0065c\u0074\u0065\u0064\u0020\u0065\u006e\u0064\u0020\u0065\u006ce\u006de\u006e\u0074\u002c\u0020\u0067\u006f\u0074 \u0025\u0076",_ccf );};
// ValidateWithPath validates the Relationships and its children, prefixing error messages with path
func (_ec *Relationships )ValidateWithPath (path string )error {if _cga :=_ec .CT_Relationships .ValidateWithPath (path );_cga !=nil {return _cga ;};return nil ;};func (_gcb ST_TargetMode )String ()string {switch _gcb {case 0:return "";case 1:return "\u0045\u0078\u0074\u0065\u0072\u006e\u0061\u006c";case 2:return "\u0049\u006e\u0074\u0065\u0072\u006e\u0061\u006c";};return "";};type CT_Relationships struct{Relationship []*Relationship ;};
func (_bf *Relationships )ValidateWithPath (path string )error {if _eff :=_bf .CT_Relationships .ValidateWithPath (path );_eff !=nil {return _eff ;};return nil ;};func (_fff *CT_Relationships )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {_ee :for {_deg ,_gg :=d .Token ();if _gg !=nil {return _gg ;};switch _ede :=_deg .(type ){case _g .StartElement :switch _ede .Name {case _g .Name {Space :"ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0072\u0065\u006c\u0061\u0074\u0069\u006fn\u0073h\u0069\u0070s",Local :"\u0052\u0065\u006ca\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070"}:_bcd :=NewRelationship ();if _dfb :=d .DecodeElement (_bcd ,&_ede );_dfb !=nil {return _dfb ;};_fff .Relationship =append (_fff .Relationship ,_bcd );default:_c .Log .Debug ("\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\u0043\u0054\u005f\u0052\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073\u0020\u0025v",_ede .Name );if _ce :=d .Skip ();_ce !=nil {return _ce ;};};case _g .EndElement :break _ee ;case _g .CharData :};};return nil ;};type CT_Relationships struct{Relationship []*Relationship ;};
// Validate validates the CT_Relationship and its children
func (_ff *CT_Relationship )Validate ()error {return _ff .ValidateWithPath ("\u0043T\u005fR\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070");};
// Validate validates the Relationship and its children
func (_ffb *Relationship )Validate ()error {return _ffb .ValidateWithPath ("\u0052\u0065\u006ca\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070");};func (_cdda *Relationships )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Attr =append (start .Attr ,_g .Attr {Name :_g .Name {Local :"\u0078\u006d\u006cn\u0073"},Value :"ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0072\u0065\u006c\u0061\u0074\u0069\u006fn\u0073h\u0069\u0070s"});start .Attr =append (start .Attr ,_g .Attr {Name :_g .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 ="\u0052\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073";return _cdda .CT_Relationships .MarshalXML (e ,start );};func (_bff ST_TargetMode )Validate ()error {return _bff .ValidateWithPath ("")};type Relationship struct{CT_Relationship };type CT_Relationship struct{TargetModeAttr ST_TargetMode ;TargetAttr string ;TypeAttr string ;IdAttr string ;Content string ;};func (_gae *CT_Relationships )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {e .EncodeToken (start );if _gae .Relationship !=nil {_ec :=_g .StartElement {Name :_g .Name {Local :"\u0052\u0065\u006ca\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070"}};for _ ,_cdd :=range _gae .Relationship {e .EncodeElement (_cdd ,_ec );};};e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};
// ValidateWithPath validates the Relationship and its children, prefixing error messages with path
func (_bda *Relationship )ValidateWithPath (path string )error {if _ab :=_bda .CT_Relationship .ValidateWithPath (path );_ab !=nil {return _ab ;};return nil ;};func (_ga *CT_Relationship )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {if _ga .TargetModeAttr !=ST_TargetModeUnset {_cb ,_ge :=_ga .TargetModeAttr .MarshalXMLAttr (_g .Name {Local :"\u0054\u0061\u0072\u0067\u0065\u0074\u004d\u006f\u0064\u0065"});if _ge !=nil {return _ge ;};start .Attr =append (start .Attr ,_cb );};start .Attr =append (start .Attr ,_g .Attr {Name :_g .Name {Local :"\u0054\u0061\u0072\u0067\u0065\u0074"},Value :_d .Sprintf ("\u0025\u0076",_ga .TargetAttr )});start .Attr =append (start .Attr ,_g .Attr {Name :_g .Name {Local :"\u0054\u0079\u0070\u0065"},Value :_d .Sprintf ("\u0025\u0076",_ga .TypeAttr )});start .Attr =append (start .Attr ,_g .Attr {Name :_g .Name {Local :"\u0049\u0064"},Value :_d .Sprintf ("\u0025\u0076",_ga .IdAttr )});e .EncodeElement (_ga .Content ,start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};func (_cfe ST_TargetMode )ValidateWithPath (path string )error {switch _cfe {case 0,1,2:default:return _d .Errorf ("\u0025s\u003a\u0020\u006f\u0075t\u0020\u006f\u0066\u0020\u0072a\u006eg\u0065 \u0076\u0061\u006c\u0075\u0065\u0020\u0025d",path ,int (_cfe ));};return nil ;};type Relationships struct{CT_Relationships };func (_ceb ST_TargetMode )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {return e .EncodeElement (_ceb .String (),start );};type ST_TargetMode byte ;func (_dce *ST_TargetMode )UnmarshalXMLAttr (attr _g .Attr )error {switch attr .Value {case "":*_dce =0;case "\u0045\u0078\u0074\u0065\u0072\u006e\u0061\u006c":*_dce =1;case "\u0049\u006e\u0074\u0065\u0072\u006e\u0061\u006c":*_dce =2;};return nil ;};func NewRelationships ()*Relationships {_cf :=&Relationships {};_cf .CT_Relationships =*NewCT_Relationships ();return _cf ;};func NewRelationship ()*Relationship {_dc :=&Relationship {};_dc .CT_Relationship =*NewCT_Relationship ();return _dc ;};func (_abc *Relationships )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {_abc .CT_Relationships =*NewCT_Relationships ();_bgc :for {_bgd ,_cefe :=d .Token ();if _cefe !=nil {return _cefe ;};switch _gaa :=_bgd .(type ){case _g .StartElement :switch _gaa .Name {case _g .Name {Space :"ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0072\u0065\u006c\u0061\u0074\u0069\u006fn\u0073h\u0069\u0070s",Local :"\u0052\u0065\u006ca\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070"}:_dda :=NewRelationship ();if _ag :=d .DecodeElement (_dda ,&_gaa );_ag !=nil {return _ag ;};_abc .Relationship =append (_abc .Relationship ,_dda );default:_c .Log .Debug ("\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\u0052\u0065\u006c\u0061t\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073 \u0025\u0076",_gaa .Name );if _bdfe :=d .Skip ();_bdfe !=nil {return _bdfe ;};};case _g .EndElement :break _bgc ;case _g .CharData :};};return nil ;};
// Validate validates the Relationships and its children
func (_caa *Relationships )Validate ()error {return _caa .ValidateWithPath ("\u0052\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073");};type CT_Relationship struct{TargetModeAttr ST_TargetMode ;TargetAttr string ;TypeAttr string ;IdAttr string ;Content string ;};func (_bb *ST_TargetMode )UnmarshalXMLAttr (attr _g .Attr )error {switch attr .Value {case "":*_bb =0;case "\u0045\u0078\u0074\u0065\u0072\u006e\u0061\u006c":*_bb =1;case "\u0049\u006e\u0074\u0065\u0072\u006e\u0061\u006c":*_bb =2;};return nil ;};
func (_cda *Relationships )Validate ()error {return _cda .ValidateWithPath ("\u0052\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073");};func NewCT_Relationship ()*CT_Relationship {_dd :=&CT_Relationship {};return _dd };
// ValidateWithPath validates the CT_Relationships and its children, prefixing error messages with path
func (_fd *CT_Relationships )ValidateWithPath (path string )error {for _aa ,_dc :=range _fd .Relationship {if _bd :=_dc .ValidateWithPath (_b .Sprintf ("\u0025\u0073\u002f\u0052el\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u005b\u0025\u0064\u005d",path ,_aa ));_bd !=nil {return _bd ;};};return nil ;};func (_ef *Relationships )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Attr =append (start .Attr ,_g .Attr {Name :_g .Name {Local :"\u0078\u006d\u006cn\u0073"},Value :"ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0072\u0065\u006c\u0061\u0074\u0069\u006fn\u0073h\u0069\u0070s"});start .Attr =append (start .Attr ,_g .Attr {Name :_g .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 ="\u0052\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073";return _ef .CT_Relationships .MarshalXML (e ,start );};func (_db *CT_Relationships )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {_faaf :for {_gbg ,_fag :=d .Token ();if _fag !=nil {return _fag ;};switch _ff :=_gbg .(type ){case _g .StartElement :switch _ff .Name {case _g .Name {Space :"ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0072\u0065\u006c\u0061\u0074\u0069\u006fn\u0073h\u0069\u0070s",Local :"\u0052\u0065\u006ca\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070"}:_bg :=NewRelationship ();if _eb :=d .DecodeElement (_bg ,&_ff );_eb !=nil {return _eb ;};_db .Relationship =append (_db .Relationship ,_bg );default:_d .Log .Debug ("\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\u0043\u0054\u005f\u0052\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073\u0020\u0025v",_ff .Name );if _gc :=d .Skip ();_gc !=nil {return _gc ;};};case _g .EndElement :break _faaf ;case _g .CharData :};};return nil ;};func NewRelationship ()*Relationship {_fg :=&Relationship {};_fg .CT_Relationship =*NewCT_Relationship ();return _fg ;};func (_ad *CT_Relationship )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {if _ad .TargetModeAttr !=ST_TargetModeUnset {_gb ,_ae :=_ad .TargetModeAttr .MarshalXMLAttr (_g .Name {Local :"\u0054\u0061\u0072\u0067\u0065\u0074\u004d\u006f\u0064\u0065"});if _ae !=nil {return _ae ;};start .Attr =append (start .Attr ,_gb );};start .Attr =append (start .Attr ,_g .Attr {Name :_g .Name {Local :"\u0054\u0061\u0072\u0067\u0065\u0074"},Value :_b .Sprintf ("\u0025\u0076",_ad .TargetAttr )});start .Attr =append (start .Attr ,_g .Attr {Name :_g .Name {Local :"\u0054\u0079\u0070\u0065"},Value :_b .Sprintf ("\u0025\u0076",_ad .TypeAttr )});start .Attr =append (start .Attr ,_g .Attr {Name :_g .Name {Local :"\u0049\u0064"},Value :_b .Sprintf ("\u0025\u0076",_ad .IdAttr )});e .EncodeElement (_ad .Content ,start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};func (_dd ST_TargetMode )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {return e .EncodeElement (_dd .String (),start );};
// Validate validates the CT_Relationships and its children
func (_da *CT_Relationships )Validate ()error {return _da .ValidateWithPath ("\u0043\u0054_\u0052\u0065\u006ca\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073");};func (_gd ST_TargetMode )String ()string {switch _gd {case 0:return "";case 1:return "\u0045\u0078\u0074\u0065\u0072\u006e\u0061\u006c";case 2:return "\u0049\u006e\u0074\u0065\u0072\u006e\u0061\u006c";};return "";};
// ValidateWithPath validates the CT_Relationship and its children, prefixing error messages with path
func (_adf *CT_Relationship )ValidateWithPath (path string )error {if _fa :=_adf .TargetModeAttr .ValidateWithPath (path +"\u002fT\u0061r\u0067\u0065\u0074\u004d\u006f\u0064\u0065\u0041\u0074\u0074\u0072");_fa !=nil {return _fa ;};return nil ;};func NewCT_Relationship ()*CT_Relationship {_dg :=&CT_Relationship {};return _dg };func (_fge *ST_TargetMode )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {_cbb ,_fde :=d .Token ();if _fde !=nil {return _fde ;};if _ccf ,_aacf :=_cbb .(_g .EndElement );_aacf &&_ccf .Name ==start .Name {*_fge =1;return nil ;};if _eda ,_aae :=_cbb .(_g .CharData );!_aae {return _b .Errorf ("\u0065\u0078\u0070\u0065\u0063\u0074\u0065\u0064\u0020\u0063\u0068a\u0072\u0020\u0064\u0061\u0074\u0061\u002c\u0020\u0067\u006ft\u0020\u0025\u0054",_cbb );}else {switch string (_eda ){case "":*_fge =0;case "\u0045\u0078\u0074\u0065\u0072\u006e\u0061\u006c":*_fge =1;case "\u0049\u006e\u0074\u0065\u0072\u006e\u0061\u006c":*_fge =2;};};_cbb ,_fde =d .Token ();if _fde !=nil {return _fde ;};if _acc ,_ddf :=_cbb .(_g .EndElement );_ddf &&_acc .Name ==start .Name {return nil ;};return _b .Errorf ("\u0065\u0078\u0070\u0065c\u0074\u0065\u0064\u0020\u0065\u006e\u0064\u0020\u0065\u006ce\u006de\u006e\u0074\u002c\u0020\u0067\u006f\u0074 \u0025\u0076",_cbb );};func (_fc ST_TargetMode )ValidateWithPath (path string )error {switch _fc {case 0,1,2:default:return _b .Errorf ("\u0025s\u003a\u0020\u006f\u0075t\u0020\u006f\u0066\u0020\u0072a\u006eg\u0065 \u0076\u0061\u006c\u0075\u0065\u0020\u0025d",path ,int (_fc ));};return nil ;};type ST_TargetMode byte ;func init (){_a .RegisterConstructor ("ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0072\u0065\u006c\u0061\u0074\u0069\u006fn\u0073h\u0069\u0070s","\u0043\u0054_\u0052\u0065\u006ca\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073",NewCT_Relationships );_a .RegisterConstructor ("ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0072\u0065\u006c\u0061\u0074\u0069\u006fn\u0073h\u0069\u0070s","\u0043T\u005fR\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070",NewCT_Relationship );_a .RegisterConstructor ("ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0072\u0065\u006c\u0061\u0074\u0069\u006fn\u0073h\u0069\u0070s","\u0052\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073",NewRelationships );_a .RegisterConstructor ("ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0072\u0065\u006c\u0061\u0074\u0069\u006fn\u0073h\u0069\u0070s","\u0052\u0065\u006ca\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070",NewRelationship );};
func (_cd *CT_Relationship )ValidateWithPath (path string )error {if _gcb :=_cd .TargetModeAttr .ValidateWithPath (path +"\u002fT\u0061r\u0067\u0065\u0074\u004d\u006f\u0064\u0065\u0041\u0074\u0074\u0072");_gcb !=nil {return _gcb ;};return nil ;};func NewCT_Relationships ()*CT_Relationships {_cc :=&CT_Relationships {};return _cc };func (_bg *Relationship )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {_bg .CT_Relationship =*NewCT_Relationship ();for _ ,_bdf :=range start .Attr {if _bdf .Name .Local =="\u0054\u0061\u0072\u0067\u0065\u0074\u004d\u006f\u0064\u0065"{_bg .TargetModeAttr .UnmarshalXMLAttr (_bdf );continue ;};if _bdf .Name .Local =="\u0054\u0061\u0072\u0067\u0065\u0074"{_fd ,_ef :=_bdf .Value ,error (nil );if _ef !=nil {return _ef ;};_bg .TargetAttr =_fd ;continue ;};if _bdf .Name .Local =="\u0054\u0079\u0070\u0065"{_cef ,_bce :=_bdf .Value ,error (nil );if _bce !=nil {return _bce ;};_bg .TypeAttr =_cef ;continue ;};if _bdf .Name .Local =="\u0049\u0064"{_gbb ,_ad :=_bdf .Value ,error (nil );if _ad !=nil {return _ad ;};_bg .IdAttr =_gbb ;continue ;};};for {_bac ,_bca :=d .Token ();if _bca !=nil {return _d .Errorf ("\u0070a\u0072\u0073\u0069\u006e\u0067\u0020\u0052\u0065\u006c\u0061\u0074i\u006f\u006e\u0073\u0068\u0069\u0070\u003a\u0020\u0025\u0073",_bca );};if _cbc ,_baa :=_bac .(_g .EndElement );_baa &&_cbc .Name ==start .Name {break ;};};return nil ;};func (_eca *Relationship )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {return _eca .CT_Relationship .MarshalXML (e ,start );};func (_dgb *CT_Relationship )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for _ ,_a :=range start .Attr {if _a .Name .Local =="\u0054\u0061\u0072\u0067\u0065\u0074\u004d\u006f\u0064\u0065"{_dgb .TargetModeAttr .UnmarshalXMLAttr (_a );continue ;};if _a .Name .Local =="\u0054\u0061\u0072\u0067\u0065\u0074"{_ba ,_e :=_a .Value ,error (nil );if _e !=nil {return _e ;};_dgb .TargetAttr =_ba ;continue ;};if _a .Name .Local =="\u0054\u0079\u0070\u0065"{_ed ,_f :=_a .Value ,error (nil );if _f !=nil {return _f ;};_dgb .TypeAttr =_ed ;continue ;};if _a .Name .Local =="\u0049\u0064"{_ded ,_fg :=_a .Value ,error (nil );if _fg !=nil {return _fg ;};_dgb .IdAttr =_ded ;continue ;};};for {_bc ,_bd :=d .Token ();if _bd !=nil {return _d .Errorf ("p\u0061\u0072\u0073\u0069\u006e\u0067 \u0043\u0054\u005f\u0052\u0065\u006c\u0061\u0074\u0069o\u006e\u0073\u0068i\u0070:\u0020\u0025\u0073",_bd );};if _gc ,_ca :=_bc .(_g .CharData );_ca {_dgb .Content =string (_gc );};if _gea ,_df :=_bc .(_g .EndElement );_df &&_gea .Name ==start .Name {break ;};};return nil ;};
// ValidateWithPath validates the CT_Relationships and its children, prefixing error messages with path
func (_ceg *CT_Relationships )ValidateWithPath (path string )error {for _ddg ,_fgg :=range _ceg .Relationship {if _gb :=_fgg .ValidateWithPath (_d .Sprintf ("\u0025\u0073\u002f\u0052el\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u005b\u0025\u0064\u005d",path ,_ddg ));_gb !=nil {return _gb ;};};return nil ;};func (_efd ST_TargetMode )MarshalXMLAttr (name _g .Name )(_g .Attr ,error ){_bgb :=_g .Attr {};_bgb .Name =name ;switch _efd {case ST_TargetModeUnset :_bgb .Value ="";case ST_TargetModeExternal :_bgb .Value ="\u0045\u0078\u0074\u0065\u0072\u006e\u0061\u006c";case ST_TargetModeInternal :_bgb .Value ="\u0049\u006e\u0074\u0065\u0072\u006e\u0061\u006c";};return _bgb ,nil ;};const (ST_TargetModeUnset ST_TargetMode =0;ST_TargetModeExternal ST_TargetMode =1;ST_TargetModeInternal ST_TargetMode =2;);func init (){_dg .RegisterConstructor ("ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0072\u0065\u006c\u0061\u0074\u0069\u006fn\u0073h\u0069\u0070s","\u0043\u0054_\u0052\u0065\u006ca\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073",NewCT_Relationships );_dg .RegisterConstructor ("ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0072\u0065\u006c\u0061\u0074\u0069\u006fn\u0073h\u0069\u0070s","\u0043T\u005fR\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070",NewCT_Relationship );_dg .RegisterConstructor ("ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0072\u0065\u006c\u0061\u0074\u0069\u006fn\u0073h\u0069\u0070s","\u0052\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073",NewRelationships );_dg .RegisterConstructor ("ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0072\u0065\u006c\u0061\u0074\u0069\u006fn\u0073h\u0069\u0070s","\u0052\u0065\u006ca\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070",NewRelationship );};

File diff suppressed because one or more lines are too long

View File

@ -9,22 +9,22 @@
// 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 schemaLibrary ;import (_d "encoding/xml";_b "fmt";_fd "github.com/unidoc/unioffice";_f "github.com/unidoc/unioffice/common/logger";);func NewSchemaLibrary ()*SchemaLibrary {_eab :=&SchemaLibrary {};_eab .CT_SchemaLibrary =*NewCT_SchemaLibrary ();return _eab ;};type CT_Schema struct{UriAttr *string ;ManifestLocationAttr *string ;SchemaLocationAttr *string ;SchemaLanguageAttr *string ;};func (_e *CT_Schema )MarshalXML (e *_d .Encoder ,start _d .StartElement )error {if _e .UriAttr !=nil {start .Attr =append (start .Attr ,_d .Attr {Name :_d .Name {Local :"\u006d\u0061\u003a\u0075\u0072\u0069"},Value :_b .Sprintf ("\u0025\u0076",*_e .UriAttr )});};if _e .ManifestLocationAttr !=nil {start .Attr =append (start .Attr ,_d .Attr {Name :_d .Name {Local :"\u006d\u0061\u003a\u006dan\u0069\u0066\u0065\u0073\u0074\u004c\u006f\u0063\u0061\u0074\u0069\u006f\u006e"},Value :_b .Sprintf ("\u0025\u0076",*_e .ManifestLocationAttr )});};if _e .SchemaLocationAttr !=nil {start .Attr =append (start .Attr ,_d .Attr {Name :_d .Name {Local :"\u006d\u0061\u003a\u0073\u0063\u0068\u0065\u006d\u0061\u004c\u006f\u0063a\u0074\u0069\u006f\u006e"},Value :_b .Sprintf ("\u0025\u0076",*_e .SchemaLocationAttr )});};if _e .SchemaLanguageAttr !=nil {start .Attr =append (start .Attr ,_d .Attr {Name :_d .Name {Local :"\u006d\u0061\u003a\u0073\u0063\u0068\u0065\u006d\u0061\u004c\u0061\u006eg\u0075\u0061\u0067\u0065"},Value :_b .Sprintf ("\u0025\u0076",*_e .SchemaLanguageAttr )});};e .EncodeToken (start );e .EncodeToken (_d .EndElement {Name :start .Name });return nil ;};func (_dcg *SchemaLibrary )UnmarshalXML (d *_d .Decoder ,start _d .StartElement )error {_dcg .CT_SchemaLibrary =*NewCT_SchemaLibrary ();_eb :for {_ga ,_gb :=d .Token ();if _gb !=nil {return _gb ;};switch _ggc :=_ga .(type ){case _d .StartElement :switch _ggc .Name {case _d .Name {Space :"\u0068\u0074\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067/\u0073\u0063\u0068\u0065\u006da\u004c\u0069\u0062\u0072\u0061\u0072\u0079\u002f\u0032\u0030\u0030\u0036\u002f\u006d\u0061\u0069\u006e",Local :"\u0073\u0063\u0068\u0065\u006d\u0061"}:_bec :=NewCT_Schema ();if _gbd :=d .DecodeElement (_bec ,&_ggc );_gbd !=nil {return _gbd ;};_dcg .Schema =append (_dcg .Schema ,_bec );default:_f .Log .Debug ("\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\u0053\u0063\u0068\u0065m\u0061\u004c\u0069\u0062\u0072\u0061\u0072\u0079 \u0025\u0076",_ggc .Name );if _aeg :=d .Skip ();_aeg !=nil {return _aeg ;};};case _d .EndElement :break _eb ;case _d .CharData :};};return nil ;};func (_cc *CT_Schema )UnmarshalXML (d *_d .Decoder ,start _d .StartElement )error {for _ ,_be :=range start .Attr {if _be .Name .Local =="\u0075\u0072\u0069"{_cce ,_de :=_be .Value ,error (nil );if _de !=nil {return _de ;};_cc .UriAttr =&_cce ;continue ;};if _be .Name .Local =="\u006d\u0061n\u0069\u0066\u0065s\u0074\u004c\u006f\u0063\u0061\u0074\u0069\u006f\u006e"{_cb ,_ef :=_be .Value ,error (nil );if _ef !=nil {return _ef ;};_cc .ManifestLocationAttr =&_cb ;continue ;};if _be .Name .Local =="\u0073\u0063\u0068\u0065\u006d\u0061\u004c\u006f\u0063a\u0074\u0069\u006f\u006e"{_ab ,_fb :=_be .Value ,error (nil );if _fb !=nil {return _fb ;};_cc .SchemaLocationAttr =&_ab ;continue ;};if _be .Name .Local =="\u0073\u0063\u0068\u0065\u006d\u0061\u004c\u0061\u006eg\u0075\u0061\u0067\u0065"{_ee ,_db :=_be .Value ,error (nil );if _db !=nil {return _db ;};_cc .SchemaLanguageAttr =&_ee ;continue ;};};for {_deb ,_bd :=d .Token ();if _bd !=nil {return _b .Errorf ("p\u0061\u0072\u0073\u0069ng\u0020C\u0054\u005f\u0053\u0063\u0068e\u006d\u0061\u003a\u0020\u0025\u0073",_bd );};if _dc ,_fe :=_deb .(_d .EndElement );_fe &&_dc .Name ==start .Name {break ;};};return nil ;};
// ValidateWithPath validates the CT_Schema and its children, prefixing error messages with path
func (_ac *CT_Schema )ValidateWithPath (path string )error {return nil };
// Validate validates the CT_Schema and its children
func (_ag *CT_Schema )Validate ()error {return _ag .ValidateWithPath ("\u0043T\u005f\u0053\u0063\u0068\u0065\u006da");};func (_ff *CT_SchemaLibrary )MarshalXML (e *_d .Encoder ,start _d .StartElement )error {e .EncodeToken (start );if _ff .Schema !=nil {_bed :=_d .StartElement {Name :_d .Name {Local :"\u006da\u003a\u0073\u0063\u0068\u0065\u006da"}};for _ ,_dd :=range _ff .Schema {e .EncodeElement (_dd ,_bed );};};e .EncodeToken (_d .EndElement {Name :start .Name });return nil ;};type SchemaLibrary struct{CT_SchemaLibrary };type CT_SchemaLibrary struct{Schema []*CT_Schema ;};
package schemaLibrary ;import (_e "encoding/xml";_a "fmt";_c "github.com/unidoc/unioffice";_b "github.com/unidoc/unioffice/common/logger";);type CT_SchemaLibrary struct{Schema []*CT_Schema ;};func (_gc *CT_SchemaLibrary )MarshalXML (e *_e .Encoder ,start _e .StartElement )error {e .EncodeToken (start );if _gc .Schema !=nil {_fca :=_e .StartElement {Name :_e .Name {Local :"\u006da\u003a\u0073\u0063\u0068\u0065\u006da"}};for _ ,_fb :=range _gc .Schema {e .EncodeElement (_fb ,_fca );};};e .EncodeToken (_e .EndElement {Name :start .Name });return nil ;};
// Validate validates the SchemaLibrary and its children
func (_bg *SchemaLibrary )Validate ()error {return _bg .ValidateWithPath ("\u0053\u0063\u0068\u0065\u006d\u0061\u004c\u0069\u0062\u0072\u0061\u0072\u0079");};func (_aa *CT_SchemaLibrary )UnmarshalXML (d *_d .Decoder ,start _d .StartElement )error {_gc :for {_ddf ,_bf :=d .Token ();if _bf !=nil {return _bf ;};switch _abd :=_ddf .(type ){case _d .StartElement :switch _abd .Name {case _d .Name {Space :"\u0068\u0074\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067/\u0073\u0063\u0068\u0065\u006da\u004c\u0069\u0062\u0072\u0061\u0072\u0079\u002f\u0032\u0030\u0030\u0036\u002f\u006d\u0061\u0069\u006e",Local :"\u0073\u0063\u0068\u0065\u006d\u0061"}:_bb :=NewCT_Schema ();if _abc :=d .DecodeElement (_bb ,&_abd );_abc !=nil {return _abc ;};_aa .Schema =append (_aa .Schema ,_bb );default:_f .Log .Debug ("\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\u0043\u0054\u005f\u0053\u0063\u0068\u0065\u006d\u0061\u004c\u0069\u0062\u0072\u0061\u0072\u0079\u0020\u0025v",_abd .Name );if _ed :=d .Skip ();_ed !=nil {return _ed ;};};case _d .EndElement :break _gc ;case _d .CharData :};};return nil ;};func NewCT_Schema ()*CT_Schema {_c :=&CT_Schema {};return _c };
func (_bbe *SchemaLibrary )Validate ()error {return _bbe .ValidateWithPath ("\u0053\u0063\u0068\u0065\u006d\u0061\u004c\u0069\u0062\u0072\u0061\u0072\u0079");};func (_ca *CT_Schema )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {for _ ,_gg :=range start .Attr {if _gg .Name .Local =="\u0075\u0072\u0069"{_gf ,_ad :=_gg .Value ,error (nil );if _ad !=nil {return _ad ;};_ca .UriAttr =&_gf ;continue ;};if _gg .Name .Local =="\u006d\u0061n\u0069\u0066\u0065s\u0074\u004c\u006f\u0063\u0061\u0074\u0069\u006f\u006e"{_cg ,_ag :=_gg .Value ,error (nil );if _ag !=nil {return _ag ;};_ca .ManifestLocationAttr =&_cg ;continue ;};if _gg .Name .Local =="\u0073\u0063\u0068\u0065\u006d\u0061\u004c\u006f\u0063a\u0074\u0069\u006f\u006e"{_ae ,_ab :=_gg .Value ,error (nil );if _ab !=nil {return _ab ;};_ca .SchemaLocationAttr =&_ae ;continue ;};if _gg .Name .Local =="\u0073\u0063\u0068\u0065\u006d\u0061\u004c\u0061\u006eg\u0075\u0061\u0067\u0065"{_cf ,_f :=_gg .Value ,error (nil );if _f !=nil {return _f ;};_ca .SchemaLanguageAttr =&_cf ;continue ;};};for {_ff ,_af :=d .Token ();if _af !=nil {return _a .Errorf ("p\u0061\u0072\u0073\u0069ng\u0020C\u0054\u005f\u0053\u0063\u0068e\u006d\u0061\u003a\u0020\u0025\u0073",_af );};if _bb ,_be :=_ff .(_e .EndElement );_be &&_bb .Name ==start .Name {break ;};};return nil ;};type SchemaLibrary struct{CT_SchemaLibrary };
// Validate validates the CT_SchemaLibrary and its children
func (_fa *CT_SchemaLibrary )Validate ()error {return _fa .ValidateWithPath ("\u0043\u0054_\u0053\u0063\u0068e\u006d\u0061\u004c\u0069\u0062\u0072\u0061\u0072\u0079");};func (_bdc *SchemaLibrary )MarshalXML (e *_d .Encoder ,start _d .StartElement )error {start .Attr =append (start .Attr ,_d .Attr {Name :_d .Name {Local :"\u0078\u006d\u006cn\u0073"},Value :"\u0068\u0074\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067/\u0073\u0063\u0068\u0065\u006da\u004c\u0069\u0062\u0072\u0061\u0072\u0079\u002f\u0032\u0030\u0030\u0036\u002f\u006d\u0061\u0069\u006e"});start .Attr =append (start .Attr ,_d .Attr {Name :_d .Name {Local :"\u0078\u006d\u006c\u006e\u0073\u003a\u006d\u0061"},Value :"\u0068\u0074\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067/\u0073\u0063\u0068\u0065\u006da\u004c\u0069\u0062\u0072\u0061\u0072\u0079\u002f\u0032\u0030\u0030\u0036\u002f\u006d\u0061\u0069\u006e"});start .Attr =append (start .Attr ,_d .Attr {Name :_d .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 ="\u006d\u0061:\u0073\u0063\u0068e\u006d\u0061\u004c\u0069\u0062\u0072\u0061\u0072\u0079";return _bdc .CT_SchemaLibrary .MarshalXML (e ,start );};
// ValidateWithPath validates the CT_Schema and its children, prefixing error messages with path
func (_agf *CT_Schema )ValidateWithPath (path string )error {return nil };func (_dge *SchemaLibrary )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {_dge .CT_SchemaLibrary =*NewCT_SchemaLibrary ();_fbf :for {_cgg ,_cad :=d .Token ();if _cad !=nil {return _cad ;};switch _ffd :=_cgg .(type ){case _e .StartElement :switch _ffd .Name {case _e .Name {Space :"\u0068\u0074\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067/\u0073\u0063\u0068\u0065\u006da\u004c\u0069\u0062\u0072\u0061\u0072\u0079\u002f\u0032\u0030\u0030\u0036\u002f\u006d\u0061\u0069\u006e",Local :"\u0073\u0063\u0068\u0065\u006d\u0061"}:_aba :=NewCT_Schema ();if _afg :=d .DecodeElement (_aba ,&_ffd );_afg !=nil {return _afg ;};_dge .Schema =append (_dge .Schema ,_aba );default:_b .Log .Debug ("\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\u0053\u0063\u0068\u0065m\u0061\u004c\u0069\u0062\u0072\u0061\u0072\u0079 \u0025\u0076",_ffd .Name );if _cdg :=d .Skip ();_cdg !=nil {return _cdg ;};};case _e .EndElement :break _fbf ;case _e .CharData :};};return nil ;};func NewCT_SchemaLibrary ()*CT_SchemaLibrary {_fc :=&CT_SchemaLibrary {};return _fc };func NewCT_Schema ()*CT_Schema {_ee :=&CT_Schema {};return _ee };func (_caa *CT_SchemaLibrary )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {_aee :for {_eea ,_gfd :=d .Token ();if _gfd !=nil {return _gfd ;};switch _db :=_eea .(type ){case _e .StartElement :switch _db .Name {case _e .Name {Space :"\u0068\u0074\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067/\u0073\u0063\u0068\u0065\u006da\u004c\u0069\u0062\u0072\u0061\u0072\u0079\u002f\u0032\u0030\u0030\u0036\u002f\u006d\u0061\u0069\u006e",Local :"\u0073\u0063\u0068\u0065\u006d\u0061"}:_bd :=NewCT_Schema ();if _bf :=d .DecodeElement (_bd ,&_db );_bf !=nil {return _bf ;};_caa .Schema =append (_caa .Schema ,_bd );default:_b .Log .Debug ("\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\u0043\u0054\u005f\u0053\u0063\u0068\u0065\u006d\u0061\u004c\u0069\u0062\u0072\u0061\u0072\u0079\u0020\u0025v",_db .Name );if _gfb :=d .Skip ();_gfb !=nil {return _gfb ;};};case _e .EndElement :break _aee ;case _e .CharData :};};return nil ;};
// ValidateWithPath validates the SchemaLibrary and its children, prefixing error messages with path
func (_dcd *SchemaLibrary )ValidateWithPath (path string )error {if _dg :=_dcd .CT_SchemaLibrary .ValidateWithPath (path );_dg !=nil {return _dg ;};return nil ;};func NewCT_SchemaLibrary ()*CT_SchemaLibrary {_gg :=&CT_SchemaLibrary {};return _gg };
func (_df *SchemaLibrary )ValidateWithPath (path string )error {if _dbb :=_df .CT_SchemaLibrary .ValidateWithPath (path );_dbb !=nil {return _dbb ;};return nil ;};func (_g *CT_Schema )MarshalXML (e *_e .Encoder ,start _e .StartElement )error {if _g .UriAttr !=nil {start .Attr =append (start .Attr ,_e .Attr {Name :_e .Name {Local :"\u006d\u0061\u003a\u0075\u0072\u0069"},Value :_a .Sprintf ("\u0025\u0076",*_g .UriAttr )});};if _g .ManifestLocationAttr !=nil {start .Attr =append (start .Attr ,_e .Attr {Name :_e .Name {Local :"\u006d\u0061\u003a\u006dan\u0069\u0066\u0065\u0073\u0074\u004c\u006f\u0063\u0061\u0074\u0069\u006f\u006e"},Value :_a .Sprintf ("\u0025\u0076",*_g .ManifestLocationAttr )});};if _g .SchemaLocationAttr !=nil {start .Attr =append (start .Attr ,_e .Attr {Name :_e .Name {Local :"\u006d\u0061\u003a\u0073\u0063\u0068\u0065\u006d\u0061\u004c\u006f\u0063a\u0074\u0069\u006f\u006e"},Value :_a .Sprintf ("\u0025\u0076",*_g .SchemaLocationAttr )});};if _g .SchemaLanguageAttr !=nil {start .Attr =append (start .Attr ,_e .Attr {Name :_e .Name {Local :"\u006d\u0061\u003a\u0073\u0063\u0068\u0065\u006d\u0061\u004c\u0061\u006eg\u0075\u0061\u0067\u0065"},Value :_a .Sprintf ("\u0025\u0076",*_g .SchemaLanguageAttr )});};e .EncodeToken (start );e .EncodeToken (_e .EndElement {Name :start .Name });return nil ;};
// Validate validates the CT_Schema and its children
func (_abg *CT_Schema )Validate ()error {return _abg .ValidateWithPath ("\u0043T\u005f\u0053\u0063\u0068\u0065\u006da");};func NewSchemaLibrary ()*SchemaLibrary {_bg :=&SchemaLibrary {};_bg .CT_SchemaLibrary =*NewCT_SchemaLibrary ();return _bg ;};func (_fd *SchemaLibrary )MarshalXML (e *_e .Encoder ,start _e .StartElement )error {start .Attr =append (start .Attr ,_e .Attr {Name :_e .Name {Local :"\u0078\u006d\u006cn\u0073"},Value :"\u0068\u0074\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067/\u0073\u0063\u0068\u0065\u006da\u004c\u0069\u0062\u0072\u0061\u0072\u0079\u002f\u0032\u0030\u0030\u0036\u002f\u006d\u0061\u0069\u006e"});start .Attr =append (start .Attr ,_e .Attr {Name :_e .Name {Local :"\u0078\u006d\u006c\u006e\u0073\u003a\u006d\u0061"},Value :"\u0068\u0074\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067/\u0073\u0063\u0068\u0065\u006da\u004c\u0069\u0062\u0072\u0061\u0072\u0079\u002f\u0032\u0030\u0030\u0036\u002f\u006d\u0061\u0069\u006e"});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 ="\u006d\u0061:\u0073\u0063\u0068e\u006d\u0061\u004c\u0069\u0062\u0072\u0061\u0072\u0079";return _fd .CT_SchemaLibrary .MarshalXML (e ,start );};type CT_Schema struct{UriAttr *string ;ManifestLocationAttr *string ;SchemaLocationAttr *string ;SchemaLanguageAttr *string ;};
// ValidateWithPath validates the CT_SchemaLibrary and its children, prefixing error messages with path
func (_fad *CT_SchemaLibrary )ValidateWithPath (path string )error {for _ae ,_ea :=range _fad .Schema {if _aga :=_ea .ValidateWithPath (_b .Sprintf ("\u0025\u0073\u002f\u0053\u0063\u0068\u0065\u006d\u0061\u005b\u0025\u0064\u005d",path ,_ae ));_aga !=nil {return _aga ;};};return nil ;};func init (){_fd .RegisterConstructor ("\u0068\u0074\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067/\u0073\u0063\u0068\u0065\u006da\u004c\u0069\u0062\u0072\u0061\u0072\u0079\u002f\u0032\u0030\u0030\u0036\u002f\u006d\u0061\u0069\u006e","\u0043T\u005f\u0053\u0063\u0068\u0065\u006da",NewCT_Schema );_fd .RegisterConstructor ("\u0068\u0074\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067/\u0073\u0063\u0068\u0065\u006da\u004c\u0069\u0062\u0072\u0061\u0072\u0079\u002f\u0032\u0030\u0030\u0036\u002f\u006d\u0061\u0069\u006e","\u0043\u0054_\u0053\u0063\u0068e\u006d\u0061\u004c\u0069\u0062\u0072\u0061\u0072\u0079",NewCT_SchemaLibrary );_fd .RegisterConstructor ("\u0068\u0074\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067/\u0073\u0063\u0068\u0065\u006da\u004c\u0069\u0062\u0072\u0061\u0072\u0079\u002f\u0032\u0030\u0030\u0036\u002f\u006d\u0061\u0069\u006e","\u0073\u0063\u0068\u0065\u006d\u0061\u004c\u0069\u0062\u0072\u0061\u0072\u0079",NewSchemaLibrary );};
func (_ada *CT_SchemaLibrary )ValidateWithPath (path string )error {for _ce ,_dd :=range _ada .Schema {if _dgc :=_dd .ValidateWithPath (_a .Sprintf ("\u0025\u0073\u002f\u0053\u0063\u0068\u0065\u006d\u0061\u005b\u0025\u0064\u005d",path ,_ce ));_dgc !=nil {return _dgc ;};};return nil ;};
// Validate validates the CT_SchemaLibrary and its children
func (_dba *CT_SchemaLibrary )Validate ()error {return _dba .ValidateWithPath ("\u0043\u0054_\u0053\u0063\u0068e\u006d\u0061\u004c\u0069\u0062\u0072\u0061\u0072\u0079");};func init (){_c .RegisterConstructor ("\u0068\u0074\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067/\u0073\u0063\u0068\u0065\u006da\u004c\u0069\u0062\u0072\u0061\u0072\u0079\u002f\u0032\u0030\u0030\u0036\u002f\u006d\u0061\u0069\u006e","\u0043T\u005f\u0053\u0063\u0068\u0065\u006da",NewCT_Schema );_c .RegisterConstructor ("\u0068\u0074\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067/\u0073\u0063\u0068\u0065\u006da\u004c\u0069\u0062\u0072\u0061\u0072\u0079\u002f\u0032\u0030\u0030\u0036\u002f\u006d\u0061\u0069\u006e","\u0043\u0054_\u0053\u0063\u0068e\u006d\u0061\u004c\u0069\u0062\u0072\u0061\u0072\u0079",NewCT_SchemaLibrary );_c .RegisterConstructor ("\u0068\u0074\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067/\u0073\u0063\u0068\u0065\u006da\u004c\u0069\u0062\u0072\u0061\u0072\u0079\u002f\u0032\u0030\u0030\u0036\u002f\u006d\u0061\u0069\u006e","\u0073\u0063\u0068\u0065\u006d\u0061\u004c\u0069\u0062\u0072\u0061\u0072\u0079",NewSchemaLibrary );};

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

View File

@ -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 (_cd "encoding/xml";_g "fmt";_d "github.com/unidoc/unioffice";);func NewCT_Rel ()*CT_Rel {_fg :=&CT_Rel {};return _fg };func NewCT_Empty ()*CT_Empty {_de :=&CT_Empty {};return _de };type CT_Empty struct{};func (_b *CT_Rel )UnmarshalXML (d *_cd .Decoder ,start _cd .StartElement )error {for _ ,_df :=range start .Attr {if _df .Name .Local =="\u0069\u0064"{_ag ,_dfd :=_df .Value ,error (nil );if _dfd !=nil {return _dfd ;};_b .IdAttr =&_ag ;continue ;};};for {_fb ,_fec :=d .Token ();if _fec !=nil {return _g .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0043T\u005f\u0052e\u006c\u003a\u0020\u0025\u0073",_fec );};if _dgf ,_cf :=_fb .(_cd .EndElement );_cf &&_dgf .Name ==start .Name {break ;};};return nil ;};func NewIscomment ()*Iscomment {_gga :=&Iscomment {};_gga .CT_Empty =*NewCT_Empty ();return _gga };func (_dd *CT_Empty )UnmarshalXML (d *_cd .Decoder ,start _cd .StartElement )error {for {_gg ,_gc :=d .Token ();if _gc !=nil {return _g .Errorf ("p\u0061r\u0073\u0069\u006e\u0067\u0020\u0043\u0054\u005fE\u006d\u0070\u0074\u0079: \u0025\u0073",_gc );};if _f ,_a :=_gg .(_cd .EndElement );_a &&_f .Name ==start .Name {break ;};};return nil ;};
// Validate validates the CT_Rel and its children
func (_cg *CT_Rel )Validate ()error {return _cg .ValidateWithPath ("\u0043\u0054\u005f\u0052\u0065\u006c");};func (_dee *Iscomment )MarshalXML (e *_cd .Encoder ,start _cd .StartElement )error {start .Attr =append (start .Attr ,_cd .Attr {Name :_cd .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 ,_cd .Attr {Name :_cd .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 _dee .CT_Empty .MarshalXML (e ,start );};type Iscomment struct{CT_Empty };func (_dg *CT_Empty )MarshalXML (e *_cd .Encoder ,start _cd .StartElement )error {e .EncodeToken (start );e .EncodeToken (_cd .EndElement {Name :start .Name });return nil ;};type Textdata struct{CT_Rel };
// ValidateWithPath validates the Iscomment and its children, prefixing error messages with path
func (_bbb *Iscomment )ValidateWithPath (path string )error {if _gge :=_bbb .CT_Empty .ValidateWithPath (path );_gge !=nil {return _gge ;};return nil ;};
// ValidateWithPath validates the CT_Rel and its children, prefixing error messages with path
func (_e *CT_Rel )ValidateWithPath (path string )error {return nil };
package powerpoint ;import (_e "encoding/xml";_b "fmt";_ad "github.com/unidoc/unioffice";);type CT_Empty struct{};func NewIscomment ()*Iscomment {_bfb :=&Iscomment {};_bfb .CT_Empty =*NewCT_Empty ();return _bfb };type Iscomment struct{CT_Empty };func NewCT_Rel ()*CT_Rel {_eb :=&CT_Rel {};return _eb };type Textdata struct{CT_Rel };func NewTextdata ()*Textdata {_ead :=&Textdata {};_ead .CT_Rel =*NewCT_Rel ();return _ead };
// ValidateWithPath validates the Textdata and its children, prefixing error messages with path
func (_fge *Textdata )ValidateWithPath (path string )error {if _agb :=_fge .CT_Rel .ValidateWithPath (path );_agb !=nil {return _agb ;};return nil ;};func (_bg *Iscomment )UnmarshalXML (d *_cd .Decoder ,start _cd .StartElement )error {_bg .CT_Empty =*NewCT_Empty ();for {_bb ,_aec :=d .Token ();if _aec !=nil {return _g .Errorf ("p\u0061\u0072\u0073\u0069ng\u0020I\u0073\u0063\u006f\u006d\u006de\u006e\u0074\u003a\u0020\u0025\u0073",_aec );};if _bf ,_ef :=_bb .(_cd .EndElement );_ef &&_bf .Name ==start .Name {break ;};};return nil ;};type CT_Rel struct{IdAttr *string ;};func (_ea *Textdata )MarshalXML (e *_cd .Encoder ,start _cd .StartElement )error {start .Attr =append (start .Attr ,_cd .Attr {Name :_cd .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 ,_cd .Attr {Name :_cd .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 _ea .CT_Rel .MarshalXML (e ,start );};
func (_ae *Textdata )ValidateWithPath (path string )error {if _ada :=_ae .CT_Rel .ValidateWithPath (path );_ada !=nil {return _ada ;};return nil ;};func (_f *CT_Empty )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {for {_ea ,_d :=d .Token ();if _d !=nil {return _b .Errorf ("p\u0061r\u0073\u0069\u006e\u0067\u0020\u0043\u0054\u005fE\u006d\u0070\u0074\u0079: \u0025\u0073",_d );};if _ab ,_be :=_ea .(_e .EndElement );_be &&_ab .Name ==start .Name {break ;};};return nil ;};
// Validate validates the CT_Empty and its children
func (_fe *CT_Empty )Validate ()error {return _fe .ValidateWithPath ("\u0043\u0054\u005f\u0045\u006d\u0070\u0074\u0079");};func (_dfc *Textdata )UnmarshalXML (d *_cd .Decoder ,start _cd .StartElement )error {_dfc .CT_Rel =*NewCT_Rel ();for _ ,_bfb :=range start .Attr {if _bfb .Name .Local =="\u0069\u0064"{_ac ,_cb :=_bfb .Value ,error (nil );if _cb !=nil {return _cb ;};_dfc .IdAttr =&_ac ;continue ;};};for {_cff ,_cab :=d .Token ();if _cab !=nil {return _g .Errorf ("p\u0061r\u0073\u0069\u006e\u0067\u0020\u0054\u0065\u0078t\u0064\u0061\u0074\u0061: \u0025\u0073",_cab );};if _fa ,_cdg :=_cff .(_cd .EndElement );_cdg &&_fa .Name ==start .Name {break ;};};return nil ;};
// ValidateWithPath validates the CT_Empty and its children, prefixing error messages with path
func (_db *CT_Empty )ValidateWithPath (path string )error {return nil };
// Validate validates the Iscomment and its children
func (_cgg *Iscomment )Validate ()error {return _cgg .ValidateWithPath ("\u0049s\u0063\u006f\u006d\u006d\u0065\u006et");};func NewTextdata ()*Textdata {_bge :=&Textdata {};_bge .CT_Rel =*NewCT_Rel ();return _bge };
func (_fb *CT_Empty )Validate ()error {return _fb .ValidateWithPath ("\u0043\u0054\u005f\u0045\u006d\u0070\u0074\u0079");};func (_ee *CT_Empty )MarshalXML (e *_e .Encoder ,start _e .StartElement )error {e .EncodeToken (start );e .EncodeToken (_e .EndElement {Name :start .Name });return nil ;};
// Validate validates the Textdata and its children
func (_ee *Textdata )Validate ()error {return _ee .ValidateWithPath ("\u0054\u0065\u0078\u0074\u0064\u0061\u0074\u0061");};func (_ae *CT_Rel )MarshalXML (e *_cd .Encoder ,start _cd .StartElement )error {if _ae .IdAttr !=nil {start .Attr =append (start .Attr ,_cd .Attr {Name :_cd .Name {Local :"\u0069\u0064"},Value :_g .Sprintf ("\u0025\u0076",*_ae .IdAttr )});};e .EncodeToken (start );e .EncodeToken (_cd .EndElement {Name :start .Name });return nil ;};func init (){_d .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 );_d .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 );_d .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 );_d .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 (_fc *Textdata )Validate ()error {return _fc .ValidateWithPath ("\u0054\u0065\u0078\u0074\u0064\u0061\u0074\u0061");};func (_fg *Textdata )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {_fg .CT_Rel =*NewCT_Rel ();for _ ,_gdd :=range start .Attr {if _gdd .Name .Local =="\u0069\u0064"{_eef ,_bd :=_gdd .Value ,error (nil );if _bd !=nil {return _bd ;};_fg .IdAttr =&_eef ;continue ;};};for {_dc ,_bde :=d .Token ();if _bde !=nil {return _b .Errorf ("p\u0061r\u0073\u0069\u006e\u0067\u0020\u0054\u0065\u0078t\u0064\u0061\u0074\u0061: \u0025\u0073",_bde );};if _gbb ,_bdc :=_dc .(_e .EndElement );_bdc &&_gbb .Name ==start .Name {break ;};};return nil ;};func (_fe *CT_Rel )MarshalXML (e *_e .Encoder ,start _e .StartElement )error {if _fe .IdAttr !=nil {start .Attr =append (start .Attr ,_e .Attr {Name :_e .Name {Local :"\u0069\u0064"},Value :_b .Sprintf ("\u0025\u0076",*_fe .IdAttr )});};e .EncodeToken (start );e .EncodeToken (_e .EndElement {Name :start .Name });return nil ;};func (_bf *CT_Rel )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {for _ ,_bc :=range start .Attr {if _bc .Name .Local =="\u0069\u0064"{_c ,_adf :=_bc .Value ,error (nil );if _adf !=nil {return _adf ;};_bf .IdAttr =&_c ;continue ;};};for {_abe ,_gd :=d .Token ();if _gd !=nil {return _b .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0043T\u005f\u0052e\u006c\u003a\u0020\u0025\u0073",_gd );};if _fa ,_df :=_abe .(_e .EndElement );_df &&_fa .Name ==start .Name {break ;};};return nil ;};
// ValidateWithPath validates the CT_Rel and its children, prefixing error messages with path
func (_cd *CT_Rel )ValidateWithPath (path string )error {return nil };func (_db *Iscomment )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {_db .CT_Empty =*NewCT_Empty ();for {_cf ,_ca :=d .Token ();if _ca !=nil {return _b .Errorf ("p\u0061\u0072\u0073\u0069ng\u0020I\u0073\u0063\u006f\u006d\u006de\u006e\u0074\u003a\u0020\u0025\u0073",_ca );};if _ebe ,_bfe :=_cf .(_e .EndElement );_bfe &&_ebe .Name ==start .Name {break ;};};return nil ;};
// Validate validates the CT_Rel and its children
func (_cb *CT_Rel )Validate ()error {return _cb .ValidateWithPath ("\u0043\u0054\u005f\u0052\u0065\u006c");};func NewCT_Empty ()*CT_Empty {_g :=&CT_Empty {};return _g };func (_gb *Iscomment )MarshalXML (e *_e .Encoder ,start _e .StartElement )error {start .Attr =append (start .Attr ,_e .Attr {Name :_e .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 ,_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 ="\u0069s\u0063\u006f\u006d\u006d\u0065\u006et";return _gb .CT_Empty .MarshalXML (e ,start );};type CT_Rel struct{IdAttr *string ;};func (_bcg *Textdata )MarshalXML (e *_e .Encoder ,start _e .StartElement )error {start .Attr =append (start .Attr ,_e .Attr {Name :_e .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 ,_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 ="\u0074\u0065\u0078\u0074\u0064\u0061\u0074\u0061";return _bcg .CT_Rel .MarshalXML (e ,start );};
// ValidateWithPath validates the Iscomment and its children, prefixing error messages with path
func (_eaa *Iscomment )ValidateWithPath (path string )error {if _da :=_eaa .CT_Empty .ValidateWithPath (path );_da !=nil {return _da ;};return nil ;};
// Validate validates the Iscomment and its children
func (_cbb *Iscomment )Validate ()error {return _cbb .ValidateWithPath ("\u0049s\u0063\u006f\u006d\u006d\u0065\u006et");};
// ValidateWithPath validates the CT_Empty and its children, prefixing error messages with path
func (_eae *CT_Empty )ValidateWithPath (path string )error {return nil };func init (){_ad .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 );_ad .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 );_ad .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 );_ad .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

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

View File

@ -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";_g "fmt";_gd "github.com/unidoc/unioffice/spreadsheet/update";_fc "regexp";_a "strconv";_bd "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 =_bd .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");};_bdf :=ColumnReference {};_db ,_gf ,_gff :=_gb (s );if _gff !=nil {return ColumnReference {},_gff ;};if _db !=""{_bdf .SheetName =_db ;};if _gf [0]=='$'{_bdf .AbsoluteColumn =true ;_gf =_gf [1:];};if !_cg .MatchString (_gf ){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");};_bdf .Column =_gf ;_bdf .ColumnIdx =ColumnToIndex (_bdf .Column );return _bdf ,nil ;};
// ParseColumnRangeReference splits a range reference of the form "A:B" into its
// components.
func ParseColumnRangeReference (s string )(_gg ,_baf ColumnReference ,_bc error ){_be :="";_ef :=_bd .Split (s ,"\u0021");if len (_ef )==2{_be =_ef [0];s =_ef [1];};_geb :=_bd .Split (s ,"\u003a");if len (_geb )!=2{return ColumnReference {},ColumnReference {},_b .New ("i\u006ev\u0061\u006c\u0069\u0064\u0020\u0072\u0061\u006eg\u0065\u0020\u0066\u006frm\u0061\u0074");};if _be !=""{_geb [0]=_be +"\u0021"+_geb [0];_geb [1]=_be +"\u0021"+_geb [1];};_ecc ,_bc :=ParseColumnReference (_geb [0]);if _bc !=nil {return ColumnReference {},ColumnReference {},_bc ;};_fef ,_bc :=ParseColumnReference (_geb [1]);if _bc !=nil {return ColumnReference {},ColumnReference {},_bc ;};return _ecc ,_fef ,nil ;};
// ParseCellReference parses a cell reference of the form 'A10' and splits it
// into column/row segments.
func ParseCellReference (s string )(CellReference ,error ){s =_bd .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");};_c :=CellReference {};_cc ,_ab ,_fg :=_gb (s );if _fg !=nil {return CellReference {},_fg ;};if _cc !=""{_c .SheetName =_cc ;};if s [0]=='$'{_c .AbsoluteColumn =true ;_ab =_ab [1:];};_ca :=-1;_d :for _eg :=0;_eg < len (_ab );_eg ++{switch {case _ab [_eg ]>='0'&&_ab [_eg ]<='9'||_ab [_eg ]=='$':_ca =_eg ;break _d ;};};switch _ca {case 0:return CellReference {},_g .Errorf ("\u006e\u006f\u0020\u006cet\u0074\u0065\u0072\u0020\u0070\u0072\u0065\u0066\u0069\u0078\u0020\u0069\u006e\u0020%\u0073",_ab );case -1:return CellReference {},_g .Errorf ("\u006eo\u0020d\u0069\u0067\u0069\u0074\u0073\u0020\u0069\u006e\u0020\u0025\u0073",_ab );};_c .Column =_ab [0:_ca ];if _ab [_ca ]=='$'{_c .AbsoluteRow =true ;_ca ++;};_c .ColumnIdx =ColumnToIndex (_c .Column );_fa ,_fg :=_a .ParseUint (_ab [_ca :],10,32);if _fg !=nil {return CellReference {},_g .Errorf ("e\u0072\u0072\u006f\u0072 p\u0061r\u0073\u0069\u006e\u0067\u0020r\u006f\u0077\u003a\u0020\u0025\u0073",_fg );};if _fa ==0{return CellReference {},_g .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");};_c .RowIdx =uint32 (_fa );return _c ,nil ;};
// 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 ;};var _cg =_fc .MustCompile ("^\u005b\u0061\u002d\u007aA-\u005a]\u0028\u005b\u0061\u002d\u007aA\u002d\u005a\u005d\u003f\u0029\u0024");
package reference ;import (_c "errors";_ca "fmt";_ge "github.com/unidoc/unioffice/spreadsheet/update";_g "regexp";_b "strconv";_db "strings";);
// ParseRangeReference splits a range reference of the form "A1:B5" into its
// components.
func ParseRangeReference (s string )(_gbb ,_ac CellReference ,_aa error ){_aed ,_fdd ,_aa :=_gb (s );if _aa !=nil {return CellReference {},CellReference {},_aa ;};_cd :=_bd .Split (_fdd ,"\u003a");if len (_cd )!=2{return CellReference {},CellReference {},_b .New ("i\u006ev\u0061\u006c\u0069\u0064\u0020\u0072\u0061\u006eg\u0065\u0020\u0066\u006frm\u0061\u0074");};if _aed !=""{_cd [0]=_aed +"\u0021"+_cd [0];_cd [1]=_aed +"\u0021"+_cd [1];};_fe ,_aa :=ParseCellReference (_cd [0]);if _aa !=nil {return CellReference {},CellReference {},_aa ;};_fed ,_aa :=ParseCellReference (_cd [1]);if _aa !=nil {return CellReference {},CellReference {},_aa ;};return _fe ,_fed ,nil ;};
func ParseRangeReference (s string )(_fb ,_aeg CellReference ,_ga error ){_gaa ,_cf ,_ga :=_ae (s );if _ga !=nil {return CellReference {},CellReference {},_ga ;};_ffa :=_db .Split (_cf ,"\u003a");if len (_ffa )!=2{return CellReference {},CellReference {},_c .New ("i\u006ev\u0061\u006c\u0069\u0064\u0020\u0072\u0061\u006eg\u0065\u0020\u0066\u006frm\u0061\u0074");};if _gaa !=""{_ffa [0]=_gaa +"\u0021"+_ffa [0];_ffa [1]=_gaa +"\u0021"+_ffa [1];};_ece ,_ga :=ParseCellReference (_ffa [0]);if _ga !=nil {return CellReference {},CellReference {},_ga ;};_gbe ,_ga :=ParseCellReference (_ffa [1]);if _ga !=nil {return CellReference {},CellReference {},_ga ;};return _ece ,_gbe ,nil ;};
// ColumnToIndex maps a column to a zero based index (e.g. A = 0, B = 1, AA = 26)
func ColumnToIndex (col string )uint32 {col =_bd .ToUpper (col );_ge :=uint32 (0);for _ ,_ce :=range col {_ge *=26;_ge +=uint32 (_ce -'A'+1);};return _ge -1;};
// String returns a string representation of ColumnReference.
func (_abe ColumnReference )String ()string {_af :=make ([]byte ,0,4);if _abe .AbsoluteColumn {_af =append (_af ,'$');};_af =append (_af ,_abe .Column ...);return string (_af );};
// Update updates reference to point one of the neighboring cells with respect to the update type after removing a row/column.
func (_cae *CellReference )Update (updateType _ge .UpdateAction )*CellReference {switch updateType {case _ge .UpdateActionRemoveColumn :_ff :=_cae ;_ff .ColumnIdx =_cae .ColumnIdx -1;_ff .Column =IndexToColumn (_ff .ColumnIdx );return _ff ;default:return _cae ;};};
// ParseCellReference parses a cell reference of the form 'A10' and splits it
// into column/row segments.
func ParseCellReference (s string )(CellReference ,error ){s =_db .TrimSpace (s );if len (s )< 2{return CellReference {},_c .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");};_bec :=CellReference {};_de ,_e ,_ab :=_ae (s );if _ab !=nil {return CellReference {},_ab ;};if _de !=""{_bec .SheetName =_de ;};if s [0]=='$'{_bec .AbsoluteColumn =true ;_e =_e [1:];};_f :=-1;_gb :for _ce :=0;_ce < len (_e );_ce ++{switch {case _e [_ce ]>='0'&&_e [_ce ]<='9'||_e [_ce ]=='$':_f =_ce ;break _gb ;};};switch _f {case 0:return CellReference {},_ca .Errorf ("\u006e\u006f\u0020\u006cet\u0074\u0065\u0072\u0020\u0070\u0072\u0065\u0066\u0069\u0078\u0020\u0069\u006e\u0020%\u0073",_e );case -1:return CellReference {},_ca .Errorf ("\u006eo\u0020d\u0069\u0067\u0069\u0074\u0073\u0020\u0069\u006e\u0020\u0025\u0073",_e );};_bec .Column =_e [0:_f ];if _e [_f ]=='$'{_bec .AbsoluteRow =true ;_f ++;};_bec .ColumnIdx =ColumnToIndex (_bec .Column );_dd ,_ab :=_b .ParseUint (_e [_f :],10,32);if _ab !=nil {return CellReference {},_ca .Errorf ("e\u0072\u0072\u006f\u0072 p\u0061r\u0073\u0069\u006e\u0067\u0020r\u006f\u0077\u003a\u0020\u0025\u0073",_ab );};if _dd ==0{return CellReference {},_ca .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");};_bec .RowIdx =uint32 (_dd );return _bec ,nil ;};
// String returns a string representation of CellReference.
func (_a CellReference )String ()string {_be :=make ([]byte ,0,4);if _a .AbsoluteColumn {_be =append (_be ,'$');};_be =append (_be ,_a .Column ...);if _a .AbsoluteRow {_be =append (_be ,'$');};_be =_b .AppendInt (_be ,int64 (_a .RowIdx ),10);return string (_be );};
// 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 ;};var _dg =_g .MustCompile ("^\u005b\u0061\u002d\u007aA-\u005a]\u0028\u005b\u0061\u002d\u007aA\u002d\u005a\u005d\u003f\u0029\u0024");
// 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 =_db .TrimSpace (s );if len (s )< 1{return ColumnReference {},_c .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");};_eb :=ColumnReference {};_cg ,_cb ,_ec :=_ae (s );if _ec !=nil {return ColumnReference {},_ec ;};if _cg !=""{_eb .SheetName =_cg ;};if _cb [0]=='$'{_eb .AbsoluteColumn =true ;_cb =_cb [1:];};if !_dg .MatchString (_cb ){return ColumnReference {},_c .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");};_eb .Column =_cb ;_eb .ColumnIdx =ColumnToIndex (_eb .Column );return _eb ,nil ;};func _ae (_ged string )(string ,string ,error ){_fc :="";_gg :=_db .LastIndex (_ged ,"\u0021");if _gg > -1{_fc =_ged [:_gg ];_ged =_ged [_gg +1:];if _fc ==""{return "","",_c .New ("\u0049n\u0076a\u006c\u0069\u0064\u0020\u0073h\u0065\u0065t\u0020\u006e\u0061\u006d\u0065");};};return _fc ,_ged ,nil ;};
// 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 ;};
// String returns a string representation of ColumnReference.
func (_bf ColumnReference )String ()string {_dg :=make ([]byte ,0,4);if _bf .AbsoluteColumn {_dg =append (_dg ,'$');};_dg =append (_dg ,_bf .Column ...);return string (_dg );};
// Update updates reference to point one of the neighboring columns with respect to the update type after removing a row/column.
func (_ec *ColumnReference )Update (updateType _gd .UpdateAction )*ColumnReference {switch updateType {case _gd .UpdateActionRemoveColumn :_ba :=_ec ;_ba .ColumnIdx =_ec .ColumnIdx -1;_ba .Column =IndexToColumn (_ba .ColumnIdx );return _ba ;default:return _ec ;};};
// ParseColumnRangeReference splits a range reference of the form "A:B" into its
// components.
func ParseColumnRangeReference (s string )(_gba ,_dee ColumnReference ,_cc error ){_fa :="";_bda :=_db .Split (s ,"\u0021");if len (_bda )==2{_fa =_bda [0];s =_bda [1];};_gd :=_db .Split (s ,"\u003a");if len (_gd )!=2{return ColumnReference {},ColumnReference {},_c .New ("i\u006ev\u0061\u006c\u0069\u0064\u0020\u0072\u0061\u006eg\u0065\u0020\u0066\u006frm\u0061\u0074");};if _fa !=""{_gd [0]=_fa +"\u0021"+_gd [0];_gd [1]=_fa +"\u0021"+_gd [1];};_dbg ,_cc :=ParseColumnReference (_gd [0]);if _cc !=nil {return ColumnReference {},ColumnReference {},_cc ;};_ee ,_cc :=ParseColumnReference (_gd [1]);if _cc !=nil {return ColumnReference {},ColumnReference {},_cc ;};return _dbg ,_ee ,nil ;};
// IndexToColumn maps a column number to a column name (e.g. 0 = A, 1 = B, 26 = AA)
func IndexToColumn (col uint32 )string {var _abd [64+1]byte ;_fd :=len (_abd );_agb :=col ;const _ga =26;for _agb >=_ga {_fd --;_abg :=_agb /_ga ;_abd [_fd ]=byte ('A'+uint (_agb -_abg *_ga ));_agb =_abg -1;};_fd --;_abd [_fd ]=byte ('A'+uint (_agb ));return string (_abd [_fd :]);};func _gb (_cga string )(string ,string ,error ){_fdf :="";_bfb :=_bd .LastIndex (_cga ,"\u0021");if _bfb > -1{_fdf =_cga [:_bfb ];_cga =_cga [_bfb +1:];if _fdf ==""{return "","",_b .New ("\u0049n\u0076a\u006c\u0069\u0064\u0020\u0073h\u0065\u0065t\u0020\u006e\u0061\u006d\u0065");};};return _fdf ,_cga ,nil ;};
func IndexToColumn (col uint32 )string {var _ef [64+1]byte ;_ddb :=len (_ef );_afe :=col ;const _ddbd =26;for _afe >=_ddbd {_ddb --;_bd :=_afe /_ddbd ;_ef [_ddb ]=byte ('A'+uint (_afe -_bd *_ddbd ));_afe =_bd -1;};_ddb --;_ef [_ddb ]=byte ('A'+uint (_afe ));return string (_ef [_ddb :]);};
// String returns a string representation of CellReference.
func (_ae CellReference )String ()string {_e :=make ([]byte ,0,4);if _ae .AbsoluteColumn {_e =append (_e ,'$');};_e =append (_e ,_ae .Column ...);if _ae .AbsoluteRow {_e =append (_e ,'$');};_e =_a .AppendInt (_e ,int64 (_ae .RowIdx ),10);return string (_e );};
// Update updates reference to point one of the neighboring columns with respect to the update type after removing a row/column.
func (_fe *ColumnReference )Update (updateType _ge .UpdateAction )*ColumnReference {switch updateType {case _ge .UpdateActionRemoveColumn :_ddd :=_fe ;_ddd .ColumnIdx =_fe .ColumnIdx -1;_ddd .Column =IndexToColumn (_ddd .ColumnIdx );return _ddd ;default:return _fe ;};};
// Update updates reference to point one of the neighboring cells with respect to the update type after removing a row/column.
func (_dd *CellReference )Update (updateType _gd .UpdateAction )*CellReference {switch updateType {case _gd .UpdateActionRemoveColumn :_ag :=_dd ;_ag .ColumnIdx =_dd .ColumnIdx -1;_ag .Column =IndexToColumn (_ag .ColumnIdx );return _ag ;default:return _dd ;};};
// ColumnToIndex maps a column to a zero based index (e.g. A = 0, B = 1, AA = 26)
func ColumnToIndex (col string )uint32 {col =_db .ToUpper (col );_dc :=uint32 (0);for _ ,_ed :=range col {_dc *=26;_dc +=uint32 (_ed -'A'+1);};return _dc -1;};

File diff suppressed because one or more lines are too long

View File

@ -12,6 +12,9 @@
// Package update contains definitions needed for updating references after removing rows/columns.
package update ;
// UpdateAction is the type for update types constants.
type UpdateAction byte ;
// UpdateQuery contains terms of how to update references after removing row/column.
type UpdateQuery struct{
@ -25,7 +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 ;);
// UpdateAction is the type for update types constants.
type UpdateAction byte ;
UpdateCurrentSheet bool ;};const (UpdateActionRemoveColumn UpdateAction =iota ;);

File diff suppressed because one or more lines are too long

View File

@ -9,92 +9,92 @@
// 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 (_bg "encoding/xml";_f "fmt";_ee "github.com/unidoc/unioffice";_ad "github.com/unidoc/unioffice/common/logger";_d "github.com/unidoc/unioffice/schema/soo/ofc/sharedTypes";_ae "github.com/unidoc/unioffice/schema/urn/schemas_microsoft_com/office/excel";_g "github.com/unidoc/unioffice/schema/urn/schemas_microsoft_com/vml";_a "strconv";_b "strings";);func (_bb *Container )MarshalXML (e *_bg .Encoder ,start _bg .StartElement )error {start .Attr =append (start .Attr ,_bg .Attr {Name :_bg .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 ,_bg .Attr {Name :_bg .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 ,_bg .Attr {Name :_bg .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 _bb .Layout !=nil {_cf :=_bg .StartElement {Name :_bg .Name {Local :"\u006f\u003a\u0073\u0068\u0061\u0070\u0065\u006c\u0061\u0079\u006f\u0075\u0074"}};e .EncodeElement (_bb .Layout ,_cf );};if _bb .ShapeType !=nil {_ff :=_bg .StartElement {Name :_bg .Name {Local :"v\u003a\u0073\u0068\u0061\u0070\u0065\u0074\u0079\u0070\u0065"}};e .EncodeElement (_bb .ShapeType ,_ff );};for _ ,_cb :=range _bb .Shape {_eb :=_bg .StartElement {Name :_bg .Name {Local :"\u0076:\u0073\u0068\u0061\u0070\u0065"}};e .EncodeElement (_cb ,_eb );};return e .EncodeToken (_bg .EndElement {Name :start .Name });};
package vmldrawing ;import (_e "encoding/xml";_b "fmt";_ag "github.com/unidoc/unioffice";_ba "github.com/unidoc/unioffice/common/logger";_bc "github.com/unidoc/unioffice/schema/soo/ofc/sharedTypes";_af "github.com/unidoc/unioffice/schema/urn/schemas_microsoft_com/office/excel";_ef "github.com/unidoc/unioffice/schema/urn/schemas_microsoft_com/vml";_d "strconv";_a "strings";);
// SetHeight set height of shape.
func (_ega *ShapeStyle )SetHeight (height float64 ){_ega ._eg =height };
// Top get top attribute of shape style.
func (_cd *ShapeStyle )Top ()float64 {return _cd ._bc };
// SetWidth set width of shape.
func (_fd *ShapeStyle )SetWidth (width float64 ){_fd ._ebd =width };
// NewShapeStyle accept value of string style attribute in v:shape and format it to generate ShapeStyle.
func NewShapeStyle (style string )ShapeStyle {_bac :=ShapeStyle {_ebd :0,_eg :0};_aeb :=_b .Split (style ,"\u003b");for _ ,_efa :=range _aeb {_dc :=_b .Split (_efa ,"\u003a");if len (_dc )!=2{continue ;};var _gcc error ;switch _dc [0]{case "\u0070\u006f\u0073\u0069\u0074\u0069\u006f\u006e":_bac ._adf =_dc [1];break ;case "\u006d\u0061\u0072\u0067\u0069\u006e\u002d\u0074\u006f\u0070":_bac ._ag ,_gcc =_a .ParseFloat (_b .ReplaceAll (_dc [1],"\u0070\u0074",""),64);break ;case "m\u0061\u0072\u0067\u0069\u006e\u002d\u006c\u0065\u0066\u0074":_bac ._ac ,_gcc =_a .ParseFloat (_b .ReplaceAll (_dc [1],"\u0070\u0074",""),64);break ;case "\u006d\u0061\u0072\u0067\u0069\u006e\u002d\u0062\u006f\u0074\u0074\u006f\u006d":_bac ._aea ,_gcc =_a .ParseFloat (_b .ReplaceAll (_dc [1],"\u0070\u0074",""),64);break ;case "\u006d\u0061\u0072g\u0069\u006e\u002d\u0072\u0069\u0067\u0068\u0074":_bac ._ba ,_gcc =_a .ParseFloat (_b .ReplaceAll (_dc [1],"\u0070\u0074",""),64);break ;case "\u0074\u006f\u0070":_bac ._bc ,_gcc =_a .ParseFloat (_b .ReplaceAll (_dc [1],"\u0070\u0074",""),64);break ;case "\u006c\u0065\u0066\u0074":_bac ._gb ,_gcc =_a .ParseFloat (_b .ReplaceAll (_dc [1],"\u0070\u0074",""),64);break ;case "\u0062\u006f\u0074\u0074\u006f\u006d":_bac ._ef ,_gcc =_a .ParseFloat (_b .ReplaceAll (_dc [1],"\u0070\u0074",""),64);break ;case "\u0072\u0069\u0067h\u0074":_bac ._fb ,_gcc =_a .ParseFloat (_b .ReplaceAll (_dc [1],"\u0070\u0074",""),64);break ;case "\u0077\u0069\u0064t\u0068":_bac ._ebd ,_gcc =_a .ParseFloat (_b .ReplaceAll (_dc [1],"\u0070\u0074",""),64);break ;case "\u0068\u0065\u0069\u0067\u0068\u0074":_bac ._eg ,_gcc =_a .ParseFloat (_b .ReplaceAll (_dc [1],"\u0070\u0074",""),64);break ;case "\u007a-\u0069\u006e\u0064\u0065\u0078":_bac ._cfg ,_gcc =_a .ParseInt (_dc [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":_bac ._gaf =_dc [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":_bac ._efg =_dc [1];break ;case "m\u0073\u006f\u002d\u0070os\u0069t\u0069\u006f\u006e\u002d\u0076e\u0072\u0074\u0069\u0063\u0061\u006c":_bac ._fc =_dc [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":_bac ._ggc =_dc [1];break ;};if _gcc !=nil {_ad .Log .Debug ("\u0055n\u0061\u0062l\u0065\u0020\u0074o\u0020\u0070\u0061\u0072\u0073\u0065\u0020s\u0074\u0079\u006c\u0065\u0020\u0061t\u0074\u0072\u0069\u0062\u0075\u0074\u0065\u003a\u0020\u0025\u0073 \u0076\u0061\u006c\u0075\u0065\u003a\u0020\u0025\u0076",_dc [0],_dc [1]);};};return _bac ;};
// IsBold returns true if text is bold.
func (_ada *TextpathStyle )IsBold ()bool {return _ada ._egc };
// CreateFormula creates F element for typeFormulas.
func CreateFormula (s string )*_g .CT_F {_ffg :=_g .NewCT_F ();_ffg .EqnAttr =&s ;return _ffg };
// ToString formatting ShapeStyle to string.
func (_fg *ShapeStyle )String ()string {_fcf :="";_fcf +=_f .Sprintf ("\u0070\u006f\u0073i\u0074\u0069\u006f\u006e\u003a\u0025\u0073\u003b",_fg ._adf );_fcf +=_f .Sprintf ("\u006da\u0072g\u0069\u006e\u002d\u006c\u0065\u0066\u0074\u003a\u0025\u0064\u003b",int64 (_fg ._ac ));_fcf +=_f .Sprintf ("\u006d\u0061\u0072\u0067\u0069\u006e\u002d\u0074\u006fp\u003a\u0025\u0064\u003b",int64 (_fg ._ag ));_fcf +=_f .Sprintf ("w\u0069\u0064\u0074\u0068\u003a\u0025\u0064\u0070\u0074\u003b",int64 (_fg ._ebd ));_fcf +=_f .Sprintf ("\u0068\u0065\u0069g\u0068\u0074\u003a\u0025\u0064\u0070\u0074\u003b",int64 (_fg ._eg ));_fcf +=_f .Sprintf ("z\u002d\u0069\u006e\u0064\u0065\u0078\u003a\u0025\u0064\u003b",_fg ._cfg );_fcf +=_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",_fg ._gaf );_fcf +=_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",_fg ._efg );_fcf +=_f .Sprintf ("\u006ds\u006f\u002d\u0070\u006fs\u0069\u0074\u0069\u006f\u006e-\u0076e\u0072t\u0069\u0063\u0061\u006c\u003a\u0025\u0073;",_fg ._fc );_fcf +=_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",_fg ._ggc );return _fcf ;};
// Bottom get bottom attribute of shape style.
func (_de *ShapeStyle )Bottom ()float64 {return _de ._ef };
// MSOPositionVerticalRelative get `mso-position-vertical-relative` attribute of shape style.
func (_eac *ShapeStyle )MSOPositionVerticalRelative ()string {return _eac ._ggc };
// SetBold sets text to bold.
func (_bbf *TextpathStyle )SetBold (bold bool ){_bbf ._egc =bold };
// Left get left attribute of shape style.
func (_cdf *ShapeStyle )Left ()float64 {return _cdf ._gb };
// NewTextpathStyle accept value of string style attribute of element v:textpath and format it to generate TextpathStyle.
func NewTextpathStyle (style string )TextpathStyle {_ggcd :=TextpathStyle {_aebg :"\u0022C\u0061\u006c\u0069\u0062\u0072\u0069\"",_bad :44,_egc :false ,_bfa :false };_gfe :=_b .Split (style ,"\u003b");for _ ,_egb :=range _gfe {_fdg :=_b .Split (_egb ,"\u003a");if len (_fdg )!=2{continue ;};switch _fdg [0]{case "f\u006f\u006e\u0074\u002d\u0066\u0061\u006d\u0069\u006c\u0079":_ggcd ._aebg =_fdg [1];break ;case "\u0066o\u006e\u0074\u002d\u0073\u0069\u007ae":_ggcd ._bad ,_ =_a .ParseInt (_b .ReplaceAll (_fdg [1],"\u0070\u0074",""),10,64);break ;case "f\u006f\u006e\u0074\u002d\u0077\u0065\u0069\u0067\u0068\u0074":_ggcd ._egc =_fdg [1]=="\u0062\u006f\u006c\u0064";break ;case "\u0066\u006f\u006e\u0074\u002d\u0073\u0074\u0079\u006c\u0065":_ggcd ._bfa =_fdg [1]=="\u0069\u0074\u0061\u006c\u0069\u0063";break ;};};return _ggcd ;};
// Width return width of shape.
func (_bg *ShapeStyle )Width ()float64 {return _bg ._cb };type Container struct{Layout *_ef .OfcShapelayout ;ShapeType *_ef .Shapetype ;Shape []*_ef .Shape ;};
// SetFontFamily sets text's fontFamily.
func (_gdc *TextpathStyle )SetFontFamily (fontFamily string ){_gdc ._aebg =fontFamily };
func (_bba *TextpathStyle )SetFontFamily (fontFamily string ){_bba ._fg =fontFamily };
// SetHeight set height of shape.
func (_cf *ShapeStyle )SetHeight (height float64 ){_cf ._egf =height };func (_gf *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 _gf .Layout !=nil {_ab :=_e .StartElement {Name :_e .Name {Local :"\u006f\u003a\u0073\u0068\u0061\u0070\u0065\u006c\u0061\u0079\u006f\u0075\u0074"}};e .EncodeElement (_gf .Layout ,_ab );};if _gf .ShapeType !=nil {_bcb :=_e .StartElement {Name :_e .Name {Local :"v\u003a\u0073\u0068\u0061\u0070\u0065\u0074\u0079\u0070\u0065"}};e .EncodeElement (_gf .ShapeType ,_bcb );};for _ ,_bca :=range _gf .Shape {_cd :=_e .StartElement {Name :_e .Name {Local :"\u0076:\u0073\u0068\u0061\u0070\u0065"}};e .EncodeElement (_bca ,_cd );};return e .EncodeToken (_e .EndElement {Name :start .Name });};
// Margins get margin top, left, bottom, and right of shape style.
func (_bb *ShapeStyle )Margins ()(float64 ,float64 ,float64 ,float64 ){return _bb ._dg ,_bb ._ebc ,_bb ._gdd ,_bb ._cdc ;};func NewContainer ()*Container {return &Container {}};
// IsBold returns true if text is bold.
func (_bbc *TextpathStyle )IsBold ()bool {return _bbc ._be };
// ToString generate string of TextpathStyle.
func (_ddd *TextpathStyle )String ()string {_dab :="";_dab +=_b .Sprintf ("\u0066o\u006et\u002d\u0066\u0061\u006d\u0069\u006c\u0079\u003a\u0025\u0073\u003b",_ddd ._fg );_dab +=_b .Sprintf ("\u0066o\u006et\u002d\u0073\u0069\u007a\u0065\u003a\u0025\u0064\u0070\u0074\u003b",_ddd ._bdb );if _ddd ._dga {_dab +=_b .Sprintf ("\u0066o\u006et\u002d\u0073\u0074\u0079\u006ce\u003a\u0069t\u0061\u006c\u0069\u0063\u003b");};if _ddd ._be {_dab +=_b .Sprintf ("\u0066\u006f\u006e\u0074\u002d\u0077\u0065\u0069\u0067\u0068\u0074\u003ab\u006f\u006c\u0064\u003b");};return _dab ;};
// Height return height of shape.
func (_fcd *ShapeStyle )Height ()float64 {return _fcd ._egf };
// SetItalic sets text to italic.
func (_fge *TextpathStyle )SetItalic (italic bool ){_fge ._dga =italic };
// SetFontSize sets text's fontSize.
func (_agc *TextpathStyle )SetFontSize (fontSize int64 ){_agc ._bad =fontSize };
func (_gfe *TextpathStyle )SetFontSize (fontSize int64 ){_gfe ._bdb =fontSize };
// Right get right attribute of shape style.
func (_acf *ShapeStyle )Right ()float64 {return _acf ._fb };
// Position get position attribute of shape style.
func (_bdg *ShapeStyle )Position ()string {return _bdg ._bd };
// FontFamily returns fontFamily of the text.
func (_fee *TextpathStyle )FontFamily ()string {return _fee ._aebg };
// MSOPositionVerticalRelative get `mso-position-vertical-relative` attribute of shape style.
func (_baf *ShapeStyle )MSOPositionVerticalRelative ()string {return _baf ._ddc };
// MSOPositionHorizontalRelative get `mso-position-horizontal-relative` attribute of shape style.
func (_aeee *ShapeStyle )MSOPositionHorizontalRelative ()string {return _aeee ._efg };
func (_ccb *ShapeStyle )MSOPositionHorizontalRelative ()string {return _ccb ._aba };
// NewShapeStyle accept value of string style attribute in v:shape and format it to generate ShapeStyle.
func NewShapeStyle (style string )ShapeStyle {_gae :=ShapeStyle {_cb :0,_egf :0};_abc :=_a .Split (style ,"\u003b");for _ ,_bcbe :=range _abc {_de :=_a .Split (_bcbe ,"\u003a");if len (_de )!=2{continue ;};var _dc error ;switch _de [0]{case "\u0070\u006f\u0073\u0069\u0074\u0069\u006f\u006e":_gae ._bd =_de [1];break ;case "\u006d\u0061\u0072\u0067\u0069\u006e\u002d\u0074\u006f\u0070":_gae ._dg ,_dc =_d .ParseFloat (_a .ReplaceAll (_de [1],"\u0070\u0074",""),64);break ;case "m\u0061\u0072\u0067\u0069\u006e\u002d\u006c\u0065\u0066\u0074":_gae ._ebc ,_dc =_d .ParseFloat (_a .ReplaceAll (_de [1],"\u0070\u0074",""),64);break ;case "\u006d\u0061\u0072\u0067\u0069\u006e\u002d\u0062\u006f\u0074\u0074\u006f\u006d":_gae ._gdd ,_dc =_d .ParseFloat (_a .ReplaceAll (_de [1],"\u0070\u0074",""),64);break ;case "\u006d\u0061\u0072g\u0069\u006e\u002d\u0072\u0069\u0067\u0068\u0074":_gae ._cdc ,_dc =_d .ParseFloat (_a .ReplaceAll (_de [1],"\u0070\u0074",""),64);break ;case "\u0074\u006f\u0070":_gae ._gg ,_dc =_d .ParseFloat (_a .ReplaceAll (_de [1],"\u0070\u0074",""),64);break ;case "\u006c\u0065\u0066\u0074":_gae ._eg ,_dc =_d .ParseFloat (_a .ReplaceAll (_de [1],"\u0070\u0074",""),64);break ;case "\u0062\u006f\u0074\u0074\u006f\u006d":_gae ._fc ,_dc =_d .ParseFloat (_a .ReplaceAll (_de [1],"\u0070\u0074",""),64);break ;case "\u0072\u0069\u0067h\u0074":_gae ._db ,_dc =_d .ParseFloat (_a .ReplaceAll (_de [1],"\u0070\u0074",""),64);break ;case "\u0077\u0069\u0064t\u0068":_gae ._cb ,_dc =_d .ParseFloat (_a .ReplaceAll (_de [1],"\u0070\u0074",""),64);break ;case "\u0068\u0065\u0069\u0067\u0068\u0074":_gae ._egf ,_dc =_d .ParseFloat (_a .ReplaceAll (_de [1],"\u0070\u0074",""),64);break ;case "\u007a-\u0069\u006e\u0064\u0065\u0078":_gae ._eae ,_dc =_d .ParseInt (_de [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":_gae ._fe =_de [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":_gae ._aba =_de [1];break ;case "m\u0073\u006f\u002d\u0070os\u0069t\u0069\u006f\u006e\u002d\u0076e\u0072\u0074\u0069\u0063\u0061\u006c":_gae ._ad =_de [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":_gae ._ddc =_de [1];break ;};if _dc !=nil {_ba .Log .Debug ("\u0055n\u0061\u0062l\u0065\u0020\u0074o\u0020\u0070\u0061\u0072\u0073\u0065\u0020s\u0074\u0079\u006c\u0065\u0020\u0061t\u0074\u0072\u0069\u0062\u0075\u0074\u0065\u003a\u0020\u0025\u0073 \u0076\u0061\u006c\u0075\u0065\u003a\u0020\u0025\u0076",_de [0],_de [1]);};};return _gae ;};
// TextpathStyle is style attribute of element v:textpath.
type TextpathStyle struct{_fg string ;_bdb int64 ;_be bool ;_dga bool ;};
// IsItalic returns true if text is italic.
func (_ggb *TextpathStyle )IsItalic ()bool {return _ggb ._dga };
// SetBold sets text to bold.
func (_ccf *TextpathStyle )SetBold (bold bool ){_ccf ._be =bold };
// Left get left attribute of shape style.
func (_dce *ShapeStyle )Left ()float64 {return _dce ._eg };
// Bottom get bottom attribute of shape style.
func (_dcc *ShapeStyle )Bottom ()float64 {return _dcc ._fc };
// ShapeStyle is style attribute of v:shape element.
type ShapeStyle struct{_bd string ;_dg float64 ;_ebc float64 ;_gdd float64 ;_cdc float64 ;_gg float64 ;_eg float64 ;_fc float64 ;_db float64 ;_cb float64 ;_egf float64 ;_eae int64 ;_fe string ;_aba string ;_ad string ;_ddc string ;};
// SetWidth set width of shape.
func (_cc *ShapeStyle )SetWidth (width float64 ){_cc ._cb =width };
// Top get top attribute of shape style.
func (_gff *ShapeStyle )Top ()float64 {return _gff ._gg };
// NewTextpathStyle accept value of string style attribute of element v:textpath and format it to generate TextpathStyle.
func NewTextpathStyle (style string )TextpathStyle {_ee :=TextpathStyle {_fg :"\u0022C\u0061\u006c\u0069\u0062\u0072\u0069\"",_bdb :44,_be :false ,_dga :false };_bdd :=_a .Split (style ,"\u003b");for _ ,_ae :=range _bdd {_df :=_a .Split (_ae ,"\u003a");if len (_df )!=2{continue ;};switch _df [0]{case "f\u006f\u006e\u0074\u002d\u0066\u0061\u006d\u0069\u006c\u0079":_ee ._fg =_df [1];break ;case "\u0066o\u006e\u0074\u002d\u0073\u0069\u007ae":_ee ._bdb ,_ =_d .ParseInt (_a .ReplaceAll (_df [1],"\u0070\u0074",""),10,64);break ;case "f\u006f\u006e\u0074\u002d\u0077\u0065\u0069\u0067\u0068\u0074":_ee ._be =_df [1]=="\u0062\u006f\u006c\u0064";break ;case "\u0066\u006f\u006e\u0074\u002d\u0073\u0074\u0079\u006c\u0065":_ee ._dga =_df [1]=="\u0069\u0074\u0061\u006c\u0069\u0063";break ;};};return _ee ;};
// FontFamily returns fontFamily of the text.
func (_gfb *TextpathStyle )FontFamily ()string {return _gfb ._fg };
// Right get right attribute of shape style.
func (_dbe *ShapeStyle )Right ()float64 {return _dbe ._db };
// CreateFormula creates F element for typeFormulas.
func CreateFormula (s string )*_ef .CT_F {_cda :=_ef .NewCT_F ();_cda .EqnAttr =&s ;return _cda };const (ShapeStylePositionAbsolute ="\u0061\u0062\u0073\u006f\u006c\u0075\u0074\u0065";ShapeStylePositionRelative ="\u0072\u0065\u006c\u0061\u0074\u0069\u0076\u0065";);
// ToString formatting ShapeStyle to string.
func (_fea *ShapeStyle )String ()string {_gfa :="";_gfa +=_b .Sprintf ("\u0070\u006f\u0073i\u0074\u0069\u006f\u006e\u003a\u0025\u0073\u003b",_fea ._bd );_gfa +=_b .Sprintf ("\u006da\u0072g\u0069\u006e\u002d\u006c\u0065\u0066\u0074\u003a\u0025\u0064\u003b",int64 (_fea ._ebc ));_gfa +=_b .Sprintf ("\u006d\u0061\u0072\u0067\u0069\u006e\u002d\u0074\u006fp\u003a\u0025\u0064\u003b",int64 (_fea ._dg ));_gfa +=_b .Sprintf ("w\u0069\u0064\u0074\u0068\u003a\u0025\u0064\u0070\u0074\u003b",int64 (_fea ._cb ));_gfa +=_b .Sprintf ("\u0068\u0065\u0069g\u0068\u0074\u003a\u0025\u0064\u0070\u0074\u003b",int64 (_fea ._egf ));_gfa +=_b .Sprintf ("z\u002d\u0069\u006e\u0064\u0065\u0078\u003a\u0025\u0064\u003b",_fea ._eae );_gfa +=_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",_fea ._fe );_gfa +=_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",_fea ._aba );_gfa +=_b .Sprintf ("\u006ds\u006f\u002d\u0070\u006fs\u0069\u0074\u0069\u006f\u006e-\u0076e\u0072t\u0069\u0063\u0061\u006c\u003a\u0025\u0073;",_fea ._ad );_gfa +=_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",_fea ._ddc );return _gfa ;};
// FontSize returns fontSize of the text.
func (_fa *TextpathStyle )FontSize ()int64 {return _fa ._bdb };
// NewCommentDrawing constructs a new comment drawing.
func NewCommentDrawing ()*Container {_eb :=NewContainer ();_eb .Layout =_ef .NewOfcShapelayout ();_eb .Layout .ExtAttr =_ef .ST_ExtEdit ;_eb .Layout .Idmap =_ef .NewOfcCT_IdMap ();_eb .Layout .Idmap .DataAttr =_ag .String ("\u0031");_eb .Layout .Idmap .ExtAttr =_ef .ST_ExtEdit ;_eb .ShapeType =_ef .NewShapetype ();_eb .ShapeType .IdAttr =_ag .String ("_\u0078\u0030\u0030\u0030\u0030\u005f\u0074\u0032\u0030\u0032");_eb .ShapeType .CoordsizeAttr =_ag .String ("2\u0031\u0036\u0030\u0030\u002c\u0032\u0031\u0036\u0030\u0030");_eb .ShapeType .SptAttr =_ag .Float32 (202);_eb .ShapeType .PathAttr =_ag .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");_efb :=_ef .NewEG_ShapeElements ();_eb .ShapeType .EG_ShapeElements =append (_eb .ShapeType .EG_ShapeElements ,_efb );_efb .Path =_ef .NewPath ();_efb .Path .GradientshapeokAttr =_bc .ST_TrueFalseT ;_efb .Path .ConnecttypeAttr =_ef .OfcST_ConnectTypeRect ;return _eb ;};func (_eda *Container )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {_eda .Shape =nil ;_fd :for {_cg ,_da :=d .Token ();if _da !=nil {return _da ;};switch _ga :=_cg .(type ){case _e .StartElement :switch _ga .Name .Local {case "s\u0068\u0061\u0070\u0065\u006c\u0061\u0079\u006f\u0075\u0074":_eda .Layout =_ef .NewOfcShapelayout ();if _ca :=d .DecodeElement (_eda .Layout ,&_ga );_ca !=nil {return _ca ;};case "\u0073h\u0061\u0070\u0065\u0074\u0079\u0070e":_eda .ShapeType =_ef .NewShapetype ();if _dd :=d .DecodeElement (_eda .ShapeType ,&_ga );_dd !=nil {return _dd ;};case "\u0073\u0068\u0061p\u0065":_dae :=_ef .NewShape ();if _gfd :=d .DecodeElement (_dae ,&_ga );_gfd !=nil {return _gfd ;};_eda .Shape =append (_eda .Shape ,_dae );};case _e .EndElement :break _fd ;};};return nil ;};
// NewCommentShape creates a new comment shape for a given cell index. The
// indices here are zero based.
func NewCommentShape (col ,row int64 )*_g .Shape {_gf :=_g .NewShape ();_gf .IdAttr =_ee .String (_f .Sprintf ("\u0063\u0073\u005f\u0025\u0064\u005f\u0025\u0064",col ,row ));_gf .TypeAttr =_ee .String ("\u0023\u005f\u00780\u0030\u0030\u0030\u005f\u0074\u0032\u0030\u0032");_gf .StyleAttr =_ee .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");_gf .FillcolorAttr =_ee .String ("\u0023f\u0062\u0066\u0036\u0064\u0036");_gf .StrokecolorAttr =_ee .String ("\u0023e\u0064\u0065\u0061\u0061\u0031");_ec :=_g .NewEG_ShapeElements ();_ec .Fill =_g .NewFill ();_ec .Fill .Color2Attr =_ee .String ("\u0023f\u0062\u0066\u0065\u0038\u0032");_ec .Fill .AngleAttr =_ee .Float64 (-180);_ec .Fill .TypeAttr =_g .ST_FillTypeGradient ;_ec .Fill .Fill =_g .NewOfcFill ();_ec .Fill .Fill .ExtAttr =_g .ST_ExtView ;_ec .Fill .Fill .TypeAttr =_g .OfcST_FillTypeGradientUnscaled ;_gf .EG_ShapeElements =append (_gf .EG_ShapeElements ,_ec );_dg :=_g .NewEG_ShapeElements ();_dg .Shadow =_g .NewShadow ();_dg .Shadow .OnAttr =_d .ST_TrueFalseT ;_dg .Shadow .ObscuredAttr =_d .ST_TrueFalseT ;_gf .EG_ShapeElements =append (_gf .EG_ShapeElements ,_dg );_ca :=_g .NewEG_ShapeElements ();_ca .Path =_g .NewPath ();_ca .Path .ConnecttypeAttr =_g .OfcST_ConnectTypeNone ;_gf .EG_ShapeElements =append (_gf .EG_ShapeElements ,_ca );_db :=_g .NewEG_ShapeElements ();_db .Textbox =_g .NewTextbox ();_db .Textbox .StyleAttr =_ee .String ("\u006d\u0073\u006f\u002ddi\u0072\u0065\u0063\u0074\u0069\u006f\u006e\u002d\u0061\u006c\u0074\u003a\u0061\u0075t\u006f");_gf .EG_ShapeElements =append (_gf .EG_ShapeElements ,_db );_gg :=_g .NewEG_ShapeElements ();_gg .ClientData =_ae .NewClientData ();_gg .ClientData .ObjectTypeAttr =_ae .ST_ObjectTypeNote ;_gg .ClientData .MoveWithCells =_d .ST_TrueFalseBlankT ;_gg .ClientData .SizeWithCells =_d .ST_TrueFalseBlankT ;_gg .ClientData .Anchor =_ee .String ("\u0031,\u0020\u0031\u0035\u002c\u0020\u0030\u002c\u0020\u0032\u002c\u00202\u002c\u0020\u0035\u0034\u002c\u0020\u0035\u002c\u0020\u0033");_gg .ClientData .AutoFill =_d .ST_TrueFalseBlankFalse ;_gg .ClientData .Row =_ee .Int64 (row );_gg .ClientData .Column =_ee .Int64 (col );_gf .EG_ShapeElements =append (_gf .EG_ShapeElements ,_gg );return _gf ;};func (_fe *Container )UnmarshalXML (d *_bg .Decoder ,start _bg .StartElement )error {_fe .Shape =nil ;_bgf :for {_ade ,_bf :=d .Token ();if _bf !=nil {return _bf ;};switch _af :=_ade .(type ){case _bg .StartElement :switch _af .Name .Local {case "s\u0068\u0061\u0070\u0065\u006c\u0061\u0079\u006f\u0075\u0074":_fe .Layout =_g .NewOfcShapelayout ();if _ea :=d .DecodeElement (_fe .Layout ,&_af );_ea !=nil {return _ea ;};case "\u0073h\u0061\u0070\u0065\u0074\u0079\u0070e":_fe .ShapeType =_g .NewShapetype ();if _aa :=d .DecodeElement (_fe .ShapeType ,&_af );_aa !=nil {return _aa ;};case "\u0073\u0068\u0061p\u0065":_bgd :=_g .NewShape ();if _ga :=d .DecodeElement (_bgd ,&_af );_ga !=nil {return _ga ;};_fe .Shape =append (_fe .Shape ,_bgd );};case _bg .EndElement :break _bgf ;};};return nil ;};func NewContainer ()*Container {return &Container {}};
// Width return width of shape.
func (_aaf *ShapeStyle )Width ()float64 {return _aaf ._ebd };
// TextpathStyle is style attribute of element v:textpath.
type TextpathStyle struct{_aebg string ;_bad int64 ;_egc bool ;_bfa bool ;};type Container struct{Layout *_g .OfcShapelayout ;ShapeType *_g .Shapetype ;Shape []*_g .Shape ;};
// FontSize returns fontSize of the text.
func (_caa *TextpathStyle )FontSize ()int64 {return _caa ._bad };
// ShapeStyle is style attribute of v:shape element.
type ShapeStyle struct{_adf string ;_ag float64 ;_ac float64 ;_aea float64 ;_ba float64 ;_bc float64 ;_gb float64 ;_ef float64 ;_fb float64 ;_ebd float64 ;_eg float64 ;_cfg int64 ;_gaf string ;_efg string ;_fc string ;_ggc string ;};
// Margins get margin top, left, bottom, and right of shape style.
func (_ce *ShapeStyle )Margins ()(float64 ,float64 ,float64 ,float64 ){return _ce ._ag ,_ce ._ac ,_ce ._aea ,_ce ._ba ;};
// IsItalic returns true if text is italic.
func (_dd *TextpathStyle )IsItalic ()bool {return _dd ._bfa };
// NewCommentDrawing constructs a new comment drawing.
func NewCommentDrawing ()*Container {_gc :=NewContainer ();_gc .Layout =_g .NewOfcShapelayout ();_gc .Layout .ExtAttr =_g .ST_ExtEdit ;_gc .Layout .Idmap =_g .NewOfcCT_IdMap ();_gc .Layout .Idmap .DataAttr =_ee .String ("\u0031");_gc .Layout .Idmap .ExtAttr =_g .ST_ExtEdit ;_gc .ShapeType =_g .NewShapetype ();_gc .ShapeType .IdAttr =_ee .String ("_\u0078\u0030\u0030\u0030\u0030\u005f\u0074\u0032\u0030\u0032");_gc .ShapeType .CoordsizeAttr =_ee .String ("2\u0031\u0036\u0030\u0030\u002c\u0032\u0031\u0036\u0030\u0030");_gc .ShapeType .SptAttr =_ee .Float32 (202);_gc .ShapeType .PathAttr =_ee .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");_c :=_g .NewEG_ShapeElements ();_gc .ShapeType .EG_ShapeElements =append (_gc .ShapeType .EG_ShapeElements ,_c );_c .Path =_g .NewPath ();_c .Path .GradientshapeokAttr =_d .ST_TrueFalseT ;_c .Path .ConnecttypeAttr =_g .OfcST_ConnectTypeRect ;return _gc ;};
// Position get position attribute of shape style.
func (_ge *ShapeStyle )Position ()string {return _ge ._adf };
// Height return height of shape.
func (_cbg *ShapeStyle )Height ()float64 {return _cbg ._eg };
// ToString generate string of TextpathStyle.
func (_gfd *TextpathStyle )String ()string {_cbc :="";_cbc +=_f .Sprintf ("\u0066o\u006et\u002d\u0066\u0061\u006d\u0069\u006c\u0079\u003a\u0025\u0073\u003b",_gfd ._aebg );_cbc +=_f .Sprintf ("\u0066o\u006et\u002d\u0073\u0069\u007a\u0065\u003a\u0025\u0064\u0070\u0074\u003b",_gfd ._bad );if _gfd ._bfa {_cbc +=_f .Sprintf ("\u0066o\u006et\u002d\u0073\u0074\u0079\u006ce\u003a\u0069t\u0061\u006c\u0069\u0063\u003b");};if _gfd ._egc {_cbc +=_f .Sprintf ("\u0066\u006f\u006e\u0074\u002d\u0077\u0065\u0069\u0067\u0068\u0074\u003ab\u006f\u006c\u0064\u003b");};return _cbc ;};const (ShapeStylePositionAbsolute ="\u0061\u0062\u0073\u006f\u006c\u0075\u0074\u0065";ShapeStylePositionRelative ="\u0072\u0065\u006c\u0061\u0074\u0069\u0076\u0065";);
// SetItalic sets text to italic.
func (_ead *TextpathStyle )SetItalic (italic bool ){_ead ._bfa =italic };
func NewCommentShape (col ,row int64 )*_ef .Shape {_g :=_ef .NewShape ();_g .IdAttr =_ag .String (_b .Sprintf ("\u0063\u0073\u005f\u0025\u0064\u005f\u0025\u0064",col ,row ));_g .TypeAttr =_ag .String ("\u0023\u005f\u00780\u0030\u0030\u0030\u005f\u0074\u0032\u0030\u0032");_g .StyleAttr =_ag .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");_g .FillcolorAttr =_ag .String ("\u0023f\u0062\u0066\u0036\u0064\u0036");_g .StrokecolorAttr =_ag .String ("\u0023e\u0064\u0065\u0061\u0061\u0031");_ed :=_ef .NewEG_ShapeElements ();_ed .Fill =_ef .NewFill ();_ed .Fill .Color2Attr =_ag .String ("\u0023f\u0062\u0066\u0065\u0038\u0032");_ed .Fill .AngleAttr =_ag .Float64 (-180);_ed .Fill .TypeAttr =_ef .ST_FillTypeGradient ;_ed .Fill .Fill =_ef .NewOfcFill ();_ed .Fill .Fill .ExtAttr =_ef .ST_ExtView ;_ed .Fill .Fill .TypeAttr =_ef .OfcST_FillTypeGradientUnscaled ;_g .EG_ShapeElements =append (_g .EG_ShapeElements ,_ed );_ea :=_ef .NewEG_ShapeElements ();_ea .Shadow =_ef .NewShadow ();_ea .Shadow .OnAttr =_bc .ST_TrueFalseT ;_ea .Shadow .ObscuredAttr =_bc .ST_TrueFalseT ;_g .EG_ShapeElements =append (_g .EG_ShapeElements ,_ea );_gd :=_ef .NewEG_ShapeElements ();_gd .Path =_ef .NewPath ();_gd .Path .ConnecttypeAttr =_ef .OfcST_ConnectTypeNone ;_g .EG_ShapeElements =append (_g .EG_ShapeElements ,_gd );_c :=_ef .NewEG_ShapeElements ();_c .Textbox =_ef .NewTextbox ();_c .Textbox .StyleAttr =_ag .String ("\u006d\u0073\u006f\u002ddi\u0072\u0065\u0063\u0074\u0069\u006f\u006e\u002d\u0061\u006c\u0074\u003a\u0061\u0075t\u006f");_g .EG_ShapeElements =append (_g .EG_ShapeElements ,_c );_gb :=_ef .NewEG_ShapeElements ();_gb .ClientData =_af .NewClientData ();_gb .ClientData .ObjectTypeAttr =_af .ST_ObjectTypeNote ;_gb .ClientData .MoveWithCells =_bc .ST_TrueFalseBlankT ;_gb .ClientData .SizeWithCells =_bc .ST_TrueFalseBlankT ;_gb .ClientData .Anchor =_ag .String ("\u0031,\u0020\u0031\u0035\u002c\u0020\u0030\u002c\u0020\u0032\u002c\u00202\u002c\u0020\u0035\u0034\u002c\u0020\u0035\u002c\u0020\u0033");_gb .ClientData .AutoFill =_bc .ST_TrueFalseBlankFalse ;_gb .ClientData .Row =_ag .Int64 (row );_gb .ClientData .Column =_ag .Int64 (col );_g .EG_ShapeElements =append (_g .EG_ShapeElements ,_gb );return _g ;};

View File

@ -9,7 +9,23 @@
// 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 (_dc "archive/zip";_fa "bytes";_a "encoding/xml";_db "fmt";_fc "github.com/unidoc/unioffice";_g "github.com/unidoc/unioffice/algo";_aa "github.com/unidoc/unioffice/common/tempstorage";_cb "github.com/unidoc/unioffice/schema/soo/pkg/relationships";_b "io";_c "path";_f "sort";_de "strings";_e "time";);
package zippkg ;import (_e "archive/zip";_cf "bytes";_dd "encoding/xml";_ca "fmt";_cfg "github.com/unidoc/unioffice";_ge "github.com/unidoc/unioffice/algo";_cfa "github.com/unidoc/unioffice/common/tempstorage";_g "github.com/unidoc/unioffice/schema/soo/pkg/relationships";_b "io";_ee "path";_cd "sort";_c "strings";_f "time";);
// SelfClosingWriter wraps a writer and replaces XML tags of the
// type <foo></foo> with <foo/>
type SelfClosingWriter struct{W _b .Writer ;};func MarshalXMLByType (z *_e .Writer ,dt _cfg .DocType ,typ string ,v interface{})error {_gfd :=_cfg .AbsoluteFilename (dt ,typ ,0);return MarshalXML (z ,_gfd ,v );};func MarshalXMLByTypeIndex (z *_e .Writer ,dt _cfg .DocType ,typ string ,idx int ,v interface{})error {_gf :=_cfg .AbsoluteFilename (dt ,typ ,idx );return MarshalXML (z ,_gf ,v );};func (_df *DecodeMap )IndexFor (path string )int {return _df ._db [path ]};var _bbc =[]byte {'\r','\n'};
// 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 *_e .Writer ,zipPath ,storagePath string )error {_bdc ,_dca :=z .Create (zipPath );if _dca !=nil {return _ca .Errorf ("e\u0072\u0072\u006f\u0072 c\u0072e\u0061\u0074\u0069\u006e\u0067 \u0025\u0073\u003a\u0020\u0025\u0073",zipPath ,_dca );};_ac ,_dca :=_cfa .Open (storagePath );if _dca !=nil {return _ca .Errorf ("e\u0072r\u006f\u0072\u0020\u006f\u0070\u0065\u006e\u0069n\u0067\u0020\u0025\u0073: \u0025\u0073",storagePath ,_dca );};defer _ac .Close ();_ ,_dca =_b .Copy (_bdc ,_ac );return _dca ;};
// RelationsPathFor returns the relations path for a given filename.
func RelationsPathFor (path string )string {_dcf :=_c .Split (path ,"\u002f");_cg :=_c .Join (_dcf [0:len (_dcf )-1],"\u002f");_cea :=_dcf [len (_dcf )-1];_cg +="\u002f_\u0072\u0065\u006c\u0073\u002f";_cea +="\u002e\u0072\u0065l\u0073";return _cg +_cea ;};
// ExtractToDiskTmp extracts a zip file to a temporary file in a given path,
// returning the name of the file.
func ExtractToDiskTmp (f *_e .File ,path string )(string ,error ){_ffg ,_agdf :=_cfa .TempFile (path ,"\u007a\u007a");if _agdf !=nil {return "",_agdf ;};defer _ffg .Close ();_cef ,_agdf :=f .Open ();if _agdf !=nil {return "",_agdf ;};defer _cef .Close ();_ ,_agdf =_b .Copy (_ffg ,_cef );if _agdf !=nil {return "",_agdf ;};return _ffg .Name (),nil ;};func (_ab *DecodeMap )RecordIndex (path string ,idx int ){_ab ._db [path ]=idx };
// OnNewRelationshipFunc is called when a new relationship has been discovered.
//
@ -23,48 +39,32 @@ package zippkg ;import (_dc "archive/zip";_fa "bytes";_a "encoding/xml";_db "fmt
// 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 (_deg *DecodeMap ,_ga ,_cc string ,_fd []*_dc .File ,_ee *_cb .Relationship ,_bd Target )error ;func (_gfe *DecodeMap )RecordIndex (path string ,idx int ){_gfe ._dcg [path ]=idx };
// ExtractToDiskTmp extracts a zip file to a temporary file in a given path,
// returning the name of the file.
func ExtractToDiskTmp (f *_dc .File ,path string )(string ,error ){_ggg ,_afe :=_aa .TempFile (path ,"\u007a\u007a");if _afe !=nil {return "",_afe ;};defer _ggg .Close ();_eea ,_afe :=f .Open ();if _afe !=nil {return "",_afe ;};defer _eea .Close ();_ ,_afe =_b .Copy (_ggg ,_eea );if _afe !=nil {return "",_afe ;};return _ggg .Name (),nil ;};
// Decode unmarshals the content of a *zip.File as XML to a given destination.
func Decode (f *_dc .File ,dest interface{})error {_gag ,_af :=f .Open ();if _af !=nil {return _db .Errorf ("e\u0072r\u006f\u0072\u0020\u0072\u0065\u0061\u0064\u0069n\u0067\u0020\u0025\u0073: \u0025\u0073",f .Name ,_af );};defer _gag .Close ();_baa :=_a .NewDecoder (_gag );if _ffd :=_baa .Decode (dest );_ffd !=nil {return _db .Errorf ("e\u0072\u0072\u006f\u0072 d\u0065c\u006f\u0064\u0069\u006e\u0067 \u0025\u0073\u003a\u0020\u0025\u0073",f .Name ,_ffd );};if _dd ,_ccc :=dest .(*_cb .Relationships );_ccc {for _ffdb ,_cbg :=range _dd .Relationship {switch _cbg .TypeAttr {case _fc .OfficeDocumentTypeStrict :_dd .Relationship [_ffdb ].TypeAttr =_fc .OfficeDocumentType ;case _fc .StylesTypeStrict :_dd .Relationship [_ffdb ].TypeAttr =_fc .StylesType ;case _fc .ThemeTypeStrict :_dd .Relationship [_ffdb ].TypeAttr =_fc .ThemeType ;case _fc .ControlTypeStrict :_dd .Relationship [_ffdb ].TypeAttr =_fc .ControlType ;case _fc .SettingsTypeStrict :_dd .Relationship [_ffdb ].TypeAttr =_fc .SettingsType ;case _fc .ImageTypeStrict :_dd .Relationship [_ffdb ].TypeAttr =_fc .ImageType ;case _fc .CommentsTypeStrict :_dd .Relationship [_ffdb ].TypeAttr =_fc .CommentsType ;case _fc .ThumbnailTypeStrict :_dd .Relationship [_ffdb ].TypeAttr =_fc .ThumbnailType ;case _fc .DrawingTypeStrict :_dd .Relationship [_ffdb ].TypeAttr =_fc .DrawingType ;case _fc .ChartTypeStrict :_dd .Relationship [_ffdb ].TypeAttr =_fc .ChartType ;case _fc .ExtendedPropertiesTypeStrict :_dd .Relationship [_ffdb ].TypeAttr =_fc .ExtendedPropertiesType ;case _fc .CustomXMLTypeStrict :_dd .Relationship [_ffdb ].TypeAttr =_fc .CustomXMLType ;case _fc .WorksheetTypeStrict :_dd .Relationship [_ffdb ].TypeAttr =_fc .WorksheetType ;case _fc .SharedStringsTypeStrict :_dd .Relationship [_ffdb ].TypeAttr =_fc .SharedStringsType ;case _fc .TableTypeStrict :_dd .Relationship [_ffdb ].TypeAttr =_fc .TableType ;case _fc .HeaderTypeStrict :_dd .Relationship [_ffdb ].TypeAttr =_fc .HeaderType ;case _fc .FooterTypeStrict :_dd .Relationship [_ffdb ].TypeAttr =_fc .FooterType ;case _fc .NumberingTypeStrict :_dd .Relationship [_ffdb ].TypeAttr =_fc .NumberingType ;case _fc .FontTableTypeStrict :_dd .Relationship [_ffdb ].TypeAttr =_fc .FontTableType ;case _fc .WebSettingsTypeStrict :_dd .Relationship [_ffdb ].TypeAttr =_fc .WebSettingsType ;case _fc .FootNotesTypeStrict :_dd .Relationship [_ffdb ].TypeAttr =_fc .FootNotesType ;case _fc .EndNotesTypeStrict :_dd .Relationship [_ffdb ].TypeAttr =_fc .EndNotesType ;case _fc .SlideTypeStrict :_dd .Relationship [_ffdb ].TypeAttr =_fc .SlideType ;case _fc .VMLDrawingTypeStrict :_dd .Relationship [_ffdb ].TypeAttr =_fc .VMLDrawingType ;};};_f .Slice (_dd .Relationship ,func (_eae ,_ag int )bool {_ab :=_dd .Relationship [_eae ];_gd :=_dd .Relationship [_ag ];return _g .NaturalLess (_ab .IdAttr ,_gd .IdAttr );});};return nil ;};var _fe =[]byte {'\r','\n'};
type OnNewRelationshipFunc func (_ga *DecodeMap ,_eeb ,_fe string ,_gea []*_e .File ,_cb *_g .Relationship ,_gg Target )error ;
// MarshalXML creates a file inside of a zip and marshals an object as xml, prefixing it
// with a standard XML header.
func MarshalXML (z *_dc .Writer ,filename string ,v interface{})error {_ca :=&_dc .FileHeader {};_ca .Method =_dc .Deflate ;_ca .Name =filename ;_ca .SetModTime (_e .Now ());_aea ,_dad :=z .CreateHeader (_ca );if _dad !=nil {return _db .Errorf ("\u0063\u0072\u0065\u0061ti\u006e\u0067\u0020\u0025\u0073\u0020\u0069\u006e\u0020\u007a\u0069\u0070\u003a\u0020%\u0073",filename ,_dad );};_ ,_dad =_aea .Write ([]byte (XMLHeader ));if _dad !=nil {return _db .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 ,_dad );};if _dad =_a .NewEncoder (SelfClosingWriter {_aea }).Encode (v );_dad !=nil {return _db .Errorf ("\u006d\u0061\u0072\u0073\u0068\u0061\u006c\u0069\u006e\u0067\u0020\u0025s\u003a\u0020\u0025\u0073",filename ,_dad );};_ ,_dad =_aea .Write (_fe );return _dad ;};type Target struct{Path string ;Typ string ;Ifc interface{};Index uint32 ;};
func MarshalXML (z *_e .Writer ,filename string ,v interface{})error {_ada :=&_e .FileHeader {};_ada .Method =_e .Deflate ;_ada .Name =filename ;_ada .SetModTime (_f .Now ());_ffb ,_aag :=z .CreateHeader (_ada );if _aag !=nil {return _ca .Errorf ("\u0063\u0072\u0065\u0061ti\u006e\u0067\u0020\u0025\u0073\u0020\u0069\u006e\u0020\u007a\u0069\u0070\u003a\u0020%\u0073",filename ,_aag );};_ ,_aag =_ffb .Write ([]byte (XMLHeader ));if _aag !=nil {return _ca .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 ,_aag );};if _aag =_dd .NewEncoder (SelfClosingWriter {_ffb }).Encode (v );_aag !=nil {return _ca .Errorf ("\u006d\u0061\u0072\u0073\u0068\u0061\u006c\u0069\u006e\u0067\u0020\u0025s\u003a\u0020\u0025\u0073",filename ,_aag );};_ ,_aag =_ffb .Write (_bbc );return _aag ;};
// 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 (_ea *DecodeMap )AddTarget (filePath string ,ifc interface{},sourceFileType string ,idx uint32 )bool {if _ea ._ba ==nil {_ea ._ba =make (map[string ]Target );_ea ._eb =make (map[*_cb .Relationships ]string );_ea ._ded =make (map[string ]struct{});_ea ._dcg =make (map[string ]int );};_bdf :=_c .Clean (filePath );if _ ,_bg :=_ea ._ded [_bdf ];_bg {return false ;};_ea ._ded [_bdf ]=struct{}{};_ea ._ba [_bdf ]=Target {Path :filePath ,Typ :sourceFileType ,Ifc :ifc ,Index :idx };return true ;};func (_ceg *DecodeMap )IndexFor (path string )int {return _ceg ._dcg [path ]};
// AddFileFromBytes takes a byte array and adds it at a given path to a zip file.
func AddFileFromBytes (z *_dc .Writer ,zipPath string ,data []byte )error {_bcd ,_aag :=z .Create (zipPath );if _aag !=nil {return _db .Errorf ("e\u0072\u0072\u006f\u0072 c\u0072e\u0061\u0074\u0069\u006e\u0067 \u0025\u0073\u003a\u0020\u0025\u0073",zipPath ,_aag );};_ ,_aag =_b .Copy (_bcd ,_fa .NewReader (data ));return _aag ;};
// RelationsPathFor returns the relations path for a given filename.
func RelationsPathFor (path string )string {_eba :=_de .Split (path ,"\u002f");_daf :=_de .Join (_eba [0:len (_eba )-1],"\u002f");_fdb :=_eba [len (_eba )-1];_daf +="\u002f_\u0072\u0065\u006c\u0073\u002f";_fdb +="\u002e\u0072\u0065l\u0073";return _daf +_fdb ;};
// 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 *_dc .Writer ,zipPath ,storagePath string )error {_fb ,_bac :=z .Create (zipPath );if _bac !=nil {return _db .Errorf ("e\u0072\u0072\u006f\u0072 c\u0072e\u0061\u0074\u0069\u006e\u0067 \u0025\u0073\u003a\u0020\u0025\u0073",zipPath ,_bac );};_ead ,_bac :=_aa .Open (storagePath );if _bac !=nil {return _db .Errorf ("e\u0072r\u006f\u0072\u0020\u006f\u0070\u0065\u006e\u0069n\u0067\u0020\u0025\u0073: \u0025\u0073",storagePath ,_bac );};defer _ead .Close ();_ ,_bac =_b .Copy (_fb ,_ead );return _bac ;};
// SetOnNewRelationshipFunc sets the function to be called when a new
// relationship has been discovered.
func (_gf *DecodeMap )SetOnNewRelationshipFunc (fn OnNewRelationshipFunc ){_gf ._ff =fn };
// SelfClosingWriter wraps a writer and replaces XML tags of the
// type <foo></foo> with <foo/>
type SelfClosingWriter struct{W _b .Writer ;};
// Decode loops decoding targets registered with AddTarget and calling th
func (_da *DecodeMap )Decode (files []*_dc .File )error {_bf :=1;for _bf > 0{for len (_da ._fae )> 0{_ccf :=_da ._fae [0];_da ._fae =_da ._fae [1:];_be :=_ccf .Ifc .(*_cb .Relationships );for _ ,_ae :=range _be .Relationship {_bc ,_ :=_da ._eb [_be ];_da ._ff (_da ,_bc +_ae .TargetAttr ,_ae .TypeAttr ,files ,_ae ,_ccf );};};for _dcgf ,_gg :=range files {if _gg ==nil {continue ;};if _bgd ,_ccb :=_da ._ba [_gg .Name ];_ccb {delete (_da ._ba ,_gg .Name );if _dcc :=Decode (_gg ,_bgd .Ifc );_dcc !=nil {return _dcc ;};files [_dcgf ]=nil ;if _bde ,_cbd :=_bgd .Ifc .(*_cb .Relationships );_cbd {_da ._fae =append (_da ._fae ,_bgd );_cbf ,_ :=_c .Split (_c .Clean (_gg .Name +"\u002f\u002e\u002e\u002f"));_da ._eb [_bde ]=_cbf ;_bf ++;};};};_bf --;};return nil ;};var _abc =[]byte {'/','>'};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";func MarshalXMLByTypeIndex (z *_dc .Writer ,dt _fc .DocType ,typ string ,idx int ,v interface{})error {_dae :=_fc .AbsoluteFilename (dt ,typ ,idx );return MarshalXML (z ,_dae ,v );};
func (_gb *DecodeMap )AddTarget (filePath string ,ifc interface{},sourceFileType string ,idx uint32 )bool {if _gb ._ed ==nil {_gb ._ed =make (map[string ]Target );_gb ._a =make (map[*_g .Relationships ]string );_gb ._gc =make (map[string ]struct{});_gb ._db =make (map[string ]int );};_gd :=_ee .Clean (filePath );if _ ,_af :=_gb ._gc [_gd ];_af {return false ;};_gb ._gc [_gd ]=struct{}{};_gb ._ed [_gd ]=Target {Path :filePath ,Typ :sourceFileType ,Ifc :ifc ,Index :idx };return true ;};
// DecodeMap is used to walk a tree of relationships, decoding files and passing
// control back to the document.
type DecodeMap struct{_ba map[string ]Target ;_eb map[*_cb .Relationships ]string ;_fae []Target ;_ff OnNewRelationshipFunc ;_ded map[string ]struct{};_dcg map[string ]int ;};func MarshalXMLByType (z *_dc .Writer ,dt _fc .DocType ,typ string ,v interface{})error {_cg :=_fc .AbsoluteFilename (dt ,typ ,0);return MarshalXML (z ,_cg ,v );};func (_fde SelfClosingWriter )Write (b []byte )(int ,error ){_fdbe :=0;_gdc :=0;for _eed :=0;_eed < len (b )-2;_eed ++{if b [_eed ]=='>'&&b [_eed +1]=='<'&&b [_eed +2]=='/'{_fdef :=[]byte {};_bcfg :=_eed ;for _gbe :=_eed ;_gbe >=0;_gbe --{if b [_gbe ]==' '{_bcfg =_gbe ;}else if b [_gbe ]=='<'{_fdef =b [_gbe +1:_bcfg ];break ;};};_aab :=[]byte {};for _ebf :=_eed +3;_ebf < len (b );_ebf ++{if b [_ebf ]=='>'{_aab =b [_eed +3:_ebf ];break ;};};if !_fa .Equal (_fdef ,_aab ){continue ;};_fbe ,_ced :=_fde .W .Write (b [_fdbe :_eed ]);if _ced !=nil {return _gdc +_fbe ,_ced ;};_gdc +=_fbe ;_ ,_ced =_fde .W .Write (_abc );if _ced !=nil {return _gdc ,_ced ;};_gdc +=3;for _gac :=_eed +2;_gac < len (b )&&b [_gac ]!='>';_gac ++{_gdc ++;_fdbe =_gac +2;_eed =_fdbe ;};};};_dg ,_abg :=_fde .W .Write (b [_fdbe :]);return _dg +_gdc ,_abg ;};
type DecodeMap struct{_ed map[string ]Target ;_a map[*_g .Relationships ]string ;_bd []Target ;_ggb OnNewRelationshipFunc ;_gc map[string ]struct{};_db map[string ]int ;};var _cae =[]byte {'/','>'};
// Decode unmarshals the content of a *zip.File as XML to a given destination.
func Decode (f *_e .File ,dest interface{})error {_ff ,_aa :=f .Open ();if _aa !=nil {return _ca .Errorf ("e\u0072r\u006f\u0072\u0020\u0072\u0065\u0061\u0064\u0069n\u0067\u0020\u0025\u0073: \u0025\u0073",f .Name ,_aa );};defer _ff .Close ();_agd :=_dd .NewDecoder (_ff );if _dg :=_agd .Decode (dest );_dg !=nil {return _ca .Errorf ("e\u0072\u0072\u006f\u0072 d\u0065c\u006f\u0064\u0069\u006e\u0067 \u0025\u0073\u003a\u0020\u0025\u0073",f .Name ,_dg );};if _gdd ,_ddc :=dest .(*_g .Relationships );_ddc {for _fde ,_ae :=range _gdd .Relationship {switch _ae .TypeAttr {case _cfg .OfficeDocumentTypeStrict :_gdd .Relationship [_fde ].TypeAttr =_cfg .OfficeDocumentType ;case _cfg .StylesTypeStrict :_gdd .Relationship [_fde ].TypeAttr =_cfg .StylesType ;case _cfg .ThemeTypeStrict :_gdd .Relationship [_fde ].TypeAttr =_cfg .ThemeType ;case _cfg .ControlTypeStrict :_gdd .Relationship [_fde ].TypeAttr =_cfg .ControlType ;case _cfg .SettingsTypeStrict :_gdd .Relationship [_fde ].TypeAttr =_cfg .SettingsType ;case _cfg .ImageTypeStrict :_gdd .Relationship [_fde ].TypeAttr =_cfg .ImageType ;case _cfg .CommentsTypeStrict :_gdd .Relationship [_fde ].TypeAttr =_cfg .CommentsType ;case _cfg .ThumbnailTypeStrict :_gdd .Relationship [_fde ].TypeAttr =_cfg .ThumbnailType ;case _cfg .DrawingTypeStrict :_gdd .Relationship [_fde ].TypeAttr =_cfg .DrawingType ;case _cfg .ChartTypeStrict :_gdd .Relationship [_fde ].TypeAttr =_cfg .ChartType ;case _cfg .ExtendedPropertiesTypeStrict :_gdd .Relationship [_fde ].TypeAttr =_cfg .ExtendedPropertiesType ;case _cfg .CustomXMLTypeStrict :_gdd .Relationship [_fde ].TypeAttr =_cfg .CustomXMLType ;case _cfg .WorksheetTypeStrict :_gdd .Relationship [_fde ].TypeAttr =_cfg .WorksheetType ;case _cfg .SharedStringsTypeStrict :_gdd .Relationship [_fde ].TypeAttr =_cfg .SharedStringsType ;case _cfg .TableTypeStrict :_gdd .Relationship [_fde ].TypeAttr =_cfg .TableType ;case _cfg .HeaderTypeStrict :_gdd .Relationship [_fde ].TypeAttr =_cfg .HeaderType ;case _cfg .FooterTypeStrict :_gdd .Relationship [_fde ].TypeAttr =_cfg .FooterType ;case _cfg .NumberingTypeStrict :_gdd .Relationship [_fde ].TypeAttr =_cfg .NumberingType ;case _cfg .FontTableTypeStrict :_gdd .Relationship [_fde ].TypeAttr =_cfg .FontTableType ;case _cfg .WebSettingsTypeStrict :_gdd .Relationship [_fde ].TypeAttr =_cfg .WebSettingsType ;case _cfg .FootNotesTypeStrict :_gdd .Relationship [_fde ].TypeAttr =_cfg .FootNotesType ;case _cfg .EndNotesTypeStrict :_gdd .Relationship [_fde ].TypeAttr =_cfg .EndNotesType ;case _cfg .SlideTypeStrict :_gdd .Relationship [_fde ].TypeAttr =_cfg .SlideType ;case _cfg .VMLDrawingTypeStrict :_gdd .Relationship [_fde ].TypeAttr =_cfg .VMLDrawingType ;};};_cd .Slice (_gdd .Relationship ,func (_ebc ,_ad int )bool {_dda :=_gdd .Relationship [_ebc ];_ddd :=_gdd .Relationship [_ad ];return _ge .NaturalLess (_dda .IdAttr ,_ddd .IdAttr );});};return nil ;};
// SetOnNewRelationshipFunc sets the function to be called when a new
// relationship has been discovered.
func (_dbd *DecodeMap )SetOnNewRelationshipFunc (fn OnNewRelationshipFunc ){_dbd ._ggb =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";type Target struct{Path string ;Typ string ;Ifc interface{};Index uint32 ;};func (_ddde SelfClosingWriter )Write (b []byte )(int ,error ){_gfe :=0;_dfc :=0;for _ede :=0;_ede < len (b )-2;_ede ++{if b [_ede ]=='>'&&b [_ede +1]=='<'&&b [_ede +2]=='/'{_cdeg :=[]byte {};_cc :=_ede ;for _afg :=_ede ;_afg >=0;_afg --{if b [_afg ]==' '{_cc =_afg ;}else if b [_afg ]=='<'{_cdeg =b [_afg +1:_cc ];break ;};};_adf :=[]byte {};for _ced :=_ede +3;_ced < len (b );_ced ++{if b [_ced ]=='>'{_adf =b [_ede +3:_ced ];break ;};};if !_cf .Equal (_cdeg ,_adf ){continue ;};_aab ,_eede :=_ddde .W .Write (b [_gfe :_ede ]);if _eede !=nil {return _dfc +_aab ,_eede ;};_dfc +=_aab ;_ ,_eede =_ddde .W .Write (_cae );if _eede !=nil {return _dfc ,_eede ;};_dfc +=3;for _dbc :=_ede +2;_dbc < len (b )&&b [_dbc ]!='>';_dbc ++{_dfc ++;_gfe =_dbc +2;_ede =_gfe ;};};};_gfdf ,_dfe :=_ddde .W .Write (b [_gfe :]);return _gfdf +_dfc ,_dfe ;};
// AddFileFromBytes takes a byte array and adds it at a given path to a zip file.
func AddFileFromBytes (z *_e .Writer ,zipPath string ,data []byte )error {_bca ,_fcb :=z .Create (zipPath );if _fcb !=nil {return _ca .Errorf ("e\u0072\u0072\u006f\u0072 c\u0072e\u0061\u0074\u0069\u006e\u0067 \u0025\u0073\u003a\u0020\u0025\u0073",zipPath ,_fcb );};_ ,_fcb =_b .Copy (_bca ,_cf .NewReader (data ));return _fcb ;};
// Decode loops decoding targets registered with AddTarget and calling th
func (_cde *DecodeMap )Decode (files []*_e .File )error {_bb :=1;for _bb > 0{for len (_cde ._bd )> 0{_dbda :=_cde ._bd [0];_cde ._bd =_cde ._bd [1:];_bde :=_dbda .Ifc .(*_g .Relationships );for _ ,_dbdf :=range _bde .Relationship {_eb ,_ :=_cde ._a [_bde ];_cde ._ggb (_cde ,_eb +_dbdf .TargetAttr ,_dbdf .TypeAttr ,files ,_dbdf ,_dbda );};};for _dfb ,_fb :=range files {if _fb ==nil {continue ;};if _afd ,_ce :=_cde ._ed [_fb .Name ];_ce {delete (_cde ._ed ,_fb .Name );if _fcd :=Decode (_fb ,_afd .Ifc );_fcd !=nil {return _fcd ;};files [_dfb ]=nil ;if _geaa ,_ea :=_afd .Ifc .(*_g .Relationships );_ea {_cde ._bd =append (_cde ._bd ,_afd );_dc ,_ :=_ee .Split (_ee .Clean (_fb .Name +"\u002f\u002e\u002e\u002f"));_cde ._a [_geaa ]=_dc ;_bb ++;};};};_bb --;};return nil ;};