mirror of
https://github.com/unidoc/unioffice.git
synced 2025-04-25 13:48:53 +08:00
Merge pull request #490 from unidoc-build/prep-rc-v1.25.0
Prepare Release v1.25.0
This commit is contained in:
commit
b1a55b4e68
@ -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 _f "strconv";func RepeatString (s string ,cnt int )string {if cnt <=0{return "";};_ffg :=make ([]byte ,len (s )*cnt );_gbf :=[]byte (s );for _c :=0;_c < cnt ;_c ++{copy (_ffg [_c :],_gbf );};return string (_ffg );};func _g (_ff byte )bool {return _ff >='0'&&_ff <='9'};
|
||||
package algo ;import _a "strconv";func RepeatString (s string ,cnt int )string {if cnt <=0{return "";};_aa :=make ([]byte ,len (s )*cnt );_ae :=[]byte (s );for _eb :=0;_eb < cnt ;_eb ++{copy (_aa [_eb :],_ae );};return string (_aa );};func _da (_f byte )bool {return _f >='0'&&_f <='9'};
|
||||
|
||||
// NaturalLess compares two strings in a human manner so rId2 sorts less than rId10
|
||||
func NaturalLess (lhs ,rhs string )bool {_d ,_dc :=0,0;for _d < len (lhs )&&_dc < len (rhs ){_dg :=lhs [_d ];_db :=rhs [_dc ];_fg :=_g (_dg );_gb :=_g (_db );switch {case _fg &&!_gb :return true ;case !_fg &&_gb :return false ;case !_fg &&!_gb :if _dg !=_db {return _dg < _db ;};_d ++;_dc ++;default:_e :=_d +1;_b :=_dc +1;for _e < len (lhs )&&_g (lhs [_e ]){_e ++;};for _b < len (rhs )&&_g (rhs [_b ]){_b ++;};_bb ,_ :=_f .ParseUint (lhs [_d :_e ],10,64);_bg ,_ :=_f .ParseUint (rhs [_d :_b ],10,64);if _bb !=_bg {return _bb < _bg ;};_d =_e ;_dc =_b ;};};return len (lhs )< len (rhs );};
|
||||
func NaturalLess (lhs ,rhs string )bool {_daa ,_c :=0,0;for _daa < len (lhs )&&_c < len (rhs ){_dg :=lhs [_daa ];_fa :=rhs [_c ];_fac :=_da (_dg );_ag :=_da (_fa );switch {case _fac &&!_ag :return true ;case !_fac &&_ag :return false ;case !_fac &&!_ag :if _dg !=_fa {return _dg < _fa ;};_daa ++;_c ++;default:_e :=_daa +1;_de :=_c +1;for _e < len (lhs )&&_da (lhs [_e ]){_e ++;};for _de < len (rhs )&&_da (rhs [_de ]){_de ++;};_deg ,_ :=_a .ParseUint (lhs [_daa :_e ],10,64);_b ,_ :=_a .ParseUint (rhs [_daa :_de ],10,64);if _deg !=_b {return _deg < _b ;};_daa =_e ;_c =_de ;};};return len (lhs )< len (rhs );};
|
922
chart/chart.go
922
chart/chart.go
@ -9,523 +9,523 @@
|
||||
// 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 chart ;import (_cb "fmt";_cf "github.com/unidoc/unioffice";_cg "github.com/unidoc/unioffice/color";_f "github.com/unidoc/unioffice/drawing";_g "github.com/unidoc/unioffice/measurement";_d "github.com/unidoc/unioffice/schema/soo/dml";_a "github.com/unidoc/unioffice/schema/soo/dml/chart";_ad "math/rand";);
|
||||
|
||||
// InitializeDefaults the Bubble chart to its defaults
|
||||
func (_cda BubbleChart )InitializeDefaults (){};
|
||||
|
||||
// AddSeries adds a default series to a Scatter chart.
|
||||
func (_fbbe ScatterChart )AddSeries ()ScatterChartSeries {_baggg :=_fbbe .nextColor (len (_fbbe ._dcgf .Ser ));_bbb :=_a .NewCT_ScatterSer ();_fbbe ._dcgf .Ser =append (_fbbe ._dcgf .Ser ,_bbb );_bbb .Idx .ValAttr =uint32 (len (_fbbe ._dcgf .Ser )-1);_bbb .Order .ValAttr =uint32 (len (_fbbe ._dcgf .Ser )-1);_abb :=ScatterChartSeries {_bbb };_abb .InitializeDefaults ();_abb .Marker ().Properties ().LineProperties ().SetSolidFill (_baggg );_abb .Marker ().Properties ().SetSolidFill (_baggg );return _abb ;};func (_efac DataLabels )ensureChoice (){if _efac ._dca .Choice ==nil {_efac ._dca .Choice =_a .NewCT_DLblsChoice ();};};
|
||||
|
||||
// Properties returns the chart's shape properties.
|
||||
func (_eed Chart )Properties ()_f .ShapeProperties {if _eed ._egg .SpPr ==nil {_eed ._egg .SpPr =_d .NewCT_ShapeProperties ();};return _f .MakeShapeProperties (_eed ._egg .SpPr );};type Title struct{_dcgg *_a .CT_Title };
|
||||
|
||||
// AddSeries adds a default series to a line chart.
|
||||
func (_dcff Line3DChart )AddSeries ()LineChartSeries {_acca :=_dcff .nextColor (len (_dcff ._fdg .Ser ));_aec :=_a .NewCT_LineSer ();_dcff ._fdg .Ser =append (_dcff ._fdg .Ser ,_aec );_aec .Idx .ValAttr =uint32 (len (_dcff ._fdg .Ser )-1);_aec .Order .ValAttr =uint32 (len (_dcff ._fdg .Ser )-1);_gad :=LineChartSeries {_aec };_gad .InitializeDefaults ();_gad .Properties ().LineProperties ().SetSolidFill (_acca );_gad .Properties ().SetSolidFill (_acca );return _gad ;};
|
||||
package chart ;import (_b "fmt";_f "github.com/unidoc/unioffice";_ad "github.com/unidoc/unioffice/color";_e "github.com/unidoc/unioffice/drawing";_cg "github.com/unidoc/unioffice/measurement";_d "github.com/unidoc/unioffice/schema/soo/dml";_c "github.com/unidoc/unioffice/schema/soo/dml/chart";_a "math/rand";);
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_bbad LineChart )X ()*_a .CT_LineChart {return _bbad ._acd };type LineChart struct{chartBase ;_acd *_a .CT_LineChart ;};
|
||||
func (_db Area3DChart )X ()*_c .CT_Area3DChart {return _db ._bc };func (_ccg CategoryAxis )AxisID ()uint32 {return _ccg ._bfb .AxId .ValAttr };type CategoryAxis struct{_bfb *_c .CT_CatAx };
|
||||
|
||||
// AddSeries adds a default series to an Doughnut chart.
|
||||
func (_cee DoughnutChart )AddSeries ()PieChartSeries {_daa :=_a .NewCT_PieSer ();_cee ._dcf .Ser =append (_cee ._dcf .Ser ,_daa );_daa .Idx .ValAttr =uint32 (len (_cee ._dcf .Ser )-1);_daa .Order .ValAttr =uint32 (len (_cee ._dcf .Ser )-1);_fcf :=PieChartSeries {_daa };_fcf .InitializeDefaults ();return _fcf ;};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_gbeb BubbleChart )X ()*_a .CT_BubbleChart {return _gbeb ._aga };func (_cdad GridLines )Properties ()_f .ShapeProperties {if _cdad ._dgc .SpPr ==nil {_cdad ._dgc .SpPr =_d .NewCT_ShapeProperties ();};return _f .MakeShapeProperties (_cdad ._dgc .SpPr );};
|
||||
|
||||
// PieChart is a Pie chart.
|
||||
type PieChart struct{chartBase ;_ddg *_a .CT_PieChart ;};func (_dcee LineChartSeries )SetSmooth (b bool ){_dcee ._aabc .Smooth =_a .NewCT_Boolean ();_dcee ._aabc .Smooth .ValAttr =&b ;};func MakeNumberDataSource (x *_a .CT_NumDataSource )NumberDataSource {return NumberDataSource {x }};
|
||||
|
||||
// AddAxis adds an axis to a line chart.
|
||||
func (_bfb LineChart )AddAxis (axis Axis ){_ge :=_a .NewCT_UnsignedInt ();_ge .ValAttr =axis .AxisID ();_bfb ._acd .AxId =append (_bfb ._acd .AxId ,_ge );};
|
||||
|
||||
// InitializeDefaults the bar chart to its defaults
|
||||
func (_df AreaChart )InitializeDefaults (){};
|
||||
|
||||
// SetValues sets values directly on a source.
|
||||
func (_efb NumberDataSource )SetValues (v []float64 ){_efb .ensureChoice ();_efb ._edd .Choice .NumRef =nil ;_efb ._edd .Choice .NumLit =_a .NewCT_NumData ();_efb ._edd .Choice .NumLit .PtCount =_a .NewCT_UnsignedInt ();_efb ._edd .Choice .NumLit .PtCount .ValAttr =uint32 (len (v ));for _aecg ,_gabf :=range v {_efb ._edd .Choice .NumLit .Pt =append (_efb ._edd .Choice .NumLit .Pt ,&_a .CT_NumVal {IdxAttr :uint32 (_aecg ),V :_cb .Sprintf ("\u0025\u0067",_gabf )});};};
|
||||
|
||||
// ScatterChartSeries is the data series for a scatter chart.
|
||||
type ScatterChartSeries struct{_fdd *_a .CT_ScatterSer };func (_fae Surface3DChart )InitializeDefaults (){_fae ._bfcb .Wireframe =_a .NewCT_Boolean ();_fae ._bfcb .Wireframe .ValAttr =_cf .Bool (false );_fae ._bfcb .BandFmts =_a .NewCT_BandFmts ();for _eff :=0;_eff < 15;_eff ++{_bcb :=_a .NewCT_BandFmt ();_bcb .Idx .ValAttr =uint32 (_eff );_bcb .SpPr =_d .NewCT_ShapeProperties ();_cgca :=_f .MakeShapeProperties (_bcb .SpPr );_cgca .SetSolidFill (_fae .nextColor (_eff ));_fae ._bfcb .BandFmts .BandFmt =append (_fae ._bfcb .BandFmts .BandFmt ,_bcb );};};func (_agf DataLabels )SetShowCategoryName (b bool ){_agf .ensureChoice ();_agf ._dca .Choice .ShowCatName =_a .NewCT_Boolean ();_agf ._dca .Choice .ShowCatName .ValAttr =_cf .Bool (b );};func (_gade ScatterChart )InitializeDefaults (){_gade ._dcgf .ScatterStyle .ValAttr =_a .ST_ScatterStyleMarker ;};
|
||||
|
||||
// AddSeries adds a default series to a Stock chart.
|
||||
func (_cgbfb StockChart )AddSeries ()LineChartSeries {_dec :=_a .NewCT_LineSer ();_cgbfb ._addb .Ser =append (_cgbfb ._addb .Ser ,_dec );_dec .Idx .ValAttr =uint32 (len (_cgbfb ._addb .Ser )-1);_dec .Order .ValAttr =uint32 (len (_cgbfb ._addb .Ser )-1);_aacb :=LineChartSeries {_dec };_aacb .Values ().CreateEmptyNumberCache ();_aacb .Properties ().LineProperties ().SetNoFill ();return _aacb ;};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_bba DateAxis )X ()*_a .CT_DateAx {return _bba ._adef };
|
||||
|
||||
// SetDirection changes the direction of the bar chart (bar or column).
|
||||
func (_bd Bar3DChart )SetDirection (d _a .ST_BarDir ){_bd ._dfc .BarDir .ValAttr =d };
|
||||
|
||||
// PieOfPieChart is a Pie chart with an extra Pie chart.
|
||||
type PieOfPieChart struct{chartBase ;_geg *_a .CT_OfPieChart ;};
|
||||
|
||||
// AddBarChart adds a new bar chart to a chart.
|
||||
func (_gbbd Chart )AddBarChart ()BarChart {_adg :=_a .NewCT_PlotAreaChoice ();_gbbd ._egg .Chart .PlotArea .Choice =append (_gbbd ._egg .Chart .PlotArea .Choice ,_adg );_adg .BarChart =_a .NewCT_BarChart ();_adg .BarChart .Grouping =_a .NewCT_BarGrouping ();_adg .BarChart .Grouping .ValAttr =_a .ST_BarGroupingStandard ;_fce :=BarChart {_dfd :_adg .BarChart };_fce .InitializeDefaults ();return _fce ;};type SeriesAxis struct{_dgbb *_a .CT_SerAx };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_egb Marker )X ()*_a .CT_Marker {return _egb ._gfg };func (_ce CategoryAxis )AxisID ()uint32 {return _ce ._acc .AxId .ValAttr };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_fg BarChart )X ()*_a .CT_BarChart {return _fg ._dfd };func (_ccea DateAxis )MajorGridLines ()GridLines {if _ccea ._adef .MajorGridlines ==nil {_ccea ._adef .MajorGridlines =_a .NewCT_ChartLines ();};return GridLines {_ccea ._adef .MajorGridlines };};
|
||||
|
||||
// AddTitle sets a new title on the chart.
|
||||
func (_gge Chart )AddTitle ()Title {_gge ._egg .Chart .Title =_a .NewCT_Title ();_gge ._egg .Chart .Title .Overlay =_a .NewCT_Boolean ();_gge ._egg .Chart .Title .Overlay .ValAttr =_cf .Bool (false );_gge ._egg .Chart .AutoTitleDeleted =_a .NewCT_Boolean ();_gge ._egg .Chart .AutoTitleDeleted .ValAttr =_cf .Bool (false );_cfdd :=MakeTitle (_gge ._egg .Chart .Title );_cfdd .InitializeDefaults ();return _cfdd ;};
|
||||
|
||||
// Order returns the order of the series
|
||||
func (_adbe ScatterChartSeries )Order ()uint32 {return _adbe ._fdd .Order .ValAttr };
|
||||
|
||||
// Values returns the value data source.
|
||||
func (_cfbf BubbleChartSeries )Values ()NumberDataSource {if _cfbf ._gfe .YVal ==nil {_cfbf ._gfe .YVal =_a .NewCT_NumDataSource ();};return MakeNumberDataSource (_cfbf ._gfe .YVal );};
|
||||
|
||||
// SetType sets the type the secone pie to either pie or bar
|
||||
func (_bgg PieOfPieChart )SetType (t _a .ST_OfPieType ){_bgg ._geg .OfPieType .ValAttr =t };
|
||||
|
||||
// Order returns the order of the series
|
||||
func (_fcc LineChartSeries )Order ()uint32 {return _fcc ._aabc .Order .ValAttr };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_gbg PieChart )X ()*_a .CT_PieChart {return _gbg ._ddg };
|
||||
|
||||
// AddStockChart adds a new stock chart.
|
||||
func (_fc Chart )AddStockChart ()StockChart {_ade :=_a .NewCT_PlotAreaChoice ();_fc ._egg .Chart .PlotArea .Choice =append (_fc ._egg .Chart .PlotArea .Choice ,_ade );_ade .StockChart =_a .NewCT_StockChart ();_efa :=StockChart {_addb :_ade .StockChart };_efa .InitializeDefaults ();return _efa ;};func (_bda CategoryAxis )SetPosition (p _a .ST_AxPos ){_bda ._acc .AxPos =_a .NewCT_AxPos ();_bda ._acc .AxPos .ValAttr =p ;};func (_fceb DataLabels )SetShowValue (b bool ){_fceb .ensureChoice ();_fceb ._dca .Choice .ShowVal =_a .NewCT_Boolean ();_fceb ._dca .Choice .ShowVal .ValAttr =_cf .Bool (b );};func (_abcg ValueAxis )SetCrosses (axis Axis ){_abcg ._aabbf .CrossAx .ValAttr =axis .AxisID ()};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_bbe SurfaceChartSeries )X ()*_a .CT_SurfaceSer {return _bbe ._cacg };
|
||||
|
||||
// Properties returns the bar chart series shape properties.
|
||||
func (_eg AreaChartSeries )Properties ()_f .ShapeProperties {if _eg ._ag .SpPr ==nil {_eg ._ag .SpPr =_d .NewCT_ShapeProperties ();};return _f .MakeShapeProperties (_eg ._ag .SpPr );};
|
||||
|
||||
// AddLineChart adds a new line chart to a chart.
|
||||
func (_cdf Chart )AddLineChart ()LineChart {_cgba :=_a .NewCT_PlotAreaChoice ();_cdf ._egg .Chart .PlotArea .Choice =append (_cdf ._egg .Chart .PlotArea .Choice ,_cgba );_cgba .LineChart =_a .NewCT_LineChart ();_cgba .LineChart .Grouping =_a .NewCT_Grouping ();_cgba .LineChart .Grouping .ValAttr =_a .ST_GroupingStandard ;return LineChart {_acd :_cgba .LineChart };};
|
||||
|
||||
// AddSurface3DChart adds a new 3D surface chart to a chart.
|
||||
func (_bcd Chart )AddSurface3DChart ()Surface3DChart {_fgg :=_a .NewCT_PlotAreaChoice ();_bcd ._egg .Chart .PlotArea .Choice =append (_bcd ._egg .Chart .PlotArea .Choice ,_fgg );_fgg .Surface3DChart =_a .NewCT_Surface3DChart ();_aad (_bcd ._egg .Chart );_aae :=Surface3DChart {_bfcb :_fgg .Surface3DChart };_aae .InitializeDefaults ();return _aae ;};
|
||||
|
||||
// InitializeDefaults initializes a Bubble chart series to the default values.
|
||||
func (_ba BubbleChartSeries )InitializeDefaults (){};func (_cdb DateAxis )Properties ()_f .ShapeProperties {if _cdb ._adef .SpPr ==nil {_cdb ._adef .SpPr =_d .NewCT_ShapeProperties ();};return _f .MakeShapeProperties (_cdb ._adef .SpPr );};
|
||||
|
||||
// RemoveTitle removes any existing title from the chart.
|
||||
func (_cgc Chart )RemoveTitle (){_cgc ._egg .Chart .Title =nil ;_cgc ._egg .Chart .AutoTitleDeleted =_a .NewCT_Boolean ();_cgc ._egg .Chart .AutoTitleDeleted .ValAttr =_cf .Bool (true );};
|
||||
|
||||
// AddPieOfPieChart adds a new pie chart to a chart.
|
||||
func (_dbb Chart )AddPieOfPieChart ()PieOfPieChart {_dgeb :=_a .NewCT_PlotAreaChoice ();_dbb ._egg .Chart .PlotArea .Choice =append (_dbb ._egg .Chart .PlotArea .Choice ,_dgeb );_dgeb .OfPieChart =_a .NewCT_OfPieChart ();_dbe :=PieOfPieChart {_geg :_dgeb .OfPieChart };_dbe .InitializeDefaults ();return _dbe ;};func MakeLegend (l *_a .CT_Legend )Legend {return Legend {l }};
|
||||
|
||||
// AddSeries adds a default series to a bar chart.
|
||||
func (_ff Bar3DChart )AddSeries ()BarChartSeries {_cbc :=_ff .nextColor (len (_ff ._dfc .Ser ));_ea :=_a .NewCT_BarSer ();_ff ._dfc .Ser =append (_ff ._dfc .Ser ,_ea );_ea .Idx .ValAttr =uint32 (len (_ff ._dfc .Ser )-1);_ea .Order .ValAttr =uint32 (len (_ff ._dfc .Ser )-1);_dg :=BarChartSeries {_ea };_dg .InitializeDefaults ();_dg .Properties ().SetSolidFill (_cbc );return _dg ;};
|
||||
|
||||
// AddSeries adds a default series to an Radar chart.
|
||||
func (_babg RadarChart )AddSeries ()RadarChartSeries {_bgd :=_babg .nextColor (len (_babg ._gce .Ser ));_gdgd :=_a .NewCT_RadarSer ();_babg ._gce .Ser =append (_babg ._gce .Ser ,_gdgd );_gdgd .Idx .ValAttr =uint32 (len (_babg ._gce .Ser )-1);_gdgd .Order .ValAttr =uint32 (len (_babg ._gce .Ser )-1);_fab :=RadarChartSeries {_gdgd };_fab .InitializeDefaults ();_fab .Properties ().SetSolidFill (_bgd );return _fab ;};
|
||||
|
||||
// AddBubbleChart adds a new bubble chart.
|
||||
func (_ccb Chart )AddBubbleChart ()BubbleChart {_ggg :=_a .NewCT_PlotAreaChoice ();_ccb ._egg .Chart .PlotArea .Choice =append (_ccb ._egg .Chart .PlotArea .Choice ,_ggg );_ggg .BubbleChart =_a .NewCT_BubbleChart ();_bfeb :=BubbleChart {_aga :_ggg .BubbleChart };_bfeb .InitializeDefaults ();return _bfeb ;};
|
||||
|
||||
// BarChartSeries is a series to be used on a bar chart.
|
||||
type BarChartSeries struct{_gbb *_a .CT_BarSer };func (_aed SurfaceChartSeries )Values ()NumberDataSource {if _aed ._cacg .Val ==nil {_aed ._cacg .Val =_a .NewCT_NumDataSource ();};_edeeb :=MakeNumberDataSource (_aed ._cacg .Val );_edeeb .CreateEmptyNumberCache ();return _edeeb ;};func (_cae Marker )Properties ()_f .ShapeProperties {if _cae ._gfg .SpPr ==nil {_cae ._gfg .SpPr =_d .NewCT_ShapeProperties ();};return _f .MakeShapeProperties (_cae ._gfg .SpPr );};
|
||||
|
||||
// AddAxis adds an axis to a Scatter chart.
|
||||
func (_edb ScatterChart )AddAxis (axis Axis ){_cgbf :=_a .NewCT_UnsignedInt ();_cgbf .ValAttr =axis .AxisID ();_edb ._dcgf .AxId =append (_edb ._dcgf .AxId ,_cgbf );};func (_fed Title )InitializeDefaults (){_fed .SetText ("\u0054\u0069\u0074l\u0065");_fed .RunProperties ().SetSize (16*_g .Point );_fed .RunProperties ().SetSolidFill (_cg .Black );_fed .RunProperties ().SetFont ("\u0043\u0061\u006c\u0069\u0062\u0020\u0072\u0069");_fed .RunProperties ().SetBold (false );};func (_gafa Legend )SetOverlay (b bool ){_gafa ._bed .Overlay =_a .NewCT_Boolean ();_gafa ._bed .Overlay .ValAttr =_cf .Bool (b );};func (_bab DataLabels )SetShowPercent (b bool ){_bab .ensureChoice ();_bab ._dca .Choice .ShowPercent =_a .NewCT_Boolean ();_bab ._dca .Choice .ShowPercent .ValAttr =_cf .Bool (b );};
|
||||
|
||||
// SetOrder sets the order of the series
|
||||
func (_cfca ScatterChartSeries )SetOrder (idx uint32 ){_cfca ._fdd .Order .ValAttr =idx };
|
||||
|
||||
// InitializeDefaults the bar chart to its defaults
|
||||
func (_cbd Pie3DChart )InitializeDefaults (){_cbd ._cfdb .VaryColors =_a .NewCT_Boolean ();_cbd ._cfdb .VaryColors .ValAttr =_cf .Bool (true );};func (_eggd ValueAxis )SetMajorTickMark (m _a .ST_TickMark ){if m ==_a .ST_TickMarkUnset {_eggd ._aabbf .MajorTickMark =nil ;}else {_eggd ._aabbf .MajorTickMark =_a .NewCT_TickMark ();_eggd ._aabbf .MajorTickMark .ValAttr =m ;};};func (_fcb Title )RunProperties ()_f .RunProperties {if _fcb ._dcgg .Tx ==nil {_fcb .SetText ("");};if _fcb ._dcgg .Tx .Choice .Rich .P [0].EG_TextRun [0].R .RPr ==nil {_fcb ._dcgg .Tx .Choice .Rich .P [0].EG_TextRun [0].R .RPr =_d .NewCT_TextCharacterProperties ();};return _f .MakeRunProperties (_fcb ._dcgg .Tx .Choice .Rich .P [0].EG_TextRun [0].R .RPr );};func (_bcgd ScatterChartSeries )CategoryAxis ()CategoryAxisDataSource {if _bcgd ._fdd .XVal ==nil {_bcgd ._fdd .XVal =_a .NewCT_AxDataSource ();};return MakeAxisDataSource (_bcgd ._fdd .XVal );};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_edf Legend )X ()*_a .CT_Legend {return _edf ._bed };
|
||||
|
||||
// Properties returns the bar chart series shape properties.
|
||||
func (_cecg RadarChartSeries )Properties ()_f .ShapeProperties {if _cecg ._gfbc .SpPr ==nil {_cecg ._gfbc .SpPr =_d .NewCT_ShapeProperties ();};return _f .MakeShapeProperties (_cecg ._gfbc .SpPr );};func (_dfdb DateAxis )SetPosition (p _a .ST_AxPos ){_dfdb ._adef .AxPos =_a .NewCT_AxPos ();_dfdb ._adef .AxPos .ValAttr =p ;};func (_ceb ValueAxis )MajorGridLines ()GridLines {if _ceb ._aabbf .MajorGridlines ==nil {_ceb ._aabbf .MajorGridlines =_a .NewCT_ChartLines ();};return GridLines {_ceb ._aabbf .MajorGridlines };};func (_baggc Legend )InitializeDefaults (){_baggc .SetPosition (_a .ST_LegendPosR );_baggc .SetOverlay (false );_baggc .Properties ().SetNoFill ();_baggc .Properties ().LineProperties ().SetNoFill ();};
|
||||
|
||||
// InitializeDefaults the Stock chart to its defaults
|
||||
func (_baee StockChart )InitializeDefaults (){_baee ._addb .HiLowLines =_a .NewCT_ChartLines ();_baee ._addb .UpDownBars =_a .NewCT_UpDownBars ();_baee ._addb .UpDownBars .GapWidth =_a .NewCT_GapAmount ();_baee ._addb .UpDownBars .GapWidth .ValAttr =&_a .ST_GapAmount {};_baee ._addb .UpDownBars .GapWidth .ValAttr .ST_GapAmountUShort =_cf .Uint16 (150);_baee ._addb .UpDownBars .UpBars =_a .NewCT_UpDownBar ();_baee ._addb .UpDownBars .DownBars =_a .NewCT_UpDownBar ();};
|
||||
|
||||
// AddLegend adds a legend to a chart, replacing any existing legend.
|
||||
func (_bgea Chart )AddLegend ()Legend {_bgea ._egg .Chart .Legend =_a .NewCT_Legend ();_bfea :=MakeLegend (_bgea ._egg .Chart .Legend );_bfea .InitializeDefaults ();return _bfea ;};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_dad AreaChart )X ()*_a .CT_AreaChart {return _dad ._da };
|
||||
|
||||
// AddSurfaceChart adds a new surface chart to a chart.
|
||||
func (_gcd Chart )AddSurfaceChart ()SurfaceChart {_bgc :=_a .NewCT_PlotAreaChoice ();_gcd ._egg .Chart .PlotArea .Choice =append (_gcd ._egg .Chart .PlotArea .Choice ,_bgc );_bgc .SurfaceChart =_a .NewCT_SurfaceChart ();_aad (_gcd ._egg .Chart );_gcd ._egg .Chart .View3D .RotX .ValAttr =_cf .Int8 (90);_gcd ._egg .Chart .View3D .RotY .ValAttr =_cf .Uint16 (0);_gcd ._egg .Chart .View3D .Perspective =_a .NewCT_Perspective ();_gcd ._egg .Chart .View3D .Perspective .ValAttr =_cf .Uint8 (0);_fgd :=SurfaceChart {_fcab :_bgc .SurfaceChart };_fgd .InitializeDefaults ();return _fgd ;};
|
||||
|
||||
// SetHoleSize controls the hole size in the pie chart and is measured in percent.
|
||||
func (_fbad DoughnutChart )SetHoleSize (pct uint8 ){if _fbad ._dcf .HoleSize ==nil {_fbad ._dcf .HoleSize =_a .NewCT_HoleSize ();};if _fbad ._dcf .HoleSize .ValAttr ==nil {_fbad ._dcf .HoleSize .ValAttr =&_a .ST_HoleSize {};};_fbad ._dcf .HoleSize .ValAttr .ST_HoleSizeUByte =&pct ;};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_ffaf SurfaceChart )X ()*_a .CT_SurfaceChart {return _ffaf ._fcab };
|
||||
|
||||
// InitializeDefaults initializes an area series to the default values.
|
||||
func (_gc AreaChartSeries )InitializeDefaults (){};func (_eded Marker )SetSymbol (s _a .ST_MarkerStyle ){if s ==_a .ST_MarkerStyleUnset {_eded ._gfg .Symbol =nil ;}else {_eded ._gfg .Symbol =_a .NewCT_MarkerStyle ();_eded ._gfg .Symbol .ValAttr =s ;};};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_baf Title )X ()*_a .CT_Title {return _baf ._dcgg };
|
||||
|
||||
// Values returns the bubble size data source.
|
||||
func (_ecg BubbleChartSeries )BubbleSizes ()NumberDataSource {if _ecg ._gfe .BubbleSize ==nil {_ecg ._gfe .BubbleSize =_a .NewCT_NumDataSource ();};return MakeNumberDataSource (_ecg ._gfe .BubbleSize );};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_eef GridLines )X ()*_a .CT_ChartLines {return _eef ._dgc };
|
||||
|
||||
// Index returns the index of the series
|
||||
func (_eggae SurfaceChartSeries )Index ()uint32 {return _eggae ._cacg .Idx .ValAttr };func (_fced Title )SetText (s string ){if _fced ._dcgg .Tx ==nil {_fced ._dcgg .Tx =_a .NewCT_Tx ();};if _fced ._dcgg .Tx .Choice .Rich ==nil {_fced ._dcgg .Tx .Choice .Rich =_d .NewCT_TextBody ();};var _agfe *_d .CT_TextParagraph ;if len (_fced ._dcgg .Tx .Choice .Rich .P )==0{_agfe =_d .NewCT_TextParagraph ();_fced ._dcgg .Tx .Choice .Rich .P =[]*_d .CT_TextParagraph {_agfe };}else {_agfe =_fced ._dcgg .Tx .Choice .Rich .P [0];};var _cdfc *_d .EG_TextRun ;if len (_agfe .EG_TextRun )==0{_cdfc =_d .NewEG_TextRun ();_agfe .EG_TextRun =[]*_d .EG_TextRun {_cdfc };}else {_cdfc =_agfe .EG_TextRun [0];};if _cdfc .R ==nil {_cdfc .R =_d .NewCT_RegularTextRun ();};_cdfc .R .T =s ;};
|
||||
|
||||
// Properties returns the bar chart series shape properties.
|
||||
func (_ebf PieChartSeries )Properties ()_f .ShapeProperties {if _ebf ._fca .SpPr ==nil {_ebf ._fca .SpPr =_d .NewCT_ShapeProperties ();};return _f .MakeShapeProperties (_ebf ._fca .SpPr );};
|
||||
|
||||
// BubbleChartSeries is a series to be used on a Bubble chart.
|
||||
type BubbleChartSeries struct{_gfe *_a .CT_BubbleSer };
|
||||
|
||||
// PieChartSeries is a series to be used on an Pie chart.
|
||||
type PieChartSeries struct{_fca *_a .CT_PieSer };
|
||||
|
||||
// AddBar3DChart adds a new 3D bar chart to a chart.
|
||||
func (_gdg Chart )AddBar3DChart ()Bar3DChart {_aad (_gdg ._egg .Chart );_bagg :=_a .NewCT_PlotAreaChoice ();_gdg ._egg .Chart .PlotArea .Choice =append (_gdg ._egg .Chart .PlotArea .Choice ,_bagg );_bagg .Bar3DChart =_a .NewCT_Bar3DChart ();_bagg .Bar3DChart .Grouping =_a .NewCT_BarGrouping ();_bagg .Bar3DChart .Grouping .ValAttr =_a .ST_BarGroupingStandard ;_bfc :=Bar3DChart {_dfc :_bagg .Bar3DChart };_bfc .InitializeDefaults ();return _bfc ;};
|
||||
|
||||
// Properties returns the bar chart series shape properties.
|
||||
func (_ef BarChartSeries )Properties ()_f .ShapeProperties {if _ef ._gbb .SpPr ==nil {_ef ._gbb .SpPr =_d .NewCT_ShapeProperties ();};return _f .MakeShapeProperties (_ef ._gbb .SpPr );};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_de Bar3DChart )X ()*_a .CT_Bar3DChart {return _de ._dfc };func (_fgab Legend )Properties ()_f .ShapeProperties {if _fgab ._bed .SpPr ==nil {_fgab ._bed .SpPr =_d .NewCT_ShapeProperties ();};return _f .MakeShapeProperties (_fgab ._bed .SpPr );};
|
||||
|
||||
// AddSeries adds a default series to an Pie chart.
|
||||
func (_cec PieChart )AddSeries ()PieChartSeries {_ebgaf :=_a .NewCT_PieSer ();_cec ._ddg .Ser =append (_cec ._ddg .Ser ,_ebgaf );_ebgaf .Idx .ValAttr =uint32 (len (_cec ._ddg .Ser )-1);_ebgaf .Order .ValAttr =uint32 (len (_cec ._ddg .Ser )-1);_ceg :=PieChartSeries {_ebgaf };_ceg .InitializeDefaults ();return _ceg ;};func (_ggcg DataLabels )SetShowLegendKey (b bool ){_ggcg .ensureChoice ();_ggcg ._dca .Choice .ShowLegendKey =_a .NewCT_Boolean ();_ggcg ._dca .Choice .ShowLegendKey .ValAttr =_cf .Bool (b );};type SurfaceChartSeries struct{_cacg *_a .CT_SurfaceSer };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_eea DoughnutChart )X ()*_a .CT_DoughnutChart {return _eea ._dcf };func (_bfg DateAxis )SetCrosses (axis Axis ){_bfg ._adef .CrossAx .ValAttr =axis .AxisID ()};func MakeSeriesAxis (x *_a .CT_SerAx )SeriesAxis {return SeriesAxis {x }};
|
||||
|
||||
// SetNumberReference is used to set the source data to a range of cells containing
|
||||
// numbers.
|
||||
func (_caf CategoryAxisDataSource )SetNumberReference (s string ){_caf ._dab .Choice =_a .NewCT_AxDataSourceChoice ();_caf ._dab .Choice .NumRef =_a .NewCT_NumRef ();_caf ._dab .Choice .NumRef .F =s ;};
|
||||
// SetText sets the series text.
|
||||
func (_bcd BarChartSeries )SetText (s string ){_bcd ._deb .Tx =_c .NewCT_SerTx ();_bcd ._deb .Tx .Choice .V =&s ;};
|
||||
|
||||
// CategoryAxis returns the category data source.
|
||||
func (_dde PieChartSeries )CategoryAxis ()CategoryAxisDataSource {if _dde ._fca .Cat ==nil {_dde ._fca .Cat =_a .NewCT_AxDataSource ();};return MakeAxisDataSource (_dde ._fca .Cat );};type DataLabels struct{_dca *_a .CT_DLbls };
|
||||
func (_fdb AreaChartSeries )CategoryAxis ()CategoryAxisDataSource {if _fdb ._bba .Cat ==nil {_fdb ._bba .Cat =_c .NewCT_AxDataSource ();};return MakeAxisDataSource (_fdb ._bba .Cat );};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_gc BarChart )X ()*_c .CT_BarChart {return _gc ._baa };func (_edfg Title )InitializeDefaults (){_edfg .SetText ("\u0054\u0069\u0074l\u0065");_edfg .RunProperties ().SetSize (16*_cg .Point );_edfg .RunProperties ().SetSolidFill (_ad .Black );_edfg .RunProperties ().SetFont ("\u0043\u0061\u006c\u0069\u0062\u0020\u0072\u0069");_edfg .RunProperties ().SetBold (false );};
|
||||
|
||||
// CategoryAxis returns the category data source.
|
||||
func (_befe RadarChartSeries )CategoryAxis ()CategoryAxisDataSource {if _befe ._ggce .Cat ==nil {_befe ._ggce .Cat =_c .NewCT_AxDataSource ();};return MakeAxisDataSource (_befe ._ggce .Cat );};
|
||||
|
||||
// AddSeries adds a default series to a Surface chart.
|
||||
func (_ega Surface3DChart )AddSeries ()SurfaceChartSeries {_fgf :=_ega .nextColor (len (_ega ._cde .Ser ));_eebeb :=_c .NewCT_SurfaceSer ();_ega ._cde .Ser =append (_ega ._cde .Ser ,_eebeb );_eebeb .Idx .ValAttr =uint32 (len (_ega ._cde .Ser )-1);_eebeb .Order .ValAttr =uint32 (len (_ega ._cde .Ser )-1);_bbbc :=SurfaceChartSeries {_eebeb };_bbbc .InitializeDefaults ();_bbbc .Properties ().LineProperties ().SetSolidFill (_fgf );return _bbbc ;};
|
||||
|
||||
// AddPieChart adds a new pie chart to a chart.
|
||||
func (_bbd Chart )AddPieChart ()PieChart {_fec :=_c .NewCT_PlotAreaChoice ();_bbd ._ag .Chart .PlotArea .Choice =append (_bbd ._ag .Chart .PlotArea .Choice ,_fec );_fec .PieChart =_c .NewCT_PieChart ();_gec :=PieChart {_cccd :_fec .PieChart };_gec .InitializeDefaults ();return _gec ;};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_aaf LineChartSeries )X ()*_c .CT_LineSer {return _aaf ._ggcf };func (_ga Bar3DChart )AddAxis (axis Axis ){_eaf :=_c .NewCT_UnsignedInt ();_eaf .ValAttr =axis .AxisID ();_ga ._eb .AxId =append (_ga ._eb .AxId ,_eaf );};func (_baac DateAxis )Properties ()_e .ShapeProperties {if _baac ._ebe .SpPr ==nil {_baac ._ebe .SpPr =_d .NewCT_ShapeProperties ();};return _e .MakeShapeProperties (_baac ._ebe .SpPr );};func (_dgcd ScatterChartSeries )CategoryAxis ()CategoryAxisDataSource {if _dgcd ._dba .XVal ==nil {_dgcd ._dba .XVal =_c .NewCT_AxDataSource ();};return MakeAxisDataSource (_dgcd ._dba .XVal );};
|
||||
|
||||
// InitializeDefaults the Stock chart to its defaults
|
||||
func (_dgca StockChart )InitializeDefaults (){_dgca ._agb .HiLowLines =_c .NewCT_ChartLines ();_dgca ._agb .UpDownBars =_c .NewCT_UpDownBars ();_dgca ._agb .UpDownBars .GapWidth =_c .NewCT_GapAmount ();_dgca ._agb .UpDownBars .GapWidth .ValAttr =&_c .ST_GapAmount {};_dgca ._agb .UpDownBars .GapWidth .ValAttr .ST_GapAmountUShort =_f .Uint16 (150);_dgca ._agb .UpDownBars .UpBars =_c .NewCT_UpDownBar ();_dgca ._agb .UpDownBars .DownBars =_c .NewCT_UpDownBar ();};
|
||||
|
||||
// AddPieOfPieChart adds a new pie chart to a chart.
|
||||
func (_fca Chart )AddPieOfPieChart ()PieOfPieChart {_dbf :=_c .NewCT_PlotAreaChoice ();_fca ._ag .Chart .PlotArea .Choice =append (_fca ._ag .Chart .PlotArea .Choice ,_dbf );_dbf .OfPieChart =_c .NewCT_OfPieChart ();_faa :=PieOfPieChart {_ecff :_dbf .OfPieChart };_faa .InitializeDefaults ();return _faa ;};func (_aba DataLabels )SetPosition (p _c .ST_DLblPos ){_aba .ensureChoice ();_aba ._dfc .Choice .DLblPos =_c .NewCT_DLblPos ();_aba ._dfc .Choice .DLblPos .ValAttr =p ;};
|
||||
|
||||
// Order returns the order of the series
|
||||
func (_adc LineChartSeries )Order ()uint32 {return _adc ._ggcf .Order .ValAttr };
|
||||
|
||||
// SetDirection changes the direction of the bar chart (bar or column).
|
||||
func (_eea Bar3DChart )SetDirection (d _c .ST_BarDir ){_eea ._eb .BarDir .ValAttr =d };
|
||||
|
||||
// InitializeDefaults the bar chart to its defaults
|
||||
func (_gda RadarChart )InitializeDefaults (){_gda ._aac .RadarStyle .ValAttr =_c .ST_RadarStyleMarker };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_beg SurfaceChartSeries )X ()*_c .CT_SurfaceSer {return _beg ._cab };func (_cbdd DataLabels )ensureChoice (){if _cbdd ._dfc .Choice ==nil {_cbdd ._dfc .Choice =_c .NewCT_DLblsChoice ();};};
|
||||
|
||||
// SetIndex sets the index of the series
|
||||
func (_abfb SurfaceChartSeries )SetIndex (idx uint32 ){_abfb ._cab .Idx .ValAttr =idx };
|
||||
|
||||
// Index returns the index of the series
|
||||
func (_dcedg SurfaceChartSeries )Index ()uint32 {return _dcedg ._cab .Idx .ValAttr };
|
||||
|
||||
// InitializeDefaults the bar chart to its defaults
|
||||
func (_dc BarChart )InitializeDefaults (){_dc .SetDirection (_c .ST_BarDirCol )};func (_dcb CategoryAxis )SetMajorTickMark (m _c .ST_TickMark ){if m ==_c .ST_TickMarkUnset {_dcb ._bfb .MajorTickMark =nil ;}else {_dcb ._bfb .MajorTickMark =_c .NewCT_TickMark ();_dcb ._bfb .MajorTickMark .ValAttr =m ;};};
|
||||
|
||||
// BarChartSeries is a series to be used on a bar chart.
|
||||
type BarChartSeries struct{_deb *_c .CT_BarSer };
|
||||
|
||||
// AddLegend adds a legend to a chart, replacing any existing legend.
|
||||
func (_fcc Chart )AddLegend ()Legend {_fcc ._ag .Chart .Legend =_c .NewCT_Legend ();_gee :=MakeLegend (_fcc ._ag .Chart .Legend );_gee .InitializeDefaults ();return _gee ;};
|
||||
|
||||
// Properties returns the bar chart series shape properties.
|
||||
func (_fcge PieChartSeries )Properties ()_e .ShapeProperties {if _fcge ._abab .SpPr ==nil {_fcge ._abab .SpPr =_d .NewCT_ShapeProperties ();};return _e .MakeShapeProperties (_fcge ._abab .SpPr );};
|
||||
|
||||
// SetIndex sets the index of the series
|
||||
func (_fcde LineChartSeries )SetIndex (idx uint32 ){_fcde ._ggcf .Idx .ValAttr =idx };
|
||||
|
||||
// AddSurfaceChart adds a new surface chart to a chart.
|
||||
func (_dbe Chart )AddSurfaceChart ()SurfaceChart {_cad :=_c .NewCT_PlotAreaChoice ();_dbe ._ag .Chart .PlotArea .Choice =append (_dbe ._ag .Chart .PlotArea .Choice ,_cad );_cad .SurfaceChart =_c .NewCT_SurfaceChart ();_dff (_dbe ._ag .Chart );_dbe ._ag .Chart .View3D .RotX .ValAttr =_f .Int8 (90);_dbe ._ag .Chart .View3D .RotY .ValAttr =_f .Uint16 (0);_dbe ._ag .Chart .View3D .Perspective =_c .NewCT_Perspective ();_dbe ._ag .Chart .View3D .Perspective .ValAttr =_f .Uint8 (0);_gdf :=SurfaceChart {_debg :_cad .SurfaceChart };_gdf .InitializeDefaults ();return _gdf ;};func (_feed NumberDataSource )ensureChoice (){if _feed ._fcgf .Choice ==nil {_feed ._fcgf .Choice =_c .NewCT_NumDataSourceChoice ();};};
|
||||
|
||||
// Properties returns the Bubble chart series shape properties.
|
||||
func (_ddb BubbleChartSeries )Properties ()_e .ShapeProperties {if _ddb ._ac .SpPr ==nil {_ddb ._ac .SpPr =_d .NewCT_ShapeProperties ();};return _e .MakeShapeProperties (_ddb ._ac .SpPr );};func MakeDataLabels (x *_c .CT_DLbls )DataLabels {return DataLabels {x }};
|
||||
|
||||
// SetText sets the series text.
|
||||
func (_gg BubbleChartSeries )SetText (s string ){_gg ._ac .Tx =_c .NewCT_SerTx ();_gg ._ac .Tx .Choice .V =&s ;};func (_baag DateAxis )SetMajorTickMark (m _c .ST_TickMark ){if m ==_c .ST_TickMarkUnset {_baag ._ebe .MajorTickMark =nil ;}else {_baag ._ebe .MajorTickMark =_c .NewCT_TickMark ();_baag ._ebe .MajorTickMark .ValAttr =m ;};};
|
||||
|
||||
// AddBar3DChart adds a new 3D bar chart to a chart.
|
||||
func (_gcg Chart )AddBar3DChart ()Bar3DChart {_dff (_gcg ._ag .Chart );_dec :=_c .NewCT_PlotAreaChoice ();_gcg ._ag .Chart .PlotArea .Choice =append (_gcg ._ag .Chart .PlotArea .Choice ,_dec );_dec .Bar3DChart =_c .NewCT_Bar3DChart ();_dec .Bar3DChart .Grouping =_c .NewCT_BarGrouping ();_dec .Bar3DChart .Grouping .ValAttr =_c .ST_BarGroupingStandard ;_fga :=Bar3DChart {_eb :_dec .Bar3DChart };_fga .InitializeDefaults ();return _fga ;};
|
||||
|
||||
// AddSeries adds a default series to a bar chart.
|
||||
func (_ead BarChart )AddSeries ()BarChartSeries {_eee :=_ead .nextColor (len (_ead ._baa .Ser ));_ef :=_c .NewCT_BarSer ();_ead ._baa .Ser =append (_ead ._baa .Ser ,_ef );_ef .Idx .ValAttr =uint32 (len (_ead ._baa .Ser )-1);_ef .Order .ValAttr =uint32 (len (_ead ._baa .Ser )-1);_fb :=BarChartSeries {_ef };_fb .InitializeDefaults ();_fb .Properties ().SetSolidFill (_eee );return _fb ;};
|
||||
|
||||
// AddSeries adds a default series to a Scatter chart.
|
||||
func (_acge ScatterChart )AddSeries ()ScatterChartSeries {_cdbe :=_acge .nextColor (len (_acge ._gfa .Ser ));_age :=_c .NewCT_ScatterSer ();_acge ._gfa .Ser =append (_acge ._gfa .Ser ,_age );_age .Idx .ValAttr =uint32 (len (_acge ._gfa .Ser )-1);_age .Order .ValAttr =uint32 (len (_acge ._gfa .Ser )-1);_acb :=ScatterChartSeries {_age };_acb .InitializeDefaults ();_acb .Marker ().Properties ().LineProperties ().SetSolidFill (_cdbe );_acb .Marker ().Properties ().SetSolidFill (_cdbe );return _acb ;};type GridLines struct{_deg *_c .CT_ChartLines };
|
||||
|
||||
// AddSeries adds a default series to an Doughnut chart.
|
||||
func (_fcgg DoughnutChart )AddSeries ()PieChartSeries {_fea :=_c .NewCT_PieSer ();_fcgg ._eefd .Ser =append (_fcgg ._eefd .Ser ,_fea );_fea .Idx .ValAttr =uint32 (len (_fcgg ._eefd .Ser )-1);_fea .Order .ValAttr =uint32 (len (_fcgg ._eefd .Ser )-1);_aag :=PieChartSeries {_fea };_aag .InitializeDefaults ();return _aag ;};func (_geae SurfaceChartSeries )CategoryAxis ()CategoryAxisDataSource {if _geae ._cab .Cat ==nil {_geae ._cab .Cat =_c .NewCT_AxDataSource ();};return MakeAxisDataSource (_geae ._cab .Cat );};func (_fdc CategoryAxis )MajorGridLines ()GridLines {if _fdc ._bfb .MajorGridlines ==nil {_fdc ._bfb .MajorGridlines =_c .NewCT_ChartLines ();};return GridLines {_fdc ._bfb .MajorGridlines };};
|
||||
|
||||
// Values returns the value data source.
|
||||
func (_af AreaChartSeries )Values ()NumberDataSource {if _af ._bba .Val ==nil {_af ._bba .Val =_c .NewCT_NumDataSource ();};return MakeNumberDataSource (_af ._bba .Val );};
|
||||
|
||||
// SetOrder sets the order of the series
|
||||
func (_egcg ScatterChartSeries )SetOrder (idx uint32 ){_egcg ._dba .Order .ValAttr =idx };func (_cce ValueAxis )SetMajorTickMark (m _c .ST_TickMark ){if m ==_c .ST_TickMarkUnset {_cce ._acec .MajorTickMark =nil ;}else {_cce ._acec .MajorTickMark =_c .NewCT_TickMark ();_cce ._acec .MajorTickMark .ValAttr =m ;};};
|
||||
|
||||
// Index returns the index of the series
|
||||
func (_deef LineChartSeries )Index ()uint32 {return _deef ._ggcf .Idx .ValAttr };
|
||||
|
||||
// CreateEmptyNumberCache creates an empty number cache, which is used sometimes
|
||||
// to increase file format compatibility. It should actually contain the
|
||||
// computed cell data, but just creating an empty one is good enough.
|
||||
func (_fdg NumberDataSource )CreateEmptyNumberCache (){_fdg .ensureChoice ();if _fdg ._fcgf .Choice .NumRef ==nil {_fdg ._fcgf .Choice .NumRef =_c .NewCT_NumRef ();};_fdg ._fcgf .Choice .NumLit =nil ;_fdg ._fcgf .Choice .NumRef .NumCache =_c .NewCT_NumData ();_fdg ._fcgf .Choice .NumRef .NumCache .PtCount =_c .NewCT_UnsignedInt ();_fdg ._fcgf .Choice .NumRef .NumCache .PtCount .ValAttr =0;};
|
||||
|
||||
// CategoryAxis returns the category data source.
|
||||
func (_ada BubbleChartSeries )CategoryAxis ()CategoryAxisDataSource {if _ada ._ac .XVal ==nil {_ada ._ac .XVal =_c .NewCT_AxDataSource ();};return MakeAxisDataSource (_ada ._ac .XVal );};func (_fa CategoryAxis )SetMinorTickMark (m _c .ST_TickMark ){if m ==_c .ST_TickMarkUnset {_fa ._bfb .MinorTickMark =nil ;}else {_fa ._bfb .MinorTickMark =_c .NewCT_TickMark ();_fa ._bfb .MinorTickMark .ValAttr =m ;};};type ScatterChart struct{chartBase ;_gfa *_c .CT_ScatterChart ;};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_gebg SeriesAxis )X ()*_c .CT_SerAx {return _gebg ._bdb };
|
||||
|
||||
// AddBarChart adds a new bar chart to a chart.
|
||||
func (_cgd Chart )AddBarChart ()BarChart {_dg :=_c .NewCT_PlotAreaChoice ();_cgd ._ag .Chart .PlotArea .Choice =append (_cgd ._ag .Chart .PlotArea .Choice ,_dg );_dg .BarChart =_c .NewCT_BarChart ();_dg .BarChart .Grouping =_c .NewCT_BarGrouping ();_dg .BarChart .Grouping .ValAttr =_c .ST_BarGroupingStandard ;_gcd :=BarChart {_baa :_dg .BarChart };_gcd .InitializeDefaults ();return _gcd ;};type LineChart struct{chartBase ;_bge *_c .CT_LineChart ;};func (_gdd LineChartSeries )SetSmooth (b bool ){_gdd ._ggcf .Smooth =_c .NewCT_Boolean ();_gdd ._ggcf .Smooth .ValAttr =&b ;};
|
||||
|
||||
// Index returns the index of the series
|
||||
func (_gdc ScatterChartSeries )Index ()uint32 {return _gdc ._dba .Idx .ValAttr };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_bfdf Marker )X ()*_c .CT_Marker {return _bfdf ._ffd };
|
||||
|
||||
// InitializeDefaults the bar chart to its defaults
|
||||
func (_bdad PieOfPieChart )InitializeDefaults (){_bdad ._ecff .VaryColors =_c .NewCT_Boolean ();_bdad ._ecff .VaryColors .ValAttr =_f .Bool (true );_bdad .SetType (_c .ST_OfPieTypePie );_bdad ._ecff .SecondPieSize =_c .NewCT_SecondPieSize ();_bdad ._ecff .SecondPieSize .ValAttr =&_c .ST_SecondPieSize {};_bdad ._ecff .SecondPieSize .ValAttr .ST_SecondPieSizeUShort =_f .Uint16 (75);_dece :=_c .NewCT_ChartLines ();_dece .SpPr =_d .NewCT_ShapeProperties ();_cdf :=_e .MakeShapeProperties (_dece .SpPr );_cdf .LineProperties ().SetSolidFill (_ad .Auto );_bdad ._ecff .SerLines =append (_bdad ._ecff .SerLines ,_dece );};
|
||||
|
||||
// SetType sets the type the secone pie to either pie or bar
|
||||
func (_caff PieOfPieChart )SetType (t _c .ST_OfPieType ){_caff ._ecff .OfPieType .ValAttr =t };
|
||||
|
||||
// Bar3DChart is a 3D bar chart.
|
||||
type Bar3DChart struct{chartBase ;_eb *_c .CT_Bar3DChart ;};
|
||||
|
||||
// Values returns the bubble size data source.
|
||||
func (_gdg BubbleChartSeries )BubbleSizes ()NumberDataSource {if _gdg ._ac .BubbleSize ==nil {_gdg ._ac .BubbleSize =_c .NewCT_NumDataSource ();};return MakeNumberDataSource (_gdg ._ac .BubbleSize );};
|
||||
|
||||
// Properties returns the chart's shape properties.
|
||||
func (_gac Chart )Properties ()_e .ShapeProperties {if _gac ._ag .SpPr ==nil {_gac ._ag .SpPr =_d .NewCT_ShapeProperties ();};return _e .MakeShapeProperties (_gac ._ag .SpPr );};func (_bfd Chart )AddSeriesAxis ()SeriesAxis {_eda :=_c .NewCT_SerAx ();if _bfd ._ag .Chart .PlotArea .CChoice ==nil {_bfd ._ag .Chart .PlotArea .CChoice =_c .NewCT_PlotAreaChoice1 ();};_eda .AxId =_c .NewCT_UnsignedInt ();_eda .AxId .ValAttr =0x7FFFFFFF&_a .Uint32 ();_bfd ._ag .Chart .PlotArea .CChoice .SerAx =append (_bfd ._ag .Chart .PlotArea .CChoice .SerAx ,_eda );_eda .Delete =_c .NewCT_Boolean ();_eda .Delete .ValAttr =_f .Bool (false );_abg :=MakeSeriesAxis (_eda );_abg .InitializeDefaults ();return _abg ;};
|
||||
|
||||
// RemoveLegend removes the legend if the chart has one.
|
||||
func (_dbff Chart )RemoveLegend (){_dbff ._ag .Chart .Legend =nil };func (_cfcd ValueAxis )SetCrosses (axis Axis ){_cfcd ._acec .CrossAx .ValAttr =axis .AxisID ()};
|
||||
|
||||
// AddSeries adds a default series to a Bubble chart.
|
||||
func (_fdbf BubbleChart )AddSeries ()BubbleChartSeries {_gff :=_fdbf .nextColor (len (_fdbf ._ebf .Ser ));_eada :=_c .NewCT_BubbleSer ();_fdbf ._ebf .Ser =append (_fdbf ._ebf .Ser ,_eada );_eada .Idx .ValAttr =uint32 (len (_fdbf ._ebf .Ser )-1);_eada .Order .ValAttr =uint32 (len (_fdbf ._ebf .Ser )-1);_abe :=BubbleChartSeries {_eada };_abe .InitializeDefaults ();_abe .Properties ().SetSolidFill (_gff );return _abe ;};
|
||||
|
||||
// SetOrder sets the order of the series
|
||||
func (_bgef SurfaceChartSeries )SetOrder (idx uint32 ){_bgef ._cab .Order .ValAttr =idx };
|
||||
|
||||
// AddPie3DChart adds a new pie chart to a chart.
|
||||
func (_ede Chart )AddPie3DChart ()Pie3DChart {_dff (_ede ._ag .Chart );_fgag :=_c .NewCT_PlotAreaChoice ();_ede ._ag .Chart .PlotArea .Choice =append (_ede ._ag .Chart .PlotArea .Choice ,_fgag );_fgag .Pie3DChart =_c .NewCT_Pie3DChart ();_fbg :=Pie3DChart {_cafa :_fgag .Pie3DChart };_fbg .InitializeDefaults ();return _fbg ;};
|
||||
|
||||
// SetIndex sets the index of the series
|
||||
func (_edae ScatterChartSeries )SetIndex (idx uint32 ){_edae ._dba .Idx .ValAttr =idx };func (_fd Area3DChart )AddAxis (axis Axis ){_ed :=_c .NewCT_UnsignedInt ();_ed .ValAttr =axis .AxisID ();_fd ._bc .AxId =append (_fd ._bc .AxId ,_ed );};
|
||||
|
||||
// InitializeDefaults the bar chart to its defaults
|
||||
func (_fc AreaChart )InitializeDefaults (){};func (_dda ValueAxis )Properties ()_e .ShapeProperties {if _dda ._acec .SpPr ==nil {_dda ._acec .SpPr =_d .NewCT_ShapeProperties ();};return _e .MakeShapeProperties (_dda ._acec .SpPr );};
|
||||
|
||||
// AddScatterChart adds a scatter (X/Y) chart.
|
||||
func (_bfa Chart )AddScatterChart ()ScatterChart {_fbe :=_c .NewCT_PlotAreaChoice ();_bfa ._ag .Chart .PlotArea .Choice =append (_bfa ._ag .Chart .PlotArea .Choice ,_fbe );_fbe .ScatterChart =_c .NewCT_ScatterChart ();_ggf :=ScatterChart {_gfa :_fbe .ScatterChart };_ggf .InitializeDefaults ();return _ggf ;};type nullAxis byte ;func (_fgbd ValueAxis )MajorGridLines ()GridLines {if _fgbd ._acec .MajorGridlines ==nil {_fgbd ._acec .MajorGridlines =_c .NewCT_ChartLines ();};return GridLines {_fgbd ._acec .MajorGridlines };};func (_bbe CategoryAxis )SetPosition (p _c .ST_AxPos ){_bbe ._bfb .AxPos =_c .NewCT_AxPos ();_bbe ._bfb .AxPos .ValAttr =p ;};
|
||||
|
||||
// CategoryAxisDataSource specifies the data for an axis. It's commonly used with
|
||||
// SetReference to set the axis data to a range of cells.
|
||||
type CategoryAxisDataSource struct{_dab *_a .CT_AxDataSource };
|
||||
|
||||
// SetExplosion sets the value that the segements of the pie are 'exploded' by
|
||||
func (_aecc PieChartSeries )SetExplosion (v uint32 ){_aecc ._fca .Explosion =_a .NewCT_UnsignedInt ();_aecc ._fca .Explosion .ValAttr =v ;};func (_dcfb NumberDataSource )SetReference (s string ){_dcfb .ensureChoice ();if _dcfb ._edd .Choice .NumRef ==nil {_dcfb ._edd .Choice .NumRef =_a .NewCT_NumRef ();};_dcfb ._edd .Choice .NumRef .F =s ;};type GridLines struct{_dgc *_a .CT_ChartLines };
|
||||
|
||||
// CategoryAxis returns the category data source.
|
||||
func (_fee AreaChartSeries )CategoryAxis ()CategoryAxisDataSource {if _fee ._ag .Cat ==nil {_fee ._ag .Cat =_a .NewCT_AxDataSource ();};return MakeAxisDataSource (_fee ._ag .Cat );};
|
||||
|
||||
// AddSeries adds a default series to an area chart.
|
||||
func (_bb Area3DChart )AddSeries ()AreaChartSeries {_ac :=_bb .nextColor (len (_bb ._gd .Ser ));_eb :=_a .NewCT_AreaSer ();_bb ._gd .Ser =append (_bb ._gd .Ser ,_eb );_eb .Idx .ValAttr =uint32 (len (_bb ._gd .Ser )-1);_eb .Order .ValAttr =uint32 (len (_bb ._gd .Ser )-1);_ee :=AreaChartSeries {_eb };_ee .InitializeDefaults ();_ee .Properties ().SetSolidFill (_ac );return _ee ;};
|
||||
|
||||
// Chart is a generic chart.
|
||||
type Chart struct{_egg *_a .ChartSpace };func (_bfe CategoryAxis )SetMajorTickMark (m _a .ST_TickMark ){if m ==_a .ST_TickMarkUnset {_bfe ._acc .MajorTickMark =nil ;}else {_bfe ._acc .MajorTickMark =_a .NewCT_TickMark ();_bfe ._acc .MajorTickMark .ValAttr =m ;};};func (_ca CategoryAxis )InitializeDefaults (){_ca .SetPosition (_a .ST_AxPosB );_ca .SetMajorTickMark (_a .ST_TickMarkOut );_ca .SetMinorTickMark (_a .ST_TickMarkIn );_ca .SetTickLabelPosition (_a .ST_TickLblPosNextTo );_ca .MajorGridLines ().Properties ().LineProperties ().SetSolidFill (_cg .LightGray );_ca .Properties ().LineProperties ().SetSolidFill (_cg .Black );};func (_ece RadarChart )AddAxis (axis Axis ){_afa :=_a .NewCT_UnsignedInt ();_afa .ValAttr =axis .AxisID ();_ece ._gce .AxId =append (_ece ._gce .AxId ,_afa );};func (_bga DateAxis )SetMajorTickMark (m _a .ST_TickMark ){if m ==_a .ST_TickMarkUnset {_bga ._adef .MajorTickMark =nil ;}else {_bga ._adef .MajorTickMark =_a .NewCT_TickMark ();_bga ._adef .MajorTickMark .ValAttr =m ;};};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_bdf PieChartSeries )X ()*_a .CT_PieSer {return _bdf ._fca };
|
||||
|
||||
// Labels returns the data label properties.
|
||||
func (_dda ScatterChartSeries )Labels ()DataLabels {if _dda ._fdd .DLbls ==nil {_dda ._fdd .DLbls =_a .NewCT_DLbls ();};return MakeDataLabels (_dda ._fdd .DLbls );};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_ffae Line3DChart )X ()*_a .CT_Line3DChart {return _ffae ._fdg };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_ffd StockChart )X ()*_a .CT_StockChart {return _ffd ._addb };
|
||||
|
||||
// BarChart is a 2D bar chart.
|
||||
type BarChart struct{chartBase ;_dfd *_a .CT_BarChart ;};
|
||||
|
||||
// Area3DChart is an area chart that has a shaded area underneath a curve.
|
||||
type Area3DChart struct{chartBase ;_gd *_a .CT_Area3DChart ;};
|
||||
|
||||
// AddPieChart adds a new pie chart to a chart.
|
||||
func (_bdaf Chart )AddPieChart ()PieChart {_ccece :=_a .NewCT_PlotAreaChoice ();_bdaf ._egg .Chart .PlotArea .Choice =append (_bdaf ._egg .Chart .PlotArea .Choice ,_ccece );_ccece .PieChart =_a .NewCT_PieChart ();_dcd :=PieChart {_ddg :_ccece .PieChart };_dcd .InitializeDefaults ();return _dcd ;};func MakeMarker (x *_a .CT_Marker )Marker {return Marker {x }};type nullAxis byte ;
|
||||
|
||||
// RemoveLegend removes the legend if the chart has one.
|
||||
func (_eacd Chart )RemoveLegend (){_eacd ._egg .Chart .Legend =nil };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_aedf ValueAxis )X ()*_a .CT_ValAx {return _aedf ._aabbf };func (_afd ValueAxis )SetPosition (p _a .ST_AxPos ){_afd ._aabbf .AxPos =_a .NewCT_AxPos ();_afd ._aabbf .AxPos .ValAttr =p ;};
|
||||
|
||||
// SetText sets the series text
|
||||
func (_edee SurfaceChartSeries )SetText (s string ){_edee ._cacg .Tx =_a .NewCT_SerTx ();_edee ._cacg .Tx .Choice .V =&s ;};
|
||||
|
||||
// AddPie3DChart adds a new pie chart to a chart.
|
||||
func (_bdae Chart )AddPie3DChart ()Pie3DChart {_aad (_bdae ._egg .Chart );_cgf :=_a .NewCT_PlotAreaChoice ();_bdae ._egg .Chart .PlotArea .Choice =append (_bdae ._egg .Chart .PlotArea .Choice ,_cgf );_cgf .Pie3DChart =_a .NewCT_Pie3DChart ();_ffa :=Pie3DChart {_cfdb :_cgf .Pie3DChart };_ffa .InitializeDefaults ();return _ffa ;};
|
||||
|
||||
// RadarChart is an Radar chart that has a shaded Radar underneath a curve.
|
||||
type RadarChart struct{chartBase ;_gce *_a .CT_RadarChart ;};func (_aab Chart )AddSeriesAxis ()SeriesAxis {_fd :=_a .NewCT_SerAx ();if _aab ._egg .Chart .PlotArea .CChoice ==nil {_aab ._egg .Chart .PlotArea .CChoice =_a .NewCT_PlotAreaChoice1 ();};_fd .AxId =_a .NewCT_UnsignedInt ();_fd .AxId .ValAttr =0x7FFFFFFF&_ad .Uint32 ();_aab ._egg .Chart .PlotArea .CChoice .SerAx =append (_aab ._egg .Chart .PlotArea .CChoice .SerAx ,_fd );_fd .Delete =_a .NewCT_Boolean ();_fd .Delete .ValAttr =_cf .Bool (false );_eac :=MakeSeriesAxis (_fd );_eac .InitializeDefaults ();return _eac ;};
|
||||
|
||||
// SetText sets the series text.
|
||||
func (_fff RadarChartSeries )SetText (s string ){_fff ._gfbc .Tx =_a .NewCT_SerTx ();_fff ._gfbc .Tx .Choice .V =&s ;};
|
||||
|
||||
// SetDisplayBlanksAs controls how missing values are displayed.
|
||||
func (_fcd Chart )SetDisplayBlanksAs (v _a .ST_DispBlanksAs ){_fcd ._egg .Chart .DispBlanksAs =_a .NewCT_DispBlanksAs ();_fcd ._egg .Chart .DispBlanksAs .ValAttr =v ;};type Legend struct{_bed *_a .CT_Legend };func (_ega LineChartSeries )InitializeDefaults (){_ega .Properties ().LineProperties ().SetWidth (1*_g .Point );_ega .Properties ().LineProperties ().SetSolidFill (_cg .Black );_ega .Properties ().LineProperties ().SetJoin (_f .LineJoinRound );_ega .Marker ().SetSymbol (_a .ST_MarkerStyleNone );_ega .Labels ().SetShowLegendKey (false );_ega .Labels ().SetShowValue (false );_ega .Labels ().SetShowPercent (false );_ega .Labels ().SetShowCategoryName (false );_ega .Labels ().SetShowSeriesName (false );_ega .Labels ().SetShowLeaderLines (false );};func (_bcdc DateAxis )SetTickLabelPosition (p _a .ST_TickLblPos ){if p ==_a .ST_TickLblPosUnset {_bcdc ._adef .TickLblPos =nil ;}else {_bcdc ._adef .TickLblPos =_a .NewCT_TickLblPos ();_bcdc ._adef .TickLblPos .ValAttr =p ;};};
|
||||
|
||||
// RadarChartSeries is a series to be used on an Radar chart.
|
||||
type RadarChartSeries struct{_gfbc *_a .CT_RadarSer };
|
||||
|
||||
// InitializeDefaults the bar chart to its defaults
|
||||
func (_fea DoughnutChart )InitializeDefaults (){_fea ._dcf .VaryColors =_a .NewCT_Boolean ();_fea ._dcf .VaryColors .ValAttr =_cf .Bool (true );_fea ._dcf .HoleSize =_a .NewCT_HoleSize ();_fea ._dcf .HoleSize .ValAttr =&_a .ST_HoleSize {};_fea ._dcf .HoleSize .ValAttr .ST_HoleSizeUByte =_cf .Uint8 (50);};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_fcdf LineChartSeries )X ()*_a .CT_LineSer {return _fcdf ._aabc };
|
||||
|
||||
// AddCategoryAxis adds a category axis.
|
||||
func (_aac Chart )AddCategoryAxis ()CategoryAxis {_bgf :=_a .NewCT_CatAx ();if _aac ._egg .Chart .PlotArea .CChoice ==nil {_aac ._egg .Chart .PlotArea .CChoice =_a .NewCT_PlotAreaChoice1 ();};_bgf .AxId =_a .NewCT_UnsignedInt ();_bgf .AxId .ValAttr =0x7FFFFFFF&_ad .Uint32 ();_aac ._egg .Chart .PlotArea .CChoice .CatAx =append (_aac ._egg .Chart .PlotArea .CChoice .CatAx ,_bgf );_bgf .Auto =_a .NewCT_Boolean ();_bgf .Auto .ValAttr =_cf .Bool (true );_bgf .Delete =_a .NewCT_Boolean ();_bgf .Delete .ValAttr =_cf .Bool (false );_gda :=MakeCategoryAxis (_bgf );_gda .InitializeDefaults ();return _gda ;};func _aad (_ae *_a .CT_Chart ){_ae .View3D =_a .NewCT_View3D ();_ae .View3D .RotX =_a .NewCT_RotX ();_ae .View3D .RotX .ValAttr =_cf .Int8 (15);_ae .View3D .RotY =_a .NewCT_RotY ();_ae .View3D .RotY .ValAttr =_cf .Uint16 (20);_ae .View3D .RAngAx =_a .NewCT_Boolean ();_ae .View3D .RAngAx .ValAttr =_cf .Bool (false );_ae .Floor =_a .NewCT_Surface ();_ae .Floor .Thickness =_a .NewCT_Thickness ();_ae .Floor .Thickness .ValAttr .Uint32 =_cf .Uint32 (0);_ae .SideWall =_a .NewCT_Surface ();_ae .SideWall .Thickness =_a .NewCT_Thickness ();_ae .SideWall .Thickness .ValAttr .Uint32 =_cf .Uint32 (0);_ae .BackWall =_a .NewCT_Surface ();_ae .BackWall .Thickness =_a .NewCT_Thickness ();_ae .BackWall .Thickness .ValAttr .Uint32 =_cf .Uint32 (0);};type ScatterChart struct{chartBase ;_dcgf *_a .CT_ScatterChart ;};func (_fb Bar3DChart )AddAxis (axis Axis ){_cbec :=_a .NewCT_UnsignedInt ();_cbec .ValAttr =axis .AxisID ();_fb ._dfc .AxId =append (_fb ._dfc .AxId ,_cbec );};type DateAxis struct{_adef *_a .CT_DateAx };func (_ecb DateAxis )SetMinorTickMark (m _a .ST_TickMark ){if m ==_a .ST_TickMarkUnset {_ecb ._adef .MinorTickMark =nil ;}else {_ecb ._adef .MinorTickMark =_a .NewCT_TickMark ();_ecb ._adef .MinorTickMark .ValAttr =m ;};};func (_dgb DateAxis )AxisID ()uint32 {return _dgb ._adef .AxId .ValAttr };var NullAxis Axis =nullAxis (0);
|
||||
|
||||
// AddAxis adds an axis to a Surface chart.
|
||||
func (_fabc SurfaceChart )AddAxis (axis Axis ){_adcd :=_a .NewCT_UnsignedInt ();_adcd .ValAttr =axis .AxisID ();_fabc ._fcab .AxId =append (_fabc ._fcab .AxId ,_adcd );};
|
||||
|
||||
// Marker returns the marker properties.
|
||||
func (_dgg ScatterChartSeries )Marker ()Marker {if _dgg ._fdd .Marker ==nil {_dgg ._fdd .Marker =_a .NewCT_Marker ();};return MakeMarker (_dgg ._fdd .Marker );};func (_eaf CategoryAxis )SetMinorTickMark (m _a .ST_TickMark ){if m ==_a .ST_TickMarkUnset {_eaf ._acc .MinorTickMark =nil ;}else {_eaf ._acc .MinorTickMark =_a .NewCT_TickMark ();_eaf ._acc .MinorTickMark .ValAttr =m ;};};type NumberDataSource struct{_edd *_a .CT_NumDataSource };func (_aa Area3DChart )AddAxis (axis Axis ){_ec :=_a .NewCT_UnsignedInt ();_ec .ValAttr =axis .AxisID ();_aa ._gd .AxId =append (_aa ._gd .AxId ,_ec );};func (_gde CategoryAxis )SetTickLabelPosition (p _a .ST_TickLblPos ){if p ==_a .ST_TickLblPosUnset {_gde ._acc .TickLblPos =nil ;}else {_gde ._acc .TickLblPos =_a .NewCT_TickLblPos ();_gde ._acc .TickLblPos .ValAttr =p ;};};
|
||||
|
||||
// Marker returns the marker properties.
|
||||
func (_ddb LineChartSeries )Marker ()Marker {if _ddb ._aabc .Marker ==nil {_ddb ._aabc .Marker =_a .NewCT_Marker ();};return MakeMarker (_ddb ._aabc .Marker );};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_cbecc PieOfPieChart )X ()*_a .CT_OfPieChart {return _cbecc ._geg };
|
||||
|
||||
// InitializeDefaults the bar chart to its defaults
|
||||
func (_bcg RadarChart )InitializeDefaults (){_bcg ._gce .RadarStyle .ValAttr =_a .ST_RadarStyleMarker };func (_dee LineChartSeries )CategoryAxis ()CategoryAxisDataSource {if _dee ._aabc .Cat ==nil {_dee ._aabc .Cat =_a .NewCT_AxDataSource ();};return MakeAxisDataSource (_dee ._aabc .Cat );};
|
||||
|
||||
// AddSeries adds a default series to an Pie3D chart.
|
||||
func (_dcg Pie3DChart )AddSeries ()PieChartSeries {_dfg :=_a .NewCT_PieSer ();_dcg ._cfdb .Ser =append (_dcg ._cfdb .Ser ,_dfg );_dfg .Idx .ValAttr =uint32 (len (_dcg ._cfdb .Ser )-1);_dfg .Order .ValAttr =uint32 (len (_dcg ._cfdb .Ser )-1);_edfc :=PieChartSeries {_dfg };_edfc .InitializeDefaults ();return _edfc ;};
|
||||
|
||||
// AddDoughnutChart adds a new doughnut (pie with a hole in the center) chart to a chart.
|
||||
func (_cfce Chart )AddDoughnutChart ()DoughnutChart {_gaf :=_a .NewCT_PlotAreaChoice ();_cfce ._egg .Chart .PlotArea .Choice =append (_cfce ._egg .Chart .PlotArea .Choice ,_gaf );_gaf .DoughnutChart =_a .NewCT_DoughnutChart ();_ddd :=DoughnutChart {_dcf :_gaf .DoughnutChart };_ddd .InitializeDefaults ();return _ddd ;};func (_dfce CategoryAxis )Properties ()_f .ShapeProperties {if _dfce ._acc .SpPr ==nil {_dfce ._acc .SpPr =_d .NewCT_ShapeProperties ();};return _f .MakeShapeProperties (_dfce ._acc .SpPr );};type Marker struct{_gfg *_a .CT_Marker };
|
||||
|
||||
// SetIndex sets the index of the series
|
||||
func (_ded ScatterChartSeries )SetIndex (idx uint32 ){_ded ._fdd .Idx .ValAttr =idx };
|
||||
|
||||
// CategoryAxis returns the category data source.
|
||||
func (_db BarChartSeries )CategoryAxis ()CategoryAxisDataSource {if _db ._gbb .Cat ==nil {_db ._gbb .Cat =_a .NewCT_AxDataSource ();};return MakeAxisDataSource (_db ._gbb .Cat );};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_abc ScatterChartSeries )X ()*_a .CT_ScatterSer {return _abc ._fdd };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_ggc Chart )X ()*_a .ChartSpace {return _ggc ._egg };
|
||||
|
||||
// LineChartSeries is the data series for a line chart.
|
||||
type LineChartSeries struct{_aabc *_a .CT_LineSer };func (_ced DataLabels )SetShowSeriesName (b bool ){_ced .ensureChoice ();_ced ._dca .Choice .ShowSerName =_a .NewCT_Boolean ();_ced ._dca .Choice .ShowSerName .ValAttr =_cf .Bool (b );};
|
||||
|
||||
// SetOrder sets the order of the series
|
||||
func (_ede LineChartSeries )SetOrder (idx uint32 ){_ede ._aabc .Order .ValAttr =idx };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_cbe AreaChartSeries )X ()*_a .CT_AreaSer {return _cbe ._ag };
|
||||
type CategoryAxisDataSource struct{_ge *_c .CT_AxDataSource };func (_gea GridLines )Properties ()_e .ShapeProperties {if _gea ._deg .SpPr ==nil {_gea ._deg .SpPr =_d .NewCT_ShapeProperties ();};return _e .MakeShapeProperties (_gea ._deg .SpPr );};func MakeSeriesAxis (x *_c .CT_SerAx )SeriesAxis {return SeriesAxis {x }};
|
||||
|
||||
// SetValues is used to set the source data to a set of values.
|
||||
func (_cdg CategoryAxisDataSource )SetValues (v []string ){_cdg ._dab .Choice =_a .NewCT_AxDataSourceChoice ();_cdg ._dab .Choice .StrLit =_a .NewCT_StrData ();_cdg ._dab .Choice .StrLit .PtCount =_a .NewCT_UnsignedInt ();_cdg ._dab .Choice .StrLit .PtCount .ValAttr =uint32 (len (v ));for _bge ,_ga :=range v {_cdg ._dab .Choice .StrLit .Pt =append (_cdg ._dab .Choice .StrLit .Pt ,&_a .CT_StrVal {IdxAttr :uint32 (_bge ),V :_ga });};};
|
||||
func (_fdbc CategoryAxisDataSource )SetValues (v []string ){_fdbc ._ge .Choice =_c .NewCT_AxDataSourceChoice ();_fdbc ._ge .Choice .StrLit =_c .NewCT_StrData ();_fdbc ._ge .Choice .StrLit .PtCount =_c .NewCT_UnsignedInt ();_fdbc ._ge .Choice .StrLit .PtCount .ValAttr =uint32 (len (v ));for _babe ,_fcda :=range v {_fdbc ._ge .Choice .StrLit .Pt =append (_fdbc ._ge .Choice .StrLit .Pt ,&_c .CT_StrVal {IdxAttr :uint32 (_babe ),V :_fcda });};};func (_gdgc CategoryAxis )SetTickLabelPosition (p _c .ST_TickLblPos ){if p ==_c .ST_TickLblPosUnset {_gdgc ._bfb .TickLblPos =nil ;}else {_gdgc ._bfb .TickLblPos =_c .NewCT_TickLblPos ();_gdgc ._bfb .TickLblPos .ValAttr =p ;};};
|
||||
|
||||
// Index returns the index of the series
|
||||
func (_gab LineChartSeries )Index ()uint32 {return _gab ._aabc .Idx .ValAttr };
|
||||
// MakeAxisDataSource constructs an AxisDataSource wrapper.
|
||||
func MakeAxisDataSource (x *_c .CT_AxDataSource )CategoryAxisDataSource {return CategoryAxisDataSource {x };};func (_aab DateAxis )SetTickLabelPosition (p _c .ST_TickLblPos ){if p ==_c .ST_TickLblPosUnset {_aab ._ebe .TickLblPos =nil ;}else {_aab ._ebe .TickLblPos =_c .NewCT_TickLblPos ();_aab ._ebe .TickLblPos .ValAttr =p ;};};
|
||||
|
||||
// SetText sets the series text
|
||||
func (_aabb LineChartSeries )SetText (s string ){_aabb ._aabc .Tx =_a .NewCT_SerTx ();_aabb ._aabc .Tx .Choice .V =&s ;};
|
||||
// InitializeDefaults initializes an area series to the default values.
|
||||
func (_eaa AreaChartSeries )InitializeDefaults (){};
|
||||
|
||||
// AddAreaChart adds a new area chart to a chart.
|
||||
func (_bdb Chart )AddAreaChart ()AreaChart {_baa :=_a .NewCT_PlotAreaChoice ();_bdb ._egg .Chart .PlotArea .Choice =append (_bdb ._egg .Chart .PlotArea .Choice ,_baa );_baa .AreaChart =_a .NewCT_AreaChart ();_ccd :=AreaChart {_da :_baa .AreaChart };_ccd .InitializeDefaults ();return _ccd ;};func (_cbed ValueAxis )SetTickLabelPosition (p _a .ST_TickLblPos ){if p ==_a .ST_TickLblPosUnset {_cbed ._aabbf .TickLblPos =nil ;}else {_cbed ._aabbf .TickLblPos =_a .NewCT_TickLblPos ();_cbed ._aabbf .TickLblPos .ValAttr =p ;};};func (_add SeriesAxis )InitializeDefaults (){};func (_egga ScatterChartSeries )SetSmooth (b bool ){_egga ._fdd .Smooth =_a .NewCT_Boolean ();_egga ._fdd .Smooth .ValAttr =&b ;};
|
||||
// LineChartSeries is the data series for a line chart.
|
||||
type LineChartSeries struct{_ggcf *_c .CT_LineSer };
|
||||
|
||||
// AddSeries adds a default series to an Pie chart.
|
||||
func (_gca PieOfPieChart )AddSeries ()PieChartSeries {_cggb :=_a .NewCT_PieSer ();_gca ._geg .Ser =append (_gca ._geg .Ser ,_cggb );_cggb .Idx .ValAttr =uint32 (len (_gca ._geg .Ser )-1);_cggb .Order .ValAttr =uint32 (len (_gca ._geg .Ser )-1);_cdgg :=PieChartSeries {_cggb };_cdgg .InitializeDefaults ();return _cdgg ;};type CategoryAxis struct{_acc *_a .CT_CatAx };func (_aca ScatterChartSeries )InitializeDefaults (){_aca .Properties ().LineProperties ().SetNoFill ();_aca .Marker ().SetSymbol (_a .ST_MarkerStyleAuto );_aca .Labels ().SetShowLegendKey (false );_aca .Labels ().SetShowValue (true );_aca .Labels ().SetShowPercent (false );_aca .Labels ().SetShowCategoryName (false );_aca .Labels ().SetShowSeriesName (false );_aca .Labels ().SetShowLeaderLines (false );};
|
||||
// SetDisplayBlanksAs controls how missing values are displayed.
|
||||
func (_cbd Chart )SetDisplayBlanksAs (v _c .ST_DispBlanksAs ){_cbd ._ag .Chart .DispBlanksAs =_c .NewCT_DispBlanksAs ();_cbd ._ag .Chart .DispBlanksAs .ValAttr =v ;};func (_bffg ValueAxis )SetPosition (p _c .ST_AxPos ){_bffg ._acec .AxPos =_c .NewCT_AxPos ();_bffg ._acec .AxPos .ValAttr =p ;};
|
||||
|
||||
// AddRadarChart adds a new radar chart to a chart.
|
||||
func (_ebg Chart )AddRadarChart ()RadarChart {_fa :=_a .NewCT_PlotAreaChoice ();_ebg ._egg .Chart .PlotArea .Choice =append (_ebg ._egg .Chart .PlotArea .Choice ,_fa );_fa .RadarChart =_a .NewCT_RadarChart ();_be :=RadarChart {_gce :_fa .RadarChart };_be .InitializeDefaults ();return _be ;};
|
||||
// SetOrder sets the order of the series
|
||||
func (_aafc LineChartSeries )SetOrder (idx uint32 ){_aafc ._ggcf .Order .ValAttr =idx };
|
||||
|
||||
// CategoryAxis returns the category data source.
|
||||
func (_eefe RadarChartSeries )CategoryAxis ()CategoryAxisDataSource {if _eefe ._gfbc .Cat ==nil {_eefe ._gfbc .Cat =_a .NewCT_AxDataSource ();};return MakeAxisDataSource (_eefe ._gfbc .Cat );};func (_dce chartBase )nextColor (_cgg int )_cg .Color {return _bea [_cgg %len (_bea )]};
|
||||
// SetExplosion sets the value that the segements of the pie are 'exploded' by
|
||||
func (_ffa PieChartSeries )SetExplosion (v uint32 ){_ffa ._abab .Explosion =_c .NewCT_UnsignedInt ();_ffa ._abab .Explosion .ValAttr =v ;};
|
||||
|
||||
// Properties returns the line chart series shape properties.
|
||||
func (_bcfg ScatterChartSeries )Properties ()_e .ShapeProperties {if _bcfg ._dba .SpPr ==nil {_bcfg ._dba .SpPr =_d .NewCT_ShapeProperties ();};return _e .MakeShapeProperties (_bcfg ._dba .SpPr );};func (_fdfe ScatterChartSeries )SetSmooth (b bool ){_fdfe ._dba .Smooth =_c .NewCT_Boolean ();_fdfe ._dba .Smooth .ValAttr =&b ;};func (_ege Marker )SetSymbol (s _c .ST_MarkerStyle ){if s ==_c .ST_MarkerStyleUnset {_ege ._ffd .Symbol =nil ;}else {_ege ._ffd .Symbol =_c .NewCT_MarkerStyle ();_ege ._ffd .Symbol .ValAttr =s ;};};
|
||||
|
||||
// InitializeDefaults the bar chart to its defaults
|
||||
func (_ace Pie3DChart )InitializeDefaults (){_ace ._cafa .VaryColors =_c .NewCT_Boolean ();_ace ._cafa .VaryColors .ValAttr =_f .Bool (true );};func (_bab BarChart )AddAxis (axis Axis ){_cfc :=_c .NewCT_UnsignedInt ();_cfc .ValAttr =axis .AxisID ();_bab ._baa .AxId =append (_bab ._baa .AxId ,_cfc );};
|
||||
|
||||
// Properties returns the bar chart series shape properties.
|
||||
func (_egeg RadarChartSeries )Properties ()_e .ShapeProperties {if _egeg ._ggce .SpPr ==nil {_egeg ._ggce .SpPr =_d .NewCT_ShapeProperties ();};return _e .MakeShapeProperties (_egeg ._ggce .SpPr );};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_cge AreaChartSeries )X ()*_c .CT_AreaSer {return _cge ._bba };
|
||||
|
||||
// AreaChartSeries is a series to be used on an area chart.
|
||||
type AreaChartSeries struct{_bba *_c .CT_AreaSer };
|
||||
|
||||
// SetDirection changes the direction of the bar chart (bar or column).
|
||||
func (_ce BarChart )SetDirection (d _c .ST_BarDir ){_ce ._baa .BarDir .ValAttr =d };func (_gecb ScatterChartSeries )InitializeDefaults (){_gecb .Properties ().LineProperties ().SetNoFill ();_gecb .Marker ().SetSymbol (_c .ST_MarkerStyleAuto );_gecb .Labels ().SetShowLegendKey (false );_gecb .Labels ().SetShowValue (true );_gecb .Labels ().SetShowPercent (false );_gecb .Labels ().SetShowCategoryName (false );_gecb .Labels ().SetShowSeriesName (false );_gecb .Labels ().SetShowLeaderLines (false );};
|
||||
|
||||
// AddSeries adds a default series to a line chart.
|
||||
func (_cac LineChart )AddSeries ()LineChartSeries {_bae :=_cac .nextColor (len (_cac ._acd .Ser ));_aaf :=_a .NewCT_LineSer ();_cac ._acd .Ser =append (_cac ._acd .Ser ,_aaf );_aaf .Idx .ValAttr =uint32 (len (_cac ._acd .Ser )-1);_aaf .Order .ValAttr =uint32 (len (_cac ._acd .Ser )-1);_deaa :=LineChartSeries {_aaf };_deaa .InitializeDefaults ();_deaa .Properties ().LineProperties ().SetSolidFill (_bae );return _deaa ;};func (_gcg Legend )SetPosition (p _a .ST_LegendPos ){if p ==_a .ST_LegendPosUnset {_gcg ._bed .LegendPos =nil ;}else {_gcg ._bed .LegendPos =_a .NewCT_LegendPos ();_gcg ._bed .LegendPos .ValAttr =p ;};};func (_cce BubbleChart )AddAxis (axis Axis ){_dff :=_a .NewCT_UnsignedInt ();_dff .ValAttr =axis .AxisID ();_cce ._aga .AxId =append (_cce ._aga .AxId ,_dff );};
|
||||
func (_dfb Line3DChart )AddSeries ()LineChartSeries {_eadc :=_dfb .nextColor (len (_dfb ._dgb .Ser ));_bda :=_c .NewCT_LineSer ();_dfb ._dgb .Ser =append (_dfb ._dgb .Ser ,_bda );_bda .Idx .ValAttr =uint32 (len (_dfb ._dgb .Ser )-1);_bda .Order .ValAttr =uint32 (len (_dfb ._dgb .Ser )-1);_aed :=LineChartSeries {_bda };_aed .InitializeDefaults ();_aed .Properties ().LineProperties ().SetSolidFill (_eadc );_aed .Properties ().SetSolidFill (_eadc );return _aed ;};var NullAxis Axis =nullAxis (0);
|
||||
|
||||
// AreaChart is an area chart that has a shaded area underneath a curve.
|
||||
type AreaChart struct{chartBase ;_da *_a .CT_AreaChart ;};
|
||||
// ScatterChartSeries is the data series for a scatter chart.
|
||||
type ScatterChartSeries struct{_dba *_c .CT_ScatterSer };func (_beff SurfaceChart )InitializeDefaults (){_beff ._debg .Wireframe =_c .NewCT_Boolean ();_beff ._debg .Wireframe .ValAttr =_f .Bool (false );_beff ._debg .BandFmts =_c .NewCT_BandFmts ();for _abfd :=0;_abfd < 15;_abfd ++{_fcce :=_c .NewCT_BandFmt ();_fcce .Idx .ValAttr =uint32 (_abfd );_fcce .SpPr =_d .NewCT_ShapeProperties ();_dbc :=_e .MakeShapeProperties (_fcce .SpPr );_dbc .SetSolidFill (_beff .nextColor (_abfd ));_beff ._debg .BandFmts .BandFmt =append (_beff ._debg .BandFmts .BandFmt ,_fcce );};};func (_afg Legend )InitializeDefaults (){_afg .SetPosition (_c .ST_LegendPosR );_afg .SetOverlay (false );_afg .Properties ().SetNoFill ();_afg .Properties ().LineProperties ().SetNoFill ();};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_bef RadarChartSeries )X ()*_c .CT_RadarSer {return _bef ._ggce };type DateAxis struct{_ebe *_c .CT_DateAx };
|
||||
|
||||
// Pie3DChart is a Pie3D chart.
|
||||
type Pie3DChart struct{chartBase ;_cafa *_c .CT_Pie3DChart ;};
|
||||
|
||||
// InitializeDefaults the bar chart to its defaults
|
||||
func (_ec Area3DChart )InitializeDefaults (){};func (_cbb Marker )SetSize (sz uint8 ){_cbb ._ffd .Size =_c .NewCT_MarkerSize ();_cbb ._ffd .Size .ValAttr =&sz ;};
|
||||
|
||||
// AddArea3DChart adds a new area chart to a chart.
|
||||
func (_dca Chart )AddArea3DChart ()Area3DChart {_dff (_dca ._ag .Chart );_debe :=_c .NewCT_PlotAreaChoice ();_dca ._ag .Chart .PlotArea .Choice =append (_dca ._ag .Chart .PlotArea .Choice ,_debe );_debe .Area3DChart =_c .NewCT_Area3DChart ();_cd :=Area3DChart {_bc :_debe .Area3DChart };_cd .InitializeDefaults ();return _cd ;};
|
||||
|
||||
// InitializeDefaults the Bubble chart to its defaults
|
||||
func (_gd BubbleChart )InitializeDefaults (){};func (_be DateAxis )AxisID ()uint32 {return _be ._ebe .AxId .ValAttr };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_aff Chart )X ()*_c .ChartSpace {return _aff ._ag };
|
||||
|
||||
// PieChart is a Pie chart.
|
||||
type PieChart struct{chartBase ;_cccd *_c .CT_PieChart ;};
|
||||
|
||||
// Marker returns the marker properties.
|
||||
func (_edg ScatterChartSeries )Marker ()Marker {if _edg ._dba .Marker ==nil {_edg ._dba .Marker =_c .NewCT_Marker ();};return MakeMarker (_edg ._dba .Marker );};
|
||||
|
||||
// Values returns the value data source.
|
||||
func (_cef BarChartSeries )Values ()NumberDataSource {if _cef ._deb .Val ==nil {_cef ._deb .Val =_c .NewCT_NumDataSource ();};return MakeNumberDataSource (_cef ._deb .Val );};
|
||||
|
||||
// Values returns the value data source.
|
||||
func (_ccgdb PieChartSeries )Values ()NumberDataSource {if _ccgdb ._abab .Val ==nil {_ccgdb ._abab .Val =_c .NewCT_NumDataSource ();};return MakeNumberDataSource (_ccgdb ._abab .Val );};
|
||||
|
||||
// Values returns the value data source.
|
||||
func (_geb RadarChartSeries )Values ()NumberDataSource {if _geb ._ggce .Val ==nil {_geb ._ggce .Val =_c .NewCT_NumDataSource ();};return MakeNumberDataSource (_geb ._ggce .Val );};func (_fce Legend )SetPosition (p _c .ST_LegendPos ){if p ==_c .ST_LegendPosUnset {_fce ._aef .LegendPos =nil ;}else {_fce ._aef .LegendPos =_c .NewCT_LegendPos ();_fce ._aef .LegendPos .ValAttr =p ;};};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_feee Pie3DChart )X ()*_c .CT_Pie3DChart {return _feee ._cafa };var _gga =[]_ad .Color {_ad .RGB (0x33,0x66,0xcc),_ad .RGB (0xDC,0x39,0x12),_ad .RGB (0xFF,0x99,0x00),_ad .RGB (0x10,0x96,0x18),_ad .RGB (0x99,0x00,0x99),_ad .RGB (0x3B,0x3E,0xAC),_ad .RGB (0x00,0x99,0xC6),_ad .RGB (0xDD,0x44,0x77),_ad .RGB (0x66,0xAA,0x00),_ad .RGB (0xB8,0x2E,0x2E),_ad .RGB (0x31,0x63,0x95),_ad .RGB (0x99,0x44,0x99),_ad .RGB (0x22,0xAA,0x99),_ad .RGB (0xAA,0xAA,0x11),_ad .RGB (0x66,0x33,0xCC),_ad .RGB (0xE6,0x73,0x00),_ad .RGB (0x8B,0x07,0x07),_ad .RGB (0x32,0x92,0x62),_ad .RGB (0x55,0x74,0xA6),_ad .RGB (0x3B,0x3E,0xAC)};
|
||||
|
||||
// AddAxis adds an axis to a Surface chart.
|
||||
func (_edgb Surface3DChart )AddAxis (axis Axis ){_bbf :=_c .NewCT_UnsignedInt ();_bbf .ValAttr =axis .AxisID ();_edgb ._cde .AxId =append (_edgb ._cde .AxId ,_bbf );};
|
||||
|
||||
// InitializeDefaults the bar chart to its defaults
|
||||
func (_cac Bar3DChart )InitializeDefaults (){_cac .SetDirection (_c .ST_BarDirCol )};
|
||||
|
||||
// PieChartSeries is a series to be used on an Pie chart.
|
||||
type PieChartSeries struct{_abab *_c .CT_PieSer };func (_adf AreaChart )AddAxis (axis Axis ){_ee :=_c .NewCT_UnsignedInt ();_ee .ValAttr =axis .AxisID ();_adf ._bg .AxId =append (_adf ._bg .AxId ,_ee );};func MakeCategoryAxis (x *_c .CT_CatAx )CategoryAxis {return CategoryAxis {x }};
|
||||
|
||||
// SetHoleSize controls the hole size in the pie chart and is measured in percent.
|
||||
func (_caf DoughnutChart )SetHoleSize (pct uint8 ){if _caf ._eefd .HoleSize ==nil {_caf ._eefd .HoleSize =_c .NewCT_HoleSize ();};if _caf ._eefd .HoleSize .ValAttr ==nil {_caf ._eefd .HoleSize .ValAttr =&_c .ST_HoleSize {};};_caf ._eefd .HoleSize .ValAttr .ST_HoleSizeUByte =&pct ;};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_gcc LineChart )X ()*_c .CT_LineChart {return _gcc ._bge };func (_ecb ScatterChartSeries )Values ()NumberDataSource {if _ecb ._dba .YVal ==nil {_ecb ._dba .YVal =_c .NewCT_NumDataSource ();};return MakeNumberDataSource (_ecb ._dba .YVal );};func (_dea DataLabels )SetShowCategoryName (b bool ){_dea .ensureChoice ();_dea ._dfc .Choice .ShowCatName =_c .NewCT_Boolean ();_dea ._dfc .Choice .ShowCatName .ValAttr =_f .Bool (b );};func (_dcba Surface3DChart )InitializeDefaults (){_dcba ._cde .Wireframe =_c .NewCT_Boolean ();_dcba ._cde .Wireframe .ValAttr =_f .Bool (false );_dcba ._cde .BandFmts =_c .NewCT_BandFmts ();for _agg :=0;_agg < 15;_agg ++{_bdf :=_c .NewCT_BandFmt ();_bdf .Idx .ValAttr =uint32 (_agg );_bdf .SpPr =_d .NewCT_ShapeProperties ();_gddf :=_e .MakeShapeProperties (_bdf .SpPr );_gddf .SetSolidFill (_dcba .nextColor (_agg ));_dcba ._cde .BandFmts .BandFmt =append (_dcba ._cde .BandFmts .BandFmt ,_bdf );};};func (_aa chartBase )nextColor (_fcg int )_ad .Color {return _gga [_fcg %len (_gga )]};
|
||||
|
||||
// AddSurface3DChart adds a new 3D surface chart to a chart.
|
||||
func (_dce Chart )AddSurface3DChart ()Surface3DChart {_dcaa :=_c .NewCT_PlotAreaChoice ();_dce ._ag .Chart .PlotArea .Choice =append (_dce ._ag .Chart .PlotArea .Choice ,_dcaa );_dcaa .Surface3DChart =_c .NewCT_Surface3DChart ();_dff (_dce ._ag .Chart );_add :=Surface3DChart {_cde :_dcaa .Surface3DChart };_add .InitializeDefaults ();return _add ;};func (_abf DateAxis )MajorGridLines ()GridLines {if _abf ._ebe .MajorGridlines ==nil {_abf ._ebe .MajorGridlines =_c .NewCT_ChartLines ();};return GridLines {_abf ._ebe .MajorGridlines };};func (_feb LineChartSeries )Values ()NumberDataSource {if _feb ._ggcf .Val ==nil {_feb ._ggcf .Val =_c .NewCT_NumDataSource ();};return MakeNumberDataSource (_feb ._ggcf .Val );};
|
||||
|
||||
// AddAreaChart adds a new area chart to a chart.
|
||||
func (_cga Chart )AddAreaChart ()AreaChart {_bca :=_c .NewCT_PlotAreaChoice ();_cga ._ag .Chart .PlotArea .Choice =append (_cga ._ag .Chart .PlotArea .Choice ,_bca );_bca .AreaChart =_c .NewCT_AreaChart ();_fe :=AreaChart {_bg :_bca .AreaChart };_fe .InitializeDefaults ();return _fe ;};func MakeMarker (x *_c .CT_Marker )Marker {return Marker {x }};
|
||||
|
||||
// Axis is the interface implemented by different axes when assigning to a
|
||||
// chart.
|
||||
type Axis interface{AxisID ()uint32 ;};
|
||||
|
||||
// Order returns the order of the series
|
||||
func (_cab SurfaceChartSeries )Order ()uint32 {return _cab ._cacg .Order .ValAttr };func (_bee StockChart )AddAxis (axis Axis ){_ddbb :=_a .NewCT_UnsignedInt ();_ddbb .ValAttr =axis .AxisID ();_bee ._addb .AxId =append (_bee ._addb .AxId ,_ddbb );};func (_aade Marker )SetSize (sz uint8 ){_aade ._gfg .Size =_a .NewCT_MarkerSize ();_aade ._gfg .Size .ValAttr =&sz ;};
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_cgea PieChartSeries )X ()*_c .CT_PieSer {return _cgea ._abab };
|
||||
|
||||
// MakeAxisDataSource constructs an AxisDataSource wrapper.
|
||||
func MakeAxisDataSource (x *_a .CT_AxDataSource )CategoryAxisDataSource {return CategoryAxisDataSource {x };};
|
||||
// AddDoughnutChart adds a new doughnut (pie with a hole in the center) chart to a chart.
|
||||
func (_gb Chart )AddDoughnutChart ()DoughnutChart {_fcae :=_c .NewCT_PlotAreaChoice ();_gb ._ag .Chart .PlotArea .Choice =append (_gb ._ag .Chart .PlotArea .Choice ,_fcae );_fcae .DoughnutChart =_c .NewCT_DoughnutChart ();_edf :=DoughnutChart {_eefd :_fcae .DoughnutChart };_edf .InitializeDefaults ();return _edf ;};
|
||||
|
||||
// AddScatterChart adds a scatter (X/Y) chart.
|
||||
func (_bfa Chart )AddScatterChart ()ScatterChart {_acb :=_a .NewCT_PlotAreaChoice ();_bfa ._egg .Chart .PlotArea .Choice =append (_bfa ._egg .Chart .PlotArea .Choice ,_acb );_acb .ScatterChart =_a .NewCT_ScatterChart ();_ebga :=ScatterChart {_dcgf :_acb .ScatterChart };_ebga .InitializeDefaults ();return _ebga ;};
|
||||
// AddSeries adds a default series to an Pie3D chart.
|
||||
func (_ddcd Pie3DChart )AddSeries ()PieChartSeries {_fag :=_c .NewCT_PieSer ();_ddcd ._cafa .Ser =append (_ddcd ._cafa .Ser ,_fag );_fag .Idx .ValAttr =uint32 (len (_ddcd ._cafa .Ser )-1);_fag .Order .ValAttr =uint32 (len (_ddcd ._cafa .Ser )-1);_bbcg :=PieChartSeries {_fag };_bbcg .InitializeDefaults ();return _bbcg ;};
|
||||
|
||||
// SetText sets the series text.
|
||||
func (_gg BarChartSeries )SetText (s string ){_gg ._gbb .Tx =_a .NewCT_SerTx ();_gg ._gbb .Tx .Choice .V =&s ;};func (_feb SeriesAxis )SetCrosses (axis Axis ){_feb ._dgbb .CrossAx .ValAttr =axis .AxisID ()};
|
||||
// AddSeries adds a default series to a line chart.
|
||||
func (_gae LineChart )AddSeries ()LineChartSeries {_cbc :=_gae .nextColor (len (_gae ._bge .Ser ));_cfa :=_c .NewCT_LineSer ();_gae ._bge .Ser =append (_gae ._bge .Ser ,_cfa );_cfa .Idx .ValAttr =uint32 (len (_gae ._bge .Ser )-1);_cfa .Order .ValAttr =uint32 (len (_gae ._bge .Ser )-1);_fac :=LineChartSeries {_cfa };_fac .InitializeDefaults ();_fac .Properties ().LineProperties ().SetSolidFill (_cbc );return _fac ;};func (_bgf SeriesAxis )SetCrosses (axis Axis ){_bgf ._bdb .CrossAx .ValAttr =axis .AxisID ()};
|
||||
|
||||
// Properties returns the line chart series shape properties.
|
||||
func (_ddcg LineChartSeries )Properties ()_e .ShapeProperties {if _ddcg ._ggcf .SpPr ==nil {_ddcg ._ggcf .SpPr =_d .NewCT_ShapeProperties ();};return _e .MakeShapeProperties (_ddcg ._ggcf .SpPr );};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_fdf PieOfPieChart )X ()*_c .CT_OfPieChart {return _fdf ._ecff };
|
||||
|
||||
// InitializeDefaults initializes an Pie series to the default values.
|
||||
func (_dcbb PieChartSeries )InitializeDefaults (){};
|
||||
|
||||
// InitializeDefaults the bar chart to its defaults
|
||||
func (_bg Bar3DChart )InitializeDefaults (){_bg .SetDirection (_a .ST_BarDirCol )};
|
||||
func (_gca PieChart )InitializeDefaults (){_gca ._cccd .VaryColors =_c .NewCT_Boolean ();_gca ._cccd .VaryColors .ValAttr =_f .Bool (true );};
|
||||
|
||||
// AddSeries adds a default series to a Surface chart.
|
||||
func (_deeg SurfaceChart )AddSeries ()SurfaceChartSeries {_gac :=_deeg .nextColor (len (_deeg ._fcab .Ser ));_eega :=_a .NewCT_SurfaceSer ();_deeg ._fcab .Ser =append (_deeg ._fcab .Ser ,_eega );_eega .Idx .ValAttr =uint32 (len (_deeg ._fcab .Ser )-1);_eega .Order .ValAttr =uint32 (len (_deeg ._fcab .Ser )-1);_eee :=SurfaceChartSeries {_eega };_eee .InitializeDefaults ();_eee .Properties ().LineProperties ().SetSolidFill (_gac );return _eee ;};
|
||||
// AddSeries adds a default series to a bar chart.
|
||||
func (_fcd Bar3DChart )AddSeries ()BarChartSeries {_dfg :=_fcd .nextColor (len (_fcd ._eb .Ser ));_bd :=_c .NewCT_BarSer ();_fcd ._eb .Ser =append (_fcd ._eb .Ser ,_bd );_bd .Idx .ValAttr =uint32 (len (_fcd ._eb .Ser )-1);_bd .Order .ValAttr =uint32 (len (_fcd ._eb .Ser )-1);_ba :=BarChartSeries {_bd };_ba .InitializeDefaults ();_ba .Properties ().SetSolidFill (_dfg );return _ba ;};func (_fbf Legend )Properties ()_e .ShapeProperties {if _fbf ._aef .SpPr ==nil {_fbf ._aef .SpPr =_d .NewCT_ShapeProperties ();};return _e .MakeShapeProperties (_fbf ._aef .SpPr );};
|
||||
|
||||
// Marker returns the marker properties.
|
||||
func (_dfcd LineChartSeries )Marker ()Marker {if _dfcd ._ggcf .Marker ==nil {_dfcd ._ggcf .Marker =_c .NewCT_Marker ();};return MakeMarker (_dfcd ._ggcf .Marker );};func MakeNumberDataSource (x *_c .CT_NumDataSource )NumberDataSource {return NumberDataSource {x }};func (_dae SeriesAxis )InitializeDefaults (){};func (_cbf CategoryAxis )SetCrosses (axis Axis ){_cbf ._bfb .Choice =_c .NewEG_AxSharedChoice ();_cbf ._bfb .Choice .Crosses =_c .NewCT_Crosses ();_cbf ._bfb .Choice .Crosses .ValAttr =_c .ST_CrossesAutoZero ;_cbf ._bfb .CrossAx .ValAttr =axis .AxisID ();};
|
||||
|
||||
// AddSeries adds a default series to a Stock chart.
|
||||
func (_cfce StockChart )AddSeries ()LineChartSeries {_ggbg :=_c .NewCT_LineSer ();_cfce ._agb .Ser =append (_cfce ._agb .Ser ,_ggbg );_ggbg .Idx .ValAttr =uint32 (len (_cfce ._agb .Ser )-1);_ggbg .Order .ValAttr =uint32 (len (_cfce ._agb .Ser )-1);_bbed :=LineChartSeries {_ggbg };_bbed .Values ().CreateEmptyNumberCache ();_bbed .Properties ().LineProperties ().SetNoFill ();return _bbed ;};func (_bf BubbleChart )AddAxis (axis Axis ){_dd :=_c .NewCT_UnsignedInt ();_dd .ValAttr =axis .AxisID ();_bf ._ebf .AxId =append (_bf ._ebf .AxId ,_dd );};
|
||||
|
||||
// AddSeries adds a default series to an Radar chart.
|
||||
func (_aec RadarChart )AddSeries ()RadarChartSeries {_bgg :=_aec .nextColor (len (_aec ._aac .Ser ));_dcedf :=_c .NewCT_RadarSer ();_aec ._aac .Ser =append (_aec ._aac .Ser ,_dcedf );_dcedf .Idx .ValAttr =uint32 (len (_aec ._aac .Ser )-1);_dcedf .Order .ValAttr =uint32 (len (_aec ._aac .Ser )-1);_agf :=RadarChartSeries {_dcedf };_agf .InitializeDefaults ();_agf .Properties ().SetSolidFill (_bgg );return _agf ;};func (_cfcc ScatterChart )InitializeDefaults (){_cfcc ._gfa .ScatterStyle .ValAttr =_c .ST_ScatterStyleMarker ;};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_eg AreaChart )X ()*_c .CT_AreaChart {return _eg ._bg };
|
||||
|
||||
// RemoveTitle removes any existing title from the chart.
|
||||
func (_gagd Chart )RemoveTitle (){_gagd ._ag .Chart .Title =nil ;_gagd ._ag .Chart .AutoTitleDeleted =_c .NewCT_Boolean ();_gagd ._ag .Chart .AutoTitleDeleted .ValAttr =_f .Bool (true );};
|
||||
|
||||
// SetText sets the series text.
|
||||
func (_bad PieChartSeries )SetText (s string ){_bad ._abab .Tx =_c .NewCT_SerTx ();_bad ._abab .Tx .Choice .V =&s ;};
|
||||
|
||||
// BarChart is a 2D bar chart.
|
||||
type BarChart struct{chartBase ;_baa *_c .CT_BarChart ;};
|
||||
|
||||
// RadarChartSeries is a series to be used on an Radar chart.
|
||||
type RadarChartSeries struct{_ggce *_c .CT_RadarSer };
|
||||
|
||||
// AddAxis adds an axis to a Scatter chart.
|
||||
func (_dega ScatterChart )AddAxis (axis Axis ){_gaa :=_c .NewCT_UnsignedInt ();_gaa .ValAttr =axis .AxisID ();_dega ._gfa .AxId =append (_dega ._gfa .AxId ,_gaa );};
|
||||
|
||||
// AddLineChart adds a new line chart to a chart.
|
||||
func (_afd Chart )AddLineChart ()LineChart {_ecf :=_c .NewCT_PlotAreaChoice ();_afd ._ag .Chart .PlotArea .Choice =append (_afd ._ag .Chart .PlotArea .Choice ,_ecf );_ecf .LineChart =_c .NewCT_LineChart ();_ecf .LineChart .Grouping =_c .NewCT_Grouping ();_ecf .LineChart .Grouping .ValAttr =_c .ST_GroupingStandard ;return LineChart {_bge :_ecf .LineChart };};func (_bdfc ValueAxis )AxisID ()uint32 {return _bdfc ._acec .AxId .ValAttr };
|
||||
|
||||
// AddBubbleChart adds a new bubble chart.
|
||||
func (_bfe Chart )AddBubbleChart ()BubbleChart {_dced :=_c .NewCT_PlotAreaChoice ();_bfe ._ag .Chart .PlotArea .Choice =append (_bfe ._ag .Chart .PlotArea .Choice ,_dced );_dced .BubbleChart =_c .NewCT_BubbleChart ();_dad :=BubbleChart {_ebf :_dced .BubbleChart };_dad .InitializeDefaults ();return _dad ;};
|
||||
|
||||
// CategoryAxis returns the category data source.
|
||||
func (_ae BarChartSeries )CategoryAxis ()CategoryAxisDataSource {if _ae ._deb .Cat ==nil {_ae ._deb .Cat =_c .NewCT_AxDataSource ();};return MakeAxisDataSource (_ae ._deb .Cat );};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_aecf ScatterChart )X ()*_c .CT_ScatterChart {return _aecf ._gfa };func (_gdb CategoryAxis )Properties ()_e .ShapeProperties {if _gdb ._bfb .SpPr ==nil {_gdb ._bfb .SpPr =_d .NewCT_ShapeProperties ();};return _e .MakeShapeProperties (_gdb ._bfb .SpPr );};
|
||||
|
||||
// InitializeDefaults the bar chart to its defaults
|
||||
func (_cdc DoughnutChart )InitializeDefaults (){_cdc ._eefd .VaryColors =_c .NewCT_Boolean ();_cdc ._eefd .VaryColors .ValAttr =_f .Bool (true );_cdc ._eefd .HoleSize =_c .NewCT_HoleSize ();_cdc ._eefd .HoleSize .ValAttr =&_c .ST_HoleSize {};_cdc ._eefd .HoleSize .ValAttr .ST_HoleSizeUByte =_f .Uint8 (50);};
|
||||
|
||||
// Properties returns the line chart series shape properties.
|
||||
func (_bfef SurfaceChartSeries )Properties ()_e .ShapeProperties {if _bfef ._cab .SpPr ==nil {_bfef ._cab .SpPr =_d .NewCT_ShapeProperties ();};return _e .MakeShapeProperties (_bfef ._cab .SpPr );};func (_baed DataLabels )SetShowLeaderLines (b bool ){_baed .ensureChoice ();_baed ._dfc .Choice .ShowLeaderLines =_c .NewCT_Boolean ();_baed ._dfc .Choice .ShowLeaderLines .ValAttr =_f .Bool (b );};
|
||||
|
||||
// Labels returns the data label properties.
|
||||
func (_bed ScatterChartSeries )Labels ()DataLabels {if _bed ._dba .DLbls ==nil {_bed ._dba .DLbls =_c .NewCT_DLbls ();};return MakeDataLabels (_bed ._dba .DLbls );};
|
||||
|
||||
// Properties returns the bar chart series shape properties.
|
||||
func (_ff BarChartSeries )Properties ()_e .ShapeProperties {if _ff ._deb .SpPr ==nil {_ff ._deb .SpPr =_d .NewCT_ShapeProperties ();};return _e .MakeShapeProperties (_ff ._deb .SpPr );};
|
||||
|
||||
// SetLabelReference is used to set the source data to a range of cells
|
||||
// containing strings.
|
||||
func (_dea CategoryAxisDataSource )SetLabelReference (s string ){_dea ._dab .Choice =_a .NewCT_AxDataSourceChoice ();_dea ._dab .Choice .StrRef =_a .NewCT_StrRef ();_dea ._dab .Choice .StrRef .F =s ;};
|
||||
|
||||
// SetIndex sets the index of the series
|
||||
func (_egd SurfaceChartSeries )SetIndex (idx uint32 ){_egd ._cacg .Idx .ValAttr =idx };
|
||||
|
||||
// InitializeDefaults the bar chart to its defaults
|
||||
func (_edga PieChart )InitializeDefaults (){_edga ._ddg .VaryColors =_a .NewCT_Boolean ();_edga ._ddg .VaryColors .ValAttr =_cf .Bool (true );};
|
||||
func (_bdc CategoryAxisDataSource )SetLabelReference (s string ){_bdc ._ge .Choice =_c .NewCT_AxDataSourceChoice ();_bdc ._ge .Choice .StrRef =_c .NewCT_StrRef ();_bdc ._ge .Choice .StrRef .F =s ;};func (_bggb Title )ParagraphProperties ()_e .ParagraphProperties {if _bggb ._fcbc .Tx ==nil {_bggb .SetText ("");};if _bggb ._fcbc .Tx .Choice .Rich .P [0].PPr ==nil {_bggb ._fcbc .Tx .Choice .Rich .P [0].PPr =_d .NewCT_TextParagraphProperties ();};return _e .MakeParagraphProperties (_bggb ._fcbc .Tx .Choice .Rich .P [0].PPr );};type Title struct{_fcbc *_c .CT_Title };func MakeChart (x *_c .ChartSpace )Chart {return Chart {x }};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_fcebb Surface3DChart )X ()*_a .CT_Surface3DChart {return _fcebb ._bfcb };
|
||||
func (_dac ScatterChartSeries )X ()*_c .CT_ScatterSer {return _dac ._dba };
|
||||
|
||||
// Values returns the value data source.
|
||||
func (_fefc BarChartSeries )Values ()NumberDataSource {if _fefc ._gbb .Val ==nil {_fefc ._gbb .Val =_a .NewCT_NumDataSource ();};return MakeNumberDataSource (_fefc ._gbb .Val );};
|
||||
// RadarChart is an Radar chart that has a shaded Radar underneath a curve.
|
||||
type RadarChart struct{chartBase ;_aac *_c .CT_RadarChart ;};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_bec SeriesAxis )X ()*_a .CT_SerAx {return _bec ._dgbb };
|
||||
func (_ceg StockChart )X ()*_c .CT_StockChart {return _ceg ._agb };type DataLabels struct{_dfc *_c .CT_DLbls };func MakeTitle (x *_c .CT_Title )Title {return Title {x }};
|
||||
|
||||
// InitializeDefaults initializes a bar chart series to the default values.
|
||||
func (_cbb BarChartSeries )InitializeDefaults (){};
|
||||
// AddTitle sets a new title on the chart.
|
||||
func (_aeb Chart )AddTitle ()Title {_aeb ._ag .Chart .Title =_c .NewCT_Title ();_aeb ._ag .Chart .Title .Overlay =_c .NewCT_Boolean ();_aeb ._ag .Chart .Title .Overlay .ValAttr =_f .Bool (false );_aeb ._ag .Chart .AutoTitleDeleted =_c .NewCT_Boolean ();_aeb ._ag .Chart .AutoTitleDeleted .ValAttr =_f .Bool (false );_efd :=MakeTitle (_aeb ._ag .Chart .Title );_efd .InitializeDefaults ();return _efd ;};func (_addc SurfaceChartSeries )Values ()NumberDataSource {if _addc ._cab .Val ==nil {_addc ._cab .Val =_c .NewCT_NumDataSource ();};_agef :=MakeNumberDataSource (_addc ._cab .Val );_agef .CreateEmptyNumberCache ();return _agef ;};func (_eccb LineChartSeries )InitializeDefaults (){_eccb .Properties ().LineProperties ().SetWidth (1*_cg .Point );_eccb .Properties ().LineProperties ().SetSolidFill (_ad .Black );_eccb .Properties ().LineProperties ().SetJoin (_e .LineJoinRound );_eccb .Marker ().SetSymbol (_c .ST_MarkerStyleNone );_eccb .Labels ().SetShowLegendKey (false );_eccb .Labels ().SetShowValue (false );_eccb .Labels ().SetShowPercent (false );_eccb .Labels ().SetShowCategoryName (false );_eccb .Labels ().SetShowSeriesName (false );_eccb .Labels ().SetShowLeaderLines (false );};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_edgg Pie3DChart )X ()*_a .CT_Pie3DChart {return _edgg ._cfdb };
|
||||
|
||||
// InitializeDefaults initializes an Pie series to the default values.
|
||||
func (_ddf PieChartSeries )InitializeDefaults (){};func MakeChart (x *_a .ChartSpace )Chart {return Chart {x }};
|
||||
|
||||
// AddSeries adds a default series to a Surface chart.
|
||||
func (_ccg Surface3DChart )AddSeries ()SurfaceChartSeries {_eafc :=_ccg .nextColor (len (_ccg ._bfcb .Ser ));_bgad :=_a .NewCT_SurfaceSer ();_ccg ._bfcb .Ser =append (_ccg ._bfcb .Ser ,_bgad );_bgad .Idx .ValAttr =uint32 (len (_ccg ._bfcb .Ser )-1);_bgad .Order .ValAttr =uint32 (len (_ccg ._bfcb .Ser )-1);_adde :=SurfaceChartSeries {_bgad };_adde .InitializeDefaults ();_adde .Properties ().LineProperties ().SetSolidFill (_eafc );return _adde ;};func MakeTitle (x *_a .CT_Title )Title {return Title {x }};
|
||||
func (_ced GridLines )X ()*_c .CT_ChartLines {return _ced ._deg };type SeriesAxis struct{_bdb *_c .CT_SerAx };
|
||||
|
||||
// CategoryAxis returns the category data source.
|
||||
func (_edg BubbleChartSeries )CategoryAxis ()CategoryAxisDataSource {if _edg ._gfe .XVal ==nil {_edg ._gfe .XVal =_a .NewCT_AxDataSource ();};return MakeAxisDataSource (_edg ._gfe .XVal );};func (_dgd LineChartSeries )Values ()NumberDataSource {if _dgd ._aabc .Val ==nil {_dgd ._aabc .Val =_a .NewCT_NumDataSource ();};return MakeNumberDataSource (_dgd ._aabc .Val );};
|
||||
|
||||
// Index returns the index of the series
|
||||
func (_gga ScatterChartSeries )Index ()uint32 {return _gga ._fdd .Idx .ValAttr };
|
||||
|
||||
// AddSeries adds a default series to a bar chart.
|
||||
func (_eeg BarChart )AddSeries ()BarChartSeries {_dge :=_eeg .nextColor (len (_eeg ._dfd .Ser ));_dd :=_a .NewCT_BarSer ();_eeg ._dfd .Ser =append (_eeg ._dfd .Ser ,_dd );_dd .Idx .ValAttr =uint32 (len (_eeg ._dfd .Ser )-1);_dd .Order .ValAttr =uint32 (len (_eeg ._dfd .Ser )-1);_bf :=BarChartSeries {_dd };_bf .InitializeDefaults ();_bf .Properties ().SetSolidFill (_dge );return _bf ;};
|
||||
|
||||
// SetText sets the series text.
|
||||
func (_def PieChartSeries )SetText (s string ){_def ._fca .Tx =_a .NewCT_SerTx ();_def ._fca .Tx .Choice .V =&s ;};
|
||||
|
||||
// SetOrder sets the order of the series
|
||||
func (_fgb SurfaceChartSeries )SetOrder (idx uint32 ){_fgb ._cacg .Order .ValAttr =idx };
|
||||
func (_def PieChartSeries )CategoryAxis ()CategoryAxisDataSource {if _def ._abab .Cat ==nil {_def ._abab .Cat =_c .NewCT_AxDataSource ();};return MakeAxisDataSource (_def ._abab .Cat );};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_agbd RadarChart )X ()*_a .CT_RadarChart {return _agbd ._gce };func (_abg ValueAxis )AxisID ()uint32 {return _abg ._aabbf .AxId .ValAttr };
|
||||
func (_fg BarChartSeries )X ()*_c .CT_BarSer {return _fg ._deb };func (_afb DataLabels )SetShowPercent (b bool ){_afb .ensureChoice ();_afb ._dfc .Choice .ShowPercent =_c .NewCT_Boolean ();_afb ._dfc .Choice .ShowPercent .ValAttr =_f .Bool (b );};func (_gfb nullAxis )AxisID ()uint32 {return 0};
|
||||
|
||||
// Bar3DChart is a 3D bar chart.
|
||||
type Bar3DChart struct{chartBase ;_dfc *_a .CT_Bar3DChart ;};
|
||||
// AddRadarChart adds a new radar chart to a chart.
|
||||
func (_efcd Chart )AddRadarChart ()RadarChart {_ggc :=_c .NewCT_PlotAreaChoice ();_efcd ._ag .Chart .PlotArea .Choice =append (_efcd ._ag .Chart .PlotArea .Choice ,_ggc );_ggc .RadarChart =_c .NewCT_RadarChart ();_eef :=RadarChart {_aac :_ggc .RadarChart };_eef .InitializeDefaults ();return _eef ;};
|
||||
|
||||
// Values returns the value data source.
|
||||
func (_adc AreaChartSeries )Values ()NumberDataSource {if _adc ._ag .Val ==nil {_adc ._ag .Val =_a .NewCT_NumDataSource ();};return MakeNumberDataSource (_adc ._ag .Val );};
|
||||
// AreaChart is an area chart that has a shaded area underneath a curve.
|
||||
type AreaChart struct{chartBase ;_bg *_c .CT_AreaChart ;};
|
||||
|
||||
// Properties returns the bar chart series shape properties.
|
||||
func (_cb AreaChartSeries )Properties ()_e .ShapeProperties {if _cb ._bba .SpPr ==nil {_cb ._bba .SpPr =_d .NewCT_ShapeProperties ();};return _e .MakeShapeProperties (_cb ._bba .SpPr );};func (_cba SurfaceChartSeries )InitializeDefaults (){_cba .Properties ().LineProperties ().SetWidth (1*_cg .Point );_cba .Properties ().LineProperties ().SetSolidFill (_ad .Black );_cba .Properties ().LineProperties ().SetJoin (_e .LineJoinRound );};type SurfaceChartSeries struct{_cab *_c .CT_SurfaceSer };func (_egb DateAxis )SetMinorTickMark (m _c .ST_TickMark ){if m ==_c .ST_TickMarkUnset {_egb ._ebe .MinorTickMark =nil ;}else {_egb ._ebe .MinorTickMark =_c .NewCT_TickMark ();_egb ._ebe .MinorTickMark .ValAttr =m ;};};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_fecb PieChart )X ()*_c .CT_PieChart {return _fecb ._cccd };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_dbb Surface3DChart )X ()*_c .CT_Surface3DChart {return _dbb ._cde };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_bbc Legend )X ()*_c .CT_Legend {return _bbc ._aef };
|
||||
|
||||
// Chart is a generic chart.
|
||||
type Chart struct{_ag *_c .ChartSpace };func (_fbd StockChart )AddAxis (axis Axis ){_feeef :=_c .NewCT_UnsignedInt ();_feeef .ValAttr =axis .AxisID ();_fbd ._agb .AxId =append (_fbd ._agb .AxId ,_feeef );};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_cgf SurfaceChart )X ()*_c .CT_SurfaceChart {return _cgf ._debg };
|
||||
|
||||
// AddAxis adds an axis to a line chart.
|
||||
func (_ab Line3DChart )AddAxis (axis Axis ){_fbb :=_a .NewCT_UnsignedInt ();_fbb .ValAttr =axis .AxisID ();_ab ._fdg .AxId =append (_ab ._fdg .AxId ,_fbb );};
|
||||
|
||||
// SetText sets the series text.
|
||||
func (_gfc AreaChartSeries )SetText (s string ){_gfc ._ag .Tx =_a .NewCT_SerTx ();_gfc ._ag .Tx .Choice .V =&s ;};
|
||||
|
||||
// Values returns the value data source.
|
||||
func (_ebd PieChartSeries )Values ()NumberDataSource {if _ebd ._fca .Val ==nil {_ebd ._fca .Val =_a .NewCT_NumDataSource ();};return MakeNumberDataSource (_ebd ._fca .Val );};
|
||||
|
||||
// AddDateAxis adds a value axis to the chart.
|
||||
func (_fba Chart )AddDateAxis ()DateAxis {_ebc :=_a .NewCT_DateAx ();if _fba ._egg .Chart .PlotArea .CChoice ==nil {_fba ._egg .Chart .PlotArea .CChoice =_a .NewCT_PlotAreaChoice1 ();};_ebc .AxId =_a .NewCT_UnsignedInt ();_ebc .AxId .ValAttr =0x7FFFFFFF&_ad .Uint32 ();_fba ._egg .Chart .PlotArea .CChoice .DateAx =append (_fba ._egg .Chart .PlotArea .CChoice .DateAx ,_ebc );_ebc .Delete =_a .NewCT_Boolean ();_ebc .Delete .ValAttr =_cf .Bool (false );_ebc .Scaling =_a .NewCT_Scaling ();_ebc .Scaling .Orientation =_a .NewCT_Orientation ();_ebc .Scaling .Orientation .ValAttr =_a .ST_OrientationMinMax ;_ebc .Choice =&_a .EG_AxSharedChoice {};_ebc .Choice .Crosses =_a .NewCT_Crosses ();_ebc .Choice .Crosses .ValAttr =_a .ST_CrossesAutoZero ;_dcb :=DateAxis {_ebc };_dcb .MajorGridLines ().Properties ().LineProperties ().SetSolidFill (_cg .LightGray );_dcb .SetMajorTickMark (_a .ST_TickMarkOut );_dcb .SetMinorTickMark (_a .ST_TickMarkIn );_dcb .SetTickLabelPosition (_a .ST_TickLblPosNextTo );_dcb .Properties ().LineProperties ().SetSolidFill (_cg .Black );_dcb .SetPosition (_a .ST_AxPosL );return _dcb ;};
|
||||
|
||||
// AddArea3DChart adds a new area chart to a chart.
|
||||
func (_bbcc Chart )AddArea3DChart ()Area3DChart {_aad (_bbcc ._egg .Chart );_ccec :=_a .NewCT_PlotAreaChoice ();_bbcc ._egg .Chart .PlotArea .Choice =append (_bbcc ._egg .Chart .PlotArea .Choice ,_ccec );_ccec .Area3DChart =_a .NewCT_Area3DChart ();_cfc :=Area3DChart {_gd :_ccec .Area3DChart };_cfc .InitializeDefaults ();return _cfc ;};
|
||||
|
||||
// AddLine3DChart adds a new 3D line chart to a chart.
|
||||
func (_bag Chart )AddLine3DChart ()Line3DChart {_aad (_bag ._egg .Chart );_gfb :=_a .NewCT_PlotAreaChoice ();_bag ._egg .Chart .PlotArea .Choice =append (_bag ._egg .Chart .PlotArea .Choice ,_gfb );_gfb .Line3DChart =_a .NewCT_Line3DChart ();_gfb .Line3DChart .Grouping =_a .NewCT_Grouping ();_gfb .Line3DChart .Grouping .ValAttr =_a .ST_GroupingStandard ;return Line3DChart {_fdg :_gfb .Line3DChart };};var _bea =[]_cg .Color {_cg .RGB (0x33,0x66,0xcc),_cg .RGB (0xDC,0x39,0x12),_cg .RGB (0xFF,0x99,0x00),_cg .RGB (0x10,0x96,0x18),_cg .RGB (0x99,0x00,0x99),_cg .RGB (0x3B,0x3E,0xAC),_cg .RGB (0x00,0x99,0xC6),_cg .RGB (0xDD,0x44,0x77),_cg .RGB (0x66,0xAA,0x00),_cg .RGB (0xB8,0x2E,0x2E),_cg .RGB (0x31,0x63,0x95),_cg .RGB (0x99,0x44,0x99),_cg .RGB (0x22,0xAA,0x99),_cg .RGB (0xAA,0xAA,0x11),_cg .RGB (0x66,0x33,0xCC),_cg .RGB (0xE6,0x73,0x00),_cg .RGB (0x8B,0x07,0x07),_cg .RGB (0x32,0x92,0x62),_cg .RGB (0x55,0x74,0xA6),_cg .RGB (0x3B,0x3E,0xAC)};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_fcca ScatterChart )X ()*_a .CT_ScatterChart {return _fcca ._dcgf };func (_ed nullAxis )AxisID ()uint32 {return 0};
|
||||
|
||||
// AreaChartSeries is a series to be used on an area chart.
|
||||
type AreaChartSeries struct{_ag *_a .CT_AreaSer };func (_daae SurfaceChartSeries )InitializeDefaults (){_daae .Properties ().LineProperties ().SetWidth (1*_g .Point );_daae .Properties ().LineProperties ().SetSolidFill (_cg .Black );_daae .Properties ().LineProperties ().SetJoin (_f .LineJoinRound );};func (_cfd AreaChart )AddAxis (axis Axis ){_fe :=_a .NewCT_UnsignedInt ();_fe .ValAttr =axis .AxisID ();_cfd ._da .AxId =append (_cfd ._da .AxId ,_fe );};
|
||||
|
||||
// SetDirection changes the direction of the bar chart (bar or column).
|
||||
func (_ada BarChart )SetDirection (d _a .ST_BarDir ){_ada ._dfd .BarDir .ValAttr =d };func (_dcaf ValueAxis )SetMinorTickMark (m _a .ST_TickMark ){if m ==_a .ST_TickMarkUnset {_dcaf ._aabbf .MinorTickMark =nil ;}else {_dcaf ._aabbf .MinorTickMark =_a .NewCT_TickMark ();_dcaf ._aabbf .MinorTickMark .ValAttr =m ;};};
|
||||
|
||||
// StockChart is a 2D Stock chart.
|
||||
type StockChart struct{chartBase ;_addb *_a .CT_StockChart ;};func (_gba CategoryAxis )MajorGridLines ()GridLines {if _gba ._acc .MajorGridlines ==nil {_gba ._acc .MajorGridlines =_a .NewCT_ChartLines ();};return GridLines {_gba ._acc .MajorGridlines };};
|
||||
|
||||
// Surface3DChart is a 3D view of a surface chart.
|
||||
type Surface3DChart struct{chartBase ;_bfcb *_a .CT_Surface3DChart ;};func (_cde NumberDataSource )ensureChoice (){if _cde ._edd .Choice ==nil {_cde ._edd .Choice =_a .NewCT_NumDataSourceChoice ();};};
|
||||
|
||||
// SetText sets the series text
|
||||
func (_dfdba ScatterChartSeries )SetText (s string ){_dfdba ._fdd .Tx =_a .NewCT_SerTx ();_dfdba ._fdd .Tx .Choice .V =&s ;};func (_ggcb SeriesAxis )AxisID ()uint32 {return _ggcb ._dgbb .AxId .ValAttr };func (_fccad Title )ParagraphProperties ()_f .ParagraphProperties {if _fccad ._dcgg .Tx ==nil {_fccad .SetText ("");};if _fccad ._dcgg .Tx .Choice .Rich .P [0].PPr ==nil {_fccad ._dcgg .Tx .Choice .Rich .P [0].PPr =_d .NewCT_TextParagraphProperties ();};return _f .MakeParagraphProperties (_fccad ._dcgg .Tx .Choice .Rich .P [0].PPr );};func (_dc CategoryAxis )SetCrosses (axis Axis ){_dc ._acc .Choice =_a .NewEG_AxSharedChoice ();_dc ._acc .Choice .Crosses =_a .NewCT_Crosses ();_dc ._acc .Choice .Crosses .ValAttr =_a .ST_CrossesAutoZero ;_dc ._acc .CrossAx .ValAttr =axis .AxisID ();};
|
||||
|
||||
// Properties returns the line chart series shape properties.
|
||||
func (_gag ScatterChartSeries )Properties ()_f .ShapeProperties {if _gag ._fdd .SpPr ==nil {_gag ._fdd .SpPr =_d .NewCT_ShapeProperties ();};return _f .MakeShapeProperties (_gag ._fdd .SpPr );};type Line3DChart struct{chartBase ;_fdg *_a .CT_Line3DChart ;};func (_fge ScatterChartSeries )Values ()NumberDataSource {if _fge ._fdd .YVal ==nil {_fge ._fdd .YVal =_a .NewCT_NumDataSource ();};return MakeNumberDataSource (_fge ._fdd .YVal );};func MakeValueAxis (x *_a .CT_ValAx )ValueAxis {return ValueAxis {x }};func (_abd SurfaceChart )InitializeDefaults (){_abd ._fcab .Wireframe =_a .NewCT_Boolean ();_abd ._fcab .Wireframe .ValAttr =_cf .Bool (false );_abd ._fcab .BandFmts =_a .NewCT_BandFmts ();for _dadf :=0;_dadf < 15;_dadf ++{_ffg :=_a .NewCT_BandFmt ();_ffg .Idx .ValAttr =uint32 (_dadf );_ffg .SpPr =_d .NewCT_ShapeProperties ();_feea :=_f .MakeShapeProperties (_ffg .SpPr );_feea .SetSolidFill (_abd .nextColor (_dadf ));_abd ._fcab .BandFmts .BandFmt =append (_abd ._fcab .BandFmts .BandFmt ,_ffg );};};func (_cd BarChart )AddAxis (axis Axis ){_fga :=_a .NewCT_UnsignedInt ();_fga .ValAttr =axis .AxisID ();_cd ._dfd .AxId =append (_cd ._dfd .AxId ,_fga );};
|
||||
|
||||
// Properties returns the Bubble chart series shape properties.
|
||||
func (_cgb BubbleChartSeries )Properties ()_f .ShapeProperties {if _cgb ._gfe .SpPr ==nil {_cgb ._gfe .SpPr =_d .NewCT_ShapeProperties ();};return _f .MakeShapeProperties (_cgb ._gfe .SpPr );};func (_caa DataLabels )SetShowLeaderLines (b bool ){_caa .ensureChoice ();_caa ._dca .Choice .ShowLeaderLines =_a .NewCT_Boolean ();_caa ._dca .Choice .ShowLeaderLines .ValAttr =_cf .Bool (b );};
|
||||
|
||||
// Properties returns the line chart series shape properties.
|
||||
func (_baag SurfaceChartSeries )Properties ()_f .ShapeProperties {if _baag ._cacg .SpPr ==nil {_baag ._cacg .SpPr =_d .NewCT_ShapeProperties ();};return _f .MakeShapeProperties (_baag ._cacg .SpPr );};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_b Area3DChart )X ()*_a .CT_Area3DChart {return _b ._gd };
|
||||
|
||||
// SurfaceChart is a 3D surface chart, viewed from the top-down.
|
||||
type SurfaceChart struct{chartBase ;_fcab *_a .CT_SurfaceChart ;};
|
||||
func (_acg Line3DChart )AddAxis (axis Axis ){_eebg :=_c .NewCT_UnsignedInt ();_eebg .ValAttr =axis .AxisID ();_acg ._dgb .AxId =append (_acg ._dgb .AxId ,_eebg );};
|
||||
|
||||
// Labels returns the data label properties.
|
||||
func (_dcbd LineChartSeries )Labels ()DataLabels {if _dcbd ._aabc .DLbls ==nil {_dcbd ._aabc .DLbls =_a .NewCT_DLbls ();};return MakeDataLabels (_dcbd ._aabc .DLbls );};
|
||||
|
||||
// AddSeries adds a default series to an area chart.
|
||||
func (_cc AreaChart )AddSeries ()AreaChartSeries {_gf :=_cc .nextColor (len (_cc ._da .Ser ));_gb :=_a .NewCT_AreaSer ();_cc ._da .Ser =append (_cc ._da .Ser ,_gb );_gb .Idx .ValAttr =uint32 (len (_cc ._da .Ser )-1);_gb .Order .ValAttr =uint32 (len (_cc ._da .Ser )-1);_gbe :=AreaChartSeries {_gb };_gbe .InitializeDefaults ();_gbe .Properties ().SetSolidFill (_gf );return _gbe ;};
|
||||
|
||||
// AddSeries adds a default series to a Bubble chart.
|
||||
func (_bbg BubbleChart )AddSeries ()BubbleChartSeries {_eae :=_bbg .nextColor (len (_bbg ._aga .Ser ));_agc :=_a .NewCT_BubbleSer ();_bbg ._aga .Ser =append (_bbg ._aga .Ser ,_agc );_agc .Idx .ValAttr =uint32 (len (_bbg ._aga .Ser )-1);_agc .Order .ValAttr =uint32 (len (_bbg ._aga .Ser )-1);_adb :=BubbleChartSeries {_agc };_adb .InitializeDefaults ();_adb .Properties ().SetSolidFill (_eae );return _adb ;};
|
||||
|
||||
// AddValueAxis adds a value axis to the chart.
|
||||
func (_agb Chart )AddValueAxis ()ValueAxis {_bbgc :=_a .NewCT_ValAx ();if _agb ._egg .Chart .PlotArea .CChoice ==nil {_agb ._egg .Chart .PlotArea .CChoice =_a .NewCT_PlotAreaChoice1 ();};_bbgc .AxId =_a .NewCT_UnsignedInt ();_bbgc .AxId .ValAttr =0x7FFFFFFF&_ad .Uint32 ();_agb ._egg .Chart .PlotArea .CChoice .ValAx =append (_agb ._egg .Chart .PlotArea .CChoice .ValAx ,_bbgc );_bbgc .Delete =_a .NewCT_Boolean ();_bbgc .Delete .ValAttr =_cf .Bool (false );_bbgc .Scaling =_a .NewCT_Scaling ();_bbgc .Scaling .Orientation =_a .NewCT_Orientation ();_bbgc .Scaling .Orientation .ValAttr =_a .ST_OrientationMinMax ;_bbgc .Choice =&_a .EG_AxSharedChoice {};_bbgc .Choice .Crosses =_a .NewCT_Crosses ();_bbgc .Choice .Crosses .ValAttr =_a .ST_CrossesAutoZero ;_bbgc .CrossBetween =_a .NewCT_CrossBetween ();_bbgc .CrossBetween .ValAttr =_a .ST_CrossBetweenBetween ;_aag :=MakeValueAxis (_bbgc );_aag .MajorGridLines ().Properties ().LineProperties ().SetSolidFill (_cg .LightGray );_aag .SetMajorTickMark (_a .ST_TickMarkOut );_aag .SetMinorTickMark (_a .ST_TickMarkIn );_aag .SetTickLabelPosition (_a .ST_TickLblPosNextTo );_aag .Properties ().LineProperties ().SetSolidFill (_cg .Black );_aag .SetPosition (_a .ST_AxPosL );return _aag ;};
|
||||
|
||||
// InitializeDefaults the bar chart to its defaults
|
||||
func (_gbbe PieOfPieChart )InitializeDefaults (){_gbbe ._geg .VaryColors =_a .NewCT_Boolean ();_gbbe ._geg .VaryColors .ValAttr =_cf .Bool (true );_gbbe .SetType (_a .ST_OfPieTypePie );_gbbe ._geg .SecondPieSize =_a .NewCT_SecondPieSize ();_gbbe ._geg .SecondPieSize .ValAttr =&_a .ST_SecondPieSize {};_gbbe ._geg .SecondPieSize .ValAttr .ST_SecondPieSizeUShort =_cf .Uint16 (75);_gggd :=_a .NewCT_ChartLines ();_gggd .SpPr =_d .NewCT_ShapeProperties ();_eab :=_f .MakeShapeProperties (_gggd .SpPr );_eab .LineProperties ().SetSolidFill (_cg .Auto );_gbbe ._geg .SerLines =append (_gbbe ._geg .SerLines ,_gggd );};func MakeCategoryAxis (x *_a .CT_CatAx )CategoryAxis {return CategoryAxis {x }};
|
||||
|
||||
// InitializeDefaults the bar chart to its defaults
|
||||
func (_e Area3DChart )InitializeDefaults (){};
|
||||
|
||||
// InitializeDefaults initializes an Radar series to the default values.
|
||||
func (_feac RadarChartSeries )InitializeDefaults (){};func MakeDataLabels (x *_a .CT_DLbls )DataLabels {return DataLabels {x }};func (_ggd DataLabels )SetPosition (p _a .ST_DLblPos ){_ggd .ensureChoice ();_ggd ._dca .Choice .DLblPos =_a .NewCT_DLblPos ();_ggd ._dca .Choice .DLblPos .ValAttr =p ;};
|
||||
|
||||
// BubbleChart is a 2D Bubble chart.
|
||||
type BubbleChart struct{chartBase ;_aga *_a .CT_BubbleChart ;};
|
||||
|
||||
// AddAxis adds an axis to a Surface chart.
|
||||
func (_fgad Surface3DChart )AddAxis (axis Axis ){_ebgf :=_a .NewCT_UnsignedInt ();_ebgf .ValAttr =axis .AxisID ();_fgad ._bfcb .AxId =append (_fgad ._bfcb .AxId ,_ebgf );};
|
||||
|
||||
// InitializeDefaults the bar chart to its defaults
|
||||
func (_cfb BarChart )InitializeDefaults (){_cfb .SetDirection (_a .ST_BarDirCol )};func (_cfba ValueAxis )Properties ()_f .ShapeProperties {if _cfba ._aabbf .SpPr ==nil {_cfba ._aabbf .SpPr =_d .NewCT_ShapeProperties ();};return _f .MakeShapeProperties (_cfba ._aabbf .SpPr );};
|
||||
|
||||
// SetIndex sets the index of the series
|
||||
func (_aafa LineChartSeries )SetIndex (idx uint32 ){_aafa ._aabc .Idx .ValAttr =idx };
|
||||
|
||||
// DoughnutChart is a Doughnut chart.
|
||||
type DoughnutChart struct{chartBase ;_dcf *_a .CT_DoughnutChart ;};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_bc BubbleChartSeries )X ()*_a .CT_BubbleSer {return _bc ._gfe };
|
||||
func (_abc LineChartSeries )Labels ()DataLabels {if _abc ._ggcf .DLbls ==nil {_abc ._ggcf .DLbls =_c .NewCT_DLbls ();};return MakeDataLabels (_abc ._ggcf .DLbls );};
|
||||
|
||||
// SetText sets the series text.
|
||||
func (_bbc BubbleChartSeries )SetText (s string ){_bbc ._gfe .Tx =_a .NewCT_SerTx ();_bbc ._gfe .Tx .Choice .V =&s ;};
|
||||
func (_eeb AreaChartSeries )SetText (s string ){_eeb ._bba .Tx =_c .NewCT_SerTx ();_eeb ._bba .Tx .Choice .V =&s ;};func (_fge RadarChart )AddAxis (axis Axis ){_bcf :=_c .NewCT_UnsignedInt ();_bcf .ValAttr =axis .AxisID ();_fge ._aac .AxId =append (_fge ._aac .AxId ,_bcf );};
|
||||
|
||||
// CreateEmptyNumberCache creates an empty number cache, which is used sometimes
|
||||
// to increase file format compatibility. It should actually contain the
|
||||
// computed cell data, but just creating an empty one is good enough.
|
||||
func (_af NumberDataSource )CreateEmptyNumberCache (){_af .ensureChoice ();if _af ._edd .Choice .NumRef ==nil {_af ._edd .Choice .NumRef =_a .NewCT_NumRef ();};_af ._edd .Choice .NumLit =nil ;_af ._edd .Choice .NumRef .NumCache =_a .NewCT_NumData ();_af ._edd .Choice .NumRef .NumCache .PtCount =_a .NewCT_UnsignedInt ();_af ._edd .Choice .NumRef .NumCache .PtCount .ValAttr =0;};
|
||||
// AddLine3DChart adds a new 3D line chart to a chart.
|
||||
func (_dfga Chart )AddLine3DChart ()Line3DChart {_dff (_dfga ._ag .Chart );_da :=_c .NewCT_PlotAreaChoice ();_dfga ._ag .Chart .PlotArea .Choice =append (_dfga ._ag .Chart .PlotArea .Choice ,_da );_da .Line3DChart =_c .NewCT_Line3DChart ();_da .Line3DChart .Grouping =_c .NewCT_Grouping ();_da .Line3DChart .Grouping .ValAttr =_c .ST_GroupingStandard ;return Line3DChart {_dgb :_da .Line3DChart };};
|
||||
|
||||
// AddSeries adds a default series to an Pie chart.
|
||||
func (_cca PieChart )AddSeries ()PieChartSeries {_ddeg :=_c .NewCT_PieSer ();_cca ._cccd .Ser =append (_cca ._cccd .Ser ,_ddeg );_ddeg .Idx .ValAttr =uint32 (len (_cca ._cccd .Ser )-1);_ddeg .Order .ValAttr =uint32 (len (_cca ._cccd .Ser )-1);_ebad :=PieChartSeries {_ddeg };_ebad .InitializeDefaults ();return _ebad ;};
|
||||
|
||||
// StockChart is a 2D Stock chart.
|
||||
type StockChart struct{chartBase ;_agb *_c .CT_StockChart ;};
|
||||
|
||||
// InitializeDefaults initializes an Radar series to the default values.
|
||||
func (_cee RadarChartSeries )InitializeDefaults (){};func (_gaf LineChartSeries )CategoryAxis ()CategoryAxisDataSource {if _gaf ._ggcf .Cat ==nil {_gaf ._ggcf .Cat =_c .NewCT_AxDataSource ();};return MakeAxisDataSource (_gaf ._ggcf .Cat );};
|
||||
|
||||
// SetText sets the series text
|
||||
func (_aafcf LineChartSeries )SetText (s string ){_aafcf ._ggcf .Tx =_c .NewCT_SerTx ();_aafcf ._ggcf .Tx .Choice .V =&s ;};
|
||||
|
||||
// AddStockChart adds a new stock chart.
|
||||
func (_bbb Chart )AddStockChart ()StockChart {_efc :=_c .NewCT_PlotAreaChoice ();_bbb ._ag .Chart .PlotArea .Choice =append (_bbb ._ag .Chart .PlotArea .Choice ,_efc );_efc .StockChart =_c .NewCT_StockChart ();_eba :=StockChart {_agb :_efc .StockChart };_eba .InitializeDefaults ();return _eba ;};type Legend struct{_aef *_c .CT_Legend };
|
||||
|
||||
// Area3DChart is an area chart that has a shaded area underneath a curve.
|
||||
type Area3DChart struct{chartBase ;_bc *_c .CT_Area3DChart ;};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_efad RadarChartSeries )X ()*_a .CT_RadarSer {return _efad ._gfbc };
|
||||
func (_fcb BubbleChartSeries )X ()*_c .CT_BubbleSer {return _fcb ._ac };
|
||||
|
||||
// Properties returns the line chart series shape properties.
|
||||
func (_eec LineChartSeries )Properties ()_f .ShapeProperties {if _eec ._aabc .SpPr ==nil {_eec ._aabc .SpPr =_d .NewCT_ShapeProperties ();};return _f .MakeShapeProperties (_eec ._aabc .SpPr );};
|
||||
// SetValues sets values directly on a source.
|
||||
func (_ffc NumberDataSource )SetValues (v []float64 ){_ffc .ensureChoice ();_ffc ._fcgf .Choice .NumRef =nil ;_ffc ._fcgf .Choice .NumLit =_c .NewCT_NumData ();_ffc ._fcgf .Choice .NumLit .PtCount =_c .NewCT_UnsignedInt ();_ffc ._fcgf .Choice .NumLit .PtCount .ValAttr =uint32 (len (v ));for _ccc ,_bfdd :=range v {_ffc ._fcgf .Choice .NumLit .Pt =append (_ffc ._fcgf .Choice .NumLit .Pt ,&_c .CT_NumVal {IdxAttr :uint32 (_ccc ),V :_b .Sprintf ("\u0025\u0067",_bfdd )});};};func (_fbbd Title )RunProperties ()_e .RunProperties {if _fbbd ._fcbc .Tx ==nil {_fbbd .SetText ("");};if _fbbd ._fcbc .Tx .Choice .Rich .P [0].EG_TextRun [0].R .RPr ==nil {_fbbd ._fcbc .Tx .Choice .Rich .P [0].EG_TextRun [0].R .RPr =_d .NewCT_TextCharacterProperties ();};return _e .MakeRunProperties (_fbbd ._fcbc .Tx .Choice .Rich .P [0].EG_TextRun [0].R .RPr );};
|
||||
|
||||
// AddValueAxis adds a value axis to the chart.
|
||||
func (_ddc Chart )AddValueAxis ()ValueAxis {_egc :=_c .NewCT_ValAx ();if _ddc ._ag .Chart .PlotArea .CChoice ==nil {_ddc ._ag .Chart .PlotArea .CChoice =_c .NewCT_PlotAreaChoice1 ();};_egc .AxId =_c .NewCT_UnsignedInt ();_egc .AxId .ValAttr =0x7FFFFFFF&_a .Uint32 ();_ddc ._ag .Chart .PlotArea .CChoice .ValAx =append (_ddc ._ag .Chart .PlotArea .CChoice .ValAx ,_egc );_egc .Delete =_c .NewCT_Boolean ();_egc .Delete .ValAttr =_f .Bool (false );_egc .Scaling =_c .NewCT_Scaling ();_egc .Scaling .Orientation =_c .NewCT_Orientation ();_egc .Scaling .Orientation .ValAttr =_c .ST_OrientationMinMax ;_egc .Choice =&_c .EG_AxSharedChoice {};_egc .Choice .Crosses =_c .NewCT_Crosses ();_egc .Choice .Crosses .ValAttr =_c .ST_CrossesAutoZero ;_egc .CrossBetween =_c .NewCT_CrossBetween ();_egc .CrossBetween .ValAttr =_c .ST_CrossBetweenBetween ;_acc :=MakeValueAxis (_egc );_acc .MajorGridLines ().Properties ().LineProperties ().SetSolidFill (_ad .LightGray );_acc .SetMajorTickMark (_c .ST_TickMarkOut );_acc .SetMinorTickMark (_c .ST_TickMarkIn );_acc .SetTickLabelPosition (_c .ST_TickLblPosNextTo );_acc .Properties ().LineProperties ().SetSolidFill (_ad .Black );_acc .SetPosition (_c .ST_AxPosL );return _acc ;};
|
||||
|
||||
// AddSeries adds a default series to an Pie chart.
|
||||
func (_fbb PieOfPieChart )AddSeries ()PieChartSeries {_agd :=_c .NewCT_PieSer ();_fbb ._ecff .Ser =append (_fbb ._ecff .Ser ,_agd );_agd .Idx .ValAttr =uint32 (len (_fbb ._ecff .Ser )-1);_agd .Order .ValAttr =uint32 (len (_fbb ._ecff .Ser )-1);_ceb :=PieChartSeries {_agd };_ceb .InitializeDefaults ();return _ceb ;};func (_edd ValueAxis )SetMinorTickMark (m _c .ST_TickMark ){if m ==_c .ST_TickMarkUnset {_edd ._acec .MinorTickMark =nil ;}else {_edd ._acec .MinorTickMark =_c .NewCT_TickMark ();_edd ._acec .MinorTickMark .ValAttr =m ;};};func MakeLegend (l *_c .CT_Legend )Legend {return Legend {l }};func (_dffb Marker )Properties ()_e .ShapeProperties {if _dffb ._ffd .SpPr ==nil {_dffb ._ffd .SpPr =_d .NewCT_ShapeProperties ();};return _e .MakeShapeProperties (_dffb ._ffd .SpPr );};func (_bgd DataLabels )SetShowSeriesName (b bool ){_bgd .ensureChoice ();_bgd ._dfc .Choice .ShowSerName =_c .NewCT_Boolean ();_bgd ._dfc .Choice .ShowSerName .ValAttr =_f .Bool (b );};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_ecfg DateAxis )X ()*_c .CT_DateAx {return _ecfg ._ebe };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_fgg ValueAxis )X ()*_c .CT_ValAx {return _fgg ._acec };
|
||||
|
||||
// InitializeDefaults initializes a bar chart series to the default values.
|
||||
func (_ab BarChartSeries )InitializeDefaults (){};
|
||||
|
||||
// SetText sets the series text
|
||||
func (_bfbf ScatterChartSeries )SetText (s string ){_bfbf ._dba .Tx =_c .NewCT_SerTx ();_bfbf ._dba .Tx .Choice .V =&s ;};func (_abae SeriesAxis )AxisID ()uint32 {return _abae ._bdb .AxId .ValAttr };func (_eebe NumberDataSource )SetReference (s string ){_eebe .ensureChoice ();if _eebe ._fcgf .Choice .NumRef ==nil {_eebe ._fcgf .Choice .NumRef =_c .NewCT_NumRef ();};_eebe ._fcgf .Choice .NumRef .F =s ;};
|
||||
|
||||
// AddCategoryAxis adds a category axis.
|
||||
func (_gfbg Chart )AddCategoryAxis ()CategoryAxis {_fgb :=_c .NewCT_CatAx ();if _gfbg ._ag .Chart .PlotArea .CChoice ==nil {_gfbg ._ag .Chart .PlotArea .CChoice =_c .NewCT_PlotAreaChoice1 ();};_fgb .AxId =_c .NewCT_UnsignedInt ();_fgb .AxId .ValAttr =0x7FFFFFFF&_a .Uint32 ();_gfbg ._ag .Chart .PlotArea .CChoice .CatAx =append (_gfbg ._ag .Chart .PlotArea .CChoice .CatAx ,_fgb );_fgb .Auto =_c .NewCT_Boolean ();_fgb .Auto .ValAttr =_f .Bool (true );_fgb .Delete =_c .NewCT_Boolean ();_fgb .Delete .ValAttr =_f .Bool (false );_dgc :=MakeCategoryAxis (_fgb );_dgc .InitializeDefaults ();return _dgc ;};func (_decf DateAxis )SetCrosses (axis Axis ){_decf ._ebe .CrossAx .ValAttr =axis .AxisID ()};func MakeValueAxis (x *_c .CT_ValAx )ValueAxis {return ValueAxis {x }};
|
||||
|
||||
// AddAxis adds an axis to a Surface chart.
|
||||
func (_agc SurfaceChart )AddAxis (axis Axis ){_dgbg :=_c .NewCT_UnsignedInt ();_dgbg .ValAttr =axis .AxisID ();_agc ._debg .AxId =append (_agc ._debg .AxId ,_dgbg );};func (_adcg Title )SetText (s string ){if _adcg ._fcbc .Tx ==nil {_adcg ._fcbc .Tx =_c .NewCT_Tx ();};if _adcg ._fcbc .Tx .Choice .Rich ==nil {_adcg ._fcbc .Tx .Choice .Rich =_d .NewCT_TextBody ();};var _aadf *_d .CT_TextParagraph ;if len (_adcg ._fcbc .Tx .Choice .Rich .P )==0{_aadf =_d .NewCT_TextParagraph ();_adcg ._fcbc .Tx .Choice .Rich .P =[]*_d .CT_TextParagraph {_aadf };}else {_aadf =_adcg ._fcbc .Tx .Choice .Rich .P [0];};var _cbg *_d .EG_TextRun ;if len (_aadf .EG_TextRun )==0{_cbg =_d .NewEG_TextRun ();_aadf .EG_TextRun =[]*_d .EG_TextRun {_cbg };}else {_cbg =_aadf .EG_TextRun [0];};if _cbg .R ==nil {_cbg .R =_d .NewCT_RegularTextRun ();};_cbg .R .T =s ;};func (_adfg CategoryAxis )InitializeDefaults (){_adfg .SetPosition (_c .ST_AxPosB );_adfg .SetMajorTickMark (_c .ST_TickMarkOut );_adfg .SetMinorTickMark (_c .ST_TickMarkIn );_adfg .SetTickLabelPosition (_c .ST_TickLblPosNextTo );_adfg .MajorGridLines ().Properties ().LineProperties ().SetSolidFill (_ad .LightGray );_adfg .Properties ().LineProperties ().SetSolidFill (_ad .Black );};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_dde Line3DChart )X ()*_c .CT_Line3DChart {return _dde ._dgb };
|
||||
|
||||
// SetText sets the series text
|
||||
func (_acd SurfaceChartSeries )SetText (s string ){_acd ._cab .Tx =_c .NewCT_SerTx ();_acd ._cab .Tx .Choice .V =&s ;};
|
||||
|
||||
// SetNumberReference is used to set the source data to a range of cells containing
|
||||
// numbers.
|
||||
func (_efb CategoryAxisDataSource )SetNumberReference (s string ){_efb ._ge .Choice =_c .NewCT_AxDataSourceChoice ();_efb ._ge .Choice .NumRef =_c .NewCT_NumRef ();_efb ._ge .Choice .NumRef .F =s ;};
|
||||
|
||||
// Order returns the order of the series
|
||||
func (_bff SurfaceChartSeries )Order ()uint32 {return _bff ._cab .Order .ValAttr };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_bbg BubbleChart )X ()*_c .CT_BubbleChart {return _bbg ._ebf };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_fbbf Title )X ()*_c .CT_Title {return _fbbf ._fcbc };func (_afa DateAxis )SetPosition (p _c .ST_AxPos ){_afa ._ebe .AxPos =_c .NewCT_AxPos ();_afa ._ebe .AxPos .ValAttr =p ;};
|
||||
|
||||
// AddSeries adds a default series to an area chart.
|
||||
func (_ea Area3DChart )AddSeries ()AreaChartSeries {_de :=_ea .nextColor (len (_ea ._bc .Ser ));_bb :=_c .NewCT_AreaSer ();_ea ._bc .Ser =append (_ea ._bc .Ser ,_bb );_bb .Idx .ValAttr =uint32 (len (_ea ._bc .Ser )-1);_bb .Order .ValAttr =uint32 (len (_ea ._bc .Ser )-1);_ca :=AreaChartSeries {_bb };_ca .InitializeDefaults ();_ca .Properties ().SetSolidFill (_de );return _ca ;};type Marker struct{_ffd *_c .CT_Marker };type NumberDataSource struct{_fcgf *_c .CT_NumDataSource };func (_ggb DataLabels )SetShowValue (b bool ){_ggb .ensureChoice ();_ggb ._dfc .Choice .ShowVal =_c .NewCT_Boolean ();_ggb ._dfc .Choice .ShowVal .ValAttr =_f .Bool (b );};type Line3DChart struct{chartBase ;_dgb *_c .CT_Line3DChart ;};type chartBase struct{};
|
||||
|
||||
// SetText sets the series text.
|
||||
func (_gacf RadarChartSeries )SetText (s string ){_gacf ._ggce .Tx =_c .NewCT_SerTx ();_gacf ._ggce .Tx .Choice .V =&s ;};
|
||||
|
||||
// AddDateAxis adds a value axis to the chart.
|
||||
func (_fff Chart )AddDateAxis ()DateAxis {_ccgd :=_c .NewCT_DateAx ();if _fff ._ag .Chart .PlotArea .CChoice ==nil {_fff ._ag .Chart .PlotArea .CChoice =_c .NewCT_PlotAreaChoice1 ();};_ccgd .AxId =_c .NewCT_UnsignedInt ();_ccgd .AxId .ValAttr =0x7FFFFFFF&_a .Uint32 ();_fff ._ag .Chart .PlotArea .CChoice .DateAx =append (_fff ._ag .Chart .PlotArea .CChoice .DateAx ,_ccgd );_ccgd .Delete =_c .NewCT_Boolean ();_ccgd .Delete .ValAttr =_f .Bool (false );_ccgd .Scaling =_c .NewCT_Scaling ();_ccgd .Scaling .Orientation =_c .NewCT_Orientation ();_ccgd .Scaling .Orientation .ValAttr =_c .ST_OrientationMinMax ;_ccgd .Choice =&_c .EG_AxSharedChoice {};_ccgd .Choice .Crosses =_c .NewCT_Crosses ();_ccgd .Choice .Crosses .ValAttr =_c .ST_CrossesAutoZero ;_gag :=DateAxis {_ccgd };_gag .MajorGridLines ().Properties ().LineProperties ().SetSolidFill (_ad .LightGray );_gag .SetMajorTickMark (_c .ST_TickMarkOut );_gag .SetMinorTickMark (_c .ST_TickMarkIn );_gag .SetTickLabelPosition (_c .ST_TickLblPosNextTo );_gag .Properties ().LineProperties ().SetSolidFill (_ad .Black );_gag .SetPosition (_c .ST_AxPosL );return _gag ;};func (_cfcg ValueAxis )SetTickLabelPosition (p _c .ST_TickLblPos ){if p ==_c .ST_TickLblPosUnset {_cfcg ._acec .TickLblPos =nil ;}else {_cfcg ._acec .TickLblPos =_c .NewCT_TickLblPos ();_cfcg ._acec .TickLblPos .ValAttr =p ;};};
|
||||
|
||||
// BubbleChart is a 2D Bubble chart.
|
||||
type BubbleChart struct{chartBase ;_ebf *_c .CT_BubbleChart ;};
|
||||
|
||||
// AddSeries adds a default series to a Surface chart.
|
||||
func (_dga SurfaceChart )AddSeries ()SurfaceChartSeries {_gcb :=_dga .nextColor (len (_dga ._debg .Ser ));_decb :=_c .NewCT_SurfaceSer ();_dga ._debg .Ser =append (_dga ._debg .Ser ,_decb );_decb .Idx .ValAttr =uint32 (len (_dga ._debg .Ser )-1);_decb .Order .ValAttr =uint32 (len (_dga ._debg .Ser )-1);_aad :=SurfaceChartSeries {_decb };_aad .InitializeDefaults ();_aad .Properties ().LineProperties ().SetSolidFill (_gcb );return _aad ;};
|
||||
|
||||
// AddAxis adds an axis to a line chart.
|
||||
func (_ecc LineChart )AddAxis (axis Axis ){_cdb :=_c .NewCT_UnsignedInt ();_cdb .ValAttr =axis .AxisID ();_ecc ._bge .AxId =append (_ecc ._bge .AxId ,_cdb );};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_fee DoughnutChart )X ()*_c .CT_DoughnutChart {return _fee ._eefd };func _dff (_bae *_c .CT_Chart ){_bae .View3D =_c .NewCT_View3D ();_bae .View3D .RotX =_c .NewCT_RotX ();_bae .View3D .RotX .ValAttr =_f .Int8 (15);_bae .View3D .RotY =_c .NewCT_RotY ();_bae .View3D .RotY .ValAttr =_f .Uint16 (20);_bae .View3D .RAngAx =_c .NewCT_Boolean ();_bae .View3D .RAngAx .ValAttr =_f .Bool (false );_bae .Floor =_c .NewCT_Surface ();_bae .Floor .Thickness =_c .NewCT_Thickness ();_bae .Floor .Thickness .ValAttr .Uint32 =_f .Uint32 (0);_bae .SideWall =_c .NewCT_Surface ();_bae .SideWall .Thickness =_c .NewCT_Thickness ();_bae .SideWall .Thickness .ValAttr .Uint32 =_f .Uint32 (0);_bae .BackWall =_c .NewCT_Surface ();_bae .BackWall .Thickness =_c .NewCT_Thickness ();_bae .BackWall .Thickness .ValAttr .Uint32 =_f .Uint32 (0);};func (_babb Legend )SetOverlay (b bool ){_babb ._aef .Overlay =_c .NewCT_Boolean ();_babb ._aef .Overlay .ValAttr =_f .Bool (b );};type ValueAxis struct{_acec *_c .CT_ValAx };
|
||||
|
||||
// DoughnutChart is a Doughnut chart.
|
||||
type DoughnutChart struct{chartBase ;_eefd *_c .CT_DoughnutChart ;};
|
||||
|
||||
// PieOfPieChart is a Pie chart with an extra Pie chart.
|
||||
type PieOfPieChart struct{chartBase ;_ecff *_c .CT_OfPieChart ;};
|
||||
|
||||
// AddSeries adds a default series to an area chart.
|
||||
func (_df AreaChart )AddSeries ()AreaChartSeries {_cf :=_df .nextColor (len (_df ._bg .Ser ));_gf :=_c .NewCT_AreaSer ();_df ._bg .Ser =append (_df ._bg .Ser ,_gf );_gf .Idx .ValAttr =uint32 (len (_df ._bg .Ser )-1);_gf .Order .ValAttr =uint32 (len (_df ._bg .Ser )-1);_dbd :=AreaChartSeries {_gf };_dbd .InitializeDefaults ();_dbd .Properties ().SetSolidFill (_cf );return _dbd ;};
|
||||
|
||||
// InitializeDefaults initializes a Bubble chart series to the default values.
|
||||
func (_dee BubbleChartSeries )InitializeDefaults (){};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_ddca RadarChart )X ()*_c .CT_RadarChart {return _ddca ._aac };
|
||||
|
||||
// Surface3DChart is a 3D view of a surface chart.
|
||||
type Surface3DChart struct{chartBase ;_cde *_c .CT_Surface3DChart ;};
|
||||
|
||||
// SurfaceChart is a 3D surface chart, viewed from the top-down.
|
||||
type SurfaceChart struct{chartBase ;_debg *_c .CT_SurfaceChart ;};
|
||||
|
||||
// BubbleChartSeries is a series to be used on a Bubble chart.
|
||||
type BubbleChartSeries struct{_ac *_c .CT_BubbleSer };
|
||||
|
||||
// Order returns the order of the series
|
||||
func (_gba ScatterChartSeries )Order ()uint32 {return _gba ._dba .Order .ValAttr };func (_affe DataLabels )SetShowLegendKey (b bool ){_affe .ensureChoice ();_affe ._dfc .Choice .ShowLegendKey =_c .NewCT_Boolean ();_affe ._dfc .Choice .ShowLegendKey .ValAttr =_f .Bool (b );};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_gfbc Bar3DChart )X ()*_c .CT_Bar3DChart {return _gfbc ._eb };
|
||||
|
||||
// Values returns the value data source.
|
||||
func (_adca RadarChartSeries )Values ()NumberDataSource {if _adca ._gfbc .Val ==nil {_adca ._gfbc .Val =_a .NewCT_NumDataSource ();};return MakeNumberDataSource (_adca ._gfbc .Val );};type ValueAxis struct{_aabbf *_a .CT_ValAx };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_fef BarChartSeries )X ()*_a .CT_BarSer {return _fef ._gbb };type chartBase struct{};func (_gdgg SurfaceChartSeries )CategoryAxis ()CategoryAxisDataSource {if _gdgg ._cacg .Cat ==nil {_gdgg ._cacg .Cat =_a .NewCT_AxDataSource ();};return MakeAxisDataSource (_gdgg ._cacg .Cat );};
|
||||
|
||||
// Pie3DChart is a Pie3D chart.
|
||||
type Pie3DChart struct{chartBase ;_cfdb *_a .CT_Pie3DChart ;};
|
||||
func (_cc BubbleChartSeries )Values ()NumberDataSource {if _cc ._ac .YVal ==nil {_cc ._ac .YVal =_c .NewCT_NumDataSource ();};return MakeNumberDataSource (_cc ._ac .YVal );};
|
@ -11,27 +11,27 @@
|
||||
|
||||
// Package color provides color handling structures and functions for use across
|
||||
// all of the document types.
|
||||
package color ;import (_cd "fmt";_g "github.com/unidoc/unioffice";);
|
||||
package color ;import (_a "fmt";_bf "github.com/unidoc/unioffice";);var MistyRose =Color {0xFF,0xE4,0xE1,255,false };var LightSteelBlue =Color {0xB0,0xC4,0xDE,255,false };var Aquamarine =Color {0x7F,0xFF,0xD4,255,false };var Red =Color {0xFF,0x00,0x00,255,false };var BurlyWood =Color {0xDE,0xB8,0x87,255,false };var PaleTurquoise =Color {0xAF,0xEE,0xEE,255,false };var Tomato =Color {0xFF,0x63,0x47,255,false };var MintCream =Color {0xF5,0xFF,0xFA,255,false };var AntiqueWhite =Color {0xFA,0xEB,0xD7,255,false };var DarkOrchid =Color {0x99,0x32,0xCC,255,false };var Tan =Color {0xD2,0xB4,0x8C,255,false };var Lime =Color {0x00,0xFF,0x00,255,false };var Wheat =Color {0xF5,0xDE,0xB3,255,false };var Pink =Color {0xFF,0xC0,0xCB,255,false };var LightGreen =Color {0x90,0xEE,0x90,255,false };var MediumOrchid =Color {0xBA,0x55,0xD3,255,false };var Snow =Color {0xFF,0xFA,0xFA,255,false };var FireBrick =Color {0xB2,0x22,0x22,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 DarkSlateGray =Color {0x2F,0x4F,0x4F,255,false };var OliveDrab =Color {0x6B,0x8E,0x23,255,false };var Purple =Color {0x80,0x00,0x80,255,false };var FireBrick =Color {0xB2,0x22,0x22,255,false };var LightBlue =Color {0xAD,0xD8,0xE6,255,false };var LightSlateGray =Color {0x77,0x88,0x99,255,false };var Blue =Color {0x00,0x00,0xFF,255,false };
|
||||
|
||||
// RGB constructs a new RGB color with a given red, green and blue value.
|
||||
func RGB (r ,g ,b uint8 )Color {return Color {r ,g ,b ,255,false }};var Beige =Color {0xF5,0xF5,0xDC,255,false };
|
||||
func RGBA (r ,g ,b ,a uint8 )Color {return Color {r ,g ,b ,a ,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 (_e Color )IsAuto ()bool {return _e ._gf };var Coral =Color {0xFF,0x7F,0x50,255,false };var CadetBlue =Color {0x5F,0x9E,0xA0,255,false };var SpringGreen =Color {0x00,0xFF,0x7F,255,false };var PaleGreen =Color {0x98,0xFB,0x98,255,false };var DarkRed =Color {0x8B,0x00,0x00,255,false };var Green =Color {0x00,0x80,0x00,255,false };var CornflowerBlue =Color {0x64,0x95,0xED,255,false };var MistyRose =Color {0xFF,0xE4,0xE1,255,false };var Aquamarine =Color {0x7F,0xFF,0xD4,255,false };var GhostWhite =Color {0xF8,0xF8,0xFF,255,false };var HotPink =Color {0xFF,0x69,0xB4,255,false };var Bisque =Color {0xFF,0xE4,0xC4,255,false };var DarkMagenta =Color {0x8B,0x00,0x8B,255,false };var LightCoral =Color {0xF0,0x80,0x80,255,false };var PowderBlue =Color {0xB0,0xE0,0xE6,255,false };var NavajoWhite =Color {0xFF,0xDE,0xAD,255,false };var DarkTurquoise =Color {0x00,0xCE,0xD1,255,false };var FloralWhite =Color {0xFF,0xFA,0xF0,255,false };var LightGreen =Color {0x90,0xEE,0x90,255,false };var WhiteSmoke =Color {0xF5,0xF5,0xF5,255,false };var DimGrey =Color {0x69,0x69,0x69,255,false };var Sienna =Color {0xA0,0x52,0x2D,255,false };var LavenderBlush =Color {0xFF,0xF0,0xF5,255,false };var DarkViolet =Color {0x94,0x00,0xD3,255,false };var YellowGreen =Color {0x9A,0xCD,0x32,255,false };var DarkGoldenRod =Color {0xB8,0x86,0x0B,255,false };var PaleGoldenRod =Color {0xEE,0xE8,0xAA,255,false };var LightSeaGreen =Color {0x20,0xB2,0xAA,255,false };var MintCream =Color {0xF5,0xFF,0xFA,255,false };var Wheat =Color {0xF5,0xDE,0xB3,255,false };var IndianRed =Color {0xCD,0x5C,0x5C,255,false };func FromHex (s string )Color {if len (s )==0{return Auto ;};if s [0]=='#'{s =s [1:];};var _fg ,_af ,_b uint8 ;_bf ,_ :=_cd .Sscanf (s ,"\u0025\u0030\u0032x\u0025\u0030\u0032\u0078\u0025\u0030\u0032\u0078",&_fg ,&_af ,&_b );if _bf ==3{return RGB (_fg ,_af ,_b );};return Auto ;};var DimGray =Color {0x69,0x69,0x69,255,false };var DarkGray =Color {0xA9,0xA9,0xA9,255,false };var SlateGrey =Color {0x70,0x80,0x90,255,false };var Ivory =Color {0xFF,0xFF,0xF0,255,false };var MediumVioletRed =Color {0xC7,0x15,0x85,255,false };var Khaki =Color {0xF0,0xE6,0x8C,255,false };var Tan =Color {0xD2,0xB4,0x8C,255,false };var Lime =Color {0x00,0xFF,0x00,255,false };var AliceBlue =Color {0xF0,0xF8,0xFF,255,false };var Lavender =Color {0xE6,0xE6,0xFA,255,false };var MediumPurple =Color {0x93,0x70,0xDB,255,false };var LightSteelBlue =Color {0xB0,0xC4,0xDE,255,false };var Snow =Color {0xFF,0xFA,0xFA,255,false };var Linen =Color {0xFA,0xF0,0xE6,255,false };var DodgerBlue =Color {0x1E,0x90,0xFF,255,false };var BlueViolet =Color {0x8A,0x2B,0xE2,255,false };var MediumTurquoise =Color {0x48,0xD1,0xCC,255,false };var SlateBlue =Color {0x6A,0x5A,0xCD,255,false };var Indigo =Color {0x4B,0x00,0x82,255,false };var DarkOrange =Color {0xFF,0x8C,0x00,255,false };var HoneyDew =Color {0xF0,0xFF,0xF0,255,false };var Auto =Color {0,0,0,255,true };var LightCyan =Color {0xE0,0xFF,0xFF,255,false };var LemonChiffon =Color {0xFF,0xFA,0xCD,255,false };var DarkSeaGreen =Color {0x8F,0xBC,0x8F,255,false };var Orchid =Color {0xDA,0x70,0xD6,255,false };var LightYellow =Color {0xFF,0xFF,0xE0,255,false };var DarkOrchid =Color {0x99,0x32,0xCC,255,false };var MidnightBlue =Color {0x19,0x19,0x70,255,false };var Cornsilk =Color {0xFF,0xF8,0xDC,255,false };var OldLace =Color {0xFD,0xF5,0xE6,255,false };
|
||||
|
||||
// Color is a 24 bit color that can be converted to
|
||||
// internal ECMA-376 formats as needed.
|
||||
type Color struct{_cdf ,_f ,_d ,_db uint8 ;_gf bool ;};var Gray =Color {0x80,0x80,0x80,255,false };var SandyBrown =Color {0xF4,0xA4,0x60,255,false };var LightPink =Color {0xFF,0xB6,0xC1,255,false };var Peru =Color {0xCD,0x85,0x3F,255,false };var DarkBlue =Color {0x00,0x00,0x8B,255,false };var SteelBlue =Color {0x46,0x82,0xB4,255,false };var SeaShell =Color {0xFF,0xF5,0xEE,255,false };var Chartreuse =Color {0x7F,0xFF,0x00,255,false };var Moccasin =Color {0xFF,0xE4,0xB5,255,false };var Olive =Color {0x80,0x80,0x00,255,false };var RosyBrown =Color {0xBC,0x8F,0x8F,255,false };var Cyan =Color {0x00,0xFF,0xFF,255,false };var MediumOrchid =Color {0xBA,0x55,0xD3,255,false };var LightSalmon =Color {0xFF,0xA0,0x7A,255,false };var DarkGreen =Color {0x00,0x64,0x00,255,false };var DarkSlateBlue =Color {0x48,0x3D,0x8B,255,false };var Thistle =Color {0xD8,0xBF,0xD8,255,false };var Maroon =Color {0x80,0x00,0x00,255,false };
|
||||
|
||||
// AsRGBString is used by the various wrappers to return a pointer
|
||||
// to a string containing a six digit hex RGB value.
|
||||
func (_ce Color )AsRGBString ()*string {return _g .Stringf ("\u0025\u0030\u0032x\u0025\u0030\u0032\u0078\u0025\u0030\u0032\u0078",_ce ._cdf ,_ce ._f ,_ce ._d );};var Orange =Color {0xFF,0xA5,0x00,255,false };var DarkOliveGreen =Color {0x55,0x6B,0x2F,255,false };var SaddleBrown =Color {0x8B,0x45,0x13,255,false };var Silver =Color {0xC0,0xC0,0xC0,255,false };var AntiqueWhite =Color {0xFA,0xEB,0xD7,255,false };var SeaGreen =Color {0x2E,0x8B,0x57,255,false };var LightGray =Color {0xD3,0xD3,0xD3,255,false };var Chocolate =Color {0xD2,0x69,0x1E,255,false };var OrangeRed =Color {0xFF,0x45,0x00,255,false };var MediumAquaMarine =Color {0x66,0xCD,0xAA,255,false };var Fuchsia =Color {0xFF,0x00,0xFF,255,false };var DarkSlateGrey =Color {0x2F,0x4F,0x4F,255,false };var LightSlateGrey =Color {0x77,0x88,0x99,255,false };var DarkSalmon =Color {0xE9,0x96,0x7A,255,false };var Azure =Color {0xF0,0xFF,0xFF,255,false };var SuccessGreen =Color {0x00,0xCC,0x00,255,false };var LimeGreen =Color {0x32,0xCD,0x32,255,false };var MediumSlateBlue =Color {0x7B,0x68,0xEE,255,false };var DarkGrey =Color {0xA9,0xA9,0xA9,255,false };var MediumBlue =Color {0x00,0x00,0xCD,255,false };var PeachPuff =Color {0xFF,0xDA,0xB9,255,false };var Yellow =Color {0xFF,0xFF,0x00,255,false };var LightSkyBlue =Color {0x87,0xCE,0xFA,255,false };var Violet =Color {0xEE,0x82,0xEE,255,false };
|
||||
func (_ffe Color )IsAuto ()bool {return _ffe ._ffc };var DarkRed =Color {0x8B,0x00,0x00,255,false };var Navy =Color {0x00,0x00,0x80,255,false };var SpringGreen =Color {0x00,0xFF,0x7F,255,false };var SuccessGreen =Color {0x00,0xCC,0x00,255,false };var DarkOrange =Color {0xFF,0x8C,0x00,255,false };var Peru =Color {0xCD,0x85,0x3F,255,false };var OliveDrab =Color {0x6B,0x8E,0x23,255,false };var AliceBlue =Color {0xF0,0xF8,0xFF,255,false };var MediumTurquoise =Color {0x48,0xD1,0xCC,255,false };var DimGray =Color {0x69,0x69,0x69,255,false };var WhiteSmoke =Color {0xF5,0xF5,0xF5,255,false };var Olive =Color {0x80,0x80,0x00,255,false };var Lavender =Color {0xE6,0xE6,0xFA,255,false };var DarkTurquoise =Color {0x00,0xCE,0xD1,255,false };var IndianRed =Color {0xCD,0x5C,0x5C,255,false };var CornflowerBlue =Color {0x64,0x95,0xED,255,false };var MediumSeaGreen =Color {0x3C,0xB3,0x71,255,false };var SkyBlue =Color {0x87,0xCE,0xEB,255,false };var DarkKhaki =Color {0xBD,0xB7,0x6B,255,false };var Black =Color {0x00,0x00,0x00,255,false };var DeepSkyBlue =Color {0x00,0xBF,0xFF,255,false };var Purple =Color {0x80,0x00,0x80,255,false };var HotPink =Color {0xFF,0x69,0xB4,255,false };var DarkBlue =Color {0x00,0x00,0x8B,255,false };var Fuchsia =Color {0xFF,0x00,0xFF,255,false };var Crimson =Color {0xDC,0x14,0x3C,255,false };var LightSlateGray =Color {0x77,0x88,0x99,255,false };var PowderBlue =Color {0xB0,0xE0,0xE6,255,false };var DarkMagenta =Color {0x8B,0x00,0x8B,255,false };var MediumPurple =Color {0x93,0x70,0xDB,255,false };var GhostWhite =Color {0xF8,0xF8,0xFF,255,false };var LightCyan =Color {0xE0,0xFF,0xFF,255,false };var Indigo =Color {0x4B,0x00,0x82,255,false };
|
||||
|
||||
// AsRGBAString is used by the various wrappers to return a pointer
|
||||
// to a string containing a six digit hex RGB value.
|
||||
func (_a Color )AsRGBAString ()*string {return _g .Stringf ("\u0025\u00302\u0078\u0025\u00302\u0078\u0025\u0030\u0032\u0078\u0025\u0030\u0032\u0078",_a ._db ,_a ._cdf ,_a ._f ,_a ._d );};var RoyalBlue =Color {0x41,0x69,0xE1,255,false };var Plum =Color {0xDD,0xA0,0xDD,255,false };var Pink =Color {0xFF,0xC0,0xCB,255,false };var LightGoldenRodYellow =Color {0xFA,0xFA,0xD2,255,false };var SkyBlue =Color {0x87,0xCE,0xEB,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 Aqua =Color {0x00,0xFF,0xFF,255,false };var Brown =Color {0xA5,0x2A,0x2A,255,false };var PapayaWhip =Color {0xFF,0xEF,0xD5,255,false };var DarkCyan =Color {0x00,0x8B,0x8B,255,false };var GoldenRod =Color {0xDA,0xA5,0x20,255,false };var PaleTurquoise =Color {0xAF,0xEE,0xEE,255,false };var LawnGreen =Color {0x7C,0xFC,0x00,255,false };var GreenYellow =Color {0xAD,0xFF,0x2F,255,false };var Turquoise =Color {0x40,0xE0,0xD0,255,false };var White =Color {0xFF,0xFF,0xFF,255,false };var DarkKhaki =Color {0xBD,0xB7,0x6B,255,false };var BlanchedAlmond =Color {0xFF,0xEB,0xCD,255,false };var BurlyWood =Color {0xDE,0xB8,0x87,255,false };var Gainsboro =Color {0xDC,0xDC,0xDC,255,false };var ForestGreen =Color {0x22,0x8B,0x22,255,false };var DeepSkyBlue =Color {0x00,0xBF,0xFF,255,false };var LightGrey =Color {0xD3,0xD3,0xD3,255,false };var Red =Color {0xFF,0x00,0x00,255,false };var PaleVioletRed =Color {0xDB,0x70,0x93,255,false };var Navy =Color {0x00,0x00,0x80,255,false };var Gold =Color {0xFF,0xD7,0x00,255,false };var MediumSeaGreen =Color {0x3C,0xB3,0x71,255,false };var MediumSpringGreen =Color {0x00,0xFA,0x9A,255,false };var Tomato =Color {0xFF,0x63,0x47,255,false };var Magenta =Color {0xFF,0x00,0xFF,255,false };var Salmon =Color {0xFA,0x80,0x72,255,false };var Teal =Color {0x00,0x80,0x80,255,false };var RebeccaPurple =Color {0x66,0x33,0x99,255,false };var DeepPink =Color {0xFF,0x14,0x93,255,false };
|
||||
func (_bg Color )AsRGBAString ()*string {return _bf .Stringf ("\u0025\u00302\u0078\u0025\u00302\u0078\u0025\u0030\u0032\u0078\u0025\u0030\u0032\u0078",_bg ._g ,_bg ._f ,_bg ._fd ,_bg ._ff );};var DarkGreen =Color {0x00,0x64,0x00,255,false };var Ivory =Color {0xFF,0xFF,0xF0,255,false };var GreenYellow =Color {0xAD,0xFF,0x2F,255,false };var Gainsboro =Color {0xDC,0xDC,0xDC,255,false };var Thistle =Color {0xD8,0xBF,0xD8,255,false };var NavajoWhite =Color {0xFF,0xDE,0xAD,255,false };var MediumSpringGreen =Color {0x00,0xFA,0x9A,255,false };var YellowGreen =Color {0x9A,0xCD,0x32,255,false };var CadetBlue =Color {0x5F,0x9E,0xA0,255,false };var DarkSlateGrey =Color {0x2F,0x4F,0x4F,255,false };var DarkGoldenRod =Color {0xB8,0x86,0x0B,255,false };var Chartreuse =Color {0x7F,0xFF,0x00,255,false };var Orchid =Color {0xDA,0x70,0xD6,255,false };var BlanchedAlmond =Color {0xFF,0xEB,0xCD,255,false };var LightSkyBlue =Color {0x87,0xCE,0xFA,255,false };var White =Color {0xFF,0xFF,0xFF,255,false };var LawnGreen =Color {0x7C,0xFC,0x00,255,false };var Sienna =Color {0xA0,0x52,0x2D,255,false };var SeaShell =Color {0xFF,0xF5,0xEE,255,false };var SeaGreen =Color {0x2E,0x8B,0x57,255,false };var Orange =Color {0xFF,0xA5,0x00,255,false };var Moccasin =Color {0xFF,0xE4,0xB5,255,false };var Linen =Color {0xFA,0xF0,0xE6,255,false };var PaleGreen =Color {0x98,0xFB,0x98,255,false };var DarkSlateGray =Color {0x2F,0x4F,0x4F,255,false };var Khaki =Color {0xF0,0xE6,0x8C,255,false };var PapayaWhip =Color {0xFF,0xEF,0xD5,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 LightSlateGrey =Color {0x77,0x88,0x99,255,false };var PeachPuff =Color {0xFF,0xDA,0xB9,255,false };var SlateGray =Color {0x70,0x80,0x90,255,false };var MediumBlue =Color {0x00,0x00,0xCD,255,false };var LightYellow =Color {0xFF,0xFF,0xE0,255,false };var Teal =Color {0x00,0x80,0x80,255,false };func FromHex (s string )Color {if len (s )==0{return Auto ;};if s [0]=='#'{s =s [1:];};var _bfd ,_e ,_d uint8 ;_fg ,_ :=_a .Sscanf (s ,"\u0025\u0030\u0032x\u0025\u0030\u0032\u0078\u0025\u0030\u0032\u0078",&_bfd ,&_e ,&_d );if _fg ==3{return RGB (_bfd ,_e ,_d );};return Auto ;};var LightCoral =Color {0xF0,0x80,0x80,255,false };var DarkOliveGreen =Color {0x55,0x6B,0x2F,255,false };
|
||||
|
||||
// AsRGBString is used by the various wrappers to return a pointer
|
||||
// to a string containing a six digit hex RGB value.
|
||||
func (_c Color )AsRGBString ()*string {return _bf .Stringf ("\u0025\u0030\u0032x\u0025\u0030\u0032\u0078\u0025\u0030\u0032\u0078",_c ._f ,_c ._fd ,_c ._ff );};var MediumAquaMarine =Color {0x66,0xCD,0xAA,255,false };var ForestGreen =Color {0x22,0x8B,0x22,255,false };var Magenta =Color {0xFF,0x00,0xFF,255,false };var LightBlue =Color {0xAD,0xD8,0xE6,255,false };var RoyalBlue =Color {0x41,0x69,0xE1,255,false };var Turquoise =Color {0x40,0xE0,0xD0,255,false };var LightGrey =Color {0xD3,0xD3,0xD3,255,false };var Coral =Color {0xFF,0x7F,0x50,255,false };var RebeccaPurple =Color {0x66,0x33,0x99,255,false };var MediumSlateBlue =Color {0x7B,0x68,0xEE,255,false };var Cyan =Color {0x00,0xFF,0xFF,255,false };var LavenderBlush =Color {0xFF,0xF0,0xF5,255,false };var FloralWhite =Color {0xFF,0xFA,0xF0,255,false };var LightGray =Color {0xD3,0xD3,0xD3,255,false };var Cornsilk =Color {0xFF,0xF8,0xDC,255,false };var Silver =Color {0xC0,0xC0,0xC0,255,false };var LightSeaGreen =Color {0x20,0xB2,0xAA,255,false };var Violet =Color {0xEE,0x82,0xEE,255,false };var Green =Color {0x00,0x80,0x00,255,false };var DodgerBlue =Color {0x1E,0x90,0xFF,255,false };var Maroon =Color {0x80,0x00,0x00,255,false };var OrangeRed =Color {0xFF,0x45,0x00,255,false };var SlateGrey =Color {0x70,0x80,0x90,255,false };var LightPink =Color {0xFF,0xB6,0xC1,255,false };var LightGoldenRodYellow =Color {0xFA,0xFA,0xD2,255,false };var SandyBrown =Color {0xF4,0xA4,0x60,255,false };var MidnightBlue =Color {0x19,0x19,0x70,255,false };var LightSalmon =Color {0xFF,0xA0,0x7A,255,false };var DarkGrey =Color {0xA9,0xA9,0xA9,255,false };var RosyBrown =Color {0xBC,0x8F,0x8F,255,false };var Gold =Color {0xFF,0xD7,0x00,255,false };var Auto =Color {0,0,0,255,true };var Aqua =Color {0x00,0xFF,0xFF,255,false };var Salmon =Color {0xFA,0x80,0x72,255,false };var BlueViolet =Color {0x8A,0x2B,0xE2,255,false };var DarkGray =Color {0xA9,0xA9,0xA9,255,false };var DarkSeaGreen =Color {0x8F,0xBC,0x8F,255,false };var DarkSalmon =Color {0xE9,0x96,0x7A,255,false };var DarkViolet =Color {0x94,0x00,0xD3,255,false };var SteelBlue =Color {0x46,0x82,0xB4,255,false };var HoneyDew =Color {0xF0,0xFF,0xF0,255,false };var Gray =Color {0x80,0x80,0x80,255,false };var LimeGreen =Color {0x32,0xCD,0x32,255,false };var PaleVioletRed =Color {0xDB,0x70,0x93,255,false };var SaddleBrown =Color {0x8B,0x45,0x13,255,false };var PaleGoldenRod =Color {0xEE,0xE8,0xAA,255,false };var DarkCyan =Color {0x00,0x8B,0x8B,255,false };
|
||||
|
||||
// Color is a 24 bit color that can be converted to
|
||||
// internal ECMA-376 formats as needed.
|
||||
type Color struct{_f ,_fd ,_ff ,_g uint8 ;_ffc bool ;};var DimGrey =Color {0x69,0x69,0x69,255,false };var Blue =Color {0x00,0x00,0xFF,255,false };var Beige =Color {0xF5,0xF5,0xDC,255,false };var DeepPink =Color {0xFF,0x14,0x93,255,false };var DarkSlateBlue =Color {0x48,0x3D,0x8B,255,false };var GoldenRod =Color {0xDA,0xA5,0x20,255,false };var LemonChiffon =Color {0xFF,0xFA,0xCD,255,false };var SlateBlue =Color {0x6A,0x5A,0xCD,255,false };var Bisque =Color {0xFF,0xE4,0xC4,255,false };var Plum =Color {0xDD,0xA0,0xDD,255,false };var Azure =Color {0xF0,0xFF,0xFF,255,false };var Brown =Color {0xA5,0x2A,0x2A,255,false };var MediumVioletRed =Color {0xC7,0x15,0x85,255,false };var Yellow =Color {0xFF,0xFF,0x00,255,false };var Chocolate =Color {0xD2,0x69,0x1E,255,false };var OldLace =Color {0xFD,0xF5,0xE6,255,false };
|
File diff suppressed because one or more lines are too long
712
common/common.go
712
common/common.go
@ -13,404 +13,404 @@
|
||||
// OOXML document formats.
|
||||
//
|
||||
// Package common contains common properties used by the subpackages.
|
||||
package common ;import (_e "archive/zip";_f "bytes";_fa "encoding/xml";_ff "errors";_g "fmt";_fcf "github.com/unidoc/unioffice";_ca "github.com/unidoc/unioffice/common/logger";_gf "github.com/unidoc/unioffice/common/tempstorage";_ea "github.com/unidoc/unioffice/common/tempstorage/diskstore";_ee "github.com/unidoc/unioffice/measurement";_bg "github.com/unidoc/unioffice/schema/soo/dml";_c "github.com/unidoc/unioffice/schema/soo/ofc/custom_properties";_dd "github.com/unidoc/unioffice/schema/soo/ofc/docPropsVTypes";_bee "github.com/unidoc/unioffice/schema/soo/ofc/extended_properties";_bd "github.com/unidoc/unioffice/schema/soo/pkg/content_types";_fc "github.com/unidoc/unioffice/schema/soo/pkg/metadata/core_properties";_ag "github.com/unidoc/unioffice/schema/soo/pkg/relationships";_fae "github.com/unidoc/unioffice/zippkg";_bba "image";_ "image/gif";_ "image/jpeg";_ "image/png";_be "os";_d "reflect";_fg "regexp";_ffa "strconv";_bbb "strings";_aa "time";);
|
||||
package common ;import (_cg "archive/zip";_c "bytes";_gbf "encoding/xml";_fe "errors";_ge "fmt";_eb "github.com/unidoc/unioffice";_ee "github.com/unidoc/unioffice/common/logger";_ff "github.com/unidoc/unioffice/common/tempstorage";_db "github.com/unidoc/unioffice/common/tempstorage/diskstore";_gfd "github.com/unidoc/unioffice/measurement";_de "github.com/unidoc/unioffice/schema/soo/dml";_cb "github.com/unidoc/unioffice/schema/soo/ofc/custom_properties";_ce "github.com/unidoc/unioffice/schema/soo/ofc/docPropsVTypes";_ec "github.com/unidoc/unioffice/schema/soo/ofc/extended_properties";_bf "github.com/unidoc/unioffice/schema/soo/pkg/content_types";_gc "github.com/unidoc/unioffice/schema/soo/pkg/metadata/core_properties";_fdg "github.com/unidoc/unioffice/schema/soo/pkg/relationships";_fd "github.com/unidoc/unioffice/zippkg";_e "image";_ "image/gif";_ "image/jpeg";_ "image/png";_gb "os";_fb "reflect";_bg "regexp";_b "strconv";_gg "strings";_ga "time";);
|
||||
|
||||
// SetTarget set the target (path) of a relationship.
|
||||
func (_bcb Relationship )SetTarget (s string ){_bcb ._gae .TargetAttr =s };
|
||||
// Remove removes an existing relationship.
|
||||
func (_bfggd Relationships )Remove (rel Relationship )bool {for _dgeb ,_afe :=range _bfggd ._gda .Relationship {if _afe ==rel ._cbc {copy (_bfggd ._gda .Relationship [_dgeb :],_bfggd ._gda .Relationship [_dgeb +1:]);_bfggd ._gda .Relationship =_bfggd ._gda .Relationship [0:len (_bfggd ._gda .Relationship )-1];return true ;};};return false ;};func (_bbbf CustomProperties )SetPropertyAsVstream (name string ,vstream *_ce .Vstream ){_aab :=_bbbf .getNewProperty (name );_aab .Vstream =vstream ;_bbbf .setOrReplaceProperty (_aab );};func (_cfb CustomProperties )SetPropertyAsStream (name string ,stream string ){_dgc :=_cfb .getNewProperty (name );_dgc .Stream =&stream ;_cfb .setOrReplaceProperty (_dgc );};func (_dfc CustomProperties )SetPropertyAsR8 (name string ,r8 float64 ){_dda :=_dfc .getNewProperty (name );_dda .R8 =&r8 ;_dfc .setOrReplaceProperty (_dda );};
|
||||
|
||||
// SetHeight sets row height, see measurement package.
|
||||
func (_ffd TableRow )SetHeight (m _ee .Distance ){_gcc :=_ee .ToEMU (float64 (m ));_ffd ._dfd .HAttr =_bg .ST_Coordinate {ST_CoordinateUnqualified :&_gcc };};const Version ="\u0031\u002e\u0032\u0034\u002e\u0030";
|
||||
// Description returns the description of the document
|
||||
func (_aga CoreProperties )Description ()string {if _aga ._feg .Description !=nil {return string (_aga ._feg .Description .Data );};return "";};func (_eba CustomProperties )SetPropertyAsLpwstr (name string ,lpwstr string ){_bbb :=_eba .getNewProperty (name );_bbb .Lpwstr =&lpwstr ;_eba .setOrReplaceProperty (_bbb );};
|
||||
|
||||
// NewContentTypes returns a wrapper around a newly constructed content-types.
|
||||
func NewContentTypes ()ContentTypes {_ec :=ContentTypes {_eba :_bd .NewTypes ()};_ec .AddDefault ("\u0078\u006d\u006c","\u0061p\u0070l\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u0078\u006d\u006c");_ec .AddDefault ("\u0072\u0065\u006c\u0073","\u0061\u0070\u0070\u006c\u0069\u0063a\u0074\u0069\u006fn\u002f\u0076\u006ed\u002e\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006fr\u006d\u0061\u0074\u0073\u002dpa\u0063\u006b\u0061\u0067\u0065\u002e\u0072\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073\u002b\u0078\u006d\u006c");_ec .AddDefault ("\u0070\u006e\u0067","\u0069m\u0061\u0067\u0065\u002f\u0070\u006eg");_ec .AddDefault ("\u006a\u0070\u0065\u0067","\u0069\u006d\u0061\u0067\u0065\u002f\u006a\u0070\u0065\u0067");_ec .AddDefault ("\u006a\u0070\u0067","\u0069m\u0061\u0067\u0065\u002f\u006a\u0070g");_ec .AddDefault ("\u0077\u006d\u0066","i\u006d\u0061\u0067\u0065\u002f\u0078\u002d\u0077\u006d\u0066");_ec .AddOverride ("\u002fd\u006fc\u0050\u0072\u006f\u0070\u0073/\u0063\u006fr\u0065\u002e\u0078\u006d\u006c","\u0061\u0070\u0070\u006c\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u0076\u006e\u0064\u002e\u006f\u0070\u0065\u006ex\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073-\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002e\u0063\u006f\u0072\u0065\u002dp\u0072\u006f\u0070\u0065\u0072\u0074i\u0065\u0073\u002bx\u006d\u006c");_ec .AddOverride ("\u002f\u0064\u006f\u0063\u0050\u0072\u006f\u0070\u0073\u002f\u0061\u0070p\u002e\u0078\u006d\u006c","a\u0070\u0070l\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u0076\u006e\u0064\u002e\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066o\u0072\u006d\u0061\u0074\u0073\u002d\u006f\u0066\u0066\u0069\u0063\u0065\u0064\u006f\u0063\u0075m\u0065\u006e\u0074\u002e\u0065\u0078\u0074\u0065\u006e\u0064\u0065\u0064\u002dp\u0072\u006f\u0070\u0065\u0072\u0074\u0069\u0065\u0073\u002b\u0078m\u006c");return _ec ;};
|
||||
|
||||
// NewAppProperties constructs a new AppProperties.
|
||||
func NewAppProperties ()AppProperties {_edf :=AppProperties {_fcg :_bee .NewProperties ()};_edf .SetCompany ("\u0046\u006f\u0078\u0079\u0055\u0074\u0069\u006c\u0073\u0020\u0065\u0068\u0066");_edf .SetApplication ("g\u0069\u0074\u0068\u0075\u0062\u002ec\u006f\u006d\u002f\u0075\u006e\u0069\u0064\u006f\u0063/\u0075\u006e\u0069o\u0066f\u0069\u0063\u0065");_edf .SetDocSecurity (0);_edf .SetLinksUpToDate (false );var _ce ,_efg ,_beg int64 ;_g .Sscanf (Version ,"\u0025\u0064\u002e\u0025\u0064\u002e\u0025\u0064",&_ce ,&_efg ,&_beg );_eeac :=float64 (_ce )+float64 (_efg )/10000.0;_edf .SetApplicationVersion (_g .Sprintf ("\u0025\u0030\u0037\u002e\u0034\u0066",_eeac ));return _edf ;};
|
||||
|
||||
// NewTableStyles constructs a new TableStyles.
|
||||
func NewTableStyles ()TableStyles {return TableStyles {_dfgf :_bg .NewTblStyleLst ()}};func (_bac CustomProperties )setProperty (_fgc *_c .CT_Property ){_bac .setPropertyHelper (_fgc ,false )};const _eecb =30;func UtcTimeFormat (t _aa .Time )string {return t .Format (_gbef )+"\u0020\u0055\u0054\u0043"};
|
||||
|
||||
// ApplicationVersion returns the version of the application that created the
|
||||
// document.
|
||||
func (_eag AppProperties )ApplicationVersion ()string {if _eag ._fcg .AppVersion !=nil {return *_eag ._fcg .AppVersion ;};return "";};
|
||||
|
||||
// Category returns the category of the document
|
||||
func (_bga CoreProperties )Category ()string {if _bga ._bc .Category !=nil {return *_bga ._bc .Category ;};return "";};
|
||||
|
||||
// NewCoreProperties constructs a new CoreProperties.
|
||||
func NewCoreProperties ()CoreProperties {return CoreProperties {_bc :_fc .NewCoreProperties ()}};
|
||||
|
||||
// Clear removes any existing relationships.
|
||||
func (_bbd Relationships )Clear (){_bbd ._dbb .Relationship =nil };
|
||||
|
||||
// SetApplicationVersion sets the version of the application that created the
|
||||
// document. Per MS, the verison string mut be in the form 'XX.YYYY'.
|
||||
func (_bf AppProperties )SetApplicationVersion (s string ){_bf ._fcg .AppVersion =&s };
|
||||
|
||||
// SetLastModifiedBy records the last person to modify the document.
|
||||
func (_aecc CoreProperties )SetLastModifiedBy (s string ){_aecc ._bc .LastModifiedBy =&s };
|
||||
|
||||
// SetStyle assigns TableStyle to a table.
|
||||
func (_dgc Table )SetStyle (style *_bg .CT_TableStyle ){if _dgc ._ddcg .TblPr ==nil {_dgc ._ddcg .TblPr =_bg .NewCT_TableProperties ();};if _dgc ._ddcg .TblPr .Choice ==nil {_dgc ._ddcg .TblPr .Choice =_bg .NewCT_TablePropertiesChoice ();};_dgc ._ddcg .TblPr .Choice .TableStyle =style ;};
|
||||
|
||||
// EnsureDefault esnures that an extension and default content type exist,
|
||||
// adding it if necessary.
|
||||
func (_faf ContentTypes )EnsureDefault (ext ,contentType string ){ext =_bbb .ToLower (ext );for _ ,_bdge :=range _faf ._eba .Default {if _bdge .ExtensionAttr ==ext {_bdge .ContentTypeAttr =contentType ;return ;};};_eadg :=&_bd .Default {};_eadg .ContentTypeAttr =contentType ;_eadg .ExtensionAttr =ext ;_faf ._eba .Default =append (_faf ._eba .Default ,_eadg );};
|
||||
|
||||
// LastModifiedBy returns the name of the last person to modify the document
|
||||
func (_aee CoreProperties )LastModifiedBy ()string {if _aee ._bc .LastModifiedBy !=nil {return *_aee ._bc .LastModifiedBy ;};return "";};
|
||||
|
||||
// SetAuthor records the author of the document.
|
||||
func (_cb CoreProperties )SetAuthor (s string ){if _cb ._bc .Creator ==nil {_cb ._bc .Creator =&_fcf .XSDAny {XMLName :_fa .Name {Local :"\u0064\u0063\u003a\u0063\u0072\u0065\u0061\u0074\u006f\u0072"}};};_cb ._bc .Creator .Data =[]byte (s );};
|
||||
|
||||
// SetOffsetY sets vertical offset of a table in distance units (see measurement package).
|
||||
func (_edad Table )SetOffsetY (offY float64 ){if _edad ._edfb .Off ==nil {_edad ._edfb .Off =_bg .NewCT_Point2D ();_agag :=int64 (0);_edad ._edfb .Off .XAttr =_bg .ST_Coordinate {ST_CoordinateUnqualified :&_agag };};_dbda :=_ee .ToEMU (offY );_edad ._edfb .Off .YAttr =_bg .ST_Coordinate {ST_CoordinateUnqualified :&_dbda };};func (_dbdd CustomProperties )SetPropertyAsFiletime (name string ,filetime _aa .Time ){_fbae :=_dbdd .getNewProperty (name );_fbae .Filetime =&filetime ;_dbdd .setOrReplaceProperty (_fbae );};
|
||||
|
||||
// Title returns the Title of the document
|
||||
func (_fef CoreProperties )Title ()string {if _fef ._bc .Title !=nil {return string (_fef ._bc .Title .Data );};return "";};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_eef CoreProperties )X ()*_fc .CoreProperties {return _eef ._bc };
|
||||
|
||||
// AddImageToZip adds an image (either from bytes or from disk) and adds it to the zip file.
|
||||
func AddImageToZip (z *_e .Writer ,img ImageRef ,imageNum int ,dt _fcf .DocType )error {_aca :=_fcf .AbsoluteImageFilename (dt ,imageNum ,_bbb .ToLower (img .Format ()));if img .Data ()!=nil &&len (*img .Data ())> 0{if _bfca :=_fae .AddFileFromBytes (z ,_aca ,*img .Data ());_bfca !=nil {return _bfca ;};}else if img .Path ()!=""{if _egee :=_fae .AddFileFromDisk (z ,_aca ,img .Path ());_egee !=nil {return _egee ;};}else {return _g .Errorf ("\u0075\u006es\u0075\u0070\u0070\u006f\u0072\u0074\u0065\u0064\u0020\u0069\u006d\u0061\u0067\u0065\u0020\u0073\u006f\u0075\u0072\u0063\u0065\u003a %\u002b\u0076",img );};return nil ;};func (_cee CustomProperties )SetPropertyAsEmpty (name string ){_ggf :=_cee .getNewProperty (name );_ggf .Empty =_dd .NewEmpty ();_cee .setOrReplaceProperty (_ggf );};func (_dce CustomProperties )SetPropertyAsInt (name string ,i int ){_aeb :=_dce .getNewProperty (name );_gbaf :=int32 (i );_aeb .Int =&_gbaf ;_dce .setOrReplaceProperty (_aeb );};
|
||||
|
||||
// Data returns the data of an image file, if any.
|
||||
func (_fda ImageRef )Data ()*[]byte {return _fda ._fgb .Data };
|
||||
|
||||
// NewRelationshipsCopy creates a new relationships wrapper as a copy of passed in instance.
|
||||
func NewRelationshipsCopy (rels Relationships )Relationships {_cbaa :=*rels ._dbb ;return Relationships {_dbb :&_cbaa };};
|
||||
|
||||
// NewTheme constructs a new theme.
|
||||
func NewTheme ()Theme {return Theme {_bg .NewTheme ()}};
|
||||
|
||||
// Table represents a table in the document.
|
||||
type Table struct{_ddcg *_bg .Tbl ;_edfb *_bg .CT_Transform2D ;};func (_fac CustomProperties )setPropertyHelper (_aeea *_c .CT_Property ,_bec bool ){_eac :=_fac .GetPropertyByName (*_aeea .NameAttr );if (_eac ==CustomProperty {}){_fac ._adg .Property =append (_fac ._adg .Property ,_aeea );}else if _bec {_aeea .FmtidAttr =_eac ._gba .FmtidAttr ;if _eac ._gba .PidAttr ==0{_aeea .PidAttr =_eac ._gba .PidAttr ;};_aeea .LinkTargetAttr =_eac ._gba .LinkTargetAttr ;*_eac ._gba =*_aeea ;};};func (_gdd CustomProperties )SetPropertyAsI2 (name string ,i2 int16 ){_eaf :=_gdd .getNewProperty (name );_eaf .I2 =&i2 ;_gdd .setOrReplaceProperty (_eaf );};
|
||||
|
||||
// Format returns the format of the underlying image
|
||||
func (_gcbb ImageRef )Format ()string {return _gcbb ._fgb .Format };func (_aba CustomProperties )getNewProperty (_dgf string )*_c .CT_Property {_cbb :=_aba ._adg .Property ;_ebe :=int32 (1);for _ ,_agg :=range _cbb {if _agg .PidAttr > _ebe {_ebe =_agg .PidAttr ;};};_dgb :=_c .NewCT_Property ();_dgb .NameAttr =&_dgf ;_dgb .PidAttr =_ebe +1;_dgb .FmtidAttr ="\u007b\u0044\u0035\u0043\u0044\u0044\u0035\u0030\u0035\u002d\u0032\u0045\u0039\u0043\u002d\u0031\u0030\u0031\u0042\u002d\u0039\u0033\u0039\u0037-\u0030\u0038\u0030\u0030\u0032B\u0032\u0043F\u0039\u0041\u0045\u007d";return _dgb ;};var ReleasedAt =_aa .Date (_eee ,_gdg ,_bfg ,_cdda ,_eecb ,0,0,_aa .UTC );
|
||||
|
||||
// CustomProperties contains document specific properties.
|
||||
type CustomProperties struct{_adg *_c .Properties };const _gbef ="\u0032\u0020\u004aan\u0075\u0061\u0072\u0079\u0020\u0032\u0030\u0030\u0036\u0020\u0061\u0074\u0020\u0031\u0035\u003a\u0030\u0034";func (_ceae CustomProperties )SetPropertyAsCy (name string ,cy string ){_abb :=_ceae .getNewProperty (name );_abb .Cy =&cy ;_ceae .setOrReplaceProperty (_abb );};
|
||||
|
||||
// RelativeWidth returns the relative width of an image given a fixed height.
|
||||
// This is used when setting image to a fixed height to calculate the width
|
||||
// required to keep the same image aspect ratio.
|
||||
func (_fbcb ImageRef )RelativeWidth (h _ee .Distance )_ee .Distance {_eadb :=float64 (_fbcb .Size ().X )/float64 (_fbcb .Size ().Y );return h *_ee .Distance (_eadb );};
|
||||
|
||||
// ID returns the ID of a relationship.
|
||||
func (_age Relationship )ID ()string {return _age ._gae .IdAttr };
|
||||
// NewTable makes a new table.
|
||||
func NewTable ()*Table {_gbba :=_de .NewTbl ();_gbba .TblPr =_de .NewCT_TableProperties ();return &Table {_cdgc :_gbba };};
|
||||
|
||||
// CustomProperty contains document specific property.
|
||||
// Using of this type is deprecated.
|
||||
type CustomProperty struct{_gba *_c .CT_Property };func (_ddad CustomProperties )SetPropertyAsClsid (name string ,clsid string ){_dcf :=_ddad .getNewProperty (name );_dcf .Clsid =&clsid ;_ddad .setOrReplaceProperty (_dcf );};const _eee =2023;
|
||||
|
||||
// AppProperties contains properties specific to the document and the
|
||||
// application that created it.
|
||||
type AppProperties struct{_fcg *_bee .Properties };
|
||||
|
||||
// CoreProperties contains document specific properties.
|
||||
type CoreProperties struct{_bc *_fc .CoreProperties };
|
||||
|
||||
// Target returns the target (path) of a relationship.
|
||||
func (_aef Relationship )Target ()string {return _aef ._gae .TargetAttr };
|
||||
|
||||
// TableRow represents a row in a table.
|
||||
type TableRow struct{_dfd *_bg .CT_TableRow };
|
||||
|
||||
// Author returns the author of the document
|
||||
func (_cea CoreProperties )Author ()string {if _cea ._bc .Creator !=nil {return string (_cea ._bc .Creator .Data );};return "";};func (_aedcb CustomProperties )SetPropertyAsOblob (name ,oblob string ){_dgbe :=_aedcb .getNewProperty (name );_dgbe .Oblob =&oblob ;_aedcb .setOrReplaceProperty (_dgbe );};
|
||||
|
||||
// Modified returns the time that the document was modified.
|
||||
func (_fega CoreProperties )Modified ()_aa .Time {return _bedd (_fega ._bc .Modified )};
|
||||
|
||||
// NewRelationship constructs a new relationship.
|
||||
func NewRelationship ()Relationship {return Relationship {_gae :_ag .NewRelationship ()}};
|
||||
|
||||
// Remove removes an existing relationship.
|
||||
func (_caac Relationships )Remove (rel Relationship )bool {for _dbadd ,_cae :=range _caac ._dbb .Relationship {if _cae ==rel ._gae {copy (_caac ._dbb .Relationship [_dbadd :],_caac ._dbb .Relationship [_dbadd +1:]);_caac ._dbb .Relationship =_caac ._dbb .Relationship [0:len (_caac ._dbb .Relationship )-1];return true ;};};return false ;};
|
||||
|
||||
// X returns the inner raw content types.
|
||||
func (_eab ContentTypes )X ()*_bd .Types {return _eab ._eba };
|
||||
|
||||
// SetContentStatus records the content status of the document.
|
||||
func (_agd CoreProperties )SetContentStatus (s string ){_agd ._bc .ContentStatus =&s };
|
||||
|
||||
// GetByRelId returns a relationship with the associated relation ID.
|
||||
func (_cbd Relationships )GetByRelId (idAttr string )Relationship {for _ ,_cbbe :=range _cbd ._dbb .Relationship {if _cbbe .IdAttr ==idAttr {return Relationship {_gae :_cbbe };};};return Relationship {};};func (_edfe CustomProperties )setOrReplaceProperty (_bad *_c .CT_Property ){_edfe .setPropertyHelper (_bad ,true );};func (_ace CustomProperties )SetPropertyAsBlob (name ,blob string ){_dbc :=_ace .getNewProperty (name );_dbc .Blob =&blob ;_ace .setOrReplaceProperty (_dbc );};func (_caf CustomProperties )SetPropertyAsUi2 (name string ,ui2 uint16 ){_dad :=_caf .getNewProperty (name );_dad .Ui2 =&ui2 ;_caf .setOrReplaceProperty (_dad );};
|
||||
|
||||
// SetCreated sets the time that the document was created.
|
||||
func (_eae CoreProperties )SetCreated (t _aa .Time ){_eae ._bc .Created =_afc (t ,"\u0064c\u0074e\u0072\u006d\u0073\u003a\u0063\u0072\u0065\u0061\u0074\u0065\u0064");};func (_egf CustomProperties )SetPropertyAsOstream (name string ,ostream string ){_fcea :=_egf .getNewProperty (name );_fcea .Ostream =&ostream ;_egf .setOrReplaceProperty (_fcea );};
|
||||
|
||||
// SetWidth sets column width, see measurement package.
|
||||
func (_babg TableCol )SetWidth (m _ee .Distance ){_eaec :=_ee .ToEMU (float64 (m ));_babg ._gada .WAttr =_bg .ST_Coordinate {ST_CoordinateUnqualified :&_eaec };};
|
||||
|
||||
// Size returns the size of an image
|
||||
func (_acb ImageRef )Size ()_bba .Point {return _acb ._fgb .Size };func (_gfd CustomProperties )SetPropertyAsUint (name string ,ui uint ){_acff :=_gfd .getNewProperty (name );_eaea :=uint32 (ui );_acff .Uint =&_eaea ;_gfd .setOrReplaceProperty (_acff );};
|
||||
|
||||
// GetPropertyByName returns a custom property selected by it's name.
|
||||
func (_ecb CustomProperties )GetPropertyByName (name string )CustomProperty {_bdcd :=_ecb ._adg .Property ;for _ ,_faed :=range _bdcd {if *_faed .NameAttr ==name {return CustomProperty {_gba :_faed };};};return CustomProperty {};};func (_bbce CustomProperties )SetPropertyAsDecimal (name string ,decimal float64 ){_bcf :=_bbce .getNewProperty (name );_bcf .Decimal =&decimal ;_bbce .setOrReplaceProperty (_bcf );};
|
||||
|
||||
// Type returns the type of a relationship.
|
||||
func (_cde Relationship )Type ()string {return _cde ._gae .TypeAttr };
|
||||
|
||||
// SetLanguage records the language of the document.
|
||||
func (_efc CoreProperties )SetLanguage (s string ){_efc ._bc .Language =&_fcf .XSDAny {XMLName :_fa .Name {Local :"d\u0063\u003a\u006c\u0061\u006e\u0067\u0075\u0061\u0067\u0065"}};_efc ._bc .Language .Data =[]byte (s );};
|
||||
|
||||
// ImageFromFile reads an image from a file on disk. It doesn't keep the image
|
||||
// in memory and only reads it to determine the format and size. You can also
|
||||
// construct an Image directly if the file and size are known.
|
||||
// NOTE: See also ImageFromStorage.
|
||||
func ImageFromFile (path string )(Image ,error ){_geeg ,_dabb :=_be .Open (path );_bgd :=Image {};if _dabb !=nil {return _bgd ,_g .Errorf ("\u0065\u0072\u0072or\u0020\u0072\u0065\u0061\u0064\u0069\u006e\u0067\u0020\u0069\u006d\u0061\u0067\u0065\u003a\u0020\u0025\u0073",_dabb );};defer _geeg .Close ();_begef ,_bbe ,_dabb :=_bba .Decode (_geeg );if _dabb !=nil {return _bgd ,_g .Errorf ("\u0075n\u0061\u0062\u006c\u0065 \u0074\u006f\u0020\u0070\u0061r\u0073e\u0020i\u006d\u0061\u0067\u0065\u003a\u0020\u0025s",_dabb );};_bgd .Path =path ;_bgd .Format =_bbe ;_bgd .Size =_begef .Bounds ().Size ();return _bgd ,nil ;};func (_fcce CustomProperties )SetPropertyAsVstream (name string ,vstream *_dd .Vstream ){_cec :=_fcce .getNewProperty (name );_cec .Vstream =vstream ;_fcce .setOrReplaceProperty (_cec );};
|
||||
|
||||
// X returns the inner wrapped XML type of CustomProperty.
|
||||
func (_gag CustomProperty )X ()*_c .CT_Property {return _gag ._gba };func (_fab CustomProperties )SetPropertyAsStream (name string ,stream string ){_bda :=_fab .getNewProperty (name );_bda .Stream =&stream ;_fab .setOrReplaceProperty (_bda );};
|
||||
|
||||
// Relationships returns a slice of all of the relationships.
|
||||
func (_beba Relationships )Relationships ()[]Relationship {_adab :=[]Relationship {};for _ ,_cfb :=range _beba ._dbb .Relationship {_adab =append (_adab ,Relationship {_gae :_cfb });};return _adab ;};
|
||||
|
||||
// ImageFromStorage reads an image using the currently set
|
||||
// temporary storage mechanism (see tempstorage). You can also
|
||||
// construct an Image directly if the file and size are known.
|
||||
func ImageFromStorage (path string )(Image ,error ){_cfg :=Image {};_aeac ,_fbda :=_gf .Open (path );if _fbda !=nil {return _cfg ,_g .Errorf ("\u0065\u0072\u0072or\u0020\u0072\u0065\u0061\u0064\u0069\u006e\u0067\u0020\u0069\u006d\u0061\u0067\u0065\u003a\u0020\u0025\u0073",_fbda );};defer _aeac .Close ();_acca ,_gdad ,_fbda :=_bba .Decode (_aeac );if _fbda !=nil {return _cfg ,_g .Errorf ("\u0075n\u0061\u0062\u006c\u0065 \u0074\u006f\u0020\u0070\u0061r\u0073e\u0020i\u006d\u0061\u0067\u0065\u003a\u0020\u0025s",_fbda );};_cfg .Path =path ;_cfg .Format =_gdad ;_cfg .Size =_acca .Bounds ().Size ();return _cfg ,nil ;};
|
||||
|
||||
// Application returns the name of the application that created the document.
|
||||
// For unioffice created documents, it defaults to github.com/unidoc/unioffice
|
||||
func (_cac AppProperties )Application ()string {if _cac ._fcg .Application !=nil {return *_cac ._fcg .Application ;};return "";};
|
||||
|
||||
// AddAutoRelationship adds a relationship with an automatically generated
|
||||
// filename based off of the type. It should be preferred over AddRelationship
|
||||
// to ensure consistent filenames are maintained.
|
||||
func (_abge Relationships )AddAutoRelationship (dt _fcf .DocType ,src string ,idx int ,ctype string )Relationship {return _abge .AddRelationship (_fcf .RelativeFilename (dt ,src ,ctype ,idx ),ctype );};var _gbf =_ff .New ("\u0069\u006d\u0061\u0067\u0065\u0020\u006e\u006f\u0074\u0020\u0066o\u0075\u006e\u0064\u0020\u0069\u006e\u0020\u0073\u0074\u006fr\u0061\u0067\u0065");
|
||||
|
||||
// AddRow adds a row to a table.
|
||||
func (_cag Table )AddRow ()*TableRow {_fad :=_bg .NewCT_TableRow ();for _fede :=0;_fede < len (_cag ._ddcg .TblGrid .GridCol );_fede ++{_fad .Tc =append (_fad .Tc ,_bg .NewCT_TableCell ());};_cag ._ddcg .Tr =append (_cag ._ddcg .Tr ,_fad );return &TableRow {_dfd :_fad };};
|
||||
|
||||
// WriteExtraFiles writes the extra files to the zip package.
|
||||
func (_fbd *DocBase )WriteExtraFiles (z *_e .Writer )error {for _ ,_eebg :=range _fbd .ExtraFiles {if _acc :=_fae .AddFileFromDisk (z ,_eebg .ZipPath ,_eebg .DiskPath );_acc !=nil {return _acc ;};};return nil ;};
|
||||
|
||||
// Target returns the target attrubute of the image reference (a path where the image file is located in the document structure).
|
||||
func (_cgcc *ImageRef )Target ()string {return _cgcc ._adad };
|
||||
|
||||
// AddCol adds a column to a table.
|
||||
func (_fgca Table )AddCol ()*TableCol {_ddef :=_bg .NewCT_TableCol ();_fgca ._ddcg .TblGrid .GridCol =append (_fgca ._ddcg .TblGrid .GridCol ,_ddef );for _ ,_gafb :=range _fgca ._ddcg .Tr {_gcd :=_bg .NewCT_TableCell ();_gafb .Tc =append (_gafb .Tc ,_gcd );};return &TableCol {_gada :_ddef };};
|
||||
|
||||
// SetModified sets the time that the document was modified.
|
||||
func (_fge CoreProperties )SetModified (t _aa .Time ){_fge ._bc .Modified =_afc (t ,"\u0064\u0063t\u0065\u0072\u006ds\u003a\u006d\u006f\u0064\u0069\u0066\u0069\u0065\u0064");};func (_caa CustomProperties )SetPropertyAsNull (name string ){_aac :=_caa .getNewProperty (name );_aac .Null =_dd .NewNull ();_caa .setOrReplaceProperty (_aac );};
|
||||
|
||||
// RemoveOverride removes an override given a path.
|
||||
func (_fbc ContentTypes )RemoveOverride (path string ){if !_bbb .HasPrefix (path ,"\u002f"){path ="\u002f"+path ;};for _df ,_efd :=range _fbc ._eba .Override {if _efd .PartNameAttr ==path {copy (_fbc ._eba .Override [_df :],_fbc ._eba .Override [_df +1:]);_fbc ._eba .Override =_fbc ._eba .Override [0:len (_fbc ._eba .Override )-1];};};};
|
||||
|
||||
// Path returns the path to an image file, if any.
|
||||
func (_eeg ImageRef )Path ()string {return _eeg ._fgb .Path };func (_gge CustomProperties )SetPropertyAsLpstr (name string ,lpstr string ){_baf :=_gge .getNewProperty (name );_baf .Lpstr =&lpstr ;_gge .setOrReplaceProperty (_baf );};
|
||||
|
||||
// Properties returns table properties.
|
||||
func (_ageb Table )Properties ()*_bg .CT_TableProperties {return _ageb ._ddcg .TblPr };
|
||||
|
||||
// NewTableWithXfrm makes a new table with a pointer to its parent Xfrm for changing its offset and size.
|
||||
func NewTableWithXfrm (xfrm *_bg .CT_Transform2D )*Table {_gffa :=_bg .NewTbl ();_gffa .TblPr =_bg .NewCT_TableProperties ();return &Table {_ddcg :_gffa ,_edfb :xfrm };};
|
||||
type CustomProperty struct{_ebgc *_cb .CT_Property };
|
||||
|
||||
// CopyRelationship copies the relationship.
|
||||
func (_bdgeg Relationships )CopyRelationship (idAttr string )(Relationship ,bool ){for _fbca :=range _bdgeg ._dbb .Relationship {if _bdgeg ._dbb .Relationship [_fbca ].IdAttr ==idAttr {_dbce :=*_bdgeg ._dbb .Relationship [_fbca ];_ded :=len (_bdgeg ._dbb .Relationship )+1;_gfda :=map[string ]struct{}{};for _ ,_gbcg :=range _bdgeg ._dbb .Relationship {_gfda [_gbcg .IdAttr ]=struct{}{};};for _ ,_eega :=_gfda [_g .Sprintf ("\u0072\u0049\u0064%\u0064",_ded )];_eega ;_ ,_eega =_gfda [_g .Sprintf ("\u0072\u0049\u0064%\u0064",_ded )]{_ded ++;};_dbce .IdAttr =_g .Sprintf ("\u0072\u0049\u0064%\u0064",_ded );_bdgeg ._dbb .Relationship =append (_bdgeg ._dbb .Relationship ,&_dbce );return Relationship {_gae :&_dbce },true ;};};return Relationship {},false ;};
|
||||
|
||||
// RemoveOverrideByIndex removes an override given a path and override index.
|
||||
func (_gaa ContentTypes )RemoveOverrideByIndex (path string ,indexToFind int )error {_aad :=path [0:len (path )-5];if !_bbb .HasPrefix (_aad ,"\u002f"){_aad ="\u002f"+_aad ;};_dea ,_ba :=_fg .Compile (_aad +"\u0028\u005b\u0030-\u0039\u005d\u002b\u0029\u002e\u0078\u006d\u006c");if _ba !=nil {return _ba ;};_gc :=0;_aedc :=-1;for _efb ,_bbag :=range _gaa ._eba .Override {if _bfe :=_dea .FindStringSubmatch (_bbag .PartNameAttr );len (_bfe )> 1{if _gc ==indexToFind {_aedc =_efb ;}else if _gc > indexToFind {_dagd ,_ :=_ffa .Atoi (_bfe [1]);_dagd --;_bbag .PartNameAttr =_g .Sprintf ("\u0025\u0073\u0025\u0064\u002e\u0078\u006d\u006c",_aad ,_dagd );};_gc ++;};};if _aedc > -1{copy (_gaa ._eba .Override [_aedc :],_gaa ._eba .Override [_aedc +1:]);_gaa ._eba .Override =_gaa ._eba .Override [0:len (_gaa ._eba .Override )-1];};return nil ;};
|
||||
|
||||
// ContentStatus returns the content status of the document (e.g. "Final", "Draft")
|
||||
func (_eebd CoreProperties )ContentStatus ()string {if _eebd ._bc .ContentStatus !=nil {return *_eebd ._bc .ContentStatus ;};return "";};
|
||||
|
||||
// SetApplication sets the name of the application that created the document.
|
||||
func (_aaa AppProperties )SetApplication (s string ){_aaa ._fcg .Application =&s };
|
||||
|
||||
// IsEmpty returns true if there are no relationships.
|
||||
func (_bca Relationships )IsEmpty ()bool {return _bca ._dbb ==nil ||len (_bca ._dbb .Relationship )==0};func (_afca CustomProperties )SetPropertyAsUi4 (name string ,ui4 uint32 ){_gdc :=_afca .getNewProperty (name );_gdc .Ui4 =&ui4 ;_afca .setOrReplaceProperty (_gdc );};
|
||||
|
||||
// PropertiesList returns the list of all custom properties of the document.
|
||||
func (_gd CustomProperties )PropertiesList ()[]*_c .CT_Property {return _gd ._adg .Property };func (_cdd CustomProperties )SetPropertyAsI4 (name string ,i4 int32 ){_gda :=_cdd .getNewProperty (name );_gda .I4 =&i4 ;_cdd .setOrReplaceProperty (_gda );};
|
||||
|
||||
// SetTarget changes the target attribute of the image reference (e.g. in the case of the creation of the reference or if the image which the reference is related to was moved from one location to another).
|
||||
func (_dcd *ImageRef )SetTarget (target string ){_dcd ._adad =target };
|
||||
|
||||
// MakeImageRef constructs an image reference which is a reference to a
|
||||
// particular image file inside a document. The same image can be used multiple
|
||||
// times in a document by re-use the ImageRef.
|
||||
func MakeImageRef (img Image ,d *DocBase ,rels Relationships )ImageRef {return ImageRef {_fgb :img ,_aeg :d ,_acfc :rels };};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_gcca Theme )X ()*_bg .Theme {return _gcca ._ceag };func (_dba CustomProperties )SetPropertyAsI1 (name string ,i1 int8 ){_cca :=_dba .getNewProperty (name );_cca .I1 =&i1 ;_dba .setOrReplaceProperty (_cca );};func (_efbd *ImageRef )SetRelID (id string ){_efbd ._gcb =id };
|
||||
|
||||
// ImageRef is a reference to an image within a document.
|
||||
type ImageRef struct{_aeg *DocBase ;_acfc Relationships ;_fgb Image ;_gcb string ;_adad string ;};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_cbfa Relationship )X ()*_ag .Relationship {return _cbfa ._gae };
|
||||
|
||||
// FindRIDForN returns the relationship ID for the i'th relationship of type t.
|
||||
func (_ecgb Relationships )FindRIDForN (i int ,t string )string {for _ ,_fbdd :=range _ecgb ._dbb .CT_Relationships .Relationship {if _fbdd .TypeAttr ==t {if i ==0{return _fbdd .IdAttr ;};i --;};};return "";};
|
||||
|
||||
// GetImageBytesByTarget returns Image object with Data bytes read from its target.
|
||||
func (_fabc *DocBase )GetImageBytesByTarget (target string )(Image ,error ){if target !=""{target ="\u0077\u006f\u0072d\u002f"+target ;for _ ,_fea :=range _fabc .Images {if _fea .Target ()==target {return ImageFromStorage (_fea .Path ());};};};return Image {},_gbf ;};func _afc (_dda _aa .Time ,_bdb string )*_fcf .XSDAny {_ffb :=&_fcf .XSDAny {XMLName :_fa .Name {Local :_bdb }};_ffb .Attrs =append (_ffb .Attrs ,_fa .Attr {Name :_fa .Name {Local :"\u0078\u0073\u0069\u003a\u0074\u0079\u0070\u0065"},Value :"\u0064\u0063\u0074\u0065\u0072\u006d\u0073\u003a\u00573\u0043\u0044\u0054\u0046"});_ffb .Attrs =append (_ffb .Attrs ,_fa .Attr {Name :_fa .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u0078\u0073i"},Value :"\u0068\u0074\u0074\u0070\u003a/\u002f\u0077\u0077\u0077\u002e\u0077\u0033\u002e\u006f\u0072\u0067\u002f\u00320\u0030\u0031\u002f\u0058\u004d\u004c\u0053\u0063\u0068\u0065\u006d\u0061\u002d\u0069\u006e\u0073\u0074\u0061\u006e\u0063\u0065"});_ffb .Attrs =append (_ffb .Attrs ,_fa .Attr {Name :_fa .Name {Local :"\u0078\u006d\u006c\u006e\u0073\u003a\u0064\u0063\u0074\u0065\u0072\u006d\u0073"},Value :"\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/"});_ffb .Data =[]byte (_dda .Format (_cfa ));return _ffb ;};
|
||||
|
||||
// Theme is a drawingml theme.
|
||||
type Theme struct{_ceag *_bg .Theme };
|
||||
|
||||
// SetDescription records the description of the document.
|
||||
func (_cgg CoreProperties )SetDescription (s string ){if _cgg ._bc .Description ==nil {_cgg ._bc .Description =&_fcf .XSDAny {XMLName :_fa .Name {Local :"\u0064\u0063\u003a\u0064\u0065\u0073\u0063\u0072\u0069p\u0074\u0069\u006f\u006e"}};};_cgg ._bc .Description .Data =[]byte (s );};
|
||||
|
||||
// GetTargetByRelIdAndType returns a target path with the associated relation ID.
|
||||
func (_bdcc Relationships )GetTargetByRelIdAndType (idAttr string ,typeAttr string )string {for _ ,_ebf :=range _bdcc ._dbb .Relationship {if _ebf .IdAttr ==idAttr &&_ebf .TypeAttr ==typeAttr {return _ebf .TargetAttr ;};};return "";};
|
||||
|
||||
// CopyOverride copies override content type for a given `path` and puts it with a path `newPath`.
|
||||
func (_bege ContentTypes )CopyOverride (path ,newPath string ){if !_bbb .HasPrefix (path ,"\u002f"){path ="\u002f"+path ;};if !_bbb .HasPrefix (newPath ,"\u002f"){newPath ="\u002f"+newPath ;};for _bef :=range _bege ._eba .Override {if _bege ._eba .Override [_bef ].PartNameAttr ==path {_geb :=*_bege ._eba .Override [_bef ];_geb .PartNameAttr =newPath ;_bege ._eba .Override =append (_bege ._eba .Override ,&_geb );};};};func (_dbaf CustomProperties )SetPropertyAsOstorage (name string ,ostorage string ){_dbdf :=_dbaf .getNewProperty (name );_dbdf .Ostorage =&ostorage ;_dbaf .setOrReplaceProperty (_dbdf );};
|
||||
|
||||
// X returns the underlying raw XML data.
|
||||
func (_edfc Relationships )X ()*_ag .Relationships {return _edfc ._dbb };func (_gcf CustomProperties )SetPropertyAsR8 (name string ,r8 float64 ){_gde :=_gcf .getNewProperty (name );_gde .R8 =&r8 ;_gcf .setOrReplaceProperty (_gde );};func (_cff CustomProperties )SetPropertyAsBool (name string ,b bool ){_cgb :=_cff .getNewProperty (name );_cgb .Bool =&b ;_cff .setOrReplaceProperty (_cgb );};
|
||||
|
||||
// AddRelationship adds a relationship.
|
||||
func (_fedg Relationships )AddRelationship (target ,ctype string )Relationship {if !_bbb .HasPrefix (ctype ,"\u0068t\u0074\u0070\u003a\u002f\u002f"){_ca .Log .Debug ("\u0072\u0065\u006c\u0061\u0074\u0069\u006f\u006es\u0068\u0069\u0070 t\u0079\u0070\u0065\u0020\u0025\u0073 \u0073\u0068\u006f\u0075\u006c\u0064\u0020\u0073\u0074\u0061\u0072\u0074\u0020\u0077\u0069t\u0068\u0020\u0027\u0068\u0074\u0074\u0070\u003a/\u002f\u0027",ctype );};_dfg :=_ag .NewRelationship ();_bbbg :=len (_fedg ._dbb .Relationship )+1;_ffg :=map[string ]struct{}{};for _ ,_bgad :=range _fedg ._dbb .Relationship {_ffg [_bgad .IdAttr ]=struct{}{};};for _ ,_gbcb :=_ffg [_g .Sprintf ("\u0072\u0049\u0064%\u0064",_bbbg )];_gbcb ;_ ,_gbcb =_ffg [_g .Sprintf ("\u0072\u0049\u0064%\u0064",_bbbg )]{_bbbg ++;};_dfg .IdAttr =_g .Sprintf ("\u0072\u0049\u0064%\u0064",_bbbg );_dfg .TargetAttr =target ;_dfg .TypeAttr =ctype ;_fedg ._dbb .Relationship =append (_fedg ._dbb .Relationship ,_dfg );return Relationship {_gae :_dfg };};func (_dgbef CustomProperties )SetPropertyAsUi8 (name string ,ui8 uint64 ){_cba :=_dgbef .getNewProperty (name );_cba .Ui8 =&ui8 ;_dgbef .setOrReplaceProperty (_cba );};
|
||||
func (_fafc Relationships )CopyRelationship (idAttr string )(Relationship ,bool ){for _fbcae :=range _fafc ._gda .Relationship {if _fafc ._gda .Relationship [_fbcae ].IdAttr ==idAttr {_gbbd :=*_fafc ._gda .Relationship [_fbcae ];_baa :=len (_fafc ._gda .Relationship )+1;_afcg :=map[string ]struct{}{};for _ ,_dgabg :=range _fafc ._gda .Relationship {_afcg [_dgabg .IdAttr ]=struct{}{};};for _ ,_agf :=_afcg [_ge .Sprintf ("\u0072\u0049\u0064%\u0064",_baa )];_agf ;_ ,_agf =_afcg [_ge .Sprintf ("\u0072\u0049\u0064%\u0064",_baa )]{_baa ++;};_gbbd .IdAttr =_ge .Sprintf ("\u0072\u0049\u0064%\u0064",_baa );_fafc ._gda .Relationship =append (_fafc ._gda .Relationship ,&_gbbd );return Relationship {_cbc :&_gbbd },true ;};};return Relationship {},false ;};
|
||||
|
||||
// NewRelationships creates a new relationship wrapper.
|
||||
func NewRelationships ()Relationships {return Relationships {_dbb :_ag .NewRelationships ()}};
|
||||
func NewRelationships ()Relationships {return Relationships {_gda :_fdg .NewRelationships ()}};
|
||||
|
||||
// DocBase is the type embedded in in the Document/Workbook/Presentation types
|
||||
// that contains members common to all.
|
||||
type DocBase struct{ContentTypes ContentTypes ;AppProperties AppProperties ;Rels Relationships ;CoreProperties CoreProperties ;CustomProperties CustomProperties ;Thumbnail _bba .Image ;Images []ImageRef ;ExtraFiles []ExtraFile ;TmpPath string ;};
|
||||
// SetApplicationVersion sets the version of the application that created the
|
||||
// document. Per MS, the verison string mut be in the form 'XX.YYYY'.
|
||||
func (_abe AppProperties )SetApplicationVersion (s string ){_abe ._cade .AppVersion =&s };func (_cbb CustomProperties )SetPropertyAsOstorage (name string ,ostorage string ){_dge :=_cbb .getNewProperty (name );_dge .Ostorage =&ostorage ;_cbb .setOrReplaceProperty (_dge );};func (_dffa CustomProperties )SetPropertyAsBstr (name string ,bstr string ){_gfg :=_dffa .getNewProperty (name );_gfg .Bstr =&bstr ;_dffa .setOrReplaceProperty (_gfg );};
|
||||
|
||||
// Created returns the time that the document was created.
|
||||
func (_dc CoreProperties )Created ()_aa .Time {return _bedd (_dc ._bc .Created )};
|
||||
// TableStyles contains document specific properties.
|
||||
type TableStyles struct{_dcg *_de .TblStyleLst };
|
||||
|
||||
// Cells returns an array of row cells.
|
||||
func (_dfda TableRow )Cells ()[]*_bg .CT_TableCell {return _dfda ._dfd .Tc };
|
||||
// SetModified sets the time that the document was modified.
|
||||
func (_ffg CoreProperties )SetModified (t _ga .Time ){_ffg ._feg .Modified =_daec (t ,"\u0064\u0063t\u0065\u0072\u006ds\u003a\u006d\u006f\u0064\u0069\u0066\u0069\u0065\u0064");};
|
||||
|
||||
// Rows returns all table rows.
|
||||
func (_bgbb Table )Rows ()[]*TableRow {_gbb :=_bgbb ._ddcg .Tr ;_gfc :=[]*TableRow {};for _ ,_gfb :=range _gbb {_gfc =append (_gfc ,&TableRow {_dfd :_gfb });};return _gfc ;};
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_bad Relationship )X ()*_fdg .Relationship {return _bad ._cbc };
|
||||
|
||||
// GetImageBytesByTarget returns Image object with Data bytes read from its target.
|
||||
func (_aef *DocBase )GetImageBytesByTarget (target string )(Image ,error ){if target !=""{target ="\u0077\u006f\u0072d\u002f"+target ;for _ ,_aefd :=range _aef .Images {if _aefd .Target ()==target {return ImageFromStorage (_aefd .Path ());};};};return Image {},_deb ;};
|
||||
|
||||
// Path returns the path to an image file, if any.
|
||||
func (_cdba ImageRef )Path ()string {return _cdba ._eabb .Path };
|
||||
|
||||
// Size returns the size of an image
|
||||
func (_beed ImageRef )Size ()_e .Point {return _beed ._eabb .Size };
|
||||
|
||||
// Target returns the target (path) of a relationship.
|
||||
func (_acf Relationship )Target ()string {return _acf ._cbc .TargetAttr };const _ggce =10;
|
||||
|
||||
// Clear removes any existing relationships.
|
||||
func (_fbca Relationships )Clear (){_fbca ._gda .Relationship =nil };
|
||||
|
||||
// SetLastModifiedBy records the last person to modify the document.
|
||||
func (_bcfb CoreProperties )SetLastModifiedBy (s string ){_bcfb ._feg .LastModifiedBy =&s };const _fged =15;
|
||||
|
||||
// AddCol adds a column to a table.
|
||||
func (_deeg Table )AddCol ()*TableCol {_gcf :=_de .NewCT_TableCol ();_deeg ._cdgc .TblGrid .GridCol =append (_deeg ._cdgc .TblGrid .GridCol ,_gcf );for _ ,_fcg :=range _deeg ._cdgc .Tr {_bcae :=_de .NewCT_TableCell ();_fcg .Tc =append (_fcg .Tc ,_bcae );};return &TableCol {_cfedd :_gcf };};
|
||||
|
||||
// Image is a container for image information. It's used as we need format and
|
||||
// and size information to use images.
|
||||
// It contains either the filesystem path to the image, or the image itself.
|
||||
type Image struct{Size _bba .Point ;Format string ;Path string ;Data *[]byte ;};
|
||||
type Image struct{Size _e .Point ;Format string ;Path string ;Data *[]byte ;};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_gbc AppProperties )X ()*_bee .Properties {return _gbc ._fcg };
|
||||
// RelativeHeight returns the relative height of an image given a fixed width.
|
||||
// This is used when setting image to a fixed width to calculate the height
|
||||
// required to keep the same image aspect ratio.
|
||||
func (_gea ImageRef )RelativeHeight (w _gfd .Distance )_gfd .Distance {_bce :=float64 (_gea .Size ().Y )/float64 (_gea .Size ().X );return w *_gfd .Distance (_bce );};func (_cfeddg TableRow )addCell ()*_de .CT_TableCell {_bcba :=_de .NewCT_TableCell ();_cfeddg ._bcef .Tc =append (_cfeddg ._bcef .Tc ,_bcba );return _bcba ;};func (_aeg CustomProperties )SetPropertyAsUint (name string ,ui uint ){_gaf :=_aeg .getNewProperty (name );_facd :=uint32 (ui );_gaf .Uint =&_facd ;_aeg .setOrReplaceProperty (_gaf );};const _ecb =6;
|
||||
|
||||
// EnsureOverride ensures that an override for the given path exists, adding it if necessary
|
||||
func (_cg ContentTypes )EnsureOverride (path ,contentType string ){for _ ,_ebb :=range _cg ._eba .Override {if _ebb .PartNameAttr ==path {if _bbb .HasPrefix (contentType ,"\u0068\u0074\u0074\u0070"){_ca .Log .Debug ("\u0063\u006f\u006e\u0074\u0065\u006et\u0020\u0074\u0079p\u0065\u0020\u0027%\u0073\u0027\u0020\u0069\u0073\u0020\u0069\u006e\u0063\u006fr\u0072\u0065\u0063\u0074\u002c m\u0075\u0073\u0074\u0020\u006e\u006f\u0074\u0020\u0073\u0074\u0061\u0072\u0074\u0020\u0077\u0069\u0074\u0068\u0020\u0068\u0074\u0074\u0070",contentType );};_ebb .ContentTypeAttr =contentType ;return ;};};_cg .AddOverride (path ,contentType );};
|
||||
// Format returns the format of the underlying image
|
||||
func (_gdba ImageRef )Format ()string {return _gdba ._eabb .Format };
|
||||
|
||||
// SetID set the ID of a relationship.
|
||||
func (_bdbd Relationship )SetID (ID string ){_bdbd ._gae .IdAttr =ID ;};func (_edff CustomProperties )SetPropertyAsDate (name string ,date _aa .Time ){date =date .UTC ();_bfff ,_dab ,_baa :=date .Date ();_ada ,_cgc ,_ecg :=date .Clock ();_abf :=_aa .Date (_bfff ,_dab ,_baa ,_ada ,_cgc ,_ecg ,0,_aa .UTC );_cbe :=_edff .getNewProperty (name );_cbe .Filetime =&_abf ;_edff .setOrReplaceProperty (_cbe );};
|
||||
// SetWidth sets column width, see measurement package.
|
||||
func (_dgfe TableCol )SetWidth (m _gfd .Distance ){_cfg :=_gfd .ToEMU (float64 (m ));_dgfe ._cfedd .WAttr =_de .ST_Coordinate {ST_CoordinateUnqualified :&_cfg };};
|
||||
|
||||
// SetCategory records the category of the document.
|
||||
func (_ceg CoreProperties )SetCategory (s string ){_ceg ._bc .Category =&s };
|
||||
// LastModifiedBy returns the name of the last person to modify the document
|
||||
func (_aad CoreProperties )LastModifiedBy ()string {if _aad ._feg .LastModifiedBy !=nil {return *_aad ._feg .LastModifiedBy ;};return "";};func (_bde CustomProperties )SetPropertyAsDecimal (name string ,decimal float64 ){_egg :=_bde .getNewProperty (name );_egg .Decimal =&decimal ;_bde .setOrReplaceProperty (_egg );};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_fcc CustomProperties )X ()*_c .Properties {return _fcc ._adg };
|
||||
// Properties returns table properties.
|
||||
func (_gec Table )Properties ()*_de .CT_TableProperties {return _gec ._cdgc .TblPr };func (_gca CustomProperties )SetPropertyAsCy (name string ,cy string ){_beb :=_gca .getNewProperty (name );_beb .Cy =&cy ;_gca .setOrReplaceProperty (_beb );};
|
||||
|
||||
// SetCompany sets the name of the company that created the document.
|
||||
func (_cc AppProperties )SetCompany (s string ){_cc ._fcg .Company =&s };const _bfg =26;
|
||||
// RemoveOverride removes an override given a path.
|
||||
func (_ebc ContentTypes )RemoveOverride (path string ){if !_gg .HasPrefix (path ,"\u002f"){path ="\u002f"+path ;};for _ed ,_cee :=range _ebc ._dae .Override {if _cee .PartNameAttr ==path {copy (_ebc ._dae .Override [_ed :],_ebc ._dae .Override [_ed +1:]);_ebc ._dae .Override =_ebc ._dae .Override [0:len (_ebc ._dae .Override )-1];};};};
|
||||
|
||||
// CreateCustomProperties creates the custom properties of the document.
|
||||
func (_fcb *DocBase )CreateCustomProperties (){_fcb .CustomProperties =NewCustomProperties ();_fcb .AddCustomRelationships ();};const _gdg =5;
|
||||
// NewContentTypes returns a wrapper around a newly constructed content-types.
|
||||
func NewContentTypes ()ContentTypes {_ffe :=ContentTypes {_dae :_bf .NewTypes ()};_ffe .AddDefault ("\u0078\u006d\u006c","\u0061p\u0070l\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u0078\u006d\u006c");_ffe .AddDefault ("\u0072\u0065\u006c\u0073","\u0061\u0070\u0070\u006c\u0069\u0063a\u0074\u0069\u006fn\u002f\u0076\u006ed\u002e\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006fr\u006d\u0061\u0074\u0073\u002dpa\u0063\u006b\u0061\u0067\u0065\u002e\u0072\u0065\u006c\u0061\u0074\u0069\u006f\u006e\u0073\u0068\u0069\u0070\u0073\u002b\u0078\u006d\u006c");_ffe .AddDefault ("\u0070\u006e\u0067","\u0069m\u0061\u0067\u0065\u002f\u0070\u006eg");_ffe .AddDefault ("\u006a\u0070\u0065\u0067","\u0069\u006d\u0061\u0067\u0065\u002f\u006a\u0070\u0065\u0067");_ffe .AddDefault ("\u006a\u0070\u0067","\u0069m\u0061\u0067\u0065\u002f\u006a\u0070g");_ffe .AddDefault ("\u0077\u006d\u0066","i\u006d\u0061\u0067\u0065\u002f\u0078\u002d\u0077\u006d\u0066");_ffe .AddOverride ("\u002fd\u006fc\u0050\u0072\u006f\u0070\u0073/\u0063\u006fr\u0065\u002e\u0078\u006d\u006c","\u0061\u0070\u0070\u006c\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u0076\u006e\u0064\u002e\u006f\u0070\u0065\u006ex\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073-\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002e\u0063\u006f\u0072\u0065\u002dp\u0072\u006f\u0070\u0065\u0072\u0074i\u0065\u0073\u002bx\u006d\u006c");_ffe .AddOverride ("\u002f\u0064\u006f\u0063\u0050\u0072\u006f\u0070\u0073\u002f\u0061\u0070p\u002e\u0078\u006d\u006c","a\u0070\u0070l\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u0076\u006e\u0064\u002e\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066o\u0072\u006d\u0061\u0074\u0073\u002d\u006f\u0066\u0066\u0069\u0063\u0065\u0064\u006f\u0063\u0075m\u0065\u006e\u0074\u002e\u0065\u0078\u0074\u0065\u006e\u0064\u0065\u0064\u002dp\u0072\u006f\u0070\u0065\u0072\u0074\u0069\u0065\u0073\u002b\u0078m\u006c");return _ffe ;};
|
||||
|
||||
// ContentTypes is the top level "[Content_Types].xml" in a zip package.
|
||||
type ContentTypes struct{_eba *_bd .Types };
|
||||
// NewCustomProperties constructs a new CustomProperties.
|
||||
func NewCustomProperties ()CustomProperties {return CustomProperties {_dcbb :_cb .NewProperties ()}};func (_gbcd CustomProperties )SetPropertyAsBool (name string ,b bool ){_dggf :=_gbcd .getNewProperty (name );_dggf .Bool =&b ;_gbcd .setOrReplaceProperty (_dggf );};
|
||||
|
||||
// Hyperlink is just an appropriately configured relationship.
|
||||
type Hyperlink Relationship ;func (_fba CustomProperties )SetPropertyAsError (name string ,error string ){_dde :=_fba .getNewProperty (name );_dde .Error =&error ;_fba .setOrReplaceProperty (_dde );};
|
||||
|
||||
// SetLinksUpToDate sets the links up to date flag.
|
||||
func (_da AppProperties )SetLinksUpToDate (v bool ){_da ._fcg .LinksUpToDate =_fcf .Bool (v )};func (_ceb CustomProperties )SetPropertyAsStorage (name string ,storage string ){_dbcf :=_ceb .getNewProperty (name );_dbcf .Storage =&storage ;_ceb .setOrReplaceProperty (_dbcf );};
|
||||
|
||||
// Description returns the description of the document
|
||||
func (_bgaf CoreProperties )Description ()string {if _bgaf ._bc .Description !=nil {return string (_bgaf ._bc .Description .Data );};return "";};
|
||||
|
||||
// Append appends DocBase part of an office document to another DocBase.
|
||||
func (_fe DocBase )Append (docBase1 DocBase )DocBase {_af :=docBase1 .ContentTypes .X ();for _ ,_aec :=range _af .Default {_fe .ContentTypes .AddDefault (_aec .ExtensionAttr ,_aec .ContentTypeAttr );};for _ ,_gb :=range _af .Override {_fe .ContentTypes .AddOverride (_gb .PartNameAttr ,_gb .ContentTypeAttr );};_eg :=_fe .AppProperties .X ();_ef :=docBase1 .AppProperties .X ();if _eg .Pages !=nil {if _ef .Pages !=nil {*_eg .Pages +=*_ef .Pages ;};}else if _ef .Pages !=nil {_eg .Pages =_ef .Pages ;};if _eg .Words !=nil {if _ef .Words !=nil {*_eg .Words +=*_ef .Words ;};}else if _ef .Words !=nil {_eg .Words =_ef .Words ;};if _eg .Characters !=nil {if _ef .Characters !=nil {*_eg .Characters +=*_ef .Characters ;};}else if _ef .Characters !=nil {_eg .Characters =_ef .Characters ;};if _eg .Lines !=nil {if _ef .Lines !=nil {*_eg .Lines +=*_ef .Lines ;};}else if _ef .Lines !=nil {_eg .Lines =_ef .Lines ;};if _eg .Paragraphs !=nil {if _ef .Paragraphs !=nil {*_eg .Paragraphs +=*_ef .Paragraphs ;};}else if _ef .Paragraphs !=nil {_eg .Paragraphs =_ef .Paragraphs ;};if _eg .Notes !=nil {if _ef .Notes !=nil {*_eg .Notes +=*_ef .Notes ;};}else if _ef .Notes !=nil {_eg .Notes =_ef .Notes ;};if _eg .HiddenSlides !=nil {if _ef .HiddenSlides !=nil {*_eg .HiddenSlides +=*_ef .HiddenSlides ;};}else if _ef .HiddenSlides !=nil {_eg .HiddenSlides =_ef .HiddenSlides ;};if _eg .MMClips !=nil {if _ef .MMClips !=nil {*_eg .MMClips +=*_ef .MMClips ;};}else if _ef .MMClips !=nil {_eg .MMClips =_ef .MMClips ;};if _eg .LinksUpToDate !=nil {if _ef .LinksUpToDate !=nil {*_eg .LinksUpToDate =*_eg .LinksUpToDate &&*_ef .LinksUpToDate ;};}else if _ef .LinksUpToDate !=nil {_eg .LinksUpToDate =_ef .LinksUpToDate ;};if _eg .CharactersWithSpaces !=nil {if _ef .CharactersWithSpaces !=nil {*_eg .CharactersWithSpaces +=*_ef .CharactersWithSpaces ;};}else if _ef .CharactersWithSpaces !=nil {_eg .CharactersWithSpaces =_ef .CharactersWithSpaces ;};if _eg .SharedDoc !=nil {if _ef .SharedDoc !=nil {*_eg .SharedDoc =*_eg .SharedDoc ||*_ef .SharedDoc ;};}else if _ef .SharedDoc !=nil {_eg .SharedDoc =_ef .SharedDoc ;};if _eg .HyperlinksChanged !=nil {if _ef .HyperlinksChanged !=nil {*_eg .HyperlinksChanged =*_eg .HyperlinksChanged ||*_ef .HyperlinksChanged ;};}else if _ef .HyperlinksChanged !=nil {_eg .HyperlinksChanged =_ef .HyperlinksChanged ;};_eg .DigSig =nil ;if _eg .TitlesOfParts ==nil &&_ef .TitlesOfParts !=nil {_eg .TitlesOfParts =_ef .TitlesOfParts ;};if _eg .HeadingPairs !=nil {if _ef .HeadingPairs !=nil {_ed :=_eg .HeadingPairs .Vector ;_ga :=_ef .HeadingPairs .Vector ;_db :=_ed .Variant ;_edg :=_ga .Variant ;_ega :=[]*_dd .Variant {};for _gaf :=0;_gaf < len (_edg );_gaf +=2{_aed :=_edg [_gaf ].Lpstr ;_gbg :=false ;for _eb :=0;_eb < len (_db );_eb +=2{_de :=_db [_eb ].Lpstr ;if _de !=nil &&_aed !=nil &&*_de ==*_aed {*_db [_eb +1].I4 =*_db [_eb +1].I4 +*_edg [_gaf +1].I4 ;_gbg =true ;break ;};};if !_gbg {_ega =append (_ega ,&_dd .Variant {CT_Variant :_dd .CT_Variant {Lpstr :_edg [_gaf ].Lpstr }});_ega =append (_ega ,&_dd .Variant {CT_Variant :_dd .CT_Variant {I4 :_edg [_gaf ].I4 }});};};_db =append (_db ,_ega ...);_ed .SizeAttr =uint32 (len (_db ));};}else if _ef .HeadingPairs !=nil {_eg .HeadingPairs =_ef .HeadingPairs ;};if _eg .HLinks !=nil {if _ef .HLinks !=nil {_ebd :=_eg .HLinks .Vector ;_bge :=_ef .HLinks .Vector ;_ad :=_ebd .Variant ;_ge :=_bge .Variant ;for _ ,_eea :=range _ge {_ege :=true ;for _ ,_ede :=range _ad {if _d .DeepEqual (_ede ,_eea ){_ege =false ;break ;};};if _ege {_ad =append (_ad ,_eea );_ebd .SizeAttr ++;};};};}else if _ef .HLinks !=nil {_eg .HLinks =_ef .HLinks ;};_aea :=_fe .GetOrCreateCustomProperties ();_gea :=docBase1 .GetOrCreateCustomProperties ();for _ ,_cf :=range _gea .PropertiesList (){_aea .setProperty (_cf );};_fe .CustomProperties =_aea ;_adb :=_fe .Rels .X ().Relationship ;for _ ,_gee :=range docBase1 .Rels .X ().Relationship {_fee :=true ;for _ ,_eec :=range _adb {if _eec .TargetAttr ==_gee .TargetAttr &&_eec .TypeAttr ==_gee .TypeAttr {_fee =false ;break ;};};if _fee {_fe .Rels .AddRelationship (_gee .TargetAttr ,_gee .TypeAttr );};};for _ ,_acf :=range docBase1 .ExtraFiles {_gbe :=_acf .ZipPath ;_fb :=true ;for _ ,_cd :=range _fe .ExtraFiles {if _cd .ZipPath ==_gbe {_fb =false ;break ;};};if _fb {_fe .ExtraFiles =append (_fe .ExtraFiles ,_acf );};};return _fe ;};func (_bfa CustomProperties )SetPropertyAsUi1 (name string ,ui1 uint8 ){_afe :=_bfa .getNewProperty (name );_afe .Ui1 =&ui1 ;_bfa .setOrReplaceProperty (_afe );};
|
||||
|
||||
// NewTable makes a new table.
|
||||
func NewTable ()*Table {_eda :=_bg .NewTbl ();_eda .TblPr =_bg .NewCT_TableProperties ();return &Table {_ddcg :_eda };};
|
||||
|
||||
// AddHyperlink adds an external hyperlink relationship.
|
||||
func (_gff Relationships )AddHyperlink (target string )Hyperlink {_bbda :=_gff .AddRelationship (target ,_fcf .HyperLinkType );_bbda ._gae .TargetModeAttr =_ag .ST_TargetModeExternal ;return Hyperlink (_bbda );};
|
||||
|
||||
// AddOverride adds an override content type for a given path name.
|
||||
func (_dag ContentTypes )AddOverride (path ,contentType string ){if !_bbb .HasPrefix (path ,"\u002f"){path ="\u002f"+path ;};if _bbb .HasPrefix (contentType ,"\u0068\u0074\u0074\u0070"){_ca .Log .Debug ("\u0063\u006f\u006e\u0074\u0065\u006et\u0020\u0074\u0079p\u0065\u0020\u0027%\u0073\u0027\u0020\u0069\u0073\u0020\u0069\u006e\u0063\u006fr\u0072\u0065\u0063\u0074\u002c m\u0075\u0073\u0074\u0020\u006e\u006f\u0074\u0020\u0073\u0074\u0061\u0072\u0074\u0020\u0077\u0069\u0074\u0068\u0020\u0068\u0074\u0074\u0070",contentType );};for _ ,_gg :=range _dag ._eba .Override {if _gg .PartNameAttr ==path &&_gg .ContentTypeAttr ==contentType {return ;};};_gad :=_bd .NewOverride ();_gad .PartNameAttr =path ;_gad .ContentTypeAttr =contentType ;_dag ._eba .Override =append (_dag ._eba .Override ,_gad );};func init (){_ea .SetAsStorage ()};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_cgcf Table )X ()*_bg .Tbl {return _cgcf ._ddcg };
|
||||
|
||||
// ImageFromBytes returns an Image struct for an in-memory image. You can also
|
||||
// construct an Image directly if the file and size are known.
|
||||
func ImageFromBytes (data []byte )(Image ,error ){_ffc :=Image {};_cbec ,_agda ,_acad :=_bba .Decode (_f .NewReader (data ));if _acad !=nil {return _ffc ,_g .Errorf ("\u0075n\u0061\u0062\u006c\u0065 \u0074\u006f\u0020\u0070\u0061r\u0073e\u0020i\u006d\u0061\u0067\u0065\u003a\u0020\u0025s",_acad );};_ffc .Data =&data ;_ffc .Format =_agda ;_ffc .Size =_cbec .Bounds ().Size ();return _ffc ,nil ;};func (_bdcda CustomProperties )SetPropertyAsVector (name string ,vector *_dd .Vector ){_beb :=_bdcda .getNewProperty (name );_beb .Vector =vector ;_bdcda .setOrReplaceProperty (_beb );};
|
||||
|
||||
// AddDefault registers a default content type for a given file extension.
|
||||
func (_fcgd ContentTypes )AddDefault (fileExtension string ,contentType string ){fileExtension =_bbb .ToLower (fileExtension );for _ ,_bdc :=range _fcgd ._eba .Default {if _bdc .ExtensionAttr ==fileExtension &&_bdc .ContentTypeAttr ==contentType {return ;};};_dbd :=_bd .NewDefault ();_dbd .ExtensionAttr =fileExtension ;_dbd .ContentTypeAttr =contentType ;_fcgd ._eba .Default =append (_fcgd ._eba .Default ,_dbd );};
|
||||
|
||||
// DefAttr returns the DefAttr property.
|
||||
func (_eeba TableStyles )DefAttr ()string {return _eeba ._dfgf .DefAttr };func (_cbf CustomProperties )SetPropertyAsI8 (name string ,i8 int64 ){_dbad :=_cbf .getNewProperty (name );_dbad .I8 =&i8 ;_cbf .setOrReplaceProperty (_dbad );};
|
||||
|
||||
// Relationships represents a .rels file.
|
||||
type Relationships struct{_dbb *_ag .Relationships };
|
||||
|
||||
// Company returns the name of the company that created the document.
|
||||
// For unioffice created documents, it defaults to github.com/unidoc/unioffice
|
||||
func (_cad AppProperties )Company ()string {if _cad ._fcg .Company !=nil {return *_cad ._fcg .Company ;};return "";};
|
||||
|
||||
// GetTargetByRelId returns a target path with the associated relation ID.
|
||||
func (_bab Relationships )GetTargetByRelId (idAttr string )string {for _ ,_cce :=range _bab ._dbb .Relationship {if _cce .IdAttr ==idAttr {return _cce .TargetAttr ;};};return "";};func (_ggg CustomProperties )SetPropertyAsR4 (name string ,r4 float32 ){_fgf :=_ggg .getNewProperty (name );_fgf .R4 =&r4 ;_ggg .setOrReplaceProperty (_fgf );};func (_eff CustomProperties )SetPropertyAsLpwstr (name string ,lpwstr string ){_acg :=_eff .getNewProperty (name );_acg .Lpwstr =&lpwstr ;_eff .setOrReplaceProperty (_acg );};func _bedd (_aff *_fcf .XSDAny )_aa .Time {if _aff ==nil {return _aa .Time {};};_fd ,_fce :=_aa .Parse (_cfa ,string (_aff .Data ));if _fce !=nil {_ca .Log .Debug ("\u0065\u0072\u0072\u006f\u0072\u0020\u0070\u0061\u0072\u0073i\u006e\u0067\u0020\u0074\u0069\u006d\u0065 \u0066\u0072\u006f\u006d\u0020\u0025\u0073\u003a\u0020\u0025\u0073",string (_aff .Data ),_fce );};return _fd ;};
|
||||
|
||||
// TableStyles contains document specific properties.
|
||||
type TableStyles struct{_dfgf *_bg .TblStyleLst };
|
||||
|
||||
// Relationship is a relationship within a .rels file.
|
||||
type Relationship struct{_gae *_ag .Relationship };
|
||||
|
||||
// SetTitle records the title of the document.
|
||||
func (_afg CoreProperties )SetTitle (s string ){if _afg ._bc .Title ==nil {_afg ._bc .Title =&_fcf .XSDAny {XMLName :_fa .Name {Local :"\u0064\u0063\u003a\u0074\u0069\u0074\u006c\u0065"}};};_afg ._bc .Title .Data =[]byte (s );};
|
||||
|
||||
// AddExtraFileFromZip is used when reading an unsupported file from an OOXML
|
||||
// file. This ensures that unsupported file content will at least round-trip
|
||||
// correctly.
|
||||
func (_cgcb *DocBase )AddExtraFileFromZip (f *_e .File )error {_dcg ,_fdb :=_fae .ExtractToDiskTmp (f ,_cgcb .TmpPath );if _fdb !=nil {return _g .Errorf ("\u0065\u0072r\u006f\u0072\u0020\u0065x\u0074\u0072a\u0063\u0074\u0069\u006e\u0067\u0020\u0075\u006es\u0075\u0070\u0070\u006f\u0072\u0074\u0065\u0064\u0020\u0066\u0069\u006ce\u003a\u0020\u0025\u0073",_fdb );};_cgcb .ExtraFiles =append (_cgcb .ExtraFiles ,ExtraFile {ZipPath :f .Name ,DiskPath :_dcg });return nil ;};func (_fbcf Relationship )String ()string {return _g .Sprintf ("\u007b\u0049\u0044\u003a \u0025\u0073\u0020\u0054\u0061\u0072\u0067\u0065\u0074\u003a \u0025s\u0020\u0054\u0079\u0070\u0065\u003a\u0020%\u0073\u007d",_fbcf .ID (),_fbcf .Target (),_fbcf .Type ());};const _cdda =15;
|
||||
// EnsureDefault esnures that an extension and default content type exist,
|
||||
// adding it if necessary.
|
||||
func (_bd ContentTypes )EnsureDefault (ext ,contentType string ){ext =_gg .ToLower (ext );for _ ,_gbc :=range _bd ._dae .Default {if _gbc .ExtensionAttr ==ext {_gbc .ContentTypeAttr =contentType ;return ;};};_efb :=&_bf .Default {};_efb .ContentTypeAttr =contentType ;_efb .ExtensionAttr =ext ;_bd ._dae .Default =append (_bd ._dae .Default ,_efb );};
|
||||
|
||||
// ExtraFile is an unsupported file type extracted from, or to be written to a
|
||||
// zip package
|
||||
type ExtraFile struct{ZipPath string ;DiskPath string ;};
|
||||
|
||||
// AddCustomRelationships adds relationships related to custom properties to the document.
|
||||
func (_gbab *DocBase )AddCustomRelationships (){_gbab .ContentTypes .AddOverride ("/\u0064o\u0063\u0050\u0072\u006f\u0070\u0073\u002f\u0063u\u0073\u0074\u006f\u006d.x\u006d\u006c","\u0061\u0070\u0070\u006c\u0069\u0063a\u0074\u0069\u006f\u006e\u002fv\u006e\u0064\u002e\u006f\u0070\u0065n\u0078\u006d\u006c\u0066\u006fr\u006d\u0061\u0074\u0073\u002d\u006f\u0066\u0066\u0069\u0063\u0065\u0064o\u0063\u0075\u006d\u0065\u006e\u0074\u002e\u0063\u0075\u0073\u0074\u006f\u006d\u002d\u0070r\u006f\u0070\u0065\u0072\u0074\u0069\u0065\u0073+\u0078\u006d\u006c");_gbab .Rels .AddRelationship ("\u0064\u006f\u0063\u0050ro\u0070\u0073\u002f\u0063\u0075\u0073\u0074\u006f\u006d\u002e\u0078\u006d\u006c",_fcf .CustomPropertiesType );};
|
||||
// SetCompany sets the name of the company that created the document.
|
||||
func (_fae AppProperties )SetCompany (s string ){_fae ._cade .Company =&s };func (_bgb CustomProperties )setProperty (_bdd *_cb .CT_Property ){_bgb .setPropertyHelper (_bdd ,false )};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_gce TableStyles )X ()*_bg .TblStyleLst {return _gce ._dfgf };
|
||||
// RelativeWidth returns the relative width of an image given a fixed height.
|
||||
// This is used when setting image to a fixed height to calculate the width
|
||||
// required to keep the same image aspect ratio.
|
||||
func (_gee ImageRef )RelativeWidth (h _gfd .Distance )_gfd .Distance {_cga :=float64 (_gee .Size ().X )/float64 (_gee .Size ().Y );return h *_gfd .Distance (_cga );};
|
||||
|
||||
// SetDocSecurity sets the document security flag.
|
||||
func (_cdb AppProperties )SetDocSecurity (v int32 ){_cdb ._fcg .DocSecurity =_fcf .Int32 (v )};
|
||||
// SetAuthor records the author of the document.
|
||||
func (_caa CoreProperties )SetAuthor (s string ){if _caa ._feg .Creator ==nil {_caa ._feg .Creator =&_eb .XSDAny {XMLName :_gbf .Name {Local :"\u0064\u0063\u003a\u0063\u0072\u0065\u0061\u0074\u006f\u0072"}};};_caa ._feg .Creator .Data =[]byte (s );};
|
||||
|
||||
// TableCol represents a column in a table.
|
||||
type TableCol struct{_gada *_bg .CT_TableCol };
|
||||
// Company returns the name of the company that created the document.
|
||||
// For unioffice created documents, it defaults to github.com/unidoc/unioffice
|
||||
func (_ef AppProperties )Company ()string {if _ef ._cade .Company !=nil {return *_ef ._cade .Company ;};return "";};const Version ="\u0031\u002e\u0032\u0035\u002e\u0030";
|
||||
|
||||
// GetOrCreateCustomProperties returns the custom properties of the document (and if they not exist yet, creating them first).
|
||||
func (_cafd *DocBase )GetOrCreateCustomProperties ()CustomProperties {if _cafd .CustomProperties .X ()==nil {_cafd .CreateCustomProperties ();};return _cafd .CustomProperties ;};
|
||||
// Append appends DocBase part of an office document to another DocBase.
|
||||
func (_cd DocBase )Append (docBase1 DocBase )DocBase {_cdb :=docBase1 .ContentTypes .X ();for _ ,_ac :=range _cdb .Default {_cd .ContentTypes .AddDefault (_ac .ExtensionAttr ,_ac .ContentTypeAttr );};for _ ,_bff :=range _cdb .Override {_cd .ContentTypes .AddOverride (_bff .PartNameAttr ,_bff .ContentTypeAttr );};_dbg :=_cd .AppProperties .X ();_ea :=docBase1 .AppProperties .X ();if _dbg .Pages !=nil {if _ea .Pages !=nil {*_dbg .Pages +=*_ea .Pages ;};}else if _ea .Pages !=nil {_dbg .Pages =_ea .Pages ;};if _dbg .Words !=nil {if _ea .Words !=nil {*_dbg .Words +=*_ea .Words ;};}else if _ea .Words !=nil {_dbg .Words =_ea .Words ;};if _dbg .Characters !=nil {if _ea .Characters !=nil {*_dbg .Characters +=*_ea .Characters ;};}else if _ea .Characters !=nil {_dbg .Characters =_ea .Characters ;};if _dbg .Lines !=nil {if _ea .Lines !=nil {*_dbg .Lines +=*_ea .Lines ;};}else if _ea .Lines !=nil {_dbg .Lines =_ea .Lines ;};if _dbg .Paragraphs !=nil {if _ea .Paragraphs !=nil {*_dbg .Paragraphs +=*_ea .Paragraphs ;};}else if _ea .Paragraphs !=nil {_dbg .Paragraphs =_ea .Paragraphs ;};if _dbg .Notes !=nil {if _ea .Notes !=nil {*_dbg .Notes +=*_ea .Notes ;};}else if _ea .Notes !=nil {_dbg .Notes =_ea .Notes ;};if _dbg .HiddenSlides !=nil {if _ea .HiddenSlides !=nil {*_dbg .HiddenSlides +=*_ea .HiddenSlides ;};}else if _ea .HiddenSlides !=nil {_dbg .HiddenSlides =_ea .HiddenSlides ;};if _dbg .MMClips !=nil {if _ea .MMClips !=nil {*_dbg .MMClips +=*_ea .MMClips ;};}else if _ea .MMClips !=nil {_dbg .MMClips =_ea .MMClips ;};if _dbg .LinksUpToDate !=nil {if _ea .LinksUpToDate !=nil {*_dbg .LinksUpToDate =*_dbg .LinksUpToDate &&*_ea .LinksUpToDate ;};}else if _ea .LinksUpToDate !=nil {_dbg .LinksUpToDate =_ea .LinksUpToDate ;};if _dbg .CharactersWithSpaces !=nil {if _ea .CharactersWithSpaces !=nil {*_dbg .CharactersWithSpaces +=*_ea .CharactersWithSpaces ;};}else if _ea .CharactersWithSpaces !=nil {_dbg .CharactersWithSpaces =_ea .CharactersWithSpaces ;};if _dbg .SharedDoc !=nil {if _ea .SharedDoc !=nil {*_dbg .SharedDoc =*_dbg .SharedDoc ||*_ea .SharedDoc ;};}else if _ea .SharedDoc !=nil {_dbg .SharedDoc =_ea .SharedDoc ;};if _dbg .HyperlinksChanged !=nil {if _ea .HyperlinksChanged !=nil {*_dbg .HyperlinksChanged =*_dbg .HyperlinksChanged ||*_ea .HyperlinksChanged ;};}else if _ea .HyperlinksChanged !=nil {_dbg .HyperlinksChanged =_ea .HyperlinksChanged ;};_dbg .DigSig =nil ;if _dbg .TitlesOfParts ==nil &&_ea .TitlesOfParts !=nil {_dbg .TitlesOfParts =_ea .TitlesOfParts ;};if _dbg .HeadingPairs !=nil {if _ea .HeadingPairs !=nil {_eec :=_dbg .HeadingPairs .Vector ;_fc :=_ea .HeadingPairs .Vector ;_eab :=_eec .Variant ;_ba :=_fc .Variant ;_gac :=[]*_ce .Variant {};for _eg :=0;_eg < len (_ba );_eg +=2{_ca :=_ba [_eg ].Lpstr ;_dg :=false ;for _da :=0;_da < len (_eab );_da +=2{_cad :=_eab [_da ].Lpstr ;if _cad !=nil &&_ca !=nil &&*_cad ==*_ca {*_eab [_da +1].I4 =*_eab [_da +1].I4 +*_ba [_eg +1].I4 ;_dg =true ;break ;};};if !_dg {_gac =append (_gac ,&_ce .Variant {CT_Variant :_ce .CT_Variant {Lpstr :_ba [_eg ].Lpstr }});_gac =append (_gac ,&_ce .Variant {CT_Variant :_ce .CT_Variant {I4 :_ba [_eg ].I4 }});};};_eab =append (_eab ,_gac ...);_eec .SizeAttr =uint32 (len (_eab ));};}else if _ea .HeadingPairs !=nil {_dbg .HeadingPairs =_ea .HeadingPairs ;};if _dbg .HLinks !=nil {if _ea .HLinks !=nil {_abf :=_dbg .HLinks .Vector ;_eabe :=_ea .HLinks .Vector ;_gd :=_abf .Variant ;_cgb :=_eabe .Variant ;for _ ,_bc :=range _cgb {_ecg :=true ;for _ ,_gga :=range _gd {if _fb .DeepEqual (_gga ,_bc ){_ecg =false ;break ;};};if _ecg {_gd =append (_gd ,_bc );_abf .SizeAttr ++;};};};}else if _ea .HLinks !=nil {_dbg .HLinks =_ea .HLinks ;};_bgg :=_cd .GetOrCreateCustomProperties ();_fed :=docBase1 .GetOrCreateCustomProperties ();for _ ,_fa :=range _fed .PropertiesList (){_bgg .setProperty (_fa );};_cd .CustomProperties =_bgg ;_egb :=_cd .Rels .X ().Relationship ;for _ ,_ebg :=range docBase1 .Rels .X ().Relationship {_be :=true ;for _ ,_dd :=range _egb {if _dd .TargetAttr ==_ebg .TargetAttr &&_dd .TypeAttr ==_ebg .TypeAttr {_be =false ;break ;};};if _be {_cd .Rels .AddRelationship (_ebg .TargetAttr ,_ebg .TypeAttr );};};for _ ,_bfd :=range docBase1 .ExtraFiles {_gfe :=_bfd .ZipPath ;_dad :=true ;for _ ,_gbb :=range _cd .ExtraFiles {if _gbb .ZipPath ==_gfe {_dad =false ;break ;};};if _dad {_cd .ExtraFiles =append (_cd .ExtraFiles ,_bfd );};};return _cd ;};
|
||||
|
||||
// NewCustomProperties constructs a new CustomProperties.
|
||||
func NewCustomProperties ()CustomProperties {return CustomProperties {_adg :_c .NewProperties ()}};
|
||||
// Data returns the data of an image file, if any.
|
||||
func (_eggg ImageRef )Data ()*[]byte {return _eggg ._eabb .Data };
|
||||
|
||||
// RelID returns the relationship ID.
|
||||
func (_eagg ImageRef )RelID ()string {return _eagg ._gcb };func (_becg CustomProperties )SetPropertyAsArray (name string ,array *_dd .Array ){_bbc :=_becg .getNewProperty (name );_bbc .Array =array ;_becg .setOrReplaceProperty (_bbc );};
|
||||
// SetCreated sets the time that the document was created.
|
||||
func (_ag CoreProperties )SetCreated (t _ga .Time ){_ag ._feg .Created =_daec (t ,"\u0064c\u0074e\u0072\u006d\u0073\u003a\u0063\u0072\u0065\u0061\u0074\u0065\u0064");};
|
||||
|
||||
// SetOffsetX sets horizontal offset of a table in distance units (see measurement package).
|
||||
func (_cade Table )SetOffsetX (offX float64 ){if _cade ._edfb .Off ==nil {_cade ._edfb .Off =_bg .NewCT_Point2D ();_gcbba :=int64 (0);_cade ._edfb .Off .YAttr =_bg .ST_Coordinate {ST_CoordinateUnqualified :&_gcbba };};_ccb :=_ee .ToEMU (offX );_cade ._edfb .Off .XAttr =_bg .ST_Coordinate {ST_CoordinateUnqualified :&_ccb };};
|
||||
// SetTitle records the title of the document.
|
||||
func (_aba CoreProperties )SetTitle (s string ){if _aba ._feg .Title ==nil {_aba ._feg .Title =&_eb .XSDAny {XMLName :_gbf .Name {Local :"\u0064\u0063\u003a\u0074\u0069\u0074\u006c\u0065"}};};_aba ._feg .Title .Data =[]byte (s );};
|
||||
|
||||
// Properties returns table properties.
|
||||
func (_edc Table )Grid ()*_bg .CT_TableGrid {return _edc ._ddcg .TblGrid };func (_bcc CustomProperties )SetPropertyAsBstr (name string ,bstr string ){_abg :=_bcc .getNewProperty (name );_abg .Bstr =&bstr ;_bcc .setOrReplaceProperty (_abg );};
|
||||
// Table represents a table in the document.
|
||||
type Table struct{_cdgc *_de .Tbl ;_fedf *_de .CT_Transform2D ;};
|
||||
|
||||
// TblStyle returns the TblStyle property.
|
||||
func (_egbg TableStyles )TblStyle ()[]*_bg .CT_TableStyle {return _egbg ._dfgf .TblStyle };
|
||||
// SetLanguage records the language of the document.
|
||||
func (_eca CoreProperties )SetLanguage (s string ){_eca ._feg .Language =&_eb .XSDAny {XMLName :_gbf .Name {Local :"d\u0063\u003a\u006c\u0061\u006e\u0067\u0075\u0061\u0067\u0065"}};_eca ._feg .Language .Data =[]byte (s );};
|
||||
|
||||
// ImageFromStorage reads an image using the currently set
|
||||
// temporary storage mechanism (see tempstorage). You can also
|
||||
// construct an Image directly if the file and size are known.
|
||||
func ImageFromStorage (path string )(Image ,error ){_dagb :=Image {};_agg ,_fef :=_ff .Open (path );if _fef !=nil {return _dagb ,_ge .Errorf ("\u0065\u0072\u0072or\u0020\u0072\u0065\u0061\u0064\u0069\u006e\u0067\u0020\u0069\u006d\u0061\u0067\u0065\u003a\u0020\u0025\u0073",_fef );};defer _agg .Close ();_dfbg ,_cbde ,_fef :=_e .Decode (_agg );if _fef !=nil {return _dagb ,_ge .Errorf ("\u0075n\u0061\u0062\u006c\u0065 \u0074\u006f\u0020\u0070\u0061r\u0073e\u0020i\u006d\u0061\u0067\u0065\u003a\u0020\u0025s",_fef );};_dagb .Path =path ;_dagb .Format =_cbde ;_dagb .Size =_dfbg .Bounds ().Size ();return _dagb ,nil ;};
|
||||
|
||||
// Type returns the type of a relationship.
|
||||
func (_fcac Relationship )Type ()string {return _fcac ._cbc .TypeAttr };func (_eac CustomProperties )SetPropertyAsInt (name string ,i int ){_accg :=_eac .getNewProperty (name );_egbf :=int32 (i );_accg .Int =&_egbf ;_eac .setOrReplaceProperty (_accg );};
|
||||
|
||||
// AddRelationship adds a relationship.
|
||||
func (_bgf Relationships )AddRelationship (target ,ctype string )Relationship {if !_gg .HasPrefix (ctype ,"\u0068t\u0074\u0070\u003a\u002f\u002f"){_ee .Log .Debug ("\u0072\u0065\u006c\u0061\u0074\u0069\u006f\u006es\u0068\u0069\u0070 t\u0079\u0070\u0065\u0020\u0025\u0073 \u0073\u0068\u006f\u0075\u006c\u0064\u0020\u0073\u0074\u0061\u0072\u0074\u0020\u0077\u0069t\u0068\u0020\u0027\u0068\u0074\u0074\u0070\u003a/\u002f\u0027",ctype );};_ffc :=_fdg .NewRelationship ();_cab :=len (_bgf ._gda .Relationship )+1;_ecag :=map[string ]struct{}{};for _ ,_febb :=range _bgf ._gda .Relationship {_ecag [_febb .IdAttr ]=struct{}{};};for _ ,_adcc :=_ecag [_ge .Sprintf ("\u0072\u0049\u0064%\u0064",_cab )];_adcc ;_ ,_adcc =_ecag [_ge .Sprintf ("\u0072\u0049\u0064%\u0064",_cab )]{_cab ++;};_ffc .IdAttr =_ge .Sprintf ("\u0072\u0049\u0064%\u0064",_cab );_ffc .TargetAttr =target ;_ffc .TypeAttr =ctype ;_bgf ._gda .Relationship =append (_bgf ._gda .Relationship ,_ffc );return Relationship {_cbc :_ffc };};func _daec (_dgf _ga .Time ,_daa string )*_eb .XSDAny {_bdg :=&_eb .XSDAny {XMLName :_gbf .Name {Local :_daa }};_bdg .Attrs =append (_bdg .Attrs ,_gbf .Attr {Name :_gbf .Name {Local :"\u0078\u0073\u0069\u003a\u0074\u0079\u0070\u0065"},Value :"\u0064\u0063\u0074\u0065\u0072\u006d\u0073\u003a\u00573\u0043\u0044\u0054\u0046"});_bdg .Attrs =append (_bdg .Attrs ,_gbf .Attr {Name :_gbf .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u0078\u0073i"},Value :"\u0068\u0074\u0074\u0070\u003a/\u002f\u0077\u0077\u0077\u002e\u0077\u0033\u002e\u006f\u0072\u0067\u002f\u00320\u0030\u0031\u002f\u0058\u004d\u004c\u0053\u0063\u0068\u0065\u006d\u0061\u002d\u0069\u006e\u0073\u0074\u0061\u006e\u0063\u0065"});_bdg .Attrs =append (_bdg .Attrs ,_gbf .Attr {Name :_gbf .Name {Local :"\u0078\u006d\u006c\u006e\u0073\u003a\u0064\u0063\u0074\u0065\u0072\u006d\u0073"},Value :"\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/"});_bdg .Data =[]byte (_dgf .Format (_egc ));return _bdg ;};func (_abg CustomProperties )SetPropertyAsError (name string ,error string ){_gae :=_abg .getNewProperty (name );_gae .Error =&error ;_abg .setOrReplaceProperty (_gae );};
|
||||
|
||||
// DocBase is the type embedded in in the Document/Workbook/Presentation types
|
||||
// that contains members common to all.
|
||||
type DocBase struct{ContentTypes ContentTypes ;AppProperties AppProperties ;Rels Relationships ;CoreProperties CoreProperties ;CustomProperties CustomProperties ;Thumbnail _e .Image ;Images []ImageRef ;ExtraFiles []ExtraFile ;TmpPath string ;};
|
||||
|
||||
// EnsureOverride ensures that an override for the given path exists, adding it if necessary
|
||||
func (_cc ContentTypes )EnsureOverride (path ,contentType string ){for _ ,_cgg :=range _cc ._dae .Override {if _cgg .PartNameAttr ==path {if _gg .HasPrefix (contentType ,"\u0068\u0074\u0074\u0070"){_ee .Log .Debug ("\u0063\u006f\u006e\u0074\u0065\u006et\u0020\u0074\u0079p\u0065\u0020\u0027%\u0073\u0027\u0020\u0069\u0073\u0020\u0069\u006e\u0063\u006fr\u0072\u0065\u0063\u0074\u002c m\u0075\u0073\u0074\u0020\u006e\u006f\u0074\u0020\u0073\u0074\u0061\u0072\u0074\u0020\u0077\u0069\u0074\u0068\u0020\u0068\u0074\u0074\u0070",contentType );};_cgg .ContentTypeAttr =contentType ;return ;};};_cc .AddOverride (path ,contentType );};
|
||||
|
||||
// SetOffsetY sets vertical offset of a table in distance units (see measurement package).
|
||||
func (_bcaeg Table )SetOffsetY (offY float64 ){if _bcaeg ._fedf .Off ==nil {_bcaeg ._fedf .Off =_de .NewCT_Point2D ();_bba :=int64 (0);_bcaeg ._fedf .Off .XAttr =_de .ST_Coordinate {ST_CoordinateUnqualified :&_bba };};_bdgd :=_gfd .ToEMU (offY );_bcaeg ._fedf .Off .YAttr =_de .ST_Coordinate {ST_CoordinateUnqualified :&_bdgd };};func (_cfe CustomProperties )SetPropertyAsUi8 (name string ,ui8 uint64 ){_fee :=_cfe .getNewProperty (name );_fee .Ui8 =&ui8 ;_cfe .setOrReplaceProperty (_fee );};func (_bfgg CustomProperties )SetPropertyAsNull (name string ){_dag :=_bfgg .getNewProperty (name );_dag .Null =_ce .NewNull ();_bfgg .setOrReplaceProperty (_dag );};func (_bcc CustomProperties )setOrReplaceProperty (_gebf *_cb .CT_Property ){_bcc .setPropertyHelper (_gebf ,true );};
|
||||
|
||||
// Theme is a drawingml theme.
|
||||
type Theme struct{_age *_de .Theme };
|
||||
|
||||
// AddAutoRelationship adds a relationship with an automatically generated
|
||||
// filename based off of the type. It should be preferred over AddRelationship
|
||||
// to ensure consistent filenames are maintained.
|
||||
func (_efg Relationships )AddAutoRelationship (dt _eb .DocType ,src string ,idx int ,ctype string )Relationship {return _efg .AddRelationship (_eb .RelativeFilename (dt ,src ,ctype ,idx ),ctype );};
|
||||
|
||||
// AddImageToZip adds an image (either from bytes or from disk) and adds it to the zip file.
|
||||
func AddImageToZip (z *_cg .Writer ,img ImageRef ,imageNum int ,dt _eb .DocType )error {_cdg :=_eb .AbsoluteImageFilename (dt ,imageNum ,_gg .ToLower (img .Format ()));if img .Data ()!=nil &&len (*img .Data ())> 0{if _edc :=_fd .AddFileFromBytes (z ,_cdg ,*img .Data ());_edc !=nil {return _edc ;};}else if img .Path ()!=""{if _gbbb :=_fd .AddFileFromDisk (z ,_cdg ,img .Path ());_gbbb !=nil {return _gbbb ;};}else {return _ge .Errorf ("\u0075\u006es\u0075\u0070\u0070\u006f\u0072\u0074\u0065\u0064\u0020\u0069\u006d\u0061\u0067\u0065\u0020\u0073\u006f\u0075\u0072\u0063\u0065\u003a %\u002b\u0076",img );};return nil ;};func (_gab CustomProperties )SetPropertyAsFiletime (name string ,filetime _ga .Time ){_ccg :=_gab .getNewProperty (name );_ccg .Filetime =&filetime ;_gab .setOrReplaceProperty (_ccg );};
|
||||
|
||||
// SetTarget set the target (path) of a relationship.
|
||||
func (_eee Relationship )SetTarget (s string ){_eee ._cbc .TargetAttr =s };
|
||||
|
||||
// Modified returns the time that the document was modified.
|
||||
func (_aaaf CoreProperties )Modified ()_ga .Time {return _gce (_aaaf ._feg .Modified )};
|
||||
|
||||
// RemoveOverrideByIndex removes an override given a path and override index.
|
||||
func (_ffa ContentTypes )RemoveOverrideByIndex (path string ,indexToFind int )error {_abb :=path [0:len (path )-5];if !_gg .HasPrefix (_abb ,"\u002f"){_abb ="\u002f"+_abb ;};_df ,_gbd :=_bg .Compile (_abb +"\u0028\u005b\u0030-\u0039\u005d\u002b\u0029\u002e\u0078\u006d\u006c");if _gbd !=nil {return _gbd ;};_aaa :=0;_cgbd :=-1;for _dcb ,_bggc :=range _ffa ._dae .Override {if _cgbdf :=_df .FindStringSubmatch (_bggc .PartNameAttr );len (_cgbdf )> 1{if _aaa ==indexToFind {_cgbd =_dcb ;}else if _aaa > indexToFind {_adg ,_ :=_b .Atoi (_cgbdf [1]);_adg --;_bggc .PartNameAttr =_ge .Sprintf ("\u0025\u0073\u0025\u0064\u002e\u0078\u006d\u006c",_abb ,_adg );};_aaa ++;};};if _cgbd > -1{copy (_ffa ._dae .Override [_cgbd :],_ffa ._dae .Override [_cgbd +1:]);_ffa ._dae .Override =_ffa ._dae .Override [0:len (_ffa ._dae .Override )-1];};return nil ;};
|
||||
|
||||
// SetTarget changes the target attribute of the image reference (e.g. in the case of the creation of the reference or if the image which the reference is related to was moved from one location to another).
|
||||
func (_eef *ImageRef )SetTarget (target string ){_eef ._fbc =target };
|
||||
|
||||
// ApplicationVersion returns the version of the application that created the
|
||||
// document.
|
||||
func (_fcf AppProperties )ApplicationVersion ()string {if _fcf ._cade .AppVersion !=nil {return *_fcf ._cade .AppVersion ;};return "";};
|
||||
|
||||
// Pages returns total number of pages which are saved by the text editor which produced the document.
|
||||
// For unioffice created documents, it is 0.
|
||||
func (_fed AppProperties )Pages ()int32 {if _fed ._fcg .Pages !=nil {return *_fed ._fcg .Pages ;};return 0;};func (_dbde TableRow )addCell ()*_bg .CT_TableCell {_cab :=_bg .NewCT_TableCell ();_dbde ._dfd .Tc =append (_dbde ._dfd .Tc ,_cab );return _cab ;};const _cfa ="2\u00300\u0036\u002d\u0030\u0031\u002d\u0030\u0032\u00541\u0035\u003a\u0030\u0034:0\u0035\u005a";
|
||||
func (_fac AppProperties )Pages ()int32 {if _fac ._cade .Pages !=nil {return *_fac ._cade .Pages ;};return 0;};
|
||||
|
||||
// RelativeHeight returns the relative height of an image given a fixed width.
|
||||
// This is used when setting image to a fixed width to calculate the height
|
||||
// required to keep the same image aspect ratio.
|
||||
func (_aeae ImageRef )RelativeHeight (w _ee .Distance )_ee .Distance {_cdbb :=float64 (_aeae .Size ().Y )/float64 (_aeae .Size ().X );return w *_ee .Distance (_cdbb );};
|
||||
// AddRow adds a row to a table.
|
||||
func (_cgac Table )AddRow ()*TableRow {_baf :=_de .NewCT_TableRow ();for _dbd :=0;_dbd < len (_cgac ._cdgc .TblGrid .GridCol );_dbd ++{_baf .Tc =append (_baf .Tc ,_de .NewCT_TableCell ());};_cgac ._cdgc .Tr =append (_cgac ._cdgc .Tr ,_baf );return &TableRow {_bcef :_baf };};
|
||||
|
||||
// ContentStatus returns the content status of the document (e.g. "Final", "Draft")
|
||||
func (_daf CoreProperties )ContentStatus ()string {if _daf ._feg .ContentStatus !=nil {return *_daf ._feg .ContentStatus ;};return "";};
|
||||
|
||||
// CreateCustomProperties creates the custom properties of the document.
|
||||
func (_dggd *DocBase )CreateCustomProperties (){_dggd .CustomProperties =NewCustomProperties ();_dggd .AddCustomRelationships ();};
|
||||
|
||||
// Target returns the target attrubute of the image reference (a path where the image file is located in the document structure).
|
||||
func (_ded *ImageRef )Target ()string {return _ded ._fbc };
|
||||
|
||||
// Category returns the category of the document
|
||||
func (_eff CoreProperties )Category ()string {if _eff ._feg .Category !=nil {return *_eff ._feg .Category ;};return "";};
|
||||
|
||||
// Rows returns all table rows.
|
||||
func (_cdc Table )Rows ()[]*TableRow {_afg :=_cdc ._cdgc .Tr ;_cgge :=[]*TableRow {};for _ ,_bec :=range _afg {_cgge =append (_cgge ,&TableRow {_bcef :_bec });};return _cgge ;};
|
||||
|
||||
// PropertiesList returns the list of all custom properties of the document.
|
||||
func (_ddf CustomProperties )PropertiesList ()[]*_cb .CT_Property {return _ddf ._dcbb .Property };
|
||||
|
||||
// NewRelationship constructs a new relationship.
|
||||
func NewRelationship ()Relationship {return Relationship {_cbc :_fdg .NewRelationship ()}};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_bca CoreProperties )X ()*_gc .CoreProperties {return _bca ._feg };
|
||||
|
||||
// AddExtraFileFromZip is used when reading an unsupported file from an OOXML
|
||||
// file. This ensures that unsupported file content will at least round-trip
|
||||
// correctly.
|
||||
func (_eacb *DocBase )AddExtraFileFromZip (f *_cg .File )error {_ddc ,_eda :=_fd .ExtractToDiskTmp (f ,_eacb .TmpPath );if _eda !=nil {return _ge .Errorf ("\u0065\u0072r\u006f\u0072\u0020\u0065x\u0074\u0072a\u0063\u0074\u0069\u006e\u0067\u0020\u0075\u006es\u0075\u0070\u0070\u006f\u0072\u0074\u0065\u0064\u0020\u0066\u0069\u006ce\u003a\u0020\u0025\u0073",_eda );};_eacb .ExtraFiles =append (_eacb .ExtraFiles ,ExtraFile {ZipPath :f .Name ,DiskPath :_ddc });return nil ;};const _dfa ="\u0032\u0020\u004aan\u0075\u0061\u0072\u0079\u0020\u0032\u0030\u0030\u0036\u0020\u0061\u0074\u0020\u0031\u0035\u003a\u0030\u0034";
|
||||
|
||||
// ContentTypes is the top level "[Content_Types].xml" in a zip package.
|
||||
type ContentTypes struct{_dae *_bf .Types };func (_cdbf CustomProperties )SetPropertyAsBlob (name ,blob string ){_cgf :=_cdbf .getNewProperty (name );_cgf .Blob =&blob ;_cdbf .setOrReplaceProperty (_cgf );};func (_cfa CustomProperties )SetPropertyAsI4 (name string ,i4 int32 ){_afc :=_cfa .getNewProperty (name );_afc .I4 =&i4 ;_cfa .setOrReplaceProperty (_afc );};
|
||||
|
||||
// FindRIDForN returns the relationship ID for the i'th relationship of type t.
|
||||
func (_faf Relationships )FindRIDForN (i int ,t string )string {for _ ,_egf :=range _faf ._gda .CT_Relationships .Relationship {if _egf .TypeAttr ==t {if i ==0{return _egf .IdAttr ;};i --;};};return "";};
|
||||
|
||||
// Relationships returns a slice of all of the relationships.
|
||||
func (_cea Relationships )Relationships ()[]Relationship {_dbgd :=[]Relationship {};for _ ,_debe :=range _cea ._gda .Relationship {_dbgd =append (_dbgd ,Relationship {_cbc :_debe });};return _dbgd ;};const _gfc =2023;var _deb =_fe .New ("\u0069\u006d\u0061\u0067\u0065\u0020\u006e\u006f\u0074\u0020\u0066o\u0075\u006e\u0064\u0020\u0069\u006e\u0020\u0073\u0074\u006fr\u0061\u0067\u0065");
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_fea TableStyles )X ()*_de .TblStyleLst {return _fea ._dcg };func (_gde CustomProperties )setPropertyHelper (_dfd *_cb .CT_Property ,_bfc bool ){_fdgf :=_gde .GetPropertyByName (*_dfd .NameAttr );if (_fdgf ==CustomProperty {}){_gde ._dcbb .Property =append (_gde ._dcbb .Property ,_dfd );}else if _bfc {_dfd .FmtidAttr =_fdgf ._ebgc .FmtidAttr ;if _fdgf ._ebgc .PidAttr ==0{_dfd .PidAttr =_fdgf ._ebgc .PidAttr ;};_dfd .LinkTargetAttr =_fdgf ._ebgc .LinkTargetAttr ;*_fdgf ._ebgc =*_dfd ;};};func (_abff CustomProperties )SetPropertyAsDate (name string ,date _ga .Time ){date =date .UTC ();_dfb ,_cae ,_dac :=date .Date ();_cefg ,_adaeg ,_ade :=date .Clock ();_ddd :=_ga .Date (_dfb ,_cae ,_dac ,_cefg ,_adaeg ,_ade ,0,_ga .UTC );_bfgf :=_abff .getNewProperty (name );_bfgf .Filetime =&_ddd ;_abff .setOrReplaceProperty (_bfgf );};
|
||||
|
||||
// NewRelationshipsCopy creates a new relationships wrapper as a copy of passed in instance.
|
||||
func NewRelationshipsCopy (rels Relationships )Relationships {_fge :=*rels ._gda ;return Relationships {_gda :&_fge };};
|
||||
|
||||
// CopyOverride copies override content type for a given `path` and puts it with a path `newPath`.
|
||||
func (_gcg ContentTypes )CopyOverride (path ,newPath string ){if !_gg .HasPrefix (path ,"\u002f"){path ="\u002f"+path ;};if !_gg .HasPrefix (newPath ,"\u002f"){newPath ="\u002f"+newPath ;};for _aea :=range _gcg ._dae .Override {if _gcg ._dae .Override [_aea ].PartNameAttr ==path {_ebcc :=*_gcg ._dae .Override [_aea ];_ebcc .PartNameAttr =newPath ;_gcg ._dae .Override =append (_gcg ._dae .Override ,&_ebcc );};};};
|
||||
|
||||
// X returns the inner raw content types.
|
||||
func (_geb ContentTypes )X ()*_bf .Types {return _geb ._dae };func (_cffe CustomProperties )SetPropertyAsClsid (name string ,clsid string ){_adf :=_cffe .getNewProperty (name );_adf .Clsid =&clsid ;_cffe .setOrReplaceProperty (_adf );};
|
||||
|
||||
// IsEmpty returns true if there are no relationships.
|
||||
func (_dcad Relationships )IsEmpty ()bool {return _dcad ._gda ==nil ||len (_dcad ._gda .Relationship )==0;};func (_cff CustomProperties )SetPropertyAsEmpty (name string ){_bcfg :=_cff .getNewProperty (name );_bcfg .Empty =_ce .NewEmpty ();_cff .setOrReplaceProperty (_bcfg );};
|
||||
|
||||
// SetHeight sets row height, see measurement package.
|
||||
func (_gdgf TableRow )SetHeight (m _gfd .Distance ){_ebgd :=_gfd .ToEMU (float64 (m ));_gdgf ._bcef .HAttr =_de .ST_Coordinate {ST_CoordinateUnqualified :&_ebgd };};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_fdc CustomProperties )X ()*_cb .Properties {return _fdc ._dcbb };
|
||||
|
||||
// Application returns the name of the application that created the document.
|
||||
// For unioffice created documents, it defaults to github.com/unidoc/unioffice
|
||||
func (_ae AppProperties )Application ()string {if _ae ._cade .Application !=nil {return *_ae ._cade .Application ;};return "";};
|
||||
|
||||
// Cells returns an array of row cells.
|
||||
func (_cfac TableRow )Cells ()[]*_de .CT_TableCell {return _cfac ._bcef .Tc };
|
||||
|
||||
// GetOrCreateCustomProperties returns the custom properties of the document (and if they not exist yet, creating them first).
|
||||
func (_eea *DocBase )GetOrCreateCustomProperties ()CustomProperties {if _eea .CustomProperties .X ()==nil {_eea .CreateCustomProperties ();};return _eea .CustomProperties ;};func (_bag CustomProperties )SetPropertyAsUi1 (name string ,ui1 uint8 ){_eed :=_bag .getNewProperty (name );_eed .Ui1 =&ui1 ;_bag .setOrReplaceProperty (_eed );};
|
||||
|
||||
// SetCategory records the category of the document.
|
||||
func (_ggf CoreProperties )SetCategory (s string ){_ggf ._feg .Category =&s };
|
||||
|
||||
// NewTheme constructs a new theme.
|
||||
func NewTheme ()Theme {return Theme {_de .NewTheme ()}};
|
||||
|
||||
// Relationship is a relationship within a .rels file.
|
||||
type Relationship struct{_cbc *_fdg .Relationship };
|
||||
|
||||
// NewTableStyles constructs a new TableStyles.
|
||||
func NewTableStyles ()TableStyles {return TableStyles {_dcg :_de .NewTblStyleLst ()}};
|
||||
|
||||
// NewTableWithXfrm makes a new table with a pointer to its parent Xfrm for changing its offset and size.
|
||||
func NewTableWithXfrm (xfrm *_de .CT_Transform2D )*Table {_cfed :=_de .NewTbl ();_cfed .TblPr =_de .NewCT_TableProperties ();return &Table {_cdgc :_cfed ,_fedf :xfrm };};
|
||||
|
||||
// SetApplication sets the name of the application that created the document.
|
||||
func (_dc AppProperties )SetApplication (s string ){_dc ._cade .Application =&s };func (_bdef CustomProperties )SetPropertyAsStorage (name string ,storage string ){_fgg :=_bdef .getNewProperty (name );_fgg .Storage =&storage ;_bdef .setOrReplaceProperty (_fgg );};func (_bac CustomProperties )SetPropertyAsArray (name string ,array *_ce .Array ){_dca :=_bac .getNewProperty (name );_dca .Array =array ;_bac .setOrReplaceProperty (_dca );};
|
||||
|
||||
// SetStyle assigns TableStyle to a table.
|
||||
func (_fbg Table )SetStyle (style *_de .CT_TableStyle ){if _fbg ._cdgc .TblPr ==nil {_fbg ._cdgc .TblPr =_de .NewCT_TableProperties ();};if _fbg ._cdgc .TblPr .Choice ==nil {_fbg ._cdgc .TblPr .Choice =_de .NewCT_TablePropertiesChoice ();};_fbg ._cdgc .TblPr .Choice .TableStyle =style ;};
|
||||
|
||||
// AppProperties contains properties specific to the document and the
|
||||
// application that created it.
|
||||
type AppProperties struct{_cade *_ec .Properties };func (_dff CustomProperties )getNewProperty (_ggac string )*_cb .CT_Property {_bed :=_dff ._dcbb .Property ;_bb :=int32 (1);for _ ,_fce :=range _bed {if _fce .PidAttr > _bb {_bb =_fce .PidAttr ;};};_ecef :=_cb .NewCT_Property ();_ecef .NameAttr =&_ggac ;_ecef .PidAttr =_bb +1;_ecef .FmtidAttr ="\u007b\u0044\u0035\u0043\u0044\u0044\u0035\u0030\u0035\u002d\u0032\u0045\u0039\u0043\u002d\u0031\u0030\u0031\u0042\u002d\u0039\u0033\u0039\u0037-\u0030\u0038\u0030\u0030\u0032B\u0032\u0043F\u0039\u0041\u0045\u007d";return _ecef ;};
|
||||
|
||||
// Properties returns table properties.
|
||||
func (_dce Table )Grid ()*_de .CT_TableGrid {return _dce ._cdgc .TblGrid };
|
||||
|
||||
// SetDescription records the description of the document.
|
||||
func (_deg CoreProperties )SetDescription (s string ){if _deg ._feg .Description ==nil {_deg ._feg .Description =&_eb .XSDAny {XMLName :_gbf .Name {Local :"\u0064\u0063\u003a\u0064\u0065\u0073\u0063\u0072\u0069p\u0074\u0069\u006f\u006e"}};};_deg ._feg .Description .Data =[]byte (s );};
|
||||
|
||||
// NewAppProperties constructs a new AppProperties.
|
||||
func NewAppProperties ()AppProperties {_bfe :=AppProperties {_cade :_ec .NewProperties ()};_bfe .SetCompany ("\u0046\u006f\u0078\u0079\u0055\u0074\u0069\u006c\u0073\u0020\u0065\u0068\u0066");_bfe .SetApplication ("g\u0069\u0074\u0068\u0075\u0062\u002ec\u006f\u006d\u002f\u0075\u006e\u0069\u0064\u006f\u0063/\u0075\u006e\u0069o\u0066f\u0069\u0063\u0065");_bfe .SetDocSecurity (0);_bfe .SetLinksUpToDate (false );var _cbd ,_fcd ,_fba int64 ;_ge .Sscanf (Version ,"\u0025\u0064\u002e\u0025\u0064\u002e\u0025\u0064",&_cbd ,&_fcd ,&_fba );_bcg :=float64 (_cbd )+float64 (_fcd )/10000.0;_bfe .SetApplicationVersion (_ge .Sprintf ("\u0025\u0030\u0037\u002e\u0034\u0066",_bcg ));return _bfe ;};const _fbaaf =30;
|
||||
|
||||
// GetByRelId returns a relationship with the associated relation ID.
|
||||
func (_acd Relationships )GetByRelId (idAttr string )Relationship {for _ ,_ddfa :=range _acd ._gda .Relationship {if _ddfa .IdAttr ==idAttr {return Relationship {_cbc :_ddfa };};};return Relationship {};};
|
||||
|
||||
// AddCustomRelationships adds relationships related to custom properties to the document.
|
||||
func (_ecf *DocBase )AddCustomRelationships (){_ecf .ContentTypes .AddOverride ("/\u0064o\u0063\u0050\u0072\u006f\u0070\u0073\u002f\u0063u\u0073\u0074\u006f\u006d.x\u006d\u006c","\u0061\u0070\u0070\u006c\u0069\u0063a\u0074\u0069\u006f\u006e\u002fv\u006e\u0064\u002e\u006f\u0070\u0065n\u0078\u006d\u006c\u0066\u006fr\u006d\u0061\u0074\u0073\u002d\u006f\u0066\u0066\u0069\u0063\u0065\u0064o\u0063\u0075\u006d\u0065\u006e\u0074\u002e\u0063\u0075\u0073\u0074\u006f\u006d\u002d\u0070r\u006f\u0070\u0065\u0072\u0074\u0069\u0065\u0073+\u0078\u006d\u006c");_ecf .Rels .AddRelationship ("\u0064\u006f\u0063\u0050ro\u0070\u0073\u002f\u0063\u0075\u0073\u0074\u006f\u006d\u002e\u0078\u006d\u006c",_eb .CustomPropertiesType );};
|
||||
|
||||
// CustomProperties contains document specific properties.
|
||||
type CustomProperties struct{_dcbb *_cb .Properties };func (_abab CustomProperties )SetPropertyAsI1 (name string ,i1 int8 ){_cef :=_abab .getNewProperty (name );_cef .I1 =&i1 ;_abab .setOrReplaceProperty (_cef );};
|
||||
|
||||
// NewCoreProperties constructs a new CoreProperties.
|
||||
func NewCoreProperties ()CoreProperties {return CoreProperties {_feg :_gc .NewCoreProperties ()}};
|
||||
|
||||
// ID returns the ID of a relationship.
|
||||
func (_adc Relationship )ID ()string {return _adc ._cbc .IdAttr };var ReleasedAt =_ga .Date (_gfc ,_ecb ,_ggce ,_fged ,_fbaaf ,0,0,_ga .UTC );
|
||||
|
||||
// SetOffsetX sets horizontal offset of a table in distance units (see measurement package).
|
||||
func (_dbc Table )SetOffsetX (offX float64 ){if _dbc ._fedf .Off ==nil {_dbc ._fedf .Off =_de .NewCT_Point2D ();_fggb :=int64 (0);_dbc ._fedf .Off .YAttr =_de .ST_Coordinate {ST_CoordinateUnqualified :&_fggb };};_cde :=_gfd .ToEMU (offX );_dbc ._fedf .Off .XAttr =_de .ST_Coordinate {ST_CoordinateUnqualified :&_cde };};func (_ddfe CustomProperties )SetPropertyAsOstream (name string ,ostream string ){_bga :=_ddfe .getNewProperty (name );_bga .Ostream =&ostream ;_ddfe .setOrReplaceProperty (_bga );};
|
||||
|
||||
// Relationships represents a .rels file.
|
||||
type Relationships struct{_gda *_fdg .Relationships };func (_aag CustomProperties )SetPropertyAsR4 (name string ,r4 float32 ){_egd :=_aag .getNewProperty (name );_egd .R4 =&r4 ;_aag .setOrReplaceProperty (_egd );};
|
||||
|
||||
// X returns the inner wrapped XML type of CustomProperty.
|
||||
func (_ead CustomProperty )X ()*_cb .CT_Property {return _ead ._ebgc };
|
||||
|
||||
// WriteExtraFiles writes the extra files to the zip package.
|
||||
func (_bebb *DocBase )WriteExtraFiles (z *_cg .Writer )error {for _ ,_gbcg :=range _bebb .ExtraFiles {if _dga :=_fd .AddFileFromDisk (z ,_gbcg .ZipPath ,_gbcg .DiskPath );_dga !=nil {return _dga ;};};return nil ;};
|
||||
|
||||
// ImageFromFile reads an image from a file on disk. It doesn't keep the image
|
||||
// in memory and only reads it to determine the format and size. You can also
|
||||
// construct an Image directly if the file and size are known.
|
||||
// NOTE: See also ImageFromStorage.
|
||||
func ImageFromFile (path string )(Image ,error ){_bcgg ,_bedf :=_gb .Open (path );_gdg :=Image {};if _bedf !=nil {return _gdg ,_ge .Errorf ("\u0065\u0072\u0072or\u0020\u0072\u0065\u0061\u0064\u0069\u006e\u0067\u0020\u0069\u006d\u0061\u0067\u0065\u003a\u0020\u0025\u0073",_bedf );};defer _bcgg .Close ();_gacf ,_efa ,_bedf :=_e .Decode (_bcgg );if _bedf !=nil {return _gdg ,_ge .Errorf ("\u0075n\u0061\u0062\u006c\u0065 \u0074\u006f\u0020\u0070\u0061r\u0073e\u0020i\u006d\u0061\u0067\u0065\u003a\u0020\u0025s",_bedf );};_gdg .Path =path ;_gdg .Format =_efa ;_gdg .Size =_gacf .Bounds ().Size ();return _gdg ,nil ;};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_fbae AppProperties )X ()*_ec .Properties {return _fbae ._cade };
|
||||
|
||||
// X returns the underlying raw XML data.
|
||||
func (_dgab Relationships )X ()*_fdg .Relationships {return _dgab ._gda };
|
||||
|
||||
// Hyperlink is just an appropriately configured relationship.
|
||||
type Hyperlink Relationship ;func _gce (_dgg *_eb .XSDAny )_ga .Time {if _dgg ==nil {return _ga .Time {};};_edb ,_af :=_ga .Parse (_egc ,string (_dgg .Data ));if _af !=nil {_ee .Log .Debug ("\u0065\u0072\u0072\u006f\u0072\u0020\u0070\u0061\u0072\u0073i\u006e\u0067\u0020\u0074\u0069\u006d\u0065 \u0066\u0072\u006f\u006d\u0020\u0025\u0073\u003a\u0020\u0025\u0073",string (_dgg .Data ),_af );};return _edb ;};func init (){_db .SetAsStorage ()};func (_beaf Relationship )String ()string {return _ge .Sprintf ("\u007b\u0049\u0044\u003a \u0025\u0073\u0020\u0054\u0061\u0072\u0067\u0065\u0074\u003a \u0025s\u0020\u0054\u0079\u0070\u0065\u003a\u0020%\u0073\u007d",_beaf .ID (),_beaf .Target (),_beaf .Type ());};
|
||||
|
||||
// RelID returns the relationship ID.
|
||||
func (_ddg ImageRef )RelID ()string {return _ddg ._gaef };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_feed Table )X ()*_de .Tbl {return _feed ._cdgc };
|
||||
|
||||
// AddDefault registers a default content type for a given file extension.
|
||||
func (_fg ContentTypes )AddDefault (fileExtension string ,contentType string ){fileExtension =_gg .ToLower (fileExtension );for _ ,_bae :=range _fg ._dae .Default {if _bae .ExtensionAttr ==fileExtension &&_bae .ContentTypeAttr ==contentType {return ;};};_bea :=_bf .NewDefault ();_bea .ExtensionAttr =fileExtension ;_bea .ContentTypeAttr =contentType ;_fg ._dae .Default =append (_fg ._dae .Default ,_bea );};
|
||||
|
||||
// SetContentStatus records the content status of the document.
|
||||
func (_eabea CoreProperties )SetContentStatus (s string ){_eabea ._feg .ContentStatus =&s };
|
||||
|
||||
// TblStyle returns the TblStyle property.
|
||||
func (_caad TableStyles )TblStyle ()[]*_de .CT_TableStyle {return _caad ._dcg .TblStyle };
|
||||
|
||||
// TableCol represents a column in a table.
|
||||
type TableCol struct{_cfedd *_de .CT_TableCol };
|
||||
|
||||
// GetTargetByRelId returns a target path with the associated relation ID.
|
||||
func (_dee Relationships )GetTargetByRelId (idAttr string )string {for _ ,_dddf :=range _dee ._gda .Relationship {if _dddf .IdAttr ==idAttr {return _dddf .TargetAttr ;};};return "";};func (_eaa CustomProperties )SetPropertyAsI8 (name string ,i8 int64 ){_aed :=_eaa .getNewProperty (name );_aed .I8 =&i8 ;_eaa .setOrReplaceProperty (_aed );};func (_ffed CustomProperties )SetPropertyAsVector (name string ,vector *_ce .Vector ){_ccf :=_ffed .getNewProperty (name );_ccf .Vector =vector ;_ffed .setOrReplaceProperty (_ccf );};
|
||||
|
||||
// GetTargetByRelIdAndType returns a target path with the associated relation ID.
|
||||
func (_aeb Relationships )GetTargetByRelIdAndType (idAttr string ,typeAttr string )string {for _ ,_cdd :=range _aeb ._gda .Relationship {if _cdd .IdAttr ==idAttr &&_cdd .TypeAttr ==typeAttr {return _cdd .TargetAttr ;};};return "";};
|
||||
|
||||
// Author returns the author of the document
|
||||
func (_fegd CoreProperties )Author ()string {if _fegd ._feg .Creator !=nil {return string (_fegd ._feg .Creator .Data );};return "";};
|
||||
|
||||
// SetID set the ID of a relationship.
|
||||
func (_cca Relationship )SetID (ID string ){_cca ._cbc .IdAttr =ID ;};func (_ggd CustomProperties )SetPropertyAsI2 (name string ,i2 int16 ){_gfb :=_ggd .getNewProperty (name );_gfb .I2 =&i2 ;_ggd .setOrReplaceProperty (_gfb );};
|
||||
|
||||
// AddOverride adds an override content type for a given path name.
|
||||
func (_fdf ContentTypes )AddOverride (path ,contentType string ){if !_gg .HasPrefix (path ,"\u002f"){path ="\u002f"+path ;};if _gg .HasPrefix (contentType ,"\u0068\u0074\u0074\u0070"){_ee .Log .Debug ("\u0063\u006f\u006e\u0074\u0065\u006et\u0020\u0074\u0079p\u0065\u0020\u0027%\u0073\u0027\u0020\u0069\u0073\u0020\u0069\u006e\u0063\u006fr\u0072\u0065\u0063\u0074\u002c m\u0075\u0073\u0074\u0020\u006e\u006f\u0074\u0020\u0073\u0074\u0061\u0072\u0074\u0020\u0077\u0069\u0074\u0068\u0020\u0068\u0074\u0074\u0070",contentType );};for _ ,_bab :=range _fdf ._dae .Override {if _bab .PartNameAttr ==path &&_bab .ContentTypeAttr ==contentType {return ;};};_gad :=_bf .NewOverride ();_gad .PartNameAttr =path ;_gad .ContentTypeAttr =contentType ;_fdf ._dae .Override =append (_fdf ._dae .Override ,_gad );};func (_ffbd CustomProperties )SetPropertyAsUi4 (name string ,ui4 uint32 ){_aedf :=_ffbd .getNewProperty (name );_aedf .Ui4 =&ui4 ;_ffbd .setOrReplaceProperty (_aedf );};
|
||||
|
||||
// Created returns the time that the document was created.
|
||||
func (_gdb CoreProperties )Created ()_ga .Time {return _gce (_gdb ._feg .Created )};
|
||||
|
||||
// Title returns the Title of the document
|
||||
func (_cgc CoreProperties )Title ()string {if _cgc ._feg .Title !=nil {return string (_cgc ._feg .Title .Data );};return "";};func (_fbaa *ImageRef )SetRelID (id string ){_fbaa ._gaef =id };
|
||||
|
||||
// DefAttr returns the DefAttr property.
|
||||
func (_eggc TableStyles )DefAttr ()string {return _eggc ._dcg .DefAttr };
|
||||
|
||||
// GetPropertyByName returns a custom property selected by it's name.
|
||||
func (_fca CustomProperties )GetPropertyByName (name string )CustomProperty {_bcgb :=_fca ._dcbb .Property ;for _ ,_bfb :=range _bcgb {if *_bfb .NameAttr ==name {return CustomProperty {_ebgc :_bfb };};};return CustomProperty {};};const _egc ="2\u00300\u0036\u002d\u0030\u0031\u002d\u0030\u0032\u00541\u0035\u003a\u0030\u0034:0\u0035\u005a";
|
||||
|
||||
// MakeImageRef constructs an image reference which is a reference to a
|
||||
// particular image file inside a document. The same image can be used multiple
|
||||
// times in a document by re-use the ImageRef.
|
||||
func MakeImageRef (img Image ,d *DocBase ,rels Relationships )ImageRef {return ImageRef {_eabb :img ,_ebae :d ,_cbbg :rels };};
|
||||
|
||||
// ImageRef is a reference to an image within a document.
|
||||
type ImageRef struct{_ebae *DocBase ;_cbbg Relationships ;_eabb Image ;_gaef string ;_fbc string ;};
|
||||
|
||||
// TableRow represents a row in a table.
|
||||
type TableRow struct{_bcef *_de .CT_TableRow };
|
||||
|
||||
// ImageFromBytes returns an Image struct for an in-memory image. You can also
|
||||
// construct an Image directly if the file and size are known.
|
||||
func ImageFromBytes (data []byte )(Image ,error ){_acae :=Image {};_fedb ,_feb ,_gbg :=_e .Decode (_c .NewReader (data ));if _gbg !=nil {return _acae ,_ge .Errorf ("\u0075n\u0061\u0062\u006c\u0065 \u0074\u006f\u0020\u0070\u0061r\u0073e\u0020i\u006d\u0061\u0067\u0065\u003a\u0020\u0025s",_gbg );};_acae .Data =&data ;_acae .Format =_feb ;_acae .Size =_fedb .Bounds ().Size ();return _acae ,nil ;};func UtcTimeFormat (t _ga .Time )string {return t .Format (_dfa )+"\u0020\u0055\u0054\u0043"};func (_bfda CustomProperties )SetPropertyAsLpstr (name string ,lpstr string ){_edg :=_bfda .getNewProperty (name );_edg .Lpstr =&lpstr ;_bfda .setOrReplaceProperty (_edg );};
|
||||
|
||||
// AddHyperlink adds an external hyperlink relationship.
|
||||
func (_fdd Relationships )AddHyperlink (target string )Hyperlink {_bacg :=_fdd .AddRelationship (target ,_eb .HyperLinkType );_bacg ._cbc .TargetModeAttr =_fdg .ST_TargetModeExternal ;return Hyperlink (_bacg );};func (_aca CustomProperties )SetPropertyAsOblob (name ,oblob string ){_adb :=_aca .getNewProperty (name );_adb .Oblob =&oblob ;_aca .setOrReplaceProperty (_adb );};
|
||||
|
||||
// SetLinksUpToDate sets the links up to date flag.
|
||||
func (_ada AppProperties )SetLinksUpToDate (v bool ){_ada ._cade .LinksUpToDate =_eb .Bool (v )};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_beedg Theme )X ()*_de .Theme {return _beedg ._age };
|
||||
|
||||
// CoreProperties contains document specific properties.
|
||||
type CoreProperties struct{_feg *_gc .CoreProperties };func (_ffb CustomProperties )SetPropertyAsUi2 (name string ,ui2 uint16 ){_ccb :=_ffb .getNewProperty (name );_ccb .Ui2 =&ui2 ;_ffb .setOrReplaceProperty (_ccb );};
|
||||
|
||||
// SetDocSecurity sets the document security flag.
|
||||
func (_abfb AppProperties )SetDocSecurity (v int32 ){_abfb ._cade .DocSecurity =_eb .Int32 (v )};
|
@ -11,39 +11,39 @@
|
||||
|
||||
// Package license helps manage commercial licenses and check if they
|
||||
// are valid for the version of UniOffice used.
|
||||
package license ;import _f "github.com/unidoc/unioffice/internal/license";
|
||||
package license ;import _e "github.com/unidoc/unioffice/internal/license";
|
||||
|
||||
// GetLicenseKey returns the currently loaded license key.
|
||||
func GetLicenseKey ()*LicenseKey {return _e .GetLicenseKey ()};
|
||||
|
||||
// SetMeteredKey sets the metered License API key required for SaaS operation.
|
||||
// Document usage is reported periodically for the product to function correctly.
|
||||
func SetMeteredKey (apiKey string )error {return _e .SetMeteredKey (apiKey )};const (LicenseTierUnlicensed =_e .LicenseTierUnlicensed ;LicenseTierCommunity =_e .LicenseTierCommunity ;LicenseTierIndividual =_e .LicenseTierIndividual ;LicenseTierBusiness =_e .LicenseTierBusiness ;);
|
||||
|
||||
// LegacyLicenseType is the type of license
|
||||
type LegacyLicenseType =_f .LegacyLicenseType ;
|
||||
type LegacyLicenseType =_e .LegacyLicenseType ;
|
||||
|
||||
// SetLegacyLicenseKey installs a legacy license code. License codes issued prior to June 2019.
|
||||
// Will be removed at some point in a future major version.
|
||||
func SetLegacyLicenseKey (s string )error {return _f .SetLegacyLicenseKey (s )};
|
||||
// LegacyLicense holds the old-style unioffice license information.
|
||||
type LegacyLicense =_e .LegacyLicense ;
|
||||
|
||||
// MakeUnlicensedKey returns a default key.
|
||||
func MakeUnlicensedKey ()*LicenseKey {return _e .MakeUnlicensedKey ()};
|
||||
|
||||
// SetLicenseKey sets and validates the license key.
|
||||
func SetLicenseKey (content string ,customerName string )error {return _e .SetLicenseKey (content ,customerName );};
|
||||
|
||||
// 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 ){_f .SetMeteredKeyPersistentCache (val )};const (LicenseTierUnlicensed =_f .LicenseTierUnlicensed ;LicenseTierCommunity =_f .LicenseTierCommunity ;LicenseTierIndividual =_f .LicenseTierIndividual ;LicenseTierBusiness =_f .LicenseTierBusiness ;);
|
||||
func SetMeteredKeyPersistentCache (val bool ){_e .SetMeteredKeyPersistentCache (val )};
|
||||
|
||||
// SetLicenseKey sets and validates the license key.
|
||||
func SetLicenseKey (content string ,customerName string )error {return _f .SetLicenseKey (content ,customerName );};
|
||||
|
||||
// SetMeteredKey sets the metered License API key required for SaaS operation.
|
||||
// Document usage is reported periodically for the product to function correctly.
|
||||
func SetMeteredKey (apiKey string )error {return _f .SetMeteredKey (apiKey )};
|
||||
// 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 _e .SetLegacyLicenseKey (s )};
|
||||
|
||||
// LicenseKey represents a loaded license key.
|
||||
type LicenseKey =_f .LicenseKey ;
|
||||
type LicenseKey =_e .LicenseKey ;
|
||||
|
||||
// GetMeteredState checks the currently used metered document usage status,
|
||||
// documents used and credits available.
|
||||
func GetMeteredState ()(_f .MeteredStatus ,error ){return _f .GetMeteredState ()};
|
||||
|
||||
// GetLicenseKey returns the currently loaded license key.
|
||||
func GetLicenseKey ()*LicenseKey {return _f .GetLicenseKey ()};
|
||||
|
||||
// MakeUnlicensedKey returns a default key.
|
||||
func MakeUnlicensedKey ()*LicenseKey {return _f .MakeUnlicensedKey ()};
|
||||
|
||||
// LegacyLicense holds the old-style unioffice license information.
|
||||
type LegacyLicense =_f .LegacyLicense ;
|
||||
func GetMeteredState ()(_e .MeteredStatus ,error ){return _e .GetMeteredState ()};
|
@ -9,68 +9,75 @@
|
||||
// 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 (_a "fmt";_c "io";_g "os";_af "path/filepath";_e "runtime";);
|
||||
package logger ;import (_b "fmt";_f "io";_ad "os";_a "path/filepath";_d "runtime";);
|
||||
|
||||
// Notice logs notice message.
|
||||
func (_fc ConsoleLogger )Notice (format string ,args ...interface{}){if _fc .LogLevel >=LogLevelNotice {_ge :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_fc .output (_g .Stdout ,_ge ,format ,args ...);};};
|
||||
// ConsoleLogger is a logger that writes logs to the 'os.Stdout'
|
||||
type ConsoleLogger struct{LogLevel LogLevel ;};
|
||||
|
||||
// Error logs error message.
|
||||
func (_fcg WriterLogger )Error (format string ,args ...interface{}){if _fcg .LogLevel >=LogLevelError {_daa :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_fcg .logToWriter (_fcg .Output ,_daa ,format ,args ...);};};
|
||||
|
||||
// Error does nothing for dummy logger.
|
||||
func (DummyLogger )Error (format string ,args ...interface{}){};
|
||||
func (DummyLogger )Error (format string ,args ...interface{}){};func (_bde WriterLogger )logToWriter (_cbf _f .Writer ,_bf string ,_edc string ,_fdg ...interface{}){_de (_cbf ,_bf ,_edc ,_fdg );};
|
||||
|
||||
// Error logs error message.
|
||||
func (_ca ConsoleLogger )Error (format string ,args ...interface{}){if _ca .LogLevel >=LogLevelError {_dga :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_ca .output (_ad .Stdout ,_dga ,format ,args ...);};};
|
||||
|
||||
// Info logs info message.
|
||||
func (_fe ConsoleLogger )Info (format string ,args ...interface{}){if _fe .LogLevel >=LogLevelInfo {_gg :="\u005bI\u004e\u0046\u004f\u005d\u0020";_fe .output (_ad .Stdout ,_gg ,format ,args ...);};};
|
||||
|
||||
// IsLogLevel returns true from dummy logger.
|
||||
func (DummyLogger )IsLogLevel (level LogLevel )bool {return true };
|
||||
|
||||
// NewConsoleLogger creates new console logger.
|
||||
func NewConsoleLogger (logLevel LogLevel )*ConsoleLogger {return &ConsoleLogger {LogLevel :logLevel }};
|
||||
// Warning logs warning message.
|
||||
func (_fec WriterLogger )Warning (format string ,args ...interface{}){if _fec .LogLevel >=LogLevelWarning {_aae :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_fec .logToWriter (_fec .Output ,_aae ,format ,args ...);};};
|
||||
|
||||
// WriterLogger is the logger that writes data to the Output writer
|
||||
type WriterLogger struct{LogLevel LogLevel ;Output _c .Writer ;};
|
||||
type WriterLogger struct{LogLevel LogLevel ;Output _f .Writer ;};
|
||||
|
||||
// Logger is the interface used for logging in the unipdf package.
|
||||
type Logger interface{Error (_f string ,_gg ...interface{});Warning (_fb string ,_ee ...interface{});Notice (_cg string ,_gf ...interface{});Info (_cd string ,_b ...interface{});Debug (_gff string ,_cdc ...interface{});Trace (_ac string ,_cb ...interface{});IsLogLevel (_gfc LogLevel )bool ;};
|
||||
|
||||
// Warning logs warning message.
|
||||
func (_da ConsoleLogger )Warning (format string ,args ...interface{}){if _da .LogLevel >=LogLevelWarning {_ef :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_da .output (_g .Stdout ,_ef ,format ,args ...);};};
|
||||
|
||||
// NewWriterLogger creates new 'writer' logger.
|
||||
func NewWriterLogger (logLevel LogLevel ,writer _c .Writer )*WriterLogger {logger :=WriterLogger {Output :writer ,LogLevel :logLevel };return &logger ;};
|
||||
// Notice logs notice message.
|
||||
func (_ge ConsoleLogger )Notice (format string ,args ...interface{}){if _ge .LogLevel >=LogLevelNotice {_df :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_ge .output (_ad .Stdout ,_df ,format ,args ...);};};
|
||||
|
||||
// Debug does nothing for dummy logger.
|
||||
func (DummyLogger )Debug (format string ,args ...interface{}){};func _dg (_db _c .Writer ,_fdc string ,_dbb string ,_gda ...interface{}){_ ,_gbg ,_gea ,_ga :=_e .Caller (3);if !_ga {_gbg ="\u003f\u003f\u003f";_gea =0;}else {_gbg =_af .Base (_gbg );};_df :=_a .Sprintf ("\u0025s\u0020\u0025\u0073\u003a\u0025\u0064 ",_fdc ,_gbg ,_gea )+_dbb +"\u000a";_a .Fprintf (_db ,_df ,_gda ...);};
|
||||
func (DummyLogger )Debug (format string ,args ...interface{}){};
|
||||
|
||||
// Warning logs warning message.
|
||||
func (_gb WriterLogger )Warning (format string ,args ...interface{}){if _gb .LogLevel >=LogLevelWarning {_acd :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_gb .logToWriter (_gb .Output ,_acd ,format ,args ...);};};
|
||||
// NewConsoleLogger creates new console logger.
|
||||
func NewConsoleLogger (logLevel LogLevel )*ConsoleLogger {return &ConsoleLogger {LogLevel :logLevel }};func (_gc ConsoleLogger )output (_ce _f .Writer ,_ea string ,_be string ,_fc ...interface{}){_de (_ce ,_ea ,_be ,_fc ...);};
|
||||
|
||||
// NewWriterLogger creates new 'writer' logger.
|
||||
func NewWriterLogger (logLevel LogLevel ,writer _f .Writer )*WriterLogger {logger :=WriterLogger {Output :writer ,LogLevel :logLevel };return &logger ;};
|
||||
|
||||
// Debug logs debug message.
|
||||
func (_aaee WriterLogger )Debug (format string ,args ...interface{}){if _aaee .LogLevel >=LogLevelDebug {_bd :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_aaee .logToWriter (_aaee .Output ,_bd ,format ,args ...);};};
|
||||
|
||||
// Trace does nothing for dummy logger.
|
||||
func (DummyLogger )Trace (format string ,args ...interface{}){};
|
||||
|
||||
// Info logs info message.
|
||||
func (_eb WriterLogger )Info (format string ,args ...interface{}){if _eb .LogLevel >=LogLevelInfo {_ecf :="\u005bI\u004e\u0046\u004f\u005d\u0020";_eb .logToWriter (_eb .Output ,_ecf ,format ,args ...);};};
|
||||
func (_fg WriterLogger )Info (format string ,args ...interface{}){if _fg .LogLevel >=LogLevelInfo {_db :="\u005bI\u004e\u0046\u004f\u005d\u0020";_fg .logToWriter (_fg .Output ,_db ,format ,args ...);};};
|
||||
|
||||
// IsLogLevel returns true if log level is greater or equal than `level`.
|
||||
// Can be used to avoid resource intensive calls to loggers.
|
||||
func (_gd ConsoleLogger )IsLogLevel (level LogLevel )bool {return _gd .LogLevel >=level };
|
||||
func (_eb WriterLogger )IsLogLevel (level LogLevel )bool {return _eb .LogLevel >=level };
|
||||
|
||||
// Info logs info message.
|
||||
func (_cc ConsoleLogger )Info (format string ,args ...interface{}){if _cc .LogLevel >=LogLevelInfo {_bc :="\u005bI\u004e\u0046\u004f\u005d\u0020";_cc .output (_g .Stdout ,_bc ,format ,args ...);};};
|
||||
|
||||
// Debug logs debug message.
|
||||
func (_ecc WriterLogger )Debug (format string ,args ...interface{}){if _ecc .LogLevel >=LogLevelDebug {_dae :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_ecc .logToWriter (_ecc .Output ,_dae ,format ,args ...);};};var Log Logger =DummyLogger {};
|
||||
|
||||
// DummyLogger does nothing.
|
||||
type DummyLogger struct{};
|
||||
|
||||
// Trace logs trace message.
|
||||
func (_gfcc ConsoleLogger )Trace (format string ,args ...interface{}){if _gfcc .LogLevel >=LogLevelTrace {_ad :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_gfcc .output (_g .Stdout ,_ad ,format ,args ...);};};
|
||||
|
||||
// ConsoleLogger is a logger that writes logs to the 'os.Stdout'
|
||||
type ConsoleLogger struct{LogLevel LogLevel ;};func (_ce ConsoleLogger )output (_acc _c .Writer ,_bb string ,_ec string ,_eef ...interface{}){_dg (_acc ,_bb ,_ec ,_eef ...);};
|
||||
// Warning logs warning message.
|
||||
func (_cb ConsoleLogger )Warning (format string ,args ...interface{}){if _cb .LogLevel >=LogLevelWarning {_aaa :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_cb .output (_ad .Stdout ,_aaa ,format ,args ...);};};func _de (_dba _f .Writer ,_fb string ,_ac string ,_bb ...interface{}){_ ,_gfd ,_ec ,_cge :=_d .Caller (3);if !_cge {_gfd ="\u003f\u003f\u003f";_ec =0;}else {_gfd =_a .Base (_gfd );};_ee :=_b .Sprintf ("\u0025s\u0020\u0025\u0073\u003a\u0025\u0064 ",_fb ,_gfd ,_ec )+_ac +"\u000a";_b .Fprintf (_dba ,_ee ,_bb ...);};
|
||||
|
||||
// Warning does nothing for dummy logger.
|
||||
func (DummyLogger )Warning (format string ,args ...interface{}){};
|
||||
|
||||
// Notice does nothing for dummy logger.
|
||||
func (DummyLogger )Notice (format string ,args ...interface{}){};
|
||||
// Notice logs notice message.
|
||||
func (_edf WriterLogger )Notice (format string ,args ...interface{}){if _edf .LogLevel >=LogLevelNotice {_bef :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_edf .logToWriter (_edf .Output ,_bef ,format ,args ...);};};
|
||||
|
||||
// Error logs error message.
|
||||
func (_efe WriterLogger )Error (format string ,args ...interface{}){if _efe .LogLevel >=LogLevelError {_ace :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_efe .logToWriter (_efe .Output ,_ace ,format ,args ...);};};func (_dag WriterLogger )logToWriter (_aec _c .Writer ,_afb string ,_be string ,_ccg ...interface{}){_dg (_aec ,_afb ,_be ,_ccg );};
|
||||
// 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 (_eg ConsoleLogger )IsLogLevel (level LogLevel )bool {return _eg .LogLevel >=level };
|
||||
|
||||
// LogLevel is the verbosity level for logging.
|
||||
type LogLevel int ;const (LogLevelTrace LogLevel =5;LogLevelDebug LogLevel =4;LogLevelInfo LogLevel =3;LogLevelNotice LogLevel =2;LogLevelWarning LogLevel =1;LogLevelError LogLevel =0;);
|
||||
|
||||
// Info does nothing for dummy logger.
|
||||
func (DummyLogger )Info (format string ,args ...interface{}){};
|
||||
@ -78,24 +85,17 @@ func (DummyLogger )Info (format string ,args ...interface{}){};
|
||||
// SetLogger sets 'logger' to be used by the unidoc unipdf library.
|
||||
func SetLogger (logger Logger ){Log =logger };
|
||||
|
||||
// Notice does nothing for dummy logger.
|
||||
func (DummyLogger )Notice (format string ,args ...interface{}){};var Log Logger =DummyLogger {};
|
||||
|
||||
// Debug logs debug message.
|
||||
func (_fd ConsoleLogger )Debug (format string ,args ...interface{}){if _fd .LogLevel >=LogLevelDebug {_de :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_fd .output (_g .Stdout ,_de ,format ,args ...);};};
|
||||
|
||||
// Error logs error message.
|
||||
func (_ag ConsoleLogger )Error (format string ,args ...interface{}){if _ag .LogLevel >=LogLevelError {_ae :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_ag .output (_g .Stdout ,_ae ,format ,args ...);};};
|
||||
|
||||
// LogLevel is the verbosity level for logging.
|
||||
type LogLevel int ;
|
||||
func (_ae ConsoleLogger )Debug (format string ,args ...interface{}){if _ae .LogLevel >=LogLevelDebug {_geb :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_ae .output (_ad .Stdout ,_geb ,format ,args ...);};};
|
||||
|
||||
// Trace logs trace message.
|
||||
func (_aa WriterLogger )Trace (format string ,args ...interface{}){if _aa .LogLevel >=LogLevelTrace {_ea :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_aa .logToWriter (_aa .Output ,_ea ,format ,args ...);};};
|
||||
func (_cf WriterLogger )Trace (format string ,args ...interface{}){if _cf .LogLevel >=LogLevelTrace {_ef :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_cf .logToWriter (_cf .Output ,_ef ,format ,args ...);};};
|
||||
|
||||
// Notice logs notice message.
|
||||
func (_dec WriterLogger )Notice (format string ,args ...interface{}){if _dec .LogLevel >=LogLevelNotice {_eec :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_dec .logToWriter (_dec .Output ,_eec ,format ,args ...);};};const (LogLevelTrace LogLevel =5;LogLevelDebug LogLevel =4;LogLevelInfo LogLevel =3;LogLevelNotice LogLevel =2;LogLevelWarning LogLevel =1;LogLevelError LogLevel =0;);
|
||||
// Logger is the interface used for logging in the unipdf package.
|
||||
type Logger interface{Error (_ab string ,_aa ...interface{});Warning (_dg string ,_e ...interface{});Notice (_cg string ,_fd ...interface{});Info (_dc string ,_ed ...interface{});Debug (_g string ,_cd ...interface{});Trace (_ba string ,_da ...interface{});IsLogLevel (_aba LogLevel )bool ;};
|
||||
|
||||
// Trace does nothing for dummy logger.
|
||||
func (DummyLogger )Trace (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 (_fdg WriterLogger )IsLogLevel (level LogLevel )bool {return _fdg .LogLevel >=level };
|
||||
// Trace logs trace message.
|
||||
func (_aec ConsoleLogger )Trace (format string ,args ...interface{}){if _aec .LogLevel >=LogLevelTrace {_gf :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_aec .output (_ad .Stdout ,_gf ,format ,args ...);};};
|
@ -11,22 +11,22 @@
|
||||
|
||||
// Package diskstore implements tempStorage interface
|
||||
// by using disk as a storage
|
||||
package diskstore ;import (_a "github.com/unidoc/unioffice/common/tempstorage";_c "io/ioutil";_cg "os";_e "strings";);
|
||||
|
||||
// TempFile creates a new temp file by calling ioutil TempFile
|
||||
func (_b diskStorage )TempFile (dir ,pattern string )(_a .File ,error ){return _c .TempFile (dir ,pattern );};
|
||||
|
||||
// TempFile creates a new temp directory by calling ioutil TempDir
|
||||
func (_d diskStorage )TempDir (pattern string )(string ,error ){return _c .TempDir ("",pattern )};type diskStorage struct{};
|
||||
|
||||
// SetAsStorage sets temp storage as a disk storage
|
||||
func SetAsStorage (){_g :=diskStorage {};_a .SetAsStorage (&_g )};
|
||||
package diskstore ;import (_bc "github.com/unidoc/unioffice/common/tempstorage";_g "io/ioutil";_d "os";_e "strings";);
|
||||
|
||||
// Open opens file from disk according to a path
|
||||
func (_fb diskStorage )Open (path string )(_a .File ,error ){return _cg .OpenFile (path ,_cg .O_RDWR ,0644);};
|
||||
func (_bcg diskStorage )Open (path string )(_bc .File ,error ){return _d .OpenFile (path ,_d .O_RDWR ,0644);};
|
||||
|
||||
// RemoveAll removes all files in the directory
|
||||
func (_ga diskStorage )RemoveAll (dir string )error {if _e .HasPrefix (dir ,_cg .TempDir ()){return _cg .RemoveAll (dir );};return nil ;};
|
||||
// TempFile creates a new temp directory by calling ioutil TempDir
|
||||
func (_ag diskStorage )TempDir (pattern string )(string ,error ){return _g .TempDir ("",pattern )};
|
||||
|
||||
// Add is not applicable in the diskstore implementation
|
||||
func (_eb diskStorage )Add (path string )error {return nil };
|
||||
func (_ab diskStorage )Add (path string )error {return nil };
|
||||
|
||||
// TempFile creates a new temp file by calling ioutil TempFile
|
||||
func (_a diskStorage )TempFile (dir ,pattern string )(_bc .File ,error ){return _g .TempFile (dir ,pattern );};
|
||||
|
||||
// RemoveAll removes all files in the directory
|
||||
func (_ed diskStorage )RemoveAll (dir string )error {if _e .HasPrefix (dir ,_d .TempDir ()){return _d .RemoveAll (dir );};return nil ;};
|
||||
|
||||
// SetAsStorage sets temp storage as a disk storage
|
||||
func SetAsStorage (){_f :=diskStorage {};_bc .SetAsStorage (&_f )};type diskStorage struct{};
|
@ -11,38 +11,38 @@
|
||||
|
||||
// Package memstore implements tempStorage interface
|
||||
// by using memory as a storage
|
||||
package memstore ;import (_fag "encoding/hex";_fa "errors";_b "fmt";_e "github.com/unidoc/unioffice/common/tempstorage";_f "io";_d "io/ioutil";_aa "math/rand";_fc "sync";);type memFile struct{_ae *memDataCell ;_ed int64 ;};
|
||||
package memstore ;import (_cc "encoding/hex";_aa "errors";_ad "fmt";_d "github.com/unidoc/unioffice/common/tempstorage";_c "io";_ca "io/ioutil";_cd "math/rand";_e "sync";);
|
||||
|
||||
// RemoveAll removes all files according to the dir argument prefix
|
||||
func (_bda *memStorage )RemoveAll (dir string )error {_bda ._bf .Range (func (_fe ,_ce interface{})bool {_bda ._bf .Delete (_fe );return true });return nil ;};
|
||||
// Open returns tempstorage File object by name
|
||||
func (_bc *memStorage )Open (path string )(_d .File ,error ){_cg ,_ddc :=_bc ._ga .Load (path );if !_ddc {return nil ,_aa .New (_ad .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 {_ab :_cg .(*memDataCell )},nil ;};
|
||||
|
||||
// TempFile creates a new empty file in the storage and returns it
|
||||
func (_fc *memStorage )TempFile (dir ,pattern string )(_d .File ,error ){_cf :=dir +"\u002f"+_ac (pattern );_bd :=&memDataCell {_gd :_cf ,_dd :[]byte {}};_eg :=&memFile {_ab :_bd };_fc ._ga .Store (_cf ,_bd );return _eg ,nil ;};
|
||||
|
||||
// Name returns the filename of the underlying memDataCell
|
||||
func (_adb *memFile )Name ()string {return _adb ._ab ._gd };func _ac (_ba string )string {_cge ,_ :=_dc (6);return _ba +_cge };type memDataCell struct{_gd string ;_dd []byte ;_gg int64 ;};
|
||||
|
||||
// ReadAt reads from the underlying memDataCell at an offset provided in order to implement ReaderAt interface.
|
||||
// It does not affect f.readOffset.
|
||||
func (_aae *memFile )ReadAt (p []byte ,readOffset int64 )(int ,error ){_df :=_aae ._ae ._ba ;_db :=int64 (len (p ));if _db > _df {_db =_df ;p =p [:_db ];};if readOffset >=_df {return 0,_f .EOF ;};_g :=readOffset +_db ;if _g >=_df {_g =_df ;};_af :=copy (p ,_aae ._ae ._gg [readOffset :_g ]);return _af ,nil ;};
|
||||
|
||||
// Open returns tempstorage File object by name
|
||||
func (_bdf *memStorage )Open (path string )(_e .File ,error ){_bdd ,_dae :=_bdf ._bf .Load (path );if !_dae {return nil ,_fa .New (_b .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 {_ae :_bdd .(*memDataCell )},nil ;};
|
||||
|
||||
// TempDir creates a name for a new temp directory using a pattern argument
|
||||
func (_fg *memStorage )TempDir (pattern string )(string ,error ){return _ef (pattern ),nil };
|
||||
|
||||
// SetAsStorage sets temp storage as a memory storage
|
||||
func SetAsStorage (){_dbb :=memStorage {_bf :_fc .Map {}};_e .SetAsStorage (&_dbb )};
|
||||
|
||||
// Write writes to the end of the underlying memDataCell in order to implement Writer interface
|
||||
func (_dc *memFile )Write (p []byte )(int ,error ){_dc ._ae ._gg =append (_dc ._ae ._gg ,p ...);_dc ._ae ._ba +=int64 (len (p ));return len (p ),nil ;};type memStorage struct{_bf _fc .Map };
|
||||
|
||||
// Close is not applicable in this implementation
|
||||
func (_ee *memFile )Close ()error {return nil };
|
||||
|
||||
// Name returns the filename of the underlying memDataCell
|
||||
func (_c *memFile )Name ()string {return _c ._ae ._ea };
|
||||
func (_ag *memFile )ReadAt (p []byte ,readOffset int64 )(int ,error ){_af :=_ag ._ab ._gg ;_be :=int64 (len (p ));if _be > _af {_be =_af ;p =p [:_be ];};if readOffset >=_af {return 0,_c .EOF ;};_f :=readOffset +_be ;if _f >=_af {_f =_af ;};_dbg :=copy (p ,_ag ._ab ._dd [readOffset :_f ]);return _dbg ,nil ;};
|
||||
|
||||
// Add reads a file from a disk and adds it to the storage
|
||||
func (_aeg *memStorage )Add (path string )error {_ ,_eg :=_aeg ._bf .Load (path );if _eg {return nil ;};_ec ,_gc :=_d .ReadFile (path );if _gc !=nil {return _gc ;};_aeg ._bf .Store (path ,&memDataCell {_ea :path ,_gg :_ec ,_ba :int64 (len (_ec ))});return nil ;};
|
||||
func (_egd *memStorage )Add (path string )error {_ ,_ggc :=_egd ._ga .Load (path );if _ggc {return nil ;};_df ,_bb :=_ca .ReadFile (path );if _bb !=nil {return _bb ;};_egd ._ga .Store (path ,&memDataCell {_gd :path ,_dd :_df ,_gg :int64 (len (_df ))});return nil ;};func _dc (_fcf int )(string ,error ){_dcc :=make ([]byte ,_fcf );if _ ,_ec :=_cd .Read (_dcc );_ec !=nil {return "",_ec ;};return _cc .EncodeToString (_dcc ),nil ;};type memStorage struct{_ga _e .Map };
|
||||
|
||||
// RemoveAll removes all files according to the dir argument prefix
|
||||
func (_ccd *memStorage )RemoveAll (dir string )error {_ccd ._ga .Range (func (_dbb ,_cgc interface{})bool {_ccd ._ga .Delete (_dbb );return true });return nil ;};type memFile struct{_ab *memDataCell ;_b int64 ;};
|
||||
|
||||
// Write writes to the end of the underlying memDataCell in order to implement Writer interface
|
||||
func (_fd *memFile )Write (p []byte )(int ,error ){_fd ._ab ._dd =append (_fd ._ab ._dd ,p ...);_fd ._ab ._gg +=int64 (len (p ));return len (p ),nil ;};
|
||||
|
||||
// SetAsStorage sets temp storage as a memory storage
|
||||
func SetAsStorage (){_cca :=memStorage {_ga :_e .Map {}};_d .SetAsStorage (&_cca )};
|
||||
|
||||
// Read reads from the underlying memDataCell in order to implement Reader interface
|
||||
func (_fcg *memFile )Read (p []byte )(int ,error ){_da :=_fcg ._ed ;_ab :=_fcg ._ae ._ba ;_ff :=int64 (len (p ));if _ff > _ab {_ff =_ab ;p =p [:_ff ];};if _da >=_ab {return 0,_f .EOF ;};_bd :=_da +_ff ;if _bd >=_ab {_bd =_ab ;};_aee :=copy (p ,_fcg ._ae ._gg [_da :_bd ]);_fcg ._ed =_bd ;return _aee ,nil ;};type memDataCell struct{_ea string ;_gg []byte ;_ba int64 ;};
|
||||
func (_g *memFile )Read (p []byte )(int ,error ){_gb :=_g ._b ;_da :=_g ._ab ._gg ;_db :=int64 (len (p ));if _db > _da {_db =_da ;p =p [:_db ];};if _gb >=_da {return 0,_c .EOF ;};_ee :=_gb +_db ;if _ee >=_da {_ee =_da ;};_bf :=copy (p ,_g ._ab ._dd [_gb :_ee ]);_g ._b =_ee ;return _bf ,nil ;};
|
||||
|
||||
// TempFile creates a new empty file in the storage and returns it
|
||||
func (_ad *memStorage )TempFile (dir ,pattern string )(_e .File ,error ){_bb :=dir +"\u002f"+_ef (pattern );_dd :=&memDataCell {_ea :_bb ,_gg :[]byte {}};_de :=&memFile {_ae :_dd };_ad ._bf .Store (_bb ,_dd );return _de ,nil ;};func _bfd (_eff int )(string ,error ){_eab :=make ([]byte ,_eff );if _ ,_eeb :=_aa .Read (_eab );_eeb !=nil {return "",_eeb ;};return _fag .EncodeToString (_eab ),nil ;};func _ef (_cf string )string {_gcb ,_ :=_bfd (6);return _cf +_gcb };
|
||||
// Close is not applicable in this implementation
|
||||
func (_gc *memFile )Close ()error {return nil };
|
||||
|
||||
// TempDir creates a name for a new temp directory using a pattern argument
|
||||
func (_ge *memStorage )TempDir (pattern string )(string ,error ){return _ac (pattern ),nil };
|
@ -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 _a "io";
|
||||
|
||||
// RemoveAll removes all files according to the dir argument prefix.
|
||||
func RemoveAll (dir string )error {return _be .RemoveAll (dir )};
|
||||
package tempstorage ;import _b "io";
|
||||
|
||||
// File is a representation of a storage file
|
||||
// with Read, Write, Close and Name methods identical to os.File.
|
||||
type File interface{_a .Reader ;_a .ReaderAt ;_a .Writer ;_a .Closer ;Name ()string ;};
|
||||
|
||||
// Add reads a file from a disk and adds it to the storage.
|
||||
func Add (path string )error {return _be .Add (path )};
|
||||
|
||||
// TempDir creates a name for a new temp directory using a pattern argument.
|
||||
func TempDir (pattern string )(string ,error ){return _be .TempDir (pattern )};
|
||||
|
||||
// SetAsStorage changes temporary storage to newStorage.
|
||||
func SetAsStorage (newStorage storage ){_be =newStorage };type storage interface{Open (_d string )(File ,error );TempFile (_f ,_aa string )(File ,error );TempDir (_c string )(string ,error );RemoveAll (_e string )error ;Add (_g string )error ;};
|
||||
type File interface{_b .Reader ;_b .ReaderAt ;_b .Writer ;_b .Closer ;Name ()string ;};
|
||||
|
||||
// Open returns tempstorage File object by name.
|
||||
func Open (path string )(File ,error ){return _be .Open (path )};var _be storage ;
|
||||
func Open (path string )(File ,error ){return _ab .Open (path )};var _ab storage ;
|
||||
|
||||
// TempFile creates new empty file in the storage and returns it.
|
||||
func TempFile (dir ,pattern string )(File ,error ){return _be .TempFile (dir ,pattern )};
|
||||
func TempFile (dir ,pattern string )(File ,error ){return _ab .TempFile (dir ,pattern )};
|
||||
|
||||
// Add reads a file from a disk and adds it to the storage.
|
||||
func Add (path string )error {return _ab .Add (path )};type storage interface{Open (_cf string )(File ,error );TempFile (_e ,_d string )(File ,error );TempDir (_a string )(string ,error );RemoveAll (_ee string )error ;Add (_aa string )error ;};
|
||||
|
||||
// SetAsStorage changes temporary storage to newStorage.
|
||||
func SetAsStorage (newStorage storage ){_ab =newStorage };
|
||||
|
||||
// RemoveAll removes all files according to the dir argument prefix.
|
||||
func RemoveAll (dir string )error {return _ab .RemoveAll (dir )};
|
||||
|
||||
// TempDir creates a name for a new temp directory using a pattern argument.
|
||||
func TempDir (pattern string )(string ,error ){return _ab .TempDir (pattern )};
|
File diff suppressed because one or more lines are too long
3154
document/document.go
3154
document/document.go
File diff suppressed because one or more lines are too long
@ -9,119 +9,119 @@
|
||||
// Use of this source code is governed by the UniDoc End User License Agreement
|
||||
// terms that can be accessed at https://unidoc.io/eula/
|
||||
|
||||
package drawing ;import (_d "github.com/unidoc/unioffice";_da "github.com/unidoc/unioffice/color";_ga "github.com/unidoc/unioffice/measurement";_gd "github.com/unidoc/unioffice/schema/soo/dml";);
|
||||
|
||||
// ParagraphProperties allows controlling paragraph properties.
|
||||
type ParagraphProperties struct{_ea *_gd .CT_TextParagraphProperties ;};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_ce Paragraph )X ()*_gd .CT_TextParagraph {return _ce ._c };
|
||||
|
||||
// Properties returns the paragraph properties.
|
||||
func (_caf Paragraph )Properties ()ParagraphProperties {if _caf ._c .PPr ==nil {_caf ._c .PPr =_gd .NewCT_TextParagraphProperties ();};return MakeParagraphProperties (_caf ._c .PPr );};func (_ge ShapeProperties )LineProperties ()LineProperties {if _ge ._ecf .Ln ==nil {_ge ._ecf .Ln =_gd .NewCT_LineProperties ();};return LineProperties {_ge ._ecf .Ln };};func (_cedf ShapeProperties )SetNoFill (){_cedf .clearFill ();_cedf ._ecf .NoFill =_gd .NewCT_NoFillProperties ();};
|
||||
|
||||
// SetFlipVertical controls if the shape is flipped vertically.
|
||||
func (_adb ShapeProperties )SetFlipVertical (b bool ){_adb .ensureXfrm ();if !b {_adb ._ecf .Xfrm .FlipVAttr =nil ;}else {_adb ._ecf .Xfrm .FlipVAttr =_d .Bool (true );};};
|
||||
|
||||
// LineJoin is the type of line join
|
||||
type LineJoin byte ;
|
||||
|
||||
// Properties returns the run's properties.
|
||||
func (_cef Run )Properties ()RunProperties {if _cef ._bd .R ==nil {_cef ._bd .R =_gd .NewCT_RegularTextRun ();};if _cef ._bd .R .RPr ==nil {_cef ._bd .R .RPr =_gd .NewCT_TextCharacterProperties ();};return RunProperties {_cef ._bd .R .RPr };};
|
||||
|
||||
// SetText sets the run's text contents.
|
||||
func (_fd Run )SetText (s string ){_fd ._bd .Br =nil ;_fd ._bd .Fld =nil ;if _fd ._bd .R ==nil {_fd ._bd .R =_gd .NewCT_RegularTextRun ();};_fd ._bd .R .T =s ;};
|
||||
|
||||
// MakeRun constructs a new Run wrapper.
|
||||
func MakeRun (x *_gd .EG_TextRun )Run {return Run {x }};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_bda ShapeProperties )X ()*_gd .CT_ShapeProperties {return _bda ._ecf };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_gdb LineProperties )X ()*_gd .CT_LineProperties {return _gdb ._a };
|
||||
|
||||
// SetAlign controls the paragraph alignment
|
||||
func (_aba ParagraphProperties )SetAlign (a _gd .ST_TextAlignType ){_aba ._ea .AlgnAttr =a };
|
||||
|
||||
// SetPosition sets the position of the shape.
|
||||
func (_gbg ShapeProperties )SetPosition (x ,y _ga .Distance ){_gbg .ensureXfrm ();if _gbg ._ecf .Xfrm .Off ==nil {_gbg ._ecf .Xfrm .Off =_gd .NewCT_Point2D ();};_gbg ._ecf .Xfrm .Off .XAttr .ST_CoordinateUnqualified =_d .Int64 (int64 (x /_ga .EMU ));_gbg ._ecf .Xfrm .Off .YAttr .ST_CoordinateUnqualified =_d .Int64 (int64 (y /_ga .EMU ));};func (_b LineProperties )SetSolidFill (c _da .Color ){_b .clearFill ();_b ._a .SolidFill =_gd .NewCT_SolidColorFillProperties ();_b ._a .SolidFill .SrgbClr =_gd .NewCT_SRgbColor ();_b ._a .SolidFill .SrgbClr .ValAttr =*c .AsRGBString ();};
|
||||
|
||||
// SetNumbered controls if bullets are numbered or not.
|
||||
func (_fe ParagraphProperties )SetNumbered (scheme _gd .ST_TextAutonumberScheme ){if scheme ==_gd .ST_TextAutonumberSchemeUnset {_fe ._ea .BuAutoNum =nil ;}else {_fe ._ea .BuAutoNum =_gd .NewCT_TextAutonumberBullet ();_fe ._ea .BuAutoNum .TypeAttr =scheme ;};};func (_dd ShapeProperties )ensureXfrm (){if _dd ._ecf .Xfrm ==nil {_dd ._ecf .Xfrm =_gd .NewCT_Transform2D ();};};
|
||||
|
||||
// SetBulletChar sets the bullet character for the paragraph.
|
||||
func (_ced ParagraphProperties )SetBulletChar (c string ){if c ==""{_ced ._ea .BuChar =nil ;}else {_ced ._ea .BuChar =_gd .NewCT_TextCharBullet ();_ced ._ea .BuChar .CharAttr =c ;};};
|
||||
|
||||
// SetLevel sets the level of indentation of a paragraph.
|
||||
func (_ab ParagraphProperties )SetLevel (idx int32 ){_ab ._ea .LvlAttr =_d .Int32 (idx )};
|
||||
|
||||
// AddBreak adds a new line break to a paragraph.
|
||||
func (_gbe Paragraph )AddBreak (){_ca :=_gd .NewEG_TextRun ();_ca .Br =_gd .NewCT_TextLineBreak ();_gbe ._c .EG_TextRun =append (_gbe ._c .EG_TextRun ,_ca );};
|
||||
|
||||
// RunProperties controls the run properties.
|
||||
type RunProperties struct{_cf *_gd .CT_TextCharacterProperties ;};
|
||||
|
||||
// Run is a run within a paragraph.
|
||||
type Run struct{_bd *_gd .EG_TextRun };
|
||||
|
||||
// SetSolidFill controls the text color of a run.
|
||||
func (_gbc RunProperties )SetSolidFill (c _da .Color ){_gbc ._cf .NoFill =nil ;_gbc ._cf .BlipFill =nil ;_gbc ._cf .GradFill =nil ;_gbc ._cf .GrpFill =nil ;_gbc ._cf .PattFill =nil ;_gbc ._cf .SolidFill =_gd .NewCT_SolidColorFillProperties ();_gbc ._cf .SolidFill .SrgbClr =_gd .NewCT_SRgbColor ();_gbc ._cf .SolidFill .SrgbClr .ValAttr =*c .AsRGBString ();};
|
||||
|
||||
// Paragraph is a paragraph within a document.
|
||||
type Paragraph struct{_c *_gd .CT_TextParagraph };
|
||||
|
||||
// AddRun adds a new run to a paragraph.
|
||||
func (_e Paragraph )AddRun ()Run {_fa :=MakeRun (_gd .NewEG_TextRun ());_e ._c .EG_TextRun =append (_e ._c .EG_TextRun ,_fa .X ());return _fa ;};
|
||||
|
||||
// MakeRunProperties constructs a new RunProperties wrapper.
|
||||
func MakeRunProperties (x *_gd .CT_TextCharacterProperties )RunProperties {return RunProperties {x }};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_bdb Run )X ()*_gd .EG_TextRun {return _bdb ._bd };
|
||||
|
||||
// SetHeight sets the height of the shape.
|
||||
func (_gc ShapeProperties )SetHeight (h _ga .Distance ){_gc .ensureXfrm ();if _gc ._ecf .Xfrm .Ext ==nil {_gc ._ecf .Xfrm .Ext =_gd .NewCT_PositiveSize2D ();};_gc ._ecf .Xfrm .Ext .CyAttr =int64 (h /_ga .EMU );};
|
||||
|
||||
// SetJoin sets the line join style.
|
||||
func (_gb LineProperties )SetJoin (e LineJoin ){_gb ._a .Round =nil ;_gb ._a .Miter =nil ;_gb ._a .Bevel =nil ;switch e {case LineJoinRound :_gb ._a .Round =_gd .NewCT_LineJoinRound ();case LineJoinBevel :_gb ._a .Bevel =_gd .NewCT_LineJoinBevel ();case LineJoinMiter :_gb ._a .Miter =_gd .NewCT_LineJoinMiterProperties ();};};
|
||||
|
||||
// SetWidth sets the width of the shape.
|
||||
func (_cc ShapeProperties )SetWidth (w _ga .Distance ){_cc .ensureXfrm ();if _cc ._ecf .Xfrm .Ext ==nil {_cc ._ecf .Xfrm .Ext =_gd .NewCT_PositiveSize2D ();};_cc ._ecf .Xfrm .Ext .CxAttr =int64 (w /_ga .EMU );};
|
||||
|
||||
// GetPosition gets the position of the shape in EMU.
|
||||
func (_ba ShapeProperties )GetPosition ()(int64 ,int64 ){_ba .ensureXfrm ();if _ba ._ecf .Xfrm .Off ==nil {_ba ._ecf .Xfrm .Off =_gd .NewCT_Point2D ();};return *_ba ._ecf .Xfrm .Off .XAttr .ST_CoordinateUnqualified ,*_ba ._ecf .Xfrm .Off .YAttr .ST_CoordinateUnqualified ;};
|
||||
|
||||
// SetFont controls the font of a run.
|
||||
func (_gf RunProperties )SetFont (s string ){_gf ._cf .Latin =_gd .NewCT_TextFont ();_gf ._cf .Latin .TypefaceAttr =s ;};
|
||||
|
||||
// SetGeometry sets the shape type of the shape
|
||||
func (_gg ShapeProperties )SetGeometry (g _gd .ST_ShapeType ){if _gg ._ecf .PrstGeom ==nil {_gg ._ecf .PrstGeom =_gd .NewCT_PresetGeometry2D ();};_gg ._ecf .PrstGeom .PrstAttr =g ;};func (_fga LineProperties )SetNoFill (){_fga .clearFill ();_fga ._a .NoFill =_gd .NewCT_NoFillProperties ();};
|
||||
package drawing ;import (_g "github.com/unidoc/unioffice";_gb "github.com/unidoc/unioffice/color";_ga "github.com/unidoc/unioffice/measurement";_e "github.com/unidoc/unioffice/schema/soo/dml";);
|
||||
|
||||
// SetWidth sets the line width, MS products treat zero as the minimum width
|
||||
// that can be displayed.
|
||||
func (_f LineProperties )SetWidth (w _ga .Distance ){_f ._a .WAttr =_d .Int32 (int32 (w /_ga .EMU ))};func (_bdg ShapeProperties )clearFill (){_bdg ._ecf .NoFill =nil ;_bdg ._ecf .BlipFill =nil ;_bdg ._ecf .GradFill =nil ;_bdg ._ecf .GrpFill =nil ;_bdg ._ecf .SolidFill =nil ;_bdg ._ecf .PattFill =nil ;};func MakeShapeProperties (x *_gd .CT_ShapeProperties )ShapeProperties {return ShapeProperties {x }};
|
||||
func (_b LineProperties )SetWidth (w _ga .Distance ){_b ._aa .WAttr =_g .Int32 (int32 (w /_ga .EMU ))};
|
||||
|
||||
// MakeParagraphProperties constructs a new ParagraphProperties wrapper.
|
||||
func MakeParagraphProperties (x *_gd .CT_TextParagraphProperties )ParagraphProperties {return ParagraphProperties {x };};
|
||||
// SetWidth sets the width of the shape.
|
||||
func (_efc ShapeProperties )SetWidth (w _ga .Distance ){_efc .ensureXfrm ();if _efc ._baf .Xfrm .Ext ==nil {_efc ._baf .Xfrm .Ext =_e .NewCT_PositiveSize2D ();};_efc ._baf .Xfrm .Ext .CxAttr =int64 (w /_ga .EMU );};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_ec ParagraphProperties )X ()*_gd .CT_TextParagraphProperties {return _ec ._ea };
|
||||
// SetLevel sets the level of indentation of a paragraph.
|
||||
func (_fb ParagraphProperties )SetLevel (idx int32 ){_fb ._ge .LvlAttr =_g .Int32 (idx )};
|
||||
|
||||
// SetFlipHorizontal controls if the shape is flipped horizontally.
|
||||
func (_aa ShapeProperties )SetFlipHorizontal (b bool ){_aa .ensureXfrm ();if !b {_aa ._ecf .Xfrm .FlipHAttr =nil ;}else {_aa ._ecf .Xfrm .FlipHAttr =_d .Bool (true );};};func (_af ShapeProperties )SetSolidFill (c _da .Color ){_af .clearFill ();_af ._ecf .SolidFill =_gd .NewCT_SolidColorFillProperties ();_af ._ecf .SolidFill .SrgbClr =_gd .NewCT_SRgbColor ();_af ._ecf .SolidFill .SrgbClr .ValAttr =*c .AsRGBString ();};const (LineJoinRound LineJoin =iota ;LineJoinBevel ;LineJoinMiter ;);
|
||||
|
||||
// SetBold controls the bolding of a run.
|
||||
func (_dcf RunProperties )SetBold (b bool ){_dcf ._cf .BAttr =_d .Bool (b )};
|
||||
|
||||
// MakeParagraph constructs a new paragraph wrapper.
|
||||
func MakeParagraph (x *_gd .CT_TextParagraph )Paragraph {return Paragraph {x }};
|
||||
|
||||
// SetSize sets the font size of the run text
|
||||
func (_ag RunProperties )SetSize (sz _ga .Distance ){_ag ._cf .SzAttr =_d .Int32 (int32 (sz /_ga .HundredthPoint ));};type ShapeProperties struct{_ecf *_gd .CT_ShapeProperties };
|
||||
|
||||
// SetSize sets the width and height of the shape.
|
||||
func (_ad ShapeProperties )SetSize (w ,h _ga .Distance ){_ad .SetWidth (w );_ad .SetHeight (h )};
|
||||
// ParagraphProperties allows controlling paragraph properties.
|
||||
type ParagraphProperties struct{_ge *_e .CT_TextParagraphProperties ;};
|
||||
|
||||
// SetBulletFont controls the font for the bullet character.
|
||||
func (_dc ParagraphProperties )SetBulletFont (f string ){if f ==""{_dc ._ea .BuFont =nil ;}else {_dc ._ea .BuFont =_gd .NewCT_TextFont ();_dc ._ea .BuFont .TypefaceAttr =f ;};};type LineProperties struct{_a *_gd .CT_LineProperties };func (_fg LineProperties )clearFill (){_fg ._a .NoFill =nil ;_fg ._a .GradFill =nil ;_fg ._a .SolidFill =nil ;_fg ._a .PattFill =nil ;};
|
||||
func (_eg ParagraphProperties )SetBulletFont (f string ){if f ==""{_eg ._ge .BuFont =nil ;}else {_eg ._ge .BuFont =_e .NewCT_TextFont ();_eg ._ge .BuFont .TypefaceAttr =f ;};};type LineProperties struct{_aa *_e .CT_LineProperties };
|
||||
|
||||
// GetPosition gets the position of the shape in EMU.
|
||||
func (_ff ShapeProperties )GetPosition ()(int64 ,int64 ){_ff .ensureXfrm ();if _ff ._baf .Xfrm .Off ==nil {_ff ._baf .Xfrm .Off =_e .NewCT_Point2D ();};return *_ff ._baf .Xfrm .Off .XAttr .ST_CoordinateUnqualified ,*_ff ._baf .Xfrm .Off .YAttr .ST_CoordinateUnqualified ;};
|
||||
|
||||
// SetFlipVertical controls if the shape is flipped vertically.
|
||||
func (_bab ShapeProperties )SetFlipVertical (b bool ){_bab .ensureXfrm ();if !b {_bab ._baf .Xfrm .FlipVAttr =nil ;}else {_bab ._baf .Xfrm .FlipVAttr =_g .Bool (true );};};
|
||||
|
||||
// SetJoin sets the line join style.
|
||||
func (_da LineProperties )SetJoin (e LineJoin ){_da ._aa .Round =nil ;_da ._aa .Miter =nil ;_da ._aa .Bevel =nil ;switch e {case LineJoinRound :_da ._aa .Round =_e .NewCT_LineJoinRound ();case LineJoinBevel :_da ._aa .Bevel =_e .NewCT_LineJoinBevel ();case LineJoinMiter :_da ._aa .Miter =_e .NewCT_LineJoinMiterProperties ();};};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_afa Run )X ()*_e .EG_TextRun {return _afa ._ac };
|
||||
|
||||
// SetNumbered controls if bullets are numbered or not.
|
||||
func (_cg ParagraphProperties )SetNumbered (scheme _e .ST_TextAutonumberScheme ){if scheme ==_e .ST_TextAutonumberSchemeUnset {_cg ._ge .BuAutoNum =nil ;}else {_cg ._ge .BuAutoNum =_e .NewCT_TextAutonumberBullet ();_cg ._ge .BuAutoNum .TypeAttr =scheme ;};};
|
||||
|
||||
// SetBold controls the bolding of a run.
|
||||
func (_ba RunProperties )SetBold (b bool ){_ba ._bde .BAttr =_g .Bool (b )};func (_d LineProperties )SetNoFill (){_d .clearFill ();_d ._aa .NoFill =_e .NewCT_NoFillProperties ()};
|
||||
|
||||
// SetFont controls the font of a run.
|
||||
func (_daf RunProperties )SetFont (s string ){_daf ._bde .Latin =_e .NewCT_TextFont ();_daf ._bde .Latin .TypefaceAttr =s ;};func (_f LineProperties )SetSolidFill (c _gb .Color ){_f .clearFill ();_f ._aa .SolidFill =_e .NewCT_SolidColorFillProperties ();_f ._aa .SolidFill .SrgbClr =_e .NewCT_SRgbColor ();_f ._aa .SolidFill .SrgbClr .ValAttr =*c .AsRGBString ();};
|
||||
|
||||
// SetBulletChar sets the bullet character for the paragraph.
|
||||
func (_fd ParagraphProperties )SetBulletChar (c string ){if c ==""{_fd ._ge .BuChar =nil ;}else {_fd ._ge .BuChar =_e .NewCT_TextCharBullet ();_fd ._ge .BuChar .CharAttr =c ;};};
|
||||
|
||||
// Paragraph is a paragraph within a document.
|
||||
type Paragraph struct{_gc *_e .CT_TextParagraph };
|
||||
|
||||
// Properties returns the run's properties.
|
||||
func (_ad Run )Properties ()RunProperties {if _ad ._ac .R ==nil {_ad ._ac .R =_e .NewCT_RegularTextRun ();};if _ad ._ac .R .RPr ==nil {_ad ._ac .R .RPr =_e .NewCT_TextCharacterProperties ();};return RunProperties {_ad ._ac .R .RPr };};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_fe ShapeProperties )X ()*_e .CT_ShapeProperties {return _fe ._baf };
|
||||
|
||||
// Run is a run within a paragraph.
|
||||
type Run struct{_ac *_e .EG_TextRun };const (LineJoinRound LineJoin =iota ;LineJoinBevel ;LineJoinMiter ;);
|
||||
|
||||
// MakeRunProperties constructs a new RunProperties wrapper.
|
||||
func MakeRunProperties (x *_e .CT_TextCharacterProperties )RunProperties {return RunProperties {x }};
|
||||
|
||||
// MakeRun constructs a new Run wrapper.
|
||||
func MakeRun (x *_e .EG_TextRun )Run {return Run {x }};
|
||||
|
||||
// SetSize sets the font size of the run text
|
||||
func (_cb RunProperties )SetSize (sz _ga .Distance ){_cb ._bde .SzAttr =_g .Int32 (int32 (sz /_ga .HundredthPoint ));};type ShapeProperties struct{_baf *_e .CT_ShapeProperties };
|
||||
|
||||
// AddBreak adds a new line break to a paragraph.
|
||||
func (_ef Paragraph )AddBreak (){_eb :=_e .NewEG_TextRun ();_eb .Br =_e .NewCT_TextLineBreak ();_ef ._gc .EG_TextRun =append (_ef ._gc .EG_TextRun ,_eb );};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_cf ParagraphProperties )X ()*_e .CT_TextParagraphProperties {return _cf ._ge };func (_df ShapeProperties )SetNoFill (){_df .clearFill ();_df ._baf .NoFill =_e .NewCT_NoFillProperties ();};
|
||||
|
||||
// SetSize sets the width and height of the shape.
|
||||
func (_dd ShapeProperties )SetSize (w ,h _ga .Distance ){_dd .SetWidth (w );_dd .SetHeight (h )};
|
||||
|
||||
// MakeParagraph constructs a new paragraph wrapper.
|
||||
func MakeParagraph (x *_e .CT_TextParagraph )Paragraph {return Paragraph {x }};func (_dc ShapeProperties )SetSolidFill (c _gb .Color ){_dc .clearFill ();_dc ._baf .SolidFill =_e .NewCT_SolidColorFillProperties ();_dc ._baf .SolidFill .SrgbClr =_e .NewCT_SRgbColor ();_dc ._baf .SolidFill .SrgbClr .ValAttr =*c .AsRGBString ();};
|
||||
|
||||
// SetPosition sets the position of the shape.
|
||||
func (_bdb ShapeProperties )SetPosition (x ,y _ga .Distance ){_bdb .ensureXfrm ();if _bdb ._baf .Xfrm .Off ==nil {_bdb ._baf .Xfrm .Off =_e .NewCT_Point2D ();};_bdb ._baf .Xfrm .Off .XAttr .ST_CoordinateUnqualified =_g .Int64 (int64 (x /_ga .EMU ));_bdb ._baf .Xfrm .Off .YAttr .ST_CoordinateUnqualified =_g .Int64 (int64 (y /_ga .EMU ));};
|
||||
|
||||
// SetText sets the run's text contents.
|
||||
func (_aba Run )SetText (s string ){_aba ._ac .Br =nil ;_aba ._ac .Fld =nil ;if _aba ._ac .R ==nil {_aba ._ac .R =_e .NewCT_RegularTextRun ();};_aba ._ac .R .T =s ;};
|
||||
|
||||
// SetFlipHorizontal controls if the shape is flipped horizontally.
|
||||
func (_aacd ShapeProperties )SetFlipHorizontal (b bool ){_aacd .ensureXfrm ();if !b {_aacd ._baf .Xfrm .FlipHAttr =nil ;}else {_aacd ._baf .Xfrm .FlipHAttr =_g .Bool (true );};};
|
||||
|
||||
// SetGeometry sets the shape type of the shape
|
||||
func (_egg ShapeProperties )SetGeometry (g _e .ST_ShapeType ){if _egg ._baf .PrstGeom ==nil {_egg ._baf .PrstGeom =_e .NewCT_PresetGeometry2D ();};_egg ._baf .PrstGeom .PrstAttr =g ;};func (_cc ShapeProperties )ensureXfrm (){if _cc ._baf .Xfrm ==nil {_cc ._baf .Xfrm =_e .NewCT_Transform2D ();};};func MakeShapeProperties (x *_e .CT_ShapeProperties )ShapeProperties {return ShapeProperties {x }};func (_afb ShapeProperties )LineProperties ()LineProperties {if _afb ._baf .Ln ==nil {_afb ._baf .Ln =_e .NewCT_LineProperties ();};return LineProperties {_afb ._baf .Ln };};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_gd LineProperties )X ()*_e .CT_LineProperties {return _gd ._aa };
|
||||
|
||||
// MakeParagraphProperties constructs a new ParagraphProperties wrapper.
|
||||
func MakeParagraphProperties (x *_e .CT_TextParagraphProperties )ParagraphProperties {return ParagraphProperties {x };};func (_bc ShapeProperties )clearFill (){_bc ._baf .NoFill =nil ;_bc ._baf .BlipFill =nil ;_bc ._baf .GradFill =nil ;_bc ._baf .GrpFill =nil ;_bc ._baf .SolidFill =nil ;_bc ._baf .PattFill =nil ;};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_bd Paragraph )X ()*_e .CT_TextParagraph {return _bd ._gc };
|
||||
|
||||
// RunProperties controls the run properties.
|
||||
type RunProperties struct{_bde *_e .CT_TextCharacterProperties ;};
|
||||
|
||||
// SetAlign controls the paragraph alignment
|
||||
func (_aac ParagraphProperties )SetAlign (a _e .ST_TextAlignType ){_aac ._ge .AlgnAttr =a };
|
||||
|
||||
// AddRun adds a new run to a paragraph.
|
||||
func (_c Paragraph )AddRun ()Run {_ab :=MakeRun (_e .NewEG_TextRun ());_c ._gc .EG_TextRun =append (_c ._gc .EG_TextRun ,_ab .X ());return _ab ;};
|
||||
|
||||
// SetSolidFill controls the text color of a run.
|
||||
func (_efa RunProperties )SetSolidFill (c _gb .Color ){_efa ._bde .NoFill =nil ;_efa ._bde .BlipFill =nil ;_efa ._bde .GradFill =nil ;_efa ._bde .GrpFill =nil ;_efa ._bde .PattFill =nil ;_efa ._bde .SolidFill =_e .NewCT_SolidColorFillProperties ();_efa ._bde .SolidFill .SrgbClr =_e .NewCT_SRgbColor ();_efa ._bde .SolidFill .SrgbClr .ValAttr =*c .AsRGBString ();};func (_be LineProperties )clearFill (){_be ._aa .NoFill =nil ;_be ._aa .GradFill =nil ;_be ._aa .SolidFill =nil ;_be ._aa .PattFill =nil ;};
|
||||
|
||||
// SetHeight sets the height of the shape.
|
||||
func (_cfg ShapeProperties )SetHeight (h _ga .Distance ){_cfg .ensureXfrm ();if _cfg ._baf .Xfrm .Ext ==nil {_cfg ._baf .Xfrm .Ext =_e .NewCT_PositiveSize2D ();};_cfg ._baf .Xfrm .Ext .CyAttr =int64 (h /_ga .EMU );};
|
||||
|
||||
// Properties returns the paragraph properties.
|
||||
func (_af Paragraph )Properties ()ParagraphProperties {if _af ._gc .PPr ==nil {_af ._gc .PPr =_e .NewCT_TextParagraphProperties ();};return MakeParagraphProperties (_af ._gc .PPr );};
|
||||
|
||||
// LineJoin is the type of line join
|
||||
type LineJoin byte ;
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -9,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{_f :=make ([]float64 ,len (array ));copy (_f ,array );return _f ;};_e :=len (array )/2;_fd :=MergeSort (array [:_e ]);_d :=MergeSort (array [_e :]);_ee :=make ([]float64 ,len (array ));_a :=0;_g :=0;_gc :=0;for _g < len (_fd )&&_gc < len (_d ){if _fd [_g ]<=_d [_gc ]{_ee [_a ]=_fd [_g ];_g ++;}else {_ee [_a ]=_d [_gc ];_gc ++;};_a ++;};for _g < len (_fd ){_ee [_a ]=_fd [_g ];_g ++;_a ++;};for _gc < len (_d ){_ee [_a ]=_d [_gc ];_gc ++;_a ++;};return _ee ;};
|
||||
package mergesort ;func MergeSort (array []float64 )[]float64 {if len (array )<=1{_g :=make ([]float64 ,len (array ));copy (_g ,array );return _g ;};_b :=len (array )/2;_d :=MergeSort (array [:_b ]);_e :=MergeSort (array [_b :]);_ec :=make ([]float64 ,len (array ));_a :=0;_dc :=0;_fb :=0;for _dc < len (_d )&&_fb < len (_e ){if _d [_dc ]<=_e [_fb ]{_ec [_a ]=_d [_dc ];_dc ++;}else {_ec [_a ]=_e [_fb ];_fb ++;};_a ++;};for _dc < len (_d ){_ec [_a ]=_d [_dc ];_dc ++;_a ++;};for _fb < len (_e ){_ec [_a ]=_e [_fb ];_fb ++;_a ++;};return _ec ;};
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -9,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 MatchSimple (pattern ,name string )bool {if pattern ==""{return name ==pattern ;};if pattern =="\u002a"{return true ;};_c :=make ([]rune ,0,len (name ));_g :=make ([]rune ,0,len (pattern ));for _ ,_ad :=range name {_c =append (_c ,_ad );};for _ ,_cd :=range pattern {_g =append (_g ,_cd );};_gee :=true ;return _fc (_c ,_g ,_gee );};func Match (pattern ,name string )(_gc bool ){if pattern ==""{return name ==pattern ;};if pattern =="\u002a"{return true ;};_f :=make ([]rune ,0,len (name ));_d :=make ([]rune ,0,len (pattern ));for _ ,_ee :=range name {_f =append (_f ,_ee );};for _ ,_cb :=range pattern {_d =append (_d ,_cb );};_gd :=false ;return _fc (_f ,_d ,_gd );};func _fc (_b ,_ga []rune ,_ec bool )bool {for len (_ga )> 0{switch _ga [0]{default:if len (_b )==0||_b [0]!=_ga [0]{return false ;};case '?':if len (_b )==0&&!_ec {return false ;};case '*':return _fc (_b ,_ga [1:],_ec )||(len (_b )> 0&&_fc (_b [1:],_ga ,_ec ));};_b =_b [1:];_ga =_ga [1:];};return len (_b )==0&&len (_ga )==0;};func Index (pattern ,name string )(_bc int ){if pattern ==""||pattern =="\u002a"{return 0;};_fa :=make ([]rune ,0,len (name ));_ab :=make ([]rune ,0,len (pattern ));for _ ,_af :=range name {_fa =append (_fa ,_af );};for _ ,_bb :=range pattern {_ab =append (_ab ,_bb );};return _ged (_fa ,_ab ,0);};func _ged (_cdb ,_gea []rune ,_fag int )int {for len (_gea )> 0{switch _gea [0]{default:if len (_cdb )==0{return -1;};if _cdb [0]!=_gea [0]{return _ged (_cdb [1:],_gea ,_fag +1);};case '?':if len (_cdb )==0{return -1;};case '*':if len (_cdb )==0{return -1;};_cf :=_ged (_cdb ,_gea [1:],_fag );if _cf !=-1{return _fag ;}else {_cf =_ged (_cdb [1:],_gea ,_fag );if _cf !=-1{return _fag ;}else {return -1;};};};_cdb =_cdb [1:];_gea =_gea [1:];};return _fag ;};
|
||||
package wildcard ;func _fa (_ce ,_ff []rune ,_de bool )bool {for len (_ff )> 0{switch _ff [0]{default:if len (_ce )==0||_ce [0]!=_ff [0]{return false ;};case '?':if len (_ce )==0&&!_de {return false ;};case '*':return _fa (_ce ,_ff [1:],_de )||(len (_ce )> 0&&_fa (_ce [1:],_ff ,_de ));};_ce =_ce [1:];_ff =_ff [1:];};return len (_ce )==0&&len (_ff )==0;};func MatchSimple (pattern ,name string )bool {if pattern ==""{return name ==pattern ;};if pattern =="\u002a"{return true ;};_be :=make ([]rune ,0,len (name ));_a :=make ([]rune ,0,len (pattern ));for _ ,_d :=range name {_be =append (_be ,_d );};for _ ,_aa :=range pattern {_a =append (_a ,_aa );};_ga :=true ;return _fa (_be ,_a ,_ga );};func _db (_ac ,_gdf []rune ,_cg int )int {for len (_gdf )> 0{switch _gdf [0]{default:if len (_ac )==0{return -1;};if _ac [0]!=_gdf [0]{return _db (_ac [1:],_gdf ,_cg +1);};case '?':if len (_ac )==0{return -1;};case '*':if len (_ac )==0{return -1;};_ccf :=_db (_ac ,_gdf [1:],_cg );if _ccf !=-1{return _cg ;}else {_ccf =_db (_ac [1:],_gdf ,_cg );if _ccf !=-1{return _cg ;}else {return -1;};};};_ac =_ac [1:];_gdf =_gdf [1:];};return _cg ;};func Match (pattern ,name string )(_e bool ){if pattern ==""{return name ==pattern ;};if pattern =="\u002a"{return true ;};_gg :=make ([]rune ,0,len (name ));_dc :=make ([]rune ,0,len (pattern ));for _ ,_ec :=range name {_gg =append (_gg ,_ec );};for _ ,_ef :=range pattern {_dc =append (_dc ,_ef );};_c :=false ;return _fa (_gg ,_dc ,_c );};func Index (pattern ,name string )(_dd int ){if pattern ==""||pattern =="\u002a"{return 0;};_aag :=make ([]rune ,0,len (name ));_cc :=make ([]rune ,0,len (pattern ));for _ ,_deb :=range name {_aag =append (_aag ,_deb );};for _ ,_cd :=range pattern {_cc =append (_cc ,_cd );};return _db (_aag ,_cc ,0);};
|
@ -11,12 +11,12 @@
|
||||
|
||||
package measurement ;
|
||||
|
||||
// ToEMU converts float64 distance units to int64 EMU.
|
||||
func ToEMU (m float64 )int64 {return int64 (914400.0/Inch *m )};
|
||||
|
||||
// Distance represents a distance and is automatically converted
|
||||
// to the units needed internally in the various ECMA 376 formats.
|
||||
type Distance float64 ;
|
||||
type Distance float64 ;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 ;);
|
||||
|
||||
// FromEMU converts int64 ENU units to float64 distance units.
|
||||
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 ;);
|
||||
func FromEMU (emu int64 )float64 {return float64 (emu )/914400*Inch };
|
||||
|
||||
// ToEMU converts float64 distance units to int64 EMU.
|
||||
func ToEMU (m float64 )int64 {return int64 (914400.0/Inch *m )};
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -9,34 +9,34 @@
|
||||
// Use of this source code is governed by the UniDoc End User License Agreement
|
||||
// terms that can be accessed at https://unidoc.io/eula/
|
||||
|
||||
package elements ;import (_b "encoding/xml";_c "fmt";_cd "github.com/unidoc/unioffice";_d "github.com/unidoc/unioffice/common/logger";);func (_bd *ElementContainer )MarshalXML (e *_b .Encoder ,start _b .StartElement )error {start .Name .Local ="\u0065\u006ce\u006d\u0065\u006et\u0043\u006f\u006e\u0074\u0061\u0069\u006e\u0065\u0072";e .EncodeToken (start );if _bd .Choice !=nil {for _ ,_ga :=range _bd .Choice {_ga .MarshalXML (e ,_b .StartElement {});};};e .EncodeToken (_b .EndElement {Name :start .Name });return nil ;};type ElementsGroupChoice struct{Any []*Any ;};func (_bgc *ElementsGroup )MarshalXML (e *_b .Encoder ,start _b .StartElement )error {if _bgc .Choice !=nil {for _ ,_bgf :=range _bgc .Choice {_bgf .MarshalXML (e ,_b .StartElement {});};};return nil ;};
|
||||
package elements ;import (_a "encoding/xml";_g "fmt";_d "github.com/unidoc/unioffice";_gd "github.com/unidoc/unioffice/common/logger";);func (_eg *ElementsGroupChoice )MarshalXML (e *_a .Encoder ,start _a .StartElement )error {if _eg .Any !=nil {_eb :=_a .StartElement {Name :_a .Name {Local :"\u0064\u0063\u003a\u0061\u006e\u0079"}};for _ ,_defc :=range _eg .Any {e .EncodeElement (_defc ,_eb );};};return nil ;};
|
||||
|
||||
// Validate validates the SimpleLiteral and its children
|
||||
func (_ad *SimpleLiteral )Validate ()error {return _ad .ValidateWithPath ("\u0053\u0069\u006d\u0070\u006c\u0065\u004c\u0069\u0074\u0065\u0072\u0061\u006c");};
|
||||
|
||||
// ValidateWithPath validates the ElementsGroup and its children, prefixing error messages with path
|
||||
func (_eeb *ElementsGroup )ValidateWithPath (path string )error {for _ea ,_ff :=range _eeb .Choice {if _eeba :=_ff .ValidateWithPath (_c .Sprintf ("\u0025\u0073\u002f\u0043\u0068\u006f\u0069\u0063\u0065\u005b\u0025\u0064\u005d",path ,_ea ));_eeba !=nil {return _eeba ;};};return nil ;};func NewSimpleLiteral ()*SimpleLiteral {_dbb :=&SimpleLiteral {};return _dbb };func NewElementsGroup ()*ElementsGroup {_dg :=&ElementsGroup {};return _dg };type ElementContainer struct{Choice []*ElementsGroupChoice ;};func (_gdd *ElementsGroup )UnmarshalXML (d *_b .Decoder ,start _b .StartElement )error {_ac :for {_gdc ,_bda :=d .Token ();if _bda !=nil {return _bda ;};switch _gea :=_gdc .(type ){case _b .StartElement :switch _gea .Name {case _b .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"}:_ee :=NewElementsGroupChoice ();if _cdc :=d .DecodeElement (&_ee .Any ,&_gea );_cdc !=nil {return _cdc ;};_gdd .Choice =append (_gdd .Choice ,_ee );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\u0045\u006c\u0065\u006de\u006e\u0074\u0073\u0047\u0072\u006f\u0075\u0070 \u0025\u0076",_gea .Name );if _gfa :=d .Skip ();_gfa !=nil {return _gfa ;};};case _b .EndElement :break _ac ;case _b .CharData :};};return nil ;};func (_cf *ElementContainer )UnmarshalXML (d *_b .Decoder ,start _b .StartElement )error {_gdf :for {_bc ,_be :=d .Token ();if _be !=nil {return _be ;};switch _ed :=_bc .(type ){case _b .StartElement :switch _ed .Name {case _b .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"}:_bfa :=NewElementsGroupChoice ();if _gae :=d .DecodeElement (&_bfa .Any ,&_ed );_gae !=nil {return _gae ;};_cf .Choice =append (_cf .Choice ,_bfa );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\u0045\u006c\u0065\u006d\u0065\u006e\u0074\u0043\u006f\u006e\u0074\u0061\u0069\u006e\u0065\u0072\u0020\u0025v",_ed .Name );if _fad :=d .Skip ();_fad !=nil {return _fad ;};};case _b .EndElement :break _gdf ;case _b .CharData :};};return nil ;};
|
||||
|
||||
// Validate validates the ElementsGroup and its children
|
||||
func (_df *ElementsGroup )Validate ()error {return _df .ValidateWithPath ("\u0045\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u0047\u0072\u006f\u0075\u0070");};
|
||||
|
||||
// Validate validates the ElementContainer and its children
|
||||
func (_ab *ElementContainer )Validate ()error {return _ab .ValidateWithPath ("\u0045\u006ce\u006d\u0065\u006et\u0043\u006f\u006e\u0074\u0061\u0069\u006e\u0065\u0072");};type SimpleLiteral struct{};type Any struct{SimpleLiteral };
|
||||
|
||||
// Validate validates the Any and its children
|
||||
func (_f *Any )Validate ()error {return _f .ValidateWithPath ("\u0041\u006e\u0079")};func (_bgfb *ElementsGroupChoice )UnmarshalXML (d *_b .Decoder ,start _b .StartElement )error {_abe :for {_aee ,_cdf :=d .Token ();if _cdf !=nil {return _cdf ;};switch _fe :=_aee .(type ){case _b .StartElement :switch _fe .Name {case _b .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"}:_gede :=NewAny ();if _gcg :=d .DecodeElement (_gede ,&_fe );_gcg !=nil {return _gcg ;};_bgfb .Any =append (_bgfb .Any ,_gede );default:_d .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",_fe .Name );if _af :=d .Skip ();_af !=nil {return _af ;};};case _b .EndElement :break _abe ;case _b .CharData :};};return nil ;};func (_ged *ElementsGroupChoice )MarshalXML (e *_b .Encoder ,start _b .StartElement )error {if _ged .Any !=nil {_gg :=_b .StartElement {Name :_b .Name {Local :"\u0064\u0063\u003a\u0061\u006e\u0079"}};for _ ,_ag :=range _ged .Any {e .EncodeElement (_ag ,_gg );};};return nil ;};func (_cae *SimpleLiteral )MarshalXML (e *_b .Encoder ,start _b .StartElement )error {e .EncodeToken (start );e .EncodeToken (_b .EndElement {Name :start .Name });return nil ;};func (_ca *Any )MarshalXML (e *_b .Encoder ,start _b .StartElement )error {return _ca .SimpleLiteral .MarshalXML (e ,start );};type ElementsGroup struct{Choice []*ElementsGroupChoice ;};
|
||||
|
||||
// ValidateWithPath validates the SimpleLiteral and its children, prefixing error messages with path
|
||||
func (_fda *SimpleLiteral )ValidateWithPath (path string )error {return nil };
|
||||
|
||||
// Validate validates the ElementsGroupChoice and its children
|
||||
func (_db *ElementsGroupChoice )Validate ()error {return _db .ValidateWithPath ("\u0045\u006c\u0065\u006den\u0074\u0073\u0047\u0072\u006f\u0075\u0070\u0043\u0068\u006f\u0069\u0063\u0065");};func (_agc *SimpleLiteral )UnmarshalXML (d *_b .Decoder ,start _b .StartElement )error {for {_deg ,_aec :=d .Token ();if _aec !=nil {return _c .Errorf ("\u0070a\u0072\u0073\u0069\u006eg\u0020\u0053\u0069\u006d\u0070l\u0065L\u0069t\u0065\u0072\u0061\u006c\u003a\u0020\u0025s",_aec );};if _ggg ,_cc :=_deg .(_b .EndElement );_cc &&_ggg .Name ==start .Name {break ;};};return nil ;};
|
||||
|
||||
// ValidateWithPath validates the ElementsGroupChoice and its children, prefixing error messages with path
|
||||
func (_dcc *ElementsGroupChoice )ValidateWithPath (path string )error {for _ce ,_bb :=range _dcc .Any {if _aed :=_bb .ValidateWithPath (_c .Sprintf ("\u0025\u0073\u002f\u0041\u006e\u0079\u005b\u0025\u0064\u005d",path ,_ce ));_aed !=nil {return _aed ;};};return nil ;};func NewElementContainer ()*ElementContainer {_bf :=&ElementContainer {};return _bf };func NewAny ()*Any {_gc :=&Any {};_gc .SimpleLiteral =*NewSimpleLiteral ();return _gc };func (_de *Any )UnmarshalXML (d *_b .Decoder ,start _b .StartElement )error {_de .SimpleLiteral =*NewSimpleLiteral ();for {_gb ,_a :=d .Token ();if _a !=nil {return _c .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0041\u006e\u0079\u003a\u0020\u0025\u0073",_a );};if _gd ,_gf :=_gb .(_b .EndElement );_gf &&_gd .Name ==start .Name {break ;};};return nil ;};
|
||||
func (_cae *SimpleLiteral )Validate ()error {return _cae .ValidateWithPath ("\u0053\u0069\u006d\u0070\u006c\u0065\u004c\u0069\u0074\u0065\u0072\u0061\u006c");};type ElementsGroupChoice struct{Any []*Any ;};func NewElementsGroupChoice ()*ElementsGroupChoice {_gfa :=&ElementsGroupChoice {};return _gfa };func (_be *ElementContainer )UnmarshalXML (d *_a .Decoder ,start _a .StartElement )error {_bg :for {_ad ,_cdc :=d .Token ();if _cdc !=nil {return _cdc ;};switch _bd :=_ad .(type ){case _a .StartElement :switch _bd .Name {case _a .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"}:_af :=NewElementsGroupChoice ();if _ada :=d .DecodeElement (&_af .Any ,&_bd );_ada !=nil {return _ada ;};_be .Choice =append (_be .Choice ,_af );default:_gd .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",_bd .Name );if _fea :=d .Skip ();_fea !=nil {return _fea ;};};case _a .EndElement :break _bg ;case _a .CharData :};};return nil ;};
|
||||
|
||||
// ValidateWithPath validates the ElementContainer and its children, prefixing error messages with path
|
||||
func (_gfg *ElementContainer )ValidateWithPath (path string )error {for _dc ,_ded :=range _gfg .Choice {if _ae :=_ded .ValidateWithPath (_c .Sprintf ("\u0025\u0073\u002f\u0043\u0068\u006f\u0069\u0063\u0065\u005b\u0025\u0064\u005d",path ,_dc ));_ae !=nil {return _ae ;};};return nil ;};
|
||||
func (_de *ElementContainer )ValidateWithPath (path string )error {for _cc ,_df :=range _de .Choice {if _ba :=_df .ValidateWithPath (_g .Sprintf ("\u0025\u0073\u002f\u0043\u0068\u006f\u0069\u0063\u0065\u005b\u0025\u0064\u005d",path ,_cc ));_ba !=nil {return _ba ;};};return nil ;};
|
||||
|
||||
// Validate validates the ElementsGroup and its children
|
||||
func (_aa *ElementsGroup )Validate ()error {return _aa .ValidateWithPath ("\u0045\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u0047\u0072\u006f\u0075\u0070");};func NewSimpleLiteral ()*SimpleLiteral {_bb :=&SimpleLiteral {};return _bb };func (_f *Any )UnmarshalXML (d *_a .Decoder ,start _a .StartElement )error {_f .SimpleLiteral =*NewSimpleLiteral ();for {_fb ,_fe :=d .Token ();if _fe !=nil {return _g .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0041\u006e\u0079\u003a\u0020\u0025\u0073",_fe );};if _ae ,_b :=_fb .(_a .EndElement );_b &&_ae .Name ==start .Name {break ;};};return nil ;};type ElementContainer struct{Choice []*ElementsGroupChoice ;};
|
||||
|
||||
// ValidateWithPath validates the ElementsGroup and its children, prefixing error messages with path
|
||||
func (_ef *ElementsGroup )ValidateWithPath (path string )error {for _fa ,_ce :=range _ef .Choice {if _cef :=_ce .ValidateWithPath (_g .Sprintf ("\u0025\u0073\u002f\u0043\u0068\u006f\u0069\u0063\u0065\u005b\u0025\u0064\u005d",path ,_fa ));_cef !=nil {return _cef ;};};return nil ;};
|
||||
|
||||
// ValidateWithPath validates the ElementsGroupChoice and its children, prefixing error messages with path
|
||||
func (_cb *ElementsGroupChoice )ValidateWithPath (path string )error {for _dd ,_dcg :=range _cb .Any {if _gfga :=_dcg .ValidateWithPath (_g .Sprintf ("\u0025\u0073\u002f\u0041\u006e\u0079\u005b\u0025\u0064\u005d",path ,_dd ));_gfga !=nil {return _gfga ;};};return nil ;};func (_dc *Any )MarshalXML (e *_a .Encoder ,start _a .StartElement )error {return _dc .SimpleLiteral .MarshalXML (e ,start );};
|
||||
|
||||
// Validate validates the Any and its children
|
||||
func (_c *Any )Validate ()error {return _c .ValidateWithPath ("\u0041\u006e\u0079")};
|
||||
|
||||
// Validate validates the ElementsGroupChoice and its children
|
||||
func (_cg *ElementsGroupChoice )Validate ()error {return _cg .ValidateWithPath ("\u0045\u006c\u0065\u006den\u0074\u0073\u0047\u0072\u006f\u0075\u0070\u0043\u0068\u006f\u0069\u0063\u0065");};func (_egg *SimpleLiteral )MarshalXML (e *_a .Encoder ,start _a .StartElement )error {e .EncodeToken (start );e .EncodeToken (_a .EndElement {Name :start .Name });return nil ;};func NewElementsGroup ()*ElementsGroup {_cdb :=&ElementsGroup {};return _cdb };
|
||||
|
||||
// ValidateWithPath validates the Any and its children, prefixing error messages with path
|
||||
func (_fa *Any )ValidateWithPath (path string )error {if _e :=_fa .SimpleLiteral .ValidateWithPath (path );_e !=nil {return _e ;};return nil ;};func NewElementsGroupChoice ()*ElementsGroupChoice {_fd :=&ElementsGroupChoice {};return _fd };func init (){_cd .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 );_cd .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 );_cd .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 );_cd .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 (_bf *Any )ValidateWithPath (path string )error {if _ge :=_bf .SimpleLiteral .ValidateWithPath (path );_ge !=nil {return _ge ;};return nil ;};type ElementsGroup struct{Choice []*ElementsGroupChoice ;};func (_bge *SimpleLiteral )UnmarshalXML (d *_a .Decoder ,start _a .StartElement )error {for {_egf ,_db :=d .Token ();if _db !=nil {return _g .Errorf ("\u0070a\u0072\u0073\u0069\u006eg\u0020\u0053\u0069\u006d\u0070l\u0065L\u0069t\u0065\u0072\u0061\u006c\u003a\u0020\u0025s",_db );};if _agf ,_aea :=_egf .(_a .EndElement );_aea &&_agf .Name ==start .Name {break ;};};return nil ;};func NewAny ()*Any {_gf :=&Any {};_gf .SimpleLiteral =*NewSimpleLiteral ();return _gf };func (_ac *ElementsGroup )MarshalXML (e *_a .Encoder ,start _a .StartElement )error {if _ac .Choice !=nil {for _ ,_fc :=range _ac .Choice {_fc .MarshalXML (e ,_a .StartElement {});};};return nil ;};
|
||||
|
||||
// ValidateWithPath validates the SimpleLiteral and its children, prefixing error messages with path
|
||||
func (_ec *SimpleLiteral )ValidateWithPath (path string )error {return nil };func (_gfg *ElementContainer )MarshalXML (e *_a .Encoder ,start _a .StartElement )error {start .Name .Local ="\u0065\u006ce\u006d\u0065\u006et\u0043\u006f\u006e\u0074\u0061\u0069\u006e\u0065\u0072";e .EncodeToken (start );if _gfg .Choice !=nil {for _ ,_cd :=range _gfg .Choice {_cd .MarshalXML (e ,_a .StartElement {});};};e .EncodeToken (_a .EndElement {Name :start .Name });return nil ;};
|
||||
|
||||
// Validate validates the ElementContainer and its children
|
||||
func (_fd *ElementContainer )Validate ()error {return _fd .ValidateWithPath ("\u0045\u006ce\u006d\u0065\u006et\u0043\u006f\u006e\u0074\u0061\u0069\u006e\u0065\u0072");};func (_ccd *ElementsGroup )UnmarshalXML (d *_a .Decoder ,start _a .StartElement )error {_fec :for {_dcd ,_cde :=d .Token ();if _cde !=nil {return _cde ;};switch _gfc :=_dcd .(type ){case _a .StartElement :switch _gfc .Name {case _a .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"}:_fg :=NewElementsGroupChoice ();if _dcf :=d .DecodeElement (&_fg .Any ,&_gfc );_dcf !=nil {return _dcf ;};_ccd .Choice =append (_ccd .Choice ,_fg );default:_gd .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",_gfc .Name );if _dec :=d .Skip ();_dec !=nil {return _dec ;};};case _a .EndElement :break _fec ;case _a .CharData :};};return nil ;};type Any struct{SimpleLiteral };func NewElementContainer ()*ElementContainer {_ea :=&ElementContainer {};return _ea };type SimpleLiteral struct{};func (_efa *ElementsGroupChoice )UnmarshalXML (d *_a .Decoder ,start _a .StartElement )error {_afa :for {_da ,_ca :=d .Token ();if _ca !=nil {return _ca ;};switch _gcc :=_da .(type ){case _a .StartElement :switch _gcc .Name {case _a .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"}:_dea :=NewAny ();if _bff :=d .DecodeElement (_dea ,&_gcc );_bff !=nil {return _bff ;};_efa .Any =append (_efa .Any ,_dea );default:_gd .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",_gcc .Name );if _gec :=d .Skip ();_gec !=nil {return _gec ;};};case _a .EndElement :break _afa ;case _a .CharData :};};return nil ;};func init (){_d .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 );_d .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 );_d .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 );_d .RegisterConstructor ("\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0072\u0067/\u0064c\u002f\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u002f\u0031\u002e\u0031\u002f","\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u0047\u0072\u006f\u0075\u0070",NewElementsGroup );};
|
@ -9,124 +9,124 @@
|
||||
// Use of this source code is governed by the UniDoc End User License Agreement
|
||||
// terms that can be accessed at https://unidoc.io/eula/
|
||||
|
||||
package terms ;import (_f "encoding/xml";_e "fmt";_c "github.com/unidoc/unioffice";_d "github.com/unidoc/unioffice/common/logger";_fe "github.com/unidoc/unioffice/schema/purl.org/dc/elements";);type ISO3166 struct{};func (_eg *DCMIType )UnmarshalXML (d *_f .Decoder ,start _f .StartElement )error {for {_gea ,_fad :=d .Token ();if _fad !=nil {return _e .Errorf ("p\u0061r\u0073\u0069\u006e\u0067\u0020\u0044\u0043\u004dI\u0054\u0079\u0070\u0065: \u0025\u0073",_fad );};if _fae ,_af :=_gea .(_f .EndElement );_af &&_fae .Name ==start .Name {break ;};};return nil ;};func NewPeriod ()*Period {_efe :=&Period {};return _efe };
|
||||
|
||||
// ValidateWithPath validates the DCMIType and its children, prefixing error messages with path
|
||||
func (_ca *DCMIType )ValidateWithPath (path string )error {return nil };
|
||||
|
||||
// Validate validates the Period and its children
|
||||
func (_dbc *Period )Validate ()error {return _dbc .ValidateWithPath ("\u0050\u0065\u0072\u0069\u006f\u0064");};
|
||||
|
||||
// Validate validates the Box and its children
|
||||
func (_ecc *Box )Validate ()error {return _ecc .ValidateWithPath ("\u0042\u006f\u0078")};type Point struct{};func (_dbce *Point )MarshalXML (e *_f .Encoder ,start _f .StartElement )error {start .Name .Local ="\u0050\u006f\u0069n\u0074";e .EncodeToken (start );e .EncodeToken (_f .EndElement {Name :start .Name });return nil ;};func NewPoint ()*Point {_fc :=&Point {};return _fc };func NewIMT ()*IMT {_cgc :=&IMT {};return _cgc };func NewDDC ()*DDC {_bg :=&DDC {};return _bg };func (_bb *DDC )MarshalXML (e *_f .Encoder ,start _f .StartElement )error {start .Name .Local ="\u0044\u0044\u0043";e .EncodeToken (start );e .EncodeToken (_f .EndElement {Name :start .Name });return nil ;};func NewUDC ()*UDC {_bac :=&UDC {};return _bac };
|
||||
|
||||
// Validate validates the ElementsAndRefinementsGroup and its children
|
||||
func (_gec *ElementsAndRefinementsGroup )Validate ()error {return _gec .ValidateWithPath ("E\u006c\u0065\u006d\u0065\u006e\u0074s\u0041\u006e\u0064\u0052\u0065\u0066\u0069\u006e\u0065m\u0065\u006e\u0074s\u0047r\u006f\u0075\u0070");};
|
||||
|
||||
// ValidateWithPath validates the MESH and its children, prefixing error messages with path
|
||||
func (_fg *MESH )ValidateWithPath (path string )error {return nil };func (_ge *Box )MarshalXML (e *_f .Encoder ,start _f .StartElement )error {start .Name .Local ="\u0042\u006f\u0078";e .EncodeToken (start );e .EncodeToken (_f .EndElement {Name :start .Name });return nil ;};func NewISO3166 ()*ISO3166 {_gac :=&ISO3166 {};return _gac };type URI struct{};func (_dea *LCSH )MarshalXML (e *_f .Encoder ,start _f .StartElement )error {start .Name .Local ="\u004c\u0043\u0053\u0048";e .EncodeToken (start );e .EncodeToken (_f .EndElement {Name :start .Name });return nil ;};
|
||||
|
||||
// Validate validates the RFC1766 and its children
|
||||
func (_bca *RFC1766 )Validate ()error {return _bca .ValidateWithPath ("\u0052F\u0043\u0031\u0037\u0036\u0036");};type ISO639_2 struct{};func (_cc *ElementOrRefinementContainer )MarshalXML (e *_f .Encoder ,start _f .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 _cc .Choice !=nil {for _ ,_ed :=range _cc .Choice {_ed .MarshalXML (e ,_f .StartElement {});};};e .EncodeToken (_f .EndElement {Name :start .Name });return nil ;};func NewTGN ()*TGN {_daf :=&TGN {};return _daf };
|
||||
|
||||
// ValidateWithPath validates the DDC and its children, prefixing error messages with path
|
||||
func (_dga *DDC )ValidateWithPath (path string )error {return nil };type RFC1766 struct{};type RFC3066 struct{};
|
||||
|
||||
// Validate validates the MESH and its children
|
||||
func (_gbg *MESH )Validate ()error {return _gbg .ValidateWithPath ("\u004d\u0045\u0053\u0048")};func (_gadb *Period )UnmarshalXML (d *_f .Decoder ,start _f .StartElement )error {for {_gcgc ,_ege :=d .Token ();if _ege !=nil {return _e .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0050e\u0072\u0069o\u0064\u003a\u0020\u0025\u0073",_ege );};if _dcd ,_gbc :=_gcgc .(_f .EndElement );_gbc &&_dcd .Name ==start .Name {break ;};};return nil ;};type LCC struct{};
|
||||
|
||||
// ValidateWithPath validates the TGN and its children, prefixing error messages with path
|
||||
func (_caf *TGN )ValidateWithPath (path string )error {return nil };func (_gecge *LCC )UnmarshalXML (d *_f .Decoder ,start _f .StartElement )error {for {_dde ,_bf :=d .Token ();if _bf !=nil {return _e .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u004c\u0043\u0043\u003a\u0020\u0025\u0073",_bf );};if _fef ,_bfe :=_dde .(_f .EndElement );_bfe &&_fef .Name ==start .Name {break ;};};return nil ;};func (_gbge *Period )MarshalXML (e *_f .Encoder ,start _f .StartElement )error {start .Name .Local ="\u0050\u0065\u0072\u0069\u006f\u0064";e .EncodeToken (start );e .EncodeToken (_f .EndElement {Name :start .Name });return nil ;};func NewRFC3066 ()*RFC3066 {_agaa :=&RFC3066 {};return _agaa };func (_dfc *TGN )UnmarshalXML (d *_f .Decoder ,start _f .StartElement )error {for {_bce ,_fac :=d .Token ();if _fac !=nil {return _e .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0054\u0047\u004e\u003a\u0020\u0025\u0073",_fac );};if _facb ,_aagg :=_bce .(_f .EndElement );_aagg &&_facb .Name ==start .Name {break ;};};return nil ;};type ElementsAndRefinementsGroup struct{Choice []*ElementsAndRefinementsGroupChoice ;};func (_cggb *UDC )MarshalXML (e *_f .Encoder ,start _f .StartElement )error {start .Name .Local ="\u0055\u0044\u0043";e .EncodeToken (start );e .EncodeToken (_f .EndElement {Name :start .Name });return nil ;};func (_bbg *RFC1766 )MarshalXML (e *_f .Encoder ,start _f .StartElement )error {start .Name .Local ="\u0052F\u0043\u0031\u0037\u0036\u0036";e .EncodeToken (start );e .EncodeToken (_f .EndElement {Name :start .Name });return nil ;};
|
||||
|
||||
// ValidateWithPath validates the RFC1766 and its children, prefixing error messages with path
|
||||
func (_bdg *RFC1766 )ValidateWithPath (path string )error {return nil };
|
||||
package terms ;import (_g "encoding/xml";_e "fmt";_b "github.com/unidoc/unioffice";_gf "github.com/unidoc/unioffice/common/logger";_ge "github.com/unidoc/unioffice/schema/purl.org/dc/elements";);func (_cgge *W3CDTF )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0057\u0033\u0043\u0044\u0054\u0046";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};
|
||||
|
||||
// ValidateWithPath validates the ElementsAndRefinementsGroupChoice and its children, prefixing error messages with path
|
||||
func (_cgg *ElementsAndRefinementsGroupChoice )ValidateWithPath (path string )error {for _fbd ,_ccdg :=range _cgg .Any {if _bde :=_ccdg .ValidateWithPath (_e .Sprintf ("\u0025\u0073\u002f\u0041\u006e\u0079\u005b\u0025\u0064\u005d",path ,_fbd ));_bde !=nil {return _bde ;};};return nil ;};func (_cccc *ISO639_2 )UnmarshalXML (d *_f .Decoder ,start _f .StartElement )error {for {_faa ,_cae :=d .Token ();if _cae !=nil {return _e .Errorf ("p\u0061r\u0073\u0069\u006e\u0067\u0020\u0049\u0053\u004f6\u0033\u0039\u005f\u0032: \u0025\u0073",_cae );};if _adf ,_bcc :=_faa .(_f .EndElement );_bcc &&_adf .Name ==start .Name {break ;};};return nil ;};func (_a *DCMIType )MarshalXML (e *_f .Encoder ,start _f .StartElement )error {start .Name .Local ="\u0044\u0043\u004d\u0049\u0054\u0079\u0070\u0065";e .EncodeToken (start );e .EncodeToken (_f .EndElement {Name :start .Name });return nil ;};func (_bddf *URI )MarshalXML (e *_f .Encoder ,start _f .StartElement )error {start .Name .Local ="\u0055\u0052\u0049";e .EncodeToken (start );e .EncodeToken (_f .EndElement {Name :start .Name });return nil ;};func (_bc *DDC )UnmarshalXML (d *_f .Decoder ,start _f .StartElement )error {for {_ae ,_gc :=d .Token ();if _gc !=nil {return _e .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0044\u0044\u0043\u003a\u0020\u0025\u0073",_gc );};if _dd ,_ab :=_ae .(_f .EndElement );_ab &&_dd .Name ==start .Name {break ;};};return nil ;};func NewURI ()*URI {_dec :=&URI {};return _dec };
|
||||
|
||||
// Validate validates the W3CDTF and its children
|
||||
func (_dgc *W3CDTF )Validate ()error {return _dgc .ValidateWithPath ("\u0057\u0033\u0043\u0044\u0054\u0046");};func (_bgd *W3CDTF )MarshalXML (e *_f .Encoder ,start _f .StartElement )error {start .Name .Local ="\u0057\u0033\u0043\u0044\u0054\u0046";e .EncodeToken (start );e .EncodeToken (_f .EndElement {Name :start .Name });return nil ;};type LCSH struct{};func (_gecb *LCSH )UnmarshalXML (d *_f .Decoder ,start _f .StartElement )error {for {_ea ,_aa :=d .Token ();if _aa !=nil {return _e .Errorf ("\u0070\u0061r\u0073\u0069\u006eg\u0020\u004c\u0043\u0053\u0048\u003a\u0020\u0025\u0073",_aa );};if _fba ,_baf :=_ea .(_f .EndElement );_baf &&_fba .Name ==start .Name {break ;};};return nil ;};
|
||||
|
||||
// ValidateWithPath validates the Box and its children, prefixing error messages with path
|
||||
func (_ba *Box )ValidateWithPath (path string )error {return nil };
|
||||
|
||||
// ValidateWithPath validates the ISO3166 and its children, prefixing error messages with path
|
||||
func (_aed *ISO3166 )ValidateWithPath (path string )error {return nil };type ElementOrRefinementContainer struct{Choice []*ElementsAndRefinementsGroupChoice ;};
|
||||
|
||||
// ValidateWithPath validates the RFC3066 and its children, prefixing error messages with path
|
||||
func (_fgfd *RFC3066 )ValidateWithPath (path string )error {return nil };func (_gbe *RFC3066 )UnmarshalXML (d *_f .Decoder ,start _f .StartElement )error {for {_cbg ,_ffd :=d .Token ();if _ffd !=nil {return _e .Errorf ("\u0070\u0061\u0072\u0073in\u0067\u0020\u0052\u0046\u0043\u0033\u0030\u0036\u0036\u003a\u0020\u0025\u0073",_ffd );};if _gdg ,_fec :=_cbg .(_f .EndElement );_fec &&_gdg .Name ==start .Name {break ;};};return nil ;};type ElementsAndRefinementsGroupChoice struct{Any []*_fe .Any ;};func (_cga *ISO3166 )UnmarshalXML (d *_f .Decoder ,start _f .StartElement )error {for {_gcg ,_cb :=d .Token ();if _cb !=nil {return _e .Errorf ("\u0070\u0061\u0072\u0073in\u0067\u0020\u0049\u0053\u004f\u0033\u0031\u0036\u0036\u003a\u0020\u0025\u0073",_cb );};if _bda ,_ecb :=_gcg .(_f .EndElement );_ecb &&_bda .Name ==start .Name {break ;};};return nil ;};func NewLCC ()*LCC {_cfa :=&LCC {};return _cfa };func NewISO639_2 ()*ISO639_2 {_cbd :=&ISO639_2 {};return _cbd };func (_agc *IMT )MarshalXML (e *_f .Encoder ,start _f .StartElement )error {start .Name .Local ="\u0049\u004d\u0054";e .EncodeToken (start );e .EncodeToken (_f .EndElement {Name :start .Name });return nil ;};
|
||||
|
||||
// Validate validates the IMT and its children
|
||||
func (_fbg *IMT )Validate ()error {return _fbg .ValidateWithPath ("\u0049\u004d\u0054")};
|
||||
|
||||
// Validate validates the ElementOrRefinementContainer and its children
|
||||
func (_afg *ElementOrRefinementContainer )Validate ()error {return _afg .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 NewBox ()*Box {_g :=&Box {};return _g };func (_ccc *ISO639_2 )MarshalXML (e *_f .Encoder ,start _f .StartElement )error {start .Name .Local ="\u0049\u0053\u004f\u0036\u0033\u0039\u002d\u0032";e .EncodeToken (start );e .EncodeToken (_f .EndElement {Name :start .Name });return nil ;};func NewElementOrRefinementContainer ()*ElementOrRefinementContainer {_dc :=&ElementOrRefinementContainer {};return _dc ;};
|
||||
|
||||
// Validate validates the ElementsAndRefinementsGroupChoice and its children
|
||||
func (_cge *ElementsAndRefinementsGroupChoice )Validate ()error {return _cge .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");};
|
||||
|
||||
// ValidateWithPath validates the LCSH and its children, prefixing error messages with path
|
||||
func (_cbe *LCSH )ValidateWithPath (path string )error {return nil };
|
||||
|
||||
// Validate validates the DCMIType and its children
|
||||
func (_eb *DCMIType )Validate ()error {return _eb .ValidateWithPath ("\u0044\u0043\u004d\u0049\u0054\u0079\u0070\u0065");};
|
||||
|
||||
// ValidateWithPath validates the ElementsAndRefinementsGroup and its children, prefixing error messages with path
|
||||
func (_cd *ElementsAndRefinementsGroup )ValidateWithPath (path string )error {for _abf ,_ee :=range _cd .Choice {if _daa :=_ee .ValidateWithPath (_e .Sprintf ("\u0025\u0073\u002f\u0043\u0068\u006f\u0069\u0063\u0065\u005b\u0025\u0064\u005d",path ,_abf ));_daa !=nil {return _daa ;};};return nil ;};func (_bdc *MESH )MarshalXML (e *_f .Encoder ,start _f .StartElement )error {start .Name .Local ="\u004d\u0045\u0053\u0048";e .EncodeToken (start );e .EncodeToken (_f .EndElement {Name :start .Name });return nil ;};func (_adbc *ElementsAndRefinementsGroup )UnmarshalXML (d *_f .Decoder ,start _f .StartElement )error {_ag :for {_bcb ,_bcd :=d .Token ();if _bcd !=nil {return _bcd ;};switch _fdf :=_bcb .(type ){case _f .StartElement :switch _fdf .Name {case _f .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"}:_bcf :=NewElementsAndRefinementsGroupChoice ();if _gf :=d .DecodeElement (&_bcf .Any ,&_fdf );_gf !=nil {return _gf ;};_adbc .Choice =append (_adbc .Choice ,_bcf );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",_fdf .Name );if _bcdc :=d .Skip ();_bcdc !=nil {return _bcdc ;};};case _f .EndElement :break _ag ;case _f .CharData :};};return nil ;};type IMT struct{};
|
||||
|
||||
// Validate validates the ISO639_2 and its children
|
||||
func (_bag *ISO639_2 )Validate ()error {return _bag .ValidateWithPath ("\u0049\u0053\u004f\u0036\u0033\u0039\u005f\u0032");};func (_aag *MESH )UnmarshalXML (d *_f .Decoder ,start _f .StartElement )error {for {_gdf ,_cgb :=d .Token ();if _cgb !=nil {return _e .Errorf ("\u0070\u0061r\u0073\u0069\u006eg\u0020\u004d\u0045\u0053\u0048\u003a\u0020\u0025\u0073",_cgb );};if _gb ,_abe :=_gdf .(_f .EndElement );_abe &&_gb .Name ==start .Name {break ;};};return nil ;};
|
||||
|
||||
// Validate validates the URI and its children
|
||||
func (_dff *URI )Validate ()error {return _dff .ValidateWithPath ("\u0055\u0052\u0049")};
|
||||
|
||||
// Validate validates the UDC and its children
|
||||
func (_fdc *UDC )Validate ()error {return _fdc .ValidateWithPath ("\u0055\u0044\u0043")};
|
||||
|
||||
// Validate validates the DDC and its children
|
||||
func (_ac *DDC )Validate ()error {return _ac .ValidateWithPath ("\u0044\u0044\u0043")};type DDC struct{};func NewDCMIType ()*DCMIType {_fa :=&DCMIType {};return _fa };type Box struct{};func NewLCSH ()*LCSH {_abc :=&LCSH {};return _abc };func (_bcg *RFC3066 )MarshalXML (e *_f .Encoder ,start _f .StartElement )error {start .Name .Local ="\u0052F\u0043\u0033\u0030\u0036\u0036";e .EncodeToken (start );e .EncodeToken (_f .EndElement {Name :start .Name });return nil ;};func (_dcg *URI )UnmarshalXML (d *_f .Decoder ,start _f .StartElement )error {for {_gfc ,_eed :=d .Token ();if _eed !=nil {return _e .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0055\u0052\u0049\u003a\u0020\u0025\u0073",_eed );};if _bdf ,_afd :=_gfc .(_f .EndElement );_afd &&_bdf .Name ==start .Name {break ;};};return nil ;};type DCMIType struct{};func (_ga *Box )UnmarshalXML (d *_f .Decoder ,start _f .StartElement )error {for {_dg ,_ec :=d .Token ();if _ec !=nil {return _e .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0042\u006f\u0078\u003a\u0020\u0025\u0073",_ec );};if _gg ,_da :=_dg .(_f .EndElement );_da &&_gg .Name ==start .Name {break ;};};return nil ;};func (_eec *ISO3166 )MarshalXML (e *_f .Encoder ,start _f .StartElement )error {start .Name .Local ="\u0049S\u004f\u0033\u0031\u0036\u0036";e .EncodeToken (start );e .EncodeToken (_f .EndElement {Name :start .Name });return nil ;};
|
||||
|
||||
// ValidateWithPath validates the Period and its children, prefixing error messages with path
|
||||
func (_aeb *Period )ValidateWithPath (path string )error {return nil };
|
||||
|
||||
// ValidateWithPath validates the UDC and its children, prefixing error messages with path
|
||||
func (_bdd *UDC )ValidateWithPath (path string )error {return nil };
|
||||
|
||||
// ValidateWithPath validates the Point and its children, prefixing error messages with path
|
||||
func (_ebe *Point )ValidateWithPath (path string )error {return nil };func (_ffg *W3CDTF )UnmarshalXML (d *_f .Decoder ,start _f .StartElement )error {for {_bfa ,_fcd :=d .Token ();if _fcd !=nil {return _e .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u00573\u0043\u0044T\u0046\u003a\u0020\u0025\u0073",_fcd );};if _aedg ,_fbf :=_bfa .(_f .EndElement );_fbf &&_aedg .Name ==start .Name {break ;};};return nil ;};type UDC struct{};func (_edb *ElementsAndRefinementsGroup )MarshalXML (e *_f .Encoder ,start _f .StartElement )error {if _edb .Choice !=nil {for _ ,_adb :=range _edb .Choice {_adb .MarshalXML (e ,_f .StartElement {});};};return nil ;};type MESH struct{};func (_ff *ElementOrRefinementContainer )UnmarshalXML (d *_f .Decoder ,start _f .StartElement )error {_bd :for {_egf ,_gd :=d .Token ();if _gd !=nil {return _gd ;};switch _cg :=_egf .(type ){case _f .StartElement :switch _cg .Name {case _f .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"}:_ce :=NewElementsAndRefinementsGroupChoice ();if _gcc :=d .DecodeElement (&_ce .Any ,&_cg );_gcc !=nil {return _gcc ;};_ff .Choice =append (_ff .Choice ,_ce );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",_cg .Name );if _ad :=d .Skip ();_ad !=nil {return _ad ;};};case _f .EndElement :break _bd ;case _f .CharData :};};return nil ;};type W3CDTF struct{};func (_bgc *ElementsAndRefinementsGroupChoice )MarshalXML (e *_f .Encoder ,start _f .StartElement )error {if _bgc .Any !=nil {_ef :=_f .StartElement {Name :_f .Name {Local :"\u0064\u0063\u003a\u0061\u006e\u0079"}};for _ ,_feb :=range _bgc .Any {e .EncodeElement (_feb ,_ef );};};return nil ;};func NewW3CDTF ()*W3CDTF {_egd :=&W3CDTF {};return _egd };
|
||||
|
||||
// Validate validates the TGN and its children
|
||||
func (_eac *TGN )Validate ()error {return _eac .ValidateWithPath ("\u0054\u0047\u004e")};
|
||||
func (_aga *ElementsAndRefinementsGroupChoice )ValidateWithPath (path string )error {for _egfd ,_dge :=range _aga .Any {if _cc :=_dge .ValidateWithPath (_e .Sprintf ("\u0025\u0073\u002f\u0041\u006e\u0079\u005b\u0025\u0064\u005d",path ,_egfd ));_cc !=nil {return _cc ;};};return nil ;};type TGN struct{};func (_fa *Period )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_dff ,_dba :=d .Token ();if _dba !=nil {return _e .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0050e\u0072\u0069o\u0064\u003a\u0020\u0025\u0073",_dba );};if _bbc ,_gee :=_dff .(_g .EndElement );_gee &&_bbc .Name ==start .Name {break ;};};return nil ;};type RFC3066 struct{};
|
||||
|
||||
// ValidateWithPath validates the IMT and its children, prefixing error messages with path
|
||||
func (_ced *IMT )ValidateWithPath (path string )error {return nil };
|
||||
|
||||
// ValidateWithPath validates the LCC and its children, prefixing error messages with path
|
||||
func (_egc *LCC )ValidateWithPath (path string )error {return nil };func NewMESH ()*MESH {_cba :=&MESH {};return _cba };func (_gcb *ElementsAndRefinementsGroupChoice )UnmarshalXML (d *_f .Decoder ,start _f .StartElement )error {_gecg :for {_fb ,_gae :=d .Token ();if _gae !=nil {return _gae ;};switch _ccd :=_fb .(type ){case _f .StartElement :switch _ccd .Name {case _f .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 :=_fe .NewAny ();if _df :=d .DecodeElement (_bgb ,&_ccd );_df !=nil {return _df ;};_gcb .Any =append (_gcb .Any ,_bgb );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",_ccd .Name );if _aga :=d .Skip ();_aga !=nil {return _aga ;};};case _f .EndElement :break _gecg ;case _f .CharData :};};return nil ;};
|
||||
|
||||
// Validate validates the Point and its children
|
||||
func (_cfe *Point )Validate ()error {return _cfe .ValidateWithPath ("\u0050\u006f\u0069n\u0074")};
|
||||
func (_bacd *IMT )ValidateWithPath (path string )error {return nil };func NewISO3166 ()*ISO3166 {_bgf :=&ISO3166 {};return _bgf };
|
||||
|
||||
// ValidateWithPath validates the ISO639_2 and its children, prefixing error messages with path
|
||||
func (_fdd *ISO639_2 )ValidateWithPath (path string )error {return nil };
|
||||
func (_cfe *ISO639_2 )ValidateWithPath (path string )error {return nil };
|
||||
|
||||
// Validate validates the RFC3066 and its children
|
||||
func (_bfd *RFC3066 )Validate ()error {return _bfd .ValidateWithPath ("\u0052F\u0043\u0033\u0030\u0036\u0036");};type TGN struct{};func NewElementsAndRefinementsGroupChoice ()*ElementsAndRefinementsGroupChoice {_acc :=&ElementsAndRefinementsGroupChoice {};return _acc ;};
|
||||
// Validate validates the MESH and its children
|
||||
func (_bb *MESH )Validate ()error {return _bb .ValidateWithPath ("\u004d\u0045\u0053\u0048")};type LCC struct{};func NewIMT ()*IMT {_dbc :=&IMT {};return _dbc };func NewElementsAndRefinementsGroup ()*ElementsAndRefinementsGroup {_gfa :=&ElementsAndRefinementsGroup {};return _gfa ;};func (_bca *LCSH )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u004c\u0043\u0053\u0048";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};type URI struct{};func NewISO639_2 ()*ISO639_2 {_cgf :=&ISO639_2 {};return _cgf };type ElementOrRefinementContainer struct{Choice []*ElementsAndRefinementsGroupChoice ;};func (_dfgf *TGN )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0054\u0047\u004e";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};
|
||||
|
||||
// ValidateWithPath validates the URI and its children, prefixing error messages with path
|
||||
func (_fbdf *URI )ValidateWithPath (path string )error {return nil };
|
||||
|
||||
// Validate validates the LCC and its children
|
||||
func (_ebc *LCC )Validate ()error {return _ebc .ValidateWithPath ("\u004c\u0043\u0043")};func (_eea *IMT )UnmarshalXML (d *_f .Decoder ,start _f .StartElement )error {for {_gad ,_bbe :=d .Token ();if _bbe !=nil {return _e .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0049\u004d\u0054\u003a\u0020\u0025\u0073",_bbe );};if _ada ,_efc :=_gad .(_f .EndElement );_efc &&_ada .Name ==start .Name {break ;};};return nil ;};
|
||||
|
||||
// ValidateWithPath validates the ElementOrRefinementContainer and its children, prefixing error messages with path
|
||||
func (_de *ElementOrRefinementContainer )ValidateWithPath (path string )error {for _cf ,_bad :=range _de .Choice {if _egb :=_bad .ValidateWithPath (_e .Sprintf ("\u0025\u0073\u002f\u0043\u0068\u006f\u0069\u0063\u0065\u005b\u0025\u0064\u005d",path ,_cf ));_egb !=nil {return _egb ;};};return nil ;};func (_db *LCC )MarshalXML (e *_f .Encoder ,start _f .StartElement )error {start .Name .Local ="\u004c\u0043\u0043";e .EncodeToken (start );e .EncodeToken (_f .EndElement {Name :start .Name });return nil ;};func NewElementsAndRefinementsGroup ()*ElementsAndRefinementsGroup {_dac :=&ElementsAndRefinementsGroup {};return _dac ;};
|
||||
|
||||
// ValidateWithPath validates the W3CDTF and its children, prefixing error messages with path
|
||||
func (_be *W3CDTF )ValidateWithPath (path string )error {return nil };func (_gbgb *Point )UnmarshalXML (d *_f .Decoder ,start _f .StartElement )error {for {_ggg ,_fcf :=d .Token ();if _fcf !=nil {return _e .Errorf ("\u0070\u0061\u0072\u0073\u0069\u006e\u0067\u0020\u0050\u006f\u0069\u006et\u003a\u0020\u0025\u0073",_fcf );};if _cag ,_cfaa :=_ggg .(_f .EndElement );_cfaa &&_cag .Name ==start .Name {break ;};};return nil ;};func NewRFC1766 ()*RFC1766 {_fade :=&RFC1766 {};return _fade };
|
||||
// Validate validates the Point and its children
|
||||
func (_ced *Point )Validate ()error {return _ced .ValidateWithPath ("\u0050\u006f\u0069n\u0074")};
|
||||
|
||||
// Validate validates the ISO3166 and its children
|
||||
func (_aef *ISO3166 )Validate ()error {return _aef .ValidateWithPath ("\u0049S\u004f\u0033\u0031\u0036\u0036");};
|
||||
func (_afc *ISO3166 )Validate ()error {return _afc .ValidateWithPath ("\u0049S\u004f\u0033\u0031\u0036\u0036");};func (_fba *Period )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0050\u0065\u0072\u0069\u006f\u0064";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};func (_beg *Point )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_gfdb ,_ebb :=d .Token ();if _ebb !=nil {return _e .Errorf ("\u0070\u0061\u0072\u0073\u0069\u006e\u0067\u0020\u0050\u006f\u0069\u006et\u003a\u0020\u0025\u0073",_ebb );};if _aec ,_cbc :=_gfdb .(_g .EndElement );_cbc &&_aec .Name ==start .Name {break ;};};return nil ;};
|
||||
|
||||
// ValidateWithPath validates the DCMIType and its children, prefixing error messages with path
|
||||
func (_eee *DCMIType )ValidateWithPath (path string )error {return nil };func (_cdf *Point )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0050\u006f\u0069n\u0074";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};
|
||||
|
||||
// ValidateWithPath validates the URI and its children, prefixing error messages with path
|
||||
func (_aefd *URI )ValidateWithPath (path string )error {return nil };
|
||||
|
||||
// Validate validates the ISO639_2 and its children
|
||||
func (_de *ISO639_2 )Validate ()error {return _de .ValidateWithPath ("\u0049\u0053\u004f\u0036\u0033\u0039\u005f\u0032");};
|
||||
|
||||
// Validate validates the RFC3066 and its children
|
||||
func (_gcea *RFC3066 )Validate ()error {return _gcea .ValidateWithPath ("\u0052F\u0043\u0033\u0030\u0036\u0036");};func NewPoint ()*Point {_cd :=&Point {};return _cd };func NewW3CDTF ()*W3CDTF {_bfg :=&W3CDTF {};return _bfg };func (_fg *ElementsAndRefinementsGroup )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {if _fg .Choice !=nil {for _ ,_cea :=range _fg .Choice {_cea .MarshalXML (e ,_g .StartElement {});};};return nil ;};
|
||||
|
||||
// Validate validates the ElementsAndRefinementsGroupChoice and its children
|
||||
func (_eab *ElementsAndRefinementsGroupChoice )Validate ()error {return _eab .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 (_fb *ElementOrRefinementContainer )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {_gbg :for {_aaf ,_eag :=d .Token ();if _eag !=nil {return _eag ;};switch _cbd :=_aaf .(type ){case _g .StartElement :switch _cbd .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"}:_bg :=NewElementsAndRefinementsGroupChoice ();if _be :=d .DecodeElement (&_bg .Any ,&_cbd );_be !=nil {return _be ;};_fb .Choice =append (_fb .Choice ,_bg );default:_gf .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",_cbd .Name );if _gea :=d .Skip ();_gea !=nil {return _gea ;};};case _g .EndElement :break _gbg ;case _g .CharData :};};return nil ;};func (_edd *DCMIType )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0044\u0043\u004d\u0049\u0054\u0079\u0070\u0065";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};type Period struct{};type ElementsAndRefinementsGroup struct{Choice []*ElementsAndRefinementsGroupChoice ;};
|
||||
|
||||
// Validate validates the URI and its children
|
||||
func (_ggd *URI )Validate ()error {return _ggd .ValidateWithPath ("\u0055\u0052\u0049")};
|
||||
|
||||
// ValidateWithPath validates the W3CDTF and its children, prefixing error messages with path
|
||||
func (_eaca *W3CDTF )ValidateWithPath (path string )error {return nil };func (_ad *ISO639_2 )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_cfb ,_ab :=d .Token ();if _ab !=nil {return _e .Errorf ("p\u0061r\u0073\u0069\u006e\u0067\u0020\u0049\u0053\u004f6\u0033\u0039\u005f\u0032: \u0025\u0073",_ab );};if _acd ,_ceb :=_cfb .(_g .EndElement );_ceb &&_acd .Name ==start .Name {break ;};};return nil ;};func (_ee *DCMIType )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_ca ,_ec :=d .Token ();if _ec !=nil {return _e .Errorf ("p\u0061r\u0073\u0069\u006e\u0067\u0020\u0044\u0043\u004dI\u0054\u0079\u0070\u0065: \u0025\u0073",_ec );};if _ea ,_egf :=_ca .(_g .EndElement );_egf &&_ea .Name ==start .Name {break ;};};return nil ;};func (_aaaaf *URI )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_fgg ,_fbb :=d .Token ();if _fbb !=nil {return _e .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0055\u0052\u0049\u003a\u0020\u0025\u0073",_fbb );};if _edad ,_baf :=_fgg .(_g .EndElement );_baf &&_edad .Name ==start .Name {break ;};};return nil ;};type W3CDTF struct{};func NewElementOrRefinementContainer ()*ElementOrRefinementContainer {_fd :=&ElementOrRefinementContainer {};return _fd ;};type LCSH struct{};
|
||||
|
||||
// Validate validates the DCMIType and its children
|
||||
func (_gbb *DCMIType )Validate ()error {return _gbb .ValidateWithPath ("\u0044\u0043\u004d\u0049\u0054\u0079\u0070\u0065");};type DDC struct{};
|
||||
|
||||
// Validate validates the RFC1766 and its children
|
||||
func (_gaa *RFC1766 )Validate ()error {return _gaa .ValidateWithPath ("\u0052F\u0043\u0031\u0037\u0036\u0036");};func (_gbgb *RFC1766 )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_dbb ,_gdc :=d .Token ();if _gdc !=nil {return _e .Errorf ("\u0070\u0061\u0072\u0073in\u0067\u0020\u0052\u0046\u0043\u0031\u0037\u0036\u0036\u003a\u0020\u0025\u0073",_gdc );};if _aef ,_fbe :=_dbb .(_g .EndElement );_fbe &&_aef .Name ==start .Name {break ;};};return nil ;};
|
||||
|
||||
// Validate validates the DDC and its children
|
||||
func (_fe *DDC )Validate ()error {return _fe .ValidateWithPath ("\u0044\u0044\u0043")};func (_aafe *TGN )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_fcad ,_dgg :=d .Token ();if _dgg !=nil {return _e .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0054\u0047\u004e\u003a\u0020\u0025\u0073",_dgg );};if _gfdf ,_bdd :=_fcad .(_g .EndElement );_bdd &&_gfdf .Name ==start .Name {break ;};};return nil ;};func NewMESH ()*MESH {_ggc :=&MESH {};return _ggc };
|
||||
|
||||
// Validate validates the IMT and its children
|
||||
func (_edg *IMT )Validate ()error {return _edg .ValidateWithPath ("\u0049\u004d\u0054")};func (_fca *ISO3166 )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0049S\u004f\u0033\u0031\u0036\u0036";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};type ISO639_2 struct{};type RFC1766 struct{};
|
||||
|
||||
// ValidateWithPath validates the LCC and its children, prefixing error messages with path
|
||||
func (_fda *LCC )ValidateWithPath (path string )error {return nil };func (_ce *Box )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_ga ,_ed :=d .Token ();if _ed !=nil {return _e .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0042\u006f\u0078\u003a\u0020\u0025\u0073",_ed );};if _eg ,_eda :=_ga .(_g .EndElement );_eda &&_eg .Name ==start .Name {break ;};};return nil ;};func (_dgfa *ElementsAndRefinementsGroupChoice )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {_ac :for {_baa ,_bgg :=d .Token ();if _bgg !=nil {return _bgg ;};switch _bd :=_baa .(type ){case _g .StartElement :switch _bd .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"}:_gfb :=_ge .NewAny ();if _gag :=d .DecodeElement (_gfb ,&_bd );_gag !=nil {return _gag ;};_dgfa .Any =append (_dgfa .Any ,_gfb );default:_gf .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",_bd .Name );if _df :=d .Skip ();_df !=nil {return _df ;};};case _g .EndElement :break _ac ;case _g .CharData :};};return nil ;};func (_dg *ElementOrRefinementContainer )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0065\u006c\u0065\u006de\u006e\u0074\u004f\u0072\u0052\u0065\u0066\u0069\u006e\u0065m\u0065n\u0074\u0043\u006f\u006e\u0074\u0061\u0069n\u0065\u0072";e .EncodeToken (start );if _dg .Choice !=nil {for _ ,_eb :=range _dg .Choice {_eb .MarshalXML (e ,_g .StartElement {});};};e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};func (_ecg *LCC )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_bcb ,_adb :=d .Token ();if _adb !=nil {return _e .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u004c\u0043\u0043\u003a\u0020\u0025\u0073",_adb );};if _ffaf ,_bgfe :=_bcb .(_g .EndElement );_bgfe &&_ffaf .Name ==start .Name {break ;};};return nil ;};func (_fgb *IMT )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0049\u004d\u0054";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};func NewBox ()*Box {_gc :=&Box {};return _gc };
|
||||
|
||||
// Validate validates the LCC and its children
|
||||
func (_cccg *LCC )Validate ()error {return _cccg .ValidateWithPath ("\u004c\u0043\u0043")};
|
||||
|
||||
// ValidateWithPath validates the RFC1766 and its children, prefixing error messages with path
|
||||
func (_fgc *RFC1766 )ValidateWithPath (path string )error {return nil };type Box struct{};
|
||||
|
||||
// ValidateWithPath validates the UDC and its children, prefixing error messages with path
|
||||
func (_agff *UDC )ValidateWithPath (path string )error {return nil };func NewRFC1766 ()*RFC1766 {_bea :=&RFC1766 {};return _bea };func NewURI ()*URI {_ddf :=&URI {};return _ddf };func NewDDC ()*DDC {_gcf :=&DDC {};return _gcf };func (_dcb *UDC )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0055\u0044\u0043";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};func NewElementsAndRefinementsGroupChoice ()*ElementsAndRefinementsGroupChoice {_ega :=&ElementsAndRefinementsGroupChoice {};return _ega ;};
|
||||
|
||||
// Validate validates the ElementOrRefinementContainer and its children
|
||||
func (_geg *ElementOrRefinementContainer )Validate ()error {return _geg .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 (_ccf *MESH )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_ggf ,_gfd :=d .Token ();if _gfd !=nil {return _e .Errorf ("\u0070\u0061r\u0073\u0069\u006eg\u0020\u004d\u0045\u0053\u0048\u003a\u0020\u0025\u0073",_gfd );};if _aae ,_ada :=_ggf .(_g .EndElement );_ada &&_aae .Name ==start .Name {break ;};};return nil ;};
|
||||
|
||||
// Validate validates the Box and its children
|
||||
func (_gb *Box )Validate ()error {return _gb .ValidateWithPath ("\u0042\u006f\u0078")};func (_gcc *ISO639_2 )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0049\u0053\u004f\u0036\u0033\u0039\u002d\u0032";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};
|
||||
|
||||
// ValidateWithPath validates the DDC and its children, prefixing error messages with path
|
||||
func (_aa *DDC )ValidateWithPath (path string )error {return nil };func (_f *DDC )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_gd ,_dd :=d .Token ();if _dd !=nil {return _e .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0044\u0044\u0043\u003a\u0020\u0025\u0073",_dd );};if _ag ,_eeg :=_gd .(_g .EndElement );_eeg &&_ag .Name ==start .Name {break ;};};return nil ;};
|
||||
|
||||
// ValidateWithPath validates the LCSH and its children, prefixing error messages with path
|
||||
func (_ae *LCSH )ValidateWithPath (path string )error {return nil };type Point struct{};
|
||||
|
||||
// Validate validates the W3CDTF and its children
|
||||
func (_aaag *W3CDTF )Validate ()error {return _aaag .ValidateWithPath ("\u0057\u0033\u0043\u0044\u0054\u0046");};func (_ggff *RFC3066 )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_fac ,_gad :=d .Token ();if _gad !=nil {return _e .Errorf ("\u0070\u0061\u0072\u0073in\u0067\u0020\u0052\u0046\u0043\u0033\u0030\u0036\u0036\u003a\u0020\u0025\u0073",_gad );};if _ebbe ,_eff :=_fac .(_g .EndElement );_eff &&_ebbe .Name ==start .Name {break ;};};return nil ;};
|
||||
|
||||
// ValidateWithPath validates the ElementOrRefinementContainer and its children, prefixing error messages with path
|
||||
func (_cbe *ElementOrRefinementContainer )ValidateWithPath (path string )error {for _af ,_cg :=range _cbe .Choice {if _cfg :=_cg .ValidateWithPath (_e .Sprintf ("\u0025\u0073\u002f\u0043\u0068\u006f\u0069\u0063\u0065\u005b\u0025\u0064\u005d",path ,_af ));_cfg !=nil {return _cfg ;};};return nil ;};func (_ba *DDC )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0044\u0044\u0043";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};type UDC struct{};type ISO3166 struct{};func NewPeriod ()*Period {_dca :=&Period {};return _dca };
|
||||
|
||||
// ValidateWithPath validates the TGN and its children, prefixing error messages with path
|
||||
func (_bgc *TGN )ValidateWithPath (path string )error {return nil };func (_egfe *ElementsAndRefinementsGroup )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {_fga :for {_dgf ,_cga :=d .Token ();if _cga !=nil {return _cga ;};switch _cee :=_dgf .(type ){case _g .StartElement :switch _cee .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"}:_gce :=NewElementsAndRefinementsGroupChoice ();if _ebc :=d .DecodeElement (&_gce .Any ,&_cee );_ebc !=nil {return _ebc ;};_egfe .Choice =append (_egfe .Choice ,_gce );default:_gf .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",_cee .Name );if _ebe :=d .Skip ();_ebe !=nil {return _ebe ;};};case _g .EndElement :break _fga ;case _g .CharData :};};return nil ;};func (_egc *RFC3066 )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0052F\u0043\u0033\u0030\u0036\u0036";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};func NewDCMIType ()*DCMIType {_cb :=&DCMIType {};return _cb };
|
||||
|
||||
// Validate validates the Period and its children
|
||||
func (_bcf *Period )Validate ()error {return _bcf .ValidateWithPath ("\u0050\u0065\u0072\u0069\u006f\u0064");};func (_d *Box )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0042\u006f\u0078";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};type IMT struct{};
|
||||
|
||||
// Validate validates the ElementsAndRefinementsGroup and its children
|
||||
func (_cgb *ElementsAndRefinementsGroup )Validate ()error {return _cgb .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 (_ccd *ISO3166 )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_fcd ,_eca :=d .Token ();if _eca !=nil {return _e .Errorf ("\u0070\u0061\u0072\u0073in\u0067\u0020\u0049\u0053\u004f\u0033\u0031\u0036\u0036\u003a\u0020\u0025\u0073",_eca );};if _baaa ,_cbf :=_fcd .(_g .EndElement );_cbf &&_baaa .Name ==start .Name {break ;};};return nil ;};func NewLCSH ()*LCSH {_cgg :=&LCSH {};return _cgg };func (_ded *MESH )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u004d\u0045\u0053\u0048";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};type MESH struct{};func NewRFC3066 ()*RFC3066 {_dcg :=&RFC3066 {};return _dcg };
|
||||
|
||||
// ValidateWithPath validates the MESH and its children, prefixing error messages with path
|
||||
func (_gec *MESH )ValidateWithPath (path string )error {return nil };
|
||||
|
||||
// ValidateWithPath validates the ElementsAndRefinementsGroup and its children, prefixing error messages with path
|
||||
func (_afb *ElementsAndRefinementsGroup )ValidateWithPath (path string )error {for _bac ,_ef :=range _afb .Choice {if _ff :=_ef .ValidateWithPath (_e .Sprintf ("\u0025\u0073\u002f\u0043\u0068\u006f\u0069\u0063\u0065\u005b\u0025\u0064\u005d",path ,_bac ));_ff !=nil {return _ff ;};};return nil ;};func (_dgc *W3CDTF )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_aad ,_begc :=d .Token ();if _begc !=nil {return _e .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u00573\u0043\u0044T\u0046\u003a\u0020\u0025\u0073",_begc );};if _abc ,_aee :=_aad .(_g .EndElement );_aee &&_abc .Name ==start .Name {break ;};};return nil ;};func (_bc *ElementsAndRefinementsGroupChoice )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {if _bc .Any !=nil {_ffa :=_g .StartElement {Name :_g .Name {Local :"\u0064\u0063\u003a\u0061\u006e\u0079"}};for _ ,_ecc :=range _bc .Any {e .EncodeElement (_ecc ,_ffa );};};return nil ;};func (_gfe *IMT )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_agf ,_fc :=d .Token ();if _fc !=nil {return _e .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0049\u004d\u0054\u003a\u0020\u0025\u0073",_fc );};if _bf ,_eegd :=_agf .(_g .EndElement );_eegd &&_bf .Name ==start .Name {break ;};};return nil ;};
|
||||
|
||||
// Validate validates the UDC and its children
|
||||
func (_cfbd *UDC )Validate ()error {return _cfbd .ValidateWithPath ("\u0055\u0044\u0043")};
|
||||
|
||||
// ValidateWithPath validates the Point and its children, prefixing error messages with path
|
||||
func (_cbdf *Point )ValidateWithPath (path string )error {return nil };func (_eba *UDC )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_afe ,_acf :=d .Token ();if _acf !=nil {return _e .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0055\u0044\u0043\u003a\u0020\u0025\u0073",_acf );};if _efg ,_aaaa :=_afe .(_g .EndElement );_aaaa &&_efg .Name ==start .Name {break ;};};return nil ;};func (_gfeg *LCSH )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_aaa ,_dc :=d .Token ();if _dc !=nil {return _e .Errorf ("\u0070\u0061r\u0073\u0069\u006eg\u0020\u004c\u0043\u0053\u0048\u003a\u0020\u0025\u0073",_dc );};if _gbd ,_ddb :=_aaa .(_g .EndElement );_ddb &&_gbd .Name ==start .Name {break ;};};return nil ;};
|
||||
|
||||
// ValidateWithPath validates the Box and its children, prefixing error messages with path
|
||||
func (_a *Box )ValidateWithPath (path string )error {return nil };func (_ege *LCC )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u004c\u0043\u0043";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};type DCMIType struct{};func (_bga *RFC1766 )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0052F\u0043\u0031\u0037\u0036\u0036";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};func NewTGN ()*TGN {_eac :=&TGN {};return _eac };func NewUDC ()*UDC {_abg :=&UDC {};return _abg };
|
||||
|
||||
// ValidateWithPath validates the ISO3166 and its children, prefixing error messages with path
|
||||
func (_ccc *ISO3166 )ValidateWithPath (path string )error {return nil };
|
||||
|
||||
// ValidateWithPath validates the Period and its children, prefixing error messages with path
|
||||
func (_dfg *Period )ValidateWithPath (path string )error {return nil };func NewLCC ()*LCC {_gegd :=&LCC {};return _gegd };type ElementsAndRefinementsGroupChoice struct{Any []*_ge .Any ;};
|
||||
|
||||
// Validate validates the LCSH and its children
|
||||
func (_efbf *LCSH )Validate ()error {return _efbf .ValidateWithPath ("\u004c\u0043\u0053\u0048")};func (_dce *UDC )UnmarshalXML (d *_f .Decoder ,start _f .StartElement )error {for {_adg ,_fbc :=d .Token ();if _fbc !=nil {return _e .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0055\u0044\u0043\u003a\u0020\u0025\u0073",_fbc );};if _egcc ,_agg :=_adg .(_f .EndElement );_agg &&_egcc .Name ==start .Name {break ;};};return nil ;};func (_efcf *TGN )MarshalXML (e *_f .Encoder ,start _f .StartElement )error {start .Name .Local ="\u0054\u0047\u004e";e .EncodeToken (start );e .EncodeToken (_f .EndElement {Name :start .Name });return nil ;};func (_fgf *RFC1766 )UnmarshalXML (d *_f .Decoder ,start _f .StartElement )error {for {_cfc ,_fcff :=d .Token ();if _fcff !=nil {return _e .Errorf ("\u0070\u0061\u0072\u0073in\u0067\u0020\u0052\u0046\u0043\u0031\u0037\u0036\u0036\u003a\u0020\u0025\u0073",_fcff );};if _acb ,_ffb :=_cfc .(_f .EndElement );_ffb &&_acb .Name ==start .Name {break ;};};return nil ;};type Period struct{};func init (){_c .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 );_c .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 );_c .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0044\u0044\u0043",NewDDC );_c .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u004c\u0043\u0043",NewLCC );_c .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0055\u0044\u0043",NewUDC );_c .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 );_c .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 );_c .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 );_c .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0049\u004d\u0054",NewIMT );_c .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0055\u0052\u0049",NewURI );_c .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 );_c .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 );_c .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 );_c .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 );_c .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 );_c .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0042\u006f\u0078",NewBox );_c .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0054\u0047\u004e",NewTGN );_c .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 );_c .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 (_edb *LCSH )Validate ()error {return _edb .ValidateWithPath ("\u004c\u0043\u0053\u0048")};func (_agd *URI )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Name .Local ="\u0055\u0052\u0049";e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};
|
||||
|
||||
// Validate validates the TGN and its children
|
||||
func (_eagc *TGN )Validate ()error {return _eagc .ValidateWithPath ("\u0054\u0047\u004e")};
|
||||
|
||||
// ValidateWithPath validates the RFC3066 and its children, prefixing error messages with path
|
||||
func (_dbae *RFC3066 )ValidateWithPath (path string )error {return nil };func init (){_b .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 );_b .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 );_b .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0044\u0044\u0043",NewDDC );_b .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u004c\u0043\u0043",NewLCC );_b .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0055\u0044\u0043",NewUDC );_b .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 );_b .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 );_b .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 );_b .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0049\u004d\u0054",NewIMT );_b .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0055\u0052\u0049",NewURI );_b .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 );_b .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 );_b .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 );_b .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 );_b .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 );_b .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0042\u006f\u0078",NewBox );_b .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","\u0054\u0047\u004e",NewTGN );_b .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 );_b .RegisterConstructor ("\u0068t\u0074\u0070\u003a\u002f/\u0070\u0075\u0072\u006c\u002eo\u0072g\u002fd\u0063\u002f\u0074\u0065\u0072\u006d\u0073/","e\u006c\u0065\u006d\u0065\u006e\u0074s\u0041\u006e\u0064\u0052\u0065\u0066\u0069\u006e\u0065m\u0065\u006e\u0074s\u0047r\u006f\u0075\u0070",NewElementsAndRefinementsGroup );};
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -9,10 +9,10 @@
|
||||
// Use of this source code is governed by the UniDoc End User License Agreement
|
||||
// terms that can be accessed at https://unidoc.io/eula/
|
||||
|
||||
package lockedCanvas ;import (_a "encoding/xml";_e "fmt";_ae "github.com/unidoc/unioffice";_d "github.com/unidoc/unioffice/schema/soo/dml";);
|
||||
|
||||
// Validate validates the LockedCanvas and its children
|
||||
func (_fc *LockedCanvas )Validate ()error {return _fc .ValidateWithPath ("\u004c\u006f\u0063k\u0065\u0064\u0043\u0061\u006e\u0076\u0061\u0073");};func (_b *LockedCanvas )UnmarshalXML (d *_a .Decoder ,start _a .StartElement )error {_b .CT_GvmlGroupShape =*_d .NewCT_GvmlGroupShape ();for {_c ,_aea :=d .Token ();if _aea !=nil {return _e .Errorf ("\u0070a\u0072\u0073\u0069\u006e\u0067\u0020\u004c\u006f\u0063\u006b\u0065d\u0043\u0061\u006e\u0076\u0061\u0073\u003a\u0020\u0025\u0073",_aea );};if _ba ,_dab :=_c .(_a .EndElement );_dab &&_ba .Name ==start .Name {break ;};};return nil ;};func NewLockedCanvas ()*LockedCanvas {_da :=&LockedCanvas {};_da .CT_GvmlGroupShape =*_d .NewCT_GvmlGroupShape ();return _da ;};func (_dc *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 _dc .CT_GvmlGroupShape .MarshalXML (e ,start );};
|
||||
package lockedCanvas ;import (_ee "encoding/xml";_b "fmt";_bg "github.com/unidoc/unioffice";_f "github.com/unidoc/unioffice/schema/soo/dml";);type LockedCanvas struct{_f .CT_GvmlGroupShape };func (_g *LockedCanvas )UnmarshalXML (d *_ee .Decoder ,start _ee .StartElement )error {_g .CT_GvmlGroupShape =*_f .NewCT_GvmlGroupShape ();for {_fe ,_ec :=d .Token ();if _ec !=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",_ec );};if _fa ,_d :=_fe .(_ee .EndElement );_d &&_fa .Name ==start .Name {break ;};};return nil ;};
|
||||
|
||||
// ValidateWithPath validates the LockedCanvas and its children, prefixing error messages with path
|
||||
func (_bc *LockedCanvas )ValidateWithPath (path string )error {if _g :=_bc .CT_GvmlGroupShape .ValidateWithPath (path );_g !=nil {return _g ;};return nil ;};type LockedCanvas struct{_d .CT_GvmlGroupShape };func init (){_ae .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 (_afb *LockedCanvas )ValidateWithPath (path string )error {if _ef :=_afb .CT_GvmlGroupShape .ValidateWithPath (path );_ef !=nil {return _ef ;};return nil ;};
|
||||
|
||||
// Validate validates the LockedCanvas and its children
|
||||
func (_af *LockedCanvas )Validate ()error {return _af .ValidateWithPath ("\u004c\u006f\u0063k\u0065\u0064\u0043\u0061\u006e\u0076\u0061\u0073");};func NewLockedCanvas ()*LockedCanvas {_fb :=&LockedCanvas {};_fb .CT_GvmlGroupShape =*_f .NewCT_GvmlGroupShape ();return _fb ;};func (_a *LockedCanvas )MarshalXML (e *_ee .Encoder ,start _ee .StartElement )error {start .Attr =append (start .Attr ,_ee .Attr {Name :_ee .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 ,_ee .Attr {Name :_ee .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 _a .CT_GvmlGroupShape .MarshalXML (e ,start );};func init (){_bg .RegisterConstructor ("h\u0074\u0074\u0070\u003a\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073\u002e\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061t\u0073.\u006f\u0072\u0067\u002fd\u0072\u0061w\u0069\u006e\u0067\u006d\u006c\u002f\u0032\u0030\u0030\u0036\u002f\u006c\u006f\u0063\u006b\u0065\u0064\u0043\u0061\u006e\u0076\u0061\u0073","\u006c\u006f\u0063k\u0065\u0064\u0043\u0061\u006e\u0076\u0061\u0073",NewLockedCanvas );};
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -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 (_g "encoding/xml";_ga "fmt";_b "github.com/unidoc/unioffice";_a "github.com/unidoc/unioffice/common/logger";);
|
||||
|
||||
// Validate validates the SchemaLibrary and its children
|
||||
func (_bfa *SchemaLibrary )Validate ()error {return _bfa .ValidateWithPath ("\u0053\u0063\u0068\u0065\u006d\u0061\u004c\u0069\u0062\u0072\u0061\u0072\u0079");};func (_eb *CT_Schema )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for _ ,_ad :=range start .Attr {if _ad .Name .Local =="\u0075\u0072\u0069"{_bf ,_ec :=_ad .Value ,error (nil );if _ec !=nil {return _ec ;};_eb .UriAttr =&_bf ;continue ;};if _ad .Name .Local =="\u006d\u0061n\u0069\u0066\u0065s\u0074\u004c\u006f\u0063\u0061\u0074\u0069\u006f\u006e"{_f ,_fb :=_ad .Value ,error (nil );if _fb !=nil {return _fb ;};_eb .ManifestLocationAttr =&_f ;continue ;};if _ad .Name .Local =="\u0073\u0063\u0068\u0065\u006d\u0061\u004c\u006f\u0063a\u0074\u0069\u006f\u006e"{_ba ,_cc :=_ad .Value ,error (nil );if _cc !=nil {return _cc ;};_eb .SchemaLocationAttr =&_ba ;continue ;};if _ad .Name .Local =="\u0073\u0063\u0068\u0065\u006d\u0061\u004c\u0061\u006eg\u0075\u0061\u0067\u0065"{_ab ,_db :=_ad .Value ,error (nil );if _db !=nil {return _db ;};_eb .SchemaLanguageAttr =&_ab ;continue ;};};for {_ade ,_gf :=d .Token ();if _gf !=nil {return _ga .Errorf ("p\u0061\u0072\u0073\u0069ng\u0020C\u0054\u005f\u0053\u0063\u0068e\u006d\u0061\u003a\u0020\u0025\u0073",_gf );};if _ea ,_bad :=_ade .(_g .EndElement );_bad &&_ea .Name ==start .Name {break ;};};return nil ;};func (_ee *CT_Schema )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {if _ee .UriAttr !=nil {start .Attr =append (start .Attr ,_g .Attr {Name :_g .Name {Local :"\u006d\u0061\u003a\u0075\u0072\u0069"},Value :_ga .Sprintf ("\u0025\u0076",*_ee .UriAttr )});};if _ee .ManifestLocationAttr !=nil {start .Attr =append (start .Attr ,_g .Attr {Name :_g .Name {Local :"\u006d\u0061\u003a\u006dan\u0069\u0066\u0065\u0073\u0074\u004c\u006f\u0063\u0061\u0074\u0069\u006f\u006e"},Value :_ga .Sprintf ("\u0025\u0076",*_ee .ManifestLocationAttr )});};if _ee .SchemaLocationAttr !=nil {start .Attr =append (start .Attr ,_g .Attr {Name :_g .Name {Local :"\u006d\u0061\u003a\u0073\u0063\u0068\u0065\u006d\u0061\u004c\u006f\u0063a\u0074\u0069\u006f\u006e"},Value :_ga .Sprintf ("\u0025\u0076",*_ee .SchemaLocationAttr )});};if _ee .SchemaLanguageAttr !=nil {start .Attr =append (start .Attr ,_g .Attr {Name :_g .Name {Local :"\u006d\u0061\u003a\u0073\u0063\u0068\u0065\u006d\u0061\u004c\u0061\u006eg\u0075\u0061\u0067\u0065"},Value :_ga .Sprintf ("\u0025\u0076",*_ee .SchemaLanguageAttr )});};e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};func NewSchemaLibrary ()*SchemaLibrary {_fe :=&SchemaLibrary {};_fe .CT_SchemaLibrary =*NewCT_SchemaLibrary ();return _fe ;};
|
||||
|
||||
// ValidateWithPath validates the CT_Schema and its children, prefixing error messages with path
|
||||
func (_aa *CT_Schema )ValidateWithPath (path string )error {return nil };
|
||||
|
||||
// ValidateWithPath validates the CT_SchemaLibrary and its children, prefixing error messages with path
|
||||
func (_fbb *CT_SchemaLibrary )ValidateWithPath (path string )error {for _cce ,_gac :=range _fbb .Schema {if _bb :=_gac .ValidateWithPath (_ga .Sprintf ("\u0025\u0073\u002f\u0053\u0063\u0068\u0065\u006d\u0061\u005b\u0025\u0064\u005d",path ,_cce ));_bb !=nil {return _bb ;};};return nil ;};func (_eaf *CT_SchemaLibrary )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {_dbc :for {_ge ,_gfd :=d .Token ();if _gfd !=nil {return _gfd ;};switch _gag :=_ge .(type ){case _g .StartElement :switch _gag .Name {case _g .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"}:_ecc :=NewCT_Schema ();if _fd :=d .DecodeElement (_ecc ,&_gag );_fd !=nil {return _fd ;};_eaf .Schema =append (_eaf .Schema ,_ecc );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\u0043\u0054\u005f\u0053\u0063\u0068\u0065\u006d\u0061\u004c\u0069\u0062\u0072\u0061\u0072\u0079\u0020\u0025v",_gag .Name );if _ce :=d .Skip ();_ce !=nil {return _ce ;};};case _g .EndElement :break _dbc ;case _g .CharData :};};return nil ;};func NewCT_Schema ()*CT_Schema {_c :=&CT_Schema {};return _c };
|
||||
|
||||
// Validate validates the CT_SchemaLibrary and its children
|
||||
func (_ed *CT_SchemaLibrary )Validate ()error {return _ed .ValidateWithPath ("\u0043\u0054_\u0053\u0063\u0068e\u006d\u0061\u004c\u0069\u0062\u0072\u0061\u0072\u0079");};func (_cdg *SchemaLibrary )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {_cdg .CT_SchemaLibrary =*NewCT_SchemaLibrary ();_de :for {_bfe ,_gab :=d .Token ();if _gab !=nil {return _gab ;};switch _ff :=_bfe .(type ){case _g .StartElement :switch _ff .Name {case _g .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"}:_fef :=NewCT_Schema ();if _fg :=d .DecodeElement (_fef ,&_ff );_fg !=nil {return _fg ;};_cdg .Schema =append (_cdg .Schema ,_fef );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\u0053\u0063\u0068\u0065m\u0061\u004c\u0069\u0062\u0072\u0061\u0072\u0079 \u0025\u0076",_ff .Name );if _ae :=d .Skip ();_ae !=nil {return _ae ;};};case _g .EndElement :break _de ;case _g .CharData :};};return nil ;};
|
||||
|
||||
// ValidateWithPath validates the SchemaLibrary and its children, prefixing error messages with path
|
||||
func (_aag *SchemaLibrary )ValidateWithPath (path string )error {if _edc :=_aag .CT_SchemaLibrary .ValidateWithPath (path );_edc !=nil {return _edc ;};return nil ;};func (_eac *SchemaLibrary )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Attr =append (start .Attr ,_g .Attr {Name :_g .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 ,_g .Attr {Name :_g .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 ,_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 ="\u006d\u0061:\u0073\u0063\u0068e\u006d\u0061\u004c\u0069\u0062\u0072\u0061\u0072\u0079";return _eac .CT_SchemaLibrary .MarshalXML (e ,start );};type CT_SchemaLibrary struct{Schema []*CT_Schema ;};
|
||||
package schemaLibrary ;import (_a "encoding/xml";_ae "fmt";_g "github.com/unidoc/unioffice";_c "github.com/unidoc/unioffice/common/logger";);type CT_SchemaLibrary struct{Schema []*CT_Schema ;};
|
||||
|
||||
// Validate validates the CT_Schema and its children
|
||||
func (_af *CT_Schema )Validate ()error {return _af .ValidateWithPath ("\u0043T\u005f\u0053\u0063\u0068\u0065\u006da");};type SchemaLibrary struct{CT_SchemaLibrary };type CT_Schema struct{UriAttr *string ;ManifestLocationAttr *string ;SchemaLocationAttr *string ;SchemaLanguageAttr *string ;};func (_ef *CT_SchemaLibrary )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {e .EncodeToken (start );if _ef .Schema !=nil {_cd :=_g .StartElement {Name :_g .Name {Local :"\u006da\u003a\u0073\u0063\u0068\u0065\u006da"}};for _ ,_ca :=range _ef .Schema {e .EncodeElement (_ca ,_cd );};};e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};func NewCT_SchemaLibrary ()*CT_SchemaLibrary {_da :=&CT_SchemaLibrary {};return _da };func init (){_b .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 );_b .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 );_b .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 (_ed *CT_Schema )Validate ()error {return _ed .ValidateWithPath ("\u0043T\u005f\u0053\u0063\u0068\u0065\u006da");};func (_dd *CT_Schema )UnmarshalXML (d *_a .Decoder ,start _a .StartElement )error {for _ ,_de :=range start .Attr {if _de .Name .Local =="\u0075\u0072\u0069"{_e ,_gd :=_de .Value ,error (nil );if _gd !=nil {return _gd ;};_dd .UriAttr =&_e ;continue ;};if _de .Name .Local =="\u006d\u0061n\u0069\u0066\u0065s\u0074\u004c\u006f\u0063\u0061\u0074\u0069\u006f\u006e"{_ab ,_ce :=_de .Value ,error (nil );if _ce !=nil {return _ce ;};_dd .ManifestLocationAttr =&_ab ;continue ;};if _de .Name .Local =="\u0073\u0063\u0068\u0065\u006d\u0061\u004c\u006f\u0063a\u0074\u0069\u006f\u006e"{_da ,_aea :=_de .Value ,error (nil );if _aea !=nil {return _aea ;};_dd .SchemaLocationAttr =&_da ;continue ;};if _de .Name .Local =="\u0073\u0063\u0068\u0065\u006d\u0061\u004c\u0061\u006eg\u0075\u0061\u0067\u0065"{_ag ,_aa :=_de .Value ,error (nil );if _aa !=nil {return _aa ;};_dd .SchemaLanguageAttr =&_ag ;continue ;};};for {_ccf ,_ca :=d .Token ();if _ca !=nil {return _ae .Errorf ("p\u0061\u0072\u0073\u0069ng\u0020C\u0054\u005f\u0053\u0063\u0068e\u006d\u0061\u003a\u0020\u0025\u0073",_ca );};if _ec ,_ad :=_ccf .(_a .EndElement );_ad &&_ec .Name ==start .Name {break ;};};return nil ;};
|
||||
|
||||
// ValidateWithPath validates the CT_Schema and its children, prefixing error messages with path
|
||||
func (_ceg *CT_Schema )ValidateWithPath (path string )error {return nil };
|
||||
|
||||
// ValidateWithPath validates the CT_SchemaLibrary and its children, prefixing error messages with path
|
||||
func (_aef *CT_SchemaLibrary )ValidateWithPath (path string )error {for _ea ,_aeg :=range _aef .Schema {if _fb :=_aeg .ValidateWithPath (_ae .Sprintf ("\u0025\u0073\u002f\u0053\u0063\u0068\u0065\u006d\u0061\u005b\u0025\u0064\u005d",path ,_ea ));_fb !=nil {return _fb ;};};return nil ;};func NewSchemaLibrary ()*SchemaLibrary {_eg :=&SchemaLibrary {};_eg .CT_SchemaLibrary =*NewCT_SchemaLibrary ();return _eg ;};func (_aec *SchemaLibrary )MarshalXML (e *_a .Encoder ,start _a .StartElement )error {start .Attr =append (start .Attr ,_a .Attr {Name :_a .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 ,_a .Attr {Name :_a .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 ,_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 ="\u006d\u0061:\u0073\u0063\u0068e\u006d\u0061\u004c\u0069\u0062\u0072\u0061\u0072\u0079";return _aec .CT_SchemaLibrary .MarshalXML (e ,start );};func (_af *CT_SchemaLibrary )MarshalXML (e *_a .Encoder ,start _a .StartElement )error {e .EncodeToken (start );if _af .Schema !=nil {_cb :=_a .StartElement {Name :_a .Name {Local :"\u006da\u003a\u0073\u0063\u0068\u0065\u006da"}};for _ ,_f :=range _af .Schema {e .EncodeElement (_f ,_cb );};};e .EncodeToken (_a .EndElement {Name :start .Name });return nil ;};type CT_Schema struct{UriAttr *string ;ManifestLocationAttr *string ;SchemaLocationAttr *string ;SchemaLanguageAttr *string ;};
|
||||
|
||||
// Validate validates the SchemaLibrary and its children
|
||||
func (_ge *SchemaLibrary )Validate ()error {return _ge .ValidateWithPath ("\u0053\u0063\u0068\u0065\u006d\u0061\u004c\u0069\u0062\u0072\u0061\u0072\u0079");};type SchemaLibrary struct{CT_SchemaLibrary };
|
||||
|
||||
// Validate validates the CT_SchemaLibrary and its children
|
||||
func (_ccbc *CT_SchemaLibrary )Validate ()error {return _ccbc .ValidateWithPath ("\u0043\u0054_\u0053\u0063\u0068e\u006d\u0061\u004c\u0069\u0062\u0072\u0061\u0072\u0079");};func (_cfb *CT_SchemaLibrary )UnmarshalXML (d *_a .Decoder ,start _a .StartElement )error {_aee :for {_dg ,_ac :=d .Token ();if _ac !=nil {return _ac ;};switch _eb :=_dg .(type ){case _a .StartElement :switch _eb .Name {case _a .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"}:_fd :=NewCT_Schema ();if _afd :=d .DecodeElement (_fd ,&_eb );_afd !=nil {return _afd ;};_cfb .Schema =append (_cfb .Schema ,_fd );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\u0053\u0063\u0068\u0065\u006d\u0061\u004c\u0069\u0062\u0072\u0061\u0072\u0079\u0020\u0025v",_eb .Name );if _fa :=d .Skip ();_fa !=nil {return _fa ;};};case _a .EndElement :break _aee ;case _a .CharData :};};return nil ;};func NewCT_SchemaLibrary ()*CT_SchemaLibrary {_ecg :=&CT_SchemaLibrary {};return _ecg };func NewCT_Schema ()*CT_Schema {_cf :=&CT_Schema {};return _cf };func (_gf *CT_Schema )MarshalXML (e *_a .Encoder ,start _a .StartElement )error {if _gf .UriAttr !=nil {start .Attr =append (start .Attr ,_a .Attr {Name :_a .Name {Local :"\u006d\u0061\u003a\u0075\u0072\u0069"},Value :_ae .Sprintf ("\u0025\u0076",*_gf .UriAttr )});};if _gf .ManifestLocationAttr !=nil {start .Attr =append (start .Attr ,_a .Attr {Name :_a .Name {Local :"\u006d\u0061\u003a\u006dan\u0069\u0066\u0065\u0073\u0074\u004c\u006f\u0063\u0061\u0074\u0069\u006f\u006e"},Value :_ae .Sprintf ("\u0025\u0076",*_gf .ManifestLocationAttr )});};if _gf .SchemaLocationAttr !=nil {start .Attr =append (start .Attr ,_a .Attr {Name :_a .Name {Local :"\u006d\u0061\u003a\u0073\u0063\u0068\u0065\u006d\u0061\u004c\u006f\u0063a\u0074\u0069\u006f\u006e"},Value :_ae .Sprintf ("\u0025\u0076",*_gf .SchemaLocationAttr )});};if _gf .SchemaLanguageAttr !=nil {start .Attr =append (start .Attr ,_a .Attr {Name :_a .Name {Local :"\u006d\u0061\u003a\u0073\u0063\u0068\u0065\u006d\u0061\u004c\u0061\u006eg\u0075\u0061\u0067\u0065"},Value :_ae .Sprintf ("\u0025\u0076",*_gf .SchemaLanguageAttr )});};e .EncodeToken (start );e .EncodeToken (_a .EndElement {Name :start .Name });return nil ;};func (_ebd *SchemaLibrary )UnmarshalXML (d *_a .Decoder ,start _a .StartElement )error {_ebd .CT_SchemaLibrary =*NewCT_SchemaLibrary ();_ef :for {_eca ,_df :=d .Token ();if _df !=nil {return _df ;};switch _db :=_eca .(type ){case _a .StartElement :switch _db .Name {case _a .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"}:_gg :=NewCT_Schema ();if _ebc :=d .DecodeElement (_gg ,&_db );_ebc !=nil {return _ebc ;};_ebd .Schema =append (_ebd .Schema ,_gg );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\u0053\u0063\u0068\u0065m\u0061\u004c\u0069\u0062\u0072\u0061\u0072\u0079 \u0025\u0076",_db .Name );if _fde :=d .Skip ();_fde !=nil {return _fde ;};};case _a .EndElement :break _ef ;case _a .CharData :};};return nil ;};
|
||||
|
||||
// ValidateWithPath validates the SchemaLibrary and its children, prefixing error messages with path
|
||||
func (_b *SchemaLibrary )ValidateWithPath (path string )error {if _dfd :=_b .CT_SchemaLibrary .ValidateWithPath (path );_dfd !=nil {return _dfd ;};return nil ;};func init (){_g .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 );_g .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 );_g .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 );};
|
14076
schema/soo/sml/sml.go
14076
schema/soo/sml/sml.go
File diff suppressed because one or more lines are too long
11212
schema/soo/wml/wml.go
11212
schema/soo/wml/wml.go
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -9,28 +9,28 @@
|
||||
// Use of this source code is governed by the UniDoc End User License Agreement
|
||||
// terms that can be accessed at https://unidoc.io/eula/
|
||||
|
||||
package powerpoint ;import (_d "encoding/xml";_b "fmt";_e "github.com/unidoc/unioffice";);
|
||||
package powerpoint ;import (_a "encoding/xml";_af "fmt";_aa "github.com/unidoc/unioffice";);
|
||||
|
||||
// Validate validates the CT_Rel and its children
|
||||
func (_cb *CT_Rel )Validate ()error {return _cb .ValidateWithPath ("\u0043\u0054\u005f\u0052\u0065\u006c");};func (_ee *Textdata )UnmarshalXML (d *_d .Decoder ,start _d .StartElement )error {_ee .CT_Rel =*NewCT_Rel ();for _ ,_eeg :=range start .Attr {if _eeg .Name .Local =="\u0069\u0064"{_bbaa ,_aaf :=_eeg .Value ,error (nil );if _aaf !=nil {return _aaf ;};_ee .IdAttr =&_bbaa ;continue ;};};for {_dcc ,_cda :=d .Token ();if _cda !=nil {return _b .Errorf ("p\u0061r\u0073\u0069\u006e\u0067\u0020\u0054\u0065\u0078t\u0064\u0061\u0074\u0061: \u0025\u0073",_cda );};if _fab ,_cg :=_dcc .(_d .EndElement );_cg &&_fab .Name ==start .Name {break ;};};return nil ;};type CT_Empty struct{};
|
||||
|
||||
// Validate validates the Textdata and its children
|
||||
func (_dcb *Textdata )Validate ()error {return _dcb .ValidateWithPath ("\u0054\u0065\u0078\u0074\u0064\u0061\u0074\u0061");};func (_ca *CT_Rel )UnmarshalXML (d *_d .Decoder ,start _d .StartElement )error {for _ ,_ge :=range start .Attr {if _ge .Name .Local =="\u0069\u0064"{_ec ,_ac :=_ge .Value ,error (nil );if _ac !=nil {return _ac ;};_ca .IdAttr =&_ec ;continue ;};};for {_gd ,_bf :=d .Token ();if _bf !=nil {return _b .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0043T\u005f\u0052e\u006c\u003a\u0020\u0025\u0073",_bf );};if _bc ,_gc :=_gd .(_d .EndElement );_gc &&_bc .Name ==start .Name {break ;};};return nil ;};type CT_Rel struct{IdAttr *string ;};func NewTextdata ()*Textdata {_bba :=&Textdata {};_bba .CT_Rel =*NewCT_Rel ();return _bba };func (_fa *CT_Empty )MarshalXML (e *_d .Encoder ,start _d .StartElement )error {e .EncodeToken (start );e .EncodeToken (_d .EndElement {Name :start .Name });return nil ;};func NewCT_Rel ()*CT_Rel {_cf :=&CT_Rel {};return _cf };
|
||||
|
||||
// ValidateWithPath validates the CT_Rel and its children, prefixing error messages with path
|
||||
func (_dcd *CT_Rel )ValidateWithPath (path string )error {return nil };func (_gcc *Iscomment )UnmarshalXML (d *_d .Decoder ,start _d .StartElement )error {_gcc .CT_Empty =*NewCT_Empty ();for {_de ,_bfa :=d .Token ();if _bfa !=nil {return _b .Errorf ("p\u0061\u0072\u0073\u0069ng\u0020I\u0073\u0063\u006f\u006d\u006de\u006e\u0074\u003a\u0020\u0025\u0073",_bfa );};if _gf ,_dg :=_de .(_d .EndElement );_dg &&_gf .Name ==start .Name {break ;};};return nil ;};
|
||||
|
||||
// Validate validates the CT_Empty and its children
|
||||
func (_dc *CT_Empty )Validate ()error {return _dc .ValidateWithPath ("\u0043\u0054\u005f\u0045\u006d\u0070\u0074\u0079");};type Iscomment struct{CT_Empty };
|
||||
|
||||
// ValidateWithPath validates the CT_Empty and its children, prefixing error messages with path
|
||||
func (_aa *CT_Empty )ValidateWithPath (path string )error {return nil };
|
||||
func (_cd *CT_Rel )Validate ()error {return _cd .ValidateWithPath ("\u0043\u0054\u005f\u0052\u0065\u006c");};func (_dda *Iscomment )MarshalXML (e *_a .Encoder ,start _a .StartElement )error {start .Attr =append (start .Attr ,_a .Attr {Name :_a .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 ,_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 ="\u0069s\u0063\u006f\u006d\u006d\u0065\u006et";return _dda .CT_Empty .MarshalXML (e ,start );};
|
||||
|
||||
// ValidateWithPath validates the Iscomment and its children, prefixing error messages with path
|
||||
func (_ef *Iscomment )ValidateWithPath (path string )error {if _ga :=_ef .CT_Empty .ValidateWithPath (path );_ga !=nil {return _ga ;};return nil ;};func (_ad *Textdata )MarshalXML (e *_d .Encoder ,start _d .StartElement )error {start .Attr =append (start .Attr ,_d .Attr {Name :_d .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 ,_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 ="\u0074\u0065\u0078\u0074\u0064\u0061\u0074\u0061";return _ad .CT_Rel .MarshalXML (e ,start );};type Textdata struct{CT_Rel };
|
||||
func (_ea *Iscomment )ValidateWithPath (path string )error {if _agf :=_ea .CT_Empty .ValidateWithPath (path );_agf !=nil {return _agf ;};return nil ;};func NewIscomment ()*Iscomment {_afc :=&Iscomment {};_afc .CT_Empty =*NewCT_Empty ();return _afc };func NewTextdata ()*Textdata {_ed :=&Textdata {};_ed .CT_Rel =*NewCT_Rel ();return _ed };func (_ae *CT_Rel )MarshalXML (e *_a .Encoder ,start _a .StartElement )error {if _ae .IdAttr !=nil {start .Attr =append (start .Attr ,_a .Attr {Name :_a .Name {Local :"\u0069\u0064"},Value :_af .Sprintf ("\u0025\u0076",*_ae .IdAttr )});};e .EncodeToken (start );e .EncodeToken (_a .EndElement {Name :start .Name });return nil ;};func (_d *CT_Empty )UnmarshalXML (d *_a .Decoder ,start _a .StartElement )error {for {_dd ,_ce :=d .Token ();if _ce !=nil {return _af .Errorf ("p\u0061r\u0073\u0069\u006e\u0067\u0020\u0043\u0054\u005fE\u006d\u0070\u0074\u0079: \u0025\u0073",_ce );};if _aad ,_bg :=_dd .(_a .EndElement );_bg &&_aad .Name ==start .Name {break ;};};return nil ;};func (_de *CT_Rel )UnmarshalXML (d *_a .Decoder ,start _a .StartElement )error {for _ ,_deb :=range start .Attr {if _deb .Name .Local =="\u0069\u0064"{_bf ,_da :=_deb .Value ,error (nil );if _da !=nil {return _da ;};_de .IdAttr =&_bf ;continue ;};};for {_fg ,_e :=d .Token ();if _e !=nil {return _af .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0043T\u005f\u0052e\u006c\u003a\u0020\u0025\u0073",_e );};if _bgf ,_aac :=_fg .(_a .EndElement );_aac &&_bgf .Name ==start .Name {break ;};};return nil ;};func (_cf *Textdata )UnmarshalXML (d *_a .Decoder ,start _a .StartElement )error {_cf .CT_Rel =*NewCT_Rel ();for _ ,_eb :=range start .Attr {if _eb .Name .Local =="\u0069\u0064"{_ef ,_cbg :=_eb .Value ,error (nil );if _cbg !=nil {return _cbg ;};_cf .IdAttr =&_ef ;continue ;};};for {_cec ,_ebc :=d .Token ();if _ebc !=nil {return _af .Errorf ("p\u0061r\u0073\u0069\u006e\u0067\u0020\u0054\u0065\u0078t\u0064\u0061\u0074\u0061: \u0025\u0073",_ebc );};if _aed ,_db :=_cec .(_a .EndElement );_db &&_aed .Name ==start .Name {break ;};};return nil ;};func (_b *CT_Empty )MarshalXML (e *_a .Encoder ,start _a .StartElement )error {e .EncodeToken (start );e .EncodeToken (_a .EndElement {Name :start .Name });return nil ;};func NewCT_Empty ()*CT_Empty {_c :=&CT_Empty {};return _c };
|
||||
|
||||
// Validate validates the Iscomment and its children
|
||||
func (_eb *Iscomment )Validate ()error {return _eb .ValidateWithPath ("\u0049s\u0063\u006f\u006d\u006d\u0065\u006et");};func (_cd *Iscomment )MarshalXML (e *_d .Encoder ,start _d .StartElement )error {start .Attr =append (start .Attr ,_d .Attr {Name :_d .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 ,_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 ="\u0069s\u0063\u006f\u006d\u006d\u0065\u006et";return _cd .CT_Empty .MarshalXML (e ,start );};func (_af *CT_Rel )MarshalXML (e *_d .Encoder ,start _d .StartElement )error {if _af .IdAttr !=nil {start .Attr =append (start .Attr ,_d .Attr {Name :_d .Name {Local :"\u0069\u0064"},Value :_b .Sprintf ("\u0025\u0076",*_af .IdAttr )});};e .EncodeToken (start );e .EncodeToken (_d .EndElement {Name :start .Name });return nil ;};func (_c *CT_Empty )UnmarshalXML (d *_d .Decoder ,start _d .StartElement )error {for {_dd ,_bb :=d .Token ();if _bb !=nil {return _b .Errorf ("p\u0061r\u0073\u0069\u006e\u0067\u0020\u0043\u0054\u005fE\u006d\u0070\u0074\u0079: \u0025\u0073",_bb );};if _ag ,_fc :=_dd .(_d .EndElement );_fc &&_ag .Name ==start .Name {break ;};};return nil ;};func NewCT_Empty ()*CT_Empty {_f :=&CT_Empty {};return _f };func NewIscomment ()*Iscomment {_bd :=&Iscomment {};_bd .CT_Empty =*NewCT_Empty ();return _bd };
|
||||
func (_fgb *Iscomment )Validate ()error {return _fgb .ValidateWithPath ("\u0049s\u0063\u006f\u006d\u006d\u0065\u006et");};func (_ddf *Textdata )MarshalXML (e *_a .Encoder ,start _a .StartElement )error {start .Attr =append (start .Attr ,_a .Attr {Name :_a .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 ,_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 ="\u0074\u0065\u0078\u0074\u0064\u0061\u0074\u0061";return _ddf .CT_Rel .MarshalXML (e ,start );};
|
||||
|
||||
// Validate validates the Textdata and its children
|
||||
func (_fe *Textdata )Validate ()error {return _fe .ValidateWithPath ("\u0054\u0065\u0078\u0074\u0064\u0061\u0074\u0061");};type Textdata struct{CT_Rel };type CT_Empty struct{};
|
||||
|
||||
// ValidateWithPath validates the CT_Empty and its children, prefixing error messages with path
|
||||
func (_ag *CT_Empty )ValidateWithPath (path string )error {return nil };type Iscomment struct{CT_Empty };func (_ba *Iscomment )UnmarshalXML (d *_a .Decoder ,start _a .StartElement )error {_ba .CT_Empty =*NewCT_Empty ();for {_dde ,_ca :=d .Token ();if _ca !=nil {return _af .Errorf ("p\u0061\u0072\u0073\u0069ng\u0020I\u0073\u0063\u006f\u006d\u006de\u006e\u0074\u003a\u0020\u0025\u0073",_ca );};if _cc ,_cab :=_dde .(_a .EndElement );_cab &&_cc .Name ==start .Name {break ;};};return nil ;};
|
||||
|
||||
// ValidateWithPath validates the Textdata and its children, prefixing error messages with path
|
||||
func (_be *Textdata )ValidateWithPath (path string )error {if _gda :=_be .CT_Rel .ValidateWithPath (path );_gda !=nil {return _gda ;};return nil ;};func init (){_e .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 );_e .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 );_e .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 );_e .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 (_cfe *Textdata )ValidateWithPath (path string )error {if _dea :=_cfe .CT_Rel .ValidateWithPath (path );_dea !=nil {return _dea ;};return nil ;};type CT_Rel struct{IdAttr *string ;};
|
||||
|
||||
// ValidateWithPath validates the CT_Rel and its children, prefixing error messages with path
|
||||
func (_cb *CT_Rel )ValidateWithPath (path string )error {return nil };func NewCT_Rel ()*CT_Rel {_gf :=&CT_Rel {};return _gf };
|
||||
|
||||
// Validate validates the CT_Empty and its children
|
||||
func (_g *CT_Empty )Validate ()error {return _g .ValidateWithPath ("\u0043\u0054\u005f\u0045\u006d\u0070\u0074\u0079");};func init (){_aa .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 );_aa .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 );_aa .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 );_aa .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
@ -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 (_e "errors";_ad "fmt";_cd "github.com/unidoc/unioffice/spreadsheet/update";_c "regexp";_f "strconv";_d "strings";);
|
||||
|
||||
// Update updates reference to point one of the neighboring cells with respect to the update type after removing a row/column.
|
||||
func (_fdd *CellReference )Update (updateType _cd .UpdateAction )*CellReference {switch updateType {case _cd .UpdateActionRemoveColumn :_bc :=_fdd ;_bc .ColumnIdx =_fdd .ColumnIdx -1;_bc .Column =IndexToColumn (_bc .ColumnIdx );return _bc ;default:return _fdd ;};};
|
||||
|
||||
// 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 =_d .TrimSpace (s );if len (s )< 1{return ColumnReference {},_e .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");};_dbb :=ColumnReference {};_bb ,_dca ,_bdg :=_gf (s );if _bdg !=nil {return ColumnReference {},_bdg ;};if _bb !=""{_dbb .SheetName =_bb ;};if _dca [0]=='$'{_dbb .AbsoluteColumn =true ;_dca =_dca [1:];};if !_cc .MatchString (_dca ){return ColumnReference {},_e .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");};_dbb .Column =_dca ;_dbb .ColumnIdx =ColumnToIndex (_dbb .Column );return _dbb ,nil ;};
|
||||
|
||||
// String returns a string representation of CellReference.
|
||||
func (_fd CellReference )String ()string {_db :=make ([]byte ,0,4);if _fd .AbsoluteColumn {_db =append (_db ,'$');};_db =append (_db ,_fd .Column ...);if _fd .AbsoluteRow {_db =append (_db ,'$');};_db =_f .AppendInt (_db ,int64 (_fd .RowIdx ),10);return string (_db );};
|
||||
|
||||
// Update updates reference to point one of the neighboring columns with respect to the update type after removing a row/column.
|
||||
func (_fb *ColumnReference )Update (updateType _cd .UpdateAction )*ColumnReference {switch updateType {case _cd .UpdateActionRemoveColumn :_ga :=_fb ;_ga .ColumnIdx =_fb .ColumnIdx -1;_ga .Column =IndexToColumn (_ga .ColumnIdx );return _ga ;default:return _fb ;};};
|
||||
|
||||
// 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 ;};func _gf (_ca string )(string ,string ,error ){_fg :="";_afc :=_d .LastIndex (_ca ,"\u0021");if _afc > -1{_fg =_ca [:_afc ];_ca =_ca [_afc +1:];if _fg ==""{return "","",_e .New ("\u0049n\u0076a\u006c\u0069\u0064\u0020\u0073h\u0065\u0065t\u0020\u006e\u0061\u006d\u0065");};};return _fg ,_ca ,nil ;};
|
||||
|
||||
// String returns a string representation of ColumnReference.
|
||||
func (_bd ColumnReference )String ()string {_fa :=make ([]byte ,0,4);if _bd .AbsoluteColumn {_fa =append (_fa ,'$');};_fa =append (_fa ,_bd .Column ...);return string (_fa );};
|
||||
|
||||
// ParseRangeReference splits a range reference of the form "A1:B5" into its
|
||||
// components.
|
||||
func ParseRangeReference (s string )(_be ,_gec CellReference ,_fe error ){_bf ,_cce ,_fe :=_gf (s );if _fe !=nil {return CellReference {},CellReference {},_fe ;};_fbd :=_d .Split (_cce ,"\u003a");if len (_fbd )!=2{return CellReference {},CellReference {},_e .New ("i\u006ev\u0061\u006c\u0069\u0064\u0020\u0072\u0061\u006eg\u0065\u0020\u0066\u006frm\u0061\u0074");};if _bf !=""{_fbd [0]=_bf +"\u0021"+_fbd [0];_fbd [1]=_bf +"\u0021"+_fbd [1];};_cae ,_fe :=ParseCellReference (_fbd [0]);if _fe !=nil {return CellReference {},CellReference {},_fe ;};_eg ,_fe :=ParseCellReference (_fbd [1]);if _fe !=nil {return CellReference {},CellReference {},_fe ;};return _cae ,_eg ,nil ;};
|
||||
|
||||
// ColumnToIndex maps a column to a zero based index (e.g. A = 0, B = 1, AA = 26)
|
||||
func ColumnToIndex (col string )uint32 {col =_d .ToUpper (col );_da :=uint32 (0);for _ ,_af :=range col {_da *=26;_da +=uint32 (_af -'A'+1);};return _da -1;};
|
||||
package reference ;import (_a "errors";_e "fmt";_f "github.com/unidoc/unioffice/spreadsheet/update";_af "regexp";_d "strconv";_c "strings";);
|
||||
|
||||
// IndexToColumn maps a column number to a column name (e.g. 0 = A, 1 = B, 26 = AA)
|
||||
func IndexToColumn (col uint32 )string {var _dbc [64+1]byte ;_bcg :=len (_dbc );_ge :=col ;const _bcf =26;for _ge >=_bcf {_bcg --;_ac :=_ge /_bcf ;_dbc [_bcg ]=byte ('A'+uint (_ge -_ac *_bcf ));_ge =_ac -1;};_bcg --;_dbc [_bcg ]=byte ('A'+uint (_ge ));return string (_dbc [_bcg :]);};
|
||||
func IndexToColumn (col uint32 )string {var _ad [64+1]byte ;_fe :=len (_ad );_dd :=col ;const _fcd =26;for _dd >=_fcd {_fe --;_cfa :=_dd /_fcd ;_ad [_fe ]=byte ('A'+uint (_dd -_cfa *_fcd ));_dd =_cfa -1;};_fe --;_ad [_fe ]=byte ('A'+uint (_dd ));return string (_ad [_fe :]);};
|
||||
|
||||
// ColumnToIndex maps a column to a zero based index (e.g. A = 0, B = 1, AA = 26)
|
||||
func ColumnToIndex (col string )uint32 {col =_c .ToUpper (col );_be :=uint32 (0);for _ ,_bff :=range col {_be *=26;_be +=uint32 (_bff -'A'+1);};return _be -1;};
|
||||
|
||||
// Update updates reference to point one of the neighboring columns with respect to the update type after removing a row/column.
|
||||
func (_cd *ColumnReference )Update (updateType _f .UpdateAction )*ColumnReference {switch updateType {case _f .UpdateActionRemoveColumn :_ba :=_cd ;_ba .ColumnIdx =_cd .ColumnIdx -1;_ba .Column =IndexToColumn (_ba .ColumnIdx );return _ba ;default:return _cd ;};};
|
||||
|
||||
// String returns a string representation of ColumnReference.
|
||||
func (_fd ColumnReference )String ()string {_cc :=make ([]byte ,0,4);if _fd .AbsoluteColumn {_cc =append (_cc ,'$');};_cc =append (_cc ,_fd .Column ...);return string (_cc );};
|
||||
|
||||
// ParseCellReference parses a cell reference of the form 'A10' and splits it
|
||||
// into column/row segments.
|
||||
func ParseCellReference (s string )(CellReference ,error ){s =_d .TrimSpace (s );if len (s )< 2{return CellReference {},_e .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");};_eb :=CellReference {};_g ,_dc ,_ed :=_gf (s );if _ed !=nil {return CellReference {},_ed ;};if _g !=""{_eb .SheetName =_g ;};if s [0]=='$'{_eb .AbsoluteColumn =true ;_dc =_dc [1:];};_ef :=-1;_ce :for _b :=0;_b < len (_dc );_b ++{switch {case _dc [_b ]>='0'&&_dc [_b ]<='9'||_dc [_b ]=='$':_ef =_b ;break _ce ;};};switch _ef {case 0:return CellReference {},_ad .Errorf ("\u006e\u006f\u0020\u006cet\u0074\u0065\u0072\u0020\u0070\u0072\u0065\u0066\u0069\u0078\u0020\u0069\u006e\u0020%\u0073",_dc );case -1:return CellReference {},_ad .Errorf ("\u006eo\u0020d\u0069\u0067\u0069\u0074\u0073\u0020\u0069\u006e\u0020\u0025\u0073",_dc );};_eb .Column =_dc [0:_ef ];if _dc [_ef ]=='$'{_eb .AbsoluteRow =true ;_ef ++;};_eb .ColumnIdx =ColumnToIndex (_eb .Column );_fdc ,_ed :=_f .ParseUint (_dc [_ef :],10,32);if _ed !=nil {return CellReference {},_ad .Errorf ("e\u0072\u0072\u006f\u0072 p\u0061r\u0073\u0069\u006e\u0067\u0020r\u006f\u0077\u003a\u0020\u0025\u0073",_ed );};if _fdc ==0{return CellReference {},_ad .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");};_eb .RowIdx =uint32 (_fdc );return _eb ,nil ;};
|
||||
func ParseCellReference (s string )(CellReference ,error ){s =_c .TrimSpace (s );if len (s )< 2{return CellReference {},_a .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");};_ee :=CellReference {};_bf ,_fc ,_fcc :=_ae (s );if _fcc !=nil {return CellReference {},_fcc ;};if _bf !=""{_ee .SheetName =_bf ;};if s [0]=='$'{_ee .AbsoluteColumn =true ;_fc =_fc [1:];};_ec :=-1;_ca :for _ed :=0;_ed < len (_fc );_ed ++{switch {case _fc [_ed ]>='0'&&_fc [_ed ]<='9'||_fc [_ed ]=='$':_ec =_ed ;break _ca ;};};switch _ec {case 0:return CellReference {},_e .Errorf ("\u006e\u006f\u0020\u006cet\u0074\u0065\u0072\u0020\u0070\u0072\u0065\u0066\u0069\u0078\u0020\u0069\u006e\u0020%\u0073",_fc );case -1:return CellReference {},_e .Errorf ("\u006eo\u0020d\u0069\u0067\u0069\u0074\u0073\u0020\u0069\u006e\u0020\u0025\u0073",_fc );};_ee .Column =_fc [0:_ec ];if _fc [_ec ]=='$'{_ee .AbsoluteRow =true ;_ec ++;};_ee .ColumnIdx =ColumnToIndex (_ee .Column );_ag ,_fcc :=_d .ParseUint (_fc [_ec :],10,32);if _fcc !=nil {return CellReference {},_e .Errorf ("e\u0072\u0072\u006f\u0072 p\u0061r\u0073\u0069\u006e\u0067\u0020r\u006f\u0077\u003a\u0020\u0025\u0073",_fcc );};if _ag ==0{return CellReference {},_e .Errorf ("\u0065\u0072\u0072\u006f\u0072\u0020\u0070\u0061\u0072\u0073i\u006e\u0067\u0020\u0072\u006f\u0077\u003a \u0063\u0061\u006e\u006e\u006f\u0074\u0020\u0062\u0065\u0020\u0030");};_ee .RowIdx =uint32 (_ag );return _ee ,nil ;};
|
||||
|
||||
// ParseRangeReference splits a range reference of the form "A1:B5" into its
|
||||
// components.
|
||||
func ParseRangeReference (s string )(_ea ,_eg CellReference ,_da error ){_bgg ,_aeb ,_da :=_ae (s );if _da !=nil {return CellReference {},CellReference {},_da ;};_bffg :=_c .Split (_aeb ,"\u003a");if len (_bffg )!=2{return CellReference {},CellReference {},_a .New ("i\u006ev\u0061\u006c\u0069\u0064\u0020\u0072\u0061\u006eg\u0065\u0020\u0066\u006frm\u0061\u0074");};if _bgg !=""{_bffg [0]=_bgg +"\u0021"+_bffg [0];_bffg [1]=_bgg +"\u0021"+_bffg [1];};_bfb ,_da :=ParseCellReference (_bffg [0]);if _da !=nil {return CellReference {},CellReference {},_da ;};_eaa ,_da :=ParseCellReference (_bffg [1]);if _da !=nil {return CellReference {},CellReference {},_da ;};return _bfb ,_eaa ,nil ;};
|
||||
|
||||
// String returns a string representation of CellReference.
|
||||
func (_bd CellReference )String ()string {_bc :=make ([]byte ,0,4);if _bd .AbsoluteColumn {_bc =append (_bc ,'$');};_bc =append (_bc ,_bd .Column ...);if _bd .AbsoluteRow {_bc =append (_bc ,'$');};_bc =_d .AppendInt (_bc ,int64 (_bd .RowIdx ),10);return string (_bc );};var _cf =_af .MustCompile ("^\u005b\u0061\u002d\u007aA-\u005a]\u0028\u005b\u0061\u002d\u007aA\u002d\u005a\u005d\u003f\u0029\u0024");
|
||||
|
||||
// ParseColumnRangeReference splits a range reference of the form "A:B" into its
|
||||
// components.
|
||||
func ParseColumnRangeReference (s string )(_cf ,_ec ColumnReference ,_fee error ){_ag :="";_fda :=_d .Split (s ,"\u0021");if len (_fda )==2{_ag =_fda [0];s =_fda [1];};_cec :=_d .Split (s ,"\u003a");if len (_cec )!=2{return ColumnReference {},ColumnReference {},_e .New ("i\u006ev\u0061\u006c\u0069\u0064\u0020\u0072\u0061\u006eg\u0065\u0020\u0066\u006frm\u0061\u0074");};if _ag !=""{_cec [0]=_ag +"\u0021"+_cec [0];_cec [1]=_ag +"\u0021"+_cec [1];};_bef ,_fee :=ParseColumnReference (_cec [0]);if _fee !=nil {return ColumnReference {},ColumnReference {},_fee ;};_gg ,_fee :=ParseColumnReference (_cec [1]);if _fee !=nil {return ColumnReference {},ColumnReference {},_fee ;};return _bef ,_gg ,nil ;};
|
||||
func ParseColumnRangeReference (s string )(_egf ,_fa ColumnReference ,_cdd error ){_ff :="";_cac :=_c .Split (s ,"\u0021");if len (_cac )==2{_ff =_cac [0];s =_cac [1];};_ffd :=_c .Split (s ,"\u003a");if len (_ffd )!=2{return ColumnReference {},ColumnReference {},_a .New ("i\u006ev\u0061\u006c\u0069\u0064\u0020\u0072\u0061\u006eg\u0065\u0020\u0066\u006frm\u0061\u0074");};if _ff !=""{_ffd [0]=_ff +"\u0021"+_ffd [0];_ffd [1]=_ff +"\u0021"+_ffd [1];};_gf ,_cdd :=ParseColumnReference (_ffd [0]);if _cdd !=nil {return ColumnReference {},ColumnReference {},_cdd ;};_dbf ,_cdd :=ParseColumnReference (_ffd [1]);if _cdd !=nil {return ColumnReference {},ColumnReference {},_cdd ;};return _gf ,_dbf ,nil ;};func _ae (_ecc string )(string ,string ,error ){_g :="";_bg :=_c .LastIndex (_ecc ,"\u0021");if _bg > -1{_g =_ecc [:_bg ];_ecc =_ecc [_bg +1:];if _g ==""{return "","",_a .New ("\u0049n\u0076a\u006c\u0069\u0064\u0020\u0073h\u0065\u0065t\u0020\u006e\u0061\u006d\u0065");};};return _g ,_ecc ,nil ;};
|
||||
|
||||
// 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 =_c .TrimSpace (s );if len (s )< 1{return ColumnReference {},_a .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");};_db :=ColumnReference {};_fcg ,_ce ,_dbb :=_ae (s );if _dbb !=nil {return ColumnReference {},_dbb ;};if _fcg !=""{_db .SheetName =_fcg ;};if _ce [0]=='$'{_db .AbsoluteColumn =true ;_ce =_ce [1:];};if !_cf .MatchString (_ce ){return ColumnReference {},_a .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");};_db .Column =_ce ;_db .ColumnIdx =ColumnToIndex (_db .Column );return _db ,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 _cc =_c .MustCompile ("^\u005b\u0061\u002d\u007aA-\u005a]\u0028\u005b\u0061\u002d\u007aA\u002d\u005a\u005d\u003f\u0029\u0024");
|
||||
type CellReference struct{RowIdx uint32 ;ColumnIdx uint32 ;Column string ;AbsoluteColumn bool ;AbsoluteRow bool ;SheetName string ;};
|
||||
|
||||
// ColumnReference is a parsed reference to a column. Input is of the form 'A',
|
||||
// '$C', etc.
|
||||
type ColumnReference struct{ColumnIdx uint32 ;Column string ;AbsoluteColumn bool ;SheetName string ;};
|
||||
|
||||
// Update updates reference to point one of the neighboring cells with respect to the update type after removing a row/column.
|
||||
func (_ac *CellReference )Update (updateType _f .UpdateAction )*CellReference {switch updateType {case _f .UpdateActionRemoveColumn :_bfc :=_ac ;_bfc .ColumnIdx =_ac .ColumnIdx -1;_bfc .Column =IndexToColumn (_bfc .ColumnIdx );return _bfc ;default:return _ac ;};};
|
File diff suppressed because one or more lines are too long
@ -10,7 +10,10 @@
|
||||
// terms that can be accessed at https://unidoc.io/eula/
|
||||
|
||||
// Package update contains definitions needed for updating references after removing rows/columns.
|
||||
package update ;const (UpdateActionRemoveColumn UpdateAction =iota ;);
|
||||
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 ;};
|
||||
|
||||
// UpdateAction is the type for update types constants.
|
||||
type UpdateAction byte ;
|
||||
UpdateCurrentSheet bool ;};const (UpdateActionRemoveColumn UpdateAction =iota ;);
|
138
unioffice.go
138
unioffice.go
File diff suppressed because one or more lines are too long
@ -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 (_ae "encoding/xml";_g "fmt";_f "github.com/unidoc/unioffice";_e "github.com/unidoc/unioffice/common/logger";_fd "github.com/unidoc/unioffice/schema/soo/ofc/sharedTypes";_ag "github.com/unidoc/unioffice/schema/urn/schemas_microsoft_com/office/excel";_d "github.com/unidoc/unioffice/schema/urn/schemas_microsoft_com/vml";_ga "strconv";_ge "strings";);func (_ddb *Container )UnmarshalXML (d *_ae .Decoder ,start _ae .StartElement )error {_ddb .Shape =nil ;_ce :for {_gf ,_ddc :=d .Token ();if _ddc !=nil {return _ddc ;};switch _ca :=_gf .(type ){case _ae .StartElement :switch _ca .Name .Local {case "s\u0068\u0061\u0070\u0065\u006c\u0061\u0079\u006f\u0075\u0074":_ddb .Layout =_d .NewOfcShapelayout ();if _ee :=d .DecodeElement (_ddb .Layout ,&_ca );_ee !=nil {return _ee ;};case "\u0073h\u0061\u0070\u0065\u0074\u0079\u0070e":_ddb .ShapeType =_d .NewShapetype ();if _dge :=d .DecodeElement (_ddb .ShapeType ,&_ca );_dge !=nil {return _dge ;};case "\u0073\u0068\u0061p\u0065":_db :=_d .NewShape ();if _fec :=d .DecodeElement (_db ,&_ca );_fec !=nil {return _fec ;};_ddb .Shape =append (_ddb .Shape ,_db );};case _ae .EndElement :break _ce ;};};return nil ;};const (ShapeStylePositionAbsolute ="\u0061\u0062\u0073\u006f\u006c\u0075\u0074\u0065";ShapeStylePositionRelative ="\u0072\u0065\u006c\u0061\u0074\u0069\u0076\u0065";);
|
||||
|
||||
// SetBold sets text to bold.
|
||||
func (_eba *TextpathStyle )SetBold (bold bool ){_eba ._af =bold };
|
||||
|
||||
// FontSize returns fontSize of the text.
|
||||
func (_ba *TextpathStyle )FontSize ()int64 {return _ba ._ffa };
|
||||
|
||||
// Top get top attribute of shape style.
|
||||
func (_ea *ShapeStyle )Top ()float64 {return _ea ._cc };type Container struct{Layout *_d .OfcShapelayout ;ShapeType *_d .Shapetype ;Shape []*_d .Shape ;};
|
||||
|
||||
// SetFontSize sets text's fontSize.
|
||||
func (_cdb *TextpathStyle )SetFontSize (fontSize int64 ){_cdb ._ffa =fontSize };
|
||||
|
||||
// Position get position attribute of shape style.
|
||||
func (_cea *ShapeStyle )Position ()string {return _cea ._ed };
|
||||
package vmldrawing ;import (_f "encoding/xml";_d "fmt";_a "github.com/unidoc/unioffice";_c "github.com/unidoc/unioffice/common/logger";_ac "github.com/unidoc/unioffice/schema/soo/ofc/sharedTypes";_ag "github.com/unidoc/unioffice/schema/urn/schemas_microsoft_com/office/excel";_ad "github.com/unidoc/unioffice/schema/urn/schemas_microsoft_com/vml";_ef "strconv";_e "strings";);
|
||||
|
||||
// SetItalic sets text to italic.
|
||||
func (_dbe *TextpathStyle )SetItalic (italic bool ){_dbe ._gfgb =italic };
|
||||
func (_gga *TextpathStyle )SetItalic (italic bool ){_gga ._dcf =italic };
|
||||
|
||||
// SetFontFamily sets text's fontFamily.
|
||||
func (_cbgd *TextpathStyle )SetFontFamily (fontFamily string ){_cbgd ._gb =fontFamily };
|
||||
|
||||
// IsBold returns true if text is bold.
|
||||
func (_gedf *TextpathStyle )IsBold ()bool {return _gedf ._af };
|
||||
|
||||
// ToString generate string of TextpathStyle.
|
||||
func (_geef *TextpathStyle )String ()string {_cg :="";_cg +=_g .Sprintf ("\u0066o\u006et\u002d\u0066\u0061\u006d\u0069\u006c\u0079\u003a\u0025\u0073\u003b",_geef ._gb );_cg +=_g .Sprintf ("\u0066o\u006et\u002d\u0073\u0069\u007a\u0065\u003a\u0025\u0064\u0070\u0074\u003b",_geef ._ffa );if _geef ._gfgb {_cg +=_g .Sprintf ("\u0066o\u006et\u002d\u0073\u0074\u0079\u006ce\u003a\u0069t\u0061\u006c\u0069\u0063\u003b");};if _geef ._af {_cg +=_g .Sprintf ("\u0066\u006f\u006e\u0074\u002d\u0077\u0065\u0069\u0067\u0068\u0074\u003ab\u006f\u006c\u0064\u003b");};return _cg ;};
|
||||
|
||||
// Margins get margin top, left, bottom, and right of shape style.
|
||||
func (_fb *ShapeStyle )Margins ()(float64 ,float64 ,float64 ,float64 ){return _fb ._cad ,_fb ._gcf ,_fb ._ef ,_fb ._b ;};func (_dd *Container )MarshalXML (e *_ae .Encoder ,start _ae .StartElement )error {start .Attr =append (start .Attr ,_ae .Attr {Name :_ae .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 ,_ae .Attr {Name :_ae .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 ,_ae .Attr {Name :_ae .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 _dd .Layout !=nil {_c :=_ae .StartElement {Name :_ae .Name {Local :"\u006f\u003a\u0073\u0068\u0061\u0070\u0065\u006c\u0061\u0079\u006f\u0075\u0074"}};e .EncodeElement (_dd .Layout ,_c );};if _dd .ShapeType !=nil {_dg :=_ae .StartElement {Name :_ae .Name {Local :"v\u003a\u0073\u0068\u0061\u0070\u0065\u0074\u0079\u0070\u0065"}};e .EncodeElement (_dd .ShapeType ,_dg );};for _ ,_cbg :=range _dd .Shape {_dgg :=_ae .StartElement {Name :_ae .Name {Local :"\u0076:\u0073\u0068\u0061\u0070\u0065"}};e .EncodeElement (_cbg ,_dgg );};return e .EncodeToken (_ae .EndElement {Name :start .Name });};
|
||||
|
||||
// IsItalic returns true if text is italic.
|
||||
func (_cdc *TextpathStyle )IsItalic ()bool {return _cdc ._gfgb };
|
||||
|
||||
// NewTextpathStyle accept value of string style attribute of element v:textpath and format it to generate TextpathStyle.
|
||||
func NewTextpathStyle (style string )TextpathStyle {_gbd :=TextpathStyle {_gb :"\u0022C\u0061\u006c\u0069\u0062\u0072\u0069\"",_ffa :44,_af :false ,_gfgb :false };_eed :=_ge .Split (style ,"\u003b");for _ ,_eee :=range _eed {_dafe :=_ge .Split (_eee ,"\u003a");if len (_dafe )!=2{continue ;};switch _dafe [0]{case "f\u006f\u006e\u0074\u002d\u0066\u0061\u006d\u0069\u006c\u0079":_gbd ._gb =_dafe [1];break ;case "\u0066o\u006e\u0074\u002d\u0073\u0069\u007ae":_gbd ._ffa ,_ =_ga .ParseInt (_ge .ReplaceAll (_dafe [1],"\u0070\u0074",""),10,64);break ;case "f\u006f\u006e\u0074\u002d\u0077\u0065\u0069\u0067\u0068\u0074":_gbd ._af =_dafe [1]=="\u0062\u006f\u006c\u0064";break ;case "\u0066\u006f\u006e\u0074\u002d\u0073\u0074\u0079\u006c\u0065":_gbd ._gfgb =_dafe [1]=="\u0069\u0074\u0061\u006c\u0069\u0063";break ;};};return _gbd ;};
|
||||
|
||||
// MSOPositionVerticalRelative get `mso-position-vertical-relative` attribute of shape style.
|
||||
func (_daf *ShapeStyle )MSOPositionVerticalRelative ()string {return _daf ._bf };
|
||||
// Top get top attribute of shape style.
|
||||
func (_gd *ShapeStyle )Top ()float64 {return _gd ._age };func (_cb *Container )MarshalXML (e *_f .Encoder ,start _f .StartElement )error {start .Attr =append (start .Attr ,_f .Attr {Name :_f .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 ,_f .Attr {Name :_f .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 ,_f .Attr {Name :_f .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 _cb .Layout !=nil {_cc :=_f .StartElement {Name :_f .Name {Local :"\u006f\u003a\u0073\u0068\u0061\u0070\u0065\u006c\u0061\u0079\u006f\u0075\u0074"}};e .EncodeElement (_cb .Layout ,_cc );};if _cb .ShapeType !=nil {_af :=_f .StartElement {Name :_f .Name {Local :"v\u003a\u0073\u0068\u0061\u0070\u0065\u0074\u0079\u0070\u0065"}};e .EncodeElement (_cb .ShapeType ,_af );};for _ ,_ab :=range _cb .Shape {_de :=_f .StartElement {Name :_f .Name {Local :"\u0076:\u0073\u0068\u0061\u0070\u0065"}};e .EncodeElement (_ab ,_de );};return e .EncodeToken (_f .EndElement {Name :start .Name });};
|
||||
|
||||
// NewCommentDrawing constructs a new comment drawing.
|
||||
func NewCommentDrawing ()*Container {_fe :=NewContainer ();_fe .Layout =_d .NewOfcShapelayout ();_fe .Layout .ExtAttr =_d .ST_ExtEdit ;_fe .Layout .Idmap =_d .NewOfcCT_IdMap ();_fe .Layout .Idmap .DataAttr =_f .String ("\u0031");_fe .Layout .Idmap .ExtAttr =_d .ST_ExtEdit ;_fe .ShapeType =_d .NewShapetype ();_fe .ShapeType .IdAttr =_f .String ("_\u0078\u0030\u0030\u0030\u0030\u005f\u0074\u0032\u0030\u0032");_fe .ShapeType .CoordsizeAttr =_f .String ("2\u0031\u0036\u0030\u0030\u002c\u0032\u0031\u0036\u0030\u0030");_fe .ShapeType .SptAttr =_f .Float32 (202);_fe .ShapeType .PathAttr =_f .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");_agc :=_d .NewEG_ShapeElements ();_fe .ShapeType .EG_ShapeElements =append (_fe .ShapeType .EG_ShapeElements ,_agc );_agc .Path =_d .NewPath ();_agc .Path .GradientshapeokAttr =_fd .ST_TrueFalseT ;_agc .Path .ConnecttypeAttr =_d .OfcST_ConnectTypeRect ;return _fe ;};
|
||||
func NewCommentDrawing ()*Container {_eb :=NewContainer ();_eb .Layout =_ad .NewOfcShapelayout ();_eb .Layout .ExtAttr =_ad .ST_ExtEdit ;_eb .Layout .Idmap =_ad .NewOfcCT_IdMap ();_eb .Layout .Idmap .DataAttr =_a .String ("\u0031");_eb .Layout .Idmap .ExtAttr =_ad .ST_ExtEdit ;_eb .ShapeType =_ad .NewShapetype ();_eb .ShapeType .IdAttr =_a .String ("_\u0078\u0030\u0030\u0030\u0030\u005f\u0074\u0032\u0030\u0032");_eb .ShapeType .CoordsizeAttr =_a .String ("2\u0031\u0036\u0030\u0030\u002c\u0032\u0031\u0036\u0030\u0030");_eb .ShapeType .SptAttr =_a .Float32 (202);_eb .ShapeType .PathAttr =_a .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");_gb :=_ad .NewEG_ShapeElements ();_eb .ShapeType .EG_ShapeElements =append (_eb .ShapeType .EG_ShapeElements ,_gb );_gb .Path =_ad .NewPath ();_gb .Path .GradientshapeokAttr =_ac .ST_TrueFalseT ;_gb .Path .ConnecttypeAttr =_ad .OfcST_ConnectTypeRect ;return _eb ;};
|
||||
|
||||
// TextpathStyle is style attribute of element v:textpath.
|
||||
type TextpathStyle struct{_gb string ;_ffa int64 ;_af bool ;_gfgb bool ;};
|
||||
// NewTextpathStyle accept value of string style attribute of element v:textpath and format it to generate TextpathStyle.
|
||||
func NewTextpathStyle (style string )TextpathStyle {_cbd :=TextpathStyle {_eg :"\u0022C\u0061\u006c\u0069\u0062\u0072\u0069\"",_gc :44,_acbd :false ,_dcf :false };_cd :=_e .Split (style ,"\u003b");for _ ,_gbc :=range _cd {_gbce :=_e .Split (_gbc ,"\u003a");if len (_gbce )!=2{continue ;};switch _gbce [0]{case "f\u006f\u006e\u0074\u002d\u0066\u0061\u006d\u0069\u006c\u0079":_cbd ._eg =_gbce [1];break ;case "\u0066o\u006e\u0074\u002d\u0073\u0069\u007ae":_cbd ._gc ,_ =_ef .ParseInt (_e .ReplaceAll (_gbce [1],"\u0070\u0074",""),10,64);break ;case "f\u006f\u006e\u0074\u002d\u0077\u0065\u0069\u0067\u0068\u0074":_cbd ._acbd =_gbce [1]=="\u0062\u006f\u006c\u0064";break ;case "\u0066\u006f\u006e\u0074\u002d\u0073\u0074\u0079\u006c\u0065":_cbd ._dcf =_gbce [1]=="\u0069\u0074\u0061\u006c\u0069\u0063";break ;};};return _cbd ;};
|
||||
|
||||
// SetWidth set width of shape.
|
||||
func (_ab *ShapeStyle )SetWidth (width float64 ){_ab ._gfa =width };
|
||||
// SetBold sets text to bold.
|
||||
func (_dg *TextpathStyle )SetBold (bold bool ){_dg ._acbd =bold };
|
||||
|
||||
// ShapeStyle is style attribute of v:shape element.
|
||||
type ShapeStyle struct{_adc string ;_fc float64 ;_ee float64 ;_fa float64 ;_b float64 ;_age float64 ;_gf float64 ;_aga float64 ;_ec float64 ;_gfd float64 ;_gg float64 ;_afb int64 ;_db string ;_be string ;_fdd string ;_ebd string ;};
|
||||
|
||||
// FontFamily returns fontFamily of the text.
|
||||
func (_efb *TextpathStyle )FontFamily ()string {return _efb ._eg };
|
||||
|
||||
// Height return height of shape.
|
||||
func (_eff *ShapeStyle )Height ()float64 {return _eff ._dbf };
|
||||
func (_bed *ShapeStyle )Height ()float64 {return _bed ._gg };
|
||||
|
||||
// MSOPositionHorizontalRelative get `mso-position-horizontal-relative` attribute of shape style.
|
||||
func (_df *ShapeStyle )MSOPositionHorizontalRelative ()string {return _df ._dca };
|
||||
// Left get left attribute of shape style.
|
||||
func (_aec *ShapeStyle )Left ()float64 {return _aec ._gf };
|
||||
|
||||
// CreateFormula creates F element for typeFormulas.
|
||||
func CreateFormula (s string )*_d .CT_F {_ead :=_d .NewCT_F ();_ead .EqnAttr =&s ;return _ead };func NewContainer ()*Container {return &Container {}};
|
||||
// SetFontSize sets text's fontSize.
|
||||
func (_dbcb *TextpathStyle )SetFontSize (fontSize int64 ){_dbcb ._gc =fontSize };
|
||||
|
||||
// IsBold returns true if text is bold.
|
||||
func (_ggf *TextpathStyle )IsBold ()bool {return _ggf ._acbd };
|
||||
|
||||
// ToString formatting ShapeStyle to string.
|
||||
func (_cee *ShapeStyle )String ()string {_ca :="";_ca +=_d .Sprintf ("\u0070\u006f\u0073i\u0074\u0069\u006f\u006e\u003a\u0025\u0073\u003b",_cee ._adc );_ca +=_d .Sprintf ("\u006da\u0072g\u0069\u006e\u002d\u006c\u0065\u0066\u0074\u003a\u0025\u0064\u003b",int64 (_cee ._ee ));_ca +=_d .Sprintf ("\u006d\u0061\u0072\u0067\u0069\u006e\u002d\u0074\u006fp\u003a\u0025\u0064\u003b",int64 (_cee ._fc ));_ca +=_d .Sprintf ("w\u0069\u0064\u0074\u0068\u003a\u0025\u0064\u0070\u0074\u003b",int64 (_cee ._gfd ));_ca +=_d .Sprintf ("\u0068\u0065\u0069g\u0068\u0074\u003a\u0025\u0064\u0070\u0074\u003b",int64 (_cee ._gg ));_ca +=_d .Sprintf ("z\u002d\u0069\u006e\u0064\u0065\u0078\u003a\u0025\u0064\u003b",_cee ._afb );_ca +=_d .Sprintf ("m\u0073\u006f\u002d\u0070\u006f\u0073i\u0074\u0069\u006f\u006e\u002d\u0068\u006f\u0072\u0069z\u006f\u006e\u0074a\u006c:\u0025\u0073\u003b",_cee ._db );_ca +=_d .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",_cee ._be );_ca +=_d .Sprintf ("\u006ds\u006f\u002d\u0070\u006fs\u0069\u0074\u0069\u006f\u006e-\u0076e\u0072t\u0069\u0063\u0061\u006c\u003a\u0025\u0073;",_cee ._fdd );_ca +=_d .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",_cee ._ebd );return _ca ;};type Container struct{Layout *_ad .OfcShapelayout ;ShapeType *_ad .Shapetype ;Shape []*_ad .Shape ;};
|
||||
|
||||
// SetHeight set height of shape.
|
||||
func (_dbc *ShapeStyle )SetHeight (height float64 ){_dbc ._gg =height };func (_ed *Container )UnmarshalXML (d *_f .Decoder ,start _f .StartElement )error {_ed .Shape =nil ;_cca :for {_dc ,_ga :=d .Token ();if _ga !=nil {return _ga ;};switch _dcc :=_dc .(type ){case _f .StartElement :switch _dcc .Name .Local {case "s\u0068\u0061\u0070\u0065\u006c\u0061\u0079\u006f\u0075\u0074":_ed .Layout =_ad .NewOfcShapelayout ();if _df :=d .DecodeElement (_ed .Layout ,&_dcc );_df !=nil {return _df ;};case "\u0073h\u0061\u0070\u0065\u0074\u0079\u0070e":_ed .ShapeType =_ad .NewShapetype ();if _da :=d .DecodeElement (_ed .ShapeType ,&_dcc );_da !=nil {return _da ;};case "\u0073\u0068\u0061p\u0065":_fg :=_ad .NewShape ();if _cbf :=d .DecodeElement (_fg ,&_dcc );_cbf !=nil {return _cbf ;};_ed .Shape =append (_ed .Shape ,_fg );};case _f .EndElement :break _cca ;};};return nil ;};
|
||||
|
||||
// Margins get margin top, left, bottom, and right of shape style.
|
||||
func (_ce *ShapeStyle )Margins ()(float64 ,float64 ,float64 ,float64 ){return _ce ._fc ,_ce ._ee ,_ce ._fa ,_ce ._b ;};
|
||||
|
||||
// NewCommentShape creates a new comment shape for a given cell index. The
|
||||
// indices here are zero based.
|
||||
func NewCommentShape (col ,row int64 )*_d .Shape {_ad :=_d .NewShape ();_ad .IdAttr =_f .String (_g .Sprintf ("\u0063\u0073\u005f\u0025\u0064\u005f\u0025\u0064",col ,row ));_ad .TypeAttr =_f .String ("\u0023\u005f\u00780\u0030\u0030\u0030\u005f\u0074\u0032\u0030\u0032");_ad .StyleAttr =_f .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");_ad .FillcolorAttr =_f .String ("\u0023f\u0062\u0066\u0036\u0064\u0036");_ad .StrokecolorAttr =_f .String ("\u0023e\u0064\u0065\u0061\u0061\u0031");_da :=_d .NewEG_ShapeElements ();_da .Fill =_d .NewFill ();_da .Fill .Color2Attr =_f .String ("\u0023f\u0062\u0066\u0065\u0038\u0032");_da .Fill .AngleAttr =_f .Float64 (-180);_da .Fill .TypeAttr =_d .ST_FillTypeGradient ;_da .Fill .Fill =_d .NewOfcFill ();_da .Fill .Fill .ExtAttr =_d .ST_ExtView ;_da .Fill .Fill .TypeAttr =_d .OfcST_FillTypeGradientUnscaled ;_ad .EG_ShapeElements =append (_ad .EG_ShapeElements ,_da );_gc :=_d .NewEG_ShapeElements ();_gc .Shadow =_d .NewShadow ();_gc .Shadow .OnAttr =_fd .ST_TrueFalseT ;_gc .Shadow .ObscuredAttr =_fd .ST_TrueFalseT ;_ad .EG_ShapeElements =append (_ad .EG_ShapeElements ,_gc );_fa :=_d .NewEG_ShapeElements ();_fa .Path =_d .NewPath ();_fa .Path .ConnecttypeAttr =_d .OfcST_ConnectTypeNone ;_ad .EG_ShapeElements =append (_ad .EG_ShapeElements ,_fa );_dc :=_d .NewEG_ShapeElements ();_dc .Textbox =_d .NewTextbox ();_dc .Textbox .StyleAttr =_f .String ("\u006d\u0073\u006f\u002ddi\u0072\u0065\u0063\u0074\u0069\u006f\u006e\u002d\u0061\u006c\u0074\u003a\u0061\u0075t\u006f");_ad .EG_ShapeElements =append (_ad .EG_ShapeElements ,_dc );_dcd :=_d .NewEG_ShapeElements ();_dcd .ClientData =_ag .NewClientData ();_dcd .ClientData .ObjectTypeAttr =_ag .ST_ObjectTypeNote ;_dcd .ClientData .MoveWithCells =_fd .ST_TrueFalseBlankT ;_dcd .ClientData .SizeWithCells =_fd .ST_TrueFalseBlankT ;_dcd .ClientData .Anchor =_f .String ("\u0031,\u0020\u0031\u0035\u002c\u0020\u0030\u002c\u0020\u0032\u002c\u00202\u002c\u0020\u0035\u0034\u002c\u0020\u0035\u002c\u0020\u0033");_dcd .ClientData .AutoFill =_fd .ST_TrueFalseBlankFalse ;_dcd .ClientData .Row =_f .Int64 (row );_dcd .ClientData .Column =_f .Int64 (col );_ad .EG_ShapeElements =append (_ad .EG_ShapeElements ,_dcd );return _ad ;};
|
||||
|
||||
// ShapeStyle is style attribute of v:shape element.
|
||||
type ShapeStyle struct{_ed string ;_cad float64 ;_gcf float64 ;_ef float64 ;_b float64 ;_cc float64 ;_gee float64 ;_eb float64 ;_fag float64 ;_gfa float64 ;_dbf float64 ;_fed int64 ;_fdf string ;_dca string ;_ccb string ;_bf string ;};
|
||||
func NewCommentShape (col ,row int64 )*_ad .Shape {_fb :=_ad .NewShape ();_fb .IdAttr =_a .String (_d .Sprintf ("\u0063\u0073\u005f\u0025\u0064\u005f\u0025\u0064",col ,row ));_fb .TypeAttr =_a .String ("\u0023\u005f\u00780\u0030\u0030\u0030\u005f\u0074\u0032\u0030\u0032");_fb .StyleAttr =_a .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");_fb .FillcolorAttr =_a .String ("\u0023f\u0062\u0066\u0036\u0064\u0036");_fb .StrokecolorAttr =_a .String ("\u0023e\u0064\u0065\u0061\u0061\u0031");_ff :=_ad .NewEG_ShapeElements ();_ff .Fill =_ad .NewFill ();_ff .Fill .Color2Attr =_a .String ("\u0023f\u0062\u0066\u0065\u0038\u0032");_ff .Fill .AngleAttr =_a .Float64 (-180);_ff .Fill .TypeAttr =_ad .ST_FillTypeGradient ;_ff .Fill .Fill =_ad .NewOfcFill ();_ff .Fill .Fill .ExtAttr =_ad .ST_ExtView ;_ff .Fill .Fill .TypeAttr =_ad .OfcST_FillTypeGradientUnscaled ;_fb .EG_ShapeElements =append (_fb .EG_ShapeElements ,_ff );_aca :=_ad .NewEG_ShapeElements ();_aca .Shadow =_ad .NewShadow ();_aca .Shadow .OnAttr =_ac .ST_TrueFalseT ;_aca .Shadow .ObscuredAttr =_ac .ST_TrueFalseT ;_fb .EG_ShapeElements =append (_fb .EG_ShapeElements ,_aca );_fd :=_ad .NewEG_ShapeElements ();_fd .Path =_ad .NewPath ();_fd .Path .ConnecttypeAttr =_ad .OfcST_ConnectTypeNone ;_fb .EG_ShapeElements =append (_fb .EG_ShapeElements ,_fd );_ae :=_ad .NewEG_ShapeElements ();_ae .Textbox =_ad .NewTextbox ();_ae .Textbox .StyleAttr =_a .String ("\u006d\u0073\u006f\u002ddi\u0072\u0065\u0063\u0074\u0069\u006f\u006e\u002d\u0061\u006c\u0074\u003a\u0061\u0075t\u006f");_fb .EG_ShapeElements =append (_fb .EG_ShapeElements ,_ae );_cf :=_ad .NewEG_ShapeElements ();_cf .ClientData =_ag .NewClientData ();_cf .ClientData .ObjectTypeAttr =_ag .ST_ObjectTypeNote ;_cf .ClientData .MoveWithCells =_ac .ST_TrueFalseBlankT ;_cf .ClientData .SizeWithCells =_ac .ST_TrueFalseBlankT ;_cf .ClientData .Anchor =_a .String ("\u0031,\u0020\u0031\u0035\u002c\u0020\u0030\u002c\u0020\u0032\u002c\u00202\u002c\u0020\u0035\u0034\u002c\u0020\u0035\u002c\u0020\u0033");_cf .ClientData .AutoFill =_ac .ST_TrueFalseBlankFalse ;_cf .ClientData .Row =_a .Int64 (row );_cf .ClientData .Column =_a .Int64 (col );_fb .EG_ShapeElements =append (_fb .EG_ShapeElements ,_cf );return _fb ;};
|
||||
|
||||
// Width return width of shape.
|
||||
func (_gfg *ShapeStyle )Width ()float64 {return _gfg ._gfa };
|
||||
func (_eec *ShapeStyle )Width ()float64 {return _eec ._gfd };
|
||||
|
||||
// Left get left attribute of shape style.
|
||||
func (_gg *ShapeStyle )Left ()float64 {return _gg ._gee };
|
||||
// MSOPositionVerticalRelative get `mso-position-vertical-relative` attribute of shape style.
|
||||
func (_ebg *ShapeStyle )MSOPositionVerticalRelative ()string {return _ebg ._ebd };
|
||||
|
||||
// Right get right attribute of shape style.
|
||||
func (_ffb *ShapeStyle )Right ()float64 {return _ffb ._fag };
|
||||
|
||||
// FontFamily returns fontFamily of the text.
|
||||
func (_cbb *TextpathStyle )FontFamily ()string {return _cbb ._gb };
|
||||
|
||||
// SetHeight set height of shape.
|
||||
func (_gfd *ShapeStyle )SetHeight (height float64 ){_gfd ._dbf =height };
|
||||
|
||||
// ToString formatting ShapeStyle to string.
|
||||
func (_bfg *ShapeStyle )String ()string {_fedb :="";_fedb +=_g .Sprintf ("\u0070\u006f\u0073i\u0074\u0069\u006f\u006e\u003a\u0025\u0073\u003b",_bfg ._ed );_fedb +=_g .Sprintf ("\u006da\u0072g\u0069\u006e\u002d\u006c\u0065\u0066\u0074\u003a\u0025\u0064\u003b",int64 (_bfg ._gcf ));_fedb +=_g .Sprintf ("\u006d\u0061\u0072\u0067\u0069\u006e\u002d\u0074\u006fp\u003a\u0025\u0064\u003b",int64 (_bfg ._cad ));_fedb +=_g .Sprintf ("w\u0069\u0064\u0074\u0068\u003a\u0025\u0064\u0070\u0074\u003b",int64 (_bfg ._gfa ));_fedb +=_g .Sprintf ("\u0068\u0065\u0069g\u0068\u0074\u003a\u0025\u0064\u0070\u0074\u003b",int64 (_bfg ._dbf ));_fedb +=_g .Sprintf ("z\u002d\u0069\u006e\u0064\u0065\u0078\u003a\u0025\u0064\u003b",_bfg ._fed );_fedb +=_g .Sprintf ("m\u0073\u006f\u002d\u0070\u006f\u0073i\u0074\u0069\u006f\u006e\u002d\u0068\u006f\u0072\u0069z\u006f\u006e\u0074a\u006c:\u0025\u0073\u003b",_bfg ._fdf );_fedb +=_g .Sprintf ("\u006d\u0073o-\u0070\u006f\u0073i\u0074\u0069\u006f\u006e-ho\u0072iz\u006f\u006e\u0074\u0061\u006c\u002d\u0072el\u0061\u0074\u0069\u0076\u0065\u003a\u0025s\u003b",_bfg ._dca );_fedb +=_g .Sprintf ("\u006ds\u006f\u002d\u0070\u006fs\u0069\u0074\u0069\u006f\u006e-\u0076e\u0072t\u0069\u0063\u0061\u006c\u003a\u0025\u0073;",_bfg ._ccb );_fedb +=_g .Sprintf ("\u006d\u0073\u006f-p\u006f\u0073\u0069\u0074\u0069\u006f\u006e\u002d\u0076e\u0072t\u0069c\u0061l\u002d\u0072\u0065\u006c\u0061\u0074\u0069\u0076\u0065\u003a\u0025\u0073\u003b",_bfg ._bf );return _fedb ;};
|
||||
// MSOPositionHorizontalRelative get `mso-position-horizontal-relative` attribute of shape style.
|
||||
func (_fdc *ShapeStyle )MSOPositionHorizontalRelative ()string {return _fdc ._be };
|
||||
|
||||
// Bottom get bottom attribute of shape style.
|
||||
func (_dad *ShapeStyle )Bottom ()float64 {return _dad ._eb };
|
||||
func (_bd *ShapeStyle )Bottom ()float64 {return _bd ._aga };
|
||||
|
||||
// Position get position attribute of shape style.
|
||||
func (_ggc *ShapeStyle )Position ()string {return _ggc ._adc };
|
||||
|
||||
// Right get right attribute of shape style.
|
||||
func (_adf *ShapeStyle )Right ()float64 {return _adf ._ec };
|
||||
|
||||
// CreateFormula creates F element for typeFormulas.
|
||||
func CreateFormula (s string )*_ad .CT_F {_bde :=_ad .NewCT_F ();_bde .EqnAttr =&s ;return _bde };
|
||||
|
||||
// IsItalic returns true if text is italic.
|
||||
func (_fdb *TextpathStyle )IsItalic ()bool {return _fdb ._dcf };
|
||||
|
||||
// ToString generate string of TextpathStyle.
|
||||
func (_acf *TextpathStyle )String ()string {_aa :="";_aa +=_d .Sprintf ("\u0066o\u006et\u002d\u0066\u0061\u006d\u0069\u006c\u0079\u003a\u0025\u0073\u003b",_acf ._eg );_aa +=_d .Sprintf ("\u0066o\u006et\u002d\u0073\u0069\u007a\u0065\u003a\u0025\u0064\u0070\u0074\u003b",_acf ._gc );if _acf ._dcf {_aa +=_d .Sprintf ("\u0066o\u006et\u002d\u0073\u0074\u0079\u006ce\u003a\u0069t\u0061\u006c\u0069\u0063\u003b");};if _acf ._acbd {_aa +=_d .Sprintf ("\u0066\u006f\u006e\u0074\u002d\u0077\u0065\u0069\u0067\u0068\u0074\u003ab\u006f\u006c\u0064\u003b");};return _aa ;};
|
||||
|
||||
// SetFontFamily sets text's fontFamily.
|
||||
func (_gfc *TextpathStyle )SetFontFamily (fontFamily string ){_gfc ._eg =fontFamily };const (ShapeStylePositionAbsolute ="\u0061\u0062\u0073\u006f\u006c\u0075\u0074\u0065";ShapeStylePositionRelative ="\u0072\u0065\u006c\u0061\u0074\u0069\u0076\u0065";);
|
||||
|
||||
// NewShapeStyle accept value of string style attribute in v:shape and format it to generate ShapeStyle.
|
||||
func NewShapeStyle (style string )ShapeStyle {_gff :=ShapeStyle {_gfa :0,_dbf :0};_ged :=_ge .Split (style ,"\u003b");for _ ,_fc :=range _ged {_ff :=_ge .Split (_fc ,"\u003a");if len (_ff )!=2{continue ;};var _cd error ;switch _ff [0]{case "\u0070\u006f\u0073\u0069\u0074\u0069\u006f\u006e":_gff ._ed =_ff [1];break ;case "\u006d\u0061\u0072\u0067\u0069\u006e\u002d\u0074\u006f\u0070":_gff ._cad ,_cd =_ga .ParseFloat (_ge .ReplaceAll (_ff [1],"\u0070\u0074",""),64);break ;case "m\u0061\u0072\u0067\u0069\u006e\u002d\u006c\u0065\u0066\u0074":_gff ._gcf ,_cd =_ga .ParseFloat (_ge .ReplaceAll (_ff [1],"\u0070\u0074",""),64);break ;case "\u006d\u0061\u0072\u0067\u0069\u006e\u002d\u0062\u006f\u0074\u0074\u006f\u006d":_gff ._ef ,_cd =_ga .ParseFloat (_ge .ReplaceAll (_ff [1],"\u0070\u0074",""),64);break ;case "\u006d\u0061\u0072g\u0069\u006e\u002d\u0072\u0069\u0067\u0068\u0074":_gff ._b ,_cd =_ga .ParseFloat (_ge .ReplaceAll (_ff [1],"\u0070\u0074",""),64);break ;case "\u0074\u006f\u0070":_gff ._cc ,_cd =_ga .ParseFloat (_ge .ReplaceAll (_ff [1],"\u0070\u0074",""),64);break ;case "\u006c\u0065\u0066\u0074":_gff ._gee ,_cd =_ga .ParseFloat (_ge .ReplaceAll (_ff [1],"\u0070\u0074",""),64);break ;case "\u0062\u006f\u0074\u0074\u006f\u006d":_gff ._eb ,_cd =_ga .ParseFloat (_ge .ReplaceAll (_ff [1],"\u0070\u0074",""),64);break ;case "\u0072\u0069\u0067h\u0074":_gff ._fag ,_cd =_ga .ParseFloat (_ge .ReplaceAll (_ff [1],"\u0070\u0074",""),64);break ;case "\u0077\u0069\u0064t\u0068":_gff ._gfa ,_cd =_ga .ParseFloat (_ge .ReplaceAll (_ff [1],"\u0070\u0074",""),64);break ;case "\u0068\u0065\u0069\u0067\u0068\u0074":_gff ._dbf ,_cd =_ga .ParseFloat (_ge .ReplaceAll (_ff [1],"\u0070\u0074",""),64);break ;case "\u007a-\u0069\u006e\u0064\u0065\u0078":_gff ._fed ,_cd =_ga .ParseInt (_ff [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":_gff ._fdf =_ff [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":_gff ._dca =_ff [1];break ;case "m\u0073\u006f\u002d\u0070os\u0069t\u0069\u006f\u006e\u002d\u0076e\u0072\u0074\u0069\u0063\u0061\u006c":_gff ._ccb =_ff [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":_gff ._bf =_ff [1];break ;};if _cd !=nil {_e .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",_ff [0],_ff [1]);};};return _gff ;};
|
||||
func NewShapeStyle (style string )ShapeStyle {_ge :=ShapeStyle {_gfd :0,_gg :0};_gaf :=_e .Split (style ,"\u003b");for _ ,_acb :=range _gaf {_cg :=_e .Split (_acb ,"\u003a");if len (_cg )!=2{continue ;};var _fba error ;switch _cg [0]{case "\u0070\u006f\u0073\u0069\u0074\u0069\u006f\u006e":_ge ._adc =_cg [1];break ;case "\u006d\u0061\u0072\u0067\u0069\u006e\u002d\u0074\u006f\u0070":_ge ._fc ,_fba =_ef .ParseFloat (_e .ReplaceAll (_cg [1],"\u0070\u0074",""),64);break ;case "m\u0061\u0072\u0067\u0069\u006e\u002d\u006c\u0065\u0066\u0074":_ge ._ee ,_fba =_ef .ParseFloat (_e .ReplaceAll (_cg [1],"\u0070\u0074",""),64);break ;case "\u006d\u0061\u0072\u0067\u0069\u006e\u002d\u0062\u006f\u0074\u0074\u006f\u006d":_ge ._fa ,_fba =_ef .ParseFloat (_e .ReplaceAll (_cg [1],"\u0070\u0074",""),64);break ;case "\u006d\u0061\u0072g\u0069\u006e\u002d\u0072\u0069\u0067\u0068\u0074":_ge ._b ,_fba =_ef .ParseFloat (_e .ReplaceAll (_cg [1],"\u0070\u0074",""),64);break ;case "\u0074\u006f\u0070":_ge ._age ,_fba =_ef .ParseFloat (_e .ReplaceAll (_cg [1],"\u0070\u0074",""),64);break ;case "\u006c\u0065\u0066\u0074":_ge ._gf ,_fba =_ef .ParseFloat (_e .ReplaceAll (_cg [1],"\u0070\u0074",""),64);break ;case "\u0062\u006f\u0074\u0074\u006f\u006d":_ge ._aga ,_fba =_ef .ParseFloat (_e .ReplaceAll (_cg [1],"\u0070\u0074",""),64);break ;case "\u0072\u0069\u0067h\u0074":_ge ._ec ,_fba =_ef .ParseFloat (_e .ReplaceAll (_cg [1],"\u0070\u0074",""),64);break ;case "\u0077\u0069\u0064t\u0068":_ge ._gfd ,_fba =_ef .ParseFloat (_e .ReplaceAll (_cg [1],"\u0070\u0074",""),64);break ;case "\u0068\u0065\u0069\u0067\u0068\u0074":_ge ._gg ,_fba =_ef .ParseFloat (_e .ReplaceAll (_cg [1],"\u0070\u0074",""),64);break ;case "\u007a-\u0069\u006e\u0064\u0065\u0078":_ge ._afb ,_fba =_ef .ParseInt (_cg [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":_ge ._db =_cg [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":_ge ._be =_cg [1];break ;case "m\u0073\u006f\u002d\u0070os\u0069t\u0069\u006f\u006e\u002d\u0076e\u0072\u0074\u0069\u0063\u0061\u006c":_ge ._fdd =_cg [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":_ge ._ebd =_cg [1];break ;};if _fba !=nil {_c .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",_cg [0],_cg [1]);};};return _ge ;};
|
||||
|
||||
// TextpathStyle is style attribute of element v:textpath.
|
||||
type TextpathStyle struct{_eg string ;_gc int64 ;_acbd bool ;_dcf bool ;};
|
||||
|
||||
// SetWidth set width of shape.
|
||||
func (_dec *ShapeStyle )SetWidth (width float64 ){_dec ._gfd =width };
|
||||
|
||||
// FontSize returns fontSize of the text.
|
||||
func (_dac *TextpathStyle )FontSize ()int64 {return _dac ._gc };func NewContainer ()*Container {return &Container {}};
|
@ -9,36 +9,18 @@
|
||||
// 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 (_b "archive/zip";_f "bytes";_de "encoding/xml";_ac "fmt";_ca "github.com/unidoc/unioffice";_c "github.com/unidoc/unioffice/algo";_dd "github.com/unidoc/unioffice/common/tempstorage";_bc "github.com/unidoc/unioffice/schema/soo/pkg/relationships";_ae "io";_ag "path";_d "sort";_g "strings";_a "time";);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 (_cdc SelfClosingWriter )Write (b []byte )(int ,error ){_bbb :=0;_fbg :=0;for _dga :=0;_dga < len (b )-2;_dga ++{if b [_dga ]=='>'&&b [_dga +1]=='<'&&b [_dga +2]=='/'{_ffc :=[]byte {};_baf :=_dga ;for _cac :=_dga ;_cac >=0;_cac --{if b [_cac ]==' '{_baf =_cac ;}else if b [_cac ]=='<'{_ffc =b [_cac +1:_baf ];break ;};};_cae :=[]byte {};for _ebe :=_dga +3;_ebe < len (b );_ebe ++{if b [_ebe ]=='>'{_cae =b [_dga +3:_ebe ];break ;};};if !_f .Equal (_ffc ,_cae ){continue ;};_adf ,_caf :=_cdc .W .Write (b [_bbb :_dga ]);if _caf !=nil {return _fbg +_adf ,_caf ;};_fbg +=_adf ;_ ,_caf =_cdc .W .Write (_feg );if _caf !=nil {return _fbg ,_caf ;};_fbg +=3;for _bdd :=_dga +2;_bdd < len (b )&&b [_bdd ]!='>';_bdd ++{_fbg ++;_bbb =_bdd +2;_dga =_bbb ;};};};_fce ,_eda :=_cdc .W .Write (b [_bbb :]);return _fce +_fbg ,_eda ;};
|
||||
package zippkg ;import (_f "archive/zip";_fe "bytes";_ea "encoding/xml";_g "fmt";_bc "github.com/unidoc/unioffice";_dff "github.com/unidoc/unioffice/algo";_gg "github.com/unidoc/unioffice/common/tempstorage";_df "github.com/unidoc/unioffice/schema/soo/pkg/relationships";_d "io";_bg "path";_e "sort";_fed "strings";_b "time";);
|
||||
|
||||
// Decode unmarshals the content of a *zip.File as XML to a given destination.
|
||||
func Decode (f *_b .File ,dest interface{})error {_ed ,_cff :=f .Open ();if _cff !=nil {return _ac .Errorf ("e\u0072r\u006f\u0072\u0020\u0072\u0065\u0061\u0064\u0069n\u0067\u0020\u0025\u0073: \u0025\u0073",f .Name ,_cff );};defer _ed .Close ();_bca :=_de .NewDecoder (_ed );if _edb :=_bca .Decode (dest );_edb !=nil {return _ac .Errorf ("e\u0072\u0072\u006f\u0072 d\u0065c\u006f\u0064\u0069\u006e\u0067 \u0025\u0073\u003a\u0020\u0025\u0073",f .Name ,_edb );};if _ebb ,_aeg :=dest .(*_bc .Relationships );_aeg {for _fc ,_agef :=range _ebb .Relationship {switch _agef .TypeAttr {case _ca .OfficeDocumentTypeStrict :_ebb .Relationship [_fc ].TypeAttr =_ca .OfficeDocumentType ;case _ca .StylesTypeStrict :_ebb .Relationship [_fc ].TypeAttr =_ca .StylesType ;case _ca .ThemeTypeStrict :_ebb .Relationship [_fc ].TypeAttr =_ca .ThemeType ;case _ca .ControlTypeStrict :_ebb .Relationship [_fc ].TypeAttr =_ca .ControlType ;case _ca .SettingsTypeStrict :_ebb .Relationship [_fc ].TypeAttr =_ca .SettingsType ;case _ca .ImageTypeStrict :_ebb .Relationship [_fc ].TypeAttr =_ca .ImageType ;case _ca .CommentsTypeStrict :_ebb .Relationship [_fc ].TypeAttr =_ca .CommentsType ;case _ca .ThumbnailTypeStrict :_ebb .Relationship [_fc ].TypeAttr =_ca .ThumbnailType ;case _ca .DrawingTypeStrict :_ebb .Relationship [_fc ].TypeAttr =_ca .DrawingType ;case _ca .ChartTypeStrict :_ebb .Relationship [_fc ].TypeAttr =_ca .ChartType ;case _ca .ExtendedPropertiesTypeStrict :_ebb .Relationship [_fc ].TypeAttr =_ca .ExtendedPropertiesType ;case _ca .CustomXMLTypeStrict :_ebb .Relationship [_fc ].TypeAttr =_ca .CustomXMLType ;case _ca .WorksheetTypeStrict :_ebb .Relationship [_fc ].TypeAttr =_ca .WorksheetType ;case _ca .SharedStringsTypeStrict :_ebb .Relationship [_fc ].TypeAttr =_ca .SharedStringsType ;case _ca .TableTypeStrict :_ebb .Relationship [_fc ].TypeAttr =_ca .TableType ;case _ca .HeaderTypeStrict :_ebb .Relationship [_fc ].TypeAttr =_ca .HeaderType ;case _ca .FooterTypeStrict :_ebb .Relationship [_fc ].TypeAttr =_ca .FooterType ;case _ca .NumberingTypeStrict :_ebb .Relationship [_fc ].TypeAttr =_ca .NumberingType ;case _ca .FontTableTypeStrict :_ebb .Relationship [_fc ].TypeAttr =_ca .FontTableType ;case _ca .WebSettingsTypeStrict :_ebb .Relationship [_fc ].TypeAttr =_ca .WebSettingsType ;case _ca .FootNotesTypeStrict :_ebb .Relationship [_fc ].TypeAttr =_ca .FootNotesType ;case _ca .EndNotesTypeStrict :_ebb .Relationship [_fc ].TypeAttr =_ca .EndNotesType ;case _ca .SlideTypeStrict :_ebb .Relationship [_fc ].TypeAttr =_ca .SlideType ;case _ca .VMLDrawingTypeStrict :_ebb .Relationship [_fc ].TypeAttr =_ca .VMLDrawingType ;};};_d .Slice (_ebb .Relationship ,func (_bcce ,_bcg int )bool {_bad :=_ebb .Relationship [_bcce ];_efb :=_ebb .Relationship [_bcg ];return _c .NaturalLess (_bad .IdAttr ,_efb .IdAttr );});};return nil ;};
|
||||
func Decode (f *_f .File ,dest interface{})error {_de ,_bdc :=f .Open ();if _bdc !=nil {return _g .Errorf ("e\u0072r\u006f\u0072\u0020\u0072\u0065\u0061\u0064\u0069n\u0067\u0020\u0025\u0073: \u0025\u0073",f .Name ,_bdc );};defer _de .Close ();_ggg :=_ea .NewDecoder (_de );if _gdb :=_ggg .Decode (dest );_gdb !=nil {return _g .Errorf ("e\u0072\u0072\u006f\u0072 d\u0065c\u006f\u0064\u0069\u006e\u0067 \u0025\u0073\u003a\u0020\u0025\u0073",f .Name ,_gdb );};if _cbg ,_ba :=dest .(*_df .Relationships );_ba {for _efe ,_be :=range _cbg .Relationship {switch _be .TypeAttr {case _bc .OfficeDocumentTypeStrict :_cbg .Relationship [_efe ].TypeAttr =_bc .OfficeDocumentType ;case _bc .StylesTypeStrict :_cbg .Relationship [_efe ].TypeAttr =_bc .StylesType ;case _bc .ThemeTypeStrict :_cbg .Relationship [_efe ].TypeAttr =_bc .ThemeType ;case _bc .ControlTypeStrict :_cbg .Relationship [_efe ].TypeAttr =_bc .ControlType ;case _bc .SettingsTypeStrict :_cbg .Relationship [_efe ].TypeAttr =_bc .SettingsType ;case _bc .ImageTypeStrict :_cbg .Relationship [_efe ].TypeAttr =_bc .ImageType ;case _bc .CommentsTypeStrict :_cbg .Relationship [_efe ].TypeAttr =_bc .CommentsType ;case _bc .ThumbnailTypeStrict :_cbg .Relationship [_efe ].TypeAttr =_bc .ThumbnailType ;case _bc .DrawingTypeStrict :_cbg .Relationship [_efe ].TypeAttr =_bc .DrawingType ;case _bc .ChartTypeStrict :_cbg .Relationship [_efe ].TypeAttr =_bc .ChartType ;case _bc .ExtendedPropertiesTypeStrict :_cbg .Relationship [_efe ].TypeAttr =_bc .ExtendedPropertiesType ;case _bc .CustomXMLTypeStrict :_cbg .Relationship [_efe ].TypeAttr =_bc .CustomXMLType ;case _bc .WorksheetTypeStrict :_cbg .Relationship [_efe ].TypeAttr =_bc .WorksheetType ;case _bc .SharedStringsTypeStrict :_cbg .Relationship [_efe ].TypeAttr =_bc .SharedStringsType ;case _bc .TableTypeStrict :_cbg .Relationship [_efe ].TypeAttr =_bc .TableType ;case _bc .HeaderTypeStrict :_cbg .Relationship [_efe ].TypeAttr =_bc .HeaderType ;case _bc .FooterTypeStrict :_cbg .Relationship [_efe ].TypeAttr =_bc .FooterType ;case _bc .NumberingTypeStrict :_cbg .Relationship [_efe ].TypeAttr =_bc .NumberingType ;case _bc .FontTableTypeStrict :_cbg .Relationship [_efe ].TypeAttr =_bc .FontTableType ;case _bc .WebSettingsTypeStrict :_cbg .Relationship [_efe ].TypeAttr =_bc .WebSettingsType ;case _bc .FootNotesTypeStrict :_cbg .Relationship [_efe ].TypeAttr =_bc .FootNotesType ;case _bc .EndNotesTypeStrict :_cbg .Relationship [_efe ].TypeAttr =_bc .EndNotesType ;case _bc .SlideTypeStrict :_cbg .Relationship [_efe ].TypeAttr =_bc .SlideType ;case _bc .VMLDrawingTypeStrict :_cbg .Relationship [_efe ].TypeAttr =_bc .VMLDrawingType ;};};_e .Slice (_cbg .Relationship ,func (_egc ,_fa int )bool {_dbg :=_cbg .Relationship [_egc ];_ce :=_cbg .Relationship [_fa ];return _dff .NaturalLess (_dbg .IdAttr ,_ce .IdAttr );});};return nil ;};
|
||||
|
||||
// SetOnNewRelationshipFunc sets the function to be called when a new
|
||||
// relationship has been discovered.
|
||||
func (_ab *DecodeMap )SetOnNewRelationshipFunc (fn OnNewRelationshipFunc ){_ab ._dg =fn };
|
||||
// DecodeMap is used to walk a tree of relationships, decoding files and passing
|
||||
// control back to the document.
|
||||
type DecodeMap struct{_ae map[string ]Target ;_eg map[*_df .Relationships ]string ;_dg []Target ;_fg OnNewRelationshipFunc ;_fef map[string ]struct{};_cb map[string ]int ;};
|
||||
|
||||
// AddFileFromBytes takes a byte array and adds it at a given path to a zip file.
|
||||
func AddFileFromBytes (z *_b .Writer ,zipPath string ,data []byte )error {_be ,_bg :=z .Create (zipPath );if _bg !=nil {return _ac .Errorf ("e\u0072\u0072\u006f\u0072 c\u0072e\u0061\u0074\u0069\u006e\u0067 \u0025\u0073\u003a\u0020\u0025\u0073",zipPath ,_bg );};_ ,_bg =_ae .Copy (_be ,_f .NewReader (data ));return _bg ;};func MarshalXMLByType (z *_b .Writer ,dt _ca .DocType ,typ string ,v interface{})error {_agf :=_ca .AbsoluteFilename (dt ,typ ,0);return MarshalXML (z ,_agf ,v );};
|
||||
|
||||
// ExtractToDiskTmp extracts a zip file to a temporary file in a given path,
|
||||
// returning the name of the file.
|
||||
func ExtractToDiskTmp (f *_b .File ,path string )(string ,error ){_afg ,_acd :=_dd .TempFile (path ,"\u007a\u007a");if _acd !=nil {return "",_acd ;};defer _afg .Close ();_agc ,_acd :=f .Open ();if _acd !=nil {return "",_acd ;};defer _agc .Close ();_ ,_acd =_ae .Copy (_afg ,_agc );if _acd !=nil {return "",_acd ;};return _afg .Name (),nil ;};
|
||||
|
||||
// Decode loops decoding targets registered with AddTarget and calling th
|
||||
func (_da *DecodeMap )Decode (files []*_b .File )error {_dgb :=1;for _dgb > 0{for len (_da ._gf )> 0{_fe :=_da ._gf [0];_da ._gf =_da ._gf [1:];_aed :=_fe .Ifc .(*_bc .Relationships );for _ ,_fed :=range _aed .Relationship {_ffa ,_ :=_da ._ad [_aed ];_da ._dg (_da ,_ffa +_fed .TargetAttr ,_fed .TypeAttr ,files ,_fed ,_fe );};};for _efd ,_bfc :=range files {if _bfc ==nil {continue ;};if _bcc ,_af :=_da ._gg [_bfc .Name ];_af {delete (_da ._gg ,_bfc .Name );if _age :=Decode (_bfc ,_bcc .Ifc );_age !=nil {return _age ;};files [_efd ]=nil ;if _acg ,_cf :=_bcc .Ifc .(*_bc .Relationships );_cf {_da ._gf =append (_da ._gf ,_bcc );_deb ,_ :=_ag .Split (_ag .Clean (_bfc .Name +"\u002f\u002e\u002e\u002f"));_da ._ad [_acg ]=_deb ;_dgb ++;};};};_dgb --;};return nil ;};
|
||||
|
||||
// RelationsPathFor returns the relations path for a given filename.
|
||||
func RelationsPathFor (path string )string {_ea :=_g .Split (path ,"\u002f");_eg :=_g .Join (_ea [0:len (_ea )-1],"\u002f");_daa :=_ea [len (_ea )-1];_eg +="\u002f_\u0072\u0065\u006c\u0073\u002f";_daa +="\u002e\u0072\u0065l\u0073";return _eg +_daa ;};
|
||||
|
||||
// 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 *_b .Writer ,zipPath ,storagePath string )error {_ce ,_gdg :=z .Create (zipPath );if _gdg !=nil {return _ac .Errorf ("e\u0072\u0072\u006f\u0072 c\u0072e\u0061\u0074\u0069\u006e\u0067 \u0025\u0073\u003a\u0020\u0025\u0073",zipPath ,_gdg );};_bdb ,_gdg :=_dd .Open (storagePath );if _gdg !=nil {return _ac .Errorf ("e\u0072r\u006f\u0072\u0020\u006f\u0070\u0065\u006e\u0069n\u0067\u0020\u0025\u0073: \u0025\u0073",storagePath ,_gdg );};defer _bdb .Close ();_ ,_gdg =_ae .Copy (_ce ,_bdb );return _gdg ;};func (_ba *DecodeMap )IndexFor (path string )int {return _ba ._eb [path ]};func (_cg *DecodeMap )RecordIndex (path string ,idx int ){_cg ._eb [path ]=idx };
|
||||
|
||||
// MarshalXML creates a file inside of a zip and marshals an object as xml, prefixing it
|
||||
// with a standard XML header.
|
||||
func MarshalXML (z *_b .Writer ,filename string ,v interface{})error {_ageg :=&_b .FileHeader {};_ageg .Method =_b .Deflate ;_ageg .Name =filename ;_ageg .SetModTime (_a .Now ());_fa ,_fb :=z .CreateHeader (_ageg );if _fb !=nil {return _ac .Errorf ("\u0063\u0072\u0065\u0061ti\u006e\u0067\u0020\u0025\u0073\u0020\u0069\u006e\u0020\u007a\u0069\u0070\u003a\u0020%\u0073",filename ,_fb );};_ ,_fb =_fa .Write ([]byte (XMLHeader ));if _fb !=nil {return _ac .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 ,_fb );};if _fb =_de .NewEncoder (SelfClosingWriter {_fa }).Encode (v );_fb !=nil {return _ac .Errorf ("\u006d\u0061\u0072\u0073\u0068\u0061\u006c\u0069\u006e\u0067\u0020\u0025s\u003a\u0020\u0025\u0073",filename ,_fb );};_ ,_fb =_fa .Write (_bag );return _fb ;};
|
||||
// SelfClosingWriter wraps a writer and replaces XML tags of the
|
||||
// type <foo></foo> with <foo/>
|
||||
type SelfClosingWriter struct{W _d .Writer ;};
|
||||
|
||||
// OnNewRelationshipFunc is called when a new relationship has been discovered.
|
||||
//
|
||||
@ -52,19 +34,37 @@ func MarshalXML (z *_b .Writer ,filename string ,v interface{})error {_ageg :=&_
|
||||
// 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 (_gd *DecodeMap ,_ef ,_aea string ,_bf []*_b .File ,_bff *_bc .Relationship ,_cd Target )error ;func MarshalXMLByTypeIndex (z *_b .Writer ,dt _ca .DocType ,typ string ,idx int ,v interface{})error {_cc :=_ca .AbsoluteFilename (dt ,typ ,idx );return MarshalXML (z ,_cc ,v );};
|
||||
type OnNewRelationshipFunc func (_ga *DecodeMap ,_af ,_c string ,_ec []*_f .File ,_cc *_df .Relationship ,_ca Target )error ;
|
||||
|
||||
// RelationsPathFor returns the relations path for a given filename.
|
||||
func RelationsPathFor (path string )string {_ffc :=_fed .Split (path ,"\u002f");_efg :=_fed .Join (_ffc [0:len (_ffc )-1],"\u002f");_eaf :=_ffc [len (_ffc )-1];_efg +="\u002f_\u0072\u0065\u006c\u0073\u002f";_eaf +="\u002e\u0072\u0065l\u0073";return _efg +_eaf ;};var _gff =[]byte {'/','>'};
|
||||
|
||||
// SetOnNewRelationshipFunc sets the function to be called when a new
|
||||
// relationship has been discovered.
|
||||
func (_gb *DecodeMap )SetOnNewRelationshipFunc (fn OnNewRelationshipFunc ){_gb ._fg =fn };var _da =[]byte {'\r','\n'};func (_eaa *DecodeMap )RecordIndex (path string ,idx int ){_eaa ._cb [path ]=idx };
|
||||
|
||||
// ExtractToDiskTmp extracts a zip file to a temporary file in a given path,
|
||||
// returning the name of the file.
|
||||
func ExtractToDiskTmp (f *_f .File ,path string )(string ,error ){_dfb ,_ac :=_gg .TempFile (path ,"\u007a\u007a");if _ac !=nil {return "",_ac ;};defer _dfb .Close ();_caf ,_ac :=f .Open ();if _ac !=nil {return "",_ac ;};defer _caf .Close ();_ ,_ac =_d .Copy (_dfb ,_caf );if _ac !=nil {return "",_ac ;};return _dfb .Name (),nil ;};
|
||||
|
||||
// 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 (_fdf *DecodeMap )AddTarget (filePath string ,ifc interface{},sourceFileType string ,idx uint32 )bool {if _fdf ._gg ==nil {_fdf ._gg =make (map[string ]Target );_fdf ._ad =make (map[*_bc .Relationships ]string );_fdf ._fd =make (map[string ]struct{});_fdf ._eb =make (map[string ]int );};_bd :=_ag .Clean (filePath );if _ ,_ff :=_fdf ._fd [_bd ];_ff {return false ;};_fdf ._fd [_bd ]=struct{}{};_fdf ._gg [_bd ]=Target {Path :filePath ,Typ :sourceFileType ,Ifc :ifc ,Index :idx };return true ;};
|
||||
func (_cg *DecodeMap )AddTarget (filePath string ,ifc interface{},sourceFileType string ,idx uint32 )bool {if _cg ._ae ==nil {_cg ._ae =make (map[string ]Target );_cg ._eg =make (map[*_df .Relationships ]string );_cg ._fef =make (map[string ]struct{});_cg ._cb =make (map[string ]int );};if _bg .IsAbs (filePath ){filePath =_fed .TrimPrefix (filePath ,"\u002f");};_bd :=_bg .Clean (filePath );if _ ,_bf :=_cg ._fef [_bd ];_bf {return false ;};_cg ._fef [_bd ]=struct{}{};_cg ._ae [_bd ]=Target {Path :_bd ,Typ :sourceFileType ,Ifc :ifc ,Index :idx };return true ;};func MarshalXMLByTypeIndex (z *_f .Writer ,dt _bc .DocType ,typ string ,idx int ,v interface{})error {_agg :=_bc .AbsoluteFilename (dt ,typ ,idx );return MarshalXML (z ,_agg ,v );};type Target struct{Path string ;Typ string ;Ifc interface{};Index uint32 ;};
|
||||
|
||||
// SelfClosingWriter wraps a writer and replaces XML tags of the
|
||||
// type <foo></foo> with <foo/>
|
||||
type SelfClosingWriter struct{W _ae .Writer ;};
|
||||
// MarshalXML creates a file inside of a zip and marshals an object as xml, prefixing it
|
||||
// with a standard XML header.
|
||||
func MarshalXML (z *_f .Writer ,filename string ,v interface{})error {_fff :=&_f .FileHeader {};_fff .Method =_f .Deflate ;_fff .Name =filename ;_fff .SetModTime (_b .Now ());_dfd ,_caee :=z .CreateHeader (_fff );if _caee !=nil {return _g .Errorf ("\u0063\u0072\u0065\u0061ti\u006e\u0067\u0020\u0025\u0073\u0020\u0069\u006e\u0020\u007a\u0069\u0070\u003a\u0020%\u0073",filename ,_caee );};_ ,_caee =_dfd .Write ([]byte (XMLHeader ));if _caee !=nil {return _g .Errorf ("\u0063\u0072e\u0061\u0074\u0069\u006e\u0067\u0020\u0078\u006d\u006c\u0020\u0068\u0065\u0061\u0064\u0065\u0072\u0020\u0074\u006f\u0020\u0025\u0073: \u0025\u0073",filename ,_caee );};if _caee =_ea .NewEncoder (SelfClosingWriter {_dfd }).Encode (v );_caee !=nil {return _g .Errorf ("\u006d\u0061\u0072\u0073\u0068\u0061\u006c\u0069\u006e\u0067\u0020\u0025s\u003a\u0020\u0025\u0073",filename ,_caee );};_ ,_caee =_dfd .Write (_da );return _caee ;};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";
|
||||
|
||||
// DecodeMap is used to walk a tree of relationships, decoding files and passing
|
||||
// control back to the document.
|
||||
type DecodeMap struct{_gg map[string ]Target ;_ad map[*_bc .Relationships ]string ;_gf []Target ;_dg OnNewRelationshipFunc ;_fd map[string ]struct{};_eb map[string ]int ;};var _feg =[]byte {'/','>'};var _bag =[]byte {'\r','\n'};type Target struct{Path string ;Typ string ;Ifc interface{};Index uint32 ;};
|
||||
// AddFileFromBytes takes a byte array and adds it at a given path to a zip file.
|
||||
func AddFileFromBytes (z *_f .Writer ,zipPath string ,data []byte )error {_ggf ,_bb :=z .Create (zipPath );if _bb !=nil {return _g .Errorf ("e\u0072\u0072\u006f\u0072 c\u0072e\u0061\u0074\u0069\u006e\u0067 \u0025\u0073\u003a\u0020\u0025\u0073",zipPath ,_bb );};_ ,_bb =_d .Copy (_ggf ,_fe .NewReader (data ));return _bb ;};
|
||||
|
||||
// Decode loops decoding targets registered with AddTarget and calling th
|
||||
func (_agd *DecodeMap )Decode (files []*_f .File )error {_ef :=1;for _ef > 0{for len (_agd ._dg )> 0{_afe :=_agd ._dg [0];_agd ._dg =_agd ._dg [1:];_fec :=_afe .Ifc .(*_df .Relationships );for _ ,_eef :=range _fec .Relationship {_gd ,_ :=_agd ._eg [_fec ];_agd ._fg (_agd ,_gd +_eef .TargetAttr ,_eef .TypeAttr ,files ,_eef ,_afe );};};for _ff ,_ed :=range files {if _ed ==nil {continue ;};if _gf ,_ab :=_agd ._ae [_ed .Name ];_ab {delete (_agd ._ae ,_ed .Name );if _db :=Decode (_ed ,_gf .Ifc );_db !=nil {return _db ;};files [_ff ]=nil ;if _gdf ,_ggb :=_gf .Ifc .(*_df .Relationships );_ggb {_agd ._dg =append (_agd ._dg ,_gf );_dd ,_ :=_bg .Split (_bg .Clean (_ed .Name +"\u002f\u002e\u002e\u002f"));_agd ._eg [_gdf ]=_dd ;_ef ++;};};};_ef --;};return nil ;};func (_ag *DecodeMap )IndexFor (path string )int {return _ag ._cb [path ]};func (_gfc SelfClosingWriter )Write (b []byte )(int ,error ){_dab :=0;_cee :=0;for _ge :=0;_ge < len (b )-2;_ge ++{if b [_ge ]=='>'&&b [_ge +1]=='<'&&b [_ge +2]=='/'{_dfdg :=[]byte {};_cafa :=_ge ;for _bfe :=_ge ;_bfe >=0;_bfe --{if b [_bfe ]==' '{_cafa =_bfe ;}else if b [_bfe ]=='<'{_dfdg =b [_bfe +1:_cafa ];break ;};};_fc :=[]byte {};for _ced :=_ge +3;_ced < len (b );_ced ++{if b [_ced ]=='>'{_fc =b [_ge +3:_ced ];break ;};};if !_fe .Equal (_dfdg ,_fc ){continue ;};_bgc ,_afeb :=_gfc .W .Write (b [_dab :_ge ]);if _afeb !=nil {return _cee +_bgc ,_afeb ;};_cee +=_bgc ;_ ,_afeb =_gfc .W .Write (_gff );if _afeb !=nil {return _cee ,_afeb ;};_cee +=3;for _fag :=_ge +2;_fag < len (b )&&b [_fag ]!='>';_fag ++{_cee ++;_dab =_fag +2;_ge =_dab ;};};};_ace ,_fcf :=_gfc .W .Write (b [_dab :]);return _ace +_cee ,_fcf ;};func MarshalXMLByType (z *_f .Writer ,dt _bc .DocType ,typ string ,v interface{})error {_bac :=_bc .AbsoluteFilename (dt ,typ ,0);return MarshalXML (z ,_bac ,v );};
|
||||
|
||||
// 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 *_f .Writer ,zipPath ,storagePath string )error {_fea ,_gbf :=z .Create (zipPath );if _gbf !=nil {return _g .Errorf ("e\u0072\u0072\u006f\u0072 c\u0072e\u0061\u0074\u0069\u006e\u0067 \u0025\u0073\u003a\u0020\u0025\u0073",zipPath ,_gbf );};_aeg ,_gbf :=_gg .Open (storagePath );if _gbf !=nil {return _g .Errorf ("e\u0072r\u006f\u0072\u0020\u006f\u0070\u0065\u006e\u0069n\u0067\u0020\u0025\u0073: \u0025\u0073",storagePath ,_gbf );};defer _aeg .Close ();_ ,_gbf =_d .Copy (_fea ,_aeg );return _gbf ;};
|
Loading…
x
Reference in New Issue
Block a user