mirror of
https://github.com/unidoc/unioffice.git
synced 2025-04-24 13:48:48 +08:00
prepare release
This commit is contained in:
parent
4af49ff084
commit
3de0947c35
@ -34,4 +34,21 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
```
|
||||
|
||||
* [MSCFB Reader](https://github.com/richardlehane/mscfb).
|
||||
|
||||
```
|
||||
Copyright 2013 Richard Lehane. All rights reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
```
|
||||
|
@ -9,7 +9,7 @@
|
||||
// Use of this source code is governed by the UniDoc End User License Agreement
|
||||
// terms that can be accessed at https://unidoc.io/eula/
|
||||
|
||||
package algo ;import _b "strconv";func RepeatString (s string ,cnt int )string {if cnt <=0{return "";};_ba :=make ([]byte ,len (s )*cnt );_ea :=[]byte (s );for _c :=0;_c < cnt ;_c ++{copy (_ba [_c :],_ea );};return string (_ba );};func _d (_e byte )bool {return _e >='0'&&_e <='9'};
|
||||
package algo ;import _b "strconv";func RepeatString (s string ,cnt int )string {if cnt <=0{return "";};_bf :=make ([]byte ,len (s )*cnt );_bc :=[]byte (s );for _gfa :=0;_gfa < cnt ;_gfa ++{copy (_bf [_gfa :],_bc );};return string (_bf );};
|
||||
|
||||
// NaturalLess compares two strings in a human manner so rId2 sorts less than rId10
|
||||
func NaturalLess (lhs ,rhs string )bool {_dg ,_g :=0,0;for _dg < len (lhs )&&_g < len (rhs ){_gc :=lhs [_dg ];_dc :=rhs [_g ];_gf :=_d (_gc );_gd :=_d (_dc );switch {case _gf &&!_gd :return true ;case !_gf &&_gd :return false ;case !_gf &&!_gd :if _gc !=_dc {return _gc < _dc ;};_dg ++;_g ++;default:_ae :=_dg +1;_ge :=_g +1;for _ae < len (lhs )&&_d (lhs [_ae ]){_ae ++;};for _ge < len (rhs )&&_d (rhs [_ge ]){_ge ++;};_ec ,_ :=_b .ParseUint (lhs [_dg :_ae ],10,64);_aa ,_ :=_b .ParseUint (rhs [_dg :_ge ],10,64);if _ec !=_aa {return _ec < _aa ;};_dg =_ae ;_g =_ge ;};};return len (lhs )< len (rhs );};
|
||||
func NaturalLess (lhs ,rhs string )bool {_cg ,_be :=0,0;for _cg < len (lhs )&&_be < len (rhs ){_gf :=lhs [_cg ];_beb :=rhs [_be ];_a :=_c (_gf );_gb :=_c (_beb );switch {case _a &&!_gb :return true ;case !_a &&_gb :return false ;case !_a &&!_gb :if _gf !=_beb {return _gf < _beb ;};_cg ++;_be ++;default:_ac :=_cg +1;_eg :=_be +1;for _ac < len (lhs )&&_c (lhs [_ac ]){_ac ++;};for _eg < len (rhs )&&_c (rhs [_eg ]){_eg ++;};_f ,_ :=_b .ParseUint (lhs [_cg :_ac ],10,64);_fa ,_ :=_b .ParseUint (rhs [_cg :_eg ],10,64);if _f !=_fa {return _f < _fa ;};_cg =_ac ;_be =_eg ;};};return len (lhs )< len (rhs );};func _c (_e byte )bool {return _e >='0'&&_e <='9'};
|
866
chart/chart.go
866
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 (_ce "fmt";_ca "github.com/unidoc/unioffice";_d "github.com/unidoc/unioffice/color";_eb "github.com/unidoc/unioffice/drawing";_cf "github.com/unidoc/unioffice/measurement";_e "github.com/unidoc/unioffice/schema/soo/dml";_c "github.com/unidoc/unioffice/schema/soo/dml/chart";_fd "math/rand";);func MakeValueAxis (x *_c .CT_ValAx )ValueAxis {return ValueAxis {x }};
|
||||
package chart ;import (_b "fmt";_f "github.com/unidoc/unioffice";_g "github.com/unidoc/unioffice/color";_fb "github.com/unidoc/unioffice/drawing";_bg "github.com/unidoc/unioffice/measurement";_dg "github.com/unidoc/unioffice/schema/soo/dml";_a "github.com/unidoc/unioffice/schema/soo/dml/chart";_d "math/rand";);
|
||||
|
||||
// Properties returns the bar chart series shape properties.
|
||||
func (_fbg BarChartSeries )Properties ()_eb .ShapeProperties {if _fbg ._cff .SpPr ==nil {_fbg ._cff .SpPr =_e .NewCT_ShapeProperties ();};return _eb .MakeShapeProperties (_fbg ._cff .SpPr );};func (_bbfe ValueAxis )MajorGridLines ()GridLines {if _bbfe ._efce .MajorGridlines ==nil {_bbfe ._efce .MajorGridlines =_c .NewCT_ChartLines ();};return GridLines {_bbfe ._efce .MajorGridlines };};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_fda Area3DChart )X ()*_c .CT_Area3DChart {return _fda ._b };
|
||||
|
||||
// AddSeries adds a default series to an area chart.
|
||||
func (_ge AreaChart )AddSeries ()AreaChartSeries {_bbc :=_ge .nextColor (len (_ge ._cb .Ser ));_fe :=_c .NewCT_AreaSer ();_ge ._cb .Ser =append (_ge ._cb .Ser ,_fe );_fe .Idx .ValAttr =uint32 (len (_ge ._cb .Ser )-1);_fe .Order .ValAttr =uint32 (len (_ge ._cb .Ser )-1);_fg :=AreaChartSeries {_fe };_fg .InitializeDefaults ();_fg .Properties ().SetSolidFill (_bbc );return _fg ;};func (_abb NumberDataSource )ensureChoice (){if _abb ._aeg .Choice ==nil {_abb ._aeg .Choice =_c .NewCT_NumDataSourceChoice ();};};func (_cef BarChart )AddAxis (axis Axis ){_acfg :=_c .NewCT_UnsignedInt ();_acfg .ValAttr =axis .AxisID ();_cef ._gcd .AxId =append (_cef ._gcd .AxId ,_acfg );};
|
||||
|
||||
// AddSeries adds a default series to a Bubble chart.
|
||||
func (_cbfg BubbleChart )AddSeries ()BubbleChartSeries {_dbb :=_cbfg .nextColor (len (_cbfg ._eed .Ser ));_bf :=_c .NewCT_BubbleSer ();_cbfg ._eed .Ser =append (_cbfg ._eed .Ser ,_bf );_bf .Idx .ValAttr =uint32 (len (_cbfg ._eed .Ser )-1);_bf .Order .ValAttr =uint32 (len (_cbfg ._eed .Ser )-1);_dd :=BubbleChartSeries {_bf };_dd .InitializeDefaults ();_dd .Properties ().SetSolidFill (_dbb );return _dd ;};func (_afe CategoryAxis )SetTickLabelPosition (p _c .ST_TickLblPos ){if p ==_c .ST_TickLblPosUnset {_afe ._bcf .TickLblPos =nil ;}else {_afe ._bcf .TickLblPos =_c .NewCT_TickLblPos ();_afe ._bcf .TickLblPos .ValAttr =p ;};};
|
||||
|
||||
// Properties returns the bar chart series shape properties.
|
||||
func (_afec RadarChartSeries )Properties ()_eb .ShapeProperties {if _afec ._aefed .SpPr ==nil {_afec ._aefed .SpPr =_e .NewCT_ShapeProperties ();};return _eb .MakeShapeProperties (_afec ._aefed .SpPr );};
|
||||
|
||||
// Values returns the bubble size data source.
|
||||
func (_fff BubbleChartSeries )BubbleSizes ()NumberDataSource {if _fff ._cba .BubbleSize ==nil {_fff ._cba .BubbleSize =_c .NewCT_NumDataSource ();};return MakeNumberDataSource (_fff ._cba .BubbleSize );};func (_fdfc DateAxis )SetPosition (p _c .ST_AxPos ){_fdfc ._dea .AxPos =_c .NewCT_AxPos ();_fdfc ._dea .AxPos .ValAttr =p ;};func (_cfag DateAxis )Properties ()_eb .ShapeProperties {if _cfag ._dea .SpPr ==nil {_cfag ._dea .SpPr =_e .NewCT_ShapeProperties ();};return _eb .MakeShapeProperties (_cfag ._dea .SpPr );};
|
||||
|
||||
// InitializeDefaults the bar chart to its defaults
|
||||
func (_ba AreaChart )InitializeDefaults (){};func (_ddbc chartBase )nextColor (_bcb int )_d .Color {return _ebge [_bcb %len (_ebge )]};func MakeChart (x *_c .ChartSpace )Chart {return Chart {x }};
|
||||
|
||||
// Marker returns the marker properties.
|
||||
func (_bgeg ScatterChartSeries )Marker ()Marker {if _bgeg ._bebd .Marker ==nil {_bgeg ._bebd .Marker =_c .NewCT_Marker ();};return MakeMarker (_bgeg ._bebd .Marker );};
|
||||
|
||||
// AddPieOfPieChart adds a new pie chart to a chart.
|
||||
func (_gdg Chart )AddPieOfPieChart ()PieOfPieChart {_ded :=_c .NewCT_PlotAreaChoice ();_gdg ._egd .Chart .PlotArea .Choice =append (_gdg ._egd .Chart .PlotArea .Choice ,_ded );_ded .OfPieChart =_c .NewCT_OfPieChart ();_aged :=PieOfPieChart {_abdb :_ded .OfPieChart };_aged .InitializeDefaults ();return _aged ;};
|
||||
|
||||
// AddSeries adds a default series to a bar chart.
|
||||
func (_eg Bar3DChart )AddSeries ()BarChartSeries {_cbg :=_eg .nextColor (len (_eg ._a .Ser ));_dbe :=_c .NewCT_BarSer ();_eg ._a .Ser =append (_eg ._a .Ser ,_dbe );_dbe .Idx .ValAttr =uint32 (len (_eg ._a .Ser )-1);_dbe .Order .ValAttr =uint32 (len (_eg ._a .Ser )-1);_cgg :=BarChartSeries {_dbe };_cgg .InitializeDefaults ();_cgg .Properties ().SetSolidFill (_cbg );return _cgg ;};
|
||||
|
||||
// AreaChartSeries is a series to be used on an area chart.
|
||||
type AreaChartSeries struct{_be *_c .CT_AreaSer };func (_cagf SurfaceChartSeries )Values ()NumberDataSource {if _cagf ._gaec .Val ==nil {_cagf ._gaec .Val =_c .NewCT_NumDataSource ();};_cgd :=MakeNumberDataSource (_cagf ._gaec .Val );_cgd .CreateEmptyNumberCache ();return _cgd ;};func (_feg BubbleChart )AddAxis (axis Axis ){_cad :=_c .NewCT_UnsignedInt ();_cad .ValAttr =axis .AxisID ();_feg ._eed .AxId =append (_feg ._eed .AxId ,_cad );};
|
||||
|
||||
// AddDoughnutChart adds a new doughnut (pie with a hole in the center) chart to a chart.
|
||||
func (_bacf Chart )AddDoughnutChart ()DoughnutChart {_ffd :=_c .NewCT_PlotAreaChoice ();_bacf ._egd .Chart .PlotArea .Choice =append (_bacf ._egd .Chart .PlotArea .Choice ,_ffd );_ffd .DoughnutChart =_c .NewCT_DoughnutChart ();_cgb :=DoughnutChart {_cac :_ffd .DoughnutChart };_cgb .InitializeDefaults ();return _cgb ;};
|
||||
|
||||
// Labels returns the data label properties.
|
||||
func (_ccag LineChartSeries )Labels ()DataLabels {if _ccag ._adb .DLbls ==nil {_ccag ._adb .DLbls =_c .NewCT_DLbls ();};return MakeDataLabels (_ccag ._adb .DLbls );};
|
||||
|
||||
// InitializeDefaults the bar chart to its defaults
|
||||
func (_fee Bar3DChart )InitializeDefaults (){_fee .SetDirection (_c .ST_BarDirCol )};func (_aeba Marker )SetSize (sz uint8 ){_aeba ._afg .Size =_c .NewCT_MarkerSize ();_aeba ._afg .Size .ValAttr =&sz ;};
|
||||
|
||||
// AddBarChart adds a new bar chart to a chart.
|
||||
func (_gfd Chart )AddBarChart ()BarChart {_eedc :=_c .NewCT_PlotAreaChoice ();_gfd ._egd .Chart .PlotArea .Choice =append (_gfd ._egd .Chart .PlotArea .Choice ,_eedc );_eedc .BarChart =_c .NewCT_BarChart ();_eedc .BarChart .Grouping =_c .NewCT_BarGrouping ();_eedc .BarChart .Grouping .ValAttr =_c .ST_BarGroupingStandard ;_agg :=BarChart {_gcd :_eedc .BarChart };_agg .InitializeDefaults ();return _agg ;};
|
||||
|
||||
// SetText sets the series text.
|
||||
func (_adea PieChartSeries )SetText (s string ){_adea ._faag .Tx =_c .NewCT_SerTx ();_adea ._faag .Tx .Choice .V =&s ;};
|
||||
|
||||
// AddArea3DChart adds a new area chart to a chart.
|
||||
func (_eda Chart )AddArea3DChart ()Area3DChart {_aab (_eda ._egd .Chart );_aff :=_c .NewCT_PlotAreaChoice ();_eda ._egd .Chart .PlotArea .Choice =append (_eda ._egd .Chart .PlotArea .Choice ,_aff );_aff .Area3DChart =_c .NewCT_Area3DChart ();_dbf :=Area3DChart {_b :_aff .Area3DChart };_dbf .InitializeDefaults ();return _dbf ;};func (_agd DataLabels )SetShowLegendKey (b bool ){_agd .ensureChoice ();_agd ._dfga .Choice .ShowLegendKey =_c .NewCT_Boolean ();_agd ._dfga .Choice .ShowLegendKey .ValAttr =_ca .Bool (b );};func (_de CategoryAxis )AxisID ()uint32 {return _de ._bcf .AxId .ValAttr };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_acg BarChart )X ()*_c .CT_BarChart {return _acg ._gcd };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_ad BubbleChart )X ()*_c .CT_BubbleChart {return _ad ._eed };
|
||||
|
||||
// Values returns the value data source.
|
||||
func (_dbg BarChartSeries )Values ()NumberDataSource {if _dbg ._cff .Val ==nil {_dbg ._cff .Val =_c .NewCT_NumDataSource ();};return MakeNumberDataSource (_dbg ._cff .Val );};func MakeCategoryAxis (x *_c .CT_CatAx )CategoryAxis {return CategoryAxis {x }};func MakeLegend (l *_c .CT_Legend )Legend {return Legend {l }};
|
||||
|
||||
// AddBubbleChart adds a new bubble chart.
|
||||
func (_bd Chart )AddBubbleChart ()BubbleChart {_cfa :=_c .NewCT_PlotAreaChoice ();_bd ._egd .Chart .PlotArea .Choice =append (_bd ._egd .Chart .PlotArea .Choice ,_cfa );_cfa .BubbleChart =_c .NewCT_BubbleChart ();_edg :=BubbleChart {_eed :_cfa .BubbleChart };_edg .InitializeDefaults ();return _edg ;};
|
||||
|
||||
// AddBar3DChart adds a new 3D bar chart to a chart.
|
||||
func (_aaa Chart )AddBar3DChart ()Bar3DChart {_aab (_aaa ._egd .Chart );_gec :=_c .NewCT_PlotAreaChoice ();_aaa ._egd .Chart .PlotArea .Choice =append (_aaa ._egd .Chart .PlotArea .Choice ,_gec );_gec .Bar3DChart =_c .NewCT_Bar3DChart ();_gec .Bar3DChart .Grouping =_c .NewCT_BarGrouping ();_gec .Bar3DChart .Grouping .ValAttr =_c .ST_BarGroupingStandard ;_bcc :=Bar3DChart {_a :_gec .Bar3DChart };_bcc .InitializeDefaults ();return _bcc ;};
|
||||
|
||||
// LineChartSeries is the data series for a line chart.
|
||||
type LineChartSeries struct{_adb *_c .CT_LineSer };func (_bfg CategoryAxis )SetCrosses (axis Axis ){_bfg ._bcf .Choice =_c .NewEG_AxSharedChoice ();_bfg ._bcf .Choice .Crosses =_c .NewCT_Crosses ();_bfg ._bcf .Choice .Crosses .ValAttr =_c .ST_CrossesAutoZero ;_bfg ._bcf .CrossAx .ValAttr =axis .AxisID ();};type DateAxis struct{_dea *_c .CT_DateAx };
|
||||
|
||||
// InitializeDefaults the bar chart to its defaults
|
||||
func (_gab RadarChart )InitializeDefaults (){_gab ._abe .RadarStyle .ValAttr =_c .ST_RadarStyleMarker };func MakeMarker (x *_c .CT_Marker )Marker {return Marker {x }};
|
||||
|
||||
// Properties returns the line chart series shape properties.
|
||||
func (_aed LineChartSeries )Properties ()_eb .ShapeProperties {if _aed ._adb .SpPr ==nil {_aed ._adb .SpPr =_e .NewCT_ShapeProperties ();};return _eb .MakeShapeProperties (_aed ._adb .SpPr );};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_dgc Chart )X ()*_c .ChartSpace {return _dgc ._egd };func (_deac Title )ParagraphProperties ()_eb .ParagraphProperties {if _deac ._feb .Tx ==nil {_deac .SetText ("");};if _deac ._feb .Tx .Choice .Rich .P [0].PPr ==nil {_deac ._feb .Tx .Choice .Rich .P [0].PPr =_e .NewCT_TextParagraphProperties ();};return _eb .MakeParagraphProperties (_deac ._feb .Tx .Choice .Rich .P [0].PPr );};
|
||||
|
||||
// Properties returns the Bubble chart series shape properties.
|
||||
func (_bg BubbleChartSeries )Properties ()_eb .ShapeProperties {if _bg ._cba .SpPr ==nil {_bg ._cba .SpPr =_e .NewCT_ShapeProperties ();};return _eb .MakeShapeProperties (_bg ._cba .SpPr );};
|
||||
|
||||
// StockChart is a 2D Stock chart.
|
||||
type StockChart struct{chartBase ;_cfe *_c .CT_StockChart ;};func (_cbe ScatterChartSeries )SetSmooth (b bool ){_cbe ._bebd .Smooth =_c .NewCT_Boolean ();_cbe ._bebd .Smooth .ValAttr =&b ;};func (_fcf Legend )Properties ()_eb .ShapeProperties {if _fcf ._eaf .SpPr ==nil {_fcf ._eaf .SpPr =_e .NewCT_ShapeProperties ();};return _eb .MakeShapeProperties (_fcf ._eaf .SpPr );};
|
||||
|
||||
// Marker returns the marker properties.
|
||||
func (_bff LineChartSeries )Marker ()Marker {if _bff ._adb .Marker ==nil {_bff ._adb .Marker =_c .NewCT_Marker ();};return MakeMarker (_bff ._adb .Marker );};var _ebge =[]_d .Color {_d .RGB (0x33,0x66,0xcc),_d .RGB (0xDC,0x39,0x12),_d .RGB (0xFF,0x99,0x00),_d .RGB (0x10,0x96,0x18),_d .RGB (0x99,0x00,0x99),_d .RGB (0x3B,0x3E,0xAC),_d .RGB (0x00,0x99,0xC6),_d .RGB (0xDD,0x44,0x77),_d .RGB (0x66,0xAA,0x00),_d .RGB (0xB8,0x2E,0x2E),_d .RGB (0x31,0x63,0x95),_d .RGB (0x99,0x44,0x99),_d .RGB (0x22,0xAA,0x99),_d .RGB (0xAA,0xAA,0x11),_d .RGB (0x66,0x33,0xCC),_d .RGB (0xE6,0x73,0x00),_d .RGB (0x8B,0x07,0x07),_d .RGB (0x32,0x92,0x62),_d .RGB (0x55,0x74,0xA6),_d .RGB (0x3B,0x3E,0xAC)};type SurfaceChartSeries struct{_gaec *_c .CT_SurfaceSer };func (_cg Area3DChart )AddAxis (axis Axis ){_ec :=_c .NewCT_UnsignedInt ();_ec .ValAttr =axis .AxisID ();_cg ._b .AxId =append (_cg ._b .AxId ,_ec );};func (_ae CategoryAxis )SetMajorTickMark (m _c .ST_TickMark ){if m ==_c .ST_TickMarkUnset {_ae ._bcf .MajorTickMark =nil ;}else {_ae ._bcf .MajorTickMark =_c .NewCT_TickMark ();_ae ._bcf .MajorTickMark .ValAttr =m ;};};
|
||||
|
||||
// RemoveTitle removes any existing title from the chart.
|
||||
func (_bbe Chart )RemoveTitle (){_bbe ._egd .Chart .Title =nil ;_bbe ._egd .Chart .AutoTitleDeleted =_c .NewCT_Boolean ();_bbe ._egd .Chart .AutoTitleDeleted .ValAttr =_ca .Bool (true );};
|
||||
|
||||
// AddTitle sets a new title on the chart.
|
||||
func (_ggg Chart )AddTitle ()Title {_ggg ._egd .Chart .Title =_c .NewCT_Title ();_ggg ._egd .Chart .Title .Overlay =_c .NewCT_Boolean ();_ggg ._egd .Chart .Title .Overlay .ValAttr =_ca .Bool (false );_ggg ._egd .Chart .AutoTitleDeleted =_c .NewCT_Boolean ();_ggg ._egd .Chart .AutoTitleDeleted .ValAttr =_ca .Bool (false );_cfb :=MakeTitle (_ggg ._egd .Chart .Title );_cfb .InitializeDefaults ();return _cfb ;};
|
||||
|
||||
// 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{_ffg *_c .CT_AxDataSource };
|
||||
|
||||
// DoughnutChart is a Doughnut chart.
|
||||
type DoughnutChart struct{chartBase ;_cac *_c .CT_DoughnutChart ;};
|
||||
|
||||
// AddAxis adds an axis to a Scatter chart.
|
||||
func (_bgg ScatterChart )AddAxis (axis Axis ){_abbb :=_c .NewCT_UnsignedInt ();_abbb .ValAttr =axis .AxisID ();_bgg ._eeee .AxId =append (_bgg ._eeee .AxId ,_abbb );};
|
||||
|
||||
// AddSurface3DChart adds a new 3D surface chart to a chart.
|
||||
func (_fde Chart )AddSurface3DChart ()Surface3DChart {_faa :=_c .NewCT_PlotAreaChoice ();_fde ._egd .Chart .PlotArea .Choice =append (_fde ._egd .Chart .PlotArea .Choice ,_faa );_faa .Surface3DChart =_c .NewCT_Surface3DChart ();_aab (_fde ._egd .Chart );_gfg :=Surface3DChart {_daeb :_faa .Surface3DChart };_gfg .InitializeDefaults ();return _gfg ;};func (_aggg RadarChart )AddAxis (axis Axis ){_dcb :=_c .NewCT_UnsignedInt ();_dcb .ValAttr =axis .AxisID ();_aggg ._abe .AxId =append (_aggg ._abe .AxId ,_dcb );};
|
||||
|
||||
// SetOrder sets the order of the series
|
||||
func (_aec SurfaceChartSeries )SetOrder (idx uint32 ){_aec ._gaec .Order .ValAttr =idx };type chartBase struct{};
|
||||
// AddSeries adds a default series to an Radar chart.
|
||||
func (_ccff RadarChart )AddSeries ()RadarChartSeries {_cace :=_ccff .nextColor (len (_ccff ._bfcd .Ser ));_gdf :=_a .NewCT_RadarSer ();_ccff ._bfcd .Ser =append (_ccff ._bfcd .Ser ,_gdf );_gdf .Idx .ValAttr =uint32 (len (_ccff ._bfcd .Ser )-1);_gdf .Order .ValAttr =uint32 (len (_ccff ._bfcd .Ser )-1);_eeb :=RadarChartSeries {_gdf };_eeb .InitializeDefaults ();_eeb .Properties ().SetSolidFill (_cace );return _eeb ;};
|
||||
|
||||
// AddAxis adds an axis to a Surface chart.
|
||||
func (_bgegf Surface3DChart )AddAxis (axis Axis ){_aaf :=_c .NewCT_UnsignedInt ();_aaf .ValAttr =axis .AxisID ();_bgegf ._daeb .AxId =append (_bgegf ._daeb .AxId ,_aaf );};func (_dfb AreaChart )AddAxis (axis Axis ){_ga :=_c .NewCT_UnsignedInt ();_ga .ValAttr =axis .AxisID ();_dfb ._cb .AxId =append (_dfb ._cb .AxId ,_ga );};
|
||||
|
||||
// AddSeries adds a default series to an Doughnut chart.
|
||||
func (_gaca DoughnutChart )AddSeries ()PieChartSeries {_abd :=_c .NewCT_PieSer ();_gaca ._cac .Ser =append (_gaca ._cac .Ser ,_abd );_abd .Idx .ValAttr =uint32 (len (_gaca ._cac .Ser )-1);_abd .Order .ValAttr =uint32 (len (_gaca ._cac .Ser )-1);_aeb :=PieChartSeries {_abd };_aeb .InitializeDefaults ();return _aeb ;};
|
||||
|
||||
// SetOrder sets the order of the series
|
||||
func (_dbfd LineChartSeries )SetOrder (idx uint32 ){_dbfd ._adb .Order .ValAttr =idx };
|
||||
func (_aeedf Surface3DChart )AddAxis (axis Axis ){_bcddc :=_a .NewCT_UnsignedInt ();_bcddc .ValAttr =axis .AxisID ();_aeedf ._bcg .AxId =append (_aeedf ._bcg .AxId ,_bcddc );};
|
||||
|
||||
// InitializeDefaults the bar chart to its defaults
|
||||
func (_aef Pie3DChart )InitializeDefaults (){_aef ._eaca .VaryColors =_c .NewCT_Boolean ();_aef ._eaca .VaryColors .ValAttr =_ca .Bool (true );};func (_ggc GridLines )Properties ()_eb .ShapeProperties {if _ggc ._cbb .SpPr ==nil {_ggc ._cbb .SpPr =_e .NewCT_ShapeProperties ();};return _eb .MakeShapeProperties (_ggc ._cbb .SpPr );};func (_aggf Marker )Properties ()_eb .ShapeProperties {if _aggf ._afg .SpPr ==nil {_aggf ._afg .SpPr =_e .NewCT_ShapeProperties ();};return _eb .MakeShapeProperties (_aggf ._afg .SpPr );};
|
||||
func (_afa PieChart )InitializeDefaults (){_afa ._dac .VaryColors =_a .NewCT_Boolean ();_afa ._dac .VaryColors .ValAttr =_f .Bool (true );};
|
||||
|
||||
// Values returns the value data source.
|
||||
func (_fb AreaChartSeries )Values ()NumberDataSource {if _fb ._be .Val ==nil {_fb ._be .Val =_c .NewCT_NumDataSource ();};return MakeNumberDataSource (_fb ._be .Val );};
|
||||
// Properties returns the bar chart series shape properties.
|
||||
func (_dcf PieChartSeries )Properties ()_fb .ShapeProperties {if _dcf ._ade .SpPr ==nil {_dcf ._ade .SpPr =_dg .NewCT_ShapeProperties ();};return _fb .MakeShapeProperties (_dcf ._ade .SpPr );};
|
||||
|
||||
// Properties returns the Bubble chart series shape properties.
|
||||
func (_efc BubbleChartSeries )Properties ()_fb .ShapeProperties {if _efc ._cdg .SpPr ==nil {_efc ._cdg .SpPr =_dg .NewCT_ShapeProperties ();};return _fb .MakeShapeProperties (_efc ._cdg .SpPr );};func (_bgd Legend )Properties ()_fb .ShapeProperties {if _bgd ._abc .SpPr ==nil {_bgd ._abc .SpPr =_dg .NewCT_ShapeProperties ();};return _fb .MakeShapeProperties (_bgd ._abc .SpPr );};type ScatterChart struct{chartBase ;_fce *_a .CT_ScatterChart ;};func (_eef DataLabels )SetShowValue (b bool ){_eef .ensureChoice ();_eef ._bgg .Choice .ShowVal =_a .NewCT_Boolean ();_eef ._bgg .Choice .ShowVal .ValAttr =_f .Bool (b );};
|
||||
|
||||
// Pie3DChart is a Pie3D chart.
|
||||
type Pie3DChart struct{chartBase ;_cbef *_a .CT_Pie3DChart ;};
|
||||
|
||||
// Order returns the order of the series
|
||||
func (_ffc SurfaceChartSeries )Order ()uint32 {return _ffc ._gaec .Order .ValAttr };func (_gcdf DataLabels )SetShowLeaderLines (b bool ){_gcdf .ensureChoice ();_gcdf ._dfga .Choice .ShowLeaderLines =_c .NewCT_Boolean ();_gcdf ._dfga .Choice .ShowLeaderLines .ValAttr =_ca .Bool (b );};
|
||||
func (_gac LineChartSeries )Order ()uint32 {return _gac ._fgfb .Order .ValAttr };
|
||||
|
||||
// AddSeries adds a default series to an Pie chart.
|
||||
func (_fega PieChart )AddSeries ()PieChartSeries {_dcd :=_c .NewCT_PieSer ();_fega ._ggdc .Ser =append (_fega ._ggdc .Ser ,_dcd );_dcd .Idx .ValAttr =uint32 (len (_fega ._ggdc .Ser )-1);_dcd .Order .ValAttr =uint32 (len (_fega ._ggdc .Ser )-1);_ddg :=PieChartSeries {_dcd };_ddg .InitializeDefaults ();return _ddg ;};type SeriesAxis struct{_cga *_c .CT_SerAx };func (_bfd SeriesAxis )AxisID ()uint32 {return _bfd ._cga .AxId .ValAttr };
|
||||
|
||||
// AddRadarChart adds a new radar chart to a chart.
|
||||
func (_baf Chart )AddRadarChart ()RadarChart {_fgc :=_c .NewCT_PlotAreaChoice ();_baf ._egd .Chart .PlotArea .Choice =append (_baf ._egd .Chart .PlotArea .Choice ,_fgc );_fgc .RadarChart =_c .NewCT_RadarChart ();_bbb :=RadarChart {_abe :_fgc .RadarChart };_bbb .InitializeDefaults ();return _bbb ;};
|
||||
|
||||
// InitializeDefaults initializes an Radar series to the default values.
|
||||
func (_eafd RadarChartSeries )InitializeDefaults (){};
|
||||
// Properties returns the bar chart series shape properties.
|
||||
func (_gab BarChartSeries )Properties ()_fb .ShapeProperties {if _gab ._ag .SpPr ==nil {_gab ._ag .SpPr =_dg .NewCT_ShapeProperties ();};return _fb .MakeShapeProperties (_gab ._ag .SpPr );};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_db Bar3DChart )X ()*_c .CT_Bar3DChart {return _db ._a };
|
||||
func (_be DoughnutChart )X ()*_a .CT_DoughnutChart {return _be ._fde };func (_ddg StockChart )AddAxis (axis Axis ){_gbg :=_a .NewCT_UnsignedInt ();_gbg .ValAttr =axis .AxisID ();_ddg ._ffbff .AxId =append (_ddg ._ffbff .AxId ,_gbg );};
|
||||
|
||||
// BarChartSeries is a series to be used on a bar chart.
|
||||
type BarChartSeries struct{_ag *_a .CT_BarSer };
|
||||
|
||||
// AddDoughnutChart adds a new doughnut (pie with a hole in the center) chart to a chart.
|
||||
func (_dca Chart )AddDoughnutChart ()DoughnutChart {_ee :=_a .NewCT_PlotAreaChoice ();_dca ._gec .Chart .PlotArea .Choice =append (_dca ._gec .Chart .PlotArea .Choice ,_ee );_ee .DoughnutChart =_a .NewCT_DoughnutChart ();_cab :=DoughnutChart {_fde :_ee .DoughnutChart };_cab .InitializeDefaults ();return _cab ;};
|
||||
|
||||
// AddArea3DChart adds a new area chart to a chart.
|
||||
func (_ebf Chart )AddArea3DChart ()Area3DChart {_fee (_ebf ._gec .Chart );_bda :=_a .NewCT_PlotAreaChoice ();_ebf ._gec .Chart .PlotArea .Choice =append (_ebf ._gec .Chart .PlotArea .Choice ,_bda );_bda .Area3DChart =_a .NewCT_Area3DChart ();_bba :=Area3DChart {_db :_bda .Area3DChart };_bba .InitializeDefaults ();return _bba ;};
|
||||
|
||||
// SetText sets the series text
|
||||
func (_abe ScatterChartSeries )SetText (s string ){_abe ._abgb .Tx =_a .NewCT_SerTx ();_abe ._abgb .Tx .Choice .V =&s ;};func (_dbb NumberDataSource )SetReference (s string ){_dbb .ensureChoice ();if _dbb ._ecc .Choice .NumRef ==nil {_dbb ._ecc .Choice .NumRef =_a .NewCT_NumRef ();};_dbb ._ecc .Choice .NumRef .F =s ;};func (_feb nullAxis )AxisID ()uint32 {return 0};func (_acd SeriesAxis )AxisID ()uint32 {return _acd ._fadd .AxId .ValAttr };
|
||||
|
||||
// PieChartSeries is a series to be used on an Pie chart.
|
||||
type PieChartSeries struct{_ade *_a .CT_PieSer };
|
||||
|
||||
// InitializeDefaults initializes a Bubble chart series to the default values.
|
||||
func (_fc BubbleChartSeries )InitializeDefaults (){};
|
||||
|
||||
// SetValues is used to set the source data to a set of values.
|
||||
func (_gca CategoryAxisDataSource )SetValues (v []string ){_gca ._bf .Choice =_a .NewCT_AxDataSourceChoice ();_gca ._bf .Choice .StrLit =_a .NewCT_StrData ();_gca ._bf .Choice .StrLit .PtCount =_a .NewCT_UnsignedInt ();_gca ._bf .Choice .StrLit .PtCount .ValAttr =uint32 (len (v ));for _gda ,_aagc :=range v {_gca ._bf .Choice .StrLit .Pt =append (_gca ._bf .Choice .StrLit .Pt ,&_a .CT_StrVal {IdxAttr :uint32 (_gda ),V :_aagc });};};func (_bdf ValueAxis )MajorGridLines ()GridLines {if _bdf ._adfg .MajorGridlines ==nil {_bdf ._adfg .MajorGridlines =_a .NewCT_ChartLines ();};return GridLines {_bdf ._adfg .MajorGridlines };};func (_abcc SurfaceChartSeries )Values ()NumberDataSource {if _abcc ._fcb .Val ==nil {_abcc ._fcb .Val =_a .NewCT_NumDataSource ();};_caec :=MakeNumberDataSource (_abcc ._fcb .Val );_caec .CreateEmptyNumberCache ();return _caec ;};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_cb AreaChartSeries )X ()*_a .CT_AreaSer {return _cb ._ea };
|
||||
|
||||
// DoughnutChart is a Doughnut chart.
|
||||
type DoughnutChart struct{chartBase ;_fde *_a .CT_DoughnutChart ;};
|
||||
|
||||
// CategoryAxis returns the category data source.
|
||||
func (_bcf BarChartSeries )CategoryAxis ()CategoryAxisDataSource {if _bcf ._ag .Cat ==nil {_bcf ._ag .Cat =_a .NewCT_AxDataSource ();};return MakeAxisDataSource (_bcf ._ag .Cat );};func (_bcdf ValueAxis )SetCrosses (axis Axis ){_bcdf ._adfg .CrossAx .ValAttr =axis .AxisID ()};
|
||||
|
||||
// Bar3DChart is a 3D bar chart.
|
||||
type Bar3DChart struct{chartBase ;_fgc *_a .CT_Bar3DChart ;};
|
||||
|
||||
// AddLine3DChart adds a new 3D line chart to a chart.
|
||||
func (_cbc Chart )AddLine3DChart ()Line3DChart {_fee (_cbc ._gec .Chart );_gbe :=_a .NewCT_PlotAreaChoice ();_cbc ._gec .Chart .PlotArea .Choice =append (_cbc ._gec .Chart .PlotArea .Choice ,_gbe );_gbe .Line3DChart =_a .NewCT_Line3DChart ();_gbe .Line3DChart .Grouping =_a .NewCT_Grouping ();_gbe .Line3DChart .Grouping .ValAttr =_a .ST_GroupingStandard ;return Line3DChart {_dce :_gbe .Line3DChart };};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_cee Marker )X ()*_a .CT_Marker {return _cee ._aeed };
|
||||
|
||||
// AddSeries adds a default series to an Pie chart.
|
||||
func (_efca PieOfPieChart )AddSeries ()PieChartSeries {_gbcd :=_a .NewCT_PieSer ();_efca ._gabb .Ser =append (_efca ._gabb .Ser ,_gbcd );_gbcd .Idx .ValAttr =uint32 (len (_efca ._gabb .Ser )-1);_gbcd .Order .ValAttr =uint32 (len (_efca ._gabb .Ser )-1);_deg :=PieChartSeries {_gbcd };_deg .InitializeDefaults ();return _deg ;};func (_dee DateAxis )MajorGridLines ()GridLines {if _dee ._dfc .MajorGridlines ==nil {_dee ._dfc .MajorGridlines =_a .NewCT_ChartLines ();};return GridLines {_dee ._dfc .MajorGridlines };};func (_ge AreaChart )AddAxis (axis Axis ){_cf :=_a .NewCT_UnsignedInt ();_cf .ValAttr =axis .AxisID ();_ge ._baa .AxId =append (_ge ._baa .AxId ,_cf );};func (_ccgc ValueAxis )SetMinorTickMark (m _a .ST_TickMark ){if m ==_a .ST_TickMarkUnset {_ccgc ._adfg .MinorTickMark =nil ;}else {_ccgc ._adfg .MinorTickMark =_a .NewCT_TickMark ();_ccgc ._adfg .MinorTickMark .ValAttr =m ;};};
|
||||
|
||||
// Area3DChart is an area chart that has a shaded area underneath a curve.
|
||||
type Area3DChart struct{chartBase ;_db *_a .CT_Area3DChart ;};
|
||||
|
||||
// AddSeries adds a default series to a line chart.
|
||||
func (_eed LineChart )AddSeries ()LineChartSeries {_aeaf :=_eed .nextColor (len (_eed ._bagd .Ser ));_cg :=_a .NewCT_LineSer ();_eed ._bagd .Ser =append (_eed ._bagd .Ser ,_cg );_cg .Idx .ValAttr =uint32 (len (_eed ._bagd .Ser )-1);_cg .Order .ValAttr =uint32 (len (_eed ._bagd .Ser )-1);_eaf :=LineChartSeries {_cg };_eaf .InitializeDefaults ();_eaf .Properties ().LineProperties ().SetSolidFill (_aeaf );return _eaf ;};func MakeNumberDataSource (x *_a .CT_NumDataSource )NumberDataSource {return NumberDataSource {x }};
|
||||
|
||||
// AddRadarChart adds a new radar chart to a chart.
|
||||
func (_edc Chart )AddRadarChart ()RadarChart {_adf :=_a .NewCT_PlotAreaChoice ();_edc ._gec .Chart .PlotArea .Choice =append (_edc ._gec .Chart .PlotArea .Choice ,_adf );_adf .RadarChart =_a .NewCT_RadarChart ();_fgf :=RadarChart {_bfcd :_adf .RadarChart };_fgf .InitializeDefaults ();return _fgf ;};
|
||||
|
||||
// AddSeries adds a default series to a Surface chart.
|
||||
func (_bdg SurfaceChart )AddSeries ()SurfaceChartSeries {_aeafb :=_bdg .nextColor (len (_bdg ._gfaa .Ser ));_gbfd :=_a .NewCT_SurfaceSer ();_bdg ._gfaa .Ser =append (_bdg ._gfaa .Ser ,_gbfd );_gbfd .Idx .ValAttr =uint32 (len (_bdg ._gfaa .Ser )-1);_gbfd .Order .ValAttr =uint32 (len (_bdg ._gfaa .Ser )-1);_fdd :=SurfaceChartSeries {_gbfd };_fdd .InitializeDefaults ();_fdd .Properties ().LineProperties ().SetSolidFill (_aeafb );return _fdd ;};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_gdd GridLines )X ()*_a .CT_ChartLines {return _gdd ._gbc };
|
||||
|
||||
// AddSeries adds a default series to an Pie chart.
|
||||
func (_gff PieChart )AddSeries ()PieChartSeries {_cdbc :=_a .NewCT_PieSer ();_gff ._dac .Ser =append (_gff ._dac .Ser ,_cdbc );_cdbc .Idx .ValAttr =uint32 (len (_gff ._dac .Ser )-1);_cdbc .Order .ValAttr =uint32 (len (_gff ._dac .Ser )-1);_abb :=PieChartSeries {_cdbc };_abb .InitializeDefaults ();return _abb ;};func (_gdag DataLabels )SetPosition (p _a .ST_DLblPos ){_gdag .ensureChoice ();_gdag ._bgg .Choice .DLblPos =_a .NewCT_DLblPos ();_gdag ._bgg .Choice .DLblPos .ValAttr =p ;};func (_fad Marker )Properties ()_fb .ShapeProperties {if _fad ._aeed .SpPr ==nil {_fad ._aeed .SpPr =_dg .NewCT_ShapeProperties ();};return _fb .MakeShapeProperties (_fad ._aeed .SpPr );};
|
||||
|
||||
// SetLabelReference is used to set the source data to a range of cells
|
||||
// containing strings.
|
||||
func (_ddb CategoryAxisDataSource )SetLabelReference (s string ){_ddb ._ffg .Choice =_c .NewCT_AxDataSourceChoice ();_ddb ._ffg .Choice .StrRef =_c .NewCT_StrRef ();_ddb ._ffg .Choice .StrRef .F =s ;};
|
||||
|
||||
// Values returns the value data source.
|
||||
func (_beb RadarChartSeries )Values ()NumberDataSource {if _beb ._aefed .Val ==nil {_beb ._aefed .Val =_c .NewCT_NumDataSource ();};return MakeNumberDataSource (_beb ._aefed .Val );};
|
||||
|
||||
// AddValueAxis adds a value axis to the chart.
|
||||
func (_ddba Chart )AddValueAxis ()ValueAxis {_efab :=_c .NewCT_ValAx ();if _ddba ._egd .Chart .PlotArea .CChoice ==nil {_ddba ._egd .Chart .PlotArea .CChoice =_c .NewCT_PlotAreaChoice1 ();};_efab .AxId =_c .NewCT_UnsignedInt ();_efab .AxId .ValAttr =0x7FFFFFFF&_fd .Uint32 ();_ddba ._egd .Chart .PlotArea .CChoice .ValAx =append (_ddba ._egd .Chart .PlotArea .CChoice .ValAx ,_efab );_efab .Delete =_c .NewCT_Boolean ();_efab .Delete .ValAttr =_ca .Bool (false );_efab .Scaling =_c .NewCT_Scaling ();_efab .Scaling .Orientation =_c .NewCT_Orientation ();_efab .Scaling .Orientation .ValAttr =_c .ST_OrientationMinMax ;_efab .Choice =&_c .EG_AxSharedChoice {};_efab .Choice .Crosses =_c .NewCT_Crosses ();_efab .Choice .Crosses .ValAttr =_c .ST_CrossesAutoZero ;_efab .CrossBetween =_c .NewCT_CrossBetween ();_efab .CrossBetween .ValAttr =_c .ST_CrossBetweenBetween ;_bgf :=MakeValueAxis (_efab );_bgf .MajorGridLines ().Properties ().LineProperties ().SetSolidFill (_d .LightGray );_bgf .SetMajorTickMark (_c .ST_TickMarkOut );_bgf .SetMinorTickMark (_c .ST_TickMarkIn );_bgf .SetTickLabelPosition (_c .ST_TickLblPosNextTo );_bgf .Properties ().LineProperties ().SetSolidFill (_d .Black );_bgf .SetPosition (_c .ST_AxPosL );return _bgf ;};
|
||||
|
||||
// RadarChartSeries is a series to be used on an Radar chart.
|
||||
type RadarChartSeries struct{_aefed *_c .CT_RadarSer };
|
||||
|
||||
// Area3DChart is an area chart that has a shaded area underneath a curve.
|
||||
type Area3DChart struct{chartBase ;_b *_c .CT_Area3DChart ;};
|
||||
|
||||
// CategoryAxis returns the category data source.
|
||||
func (_cbf AreaChartSeries )CategoryAxis ()CategoryAxisDataSource {if _cbf ._be .Cat ==nil {_cbf ._be .Cat =_c .NewCT_AxDataSource ();};return MakeAxisDataSource (_cbf ._be .Cat );};
|
||||
func (_cbd CategoryAxisDataSource )SetLabelReference (s string ){_cbd ._bf .Choice =_a .NewCT_AxDataSourceChoice ();_cbd ._bf .Choice .StrRef =_a .NewCT_StrRef ();_cbd ._bf .Choice .StrRef .F =s ;};
|
||||
|
||||
// Properties returns the line chart series shape properties.
|
||||
func (_ead ScatterChartSeries )Properties ()_eb .ShapeProperties {if _ead ._bebd .SpPr ==nil {_ead ._bebd .SpPr =_e .NewCT_ShapeProperties ();};return _eb .MakeShapeProperties (_ead ._bebd .SpPr );};
|
||||
func (_ccf LineChartSeries )Properties ()_fb .ShapeProperties {if _ccf ._fgfb .SpPr ==nil {_ccf ._fgfb .SpPr =_dg .NewCT_ShapeProperties ();};return _fb .MakeShapeProperties (_ccf ._fgfb .SpPr );};
|
||||
|
||||
// SetDisplayBlanksAs controls how missing values are displayed.
|
||||
func (_fdaf Chart )SetDisplayBlanksAs (v _c .ST_DispBlanksAs ){_fdaf ._egd .Chart .DispBlanksAs =_c .NewCT_DispBlanksAs ();_fdaf ._egd .Chart .DispBlanksAs .ValAttr =v ;};
|
||||
|
||||
// AddDateAxis adds a value axis to the chart.
|
||||
func (_ebgb Chart )AddDateAxis ()DateAxis {_cea :=_c .NewCT_DateAx ();if _ebgb ._egd .Chart .PlotArea .CChoice ==nil {_ebgb ._egd .Chart .PlotArea .CChoice =_c .NewCT_PlotAreaChoice1 ();};_cea .AxId =_c .NewCT_UnsignedInt ();_cea .AxId .ValAttr =0x7FFFFFFF&_fd .Uint32 ();_ebgb ._egd .Chart .PlotArea .CChoice .DateAx =append (_ebgb ._egd .Chart .PlotArea .CChoice .DateAx ,_cea );_cea .Delete =_c .NewCT_Boolean ();_cea .Delete .ValAttr =_ca .Bool (false );_cea .Scaling =_c .NewCT_Scaling ();_cea .Scaling .Orientation =_c .NewCT_Orientation ();_cea .Scaling .Orientation .ValAttr =_c .ST_OrientationMinMax ;_cea .Choice =&_c .EG_AxSharedChoice {};_cea .Choice .Crosses =_c .NewCT_Crosses ();_cea .Choice .Crosses .ValAttr =_c .ST_CrossesAutoZero ;_eaa :=DateAxis {_cea };_eaa .MajorGridLines ().Properties ().LineProperties ().SetSolidFill (_d .LightGray );_eaa .SetMajorTickMark (_c .ST_TickMarkOut );_eaa .SetMinorTickMark (_c .ST_TickMarkIn );_eaa .SetTickLabelPosition (_c .ST_TickLblPosNextTo );_eaa .Properties ().LineProperties ().SetSolidFill (_d .Black );_eaa .SetPosition (_c .ST_AxPosL );return _eaa ;};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_bcd Legend )X ()*_c .CT_Legend {return _bcd ._eaf };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_bef AreaChartSeries )X ()*_c .CT_AreaSer {return _bef ._be };
|
||||
|
||||
// InitializeDefaults initializes an Pie series to the default values.
|
||||
func (_cde PieChartSeries )InitializeDefaults (){};func (_egb DateAxis )SetMinorTickMark (m _c .ST_TickMark ){if m ==_c .ST_TickMarkUnset {_egb ._dea .MinorTickMark =nil ;}else {_egb ._dea .MinorTickMark =_c .NewCT_TickMark ();_egb ._dea .MinorTickMark .ValAttr =m ;};};
|
||||
|
||||
// InitializeDefaults the Bubble chart to its defaults
|
||||
func (_ebc BubbleChart )InitializeDefaults (){};type ScatterChart struct{chartBase ;_eeee *_c .CT_ScatterChart ;};
|
||||
|
||||
// SetHoleSize controls the hole size in the pie chart and is measured in percent.
|
||||
func (_fag DoughnutChart )SetHoleSize (pct uint8 ){if _fag ._cac .HoleSize ==nil {_fag ._cac .HoleSize =_c .NewCT_HoleSize ();};if _fag ._cac .HoleSize .ValAttr ==nil {_fag ._cac .HoleSize .ValAttr =&_c .ST_HoleSize {};};_fag ._cac .HoleSize .ValAttr .ST_HoleSizeUByte =&pct ;};
|
||||
|
||||
// Chart is a generic chart.
|
||||
type Chart struct{_egd *_c .ChartSpace };func (_dfg nullAxis )AxisID ()uint32 {return 0};
|
||||
|
||||
// AddSeries adds a default series to a bar chart.
|
||||
func (_ee BarChart )AddSeries ()BarChartSeries {_cc :=_ee .nextColor (len (_ee ._gcd .Ser ));_gdd :=_c .NewCT_BarSer ();_ee ._gcd .Ser =append (_ee ._gcd .Ser ,_gdd );_gdd .Idx .ValAttr =uint32 (len (_ee ._gcd .Ser )-1);_gdd .Order .ValAttr =uint32 (len (_ee ._gcd .Ser )-1);_acf :=BarChartSeries {_gdd };_acf .InitializeDefaults ();_acf .Properties ().SetSolidFill (_cc );return _acf ;};
|
||||
|
||||
// RemoveLegend removes the legend if the chart has one.
|
||||
func (_ada Chart )RemoveLegend (){_ada ._egd .Chart .Legend =nil };
|
||||
|
||||
// BarChart is a 2D bar chart.
|
||||
type BarChart struct{chartBase ;_gcd *_c .CT_BarChart ;};
|
||||
|
||||
// Properties returns the line chart series shape properties.
|
||||
func (_gabe SurfaceChartSeries )Properties ()_eb .ShapeProperties {if _gabe ._gaec .SpPr ==nil {_gabe ._gaec .SpPr =_e .NewCT_ShapeProperties ();};return _eb .MakeShapeProperties (_gabe ._gaec .SpPr );};type NumberDataSource struct{_aeg *_c .CT_NumDataSource };func (_bcaa SeriesAxis )InitializeDefaults (){};
|
||||
|
||||
// Index returns the index of the series
|
||||
func (_afff LineChartSeries )Index ()uint32 {return _afff ._adb .Idx .ValAttr };
|
||||
|
||||
// AddScatterChart adds a scatter (X/Y) chart.
|
||||
func (_ebca Chart )AddScatterChart ()ScatterChart {_bbg :=_c .NewCT_PlotAreaChoice ();_ebca ._egd .Chart .PlotArea .Choice =append (_ebca ._egd .Chart .PlotArea .Choice ,_bbg );_bbg .ScatterChart =_c .NewCT_ScatterChart ();_faf :=ScatterChart {_eeee :_bbg .ScatterChart };_faf .InitializeDefaults ();return _faf ;};type Title struct{_feb *_c .CT_Title };
|
||||
|
||||
// SetExplosion sets the value that the segements of the pie are 'exploded' by
|
||||
func (_cdf PieChartSeries )SetExplosion (v uint32 ){_cdf ._faag .Explosion =_c .NewCT_UnsignedInt ();_cdf ._faag .Explosion .ValAttr =v ;};func MakeDataLabels (x *_c .CT_DLbls )DataLabels {return DataLabels {x }};
|
||||
// AddBar3DChart adds a new 3D bar chart to a chart.
|
||||
func (_ega Chart )AddBar3DChart ()Bar3DChart {_fee (_ega ._gec .Chart );_gdb :=_a .NewCT_PlotAreaChoice ();_ega ._gec .Chart .PlotArea .Choice =append (_ega ._gec .Chart .PlotArea .Choice ,_gdb );_gdb .Bar3DChart =_a .NewCT_Bar3DChart ();_gdb .Bar3DChart .Grouping =_a .NewCT_BarGrouping ();_gdb .Bar3DChart .Grouping .ValAttr =_a .ST_BarGroupingStandard ;_fd :=Bar3DChart {_fgc :_gdb .Bar3DChart };_fd .InitializeDefaults ();return _fd ;};
|
||||
|
||||
// SetText sets the series text.
|
||||
func (_cge BubbleChartSeries )SetText (s string ){_cge ._cba .Tx =_c .NewCT_SerTx ();_cge ._cba .Tx .Choice .V =&s ;};func (_gfc CategoryAxis )InitializeDefaults (){_gfc .SetPosition (_c .ST_AxPosB );_gfc .SetMajorTickMark (_c .ST_TickMarkOut );_gfc .SetMinorTickMark (_c .ST_TickMarkIn );_gfc .SetTickLabelPosition (_c .ST_TickLblPosNextTo );_gfc .MajorGridLines ().Properties ().LineProperties ().SetSolidFill (_d .LightGray );_gfc .Properties ().LineProperties ().SetSolidFill (_d .Black );};func (_dae DateAxis )AxisID ()uint32 {return _dae ._dea .AxId .ValAttr };
|
||||
func (_gg BubbleChartSeries )SetText (s string ){_gg ._cdg .Tx =_a .NewCT_SerTx ();_gg ._cdg .Tx .Choice .V =&s ;};
|
||||
|
||||
// Order returns the order of the series
|
||||
func (_geba ScatterChartSeries )Order ()uint32 {return _geba ._bebd .Order .ValAttr };
|
||||
// InitializeDefaults the bar chart to its defaults
|
||||
func (_daa DoughnutChart )InitializeDefaults (){_daa ._fde .VaryColors =_a .NewCT_Boolean ();_daa ._fde .VaryColors .ValAttr =_f .Bool (true );_daa ._fde .HoleSize =_a .NewCT_HoleSize ();_daa ._fde .HoleSize .ValAttr =&_a .ST_HoleSize {};_daa ._fde .HoleSize .ValAttr .ST_HoleSizeUByte =_f .Uint8 (50);};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_fa AreaChart )X ()*_c .CT_AreaChart {return _fa ._cb };
|
||||
// SetDirection changes the direction of the bar chart (bar or column).
|
||||
func (_ac BarChart )SetDirection (d _a .ST_BarDir ){_ac ._bd .BarDir .ValAttr =d };
|
||||
|
||||
// AddAxis adds an axis to a line chart.
|
||||
func (_efe LineChart )AddAxis (axis Axis ){_bca :=_c .NewCT_UnsignedInt ();_bca .ValAttr =axis .AxisID ();_efe ._bed .AxId =append (_efe ._bed .AxId ,_bca );};
|
||||
func (_ggdd Line3DChart )AddAxis (axis Axis ){_ebcg :=_a .NewCT_UnsignedInt ();_ebcg .ValAttr =axis .AxisID ();_ggdd ._dce .AxId =append (_ggdd ._dce .AxId ,_ebcg );};func MakeSeriesAxis (x *_a .CT_SerAx )SeriesAxis {return SeriesAxis {x }};
|
||||
|
||||
// InitializeDefaults the bar chart to its defaults
|
||||
func (_dbd PieOfPieChart )InitializeDefaults (){_dbd ._abdb .VaryColors =_c .NewCT_Boolean ();_dbd ._abdb .VaryColors .ValAttr =_ca .Bool (true );_dbd .SetType (_c .ST_OfPieTypePie );_dbd ._abdb .SecondPieSize =_c .NewCT_SecondPieSize ();_dbd ._abdb .SecondPieSize .ValAttr =&_c .ST_SecondPieSize {};_dbd ._abdb .SecondPieSize .ValAttr .ST_SecondPieSizeUShort =_ca .Uint16 (75);_gdfb :=_c .NewCT_ChartLines ();_gdfb .SpPr =_e .NewCT_ShapeProperties ();_aefe :=_eb .MakeShapeProperties (_gdfb .SpPr );_aefe .LineProperties ().SetSolidFill (_d .Auto );_dbd ._abdb .SerLines =append (_dbd ._abdb .SerLines ,_gdfb );};
|
||||
// AddTitle sets a new title on the chart.
|
||||
func (_eae Chart )AddTitle ()Title {_eae ._gec .Chart .Title =_a .NewCT_Title ();_eae ._gec .Chart .Title .Overlay =_a .NewCT_Boolean ();_eae ._gec .Chart .Title .Overlay .ValAttr =_f .Bool (false );_eae ._gec .Chart .AutoTitleDeleted =_a .NewCT_Boolean ();_eae ._gec .Chart .AutoTitleDeleted .ValAttr =_f .Bool (false );_gfd :=MakeTitle (_eae ._gec .Chart .Title );_gfd .InitializeDefaults ();return _gfd ;};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_eff Line3DChart )X ()*_a .CT_Line3DChart {return _eff ._dce };
|
||||
|
||||
// InitializeDefaults initializes a bar chart series to the default values.
|
||||
func (_ea BarChartSeries )InitializeDefaults (){};
|
||||
func (_bcc BarChartSeries )InitializeDefaults (){};func (_ged Title )InitializeDefaults (){_ged .SetText ("\u0054\u0069\u0074l\u0065");_ged .RunProperties ().SetSize (16*_bg .Point );_ged .RunProperties ().SetSolidFill (_g .Black );_ged .RunProperties ().SetFont ("\u0043\u0061\u006c\u0069\u0062\u0020\u0072\u0069");_ged .RunProperties ().SetBold (false );};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_ffgg PieChartSeries )X ()*_c .CT_PieSer {return _ffgg ._faag };func (_ffb Legend )InitializeDefaults (){_ffb .SetPosition (_c .ST_LegendPosR );_ffb .SetOverlay (false );_ffb .Properties ().SetNoFill ();_ffb .Properties ().LineProperties ().SetNoFill ();};
|
||||
func (_fbfb SurfaceChartSeries )X ()*_a .CT_SurfaceSer {return _fbfb ._fcb };func (_bdb LineChartSeries )CategoryAxis ()CategoryAxisDataSource {if _bdb ._fgfb .Cat ==nil {_bdb ._fgfb .Cat =_a .NewCT_AxDataSource ();};return MakeAxisDataSource (_bdb ._fgfb .Cat );};func (_gabc Marker )SetSymbol (s _a .ST_MarkerStyle ){if s ==_a .ST_MarkerStyleUnset {_gabc ._aeed .Symbol =nil ;}else {_gabc ._aeed .Symbol =_a .NewCT_MarkerStyle ();_gabc ._aeed .Symbol .ValAttr =s ;};};func (_fdg DateAxis )SetMajorTickMark (m _a .ST_TickMark ){if m ==_a .ST_TickMarkUnset {_fdg ._dfc .MajorTickMark =nil ;}else {_fdg ._dfc .MajorTickMark =_a .NewCT_TickMark ();_fdg ._dfc .MajorTickMark .ValAttr =m ;};};func (_gcd DateAxis )AxisID ()uint32 {return _gcd ._dfc .AxId .ValAttr };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_eee Pie3DChart )X ()*_c .CT_Pie3DChart {return _eee ._eaca };
|
||||
|
||||
// AddLine3DChart adds a new 3D line chart to a chart.
|
||||
func (_ag Chart )AddLine3DChart ()Line3DChart {_aab (_ag ._egd .Chart );_ebd :=_c .NewCT_PlotAreaChoice ();_ag ._egd .Chart .PlotArea .Choice =append (_ag ._egd .Chart .PlotArea .Choice ,_ebd );_ebd .Line3DChart =_c .NewCT_Line3DChart ();_ebd .Line3DChart .Grouping =_c .NewCT_Grouping ();_ebd .Line3DChart .Grouping .ValAttr =_c .ST_GroupingStandard ;return Line3DChart {_cadd :_ebd .Line3DChart };};
|
||||
// SetType sets the type the secone pie to either pie or bar
|
||||
func (_bdbb PieOfPieChart )SetType (t _a .ST_OfPieType ){_bdbb ._gabb .OfPieType .ValAttr =t };
|
||||
|
||||
// InitializeDefaults the bar chart to its defaults
|
||||
func (_bgfc DoughnutChart )InitializeDefaults (){_bgfc ._cac .VaryColors =_c .NewCT_Boolean ();_bgfc ._cac .VaryColors .ValAttr =_ca .Bool (true );_bgfc ._cac .HoleSize =_c .NewCT_HoleSize ();_bgfc ._cac .HoleSize .ValAttr =&_c .ST_HoleSize {};_bgfc ._cac .HoleSize .ValAttr .ST_HoleSizeUByte =_ca .Uint8 (50);};
|
||||
func (_fba BarChart )InitializeDefaults (){_fba .SetDirection (_a .ST_BarDirCol )};
|
||||
|
||||
// AddPieOfPieChart adds a new pie chart to a chart.
|
||||
func (_bae Chart )AddPieOfPieChart ()PieOfPieChart {_afg :=_a .NewCT_PlotAreaChoice ();_bae ._gec .Chart .PlotArea .Choice =append (_bae ._gec .Chart .PlotArea .Choice ,_afg );_afg .OfPieChart =_a .NewCT_OfPieChart ();_fa :=PieOfPieChart {_gabb :_afg .OfPieChart };_fa .InitializeDefaults ();return _fa ;};
|
||||
|
||||
// BarChart is a 2D bar chart.
|
||||
type BarChart struct{chartBase ;_bd *_a .CT_BarChart ;};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_fca DateAxis )X ()*_a .CT_DateAx {return _fca ._dfc };
|
||||
|
||||
// InitializeDefaults the Stock chart to its defaults
|
||||
func (_dce StockChart )InitializeDefaults (){_dce ._cfe .HiLowLines =_c .NewCT_ChartLines ();_dce ._cfe .UpDownBars =_c .NewCT_UpDownBars ();_dce ._cfe .UpDownBars .GapWidth =_c .NewCT_GapAmount ();_dce ._cfe .UpDownBars .GapWidth .ValAttr =&_c .ST_GapAmount {};_dce ._cfe .UpDownBars .GapWidth .ValAttr .ST_GapAmountUShort =_ca .Uint16 (150);_dce ._cfe .UpDownBars .UpBars =_c .NewCT_UpDownBar ();_dce ._cfe .UpDownBars .DownBars =_c .NewCT_UpDownBar ();};func (_agf ValueAxis )AxisID ()uint32 {return _agf ._efce .AxId .ValAttr };func (_bac CategoryAxis )SetMinorTickMark (m _c .ST_TickMark ){if m ==_c .ST_TickMarkUnset {_bac ._bcf .MinorTickMark =nil ;}else {_bac ._bcf .MinorTickMark =_c .NewCT_TickMark ();_bac ._bcf .MinorTickMark .ValAttr =m ;};};
|
||||
|
||||
// SetIndex sets the index of the series
|
||||
func (_efac SurfaceChartSeries )SetIndex (idx uint32 ){_efac ._gaec .Idx .ValAttr =idx };func (_bccd Legend )SetPosition (p _c .ST_LegendPos ){if p ==_c .ST_LegendPosUnset {_bccd ._eaf .LegendPos =nil ;}else {_bccd ._eaf .LegendPos =_c .NewCT_LegendPos ();_bccd ._eaf .LegendPos .ValAttr =p ;};};
|
||||
|
||||
// AreaChart is an area chart that has a shaded area underneath a curve.
|
||||
type AreaChart struct{chartBase ;_cb *_c .CT_AreaChart ;};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_fafg DateAxis )X ()*_c .CT_DateAx {return _fafg ._dea };
|
||||
|
||||
// AddPie3DChart adds a new pie chart to a chart.
|
||||
func (_fdf Chart )AddPie3DChart ()Pie3DChart {_aab (_fdf ._egd .Chart );_bge :=_c .NewCT_PlotAreaChoice ();_fdf ._egd .Chart .PlotArea .Choice =append (_fdf ._egd .Chart .PlotArea .Choice ,_bge );_bge .Pie3DChart =_c .NewCT_Pie3DChart ();_ef :=Pie3DChart {_eaca :_bge .Pie3DChart };_ef .InitializeDefaults ();return _ef ;};
|
||||
|
||||
// SetText sets the series text
|
||||
func (_daec ScatterChartSeries )SetText (s string ){_daec ._bebd .Tx =_c .NewCT_SerTx ();_daec ._bebd .Tx .Choice .V =&s ;};type GridLines struct{_cbb *_c .CT_ChartLines };func (_bbff ValueAxis )Properties ()_eb .ShapeProperties {if _bbff ._efce .SpPr ==nil {_bbff ._efce .SpPr =_e .NewCT_ShapeProperties ();};return _eb .MakeShapeProperties (_bbff ._efce .SpPr );};
|
||||
|
||||
// AddAreaChart adds a new area chart to a chart.
|
||||
func (_ggeb Chart )AddAreaChart ()AreaChart {_age :=_c .NewCT_PlotAreaChoice ();_ggeb ._egd .Chart .PlotArea .Choice =append (_ggeb ._egd .Chart .PlotArea .Choice ,_age );_age .AreaChart =_c .NewCT_AreaChart ();_dbc :=AreaChart {_cb :_age .AreaChart };_dbc .InitializeDefaults ();return _dbc ;};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_aee Line3DChart )X ()*_c .CT_Line3DChart {return _aee ._cadd };type Legend struct{_eaf *_c .CT_Legend };func (_bae DataLabels )ensureChoice (){if _bae ._dfga .Choice ==nil {_bae ._dfga .Choice =_c .NewCT_DLblsChoice ();};};func (_dgce StockChart )AddAxis (axis Axis ){_bcbc :=_c .NewCT_UnsignedInt ();_bcbc .ValAttr =axis .AxisID ();_dgce ._cfe .AxId =append (_dgce ._cfe .AxId ,_bcbc );};func _aab (_dbbe *_c .CT_Chart ){_dbbe .View3D =_c .NewCT_View3D ();_dbbe .View3D .RotX =_c .NewCT_RotX ();_dbbe .View3D .RotX .ValAttr =_ca .Int8 (15);_dbbe .View3D .RotY =_c .NewCT_RotY ();_dbbe .View3D .RotY .ValAttr =_ca .Uint16 (20);_dbbe .View3D .RAngAx =_c .NewCT_Boolean ();_dbbe .View3D .RAngAx .ValAttr =_ca .Bool (false );_dbbe .Floor =_c .NewCT_Surface ();_dbbe .Floor .Thickness =_c .NewCT_Thickness ();_dbbe .Floor .Thickness .ValAttr .Uint32 =_ca .Uint32 (0);_dbbe .SideWall =_c .NewCT_Surface ();_dbbe .SideWall .Thickness =_c .NewCT_Thickness ();_dbbe .SideWall .Thickness .ValAttr .Uint32 =_ca .Uint32 (0);_dbbe .BackWall =_c .NewCT_Surface ();_dbbe .BackWall .Thickness =_c .NewCT_Thickness ();_dbbe .BackWall .Thickness .ValAttr .Uint32 =_ca .Uint32 (0);};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_eec DoughnutChart )X ()*_c .CT_DoughnutChart {return _eec ._cac };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_efg PieOfPieChart )X ()*_c .CT_OfPieChart {return _efg ._abdb };
|
||||
|
||||
// AddSeries adds a default series to an area chart.
|
||||
func (_df Area3DChart )AddSeries ()AreaChartSeries {_bb :=_df .nextColor (len (_df ._b .Ser ));_da :=_c .NewCT_AreaSer ();_df ._b .Ser =append (_df ._b .Ser ,_da );_da .Idx .ValAttr =uint32 (len (_df ._b .Ser )-1);_da .Order .ValAttr =uint32 (len (_df ._b .Ser )-1);_g :=AreaChartSeries {_da };_g .InitializeDefaults ();_g .Properties ().SetSolidFill (_bb );return _g ;};
|
||||
|
||||
// SetText sets the series text.
|
||||
func (_fdfg RadarChartSeries )SetText (s string ){_fdfg ._aefed .Tx =_c .NewCT_SerTx ();_fdfg ._aefed .Tx .Choice .V =&s ;};func (_gfb DataLabels )SetShowSeriesName (b bool ){_gfb .ensureChoice ();_gfb ._dfga .Choice .ShowSerName =_c .NewCT_Boolean ();_gfb ._dfga .Choice .ShowSerName .ValAttr =_ca .Bool (b );};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_bfa ScatterChartSeries )X ()*_c .CT_ScatterSer {return _bfa ._bebd };func (_cgga DateAxis )SetTickLabelPosition (p _c .ST_TickLblPos ){if p ==_c .ST_TickLblPosUnset {_cgga ._dea .TickLblPos =nil ;}else {_cgga ._dea .TickLblPos =_c .NewCT_TickLblPos ();_cgga ._dea .TickLblPos .ValAttr =p ;};};
|
||||
|
||||
// Labels returns the data label properties.
|
||||
func (_dgfa ScatterChartSeries )Labels ()DataLabels {if _dgfa ._bebd .DLbls ==nil {_dgfa ._bebd .DLbls =_c .NewCT_DLbls ();};return MakeDataLabels (_dgfa ._bebd .DLbls );};
|
||||
|
||||
// CategoryAxis returns the category data source.
|
||||
func (_cfc BubbleChartSeries )CategoryAxis ()CategoryAxisDataSource {if _cfc ._cba .XVal ==nil {_cfc ._cba .XVal =_c .NewCT_AxDataSource ();};return MakeAxisDataSource (_cfc ._cba .XVal );};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_fgce SeriesAxis )X ()*_c .CT_SerAx {return _fgce ._cga };type nullAxis byte ;
|
||||
|
||||
// SetValues is used to set the source data to a set of values.
|
||||
func (_bgb CategoryAxisDataSource )SetValues (v []string ){_bgb ._ffg .Choice =_c .NewCT_AxDataSourceChoice ();_bgb ._ffg .Choice .StrLit =_c .NewCT_StrData ();_bgb ._ffg .Choice .StrLit .PtCount =_c .NewCT_UnsignedInt ();_bgb ._ffg .Choice .StrLit .PtCount .ValAttr =uint32 (len (v ));for _dg ,_dgf :=range v {_bgb ._ffg .Choice .StrLit .Pt =append (_bgb ._ffg .Choice .StrLit .Pt ,&_c .CT_StrVal {IdxAttr :uint32 (_dg ),V :_dgf });};};
|
||||
|
||||
// Properties returns the chart's shape properties.
|
||||
func (_efa Chart )Properties ()_eb .ShapeProperties {if _efa ._egd .SpPr ==nil {_efa ._egd .SpPr =_e .NewCT_ShapeProperties ();};return _eb .MakeShapeProperties (_efa ._egd .SpPr );};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_dbga StockChart )X ()*_c .CT_StockChart {return _dbga ._cfe };func (_fef DataLabels )SetPosition (p _c .ST_DLblPos ){_fef .ensureChoice ();_fef ._dfga .Choice .DLblPos =_c .NewCT_DLblPos ();_fef ._dfga .Choice .DLblPos .ValAttr =p ;};
|
||||
|
||||
// ScatterChartSeries is the data series for a scatter chart.
|
||||
type ScatterChartSeries struct{_bebd *_c .CT_ScatterSer };
|
||||
|
||||
// InitializeDefaults initializes an area series to the default values.
|
||||
func (_gc AreaChartSeries )InitializeDefaults (){};
|
||||
|
||||
// SurfaceChart is a 3D surface chart, viewed from the top-down.
|
||||
type SurfaceChart struct{chartBase ;_fbcf *_c .CT_SurfaceChart ;};
|
||||
|
||||
// AddSeries adds a default series to a Stock chart.
|
||||
func (_fbc StockChart )AddSeries ()LineChartSeries {_fdbf :=_c .NewCT_LineSer ();_fbc ._cfe .Ser =append (_fbc ._cfe .Ser ,_fdbf );_fdbf .Idx .ValAttr =uint32 (len (_fbc ._cfe .Ser )-1);_fdbf .Order .ValAttr =uint32 (len (_fbc ._cfe .Ser )-1);_dde :=LineChartSeries {_fdbf };_dde .Values ().CreateEmptyNumberCache ();_dde .Properties ().LineProperties ().SetNoFill ();return _dde ;};func (_gg CategoryAxis )Properties ()_eb .ShapeProperties {if _gg ._bcf .SpPr ==nil {_gg ._bcf .SpPr =_e .NewCT_ShapeProperties ();};return _eb .MakeShapeProperties (_gg ._bcf .SpPr );};
|
||||
|
||||
// Values returns the value data source.
|
||||
func (_bbf BubbleChartSeries )Values ()NumberDataSource {if _bbf ._cba .YVal ==nil {_bbf ._cba .YVal =_c .NewCT_NumDataSource ();};return MakeNumberDataSource (_bbf ._cba .YVal );};
|
||||
|
||||
// AddCategoryAxis adds a category axis.
|
||||
func (_bbge Chart )AddCategoryAxis ()CategoryAxis {_cbgf :=_c .NewCT_CatAx ();if _bbge ._egd .Chart .PlotArea .CChoice ==nil {_bbge ._egd .Chart .PlotArea .CChoice =_c .NewCT_PlotAreaChoice1 ();};_cbgf .AxId =_c .NewCT_UnsignedInt ();_cbgf .AxId .ValAttr =0x7FFFFFFF&_fd .Uint32 ();_bbge ._egd .Chart .PlotArea .CChoice .CatAx =append (_bbge ._egd .Chart .PlotArea .CChoice .CatAx ,_cbgf );_cbgf .Auto =_c .NewCT_Boolean ();_cbgf .Auto .ValAttr =_ca .Bool (true );_cbgf .Delete =_c .NewCT_Boolean ();_cbgf .Delete .ValAttr =_ca .Bool (false );_add :=MakeCategoryAxis (_cbgf );_add .InitializeDefaults ();return _add ;};func (_acbd ScatterChart )InitializeDefaults (){_acbd ._eeee .ScatterStyle .ValAttr =_c .ST_ScatterStyleMarker ;};type DataLabels struct{_dfga *_c .CT_DLbls };
|
||||
|
||||
// AddSeries adds a default series to an Pie chart.
|
||||
func (_edgg PieOfPieChart )AddSeries ()PieChartSeries {_bcad :=_c .NewCT_PieSer ();_edgg ._abdb .Ser =append (_edgg ._abdb .Ser ,_bcad );_bcad .Idx .ValAttr =uint32 (len (_edgg ._abdb .Ser )-1);_bcad .Order .ValAttr =uint32 (len (_edgg ._abdb .Ser )-1);_ffe :=PieChartSeries {_bcad };_ffe .InitializeDefaults ();return _ffe ;};var NullAxis Axis =nullAxis (0);
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_dgdb ValueAxis )X ()*_c .CT_ValAx {return _dgdb ._efce };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_bab Surface3DChart )X ()*_c .CT_Surface3DChart {return _bab ._daeb };
|
||||
|
||||
// AddLineChart adds a new line chart to a chart.
|
||||
func (_ebe Chart )AddLineChart ()LineChart {_caf :=_c .NewCT_PlotAreaChoice ();_ebe ._egd .Chart .PlotArea .Choice =append (_ebe ._egd .Chart .PlotArea .Choice ,_caf );_caf .LineChart =_c .NewCT_LineChart ();_caf .LineChart .Grouping =_c .NewCT_Grouping ();_caf .LineChart .Grouping .ValAttr =_c .ST_GroupingStandard ;return LineChart {_bed :_caf .LineChart };};
|
||||
|
||||
// SetOrder sets the order of the series
|
||||
func (_bea ScatterChartSeries )SetOrder (idx uint32 ){_bea ._bebd .Order .ValAttr =idx };
|
||||
|
||||
// PieChartSeries is a series to be used on an Pie chart.
|
||||
type PieChartSeries struct{_faag *_c .CT_PieSer };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_fggb RadarChartSeries )X ()*_c .CT_RadarSer {return _fggb ._aefed };func (_bba Legend )SetOverlay (b bool ){_bba ._eaf .Overlay =_c .NewCT_Boolean ();_bba ._eaf .Overlay .ValAttr =_ca .Bool (b );};func (_bfe Marker )SetSymbol (s _c .ST_MarkerStyle ){if s ==_c .ST_MarkerStyleUnset {_bfe ._afg .Symbol =nil ;}else {_bfe ._afg .Symbol =_c .NewCT_MarkerStyle ();_bfe ._afg .Symbol .ValAttr =s ;};};
|
||||
|
||||
// AddSurfaceChart adds a new surface chart to a chart.
|
||||
func (_dc Chart )AddSurfaceChart ()SurfaceChart {_gb :=_c .NewCT_PlotAreaChoice ();_dc ._egd .Chart .PlotArea .Choice =append (_dc ._egd .Chart .PlotArea .Choice ,_gb );_gb .SurfaceChart =_c .NewCT_SurfaceChart ();_aab (_dc ._egd .Chart );_dc ._egd .Chart .View3D .RotX .ValAttr =_ca .Int8 (90);_dc ._egd .Chart .View3D .RotY .ValAttr =_ca .Uint16 (0);_dc ._egd .Chart .View3D .Perspective =_c .NewCT_Perspective ();_dc ._egd .Chart .View3D .Perspective .ValAttr =_ca .Uint8 (0);_eea :=SurfaceChart {_fbcf :_gb .SurfaceChart };_eea .InitializeDefaults ();return _eea ;};
|
||||
func (_eedf StockChart )InitializeDefaults (){_eedf ._ffbff .HiLowLines =_a .NewCT_ChartLines ();_eedf ._ffbff .UpDownBars =_a .NewCT_UpDownBars ();_eedf ._ffbff .UpDownBars .GapWidth =_a .NewCT_GapAmount ();_eedf ._ffbff .UpDownBars .GapWidth .ValAttr =&_a .ST_GapAmount {};_eedf ._ffbff .UpDownBars .GapWidth .ValAttr .ST_GapAmountUShort =_f .Uint16 (150);_eedf ._ffbff .UpDownBars .UpBars =_a .NewCT_UpDownBar ();_eedf ._ffbff .UpDownBars .DownBars =_a .NewCT_UpDownBar ();};func (_ffbg DataLabels )SetShowLegendKey (b bool ){_ffbg .ensureChoice ();_ffbg ._bgg .Choice .ShowLegendKey =_a .NewCT_Boolean ();_ffbg ._bgg .Choice .ShowLegendKey .ValAttr =_f .Bool (b );};
|
||||
|
||||
// AddSeries adds a default series to a Scatter chart.
|
||||
func (_bgbe ScatterChart )AddSeries ()ScatterChartSeries {_gcf :=_bgbe .nextColor (len (_bgbe ._eeee .Ser ));_gbd :=_c .NewCT_ScatterSer ();_bgbe ._eeee .Ser =append (_bgbe ._eeee .Ser ,_gbd );_gbd .Idx .ValAttr =uint32 (len (_bgbe ._eeee .Ser )-1);_gbd .Order .ValAttr =uint32 (len (_bgbe ._eeee .Ser )-1);_beba :=ScatterChartSeries {_gbd };_beba .InitializeDefaults ();_beba .Marker ().Properties ().LineProperties ().SetSolidFill (_gcf );_beba .Marker ().Properties ().SetSolidFill (_gcf );return _beba ;};
|
||||
func (_feg ScatterChart )AddSeries ()ScatterChartSeries {_cddf :=_feg .nextColor (len (_feg ._fce .Ser ));_bff :=_a .NewCT_ScatterSer ();_feg ._fce .Ser =append (_feg ._fce .Ser ,_bff );_bff .Idx .ValAttr =uint32 (len (_feg ._fce .Ser )-1);_bff .Order .ValAttr =uint32 (len (_feg ._fce .Ser )-1);_cga :=ScatterChartSeries {_bff };_cga .InitializeDefaults ();_cga .Marker ().Properties ().LineProperties ().SetSolidFill (_cddf );_cga .Marker ().Properties ().SetSolidFill (_cddf );return _cga ;};
|
||||
|
||||
// InitializeDefaults initializes an Radar series to the default values.
|
||||
func (_dag RadarChartSeries )InitializeDefaults (){};type Marker struct{_aeed *_a .CT_Marker };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_dgc Legend )X ()*_a .CT_Legend {return _dgc ._abc };
|
||||
|
||||
// Index returns the index of the series
|
||||
func (_acc LineChartSeries )Index ()uint32 {return _acc ._fgfb .Idx .ValAttr };
|
||||
|
||||
// SetIndex sets the index of the series
|
||||
func (_bec LineChartSeries )SetIndex (idx uint32 ){_bec ._fgfb .Idx .ValAttr =idx };func (_bgfd DataLabels )SetShowCategoryName (b bool ){_bgfd .ensureChoice ();_bgfd ._bgg .Choice .ShowCatName =_a .NewCT_Boolean ();_bgfd ._bgg .Choice .ShowCatName .ValAttr =_f .Bool (b );};
|
||||
|
||||
// Values returns the value data source.
|
||||
func (_gcb BubbleChartSeries )Values ()NumberDataSource {if _gcb ._cdg .YVal ==nil {_gcb ._cdg .YVal =_a .NewCT_NumDataSource ();};return MakeNumberDataSource (_gcb ._cdg .YVal );};
|
||||
|
||||
// Order returns the order of the series
|
||||
func (_cfgg SurfaceChartSeries )Order ()uint32 {return _cfgg ._fcb .Order .ValAttr };
|
||||
|
||||
// SetText sets the series text.
|
||||
func (_edd PieChartSeries )SetText (s string ){_edd ._ade .Tx =_a .NewCT_SerTx ();_edd ._ade .Tx .Choice .V =&s ;};type DateAxis struct{_dfc *_a .CT_DateAx };func (_ec DateAxis )SetCrosses (axis Axis ){_ec ._dfc .CrossAx .ValAttr =axis .AxisID ()};func MakeMarker (x *_a .CT_Marker )Marker {return Marker {x }};func (_bfd DataLabels )SetShowSeriesName (b bool ){_bfd .ensureChoice ();_bfd ._bgg .Choice .ShowSerName =_a .NewCT_Boolean ();_bfd ._bgg .Choice .ShowSerName .ValAttr =_f .Bool (b );};type LineChart struct{chartBase ;_bagd *_a .CT_LineChart ;};
|
||||
|
||||
// SurfaceChart is a 3D surface chart, viewed from the top-down.
|
||||
type SurfaceChart struct{chartBase ;_gfaa *_a .CT_SurfaceChart ;};func (_age chartBase )nextColor (_ace int )_g .Color {return _cag [_ace %len (_cag )]};func (_ggg ValueAxis )AxisID ()uint32 {return _ggg ._adfg .AxId .ValAttr };
|
||||
|
||||
// AddPie3DChart adds a new pie chart to a chart.
|
||||
func (_bagc Chart )AddPie3DChart ()Pie3DChart {_fee (_bagc ._gec .Chart );_bbag :=_a .NewCT_PlotAreaChoice ();_bagc ._gec .Chart .PlotArea .Choice =append (_bagc ._gec .Chart .PlotArea .Choice ,_bbag );_bbag .Pie3DChart =_a .NewCT_Pie3DChart ();_cac :=Pie3DChart {_cbef :_bbag .Pie3DChart };_cac .InitializeDefaults ();return _cac ;};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_ddb ScatterChart )X ()*_a .CT_ScatterChart {return _ddb ._fce };type GridLines struct{_gbc *_a .CT_ChartLines };func (_bbab ScatterChart )InitializeDefaults (){_bbab ._fce .ScatterStyle .ValAttr =_a .ST_ScatterStyleMarker ;};func (_geb CategoryAxis )InitializeDefaults (){_geb .SetPosition (_a .ST_AxPosB );_geb .SetMajorTickMark (_a .ST_TickMarkOut );_geb .SetMinorTickMark (_a .ST_TickMarkIn );_geb .SetTickLabelPosition (_a .ST_TickLblPosNextTo );_geb .MajorGridLines ().Properties ().LineProperties ().SetSolidFill (_g .LightGray );_geb .Properties ().LineProperties ().SetSolidFill (_g .Black );};
|
||||
|
||||
// BubbleChartSeries is a series to be used on a Bubble chart.
|
||||
type BubbleChartSeries struct{_cdg *_a .CT_BubbleSer };func (_bcfg CategoryAxis )SetMinorTickMark (m _a .ST_TickMark ){if m ==_a .ST_TickMarkUnset {_bcfg ._bde .MinorTickMark =nil ;}else {_bcfg ._bde .MinorTickMark =_a .NewCT_TickMark ();_bcfg ._bde .MinorTickMark .ValAttr =m ;};};
|
||||
|
||||
// SetDisplayBlanksAs controls how missing values are displayed.
|
||||
func (_add Chart )SetDisplayBlanksAs (v _a .ST_DispBlanksAs ){_add ._gec .Chart .DispBlanksAs =_a .NewCT_DispBlanksAs ();_add ._gec .Chart .DispBlanksAs .ValAttr =v ;};
|
||||
|
||||
// InitializeDefaults initializes an area series to the default values.
|
||||
func (_ffb AreaChartSeries )InitializeDefaults (){};func MakeValueAxis (x *_a .CT_ValAx )ValueAxis {return ValueAxis {x }};func (_gfg DateAxis )SetTickLabelPosition (p _a .ST_TickLblPos ){if p ==_a .ST_TickLblPosUnset {_gfg ._dfc .TickLblPos =nil ;}else {_gfg ._dfc .TickLblPos =_a .NewCT_TickLblPos ();_gfg ._dfc .TickLblPos .ValAttr =p ;};};
|
||||
|
||||
// Properties returns the bar chart series shape properties.
|
||||
func (_cgef PieChartSeries )Properties ()_eb .ShapeProperties {if _cgef ._faag .SpPr ==nil {_cgef ._faag .SpPr =_e .NewCT_ShapeProperties ();};return _eb .MakeShapeProperties (_cgef ._faag .SpPr );};func MakeSeriesAxis (x *_c .CT_SerAx )SeriesAxis {return SeriesAxis {x }};
|
||||
func (_bcd AreaChartSeries )Properties ()_fb .ShapeProperties {if _bcd ._ea .SpPr ==nil {_bcd ._ea .SpPr =_dg .NewCT_ShapeProperties ();};return _fb .MakeShapeProperties (_bcd ._ea .SpPr );};
|
||||
|
||||
// Pie3DChart is a Pie3D chart.
|
||||
type Pie3DChart struct{chartBase ;_eaca *_c .CT_Pie3DChart ;};
|
||||
// MakeAxisDataSource constructs an AxisDataSource wrapper.
|
||||
func MakeAxisDataSource (x *_a .CT_AxDataSource )CategoryAxisDataSource {return CategoryAxisDataSource {x };};
|
||||
|
||||
// AddSeries adds a default series to a line chart.
|
||||
func (_bfa Line3DChart )AddSeries ()LineChartSeries {_aeae :=_bfa .nextColor (len (_bfa ._dce .Ser ));_gddb :=_a .NewCT_LineSer ();_bfa ._dce .Ser =append (_bfa ._dce .Ser ,_gddb );_gddb .Idx .ValAttr =uint32 (len (_bfa ._dce .Ser )-1);_gddb .Order .ValAttr =uint32 (len (_bfa ._dce .Ser )-1);_dgf :=LineChartSeries {_gddb };_dgf .InitializeDefaults ();_dgf .Properties ().LineProperties ().SetSolidFill (_aeae );_dgf .Properties ().SetSolidFill (_aeae );return _dgf ;};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_gbbb Surface3DChart )X ()*_a .CT_Surface3DChart {return _gbbb ._bcg };
|
||||
|
||||
// ScatterChartSeries is the data series for a scatter chart.
|
||||
type ScatterChartSeries struct{_abgb *_a .CT_ScatterSer };func (_gbb CategoryAxis )MajorGridLines ()GridLines {if _gbb ._bde .MajorGridlines ==nil {_gbb ._bde .MajorGridlines =_a .NewCT_ChartLines ();};return GridLines {_gbb ._bde .MajorGridlines };};func (_cad Marker )SetSize (sz uint8 ){_cad ._aeed .Size =_a .NewCT_MarkerSize ();_cad ._aeed .Size .ValAttr =&sz ;};
|
||||
|
||||
// AddSeries adds a default series to an Pie3D chart.
|
||||
func (_cae Pie3DChart )AddSeries ()PieChartSeries {_gag :=_a .NewCT_PieSer ();_cae ._cbef .Ser =append (_cae ._cbef .Ser ,_gag );_gag .Idx .ValAttr =uint32 (len (_cae ._cbef .Ser )-1);_gag .Order .ValAttr =uint32 (len (_cae ._cbef .Ser )-1);_dga :=PieChartSeries {_gag };_dga .InitializeDefaults ();return _dga ;};func (_dab ScatterChartSeries )Values ()NumberDataSource {if _dab ._abgb .YVal ==nil {_dab ._abgb .YVal =_a .NewCT_NumDataSource ();};return MakeNumberDataSource (_dab ._abgb .YVal );};
|
||||
|
||||
// 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 (_aae NumberDataSource )CreateEmptyNumberCache (){_aae .ensureChoice ();if _aae ._aeg .Choice .NumRef ==nil {_aae ._aeg .Choice .NumRef =_c .NewCT_NumRef ();};_aae ._aeg .Choice .NumLit =nil ;_aae ._aeg .Choice .NumRef .NumCache =_c .NewCT_NumData ();_aae ._aeg .Choice .NumRef .NumCache .PtCount =_c .NewCT_UnsignedInt ();_aae ._aeg .Choice .NumRef .NumCache .PtCount .ValAttr =0;};type ValueAxis struct{_efce *_c .CT_ValAx };
|
||||
func (_fbef NumberDataSource )CreateEmptyNumberCache (){_fbef .ensureChoice ();if _fbef ._ecc .Choice .NumRef ==nil {_fbef ._ecc .Choice .NumRef =_a .NewCT_NumRef ();};_fbef ._ecc .Choice .NumLit =nil ;_fbef ._ecc .Choice .NumRef .NumCache =_a .NewCT_NumData ();_fbef ._ecc .Choice .NumRef .NumCache .PtCount =_a .NewCT_UnsignedInt ();_fbef ._ecc .Choice .NumRef .NumCache .PtCount .ValAttr =0;};func (_bdad Surface3DChart )InitializeDefaults (){_bdad ._bcg .Wireframe =_a .NewCT_Boolean ();_bdad ._bcg .Wireframe .ValAttr =_f .Bool (false );_bdad ._bcg .BandFmts =_a .NewCT_BandFmts ();for _afb :=0;_afb < 15;_afb ++{_dgca :=_a .NewCT_BandFmt ();_dgca .Idx .ValAttr =uint32 (_afb );_dgca .SpPr =_dg .NewCT_ShapeProperties ();_aega :=_fb .MakeShapeProperties (_dgca .SpPr );_aega .SetSolidFill (_bdad .nextColor (_afb ));_bdad ._bcg .BandFmts .BandFmt =append (_bdad ._bcg .BandFmts .BandFmt ,_dgca );};};
|
||||
|
||||
// InitializeDefaults the bar chart to its defaults
|
||||
func (_gd BarChart )InitializeDefaults (){_gd .SetDirection (_c .ST_BarDirCol )};func (_aca DataLabels )SetShowPercent (b bool ){_aca .ensureChoice ();_aca ._dfga .Choice .ShowPercent =_c .NewCT_Boolean ();_aca ._dfga .Choice .ShowPercent .ValAttr =_ca .Bool (b );};
|
||||
// Labels returns the data label properties.
|
||||
func (_fda LineChartSeries )Labels ()DataLabels {if _fda ._fgfb .DLbls ==nil {_fda ._fgfb .DLbls =_a .NewCT_DLbls ();};return MakeDataLabels (_fda ._fgfb .DLbls );};
|
||||
|
||||
// AddAxis adds an axis to a line chart.
|
||||
func (_fgg Line3DChart )AddAxis (axis Axis ){_fbe :=_c .NewCT_UnsignedInt ();_fbe .ValAttr =axis .AxisID ();_fgg ._cadd .AxId =append (_fgg ._cadd .AxId ,_fbe );};func (_ac Bar3DChart )AddAxis (axis Axis ){_bc :=_c .NewCT_UnsignedInt ();_bc .ValAttr =axis .AxisID ();_ac ._a .AxId =append (_ac ._a .AxId ,_bc );};func (_bcfc SurfaceChartSeries )InitializeDefaults (){_bcfc .Properties ().LineProperties ().SetWidth (1*_cf .Point );_bcfc .Properties ().LineProperties ().SetSolidFill (_d .Black );_bcfc .Properties ().LineProperties ().SetJoin (_eb .LineJoinRound );};
|
||||
// AddAreaChart adds a new area chart to a chart.
|
||||
func (_abg Chart )AddAreaChart ()AreaChart {_def :=_a .NewCT_PlotAreaChoice ();_abg ._gec .Chart .PlotArea .Choice =append (_abg ._gec .Chart .PlotArea .Choice ,_def );_def .AreaChart =_a .NewCT_AreaChart ();_geg :=AreaChart {_baa :_def .AreaChart };_geg .InitializeDefaults ();return _geg ;};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_dad LineChartSeries )X ()*_c .CT_LineSer {return _dad ._adb };func (_afb ScatterChartSeries )Values ()NumberDataSource {if _afb ._bebd .YVal ==nil {_afb ._bebd .YVal =_c .NewCT_NumDataSource ();};return MakeNumberDataSource (_afb ._bebd .YVal );};func (_fdg LineChartSeries )SetSmooth (b bool ){_fdg ._adb .Smooth =_c .NewCT_Boolean ();_fdg ._adb .Smooth .ValAttr =&b ;};
|
||||
|
||||
// AddSeries adds a default series to an Pie3D chart.
|
||||
func (_faad Pie3DChart )AddSeries ()PieChartSeries {_aea :=_c .NewCT_PieSer ();_faad ._eaca .Ser =append (_faad ._eaca .Ser ,_aea );_aea .Idx .ValAttr =uint32 (len (_faad ._eaca .Ser )-1);_aea .Order .ValAttr =uint32 (len (_faad ._eaca .Ser )-1);_bbae :=PieChartSeries {_aea };_bbae .InitializeDefaults ();return _bbae ;};
|
||||
|
||||
// InitializeDefaults the bar chart to its defaults
|
||||
func (_fgfc PieChart )InitializeDefaults (){_fgfc ._ggdc .VaryColors =_c .NewCT_Boolean ();_fgfc ._ggdc .VaryColors .ValAttr =_ca .Bool (true );};func (_fdgf ValueAxis )SetTickLabelPosition (p _c .ST_TickLblPos ){if p ==_c .ST_TickLblPosUnset {_fdgf ._efce .TickLblPos =nil ;}else {_fdgf ._efce .TickLblPos =_c .NewCT_TickLblPos ();_fdgf ._efce .TickLblPos .ValAttr =p ;};};
|
||||
func (_dcee PieOfPieChart )X ()*_a .CT_OfPieChart {return _dcee ._gabb };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_deb SurfaceChart )X ()*_c .CT_SurfaceChart {return _deb ._fbcf };
|
||||
|
||||
// Axis is the interface implemented by different axes when assigning to a
|
||||
// chart.
|
||||
type Axis interface{AxisID ()uint32 ;};func (_dbcc SurfaceChart )InitializeDefaults (){_dbcc ._fbcf .Wireframe =_c .NewCT_Boolean ();_dbcc ._fbcf .Wireframe .ValAttr =_ca .Bool (false );_dbcc ._fbcf .BandFmts =_c .NewCT_BandFmts ();for _dbdb :=0;_dbdb < 15;_dbdb ++{_feeb :=_c .NewCT_BandFmt ();_feeb .Idx .ValAttr =uint32 (_dbdb );_feeb .SpPr =_e .NewCT_ShapeProperties ();_acfe :=_eb .MakeShapeProperties (_feeb .SpPr );_acfe .SetSolidFill (_dbcc .nextColor (_dbdb ));_dbcc ._fbcf .BandFmts .BandFmt =append (_dbcc ._fbcf .BandFmts .BandFmt ,_feeb );};};
|
||||
|
||||
// InitializeDefaults initializes a Bubble chart series to the default values.
|
||||
func (_cca BubbleChartSeries )InitializeDefaults (){};
|
||||
|
||||
// SetText sets the series text.
|
||||
func (_gad BarChartSeries )SetText (s string ){_gad ._cff .Tx =_c .NewCT_SerTx ();_gad ._cff .Tx .Choice .V =&s ;};
|
||||
|
||||
// AddStockChart adds a new stock chart.
|
||||
func (_ccd Chart )AddStockChart ()StockChart {_acb :=_c .NewCT_PlotAreaChoice ();_ccd ._egd .Chart .PlotArea .Choice =append (_ccd ._egd .Chart .PlotArea .Choice ,_acb );_acb .StockChart =_c .NewCT_StockChart ();_gge :=StockChart {_cfe :_acb .StockChart };_gge .InitializeDefaults ();return _gge ;};
|
||||
func (_acb Chart )X ()*_a .ChartSpace {return _acb ._gec };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_ecf Title )X ()*_c .CT_Title {return _ecf ._feb };
|
||||
func (_ae AreaChart )X ()*_a .CT_AreaChart {return _ae ._baa };func (_gf CategoryAxis )SetTickLabelPosition (p _a .ST_TickLblPos ){if p ==_a .ST_TickLblPosUnset {_gf ._bde .TickLblPos =nil ;}else {_gf ._bde .TickLblPos =_a .NewCT_TickLblPos ();_gf ._bde .TickLblPos .ValAttr =p ;};};
|
||||
|
||||
// AddSeries adds a default series to a line chart.
|
||||
func (_fgf LineChart )AddSeries ()LineChartSeries {_gbg :=_fgf .nextColor (len (_fgf ._bed .Ser ));_ggda :=_c .NewCT_LineSer ();_fgf ._bed .Ser =append (_fgf ._bed .Ser ,_ggda );_ggda .Idx .ValAttr =uint32 (len (_fgf ._bed .Ser )-1);_ggda .Order .ValAttr =uint32 (len (_fgf ._bed .Ser )-1);_acbf :=LineChartSeries {_ggda };_acbf .InitializeDefaults ();_acbf .Properties ().LineProperties ().SetSolidFill (_gbg );return _acbf ;};
|
||||
// AreaChart is an area chart that has a shaded area underneath a curve.
|
||||
type AreaChart struct{chartBase ;_baa *_a .CT_AreaChart ;};
|
||||
|
||||
// AddSeries adds a default series to a bar chart.
|
||||
func (_cd BarChart )AddSeries ()BarChartSeries {_fbf :=_cd .nextColor (len (_cd ._bd .Ser ));_aag :=_a .NewCT_BarSer ();_cd ._bd .Ser =append (_cd ._bd .Ser ,_aag );_aag .Idx .ValAttr =uint32 (len (_cd ._bd .Ser )-1);_aag .Order .ValAttr =uint32 (len (_cd ._bd .Ser )-1);_cdd :=BarChartSeries {_aag };_cdd .InitializeDefaults ();_cdd .Properties ().SetSolidFill (_fbf );return _cdd ;};func (_eag SeriesAxis )InitializeDefaults (){};
|
||||
|
||||
// CategoryAxis returns the category data source.
|
||||
func (_gcbb RadarChartSeries )CategoryAxis ()CategoryAxisDataSource {if _gcbb ._dbfca .Cat ==nil {_gcbb ._dbfca .Cat =_a .NewCT_AxDataSource ();};return MakeAxisDataSource (_gcbb ._dbfca .Cat );};
|
||||
|
||||
// SetText sets the series text
|
||||
func (_gge LineChartSeries )SetText (s string ){_gge ._fgfb .Tx =_a .NewCT_SerTx ();_gge ._fgfb .Tx .Choice .V =&s ;};func (_gd CategoryAxis )SetPosition (p _a .ST_AxPos ){_gd ._bde .AxPos =_a .NewCT_AxPos ();_gd ._bde .AxPos .ValAttr =p ;};
|
||||
|
||||
// AddAxis adds an axis to a Scatter chart.
|
||||
func (_daca ScatterChart )AddAxis (axis Axis ){_bbb :=_a .NewCT_UnsignedInt ();_bbb .ValAttr =axis .AxisID ();_daca ._fce .AxId =append (_daca ._fce .AxId ,_bbb );};
|
||||
|
||||
// Index returns the index of the series
|
||||
func (_fgd ScatterChartSeries )Index ()uint32 {return _fgd ._bebd .Idx .ValAttr };
|
||||
func (_bce ScatterChartSeries )Index ()uint32 {return _bce ._abgb .Idx .ValAttr };type nullAxis byte ;func _fee (_cbe *_a .CT_Chart ){_cbe .View3D =_a .NewCT_View3D ();_cbe .View3D .RotX =_a .NewCT_RotX ();_cbe .View3D .RotX .ValAttr =_f .Int8 (15);_cbe .View3D .RotY =_a .NewCT_RotY ();_cbe .View3D .RotY .ValAttr =_f .Uint16 (20);_cbe .View3D .RAngAx =_a .NewCT_Boolean ();_cbe .View3D .RAngAx .ValAttr =_f .Bool (false );_cbe .Floor =_a .NewCT_Surface ();_cbe .Floor .Thickness =_a .NewCT_Thickness ();_cbe .Floor .Thickness .ValAttr .Uint32 =_f .Uint32 (0);_cbe .SideWall =_a .NewCT_Surface ();_cbe .SideWall .Thickness =_a .NewCT_Thickness ();_cbe .SideWall .Thickness .ValAttr .Uint32 =_f .Uint32 (0);_cbe .BackWall =_a .NewCT_Surface ();_cbe .BackWall .Thickness =_a .NewCT_Thickness ();_cbe .BackWall .Thickness .ValAttr .Uint32 =_f .Uint32 (0);};
|
||||
|
||||
// Bar3DChart is a 3D bar chart.
|
||||
type Bar3DChart struct{chartBase ;_a *_c .CT_Bar3DChart ;};
|
||||
// AreaChartSeries is a series to be used on an area chart.
|
||||
type AreaChartSeries struct{_ea *_a .CT_AreaSer };
|
||||
|
||||
// Properties returns the bar chart series shape properties.
|
||||
func (_ff AreaChartSeries )Properties ()_eb .ShapeProperties {if _ff ._be .SpPr ==nil {_ff ._be .SpPr =_e .NewCT_ShapeProperties ();};return _eb .MakeShapeProperties (_ff ._be .SpPr );};
|
||||
// Surface3DChart is a 3D view of a surface chart.
|
||||
type Surface3DChart struct{chartBase ;_bcg *_a .CT_Surface3DChart ;};
|
||||
|
||||
// SetIndex sets the index of the series
|
||||
func (_ceffg ScatterChartSeries )SetIndex (idx uint32 ){_ceffg ._bebd .Idx .ValAttr =idx };func (_bec DataLabels )SetShowCategoryName (b bool ){_bec .ensureChoice ();_bec ._dfga .Choice .ShowCatName =_c .NewCT_Boolean ();_bec ._dfga .Choice .ShowCatName .ValAttr =_ca .Bool (b );};func (_edggg Title )InitializeDefaults (){_edggg .SetText ("\u0054\u0069\u0074l\u0065");_edggg .RunProperties ().SetSize (16*_cf .Point );_edggg .RunProperties ().SetSolidFill (_d .Black );_edggg .RunProperties ().SetFont ("\u0043\u0061\u006c\u0069\u0062\u0020\u0072\u0069");_edggg .RunProperties ().SetBold (false );};
|
||||
// RadarChart is an Radar chart that has a shaded Radar underneath a curve.
|
||||
type RadarChart struct{chartBase ;_bfcd *_a .CT_RadarChart ;};
|
||||
|
||||
// CategoryAxis returns the category data source.
|
||||
func (_bgfe RadarChartSeries )CategoryAxis ()CategoryAxisDataSource {if _bgfe ._aefed .Cat ==nil {_bgfe ._aefed .Cat =_c .NewCT_AxDataSource ();};return MakeAxisDataSource (_bgfe ._aefed .Cat );};
|
||||
|
||||
// SetType sets the type the secone pie to either pie or bar
|
||||
func (_gfe PieOfPieChart )SetType (t _c .ST_OfPieType ){_gfe ._abdb .OfPieType .ValAttr =t };func (_fcg Title )RunProperties ()_eb .RunProperties {if _fcg ._feb .Tx ==nil {_fcg .SetText ("");};if _fcg ._feb .Tx .Choice .Rich .P [0].EG_TextRun [0].R .RPr ==nil {_fcg ._feb .Tx .Choice .Rich .P [0].EG_TextRun [0].R .RPr =_e .NewCT_TextCharacterProperties ();};return _eb .MakeRunProperties (_fcg ._feb .Tx .Choice .Rich .P [0].EG_TextRun [0].R .RPr );};func (_dgd DateAxis )SetCrosses (axis Axis ){_dgd ._dea .CrossAx .ValAttr =axis .AxisID ()};
|
||||
|
||||
// SetText sets the series text
|
||||
func (_dgcb LineChartSeries )SetText (s string ){_dgcb ._adb .Tx =_c .NewCT_SerTx ();_dgcb ._adb .Tx .Choice .V =&s ;};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_gadd ScatterChart )X ()*_c .CT_ScatterChart {return _gadd ._eeee };
|
||||
|
||||
// SetIndex sets the index of the series
|
||||
func (_bacg LineChartSeries )SetIndex (idx uint32 ){_bacg ._adb .Idx .ValAttr =idx };
|
||||
|
||||
// AddAxis adds an axis to a Surface chart.
|
||||
func (_fgfg SurfaceChart )AddAxis (axis Axis ){_cffb :=_c .NewCT_UnsignedInt ();_cffb .ValAttr =axis .AxisID ();_fgfg ._fbcf .AxId =append (_fgfg ._fbcf .AxId ,_cffb );};
|
||||
|
||||
// Order returns the order of the series
|
||||
func (_dab LineChartSeries )Order ()uint32 {return _dab ._adb .Order .ValAttr };
|
||||
|
||||
// SetText sets the series text
|
||||
func (_afc SurfaceChartSeries )SetText (s string ){_afc ._gaec .Tx =_c .NewCT_SerTx ();_afc ._gaec .Tx .Choice .V =&s ;};func (_ageg LineChartSeries )InitializeDefaults (){_ageg .Properties ().LineProperties ().SetWidth (1*_cf .Point );_ageg .Properties ().LineProperties ().SetSolidFill (_d .Black );_ageg .Properties ().LineProperties ().SetJoin (_eb .LineJoinRound );_ageg .Marker ().SetSymbol (_c .ST_MarkerStyleNone );_ageg .Labels ().SetShowLegendKey (false );_ageg .Labels ().SetShowValue (false );_ageg .Labels ().SetShowPercent (false );_ageg .Labels ().SetShowCategoryName (false );_ageg .Labels ().SetShowSeriesName (false );_ageg .Labels ().SetShowLeaderLines (false );};
|
||||
|
||||
// SetDirection changes the direction of the bar chart (bar or column).
|
||||
func (_aa Bar3DChart )SetDirection (d _c .ST_BarDir ){_aa ._a .BarDir .ValAttr =d };
|
||||
|
||||
// BarChartSeries is a series to be used on a bar chart.
|
||||
type BarChartSeries struct{_cff *_c .CT_BarSer };
|
||||
|
||||
// AddPieChart adds a new pie chart to a chart.
|
||||
func (_adc Chart )AddPieChart ()PieChart {_ceff :=_c .NewCT_PlotAreaChoice ();_adc ._egd .Chart .PlotArea .Choice =append (_adc ._egd .Chart .PlotArea .Choice ,_ceff );_ceff .PieChart =_c .NewCT_PieChart ();_edd :=PieChart {_ggdc :_ceff .PieChart };_edd .InitializeDefaults ();return _edd ;};func (_gbc Chart )AddSeriesAxis ()SeriesAxis {_eeb :=_c .NewCT_SerAx ();if _gbc ._egd .Chart .PlotArea .CChoice ==nil {_gbc ._egd .Chart .PlotArea .CChoice =_c .NewCT_PlotAreaChoice1 ();};_eeb .AxId =_c .NewCT_UnsignedInt ();_eeb .AxId .ValAttr =0x7FFFFFFF&_fd .Uint32 ();_gbc ._egd .Chart .PlotArea .CChoice .SerAx =append (_gbc ._egd .Chart .PlotArea .CChoice .SerAx ,_eeb );_eeb .Delete =_c .NewCT_Boolean ();_eeb .Delete .ValAttr =_ca .Bool (false );_ggd :=MakeSeriesAxis (_eeb );_ggd .InitializeDefaults ();return _ggd ;};func (_gbga ValueAxis )SetMinorTickMark (m _c .ST_TickMark ){if m ==_c .ST_TickMarkUnset {_gbga ._efce .MinorTickMark =nil ;}else {_gbga ._efce .MinorTickMark =_c .NewCT_TickMark ();_gbga ._efce .MinorTickMark .ValAttr =m ;};};
|
||||
// AddAxis adds an axis to a line chart.
|
||||
func (_gfb LineChart )AddAxis (axis Axis ){_dfcc :=_a .NewCT_UnsignedInt ();_dfcc .ValAttr =axis .AxisID ();_gfb ._bagd .AxId =append (_gfb ._bagd .AxId ,_dfcc );};
|
||||
|
||||
// Values returns the value data source.
|
||||
func (_cbac PieChartSeries )Values ()NumberDataSource {if _cbac ._faag .Val ==nil {_cbac ._faag .Val =_c .NewCT_NumDataSource ();};return MakeNumberDataSource (_cbac ._faag .Val );};
|
||||
func (_dgd BarChartSeries )Values ()NumberDataSource {if _dgd ._ag .Val ==nil {_dgd ._ag .Val =_a .NewCT_NumDataSource ();};return MakeNumberDataSource (_dgd ._ag .Val );};func MakeTitle (x *_a .CT_Title )Title {return Title {x }};
|
||||
|
||||
// Properties returns the chart's shape properties.
|
||||
func (_aeg Chart )Properties ()_fb .ShapeProperties {if _aeg ._gec .SpPr ==nil {_aeg ._gec .SpPr =_dg .NewCT_ShapeProperties ();};return _fb .MakeShapeProperties (_aeg ._gec .SpPr );};
|
||||
|
||||
// LineChartSeries is the data series for a line chart.
|
||||
type LineChartSeries struct{_fgfb *_a .CT_LineSer };
|
||||
|
||||
// Marker returns the marker properties.
|
||||
func (_fac LineChartSeries )Marker ()Marker {if _fac ._fgfb .Marker ==nil {_fac ._fgfb .Marker =_a .NewCT_Marker ();};return MakeMarker (_fac ._fgfb .Marker );};func (_bga ValueAxis )Properties ()_fb .ShapeProperties {if _bga ._adfg .SpPr ==nil {_bga ._adfg .SpPr =_dg .NewCT_ShapeProperties ();};return _fb .MakeShapeProperties (_bga ._adfg .SpPr );};func (_bgc CategoryAxis )SetMajorTickMark (m _a .ST_TickMark ){if m ==_a .ST_TickMarkUnset {_bgc ._bde .MajorTickMark =nil ;}else {_bgc ._bde .MajorTickMark =_a .NewCT_TickMark ();_bgc ._bde .MajorTickMark .ValAttr =m ;};};func (_bdbba SurfaceChart )InitializeDefaults (){_bdbba ._gfaa .Wireframe =_a .NewCT_Boolean ();_bdbba ._gfaa .Wireframe .ValAttr =_f .Bool (false );_bdbba ._gfaa .BandFmts =_a .NewCT_BandFmts ();for _agf :=0;_agf < 15;_agf ++{_fgg :=_a .NewCT_BandFmt ();_fgg .Idx .ValAttr =uint32 (_agf );_fgg .SpPr =_dg .NewCT_ShapeProperties ();_ecdb :=_fb .MakeShapeProperties (_fgg .SpPr );_ecdb .SetSolidFill (_bdbba .nextColor (_agf ));_bdbba ._gfaa .BandFmts .BandFmt =append (_bdbba ._gfaa .BandFmts .BandFmt ,_fgg );};};type ValueAxis struct{_adfg *_a .CT_ValAx };
|
||||
|
||||
// RemoveTitle removes any existing title from the chart.
|
||||
func (_caca Chart )RemoveTitle (){_caca ._gec .Chart .Title =nil ;_caca ._gec .Chart .AutoTitleDeleted =_a .NewCT_Boolean ();_caca ._gec .Chart .AutoTitleDeleted .ValAttr =_f .Bool (true );};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_cfd SurfaceChartSeries )X ()*_c .CT_SurfaceSer {return _cfd ._gaec };
|
||||
func (_gaee PieChart )X ()*_a .CT_PieChart {return _gaee ._dac };func (_ffa Legend )SetOverlay (b bool ){_ffa ._abc .Overlay =_a .NewCT_Boolean ();_ffa ._abc .Overlay .ValAttr =_f .Bool (b );};func (_aef LineChartSeries )Values ()NumberDataSource {if _aef ._fgfb .Val ==nil {_aef ._fgfb .Val =_a .NewCT_NumDataSource ();};return MakeNumberDataSource (_aef ._fgfb .Val );};
|
||||
|
||||
// Marker returns the marker properties.
|
||||
func (_gfa ScatterChartSeries )Marker ()Marker {if _gfa ._abgb .Marker ==nil {_gfa ._abgb .Marker =_a .NewCT_Marker ();};return MakeMarker (_gfa ._abgb .Marker );};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_af BubbleChartSeries )X ()*_c .CT_BubbleSer {return _af ._cba };
|
||||
func (_dc BarChartSeries )X ()*_a .CT_BarSer {return _dc ._ag };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_geb RadarChart )X ()*_c .CT_RadarChart {return _geb ._abe };
|
||||
func (_ffbb StockChart )X ()*_a .CT_StockChart {return _ffbb ._ffbff };func (_aeaef RadarChart )AddAxis (axis Axis ){_acf :=_a .NewCT_UnsignedInt ();_acf .ValAttr =axis .AxisID ();_aeaef ._bfcd .AxId =append (_aeaef ._bfcd .AxId ,_acf );};func (_cba ValueAxis )SetPosition (p _a .ST_AxPos ){_cba ._adfg .AxPos =_a .NewCT_AxPos ();_cba ._adfg .AxPos .ValAttr =p ;};
|
||||
|
||||
// AddPieChart adds a new pie chart to a chart.
|
||||
func (_ccg Chart )AddPieChart ()PieChart {_afe :=_a .NewCT_PlotAreaChoice ();_ccg ._gec .Chart .PlotArea .Choice =append (_ccg ._gec .Chart .PlotArea .Choice ,_afe );_afe .PieChart =_a .NewCT_PieChart ();_ebc :=PieChart {_dac :_afe .PieChart };_ebc .InitializeDefaults ();return _ebc ;};func (_dbff LineChartSeries )InitializeDefaults (){_dbff .Properties ().LineProperties ().SetWidth (1*_bg .Point );_dbff .Properties ().LineProperties ().SetSolidFill (_g .Black );_dbff .Properties ().LineProperties ().SetJoin (_fb .LineJoinRound );_dbff .Marker ().SetSymbol (_a .ST_MarkerStyleNone );_dbff .Labels ().SetShowLegendKey (false );_dbff .Labels ().SetShowValue (false );_dbff .Labels ().SetShowPercent (false );_dbff .Labels ().SetShowCategoryName (false );_dbff .Labels ().SetShowSeriesName (false );_dbff .Labels ().SetShowLeaderLines (false );};
|
||||
|
||||
// SetOrder sets the order of the series
|
||||
func (_cdc LineChartSeries )SetOrder (idx uint32 ){_cdc ._fgfb .Order .ValAttr =idx };func (_ddfb DataLabels )SetShowLeaderLines (b bool ){_ddfb .ensureChoice ();_ddfb ._bgg .Choice .ShowLeaderLines =_a .NewCT_Boolean ();_ddfb ._bgg .Choice .ShowLeaderLines .ValAttr =_f .Bool (b );};
|
||||
|
||||
// SetIndex sets the index of the series
|
||||
func (_gbac ScatterChartSeries )SetIndex (idx uint32 ){_gbac ._abgb .Idx .ValAttr =idx };
|
||||
|
||||
// AddSeries adds a default series to an area chart.
|
||||
func (_aea AreaChart )AddSeries ()AreaChartSeries {_c :=_aea .nextColor (len (_aea ._baa .Ser ));_de :=_a .NewCT_AreaSer ();_aea ._baa .Ser =append (_aea ._baa .Ser ,_de );_de .Idx .ValAttr =uint32 (len (_aea ._baa .Ser )-1);_de .Order .ValAttr =uint32 (len (_aea ._baa .Ser )-1);_ab :=AreaChartSeries {_de };_ab .InitializeDefaults ();_ab .Properties ().SetSolidFill (_c );return _ab ;};
|
||||
|
||||
// PieChart is a Pie chart.
|
||||
type PieChart struct{chartBase ;_dac *_a .CT_PieChart ;};
|
||||
|
||||
// AddSeries adds a default series to an Doughnut chart.
|
||||
func (_agg DoughnutChart )AddSeries ()PieChartSeries {_cca :=_a .NewCT_PieSer ();_agg ._fde .Ser =append (_agg ._fde .Ser ,_cca );_cca .Idx .ValAttr =uint32 (len (_agg ._fde .Ser )-1);_cca .Order .ValAttr =uint32 (len (_agg ._fde .Ser )-1);_gcc :=PieChartSeries {_cca };_gcc .InitializeDefaults ();return _gcc ;};
|
||||
|
||||
// AddBarChart adds a new bar chart to a chart.
|
||||
func (_edg Chart )AddBarChart ()BarChart {_bcb :=_a .NewCT_PlotAreaChoice ();_edg ._gec .Chart .PlotArea .Choice =append (_edg ._gec .Chart .PlotArea .Choice ,_bcb );_bcb .BarChart =_a .NewCT_BarChart ();_bcb .BarChart .Grouping =_a .NewCT_BarGrouping ();_bcb .BarChart .Grouping .ValAttr =_a .ST_BarGroupingStandard ;_aff :=BarChart {_bd :_bcb .BarChart };_aff .InitializeDefaults ();return _aff ;};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_fed SeriesAxis )X ()*_a .CT_SerAx {return _fed ._fadd };
|
||||
|
||||
// CategoryAxis returns the category data source.
|
||||
func (_gac BarChartSeries )CategoryAxis ()CategoryAxisDataSource {if _gac ._cff .Cat ==nil {_gac ._cff .Cat =_c .NewCT_AxDataSource ();};return MakeAxisDataSource (_gac ._cff .Cat );};func (_eac LineChartSeries )Values ()NumberDataSource {if _eac ._adb .Val ==nil {_eac ._adb .Val =_c .NewCT_NumDataSource ();};return MakeNumberDataSource (_eac ._adb .Val );};func (_fdb DataLabels )SetShowValue (b bool ){_fdb .ensureChoice ();_fdb ._dfga .Choice .ShowVal =_c .NewCT_Boolean ();_fdb ._dfga .Choice .ShowVal .ValAttr =_ca .Bool (b );};
|
||||
func (_dd BubbleChartSeries )CategoryAxis ()CategoryAxisDataSource {if _dd ._cdg .XVal ==nil {_dd ._cdg .XVal =_a .NewCT_AxDataSource ();};return MakeAxisDataSource (_dd ._cdg .XVal );};var _cag =[]_g .Color {_g .RGB (0x33,0x66,0xcc),_g .RGB (0xDC,0x39,0x12),_g .RGB (0xFF,0x99,0x00),_g .RGB (0x10,0x96,0x18),_g .RGB (0x99,0x00,0x99),_g .RGB (0x3B,0x3E,0xAC),_g .RGB (0x00,0x99,0xC6),_g .RGB (0xDD,0x44,0x77),_g .RGB (0x66,0xAA,0x00),_g .RGB (0xB8,0x2E,0x2E),_g .RGB (0x31,0x63,0x95),_g .RGB (0x99,0x44,0x99),_g .RGB (0x22,0xAA,0x99),_g .RGB (0xAA,0xAA,0x11),_g .RGB (0x66,0x33,0xCC),_g .RGB (0xE6,0x73,0x00),_g .RGB (0x8B,0x07,0x07),_g .RGB (0x32,0x92,0x62),_g .RGB (0x55,0x74,0xA6),_g .RGB (0x3B,0x3E,0xAC)};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_ebg BarChartSeries )X ()*_c .CT_BarSer {return _ebg ._cff };func (_dfe CategoryAxis )MajorGridLines ()GridLines {if _dfe ._bcf .MajorGridlines ==nil {_dfe ._bcf .MajorGridlines =_c .NewCT_ChartLines ();};return GridLines {_dfe ._bcf .MajorGridlines };};
|
||||
// SetText sets the series text.
|
||||
func (_ga AreaChartSeries )SetText (s string ){_ga ._ea .Tx =_a .NewCT_SerTx ();_ga ._ea .Tx .Choice .V =&s };
|
||||
|
||||
// PieOfPieChart is a Pie chart with an extra Pie chart.
|
||||
type PieOfPieChart struct{chartBase ;_gabb *_a .CT_OfPieChart ;};
|
||||
|
||||
// SetOrder sets the order of the series
|
||||
func (_ggbg ScatterChartSeries )SetOrder (idx uint32 ){_ggbg ._abgb .Order .ValAttr =idx };func (_faf Title )RunProperties ()_fb .RunProperties {if _faf ._gbff .Tx ==nil {_faf .SetText ("");};if _faf ._gbff .Tx .Choice .Rich .P [0].EG_TextRun [0].R .RPr ==nil {_faf ._gbff .Tx .Choice .Rich .P [0].EG_TextRun [0].R .RPr =_dg .NewCT_TextCharacterProperties ();};return _fb .MakeRunProperties (_faf ._gbff .Tx .Choice .Rich .P [0].EG_TextRun [0].R .RPr );};func (_fdef SurfaceChartSeries )InitializeDefaults (){_fdef .Properties ().LineProperties ().SetWidth (1*_bg .Point );_fdef .Properties ().LineProperties ().SetSolidFill (_g .Black );_fdef .Properties ().LineProperties ().SetJoin (_fb .LineJoinRound );};func (_aad ScatterChartSeries )SetSmooth (b bool ){_aad ._abgb .Smooth =_a .NewCT_Boolean ();_aad ._abgb .Smooth .ValAttr =&b ;};func (_bad DataLabels )ensureChoice (){if _bad ._bgg .Choice ==nil {_bad ._bgg .Choice =_a .NewCT_DLblsChoice ();};};
|
||||
|
||||
// SetNumberReference is used to set the source data to a range of cells containing
|
||||
// numbers.
|
||||
func (_cbae CategoryAxisDataSource )SetNumberReference (s string ){_cbae ._ffg .Choice =_c .NewCT_AxDataSourceChoice ();_cbae ._ffg .Choice .NumRef =_c .NewCT_NumRef ();_cbae ._ffg .Choice .NumRef .F =s ;};
|
||||
|
||||
// AddSeries adds a default series to an Radar chart.
|
||||
func (_efabb RadarChart )AddSeries ()RadarChartSeries {_acge :=_efabb .nextColor (len (_efabb ._abe .Ser ));_fggf :=_c .NewCT_RadarSer ();_efabb ._abe .Ser =append (_efabb ._abe .Ser ,_fggf );_fggf .Idx .ValAttr =uint32 (len (_efabb ._abe .Ser )-1);_fggf .Order .ValAttr =uint32 (len (_efabb ._abe .Ser )-1);_adef :=RadarChartSeries {_fggf };_adef .InitializeDefaults ();_adef .Properties ().SetSolidFill (_acge );return _adef ;};func MakeNumberDataSource (x *_c .CT_NumDataSource )NumberDataSource {return NumberDataSource {x }};
|
||||
|
||||
// AddSeries adds a default series to a line chart.
|
||||
func (_cd Line3DChart )AddSeries ()LineChartSeries {_edgc :=_cd .nextColor (len (_cd ._cadd .Ser ));_ggca :=_c .NewCT_LineSer ();_cd ._cadd .Ser =append (_cd ._cadd .Ser ,_ggca );_ggca .Idx .ValAttr =uint32 (len (_cd ._cadd .Ser )-1);_ggca .Order .ValAttr =uint32 (len (_cd ._cadd .Ser )-1);_fga :=LineChartSeries {_ggca };_fga .InitializeDefaults ();_fga .Properties ().LineProperties ().SetSolidFill (_edgc );_fga .Properties ().SetSolidFill (_edgc );return _fga ;};type CategoryAxis struct{_bcf *_c .CT_CatAx };func (_acfc Surface3DChart )InitializeDefaults (){_acfc ._daeb .Wireframe =_c .NewCT_Boolean ();_acfc ._daeb .Wireframe .ValAttr =_ca .Bool (false );_acfc ._daeb .BandFmts =_c .NewCT_BandFmts ();for _fbd :=0;_fbd < 15;_fbd ++{_fbda :=_c .NewCT_BandFmt ();_fbda .Idx .ValAttr =uint32 (_fbd );_fbda .SpPr =_e .NewCT_ShapeProperties ();_dbdg :=_eb .MakeShapeProperties (_fbda .SpPr );_dbdg .SetSolidFill (_acfc .nextColor (_fbd ));_acfc ._daeb .BandFmts .BandFmt =append (_acfc ._daeb .BandFmts .BandFmt ,_fbda );};};func (_ccf DateAxis )MajorGridLines ()GridLines {if _ccf ._dea .MajorGridlines ==nil {_ccf ._dea .MajorGridlines =_c .NewCT_ChartLines ();};return GridLines {_ccf ._dea .MajorGridlines };};
|
||||
|
||||
// AddSeries adds a default series to a Surface chart.
|
||||
func (_gabf SurfaceChart )AddSeries ()SurfaceChartSeries {_daba :=_gabf .nextColor (len (_gabf ._fbcf .Ser ));_dbcd :=_c .NewCT_SurfaceSer ();_gabf ._fbcf .Ser =append (_gabf ._fbcf .Ser ,_dbcd );_dbcd .Idx .ValAttr =uint32 (len (_gabf ._fbcf .Ser )-1);_dbcd .Order .ValAttr =uint32 (len (_gabf ._fbcf .Ser )-1);_adf :=SurfaceChartSeries {_dbcd };_adf .InitializeDefaults ();_adf .Properties ().LineProperties ().SetSolidFill (_daba );return _adf ;};
|
||||
|
||||
// SetDirection changes the direction of the bar chart (bar or column).
|
||||
func (_gf BarChart )SetDirection (d _c .ST_BarDir ){_gf ._gcd .BarDir .ValAttr =d };
|
||||
|
||||
// SetText sets the series text.
|
||||
func (_daa AreaChartSeries )SetText (s string ){_daa ._be .Tx =_c .NewCT_SerTx ();_daa ._be .Tx .Choice .V =&s ;};func (_gae CategoryAxis )SetPosition (p _c .ST_AxPos ){_gae ._bcf .AxPos =_c .NewCT_AxPos ();_gae ._bcf .AxPos .ValAttr =p ;};func (_ecd ValueAxis )SetCrosses (axis Axis ){_ecd ._efce .CrossAx .ValAttr =axis .AxisID ()};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_bbcg LineChart )X ()*_c .CT_LineChart {return _bbcg ._bed };func (_ebf LineChartSeries )CategoryAxis ()CategoryAxisDataSource {if _ebf ._adb .Cat ==nil {_ebf ._adb .Cat =_c .NewCT_AxDataSource ();};return MakeAxisDataSource (_ebf ._adb .Cat );};
|
||||
|
||||
// BubbleChart is a 2D Bubble chart.
|
||||
type BubbleChart struct{chartBase ;_eed *_c .CT_BubbleChart ;};
|
||||
func (_cbdg CategoryAxisDataSource )SetNumberReference (s string ){_cbdg ._bf .Choice =_a .NewCT_AxDataSourceChoice ();_cbdg ._bf .Choice .NumRef =_a .NewCT_NumRef ();_cbdg ._bf .Choice .NumRef .F =s ;};type CategoryAxis struct{_bde *_a .CT_CatAx };func MakeLegend (l *_a .CT_Legend )Legend {return Legend {l }};type SurfaceChartSeries struct{_fcb *_a .CT_SurfaceSer };
|
||||
|
||||
// SetValues sets values directly on a source.
|
||||
func (_fcd NumberDataSource )SetValues (v []float64 ){_fcd .ensureChoice ();_fcd ._aeg .Choice .NumRef =nil ;_fcd ._aeg .Choice .NumLit =_c .NewCT_NumData ();_fcd ._aeg .Choice .NumLit .PtCount =_c .NewCT_UnsignedInt ();_fcd ._aeg .Choice .NumLit .PtCount .ValAttr =uint32 (len (v ));for _agb ,_gdb :=range v {_fcd ._aeg .Choice .NumLit .Pt =append (_fcd ._aeg .Choice .NumLit .Pt ,&_c .CT_NumVal {IdxAttr :uint32 (_agb ),V :_ce .Sprintf ("\u0025\u0067",_gdb )});};};func (_ffea Title )SetText (s string ){if _ffea ._feb .Tx ==nil {_ffea ._feb .Tx =_c .NewCT_Tx ();};if _ffea ._feb .Tx .Choice .Rich ==nil {_ffea ._feb .Tx .Choice .Rich =_e .NewCT_TextBody ();};var _ddgd *_e .CT_TextParagraph ;if len (_ffea ._feb .Tx .Choice .Rich .P )==0{_ddgd =_e .NewCT_TextParagraph ();_ffea ._feb .Tx .Choice .Rich .P =[]*_e .CT_TextParagraph {_ddgd };}else {_ddgd =_ffea ._feb .Tx .Choice .Rich .P [0];};var _bbaeg *_e .EG_TextRun ;if len (_ddgd .EG_TextRun )==0{_bbaeg =_e .NewEG_TextRun ();_ddgd .EG_TextRun =[]*_e .EG_TextRun {_bbaeg };}else {_bbaeg =_ddgd .EG_TextRun [0];};if _bbaeg .R ==nil {_bbaeg .R =_e .NewCT_RegularTextRun ();};_bbaeg .R .T =s ;};
|
||||
|
||||
// MakeAxisDataSource constructs an AxisDataSource wrapper.
|
||||
func MakeAxisDataSource (x *_c .CT_AxDataSource )CategoryAxisDataSource {return CategoryAxisDataSource {x };};func (_gcdb SurfaceChartSeries )CategoryAxis ()CategoryAxisDataSource {if _gcdb ._gaec .Cat ==nil {_gcdb ._gaec .Cat =_c .NewCT_AxDataSource ();};return MakeAxisDataSource (_gcdb ._gaec .Cat );};
|
||||
func (_afd NumberDataSource )SetValues (v []float64 ){_afd .ensureChoice ();_afd ._ecc .Choice .NumRef =nil ;_afd ._ecc .Choice .NumLit =_a .NewCT_NumData ();_afd ._ecc .Choice .NumLit .PtCount =_a .NewCT_UnsignedInt ();_afd ._ecc .Choice .NumLit .PtCount .ValAttr =uint32 (len (v ));for _dec ,_cdbe :=range v {_afd ._ecc .Choice .NumLit .Pt =append (_afd ._ecc .Choice .NumLit .Pt ,&_a .CT_NumVal {IdxAttr :uint32 (_dec ),V :_b .Sprintf ("\u0025\u0067",_cdbe )});};};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_gfgc PieChart )X ()*_c .CT_PieChart {return _gfgc ._ggdc };type Line3DChart struct{chartBase ;_cadd *_c .CT_Line3DChart ;};type LineChart struct{chartBase ;_bed *_c .CT_LineChart ;};func MakeTitle (x *_c .CT_Title )Title {return Title {x }};
|
||||
|
||||
// PieOfPieChart is a Pie chart with an extra Pie chart.
|
||||
type PieOfPieChart struct{chartBase ;_abdb *_c .CT_OfPieChart ;};
|
||||
|
||||
// RadarChart is an Radar chart that has a shaded Radar underneath a curve.
|
||||
type RadarChart struct{chartBase ;_abe *_c .CT_RadarChart ;};func (_efc ScatterChartSeries )InitializeDefaults (){_efc .Properties ().LineProperties ().SetNoFill ();_efc .Marker ().SetSymbol (_c .ST_MarkerStyleAuto );_efc .Labels ().SetShowLegendKey (false );_efc .Labels ().SetShowValue (true );_efc .Labels ().SetShowPercent (false );_efc .Labels ().SetShowCategoryName (false );_efc .Labels ().SetShowSeriesName (false );_efc .Labels ().SetShowLeaderLines (false );};func (_edda ScatterChartSeries )CategoryAxis ()CategoryAxisDataSource {if _edda ._bebd .XVal ==nil {_edda ._bebd .XVal =_c .NewCT_AxDataSource ();};return MakeAxisDataSource (_edda ._bebd .XVal );};func (_ccff ValueAxis )SetPosition (p _c .ST_AxPos ){_ccff ._efce .AxPos =_c .NewCT_AxPos ();_ccff ._efce .AxPos .ValAttr =p ;};
|
||||
func (_caa LineChart )X ()*_a .CT_LineChart {return _caa ._bagd };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_adab Marker )X ()*_c .CT_Marker {return _adab ._afg };
|
||||
func (_ccgd PieChartSeries )X ()*_a .CT_PieSer {return _ccgd ._ade };
|
||||
|
||||
// BubbleChartSeries is a series to be used on a Bubble chart.
|
||||
type BubbleChartSeries struct{_cba *_c .CT_BubbleSer };
|
||||
// AddSeries adds a default series to an area chart.
|
||||
func (_ba Area3DChart )AddSeries ()AreaChartSeries {_ad :=_ba .nextColor (len (_ba ._db .Ser ));_da :=_a .NewCT_AreaSer ();_ba ._db .Ser =append (_ba ._db .Ser ,_da );_da .Idx .ValAttr =uint32 (len (_ba ._db .Ser )-1);_da .Order .ValAttr =uint32 (len (_ba ._db .Ser )-1);_ada :=AreaChartSeries {_da };_ada .InitializeDefaults ();_ada .Properties ().SetSolidFill (_ad );return _ada ;};func (_fgb Bar3DChart )AddAxis (axis Axis ){_bgf :=_a .NewCT_UnsignedInt ();_bgf .ValAttr =axis .AxisID ();_fgb ._fgc .AxId =append (_fgb ._fgc .AxId ,_bgf );};
|
||||
|
||||
// AddLegend adds a legend to a chart, replacing any existing legend.
|
||||
func (_ab Chart )AddLegend ()Legend {_ab ._egd .Chart .Legend =_c .NewCT_Legend ();_fc :=MakeLegend (_ab ._egd .Chart .Legend );_fc .InitializeDefaults ();return _fc ;};
|
||||
// SetExplosion sets the value that the segements of the pie are 'exploded' by
|
||||
func (_bccf PieChartSeries )SetExplosion (v uint32 ){_bccf ._ade .Explosion =_a .NewCT_UnsignedInt ();_bccf ._ade .Explosion .ValAttr =v ;};func (_gabf Title )ParagraphProperties ()_fb .ParagraphProperties {if _gabf ._gbff .Tx ==nil {_gabf .SetText ("");};if _gabf ._gbff .Tx .Choice .Rich .P [0].PPr ==nil {_gabf ._gbff .Tx .Choice .Rich .P [0].PPr =_dg .NewCT_TextParagraphProperties ();};return _fb .MakeParagraphProperties (_gabf ._gbff .Tx .Choice .Rich .P [0].PPr );};func (_cfg BarChart )AddAxis (axis Axis ){_eg :=_a .NewCT_UnsignedInt ();_eg .ValAttr =axis .AxisID ();_cfg ._bd .AxId =append (_cfg ._bd .AxId ,_eg );};type SeriesAxis struct{_fadd *_a .CT_SerAx };func (_aee CategoryAxis )SetCrosses (axis Axis ){_aee ._bde .Choice =_a .NewEG_AxSharedChoice ();_aee ._bde .Choice .Crosses =_a .NewCT_Crosses ();_aee ._bde .Choice .Crosses .ValAttr =_a .ST_CrossesAutoZero ;_aee ._bde .CrossAx .ValAttr =axis .AxisID ();};
|
||||
|
||||
// InitializeDefaults the bar chart to its defaults
|
||||
func (_ed Area3DChart )InitializeDefaults (){};
|
||||
|
||||
// AddSeries adds a default series to a Surface chart.
|
||||
func (_cgc Surface3DChart )AddSeries ()SurfaceChartSeries {_eca :=_cgc .nextColor (len (_cgc ._daeb .Ser ));_ggf :=_c .NewCT_SurfaceSer ();_cgc ._daeb .Ser =append (_cgc ._daeb .Ser ,_ggf );_ggf .Idx .ValAttr =uint32 (len (_cgc ._daeb .Ser )-1);_ggf .Order .ValAttr =uint32 (len (_cgc ._daeb .Ser )-1);_cbd :=SurfaceChartSeries {_ggf };_cbd .InitializeDefaults ();_cbd .Properties ().LineProperties ().SetSolidFill (_eca );return _cbd ;};func (_bbgc DateAxis )SetMajorTickMark (m _c .ST_TickMark ){if m ==_c .ST_TickMarkUnset {_bbgc ._dea .MajorTickMark =nil ;}else {_bbgc ._dea .MajorTickMark =_c .NewCT_TickMark ();_bbgc ._dea .MajorTickMark .ValAttr =m ;};};
|
||||
|
||||
// Surface3DChart is a 3D view of a surface chart.
|
||||
type Surface3DChart struct{chartBase ;_daeb *_c .CT_Surface3DChart ;};
|
||||
// AddBubbleChart adds a new bubble chart.
|
||||
func (_ebcc Chart )AddBubbleChart ()BubbleChart {_ffbf :=_a .NewCT_PlotAreaChoice ();_ebcc ._gec .Chart .PlotArea .Choice =append (_ebcc ._gec .Chart .PlotArea .Choice ,_ffbf );_ffbf .BubbleChart =_a .NewCT_BubbleChart ();_ffc :=BubbleChart {_dcd :_ffbf .BubbleChart };_ffc .InitializeDefaults ();return _ffc ;};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_gdf GridLines )X ()*_c .CT_ChartLines {return _gdf ._cbb };
|
||||
func (_caee ScatterChartSeries )X ()*_a .CT_ScatterSer {return _caee ._abgb };
|
||||
|
||||
// AddSeries adds a default series to a Bubble chart.
|
||||
func (_bag BubbleChart )AddSeries ()BubbleChartSeries {_fbab :=_bag .nextColor (len (_bag ._dcd .Ser ));_af :=_a .NewCT_BubbleSer ();_bag ._dcd .Ser =append (_bag ._dcd .Ser ,_af );_af .Idx .ValAttr =uint32 (len (_bag ._dcd .Ser )-1);_af .Order .ValAttr =uint32 (len (_bag ._dcd .Ser )-1);_fbe :=BubbleChartSeries {_af };_fbe .InitializeDefaults ();_fbe .Properties ().SetSolidFill (_fbab );return _fbe ;};func (_adaa Legend )SetPosition (p _a .ST_LegendPos ){if p ==_a .ST_LegendPosUnset {_adaa ._abc .LegendPos =nil ;}else {_adaa ._abc .LegendPos =_a .NewCT_LegendPos ();_adaa ._abc .LegendPos .ValAttr =p ;};};
|
||||
|
||||
// Index returns the index of the series
|
||||
func (_bgge SurfaceChartSeries )Index ()uint32 {return _bgge ._gaec .Idx .ValAttr };
|
||||
func (_gbgc SurfaceChartSeries )Index ()uint32 {return _gbgc ._fcb .Idx .ValAttr };func (_aefg ScatterChartSeries )CategoryAxis ()CategoryAxisDataSource {if _aefg ._abgb .XVal ==nil {_aefg ._abgb .XVal =_a .NewCT_AxDataSource ();};return MakeAxisDataSource (_aefg ._abgb .XVal );};func MakeDataLabels (x *_a .CT_DLbls )DataLabels {return DataLabels {x }};
|
||||
|
||||
// SetHoleSize controls the hole size in the pie chart and is measured in percent.
|
||||
func (_egd DoughnutChart )SetHoleSize (pct uint8 ){if _egd ._fde .HoleSize ==nil {_egd ._fde .HoleSize =_a .NewCT_HoleSize ();};if _egd ._fde .HoleSize .ValAttr ==nil {_egd ._fde .HoleSize .ValAttr =&_a .ST_HoleSize {};};_egd ._fde .HoleSize .ValAttr .ST_HoleSizeUByte =&pct ;};
|
||||
|
||||
// AddSurface3DChart adds a new 3D surface chart to a chart.
|
||||
func (_dbf Chart )AddSurface3DChart ()Surface3DChart {_dcg :=_a .NewCT_PlotAreaChoice ();_dbf ._gec .Chart .PlotArea .Choice =append (_dbf ._gec .Chart .PlotArea .Choice ,_dcg );_dcg .Surface3DChart =_a .NewCT_Surface3DChart ();_fee (_dbf ._gec .Chart );_fgbc :=Surface3DChart {_bcg :_dcg .Surface3DChart };_fgbc .InitializeDefaults ();return _fgbc ;};type Title struct{_gbff *_a .CT_Title };
|
||||
|
||||
// SetText sets the series text.
|
||||
func (_ca BarChartSeries )SetText (s string ){_ca ._ag .Tx =_a .NewCT_SerTx ();_ca ._ag .Tx .Choice .V =&s };
|
||||
|
||||
// Chart is a generic chart.
|
||||
type Chart struct{_gec *_a .ChartSpace };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_aa Area3DChart )X ()*_a .CT_Area3DChart {return _aa ._db };func (_ece ValueAxis )SetTickLabelPosition (p _a .ST_TickLblPos ){if p ==_a .ST_TickLblPosUnset {_ece ._adfg .TickLblPos =nil ;}else {_ece ._adfg .TickLblPos =_a .NewCT_TickLblPos ();_ece ._adfg .TickLblPos .ValAttr =p ;};};
|
||||
|
||||
// InitializeDefaults initializes an Pie series to the default values.
|
||||
func (_fcc PieChartSeries )InitializeDefaults (){};
|
||||
|
||||
// AddDateAxis adds a value axis to the chart.
|
||||
func (_geaa Chart )AddDateAxis ()DateAxis {_cbcb :=_a .NewCT_DateAx ();if _geaa ._gec .Chart .PlotArea .CChoice ==nil {_geaa ._gec .Chart .PlotArea .CChoice =_a .NewCT_PlotAreaChoice1 ();};_cbcb .AxId =_a .NewCT_UnsignedInt ();_cbcb .AxId .ValAttr =0x7FFFFFFF&_d .Uint32 ();_geaa ._gec .Chart .PlotArea .CChoice .DateAx =append (_geaa ._gec .Chart .PlotArea .CChoice .DateAx ,_cbcb );_cbcb .Delete =_a .NewCT_Boolean ();_cbcb .Delete .ValAttr =_f .Bool (false );_cbcb .Scaling =_a .NewCT_Scaling ();_cbcb .Scaling .Orientation =_a .NewCT_Orientation ();_cbcb .Scaling .Orientation .ValAttr =_a .ST_OrientationMinMax ;_cbcb .Choice =&_a .EG_AxSharedChoice {};_cbcb .Choice .Crosses =_a .NewCT_Crosses ();_cbcb .Choice .Crosses .ValAttr =_a .ST_CrossesAutoZero ;_bbac :=DateAxis {_cbcb };_bbac .MajorGridLines ().Properties ().LineProperties ().SetSolidFill (_g .LightGray );_bbac .SetMajorTickMark (_a .ST_TickMarkOut );_bbac .SetMinorTickMark (_a .ST_TickMarkIn );_bbac .SetTickLabelPosition (_a .ST_TickLblPosNextTo );_bbac .Properties ().LineProperties ().SetSolidFill (_g .Black );_bbac .SetPosition (_a .ST_AxPosL );return _bbac ;};func (_bfc Chart )AddSeriesAxis ()SeriesAxis {_ggf :=_a .NewCT_SerAx ();if _bfc ._gec .Chart .PlotArea .CChoice ==nil {_bfc ._gec .Chart .PlotArea .CChoice =_a .NewCT_PlotAreaChoice1 ();};_ggf .AxId =_a .NewCT_UnsignedInt ();_ggf .AxId .ValAttr =0x7FFFFFFF&_d .Uint32 ();_bfc ._gec .Chart .PlotArea .CChoice .SerAx =append (_bfc ._gec .Chart .PlotArea .CChoice .SerAx ,_ggf );_ggf .Delete =_a .NewCT_Boolean ();_ggf .Delete .ValAttr =_f .Bool (false );_cdgc :=MakeSeriesAxis (_ggf );_cdgc .InitializeDefaults ();return _cdgc ;};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_fdc SurfaceChart )X ()*_a .CT_SurfaceChart {return _fdc ._gfaa };
|
||||
|
||||
// Labels returns the data label properties.
|
||||
func (_ffac ScatterChartSeries )Labels ()DataLabels {if _ffac ._abgb .DLbls ==nil {_ffac ._abgb .DLbls =_a .NewCT_DLbls ();};return MakeDataLabels (_ffac ._abgb .DLbls );};
|
||||
|
||||
// SetText sets the series text.
|
||||
func (_badd RadarChartSeries )SetText (s string ){_badd ._dbfca .Tx =_a .NewCT_SerTx ();_badd ._dbfca .Tx .Choice .V =&s ;};
|
||||
|
||||
// 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{_bf *_a .CT_AxDataSource };func (_cea GridLines )Properties ()_fb .ShapeProperties {if _cea ._gbc .SpPr ==nil {_cea ._gbc .SpPr =_dg .NewCT_ShapeProperties ();};return _fb .MakeShapeProperties (_cea ._gbc .SpPr );};
|
||||
|
||||
// StockChart is a 2D Stock chart.
|
||||
type StockChart struct{chartBase ;_ffbff *_a .CT_StockChart ;};
|
||||
|
||||
// InitializeDefaults the bar chart to its defaults
|
||||
func (_cfb PieOfPieChart )InitializeDefaults (){_cfb ._gabb .VaryColors =_a .NewCT_Boolean ();_cfb ._gabb .VaryColors .ValAttr =_f .Bool (true );_cfb .SetType (_a .ST_OfPieTypePie );_cfb ._gabb .SecondPieSize =_a .NewCT_SecondPieSize ();_cfb ._gabb .SecondPieSize .ValAttr =&_a .ST_SecondPieSize {};_cfb ._gabb .SecondPieSize .ValAttr .ST_SecondPieSizeUShort =_f .Uint16 (75);_afec :=_a .NewCT_ChartLines ();_afec .SpPr =_dg .NewCT_ShapeProperties ();_bfdc :=_fb .MakeShapeProperties (_afec .SpPr );_bfdc .LineProperties ().SetSolidFill (_g .Auto );_cfb ._gabb .SerLines =append (_cfb ._gabb .SerLines ,_afec );};
|
||||
|
||||
// AddCategoryAxis adds a category axis.
|
||||
func (_df Chart )AddCategoryAxis ()CategoryAxis {_ce :=_a .NewCT_CatAx ();if _df ._gec .Chart .PlotArea .CChoice ==nil {_df ._gec .Chart .PlotArea .CChoice =_a .NewCT_PlotAreaChoice1 ();};_ce .AxId =_a .NewCT_UnsignedInt ();_ce .AxId .ValAttr =0x7FFFFFFF&_d .Uint32 ();_df ._gec .Chart .PlotArea .CChoice .CatAx =append (_df ._gec .Chart .PlotArea .CChoice .CatAx ,_ce );_ce .Auto =_a .NewCT_Boolean ();_ce .Auto .ValAttr =_f .Bool (true );_ce .Delete =_a .NewCT_Boolean ();_ce .Delete .ValAttr =_f .Bool (false );_ccb :=MakeCategoryAxis (_ce );_ccb .InitializeDefaults ();return _ccb ;};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_cfe BarChart )X ()*_a .CT_BarChart {return _cfe ._bd };
|
||||
|
||||
// InitializeDefaults the bar chart to its defaults
|
||||
func (_ffbac Pie3DChart )InitializeDefaults (){_ffbac ._cbef .VaryColors =_a .NewCT_Boolean ();_ffbac ._cbef .VaryColors .ValAttr =_f .Bool (true );};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_ef BubbleChart )X ()*_a .CT_BubbleChart {return _ef ._dcd };
|
||||
|
||||
// CategoryAxis returns the category data source.
|
||||
func (_cag PieChartSeries )CategoryAxis ()CategoryAxisDataSource {if _cag ._faag .Cat ==nil {_cag ._faag .Cat =_c .NewCT_AxDataSource ();};return MakeAxisDataSource (_cag ._faag .Cat );};func (_ade NumberDataSource )SetReference (s string ){_ade .ensureChoice ();if _ade ._aeg .Choice .NumRef ==nil {_ade ._aeg .Choice .NumRef =_c .NewCT_NumRef ();};_ade ._aeg .Choice .NumRef .F =s ;};
|
||||
func (_aeb PieChartSeries )CategoryAxis ()CategoryAxisDataSource {if _aeb ._ade .Cat ==nil {_aeb ._ade .Cat =_a .NewCT_AxDataSource ();};return MakeAxisDataSource (_aeb ._ade .Cat );};
|
||||
|
||||
// PieChart is a Pie chart.
|
||||
type PieChart struct{chartBase ;_ggdc *_c .CT_PieChart ;};func (_ebdf ValueAxis )SetMajorTickMark (m _c .ST_TickMark ){if m ==_c .ST_TickMarkUnset {_ebdf ._efce .MajorTickMark =nil ;}else {_ebdf ._efce .MajorTickMark =_c .NewCT_TickMark ();_ebdf ._efce .MajorTickMark .ValAttr =m ;};};func (_ffeb SeriesAxis )SetCrosses (axis Axis ){_ffeb ._cga .CrossAx .ValAttr =axis .AxisID ()};type Marker struct{_afg *_c .CT_Marker };
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_abf RadarChartSeries )X ()*_a .CT_RadarSer {return _abf ._dbfca };func (_eccg ValueAxis )SetMajorTickMark (m _a .ST_TickMark ){if m ==_a .ST_TickMarkUnset {_eccg ._adfg .MajorTickMark =nil ;}else {_eccg ._adfg .MajorTickMark =_a .NewCT_TickMark ();_eccg ._adfg .MajorTickMark .ValAttr =m ;};};
|
||||
|
||||
// InitializeDefaults the Bubble chart to its defaults
|
||||
func (_fbbf BubbleChart )InitializeDefaults (){};type DataLabels struct{_bgg *_a .CT_DLbls };
|
||||
|
||||
// SetText sets the series text
|
||||
func (_baddg SurfaceChartSeries )SetText (s string ){_baddg ._fcb .Tx =_a .NewCT_SerTx ();_baddg ._fcb .Tx .Choice .V =&s ;};
|
||||
|
||||
// AddStockChart adds a new stock chart.
|
||||
func (_ed Chart )AddStockChart ()StockChart {_bcdd :=_a .NewCT_PlotAreaChoice ();_ed ._gec .Chart .PlotArea .Choice =append (_ed ._gec .Chart .PlotArea .Choice ,_bcdd );_bcdd .StockChart =_a .NewCT_StockChart ();_gce :=StockChart {_ffbff :_bcdd .StockChart };_gce .InitializeDefaults ();return _gce ;};func (_fcd CategoryAxis )Properties ()_fb .ShapeProperties {if _fcd ._bde .SpPr ==nil {_fcd ._bde .SpPr =_dg .NewCT_ShapeProperties ();};return _fb .MakeShapeProperties (_fcd ._bde .SpPr );};
|
||||
|
||||
// AddLineChart adds a new line chart to a chart.
|
||||
func (_gae Chart )AddLineChart ()LineChart {_bb :=_a .NewCT_PlotAreaChoice ();_gae ._gec .Chart .PlotArea .Choice =append (_gae ._gec .Chart .PlotArea .Choice ,_bb );_bb .LineChart =_a .NewCT_LineChart ();_bb .LineChart .Grouping =_a .NewCT_Grouping ();_bb .LineChart .Grouping .ValAttr =_a .ST_GroupingStandard ;return LineChart {_bagd :_bb .LineChart };};func (_bed SeriesAxis )SetCrosses (axis Axis ){_bed ._fadd .CrossAx .ValAttr =axis .AxisID ()};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_ecf LineChartSeries )X ()*_a .CT_LineSer {return _ecf ._fgfb };func (_ff Area3DChart )AddAxis (axis Axis ){_fe :=_a .NewCT_UnsignedInt ();_fe .ValAttr =axis .AxisID ();_ff ._db .AxId =append (_ff ._db .AxId ,_fe );};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_cc BubbleChartSeries )X ()*_a .CT_BubbleSer {return _cc ._cdg };
|
||||
|
||||
// RemoveLegend removes the legend if the chart has one.
|
||||
func (_gbd Chart )RemoveLegend (){_gbd ._gec .Chart .Legend =nil };
|
||||
|
||||
// Properties returns the line chart series shape properties.
|
||||
func (_dcad ScatterChartSeries )Properties ()_fb .ShapeProperties {if _dcad ._abgb .SpPr ==nil {_dcad ._abgb .SpPr =_dg .NewCT_ShapeProperties ();};return _fb .MakeShapeProperties (_dcad ._abgb .SpPr );};type Legend struct{_abc *_a .CT_Legend };
|
||||
|
||||
// BubbleChart is a 2D Bubble chart.
|
||||
type BubbleChart struct{chartBase ;_dcd *_a .CT_BubbleChart ;};
|
||||
|
||||
// InitializeDefaults the bar chart to its defaults
|
||||
func (_gea Bar3DChart )InitializeDefaults (){_gea .SetDirection (_a .ST_BarDirCol )};func (_eb CategoryAxis )AxisID ()uint32 {return _eb ._bde .AxId .ValAttr };
|
||||
|
||||
// Values returns the bubble size data source.
|
||||
func (_ddf BubbleChartSeries )BubbleSizes ()NumberDataSource {if _ddf ._cdg .BubbleSize ==nil {_ddf ._cdg .BubbleSize =_a .NewCT_NumDataSource ();};return MakeNumberDataSource (_ddf ._cdg .BubbleSize );};
|
||||
|
||||
// AddValueAxis adds a value axis to the chart.
|
||||
func (_bbf Chart )AddValueAxis ()ValueAxis {_dbfc :=_a .NewCT_ValAx ();if _bbf ._gec .Chart .PlotArea .CChoice ==nil {_bbf ._gec .Chart .PlotArea .CChoice =_a .NewCT_PlotAreaChoice1 ();};_dbfc .AxId =_a .NewCT_UnsignedInt ();_dbfc .AxId .ValAttr =0x7FFFFFFF&_d .Uint32 ();_bbf ._gec .Chart .PlotArea .CChoice .ValAx =append (_bbf ._gec .Chart .PlotArea .CChoice .ValAx ,_dbfc );_dbfc .Delete =_a .NewCT_Boolean ();_dbfc .Delete .ValAttr =_f .Bool (false );_dbfc .Scaling =_a .NewCT_Scaling ();_dbfc .Scaling .Orientation =_a .NewCT_Orientation ();_dbfc .Scaling .Orientation .ValAttr =_a .ST_OrientationMinMax ;_dbfc .Choice =&_a .EG_AxSharedChoice {};_dbfc .Choice .Crosses =_a .NewCT_Crosses ();_dbfc .Choice .Crosses .ValAttr =_a .ST_CrossesAutoZero ;_dbfc .CrossBetween =_a .NewCT_CrossBetween ();_dbfc .CrossBetween .ValAttr =_a .ST_CrossBetweenBetween ;_fgbd :=MakeValueAxis (_dbfc );_fgbd .MajorGridLines ().Properties ().LineProperties ().SetSolidFill (_g .LightGray );_fgbd .SetMajorTickMark (_a .ST_TickMarkOut );_fgbd .SetMinorTickMark (_a .ST_TickMarkIn );_fgbd .SetTickLabelPosition (_a .ST_TickLblPosNextTo );_fgbd .Properties ().LineProperties ().SetSolidFill (_g .Black );_fgbd .SetPosition (_a .ST_AxPosL );return _fgbd ;};
|
||||
|
||||
// InitializeDefaults the bar chart to its defaults
|
||||
func (_bc Area3DChart )InitializeDefaults (){};
|
||||
|
||||
// SetIndex sets the index of the series
|
||||
func (_ffd SurfaceChartSeries )SetIndex (idx uint32 ){_ffd ._fcb .Idx .ValAttr =idx };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_fedf Title )X ()*_a .CT_Title {return _fedf ._gbff };type Line3DChart struct{chartBase ;_dce *_a .CT_Line3DChart ;};
|
||||
|
||||
// AddScatterChart adds a scatter (X/Y) chart.
|
||||
func (_bgcg Chart )AddScatterChart ()ScatterChart {_egc :=_a .NewCT_PlotAreaChoice ();_bgcg ._gec .Chart .PlotArea .Choice =append (_bgcg ._gec .Chart .PlotArea .Choice ,_egc );_egc .ScatterChart =_a .NewCT_ScatterChart ();_cdb :=ScatterChart {_fce :_egc .ScatterChart };_cdb .InitializeDefaults ();return _cdb ;};func (_ffba LineChartSeries )SetSmooth (b bool ){_ffba ._fgfb .Smooth =_a .NewCT_Boolean ();_ffba ._fgfb .Smooth .ValAttr =&b ;};func (_efcb Legend )InitializeDefaults (){_efcb .SetPosition (_a .ST_LegendPosR );_efcb .SetOverlay (false );_efcb .Properties ().SetNoFill ();_efcb .Properties ().LineProperties ().SetNoFill ();};func MakeCategoryAxis (x *_a .CT_CatAx )CategoryAxis {return CategoryAxis {x }};
|
||||
|
||||
// SetDirection changes the direction of the bar chart (bar or column).
|
||||
func (_gb Bar3DChart )SetDirection (d _a .ST_BarDir ){_gb ._fgc .BarDir .ValAttr =d };
|
||||
|
||||
// Order returns the order of the series
|
||||
func (_cde ScatterChartSeries )Order ()uint32 {return _cde ._abgb .Order .ValAttr };func (_cage ScatterChartSeries )InitializeDefaults (){_cage .Properties ().LineProperties ().SetNoFill ();_cage .Marker ().SetSymbol (_a .ST_MarkerStyleAuto );_cage .Labels ().SetShowLegendKey (false );_cage .Labels ().SetShowValue (true );_cage .Labels ().SetShowPercent (false );_cage .Labels ().SetShowCategoryName (false );_cage .Labels ().SetShowSeriesName (false );_cage .Labels ().SetShowLeaderLines (false );};
|
||||
|
||||
// Values returns the value data source.
|
||||
func (_bgdg RadarChartSeries )Values ()NumberDataSource {if _bgdg ._dbfca .Val ==nil {_bgdg ._dbfca .Val =_a .NewCT_NumDataSource ();};return MakeNumberDataSource (_bgdg ._dbfca .Val );};
|
||||
|
||||
// Properties returns the line chart series shape properties.
|
||||
func (_gbeb SurfaceChartSeries )Properties ()_fb .ShapeProperties {if _gbeb ._fcb .SpPr ==nil {_gbeb ._fcb .SpPr =_dg .NewCT_ShapeProperties ();};return _fb .MakeShapeProperties (_gbeb ._fcb .SpPr );};func (_cfc DataLabels )SetShowPercent (b bool ){_cfc .ensureChoice ();_cfc ._bgg .Choice .ShowPercent =_a .NewCT_Boolean ();_cfc ._bgg .Choice .ShowPercent .ValAttr =_f .Bool (b );};
|
||||
|
||||
// RadarChartSeries is a series to be used on an Radar chart.
|
||||
type RadarChartSeries struct{_dbfca *_a .CT_RadarSer };
|
||||
|
||||
// Properties returns the bar chart series shape properties.
|
||||
func (_gffc RadarChartSeries )Properties ()_fb .ShapeProperties {if _gffc ._dbfca .SpPr ==nil {_gffc ._dbfca .SpPr =_dg .NewCT_ShapeProperties ();};return _fb .MakeShapeProperties (_gffc ._dbfca .SpPr );};
|
||||
|
||||
// AddSeries adds a default series to a bar chart.
|
||||
func (_gba Bar3DChart )AddSeries ()BarChartSeries {_fbb :=_gba .nextColor (len (_gba ._fgc .Ser ));_gc :=_a .NewCT_BarSer ();_gba ._fgc .Ser =append (_gba ._fgc .Ser ,_gc );_gc .Idx .ValAttr =uint32 (len (_gba ._fgc .Ser )-1);_gc .Order .ValAttr =uint32 (len (_gba ._fgc .Ser )-1);_fgd :=BarChartSeries {_gc };_fgd .InitializeDefaults ();_fgd .Properties ().SetSolidFill (_fbb );return _fgd ;};
|
||||
|
||||
// AddLegend adds a legend to a chart, replacing any existing legend.
|
||||
func (_aba Chart )AddLegend ()Legend {_aba ._gec .Chart .Legend =_a .NewCT_Legend ();_aae :=MakeLegend (_aba ._gec .Chart .Legend );_aae .InitializeDefaults ();return _aae ;};
|
||||
|
||||
// Values returns the value data source.
|
||||
func (_ggb PieChartSeries )Values ()NumberDataSource {if _ggb ._ade .Val ==nil {_ggb ._ade .Val =_a .NewCT_NumDataSource ();};return MakeNumberDataSource (_ggb ._ade .Val );};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_gddd ValueAxis )X ()*_a .CT_ValAx {return _gddd ._adfg };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_bfb Pie3DChart )X ()*_a .CT_Pie3DChart {return _bfb ._cbef };
|
||||
|
||||
// AddSeries adds a default series to a Stock chart.
|
||||
func (_cgd StockChart )AddSeries ()LineChartSeries {_eebe :=_a .NewCT_LineSer ();_cgd ._ffbff .Ser =append (_cgd ._ffbff .Ser ,_eebe );_eebe .Idx .ValAttr =uint32 (len (_cgd ._ffbff .Ser )-1);_eebe .Order .ValAttr =uint32 (len (_cgd ._ffbff .Ser )-1);_aab :=LineChartSeries {_eebe };_aab .Values ().CreateEmptyNumberCache ();_aab .Properties ().LineProperties ().SetNoFill ();return _aab ;};
|
||||
|
||||
// CategoryAxis returns the category data source.
|
||||
func (_fg AreaChartSeries )CategoryAxis ()CategoryAxisDataSource {if _fg ._ea .Cat ==nil {_fg ._ea .Cat =_a .NewCT_AxDataSource ();};return MakeAxisDataSource (_fg ._ea .Cat );};func (_bggf DateAxis )Properties ()_fb .ShapeProperties {if _bggf ._dfc .SpPr ==nil {_bggf ._dfc .SpPr =_dg .NewCT_ShapeProperties ();};return _fb .MakeShapeProperties (_bggf ._dfc .SpPr );};func (_ggeb Title )SetText (s string ){if _ggeb ._gbff .Tx ==nil {_ggeb ._gbff .Tx =_a .NewCT_Tx ();};if _ggeb ._gbff .Tx .Choice .Rich ==nil {_ggeb ._gbff .Tx .Choice .Rich =_dg .NewCT_TextBody ();};var _adb *_dg .CT_TextParagraph ;if len (_ggeb ._gbff .Tx .Choice .Rich .P )==0{_adb =_dg .NewCT_TextParagraph ();_ggeb ._gbff .Tx .Choice .Rich .P =[]*_dg .CT_TextParagraph {_adb };}else {_adb =_ggeb ._gbff .Tx .Choice .Rich .P [0];};var _deb *_dg .EG_TextRun ;if len (_adb .EG_TextRun )==0{_deb =_dg .NewEG_TextRun ();_adb .EG_TextRun =[]*_dg .EG_TextRun {_deb };}else {_deb =_adb .EG_TextRun [0];};if _deb .R ==nil {_deb .R =_dg .NewCT_RegularTextRun ();};_deb .R .T =s ;};func (_cgg NumberDataSource )ensureChoice (){if _cgg ._ecc .Choice ==nil {_cgg ._ecc .Choice =_a .NewCT_NumDataSourceChoice ();};};
|
||||
|
||||
// SetOrder sets the order of the series
|
||||
func (_ddc SurfaceChartSeries )SetOrder (idx uint32 ){_ddc ._fcb .Order .ValAttr =idx };
|
||||
|
||||
// InitializeDefaults the bar chart to its defaults
|
||||
func (_aec AreaChart )InitializeDefaults (){};
|
||||
|
||||
// InitializeDefaults the bar chart to its defaults
|
||||
func (_abca RadarChart )InitializeDefaults (){_abca ._bfcd .RadarStyle .ValAttr =_a .ST_RadarStyleMarker };func (_bbc DateAxis )SetPosition (p _a .ST_AxPos ){_bbc ._dfc .AxPos =_a .NewCT_AxPos ();_bbc ._dfc .AxPos .ValAttr =p ;};
|
||||
|
||||
// AddSurfaceChart adds a new surface chart to a chart.
|
||||
func (_dbad Chart )AddSurfaceChart ()SurfaceChart {_gbf :=_a .NewCT_PlotAreaChoice ();_dbad ._gec .Chart .PlotArea .Choice =append (_dbad ._gec .Chart .PlotArea .Choice ,_gbf );_gbf .SurfaceChart =_a .NewCT_SurfaceChart ();_fee (_dbad ._gec .Chart );_dbad ._gec .Chart .View3D .RotX .ValAttr =_f .Int8 (90);_dbad ._gec .Chart .View3D .RotY .ValAttr =_f .Uint16 (0);_dbad ._gec .Chart .View3D .Perspective =_a .NewCT_Perspective ();_dbad ._gec .Chart .View3D .Perspective .ValAttr =_f .Uint8 (0);_ggd :=SurfaceChart {_gfaa :_gbf .SurfaceChart };_ggd .InitializeDefaults ();return _ggd ;};type chartBase struct{};type NumberDataSource struct{_ecc *_a .CT_NumDataSource };
|
||||
|
||||
// Axis is the interface implemented by different axes when assigning to a
|
||||
// chart.
|
||||
type Axis interface{AxisID ()uint32 ;};
|
||||
|
||||
// Values returns the value data source.
|
||||
func (_cfa AreaChartSeries )Values ()NumberDataSource {if _cfa ._ea .Val ==nil {_cfa ._ea .Val =_a .NewCT_NumDataSource ();};return MakeNumberDataSource (_cfa ._ea .Val );};func MakeChart (x *_a .ChartSpace )Chart {return Chart {x }};func (_ecfe SurfaceChartSeries )CategoryAxis ()CategoryAxisDataSource {if _ecfe ._fcb .Cat ==nil {_ecfe ._fcb .Cat =_a .NewCT_AxDataSource ();};return MakeAxisDataSource (_ecfe ._fcb .Cat );};var NullAxis Axis =nullAxis (0);func (_baec DateAxis )SetMinorTickMark (m _a .ST_TickMark ){if m ==_a .ST_TickMarkUnset {_baec ._dfc .MinorTickMark =nil ;}else {_baec ._dfc .MinorTickMark =_a .NewCT_TickMark ();_baec ._dfc .MinorTickMark .ValAttr =m ;};};
|
||||
|
||||
// AddSeries adds a default series to a Surface chart.
|
||||
func (_bccc Surface3DChart )AddSeries ()SurfaceChartSeries {_ecd :=_bccc .nextColor (len (_bccc ._bcg .Ser ));_ecfb :=_a .NewCT_SurfaceSer ();_bccc ._bcg .Ser =append (_bccc ._bcg .Ser ,_ecfb );_ecfb .Idx .ValAttr =uint32 (len (_bccc ._bcg .Ser )-1);_ecfb .Order .ValAttr =uint32 (len (_bccc ._bcg .Ser )-1);_aggc :=SurfaceChartSeries {_ecfb };_aggc .InitializeDefaults ();_aggc .Properties ().LineProperties ().SetSolidFill (_ecd );return _aggc ;};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_dba Bar3DChart )X ()*_a .CT_Bar3DChart {return _dba ._fgc };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_bcbf RadarChart )X ()*_a .CT_RadarChart {return _bcbf ._bfcd };func (_fbea BubbleChart )AddAxis (axis Axis ){_fbfd :=_a .NewCT_UnsignedInt ();_fbfd .ValAttr =axis .AxisID ();_fbea ._dcd .AxId =append (_fbea ._dcd .AxId ,_fbfd );};
|
||||
|
||||
// AddAxis adds an axis to a Surface chart.
|
||||
func (_bgfde SurfaceChart )AddAxis (axis Axis ){_agd :=_a .NewCT_UnsignedInt ();_agd .ValAttr =axis .AxisID ();_bgfde ._gfaa .AxId =append (_bgfde ._gfaa .AxId ,_agd );};
|
@ -11,27 +11,27 @@
|
||||
|
||||
// Package color provides color handling structures and functions for use across
|
||||
// all of the document types.
|
||||
package color ;import (_da "fmt";_dc "github.com/unidoc/unioffice";);var DarkGray =Color {0xA9,0xA9,0xA9,255,false };var LightSlateGrey =Color {0x77,0x88,0x99,255,false };var Auto =Color {0,0,0,255,true };var DarkSlateGrey =Color {0x2F,0x4F,0x4F,255,false };var DarkKhaki =Color {0xBD,0xB7,0x6B,255,false };var Tan =Color {0xD2,0xB4,0x8C,255,false };var MediumPurple =Color {0x93,0x70,0xDB,255,false };var Ivory =Color {0xFF,0xFF,0xF0,255,false };var LightGray =Color {0xD3,0xD3,0xD3,255,false };var SeaShell =Color {0xFF,0xF5,0xEE,255,false };var Sienna =Color {0xA0,0x52,0x2D,255,false };var Thistle =Color {0xD8,0xBF,0xD8,255,false };var AntiqueWhite =Color {0xFA,0xEB,0xD7,255,false };var OldLace =Color {0xFD,0xF5,0xE6,255,false };var PaleVioletRed =Color {0xDB,0x70,0x93,255,false };var NavajoWhite =Color {0xFF,0xDE,0xAD,255,false };var BlueViolet =Color {0x8A,0x2B,0xE2,255,false };var MediumOrchid =Color {0xBA,0x55,0xD3,255,false };var Chartreuse =Color {0x7F,0xFF,0x00,255,false };var DarkCyan =Color {0x00,0x8B,0x8B,255,false };var Green =Color {0x00,0x80,0x00,255,false };var LightGoldenRodYellow =Color {0xFA,0xFA,0xD2,255,false };var SeaGreen =Color {0x2E,0x8B,0x57,255,false };var Aquamarine =Color {0x7F,0xFF,0xD4,255,false };var Tomato =Color {0xFF,0x63,0x47,255,false };func FromHex (s string )Color {if len (s )==0{return Auto ;};if s [0]=='#'{s =s [1:];};var _ecc ,_bd ,_ac uint8 ;_c ,_ :=_da .Sscanf (s ,"\u0025\u0030\u0032x\u0025\u0030\u0032\u0078\u0025\u0030\u0032\u0078",&_ecc ,&_bd ,&_ac );if _c ==3{return RGB (_ecc ,_bd ,_ac );};return Auto ;};var DimGray =Color {0x69,0x69,0x69,255,false };var MediumSlateBlue =Color {0x7B,0x68,0xEE,255,false };var MediumTurquoise =Color {0x48,0xD1,0xCC,255,false };var Salmon =Color {0xFA,0x80,0x72,255,false };var DimGrey =Color {0x69,0x69,0x69,255,false };var SandyBrown =Color {0xF4,0xA4,0x60,255,false };var Cornsilk =Color {0xFF,0xF8,0xDC,255,false };var DarkRed =Color {0x8B,0x00,0x00,255,false };var Lavender =Color {0xE6,0xE6,0xFA,255,false };var PeachPuff =Color {0xFF,0xDA,0xB9,255,false };var DarkOrchid =Color {0x99,0x32,0xCC,255,false };var DarkOliveGreen =Color {0x55,0x6B,0x2F,255,false };var MidnightBlue =Color {0x19,0x19,0x70,255,false };var Beige =Color {0xF5,0xF5,0xDC,255,false };var MistyRose =Color {0xFF,0xE4,0xE1,255,false };var Turquoise =Color {0x40,0xE0,0xD0,255,false };var Magenta =Color {0xFF,0x00,0xFF,255,false };
|
||||
|
||||
// IsAuto returns true if the color is the 'Auto' type. If the
|
||||
// field doesn't support an Auto color, then black is used.
|
||||
func (_a Color )IsAuto ()bool {return _a ._f };var PapayaWhip =Color {0xFF,0xEF,0xD5,255,false };var Chocolate =Color {0xD2,0x69,0x1E,255,false };var LightSalmon =Color {0xFF,0xA0,0x7A,255,false };var WhiteSmoke =Color {0xF5,0xF5,0xF5,255,false };var GoldenRod =Color {0xDA,0xA5,0x20,255,false };var LemonChiffon =Color {0xFF,0xFA,0xCD,255,false };var MediumSpringGreen =Color {0x00,0xFA,0x9A,255,false };var CadetBlue =Color {0x5F,0x9E,0xA0,255,false };var LightSeaGreen =Color {0x20,0xB2,0xAA,255,false };var DarkSlateGray =Color {0x2F,0x4F,0x4F,255,false };var Fuchsia =Color {0xFF,0x00,0xFF,255,false };var SlateBlue =Color {0x6A,0x5A,0xCD,255,false };var Lime =Color {0x00,0xFF,0x00,255,false };var Plum =Color {0xDD,0xA0,0xDD,255,false };var Azure =Color {0xF0,0xFF,0xFF,255,false };var LightCoral =Color {0xF0,0x80,0x80,255,false };var Bisque =Color {0xFF,0xE4,0xC4,255,false };var Peru =Color {0xCD,0x85,0x3F,255,false };var DarkGrey =Color {0xA9,0xA9,0xA9,255,false };var ForestGreen =Color {0x22,0x8B,0x22,255,false };
|
||||
|
||||
// AsRGBString is used by the various wrappers to return a pointer
|
||||
// to a string containing a six digit hex RGB value.
|
||||
func (_dg Color )AsRGBString ()*string {return _dc .Stringf ("\u0025\u0030\u0032x\u0025\u0030\u0032\u0078\u0025\u0030\u0032\u0078",_dg ._e ,_dg ._b ,_dg ._ec );};var Navy =Color {0x00,0x00,0x80,255,false };var DarkSeaGreen =Color {0x8F,0xBC,0x8F,255,false };var DarkBlue =Color {0x00,0x00,0x8B,255,false };var BlanchedAlmond =Color {0xFF,0xEB,0xCD,255,false };var DarkGoldenRod =Color {0xB8,0x86,0x0B,255,false };var SteelBlue =Color {0x46,0x82,0xB4,255,false };var LightSteelBlue =Color {0xB0,0xC4,0xDE,255,false };var GhostWhite =Color {0xF8,0xF8,0xFF,255,false };var DarkMagenta =Color {0x8B,0x00,0x8B,255,false };var Coral =Color {0xFF,0x7F,0x50,255,false };var DodgerBlue =Color {0x1E,0x90,0xFF,255,false };var LimeGreen =Color {0x32,0xCD,0x32,255,false };var LavenderBlush =Color {0xFF,0xF0,0xF5,255,false };var DeepPink =Color {0xFF,0x14,0x93,255,false };var DarkSlateBlue =Color {0x48,0x3D,0x8B,255,false };var LawnGreen =Color {0x7C,0xFC,0x00,255,false };var Maroon =Color {0x80,0x00,0x00,255,false };var HotPink =Color {0xFF,0x69,0xB4,255,false };var LightSkyBlue =Color {0x87,0xCE,0xFA,255,false };var BurlyWood =Color {0xDE,0xB8,0x87,255,false };var SuccessGreen =Color {0x00,0xCC,0x00,255,false };var RoyalBlue =Color {0x41,0x69,0xE1,255,false };var MediumSeaGreen =Color {0x3C,0xB3,0x71,255,false };var Linen =Color {0xFA,0xF0,0xE6,255,false };var Khaki =Color {0xF0,0xE6,0x8C,255,false };var PaleGoldenRod =Color {0xEE,0xE8,0xAA,255,false };var DeepSkyBlue =Color {0x00,0xBF,0xFF,255,false };var AliceBlue =Color {0xF0,0xF8,0xFF,255,false };var OliveDrab =Color {0x6B,0x8E,0x23,255,false };var SpringGreen =Color {0x00,0xFF,0x7F,255,false };var SaddleBrown =Color {0x8B,0x45,0x13,255,false };var SkyBlue =Color {0x87,0xCE,0xEB,255,false };var Gray =Color {0x80,0x80,0x80,255,false };var Cyan =Color {0x00,0xFF,0xFF,255,false };var RosyBrown =Color {0xBC,0x8F,0x8F,255,false };
|
||||
|
||||
// AsRGBAString is used by the various wrappers to return a pointer
|
||||
// to a string containing a six digit hex RGB value.
|
||||
func (_ef Color )AsRGBAString ()*string {return _dc .Stringf ("\u0025\u00302\u0078\u0025\u00302\u0078\u0025\u0030\u0032\u0078\u0025\u0030\u0032\u0078",_ef ._bg ,_ef ._e ,_ef ._b ,_ef ._ec );};var Brown =Color {0xA5,0x2A,0x2A,255,false };var RebeccaPurple =Color {0x66,0x33,0x99,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 Purple =Color {0x80,0x00,0x80,255,false };var PaleTurquoise =Color {0xAF,0xEE,0xEE,255,false };
|
||||
|
||||
// Color is a 24 bit color that can be converted to
|
||||
// internal ECMA-376 formats as needed.
|
||||
type Color struct{_e ,_b ,_ec ,_bg uint8 ;_f bool ;};var CornflowerBlue =Color {0x64,0x95,0xED,255,false };var Gainsboro =Color {0xDC,0xDC,0xDC,255,false };var MintCream =Color {0xF5,0xFF,0xFA,255,false };var DarkViolet =Color {0x94,0x00,0xD3,255,false };var Yellow =Color {0xFF,0xFF,0x00,255,false };var LightBlue =Color {0xAD,0xD8,0xE6,255,false };var DarkOrange =Color {0xFF,0x8C,0x00,255,false };var Orchid =Color {0xDA,0x70,0xD6,255,false };var Moccasin =Color {0xFF,0xE4,0xB5,255,false };var Snow =Color {0xFF,0xFA,0xFA,255,false };var GreenYellow =Color {0xAD,0xFF,0x2F,255,false };var White =Color {0xFF,0xFF,0xFF,255,false };var DarkGreen =Color {0x00,0x64,0x00,255,false };var YellowGreen =Color {0x9A,0xCD,0x32,255,false };var MediumBlue =Color {0x00,0x00,0xCD,255,false };var FloralWhite =Color {0xFF,0xFA,0xF0,255,false };var LightSlateGray =Color {0x77,0x88,0x99,255,false };var FireBrick =Color {0xB2,0x22,0x22,255,false };var Silver =Color {0xC0,0xC0,0xC0,255,false };var MediumAquaMarine =Color {0x66,0xCD,0xAA,255,false };var HoneyDew =Color {0xF0,0xFF,0xF0,255,false };var IndianRed =Color {0xCD,0x5C,0x5C,255,false };var Blue =Color {0x00,0x00,0xFF,255,false };var MediumVioletRed =Color {0xC7,0x15,0x85,255,false };var Aqua =Color {0x00,0xFF,0xFF,255,false };var Crimson =Color {0xDC,0x14,0x3C,255,false };var Black =Color {0x00,0x00,0x00,255,false };var SlateGray =Color {0x70,0x80,0x90,255,false };var LightGrey =Color {0xD3,0xD3,0xD3,255,false };var PaleGreen =Color {0x98,0xFB,0x98,255,false };var LightYellow =Color {0xFF,0xFF,0xE0,255,false };var LightGreen =Color {0x90,0xEE,0x90,255,false };var Teal =Color {0x00,0x80,0x80,255,false };var Wheat =Color {0xF5,0xDE,0xB3,255,false };var DarkSalmon =Color {0xE9,0x96,0x7A,255,false };
|
||||
package color ;import (_bf "fmt";_f "github.com/unidoc/unioffice";);var DimGrey =Color {0x69,0x69,0x69,255,false };var DarkMagenta =Color {0x8B,0x00,0x8B,255,false };var PaleGoldenRod =Color {0xEE,0xE8,0xAA,255,false };var GhostWhite =Color {0xF8,0xF8,0xFF,255,false };var FireBrick =Color {0xB2,0x22,0x22,255,false };var White =Color {0xFF,0xFF,0xFF,255,false };var LawnGreen =Color {0x7C,0xFC,0x00,255,false };var Beige =Color {0xF5,0xF5,0xDC,255,false };var Peru =Color {0xCD,0x85,0x3F,255,false };var PaleTurquoise =Color {0xAF,0xEE,0xEE,255,false };var Turquoise =Color {0x40,0xE0,0xD0,255,false };var LightSlateGrey =Color {0x77,0x88,0x99,255,false };var DarkViolet =Color {0x94,0x00,0xD3,255,false };var Purple =Color {0x80,0x00,0x80,255,false };var YellowGreen =Color {0x9A,0xCD,0x32,255,false };var AliceBlue =Color {0xF0,0xF8,0xFF,255,false };var LavenderBlush =Color {0xFF,0xF0,0xF5,255,false };var Brown =Color {0xA5,0x2A,0x2A,255,false };var Violet =Color {0xEE,0x82,0xEE,255,false };var MediumTurquoise =Color {0x48,0xD1,0xCC,255,false };var PowderBlue =Color {0xB0,0xE0,0xE6,255,false };var Thistle =Color {0xD8,0xBF,0xD8,255,false };var MintCream =Color {0xF5,0xFF,0xFA,255,false };var Plum =Color {0xDD,0xA0,0xDD,255,false };var Orchid =Color {0xDA,0x70,0xD6,255,false };var LightGray =Color {0xD3,0xD3,0xD3,255,false };var Coral =Color {0xFF,0x7F,0x50,255,false };var DarkSalmon =Color {0xE9,0x96,0x7A,255,false };var RoyalBlue =Color {0x41,0x69,0xE1,255,false };var DarkKhaki =Color {0xBD,0xB7,0x6B,255,false };var Azure =Color {0xF0,0xFF,0xFF,255,false };var SaddleBrown =Color {0x8B,0x45,0x13,255,false };var LightBlue =Color {0xAD,0xD8,0xE6,255,false };var AntiqueWhite =Color {0xFA,0xEB,0xD7,255,false };var Ivory =Color {0xFF,0xFF,0xF0,255,false };var Linen =Color {0xFA,0xF0,0xE6,255,false };var Bisque =Color {0xFF,0xE4,0xC4,255,false };var LightSkyBlue =Color {0x87,0xCE,0xFA,255,false };var CornflowerBlue =Color {0x64,0x95,0xED,255,false };var Aquamarine =Color {0x7F,0xFF,0xD4,255,false };var LightPink =Color {0xFF,0xB6,0xC1,255,false };var PaleGreen =Color {0x98,0xFB,0x98,255,false };var FloralWhite =Color {0xFF,0xFA,0xF0,255,false };var Indigo =Color {0x4B,0x00,0x82,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 LightPink =Color {0xFF,0xB6,0xC1,255,false };var Gold =Color {0xFF,0xD7,0x00,255,false };var Orange =Color {0xFF,0xA5,0x00,255,false };var Red =Color {0xFF,0x00,0x00,255,false };var DarkTurquoise =Color {0x00,0xCE,0xD1,255,false };var Indigo =Color {0x4B,0x00,0x82,255,false };var PowderBlue =Color {0xB0,0xE0,0xE6,255,false };var Violet =Color {0xEE,0x82,0xEE,255,false };var Pink =Color {0xFF,0xC0,0xCB,255,false };var Olive =Color {0x80,0x80,0x00,255,false };var SlateGrey =Color {0x70,0x80,0x90,255,false };var OrangeRed =Color {0xFF,0x45,0x00,255,false };var LightCyan =Color {0xE0,0xFF,0xFF,255,false };
|
||||
func RGBA (r ,g ,b ,a uint8 )Color {return Color {r ,g ,b ,a ,false }};var LightGreen =Color {0x90,0xEE,0x90,255,false };var LightGoldenRodYellow =Color {0xFA,0xFA,0xD2,255,false };var PapayaWhip =Color {0xFF,0xEF,0xD5,255,false };var Green =Color {0x00,0x80,0x00,255,false };var SlateBlue =Color {0x6A,0x5A,0xCD,255,false };var Teal =Color {0x00,0x80,0x80,255,false };var DarkSeaGreen =Color {0x8F,0xBC,0x8F,255,false };var MediumPurple =Color {0x93,0x70,0xDB,255,false };var Blue =Color {0x00,0x00,0xFF,255,false };var Pink =Color {0xFF,0xC0,0xCB,255,false };var LightGrey =Color {0xD3,0xD3,0xD3,255,false };var BurlyWood =Color {0xDE,0xB8,0x87,255,false };var LightSteelBlue =Color {0xB0,0xC4,0xDE,255,false };var PeachPuff =Color {0xFF,0xDA,0xB9,255,false };var Moccasin =Color {0xFF,0xE4,0xB5,255,false };var HoneyDew =Color {0xF0,0xFF,0xF0,255,false };var Magenta =Color {0xFF,0x00,0xFF,255,false };
|
||||
|
||||
// Color is a 24 bit color that can be converted to
|
||||
// internal ECMA-376 formats as needed.
|
||||
type Color struct{_fc ,_ff ,_g ,_c uint8 ;_gc bool ;};var DarkSlateBlue =Color {0x48,0x3D,0x8B,255,false };var Auto =Color {0,0,0,255,true };var RosyBrown =Color {0xBC,0x8F,0x8F,255,false };var RebeccaPurple =Color {0x66,0x33,0x99,255,false };var MediumSeaGreen =Color {0x3C,0xB3,0x71,255,false };var MidnightBlue =Color {0x19,0x19,0x70,255,false };var DarkSlateGray =Color {0x2F,0x4F,0x4F,255,false };var Yellow =Color {0xFF,0xFF,0x00,255,false };var LightCyan =Color {0xE0,0xFF,0xFF,255,false };var Snow =Color {0xFF,0xFA,0xFA,255,false };func FromHex (s string )Color {if len (s )==0{return Auto ;};if s [0]=='#'{s =s [1:];};var _a ,_ag ,_fd uint8 ;_fae ,_ :=_bf .Sscanf (s ,"\u0025\u0030\u0032x\u0025\u0030\u0032\u0078\u0025\u0030\u0032\u0078",&_a ,&_ag ,&_fd );if _fae ==3{return RGB (_a ,_ag ,_fd );};return Auto ;};var BlanchedAlmond =Color {0xFF,0xEB,0xCD,255,false };var CadetBlue =Color {0x5F,0x9E,0xA0,255,false };var MediumOrchid =Color {0xBA,0x55,0xD3,255,false };var DarkGray =Color {0xA9,0xA9,0xA9,255,false };var MediumAquaMarine =Color {0x66,0xCD,0xAA,255,false };var OliveDrab =Color {0x6B,0x8E,0x23,255,false };var SandyBrown =Color {0xF4,0xA4,0x60,255,false };var Lavender =Color {0xE6,0xE6,0xFA,255,false };var Silver =Color {0xC0,0xC0,0xC0,255,false };var LightCoral =Color {0xF0,0x80,0x80,255,false };
|
||||
|
||||
// AsRGBAString is used by the various wrappers to return a pointer
|
||||
// to a string containing a six digit hex RGB value.
|
||||
func (_bd Color )AsRGBAString ()*string {return _f .Stringf ("\u0025\u00302\u0078\u0025\u00302\u0078\u0025\u0030\u0032\u0078\u0025\u0030\u0032\u0078",_bd ._c ,_bd ._fc ,_bd ._ff ,_bd ._g );};var BlueViolet =Color {0x8A,0x2B,0xE2,255,false };var ForestGreen =Color {0x22,0x8B,0x22,255,false };
|
||||
|
||||
// AsRGBString is used by the various wrappers to return a pointer
|
||||
// to a string containing a six digit hex RGB value.
|
||||
func (_e Color )AsRGBString ()*string {return _f .Stringf ("\u0025\u0030\u0032x\u0025\u0030\u0032\u0078\u0025\u0030\u0032\u0078",_e ._fc ,_e ._ff ,_e ._g );};var HotPink =Color {0xFF,0x69,0xB4,255,false };var NavajoWhite =Color {0xFF,0xDE,0xAD,255,false };var MistyRose =Color {0xFF,0xE4,0xE1,255,false };var WhiteSmoke =Color {0xF5,0xF5,0xF5,255,false };var Black =Color {0x00,0x00,0x00,255,false };var Lime =Color {0x00,0xFF,0x00,255,false };var Salmon =Color {0xFA,0x80,0x72,255,false };var Gray =Color {0x80,0x80,0x80,255,false };var Navy =Color {0x00,0x00,0x80,255,false };var SlateGray =Color {0x70,0x80,0x90,255,false };var Crimson =Color {0xDC,0x14,0x3C,255,false };var LimeGreen =Color {0x32,0xCD,0x32,255,false };var DarkOrange =Color {0xFF,0x8C,0x00,255,false };var DarkGreen =Color {0x00,0x64,0x00,255,false };var LightSalmon =Color {0xFF,0xA0,0x7A,255,false };var Gainsboro =Color {0xDC,0xDC,0xDC,255,false };var SuccessGreen =Color {0x00,0xCC,0x00,255,false };var IndianRed =Color {0xCD,0x5C,0x5C,255,false };var SpringGreen =Color {0x00,0xFF,0x7F,255,false };var MediumSlateBlue =Color {0x7B,0x68,0xEE,255,false };
|
||||
|
||||
// IsAuto returns true if the color is the 'Auto' type. If the
|
||||
// field doesn't support an Auto color, then black is used.
|
||||
func (_fa Color )IsAuto ()bool {return _fa ._gc };var DarkOrchid =Color {0x99,0x32,0xCC,255,false };var DarkBlue =Color {0x00,0x00,0x8B,255,false };var SlateGrey =Color {0x70,0x80,0x90,255,false };var SeaGreen =Color {0x2E,0x8B,0x57,255,false };var DeepPink =Color {0xFF,0x14,0x93,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 Chocolate =Color {0xD2,0x69,0x1E,255,false };var GoldenRod =Color {0xDA,0xA5,0x20,255,false };var DarkGoldenRod =Color {0xB8,0x86,0x0B,255,false };var SeaShell =Color {0xFF,0xF5,0xEE,255,false };var Orange =Color {0xFF,0xA5,0x00,255,false };var Olive =Color {0x80,0x80,0x00,255,false };var DarkSlateGrey =Color {0x2F,0x4F,0x4F,255,false };var Khaki =Color {0xF0,0xE6,0x8C,255,false };var OldLace =Color {0xFD,0xF5,0xE6,255,false };var Chartreuse =Color {0x7F,0xFF,0x00,255,false };var DarkOliveGreen =Color {0x55,0x6B,0x2F,255,false };var DarkCyan =Color {0x00,0x8B,0x8B,255,false };var Sienna =Color {0xA0,0x52,0x2D,255,false };var DimGray =Color {0x69,0x69,0x69,255,false };var Aqua =Color {0x00,0xFF,0xFF,255,false };var DodgerBlue =Color {0x1E,0x90,0xFF,255,false };var Tan =Color {0xD2,0xB4,0x8C,255,false };var MediumSpringGreen =Color {0x00,0xFA,0x9A,255,false };var PaleVioletRed =Color {0xDB,0x70,0x93,255,false };var LightYellow =Color {0xFF,0xFF,0xE0,255,false };var Gold =Color {0xFF,0xD7,0x00,255,false };var Cyan =Color {0x00,0xFF,0xFF,255,false };var Cornsilk =Color {0xFF,0xF8,0xDC,255,false };var Red =Color {0xFF,0x00,0x00,255,false };var MediumVioletRed =Color {0xC7,0x15,0x85,255,false };var DarkGrey =Color {0xA9,0xA9,0xA9,255,false };var Fuchsia =Color {0xFF,0x00,0xFF,255,false };var LightSeaGreen =Color {0x20,0xB2,0xAA,255,false };var DarkRed =Color {0x8B,0x00,0x00,255,false };var Tomato =Color {0xFF,0x63,0x47,255,false };var GreenYellow =Color {0xAD,0xFF,0x2F,255,false };var DarkTurquoise =Color {0x00,0xCE,0xD1,255,false };var Wheat =Color {0xF5,0xDE,0xB3,255,false };var SteelBlue =Color {0x46,0x82,0xB4,255,false };var SkyBlue =Color {0x87,0xCE,0xEB,255,false };var LightSlateGray =Color {0x77,0x88,0x99,255,false };var DeepSkyBlue =Color {0x00,0xBF,0xFF,255,false };var OrangeRed =Color {0xFF,0x45,0x00,255,false };var Maroon =Color {0x80,0x00,0x00,255,false };var LemonChiffon =Color {0xFF,0xFA,0xCD,255,false };var MediumBlue =Color {0x00,0x00,0xCD,255,false };
|
237
common/axcontrol/axcontrol.go
Normal file
237
common/axcontrol/axcontrol.go
Normal file
File diff suppressed because one or more lines are too long
702
common/common.go
702
common/common.go
@ -13,401 +13,401 @@
|
||||
// OOXML document formats.
|
||||
//
|
||||
// Package common contains common properties used by the subpackages.
|
||||
package common ;import (_ef "archive/zip";_ee "bytes";_fb "encoding/xml";_ddc "errors";_gef "fmt";_eca "github.com/unidoc/unioffice";_bdg "github.com/unidoc/unioffice/common/logger";_eef "github.com/unidoc/unioffice/common/tempstorage";_bag "github.com/unidoc/unioffice/common/tempstorage/diskstore";_ga "github.com/unidoc/unioffice/measurement";_eb "github.com/unidoc/unioffice/schema/soo/dml";_da "github.com/unidoc/unioffice/schema/soo/ofc/custom_properties";_ed "github.com/unidoc/unioffice/schema/soo/ofc/docPropsVTypes";_ebe "github.com/unidoc/unioffice/schema/soo/ofc/extended_properties";_ec "github.com/unidoc/unioffice/schema/soo/pkg/content_types";_ba "github.com/unidoc/unioffice/schema/soo/pkg/metadata/core_properties";_gb "github.com/unidoc/unioffice/schema/soo/pkg/relationships";_fc "github.com/unidoc/unioffice/zippkg";_bd "image";_ "image/gif";_ "image/jpeg";_ "image/png";_dd "os";_b "reflect";_ge "regexp";_bef "strconv";_db "strings";_be "time";);func _bcf (_ead _be .Time ,_egf string )*_eca .XSDAny {_aea :=&_eca .XSDAny {XMLName :_fb .Name {Local :_egf }};_aea .Attrs =append (_aea .Attrs ,_fb .Attr {Name :_fb .Name {Local :"\u0078\u0073\u0069\u003a\u0074\u0079\u0070\u0065"},Value :"\u0064\u0063\u0074\u0065\u0072\u006d\u0073\u003a\u00573\u0043\u0044\u0054\u0046"});_aea .Attrs =append (_aea .Attrs ,_fb .Attr {Name :_fb .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"});_aea .Attrs =append (_aea .Attrs ,_fb .Attr {Name :_fb .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/"});_aea .Data =[]byte (_ead .Format (_cca ));return _aea ;};
|
||||
package common ;import (_da "archive/zip";_be "bytes";_cd "encoding/xml";_g "errors";_ea "fmt";_gg "github.com/unidoc/unioffice";_ebd "github.com/unidoc/unioffice/common/logger";_daf "github.com/unidoc/unioffice/common/tempstorage";_ge "github.com/unidoc/unioffice/common/tempstorage/diskstore";_eb "github.com/unidoc/unioffice/measurement";_cg "github.com/unidoc/unioffice/schema/soo/dml";_aeb "github.com/unidoc/unioffice/schema/soo/ofc/custom_properties";_gd "github.com/unidoc/unioffice/schema/soo/ofc/docPropsVTypes";_ec "github.com/unidoc/unioffice/schema/soo/ofc/extended_properties";_ag "github.com/unidoc/unioffice/schema/soo/pkg/content_types";_fc "github.com/unidoc/unioffice/schema/soo/pkg/metadata/core_properties";_agb "github.com/unidoc/unioffice/schema/soo/pkg/relationships";_fg "github.com/unidoc/unioffice/zippkg";_f "image";_ "image/gif";_ "image/jpeg";_ "image/png";_ae "os";_c "reflect";_bg "regexp";_de "strconv";_gf "strings";_ba "time";);
|
||||
|
||||
// Title returns the Title of the document
|
||||
func (_addb CoreProperties )Title ()string {if _addb ._dfe .Title !=nil {return string (_addb ._dfe .Title .Data );};return "";};
|
||||
|
||||
// CoreProperties contains document specific properties.
|
||||
type CoreProperties struct{_dfe *_ba .CoreProperties };
|
||||
|
||||
// Rows returns all table rows.
|
||||
func (_agbd Table )Rows ()[]*TableRow {_fbc :=_agbd ._bff .Tr ;_dbbc :=[]*TableRow {};for _ ,_fga :=range _fbc {_dbbc =append (_dbbc ,&TableRow {_edab :_fga });};return _dbbc ;};func (_gbf CustomProperties )SetPropertyAsLpstr (name string ,lpstr string ){_gfce :=_gbf .getNewProperty (name );_gfce .Lpstr =&lpstr ;_gbf .setOrReplaceProperty (_gfce );};
|
||||
|
||||
// Append appends DocBase part of an office document to another DocBase.
|
||||
func (_ea DocBase )Append (docBase1 DocBase )DocBase {_c :=docBase1 .ContentTypes .X ();for _ ,_bb :=range _c .Default {_ea .ContentTypes .AddDefault (_bb .ExtensionAttr ,_bb .ContentTypeAttr );};for _ ,_ab :=range _c .Override {_ea .ContentTypes .AddOverride (_ab .PartNameAttr ,_ab .ContentTypeAttr );};_fd :=_ea .AppProperties .X ();_efg :=docBase1 .AppProperties .X ();if _fd .Pages !=nil {if _efg .Pages !=nil {*_fd .Pages +=*_efg .Pages ;};}else if _efg .Pages !=nil {_fd .Pages =_efg .Pages ;};if _fd .Words !=nil {if _efg .Words !=nil {*_fd .Words +=*_efg .Words ;};}else if _efg .Words !=nil {_fd .Words =_efg .Words ;};if _fd .Characters !=nil {if _efg .Characters !=nil {*_fd .Characters +=*_efg .Characters ;};}else if _efg .Characters !=nil {_fd .Characters =_efg .Characters ;};if _fd .Lines !=nil {if _efg .Lines !=nil {*_fd .Lines +=*_efg .Lines ;};}else if _efg .Lines !=nil {_fd .Lines =_efg .Lines ;};if _fd .Paragraphs !=nil {if _efg .Paragraphs !=nil {*_fd .Paragraphs +=*_efg .Paragraphs ;};}else if _efg .Paragraphs !=nil {_fd .Paragraphs =_efg .Paragraphs ;};if _fd .Notes !=nil {if _efg .Notes !=nil {*_fd .Notes +=*_efg .Notes ;};}else if _efg .Notes !=nil {_fd .Notes =_efg .Notes ;};if _fd .HiddenSlides !=nil {if _efg .HiddenSlides !=nil {*_fd .HiddenSlides +=*_efg .HiddenSlides ;};}else if _efg .HiddenSlides !=nil {_fd .HiddenSlides =_efg .HiddenSlides ;};if _fd .MMClips !=nil {if _efg .MMClips !=nil {*_fd .MMClips +=*_efg .MMClips ;};}else if _efg .MMClips !=nil {_fd .MMClips =_efg .MMClips ;};if _fd .LinksUpToDate !=nil {if _efg .LinksUpToDate !=nil {*_fd .LinksUpToDate =*_fd .LinksUpToDate &&*_efg .LinksUpToDate ;};}else if _efg .LinksUpToDate !=nil {_fd .LinksUpToDate =_efg .LinksUpToDate ;};if _fd .CharactersWithSpaces !=nil {if _efg .CharactersWithSpaces !=nil {*_fd .CharactersWithSpaces +=*_efg .CharactersWithSpaces ;};}else if _efg .CharactersWithSpaces !=nil {_fd .CharactersWithSpaces =_efg .CharactersWithSpaces ;};if _fd .SharedDoc !=nil {if _efg .SharedDoc !=nil {*_fd .SharedDoc =*_fd .SharedDoc ||*_efg .SharedDoc ;};}else if _efg .SharedDoc !=nil {_fd .SharedDoc =_efg .SharedDoc ;};if _fd .HyperlinksChanged !=nil {if _efg .HyperlinksChanged !=nil {*_fd .HyperlinksChanged =*_fd .HyperlinksChanged ||*_efg .HyperlinksChanged ;};}else if _efg .HyperlinksChanged !=nil {_fd .HyperlinksChanged =_efg .HyperlinksChanged ;};_fd .DigSig =nil ;if _fd .TitlesOfParts ==nil &&_efg .TitlesOfParts !=nil {_fd .TitlesOfParts =_efg .TitlesOfParts ;};if _fd .HeadingPairs !=nil {if _efg .HeadingPairs !=nil {_fg :=_fd .HeadingPairs .Vector ;_eaf :=_efg .HeadingPairs .Vector ;_bf :=_fg .Variant ;_dg :=_eaf .Variant ;_ad :=[]*_ed .Variant {};for _ce :=0;_ce < len (_dg );_ce +=2{_ca :=_dg [_ce ].Lpstr ;_cf :=false ;for _dbg :=0;_dbg < len (_bf );_dbg +=2{_add :=_bf [_dbg ].Lpstr ;if _add !=nil &&_ca !=nil &&*_add ==*_ca {*_bf [_dbg +1].I4 =*_bf [_dbg +1].I4 +*_dg [_ce +1].I4 ;_cf =true ;break ;};};if !_cf {_ad =append (_ad ,&_ed .Variant {CT_Variant :_ed .CT_Variant {Lpstr :_dg [_ce ].Lpstr }});_ad =append (_ad ,&_ed .Variant {CT_Variant :_ed .CT_Variant {I4 :_dg [_ce ].I4 }});};};_bf =append (_bf ,_ad ...);_fg .SizeAttr =uint32 (len (_bf ));};}else if _efg .HeadingPairs !=nil {_fd .HeadingPairs =_efg .HeadingPairs ;};if _fd .HLinks !=nil {if _efg .HLinks !=nil {_df :=_fd .HLinks .Vector ;_bg :=_efg .HLinks .Vector ;_cg :=_df .Variant ;_fda :=_bg .Variant ;for _ ,_gf :=range _fda {_gad :=true ;for _ ,_eeb :=range _cg {if _b .DeepEqual (_eeb ,_gf ){_gad =false ;break ;};};if _gad {_cg =append (_cg ,_gf );_df .SizeAttr ++;};};};}else if _efg .HLinks !=nil {_fd .HLinks =_efg .HLinks ;};_cb :=_ea .GetOrCreateCustomProperties ();_ff :=docBase1 .GetOrCreateCustomProperties ();for _ ,_bgd :=range _ff .PropertiesList (){_cb .setProperty (_bgd );};_ea .CustomProperties =_cb ;_dgg :=_ea .Rels .X ().Relationship ;for _ ,_gae :=range docBase1 .Rels .X ().Relationship {_ffe :=true ;for _ ,_eg :=range _dgg {if _eg .TargetAttr ==_gae .TargetAttr &&_eg .TypeAttr ==_gae .TypeAttr {_ffe =false ;break ;};};if _ffe {_ea .Rels .AddRelationship (_gae .TargetAttr ,_gae .TypeAttr );};};for _ ,_gd :=range docBase1 .ExtraFiles {_fe :=_gd .ZipPath ;_dgf :=true ;for _ ,_aa :=range _ea .ExtraFiles {if _aa .ZipPath ==_fe {_dgf =false ;break ;};};if _dgf {_ea .ExtraFiles =append (_ea .ExtraFiles ,_gd );};};return _ea ;};func (_ceg CustomProperties )setProperty (_eeg *_da .CT_Property ){_ceg .setPropertyHelper (_eeg ,false )};
|
||||
|
||||
// SetLanguage records the language of the document.
|
||||
func (_gba CoreProperties )SetLanguage (s string ){_gba ._dfe .Language =&_eca .XSDAny {XMLName :_fb .Name {Local :"d\u0063\u003a\u006c\u0061\u006e\u0067\u0075\u0061\u0067\u0065"}};_gba ._dfe .Language .Data =[]byte (s );};
|
||||
|
||||
// RemoveOverrideByIndex removes an override given a path and override index.
|
||||
func (_ae ContentTypes )RemoveOverrideByIndex (path string ,indexToFind int )error {_cge :=path [0:len (path )-5];if !_db .HasPrefix (_cge ,"\u002f"){_cge ="\u002f"+_cge ;};_gcb ,_cea :=_ge .Compile (_cge +"\u0028\u005b\u0030-\u0039\u005d\u002b\u0029\u002e\u0078\u006d\u006c");if _cea !=nil {return _cea ;};_bac :=0;_fee :=-1;for _bae ,_edae :=range _ae ._beg .Override {if _eebc :=_gcb .FindStringSubmatch (_edae .PartNameAttr );len (_eebc )> 1{if _bac ==indexToFind {_fee =_bae ;}else if _bac > indexToFind {_bbc ,_ :=_bef .Atoi (_eebc [1]);_bbc --;_edae .PartNameAttr =_gef .Sprintf ("\u0025\u0073\u0025\u0064\u002e\u0078\u006d\u006c",_cge ,_bbc );};_bac ++;};};if _fee > -1{copy (_ae ._beg .Override [_fee :],_ae ._beg .Override [_fee +1:]);_ae ._beg .Override =_ae ._beg .Override [0:len (_ae ._beg .Override )-1];};return nil ;};
|
||||
|
||||
// LastModifiedBy returns the name of the last person to modify the document
|
||||
func (_ecf CoreProperties )LastModifiedBy ()string {if _ecf ._dfe .LastModifiedBy !=nil {return *_ecf ._dfe .LastModifiedBy ;};return "";};
|
||||
|
||||
// SetDocSecurity sets the document security flag.
|
||||
func (_gefb AppProperties )SetDocSecurity (v int32 ){_gefb ._ade .DocSecurity =_eca .Int32 (v )};
|
||||
|
||||
// ContentTypes is the top level "[Content_Types].xml" in a zip package.
|
||||
type ContentTypes struct{_beg *_ec .Types };
|
||||
|
||||
// Properties returns table properties.
|
||||
func (_cga Table )Properties ()*_eb .CT_TableProperties {return _cga ._bff .TblPr };
|
||||
|
||||
// PropertiesList returns the list of all custom properties of the document.
|
||||
func (_gee CustomProperties )PropertiesList ()[]*_da .CT_Property {return _gee ._dag .Property };
|
||||
// Hyperlink is just an appropriately configured relationship.
|
||||
type Hyperlink Relationship ;
|
||||
|
||||
// SetCategory records the category of the document.
|
||||
func (_eaa CoreProperties )SetCategory (s string ){_eaa ._dfe .Category =&s };
|
||||
func (_fdfa CoreProperties )SetCategory (s string ){_fdfa ._ggf .Category =&s };
|
||||
|
||||
// Author returns the author of the document
|
||||
func (_edg CoreProperties )Author ()string {if _edg ._dfe .Creator !=nil {return string (_edg ._dfe .Creator .Data );};return "";};
|
||||
// Description returns the description of the document
|
||||
func (_cca CoreProperties )Description ()string {if _cca ._ggf .Description !=nil {return string (_cca ._ggf .Description .Data );};return "";};
|
||||
|
||||
// SetTitle records the title of the document.
|
||||
func (_dca CoreProperties )SetTitle (s string ){if _dca ._dfe .Title ==nil {_dca ._dfe .Title =&_eca .XSDAny {XMLName :_fb .Name {Local :"\u0064\u0063\u003a\u0074\u0069\u0074\u006c\u0065"}};};_dca ._dfe .Title .Data =[]byte (s );};
|
||||
|
||||
// AddCustomRelationships adds relationships related to custom properties to the document.
|
||||
func (_ddbg *DocBase )AddCustomRelationships (){_ddbg .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");_ddbg .Rels .AddRelationship ("\u0064\u006f\u0063\u0050ro\u0070\u0073\u002f\u0063\u0075\u0073\u0074\u006f\u006d\u002e\u0078\u006d\u006c",_eca .CustomPropertiesType );};
|
||||
|
||||
// NewCustomProperties constructs a new CustomProperties.
|
||||
func NewCustomProperties ()CustomProperties {return CustomProperties {_dag :_da .NewProperties ()}};
|
||||
|
||||
// SetHeight sets row height, see measurement package.
|
||||
func (_cdce TableRow )SetHeight (m _ga .Distance ){_aced :=_ga .ToEMU (float64 (m ));_cdce ._edab .HAttr =_eb .ST_Coordinate {ST_CoordinateUnqualified :&_aced };};
|
||||
|
||||
// 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 (_gbeb *DocBase )AddExtraFileFromZip (f *_ef .File )error {_efc ,_bfg :=_fc .ExtractToDiskTmp (f ,_gbeb .TmpPath );if _bfg !=nil {return _gef .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",_bfg );};_gbeb .ExtraFiles =append (_gbeb .ExtraFiles ,ExtraFile {ZipPath :f .Name ,DiskPath :_efc });return nil ;};
|
||||
|
||||
// Path returns the path to an image file, if any.
|
||||
func (_efe ImageRef )Path ()string {return _efe ._cgg .Path };
|
||||
|
||||
// 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 {_cgg :img ,_bfbf :d ,_gbfe :rels };};func (_cff CustomProperties )SetPropertyAsUint (name string ,ui uint ){_ddg :=_cff .getNewProperty (name );_gfc :=uint32 (ui );_ddg .Uint =&_gfc ;_cff .setOrReplaceProperty (_ddg );};
|
||||
|
||||
// GetPropertyByName returns a custom property selected by it's name.
|
||||
func (_bfb CustomProperties )GetPropertyByName (name string )CustomProperty {_fgg :=_bfb ._dag .Property ;for _ ,_fccd :=range _fgg {if *_fccd .NameAttr ==name {return CustomProperty {_eag :_fccd };};};return CustomProperty {};};
|
||||
|
||||
// Relationship is a relationship within a .rels file.
|
||||
type Relationship struct{_gaac *_gb .Relationship };
|
||||
|
||||
// SetCompany sets the name of the company that created the document.
|
||||
func (_cgb AppProperties )SetCompany (s string ){_cgb ._ade .Company =&s };
|
||||
|
||||
// NewTableWithXfrm makes a new table with a pointer to its parent Xfrm for changing its offset and size.
|
||||
func NewTableWithXfrm (xfrm *_eb .CT_Transform2D )*Table {_bece :=_eb .NewTbl ();_bece .TblPr =_eb .NewCT_TableProperties ();return &Table {_bff :_bece ,_ebd :xfrm };};func (_bgg CustomProperties )setOrReplaceProperty (_cda *_da .CT_Property ){_bgg .setPropertyHelper (_cda ,true );};func (_cac CustomProperties )SetPropertyAsInt (name string ,i int ){_gfg :=_cac .getNewProperty (name );_ceb :=int32 (i );_gfg .Int =&_ceb ;_cac .setOrReplaceProperty (_gfg );};
|
||||
|
||||
// RelID returns the relationship ID.
|
||||
func (_befb ImageRef )RelID ()string {return _befb ._edcg };
|
||||
|
||||
// SetAuthor records the author of the document.
|
||||
func (_gca CoreProperties )SetAuthor (s string ){if _gca ._dfe .Creator ==nil {_gca ._dfe .Creator =&_eca .XSDAny {XMLName :_fb .Name {Local :"\u0064\u0063\u003a\u0063\u0072\u0065\u0061\u0074\u006f\u0072"}};};_gca ._dfe .Creator .Data =[]byte (s );};const _ddbgg =2021;func (_edaeg CustomProperties )getNewProperty (_gec string )*_da .CT_Property {_gfa :=_edaeg ._dag .Property ;_cag :=int32 (1);for _ ,_gebe :=range _gfa {if _gebe .PidAttr > _cag {_cag =_gebe .PidAttr ;};};_de :=_da .NewCT_Property ();_de .NameAttr =&_gec ;_de .PidAttr =_cag +1;_de .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 _de ;};func (_fbd CustomProperties )SetPropertyAsArray (name string ,array *_ed .Array ){_dcg :=_fbd .getNewProperty (name );_dcg .Array =array ;_fbd .setOrReplaceProperty (_dcg );};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_baa CustomProperties )X ()*_da .Properties {return _baa ._dag };
|
||||
|
||||
// Table represents a table in the document.
|
||||
type Table struct{_bff *_eb .Tbl ;_ebd *_eb .CT_Transform2D ;};
|
||||
|
||||
// AddDefault registers a default content type for a given file extension.
|
||||
func (_ecgg ContentTypes )AddDefault (fileExtension string ,contentType string ){fileExtension =_db .ToLower (fileExtension );for _ ,_geb :=range _ecgg ._beg .Default {if _geb .ExtensionAttr ==fileExtension &&_geb .ContentTypeAttr ==contentType {return ;};};_ag :=_ec .NewDefault ();_ag .ExtensionAttr =fileExtension ;_ag .ContentTypeAttr =contentType ;_ecgg ._beg .Default =append (_ecgg ._beg .Default ,_ag );};
|
||||
|
||||
// SetApplication sets the name of the application that created the document.
|
||||
func (_ege AppProperties )SetApplication (s string ){_ege ._ade .Application =&s };
|
||||
|
||||
// NewContentTypes returns a wrapper around a newly constructed content-types.
|
||||
func NewContentTypes ()ContentTypes {_gdg :=ContentTypes {_beg :_ec .NewTypes ()};_gdg .AddDefault ("\u0078\u006d\u006c","\u0061p\u0070l\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u0078\u006d\u006c");_gdg .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");_gdg .AddDefault ("\u0070\u006e\u0067","\u0069m\u0061\u0067\u0065\u002f\u0070\u006eg");_gdg .AddDefault ("\u006a\u0070\u0065\u0067","\u0069\u006d\u0061\u0067\u0065\u002f\u006a\u0070\u0065\u0067");_gdg .AddDefault ("\u006a\u0070\u0067","\u0069m\u0061\u0067\u0065\u002f\u006a\u0070g");_gdg .AddDefault ("\u0077\u006d\u0066","i\u006d\u0061\u0067\u0065\u002f\u0078\u002d\u0077\u006d\u0066");_gdg .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");_gdg .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 _gdg ;};
|
||||
|
||||
// NewRelationship constructs a new relationship.
|
||||
func NewRelationship ()Relationship {return Relationship {_gaac :_gb .NewRelationship ()}};
|
||||
|
||||
// GetByRelId returns a relationship with the associated relation ID.
|
||||
func (_cdcc Relationships )GetByRelId (idAttr string )Relationship {for _ ,_dcce :=range _cdcc ._cdba .Relationship {if _dcce .IdAttr ==idAttr {return Relationship {_gaac :_dcce };};};return Relationship {};};func (_afe CustomProperties )SetPropertyAsBool (name string ,b bool ){_gdb :=_afe .getNewProperty (name );_gdb .Bool =&b ;_afe .setOrReplaceProperty (_gdb );};
|
||||
|
||||
// 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 (_fcbga Relationships )AddAutoRelationship (dt _eca .DocType ,src string ,idx int ,ctype string )Relationship {return _fcbga .AddRelationship (_eca .RelativeFilename (dt ,src ,ctype ,idx ),ctype );};func (_aceb CustomProperties )SetPropertyAsStorage (name string ,storage string ){_cdf :=_aceb .getNewProperty (name );_cdf .Storage =&storage ;_aceb .setOrReplaceProperty (_cdf );};func (_ggg CustomProperties )setPropertyHelper (_cdcd *_da .CT_Property ,_ccf bool ){_gbe :=_ggg .GetPropertyByName (*_cdcd .NameAttr );if (_gbe ==CustomProperty {}){_ggg ._dag .Property =append (_ggg ._dag .Property ,_cdcd );}else if _ccf {_cdcd .FmtidAttr =_gbe ._eag .FmtidAttr ;if _gbe ._eag .PidAttr ==0{_cdcd .PidAttr =_gbe ._eag .PidAttr ;};_cdcd .LinkTargetAttr =_gbe ._eag .LinkTargetAttr ;*_gbe ._eag =*_cdcd ;};};
|
||||
|
||||
// GetTargetByRelId returns a target path with the associated relation ID.
|
||||
func (_ceaf Relationships )GetTargetByRelId (idAttr string )string {for _ ,_gdgg :=range _ceaf ._cdba .Relationship {if _gdgg .IdAttr ==idAttr {return _gdgg .TargetAttr ;};};return "";};func (_dbb CustomProperties )SetPropertyAsI1 (name string ,i1 int8 ){_afa :=_dbb .getNewProperty (name );_afa .I1 =&i1 ;_dbb .setOrReplaceProperty (_afa );};
|
||||
|
||||
// Size returns the size of an image
|
||||
func (_bbf ImageRef )Size ()_bd .Point {return _bbf ._cgg .Size };const _ccg ="\u0032\u0020\u004aan\u0075\u0061\u0072\u0079\u0020\u0032\u0030\u0030\u0036\u0020\u0061\u0074\u0020\u0031\u0035\u003a\u0030\u0034";
|
||||
|
||||
// AddCol adds a column to a table.
|
||||
func (_afca Table )AddCol ()*TableCol {_dce :=_eb .NewCT_TableCol ();_afca ._bff .TblGrid .GridCol =append (_afca ._bff .TblGrid .GridCol ,_dce );for _ ,_gcf :=range _afca ._bff .Tr {_edaf :=_eb .NewCT_TableCell ();_gcf .Tc =append (_gcf .Tc ,_edaf );};return &TableCol {_bggc :_dce };};func (_ebee CustomProperties )SetPropertyAsDecimal (name string ,decimal float64 ){_gaba :=_ebee .getNewProperty (name );_gaba .Decimal =&decimal ;_ebee .setOrReplaceProperty (_gaba );};
|
||||
|
||||
// EnsureDefault esnures that an extension and default content type exist,
|
||||
// adding it if necessary.
|
||||
func (_bdb ContentTypes )EnsureDefault (ext ,contentType string ){ext =_db .ToLower (ext );for _ ,_dgb :=range _bdb ._beg .Default {if _dgb .ExtensionAttr ==ext {_dgb .ContentTypeAttr =contentType ;return ;};};_gag :=&_ec .Default {};_gag .ContentTypeAttr =contentType ;_gag .ExtensionAttr =ext ;_bdb ._beg .Default =append (_bdb ._beg .Default ,_gag );};
|
||||
|
||||
// NewAppProperties constructs a new AppProperties.
|
||||
func NewAppProperties ()AppProperties {_caf :=AppProperties {_ade :_ebe .NewProperties ()};_caf .SetCompany ("\u0046\u006f\u0078\u0079\u0055\u0074\u0069\u006c\u0073\u0020\u0065\u0068\u0066");_caf .SetApplication ("g\u0069\u0074\u0068\u0075\u0062\u002ec\u006f\u006d\u002f\u0075\u006e\u0069\u0064\u006f\u0063/\u0075\u006e\u0069o\u0066f\u0069\u0063\u0065");_caf .SetDocSecurity (0);_caf .SetLinksUpToDate (false );var _cc ,_aab ,_fge int64 ;_gef .Sscanf (Version ,"\u0025\u0064\u002e\u0025\u0064\u002e\u0025\u0064",&_cc ,&_aab ,&_fge );_gea :=float64 (_cc )+float64 (_aab )/10000.0;_caf .SetApplicationVersion (_gef .Sprintf ("\u0025\u0030\u0037\u002e\u0034\u0066",_gea ));return _caf ;};
|
||||
|
||||
// X returns the inner raw content types.
|
||||
func (_bab ContentTypes )X ()*_ec .Types {return _bab ._beg };
|
||||
|
||||
// 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 _bd .Image ;Images []ImageRef ;ExtraFiles []ExtraFile ;TmpPath string ;};func (_ece CustomProperties )SetPropertyAsOblob (name ,oblob string ){_cdb :=_ece .getNewProperty (name );_cdb .Oblob =&oblob ;_ece .setOrReplaceProperty (_cdb );};
|
||||
|
||||
// NewRelationships creates a new relationship wrapper.
|
||||
func NewRelationships ()Relationships {return Relationships {_cdba :_gb .NewRelationships ()}};func (_cee CustomProperties )SetPropertyAsError (name string ,error string ){_cae :=_cee .getNewProperty (name );_cae .Error =&error ;_cee .setOrReplaceProperty (_cae );};func (_aeac CustomProperties )SetPropertyAsClsid (name string ,clsid string ){_befg :=_aeac .getNewProperty (name );_befg .Clsid =&clsid ;_aeac .setOrReplaceProperty (_befg );};func (_dcf CustomProperties )SetPropertyAsFiletime (name string ,filetime _be .Time ){_dfg :=_dcf .getNewProperty (name );_dfg .Filetime =&filetime ;_dcf .setOrReplaceProperty (_dfg );};
|
||||
|
||||
// Category returns the category of the document
|
||||
func (_ede CoreProperties )Category ()string {if _ede ._dfe .Category !=nil {return *_ede ._dfe .Category ;};return "";};
|
||||
|
||||
// CreateCustomProperties creates the custom properties of the document.
|
||||
func (_edda *DocBase )CreateCustomProperties (){_edda .CustomProperties =NewCustomProperties ();_edda .AddCustomRelationships ();};
|
||||
|
||||
// SetWidth sets column width, see measurement package.
|
||||
func (_becd TableCol )SetWidth (m _ga .Distance ){_edada :=_ga .ToEMU (float64 (m ));_becd ._bggc .WAttr =_eb .ST_Coordinate {ST_CoordinateUnqualified :&_edada };};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_cfg Theme )X ()*_eb .Theme {return _cfg ._bdbf };
|
||||
|
||||
// AddOverride adds an override content type for a given path name.
|
||||
func (_fag ContentTypes )AddOverride (path ,contentType string ){if !_db .HasPrefix (path ,"\u002f"){path ="\u002f"+path ;};if _db .HasPrefix (contentType ,"\u0068\u0074\u0074\u0070"){_bdg .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 _ ,_cgbf :=range _fag ._beg .Override {if _cgbf .PartNameAttr ==path &&_cgbf .ContentTypeAttr ==contentType {return ;};};_fae :=_ec .NewOverride ();_fae .PartNameAttr =path ;_fae .ContentTypeAttr =contentType ;_fag ._beg .Override =append (_fag ._beg .Override ,_fae );};func (_dfd CustomProperties )SetPropertyAsCy (name string ,cy string ){_faf :=_dfd .getNewProperty (name );_faf .Cy =&cy ;_dfd .setOrReplaceProperty (_faf );};
|
||||
|
||||
// SetApplicationVersion sets the version of the application that created the
|
||||
// document. Per MS, the verison string mut be in the form 'XX.YYYY'.
|
||||
func (_cef AppProperties )SetApplicationVersion (s string ){_cef ._ade .AppVersion =&s };
|
||||
|
||||
// ApplicationVersion returns the version of the application that created the
|
||||
// document.
|
||||
func (_fcb AppProperties )ApplicationVersion ()string {if _fcb ._ade .AppVersion !=nil {return *_fcb ._ade .AppVersion ;};return "";};const _cca ="2\u00300\u0036\u002d\u0030\u0031\u002d\u0030\u0032\u00541\u0035\u003a\u0030\u0034:0\u0035\u005a";
|
||||
|
||||
// SetStyle assigns TableStyle to a table.
|
||||
func (_afg Table )SetStyle (style *_eb .CT_TableStyle ){if _afg ._bff .TblPr ==nil {_afg ._bff .TblPr =_eb .NewCT_TableProperties ();};if _afg ._bff .TblPr .Choice ==nil {_afg ._bff .TblPr .Choice =_eb .NewCT_TablePropertiesChoice ();};_afg ._bff .TblPr .Choice .TableStyle =style ;};
|
||||
|
||||
// Target returns the target attrubute of the image reference (a path where the image file is located in the document structure).
|
||||
func (_dfgb *ImageRef )Target ()string {return _dfgb ._fcbg };func (_ddf CustomProperties )SetPropertyAsOstream (name string ,ostream string ){_gdf :=_ddf .getNewProperty (name );_gdf .Ostream =&ostream ;_ddf .setOrReplaceProperty (_gdf );};
|
||||
|
||||
// SetID set the ID of a relationship.
|
||||
func (_eff Relationship )SetID (ID string ){_eff ._gaac .IdAttr =ID ;};func (_aeg CustomProperties )SetPropertyAsI2 (name string ,i2 int16 ){_acc :=_aeg .getNewProperty (name );_acc .I2 =&i2 ;_aeg .setOrReplaceProperty (_acc );};func (_dbd CustomProperties )SetPropertyAsUi8 (name string ,ui8 uint64 ){_fca :=_dbd .getNewProperty (name );_fca .Ui8 =&ui8 ;_dbd .setOrReplaceProperty (_fca );};func (_ggca *ImageRef )SetRelID (id string ){_ggca ._edcg =id };func (_afc CustomProperties )SetPropertyAsI8 (name string ,i8 int64 ){_abb :=_afc .getNewProperty (name );_abb .I8 =&i8 ;_afc .setOrReplaceProperty (_abb );};
|
||||
// SetTarget set the target (path) of a relationship.
|
||||
func (_eab Relationship )SetTarget (s string ){_eab ._egfa .TargetAttr =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 ){_edad ,_fde :=_dd .Open (path );_edce :=Image {};if _fde !=nil {return _edce ,_gef .Errorf ("\u0065\u0072\u0072or\u0020\u0072\u0065\u0061\u0064\u0069\u006e\u0067\u0020\u0069\u006d\u0061\u0067\u0065\u003a\u0020\u0025\u0073",_fde );};defer _edad .Close ();_baec ,_cfe ,_fde :=_bd .Decode (_edad );if _fde !=nil {return _edce ,_gef .Errorf ("\u0075n\u0061\u0062\u006c\u0065 \u0074\u006f\u0020\u0070\u0061r\u0073e\u0020i\u006d\u0061\u0067\u0065\u003a\u0020\u0025s",_fde );};_edce .Path =path ;_edce .Format =_cfe ;_edce .Size =_baec .Bounds ().Size ();return _edce ,nil ;};func UtcTimeFormat (t _be .Time )string {return t .Format (_ccg )+"\u0020\u0055\u0054\u0043"};
|
||||
func ImageFromFile (path string )(Image ,error ){_fdda ,_dfbf :=_ae .Open (path );_bbg :=Image {};if _dfbf !=nil {return _bbg ,_ea .Errorf ("\u0065\u0072\u0072or\u0020\u0072\u0065\u0061\u0064\u0069\u006e\u0067\u0020\u0069\u006d\u0061\u0067\u0065\u003a\u0020\u0025\u0073",_dfbf );};defer _fdda .Close ();_ddba ,_edd ,_dfbf :=_f .Decode (_fdda );if _dfbf !=nil {return _bbg ,_ea .Errorf ("\u0075n\u0061\u0062\u006c\u0065 \u0074\u006f\u0020\u0070\u0061r\u0073e\u0020i\u006d\u0061\u0067\u0065\u003a\u0020\u0025s",_dfbf );};_bbg .Path =path ;_bbg .Format =_edd ;_bbg .Size =_ddba .Bounds ().Size ();return _bbg ,nil ;};
|
||||
|
||||
// SetTarget set the target (path) of a relationship.
|
||||
func (_bge Relationship )SetTarget (s string ){_bge ._gaac .TargetAttr =s };func (_cbd CustomProperties )SetPropertyAsUi2 (name string ,ui2 uint16 ){_egg :=_cbd .getNewProperty (name );_egg .Ui2 =&ui2 ;_cbd .setOrReplaceProperty (_egg );};
|
||||
// SetOffsetY sets vertical offset of a table in distance units (see measurement package).
|
||||
func (_fbcd Table )SetOffsetY (offY float64 ){if _fbcd ._cff .Off ==nil {_fbcd ._cff .Off =_cg .NewCT_Point2D ();_bgd :=int64 (0);_fbcd ._cff .Off .XAttr =_cg .ST_Coordinate {ST_CoordinateUnqualified :&_bgd };};_dbgg :=_eb .ToEMU (offY );_fbcd ._cff .Off .YAttr =_cg .ST_Coordinate {ST_CoordinateUnqualified :&_dbgg };};func (_cfc CustomProperties )SetPropertyAsR8 (name string ,r8 float64 ){_feg :=_cfc .getNewProperty (name );_feg .R8 =&r8 ;_cfc .setOrReplaceProperty (_feg );};
|
||||
|
||||
// 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 (_fce ImageRef )RelativeWidth (h _ga .Distance )_ga .Distance {_gbab :=float64 (_fce .Size ().X )/float64 (_fce .Size ().Y );return h *_ga .Distance (_gbab );};
|
||||
// RelID returns the relationship ID.
|
||||
func (_cee ImageRef )RelID ()string {return _cee ._ddb };
|
||||
|
||||
// AddImageToZip adds an image (either from bytes or from disk) and adds it to the zip file.
|
||||
func AddImageToZip (z *_ef .Writer ,img ImageRef ,imageNum int ,dt _eca .DocType )error {_gadg :=_eca .AbsoluteImageFilename (dt ,imageNum ,_db .ToLower (img .Format ()));if img .Data ()!=nil &&len (*img .Data ())> 0{if _dcaf :=_fc .AddFileFromBytes (z ,_gadg ,*img .Data ());_dcaf !=nil {return _dcaf ;};}else if img .Path ()!=""{if _efdd :=_fc .AddFileFromDisk (z ,_gadg ,img .Path ());_efdd !=nil {return _efdd ;};}else {return _gef .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 ;};var _gfgd =_ddc .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");
|
||||
// ContentTypes is the top level "[Content_Types].xml" in a zip package.
|
||||
type ContentTypes struct{_cc *_ag .Types };func (_gcd CustomProperties )SetPropertyAsUi1 (name string ,ui1 uint8 ){_cbdga :=_gcd .getNewProperty (name );_cbdga .Ui1 =&ui1 ;_gcd .setOrReplaceProperty (_cbdga );};
|
||||
|
||||
// Data returns the data of an image file, if any.
|
||||
func (_edf ImageRef )Data ()*[]byte {return _edf ._cea .Data };
|
||||
|
||||
// NewTable makes a new table.
|
||||
func NewTable ()*Table {_dbf :=_eb .NewTbl ();_dbf .TblPr =_eb .NewCT_TableProperties ();return &Table {_bff :_dbf };};
|
||||
func NewTable ()*Table {_adb :=_cg .NewTbl ();_adb .TblPr =_cg .NewCT_TableProperties ();return &Table {_dfd :_adb };};
|
||||
|
||||
// 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 ){_dccg :=Image {};_agd ,_egc :=_eef .Open (path );if _egc !=nil {return _dccg ,_gef .Errorf ("\u0065\u0072\u0072or\u0020\u0072\u0065\u0061\u0064\u0069\u006e\u0067\u0020\u0069\u006d\u0061\u0067\u0065\u003a\u0020\u0025\u0073",_egc );};defer _agd .Close ();_bec ,_fgb ,_egc :=_bd .Decode (_agd );if _egc !=nil {return _dccg ,_gef .Errorf ("\u0075n\u0061\u0062\u006c\u0065 \u0074\u006f\u0020\u0070\u0061r\u0073e\u0020i\u006d\u0061\u0067\u0065\u003a\u0020\u0025s",_egc );};_dccg .Path =path ;_dccg .Format =_fgb ;_dccg .Size =_bec .Bounds ().Size ();return _dccg ,nil ;};
|
||||
// SetAuthor records the author of the document.
|
||||
func (_gae CoreProperties )SetAuthor (s string ){if _gae ._ggf .Creator ==nil {_gae ._ggf .Creator =&_gg .XSDAny {XMLName :_cd .Name {Local :"\u0064\u0063\u003a\u0063\u0072\u0065\u0061\u0074\u006f\u0072"}};};_gae ._ggf .Creator .Data =[]byte (s );};
|
||||
|
||||
// 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 (_fcea *ImageRef )SetTarget (target string ){_fcea ._fcbg =target };
|
||||
// NewAppProperties constructs a new AppProperties.
|
||||
func NewAppProperties ()AppProperties {_fb :=AppProperties {_fgg :_ec .NewProperties ()};_fb .SetCompany ("\u0046\u006f\u0078\u0079\u0055\u0074\u0069\u006c\u0073\u0020\u0065\u0068\u0066");_fb .SetApplication ("g\u0069\u0074\u0068\u0075\u0062\u002ec\u006f\u006d\u002f\u0075\u006e\u0069\u0064\u006f\u0063/\u0075\u006e\u0069o\u0066f\u0069\u0063\u0065");_fb .SetDocSecurity (0);_fb .SetLinksUpToDate (false );var _cdd ,_fbb ,_ggc int64 ;_ea .Sscanf (Version ,"\u0025\u0064\u002e\u0025\u0064\u002e\u0025\u0064",&_cdd ,&_fbb ,&_ggc );_gaf :=float64 (_cdd )+float64 (_fbb )/10000.0;_fb .SetApplicationVersion (_ea .Sprintf ("\u0025\u0030\u0037\u002e\u0034\u0066",_gaf ));return _fb ;};
|
||||
|
||||
// SetLinksUpToDate sets the links up to date flag.
|
||||
func (_ecg AppProperties )SetLinksUpToDate (v bool ){_ecg ._ade .LinksUpToDate =_eca .Bool (v )};
|
||||
// GetPropertyByName returns a custom property selected by it's name.
|
||||
func (_gba CustomProperties )GetPropertyByName (name string )CustomProperty {_cbac :=_gba ._ebe .Property ;for _ ,_gbf :=range _cbac {if *_gbf .NameAttr ==name {return CustomProperty {_cbd :_gbf };};};return CustomProperty {};};func (_agd CustomProperties )SetPropertyAsVstream (name string ,vstream *_gd .Vstream ){_egfg :=_agd .getNewProperty (name );_egfg .Vstream =vstream ;_agd .setOrReplaceProperty (_egfg );};func (_gbd CustomProperties )SetPropertyAsDate (name string ,date _ba .Time ){date =date .UTC ();_fea ,_fddfe ,_agg :=date .Date ();_fgaa ,_dbgb ,_gbc :=date .Clock ();_gbec :=_ba .Date (_fea ,_fddfe ,_agg ,_fgaa ,_dbgb ,_gbc ,0,_ba .UTC );_cbab :=_gbd .getNewProperty (name );_cbab .Filetime =&_gbec ;_gbd .setOrReplaceProperty (_cbab );};const _ffbg ="\u0032\u0020\u004aan\u0075\u0061\u0072\u0079\u0020\u0032\u0030\u0030\u0036\u0020\u0061\u0074\u0020\u0031\u0035\u003a\u0030\u0034";
|
||||
|
||||
// Description returns the description of the document
|
||||
func (_cgef CoreProperties )Description ()string {if _cgef ._dfe .Description !=nil {return string (_cgef ._dfe .Description .Data );};return "";};
|
||||
// Size returns the size of an image
|
||||
func (_caff ImageRef )Size ()_f .Point {return _caff ._cea .Size };
|
||||
|
||||
// SetContentStatus records the content status of the document.
|
||||
func (_ecae CoreProperties )SetContentStatus (s string ){_ecae ._dfe .ContentStatus =&s };func (_bdc CustomProperties )SetPropertyAsI4 (name string ,i4 int32 ){_bfc :=_bdc .getNewProperty (name );_bfc .I4 =&i4 ;_bdc .setOrReplaceProperty (_bfc );};var ReleasedAt =_be .Date (_ddbgg ,_dbda ,_ccgf ,_fged ,_aeaa ,0,0,_be .UTC );
|
||||
// NewTableStyles constructs a new TableStyles.
|
||||
func NewTableStyles ()TableStyles {return TableStyles {_def :_cg .NewTblStyleLst ()}};
|
||||
|
||||
// Relationships returns a slice of all of the relationships.
|
||||
func (_cfb Relationships )Relationships ()[]Relationship {_bdde :=[]Relationship {};for _ ,_dfgc :=range _cfb ._cdba .Relationship {_bdde =append (_bdde ,Relationship {_gaac :_dfgc });};return _bdde ;};const Version ="\u0031\u002e\u0031\u0036\u002e\u0030";
|
||||
// Cells returns an array of row cells.
|
||||
func (_dgb TableRow )Cells ()[]*_cg .CT_TableCell {return _dgb ._fccb .Tc };
|
||||
|
||||
// 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 _bd .Point ;Format string ;Path string ;Data *[]byte ;};
|
||||
// SetOffsetX sets horizontal offset of a table in distance units (see measurement package).
|
||||
func (_bege Table )SetOffsetX (offX float64 ){if _bege ._cff .Off ==nil {_bege ._cff .Off =_cg .NewCT_Point2D ();_daed :=int64 (0);_bege ._cff .Off .YAttr =_cg .ST_Coordinate {ST_CoordinateUnqualified :&_daed };};_aagf :=_eb .ToEMU (offX );_bege ._cff .Off .XAttr =_cg .ST_Coordinate {ST_CoordinateUnqualified :&_aagf };};func (_eebf CustomProperties )getNewProperty (_bebb string )*_aeb .CT_Property {_bca :=_eebf ._ebe .Property ;_cfa :=int32 (1);for _ ,_gdee :=range _bca {if _gdee .PidAttr > _cfa {_cfa =_gdee .PidAttr ;};};_dec :=_aeb .NewCT_Property ();_dec .NameAttr =&_bebb ;_dec .PidAttr =_cfa +1;_dec .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 _dec ;};
|
||||
|
||||
// Relationships represents a .rels file.
|
||||
type Relationships struct{_cdba *_gb .Relationships };func (_dccd CustomProperties )SetPropertyAsNull (name string ){_gde :=_dccd .getNewProperty (name );_gde .Null =_ed .NewNull ();_dccd .setOrReplaceProperty (_gde );};
|
||||
|
||||
// CustomProperty contains document specific property.
|
||||
// Using of this type is deprecated.
|
||||
type CustomProperty struct{_eag *_da .CT_Property };func (_fcf CustomProperties )SetPropertyAsOstorage (name string ,ostorage string ){_cdd :=_fcf .getNewProperty (name );_cdd .Ostorage =&ostorage ;_fcf .setOrReplaceProperty (_cdd );};
|
||||
// Type returns the type of a relationship.
|
||||
func (_ddf Relationship )Type ()string {return _ddf ._egfa .TypeAttr };func (_aed CustomProperties )SetPropertyAsInt (name string ,i int ){_cbaa :=_aed .getNewProperty (name );_ccac :=int32 (i );_cbaa .Int =&_ccac ;_aed .setOrReplaceProperty (_cbaa );};
|
||||
|
||||
// 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 (_eba ImageRef )RelativeHeight (w _ga .Distance )_ga .Distance {_fdc :=float64 (_eba .Size ().Y )/float64 (_eba .Size ().X );return w *_ga .Distance (_fdc );};
|
||||
func (_fcg ImageRef )RelativeHeight (w _eb .Distance )_eb .Distance {_bfa :=float64 (_fcg .Size ().Y )/float64 (_fcg .Size ().X );return w *_eb .Distance (_bfa );};func (_fa CustomProperties )SetPropertyAsDecimal (name string ,decimal float64 ){_adf :=_fa .getNewProperty (name );_adf .Decimal =&decimal ;_fa .setOrReplaceProperty (_adf );};func (_fbf CustomProperties )SetPropertyAsUi8 (name string ,ui8 uint64 ){_dbd :=_fbf .getNewProperty (name );_dbd .Ui8 =&ui8 ;_fbf .setOrReplaceProperty (_dbd );};
|
||||
|
||||
// TableCol represents a column in a table.
|
||||
type TableCol struct{_bggc *_eb .CT_TableCol };
|
||||
// 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 (_ced AppProperties )Pages ()int32 {if _ced ._fgg .Pages !=nil {return *_ced ._fgg .Pages ;};return 0;};
|
||||
|
||||
// CustomProperty contains document specific property.
|
||||
// Using of this type is deprecated.
|
||||
type CustomProperty struct{_cbd *_aeb .CT_Property };func (_gbad CustomProperties )SetPropertyAsUint (name string ,ui uint ){_bcf :=_gbad .getNewProperty (name );_bgf :=uint32 (ui );_bcf .Uint =&_bgf ;_gbad .setOrReplaceProperty (_bcf );};
|
||||
|
||||
// GetOrCreateCustomProperties returns the custom properties of the document (and if they not exist yet, creating them first).
|
||||
func (_ccg *DocBase )GetOrCreateCustomProperties ()CustomProperties {if _ccg .CustomProperties .X ()==nil {_ccg .CreateCustomProperties ();};return _ccg .CustomProperties ;};func (_dcg CustomProperties )SetPropertyAsUi2 (name string ,ui2 uint16 ){_bcdb :=_dcg .getNewProperty (name );_bcdb .Ui2 =&ui2 ;_dcg .setOrReplaceProperty (_bcdb );};
|
||||
|
||||
// SetLastModifiedBy records the last person to modify the document.
|
||||
func (_bbff CoreProperties )SetLastModifiedBy (s string ){_bbff ._ggf .LastModifiedBy =&s };
|
||||
|
||||
// Properties returns table properties.
|
||||
func (_dfbc Table )Grid ()*_cg .CT_TableGrid {return _dfbc ._dfd .TblGrid };
|
||||
|
||||
// AddRelationship adds a relationship.
|
||||
func (_fbc Relationships )AddRelationship (target ,ctype string )Relationship {if !_gf .HasPrefix (ctype ,"\u0068t\u0074\u0070\u003a\u002f\u002f"){_ebd .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 );};_bbffc :=_agb .NewRelationship ();_ddc :=len (_fbc ._adc .Relationship )+1;_dga :=map[string ]struct{}{};for _ ,_fafg :=range _fbc ._adc .Relationship {_dga [_fafg .IdAttr ]=struct{}{};};for _ ,_aaff :=_dga [_ea .Sprintf ("\u0072\u0049\u0064%\u0064",_ddc )];_aaff ;_ ,_aaff =_dga [_ea .Sprintf ("\u0072\u0049\u0064%\u0064",_ddc )]{_ddc ++;};_bbffc .IdAttr =_ea .Sprintf ("\u0072\u0049\u0064%\u0064",_ddc );_bbffc .TargetAttr =target ;_bbffc .TypeAttr =ctype ;_fbc ._adc .Relationship =append (_fbc ._adc .Relationship ,_bbffc );return Relationship {_egfa :_bbffc };};func (_cbdg CustomProperties )setOrReplaceProperty (_agbc *_aeb .CT_Property ){_cbdg .setPropertyHelper (_agbc ,true );};
|
||||
|
||||
// PropertiesList returns the list of all custom properties of the document.
|
||||
func (_bdb CustomProperties )PropertiesList ()[]*_aeb .CT_Property {return _bdb ._ebe .Property };
|
||||
|
||||
// SetHeight sets row height, see measurement package.
|
||||
func (_gdd TableRow )SetHeight (m _eb .Distance ){_gec :=_eb .ToEMU (float64 (m ));_gdd ._fccb .HAttr =_cg .ST_Coordinate {ST_CoordinateUnqualified :&_gec };};
|
||||
|
||||
// DefAttr returns the DefAttr property.
|
||||
func (_fgd TableStyles )DefAttr ()string {return _fgd ._def .DefAttr };
|
||||
|
||||
// ContentStatus returns the content status of the document (e.g. "Final", "Draft")
|
||||
func (_gfc CoreProperties )ContentStatus ()string {if _gfc ._ggf .ContentStatus !=nil {return *_gfc ._ggf .ContentStatus ;};return "";};func (_ffb CustomProperties )setProperty (_fbbb *_aeb .CT_Property ){_ffb .setPropertyHelper (_fbbb ,false );};
|
||||
|
||||
// CopyRelationship copies the relationship.
|
||||
func (_aebe Relationships )CopyRelationship (idAttr string )(Relationship ,bool ){for _adee :=range _aebe ._cdba .Relationship {if _aebe ._cdba .Relationship [_adee ].IdAttr ==idAttr {_fagg :=*_aebe ._cdba .Relationship [_adee ];_fdfe :=len (_aebe ._cdba .Relationship )+1;_gbef :=map[string ]struct{}{};for _ ,_fggd :=range _aebe ._cdba .Relationship {_gbef [_fggd .IdAttr ]=struct{}{};};for _ ,_gcg :=_gbef [_gef .Sprintf ("\u0072\u0049\u0064%\u0064",_fdfe )];_gcg ;_ ,_gcg =_gbef [_gef .Sprintf ("\u0072\u0049\u0064%\u0064",_fdfe )]{_fdfe ++;};_fagg .IdAttr =_gef .Sprintf ("\u0072\u0049\u0064%\u0064",_fdfe );_aebe ._cdba .Relationship =append (_aebe ._cdba .Relationship ,&_fagg );return Relationship {_gaac :&_fagg },true ;};};return Relationship {},false ;};const _dbda =11;
|
||||
func (_eda Relationships )CopyRelationship (idAttr string )(Relationship ,bool ){for _dbb :=range _eda ._adc .Relationship {if _eda ._adc .Relationship [_dbb ].IdAttr ==idAttr {_eefc :=*_eda ._adc .Relationship [_dbb ];_gab :=len (_eda ._adc .Relationship )+1;_aafd :=map[string ]struct{}{};for _ ,_egee :=range _eda ._adc .Relationship {_aafd [_egee .IdAttr ]=struct{}{};};for _ ,_dcb :=_aafd [_ea .Sprintf ("\u0072\u0049\u0064%\u0064",_gab )];_dcb ;_ ,_dcb =_aafd [_ea .Sprintf ("\u0072\u0049\u0064%\u0064",_gab )]{_gab ++;};_eefc .IdAttr =_ea .Sprintf ("\u0072\u0049\u0064%\u0064",_gab );_eda ._adc .Relationship =append (_eda ._adc .Relationship ,&_eefc );return Relationship {_egfa :&_eefc },true ;};};return Relationship {},false ;};
|
||||
|
||||
// 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 (_eaaa *ImageRef )SetTarget (target string ){_eaaa ._eafb =target };func (_cece Relationship )String ()string {return _ea .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",_cece .ID (),_cece .Target (),_cece .Type ());};
|
||||
|
||||
// X returns the inner raw content types.
|
||||
func (_ed ContentTypes )X ()*_ag .Types {return _ed ._cc };
|
||||
|
||||
// Format returns the format of the underlying image
|
||||
func (_eebd ImageRef )Format ()string {return _eebd ._cea .Format };
|
||||
|
||||
// CopyOverride copies override content type for a given `path` and puts it with a path `newPath`.
|
||||
func (_gc ContentTypes )CopyOverride (path ,newPath string ){if !_gf .HasPrefix (path ,"\u002f"){path ="\u002f"+path ;};if !_gf .HasPrefix (newPath ,"\u002f"){newPath ="\u002f"+newPath ;};for _dfe :=range _gc ._cc .Override {if _gc ._cc .Override [_dfe ].PartNameAttr ==path {_dgg :=*_gc ._cc .Override [_dfe ];_dgg .PartNameAttr =newPath ;_gc ._cc .Override =append (_gc ._cc .Override ,&_dgg );};};};
|
||||
|
||||
// Title returns the Title of the document
|
||||
func (_gaeb CoreProperties )Title ()string {if _gaeb ._ggf .Title !=nil {return string (_gaeb ._ggf .Title .Data );};return "";};
|
||||
|
||||
// CoreProperties contains document specific properties.
|
||||
type CoreProperties struct{_ggf *_fc .CoreProperties };func (_aae CustomProperties )SetPropertyAsI4 (name string ,i4 int32 ){_ccaf :=_aae .getNewProperty (name );_ccaf .I4 =&i4 ;_aae .setOrReplaceProperty (_ccaf );};func (_afdd CustomProperties )SetPropertyAsOblob (name ,oblob string ){_ac :=_afdd .getNewProperty (name );_ac .Oblob =&oblob ;_afdd .setOrReplaceProperty (_ac );};func (_fddf CustomProperties )SetPropertyAsCy (name string ,cy string ){_cbed :=_fddf .getNewProperty (name );_cbed .Cy =&cy ;_fddf .setOrReplaceProperty (_cbed );};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_eeb CoreProperties )X ()*_fc .CoreProperties {return _eeb ._ggf };const _dgeef =15;
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_fec AppProperties )X ()*_ec .Properties {return _fec ._fgg };func (_egc CustomProperties )SetPropertyAsI1 (name string ,i1 int8 ){_fdd :=_egc .getNewProperty (name );_fdd .I1 =&i1 ;_egc .setOrReplaceProperty (_fdd );};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_bgag Theme )X ()*_cg .Theme {return _bgag ._fca };
|
||||
|
||||
// X returns the underlying raw XML data.
|
||||
func (_fddd Relationships )X ()*_agb .Relationships {return _fddd ._adc };
|
||||
|
||||
// AddImageToZip adds an image (either from bytes or from disk) and adds it to the zip file.
|
||||
func AddImageToZip (z *_da .Writer ,img ImageRef ,imageNum int ,dt _gg .DocType )error {_dce :=_gg .AbsoluteImageFilename (dt ,imageNum ,_gf .ToLower (img .Format ()));if img .Data ()!=nil &&len (*img .Data ())> 0{if _ecbe :=_fg .AddFileFromBytes (z ,_dce ,*img .Data ());_ecbe !=nil {return _ecbe ;};}else if img .Path ()!=""{if _cec :=_fg .AddFileFromDisk (z ,_dce ,img .Path ());_cec !=nil {return _cec ;};}else {return _ea .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 ;};
|
||||
|
||||
// Relationships represents a .rels file.
|
||||
type Relationships struct{_adc *_agb .Relationships };
|
||||
|
||||
// TblStyle returns the TblStyle property.
|
||||
func (_bbd TableStyles )TblStyle ()[]*_cg .CT_TableStyle {return _bbd ._def .TblStyle };var _ede =_g .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");
|
||||
|
||||
// LastModifiedBy returns the name of the last person to modify the document
|
||||
func (_dge CoreProperties )LastModifiedBy ()string {if _dge ._ggf .LastModifiedBy !=nil {return *_dge ._ggf .LastModifiedBy ;};return "";};
|
||||
|
||||
// TableCol represents a column in a table.
|
||||
type TableCol struct{_gfbc *_cg .CT_TableCol };func (_bcc CustomProperties )SetPropertyAsI8 (name string ,i8 int64 ){_bgc :=_bcc .getNewProperty (name );_bgc .I8 =&i8 ;_bcc .setOrReplaceProperty (_bgc );};
|
||||
|
||||
// Modified returns the time that the document was modified.
|
||||
func (_fcc CoreProperties )Modified ()_ba .Time {return _geee (_fcc ._ggf .Modified )};func (_gbb CustomProperties )SetPropertyAsUi4 (name string ,ui4 uint32 ){_bce :=_gbb .getNewProperty (name );_bce .Ui4 =&ui4 ;_gbb .setOrReplaceProperty (_bce );};
|
||||
|
||||
// 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 ){_bba :=Image {};_bgbd ,_ddaf ,_dbe :=_f .Decode (_be .NewReader (data ));if _dbe !=nil {return _bba ,_ea .Errorf ("\u0075n\u0061\u0062\u006c\u0065 \u0074\u006f\u0020\u0070\u0061r\u0073e\u0020i\u006d\u0061\u0067\u0065\u003a\u0020\u0025s",_dbe );};_bba .Data =&data ;_bba .Format =_ddaf ;_bba .Size =_bgbd .Bounds ().Size ();return _bba ,nil ;};func (_ecb CustomProperties )SetPropertyAsLpwstr (name string ,lpwstr string ){_dcd :=_ecb .getNewProperty (name );_dcd .Lpwstr =&lpwstr ;_ecb .setOrReplaceProperty (_dcd );};
|
||||
|
||||
// AddOverride adds an override content type for a given path name.
|
||||
func (_geea ContentTypes )AddOverride (path ,contentType string ){if !_gf .HasPrefix (path ,"\u002f"){path ="\u002f"+path ;};if _gf .HasPrefix (contentType ,"\u0068\u0074\u0074\u0070"){_ebd .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 _ ,_ffge :=range _geea ._cc .Override {if _ffge .PartNameAttr ==path &&_ffge .ContentTypeAttr ==contentType {return ;};};_eee :=_ag .NewOverride ();_eee .PartNameAttr =path ;_eee .ContentTypeAttr =contentType ;_geea ._cc .Override =append (_geea ._cc .Override ,_eee );};
|
||||
|
||||
// Relationship is a relationship within a .rels file.
|
||||
type Relationship struct{_egfa *_agb .Relationship };func (_dfea CustomProperties )SetPropertyAsOstorage (name string ,ostorage string ){_gedb :=_dfea .getNewProperty (name );_gedb .Ostorage =&ostorage ;_dfea .setOrReplaceProperty (_gedb );};
|
||||
|
||||
// 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 _f .Image ;Images []ImageRef ;ExtraFiles []ExtraFile ;TmpPath string ;};
|
||||
|
||||
// Company returns the name of the company that created the document.
|
||||
// For unioffice created documents, it defaults to github.com/unidoc/unioffice
|
||||
func (_bga AppProperties )Company ()string {if _bga ._fgg .Company !=nil {return *_bga ._fgg .Company ;};return "";};func (_edc CustomProperties )SetPropertyAsStorage (name string ,storage string ){_egfb :=_edc .getNewProperty (name );_egfb .Storage =&storage ;_edc .setOrReplaceProperty (_egfb );};const Version ="\u0031\u002e\u0031\u0037\u002e\u0030";
|
||||
|
||||
// X returns the inner wrapped XML type of CustomProperty.
|
||||
func (_eefg CustomProperty )X ()*_aeb .CT_Property {return _eefg ._cbd };
|
||||
|
||||
// ID returns the ID of a relationship.
|
||||
func (_dag Relationship )ID ()string {return _dag ._egfa .IdAttr };
|
||||
|
||||
// Target returns the target (path) of a relationship.
|
||||
func (_fcb Relationship )Target ()string {return _fcb ._egfa .TargetAttr };
|
||||
|
||||
// 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 ){_ggbf :=Image {};_dceb ,_aag :=_daf .Open (path );if _aag !=nil {return _ggbf ,_ea .Errorf ("\u0065\u0072\u0072or\u0020\u0072\u0065\u0061\u0064\u0069\u006e\u0067\u0020\u0069\u006d\u0061\u0067\u0065\u003a\u0020\u0025\u0073",_aag );};defer _dceb .Close ();_abg ,_fdb ,_aag :=_f .Decode (_dceb );if _aag !=nil {return _ggbf ,_ea .Errorf ("\u0075n\u0061\u0062\u006c\u0065 \u0074\u006f\u0020\u0070\u0061r\u0073e\u0020i\u006d\u0061\u0067\u0065\u003a\u0020\u0025s",_aag );};_ggbf .Path =path ;_ggbf .Format =_fdb ;_ggbf .Size =_abg .Bounds ().Size ();return _ggbf ,nil ;};
|
||||
|
||||
// TableStyles contains document specific properties.
|
||||
type TableStyles struct{_def *_cg .TblStyleLst };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_fae Table )X ()*_cg .Tbl {return _fae ._dfd };func (_cfaa CustomProperties )SetPropertyAsBstr (name string ,bstr string ){_bbfd :=_cfaa .getNewProperty (name );_bbfd .Bstr =&bstr ;_cfaa .setOrReplaceProperty (_bbfd );};
|
||||
|
||||
// GetByRelId returns a relationship with the associated relation ID.
|
||||
func (_bdgc Relationships )GetByRelId (idAttr string )Relationship {for _ ,_caffc :=range _bdgc ._adc .Relationship {if _caffc .IdAttr ==idAttr {return Relationship {_egfa :_caffc };};};return Relationship {};};func (_gfa CustomProperties )SetPropertyAsI2 (name string ,i2 int16 ){_gfb :=_gfa .getNewProperty (name );_gfb .I2 =&i2 ;_gfa .setOrReplaceProperty (_gfb );};
|
||||
|
||||
// EnsureOverride ensures that an override for the given path exists, adding it if necessary
|
||||
func (_bd ContentTypes )EnsureOverride (path ,contentType string ){for _ ,_ccb :=range _bd ._cc .Override {if _ccb .PartNameAttr ==path {if _gf .HasPrefix (contentType ,"\u0068\u0074\u0074\u0070"){_ebd .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 );};_ccb .ContentTypeAttr =contentType ;return ;};};_bd .AddOverride (path ,contentType );};func _geee (_aa *_gg .XSDAny )_ba .Time {if _aa ==nil {return _ba .Time {};};_ef ,_efc :=_ba .Parse (_ab ,string (_aa .Data ));if _efc !=nil {_ebd .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 (_aa .Data ),_efc );};return _ef ;};
|
||||
|
||||
// Clear removes any existing relationships.
|
||||
func (_abc Relationships )Clear (){_abc ._adc .Relationship =nil };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_dbfa TableStyles )X ()*_cg .TblStyleLst {return _dbfa ._def };func (_ccc CustomProperties )SetPropertyAsEmpty (name string ){_gegf :=_ccc .getNewProperty (name );_gegf .Empty =_gd .NewEmpty ();_ccc .setOrReplaceProperty (_gegf );};
|
||||
|
||||
// NewTheme constructs a new theme.
|
||||
func NewTheme ()Theme {return Theme {_cg .NewTheme ()}};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_gad Relationship )X ()*_agb .Relationship {return _gad ._egfa };
|
||||
|
||||
// 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 {_cea :img ,_acd :d ,_aeg :rels };};
|
||||
|
||||
// SetApplicationVersion sets the version of the application that created the
|
||||
// document. Per MS, the verison string mut be in the form 'XX.YYYY'.
|
||||
func (_dd AppProperties )SetApplicationVersion (s string ){_dd ._fgg .AppVersion =&s };
|
||||
|
||||
// Author returns the author of the document
|
||||
func (_bbe CoreProperties )Author ()string {if _bbe ._ggf .Creator !=nil {return string (_bbe ._ggf .Creator .Data );};return "";};
|
||||
|
||||
// SetCreated sets the time that the document was created.
|
||||
func (_egaa CoreProperties )SetCreated (t _ba .Time ){_egaa ._ggf .Created =_gce (t ,"\u0064c\u0074e\u0072\u006d\u0073\u003a\u0063\u0072\u0065\u0061\u0074\u0065\u0064");};func _gce (_ffef _ba .Time ,_abf string )*_gg .XSDAny {_ged :=&_gg .XSDAny {XMLName :_cd .Name {Local :_abf }};_ged .Attrs =append (_ged .Attrs ,_cd .Attr {Name :_cd .Name {Local :"\u0078\u0073\u0069\u003a\u0074\u0079\u0070\u0065"},Value :"\u0064\u0063\u0074\u0065\u0072\u006d\u0073\u003a\u00573\u0043\u0044\u0054\u0046"});_ged .Attrs =append (_ged .Attrs ,_cd .Attr {Name :_cd .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"});_ged .Attrs =append (_ged .Attrs ,_cd .Attr {Name :_cd .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/"});_ged .Data =[]byte (_ffef .Format (_ab ));return _ged ;};func (_bcb CustomProperties )SetPropertyAsBool (name string ,b bool ){_fegc :=_bcb .getNewProperty (name );_fegc .Bool =&b ;_bcb .setOrReplaceProperty (_fegc );};func (_bfg CustomProperties )SetPropertyAsBlob (name ,blob string ){_feff :=_bfg .getNewProperty (name );_feff .Blob =&blob ;_bfg .setOrReplaceProperty (_feff );};
|
||||
|
||||
// SetLinksUpToDate sets the links up to date flag.
|
||||
func (_caf AppProperties )SetLinksUpToDate (v bool ){_caf ._fgg .LinksUpToDate =_gg .Bool (v )};func (_egcf CustomProperties )SetPropertyAsClsid (name string ,clsid string ){_gbbd :=_egcf .getNewProperty (name );_gbbd .Clsid =&clsid ;_egcf .setOrReplaceProperty (_gbbd );};
|
||||
|
||||
// NewContentTypes returns a wrapper around a newly constructed content-types.
|
||||
func NewContentTypes ()ContentTypes {_dda :=ContentTypes {_cc :_ag .NewTypes ()};_dda .AddDefault ("\u0078\u006d\u006c","\u0061p\u0070l\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u0078\u006d\u006c");_dda .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");_dda .AddDefault ("\u0070\u006e\u0067","\u0069m\u0061\u0067\u0065\u002f\u0070\u006eg");_dda .AddDefault ("\u006a\u0070\u0065\u0067","\u0069\u006d\u0061\u0067\u0065\u002f\u006a\u0070\u0065\u0067");_dda .AddDefault ("\u006a\u0070\u0067","\u0069m\u0061\u0067\u0065\u002f\u006a\u0070g");_dda .AddDefault ("\u0077\u006d\u0066","i\u006d\u0061\u0067\u0065\u002f\u0078\u002d\u0077\u006d\u0066");_dda .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");_dda .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 _dda ;};func (_aebg CustomProperties )SetPropertyAsNull (name string ){_aaf :=_aebg .getNewProperty (name );_aaf .Null =_gd .NewNull ();_aebg .setOrReplaceProperty (_aaf );};
|
||||
|
||||
// NewRelationship constructs a new relationship.
|
||||
func NewRelationship ()Relationship {return Relationship {_egfa :_agb .NewRelationship ()}};
|
||||
|
||||
// AddRow adds a row to a table.
|
||||
func (_bde Table )AddRow ()*TableRow {_gfab :=_cg .NewCT_TableRow ();for _agfa :=0;_agfa < len (_bde ._dfd .TblGrid .GridCol );_agfa ++{_gfab .Tc =append (_gfab .Tc ,_cg .NewCT_TableCell ());};_bde ._dfd .Tr =append (_bde ._dfd .Tr ,_gfab );return &TableRow {_fccb :_gfab };};
|
||||
|
||||
// TableRow represents a row in a table.
|
||||
type TableRow struct{_fccb *_cg .CT_TableRow };func (_bdf CustomProperties )SetPropertyAsOstream (name string ,ostream string ){_dfa :=_bdf .getNewProperty (name );_dfa .Ostream =&ostream ;_bdf .setOrReplaceProperty (_dfa );};func (_dbbe TableRow )addCell ()*_cg .CT_TableCell {_agc :=_cg .NewCT_TableCell ();_dbbe ._fccb .Tc =append (_dbbe ._fccb .Tc ,_agc );return _agc ;};
|
||||
|
||||
// CustomProperties contains document specific properties.
|
||||
type CustomProperties struct{_ebe *_aeb .Properties };
|
||||
|
||||
// IsEmpty returns true if there are no relationships.
|
||||
func (_faf Relationships )IsEmpty ()bool {return _faf ._adc ==nil ||len (_faf ._adc .Relationship )==0};func (_bdg CustomProperties )SetPropertyAsLpstr (name string ,lpstr string ){_dcgg :=_bdg .getNewProperty (name );_dcgg .Lpstr =&lpstr ;_bdg .setOrReplaceProperty (_dcgg );};
|
||||
|
||||
// AddCustomRelationships adds relationships related to custom properties to the document.
|
||||
func (_ffd *DocBase )AddCustomRelationships (){_ffd .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");_ffd .Rels .AddRelationship ("\u0064\u006f\u0063\u0050ro\u0070\u0073\u002f\u0063\u0075\u0073\u0074\u006f\u006d\u002e\u0078\u006d\u006c",_gg .CustomPropertiesType );};
|
||||
|
||||
// SetWidth sets column width, see measurement package.
|
||||
func (_gfbcd TableCol )SetWidth (m _eb .Distance ){_ceeg :=_eb .ToEMU (float64 (m ));_gfbcd ._gfbc .WAttr =_cg .ST_Coordinate {ST_CoordinateUnqualified :&_ceeg };};const _ab ="2\u00300\u0036\u002d\u0030\u0031\u002d\u0030\u0032\u00541\u0035\u003a\u0030\u0034:0\u0035\u005a";
|
||||
|
||||
// AddHyperlink adds an external hyperlink relationship.
|
||||
func (_ggae Relationships )AddHyperlink (target string )Hyperlink {_eacf :=_ggae .AddRelationship (target ,_gg .HyperLinkType );_eacf ._egfa .TargetModeAttr =_agb .ST_TargetModeExternal ;return Hyperlink (_eacf );};
|
||||
|
||||
// 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 (_dgf *DocBase )AddExtraFileFromZip (f *_da .File )error {_bae ,_ccd :=_fg .ExtractToDiskTmp (f ,_dgf .TmpPath );if _ccd !=nil {return _ea .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",_ccd );};_dgf .ExtraFiles =append (_dgf .ExtraFiles ,ExtraFile {ZipPath :f .Name ,DiskPath :_bae });return nil ;};
|
||||
|
||||
// NewCustomProperties constructs a new CustomProperties.
|
||||
func NewCustomProperties ()CustomProperties {return CustomProperties {_ebe :_aeb .NewProperties ()}};const _bef =2022;
|
||||
|
||||
// Category returns the category of the document
|
||||
func (_egd CoreProperties )Category ()string {if _egd ._ggf .Category !=nil {return *_egd ._ggf .Category ;};return "";};
|
||||
|
||||
// Created returns the time that the document was created.
|
||||
func (_egdb CoreProperties )Created ()_ba .Time {return _geee (_egdb ._ggf .Created )};
|
||||
|
||||
// NewRelationshipsCopy creates a new relationships wrapper as a copy of passed in instance.
|
||||
func NewRelationshipsCopy (rels Relationships )Relationships {_bbb :=*rels ._cdba ;return Relationships {_cdba :&_bbb };};func (_ddb CustomProperties )SetPropertyAsUi1 (name string ,ui1 uint8 ){_ffc :=_ddb .getNewProperty (name );_ffc .Ui1 =&ui1 ;_ddb .setOrReplaceProperty (_ffc );};func (_cec CustomProperties )SetPropertyAsStream (name string ,stream string ){_aff :=_cec .getNewProperty (name );_aff .Stream =&stream ;_cec .setOrReplaceProperty (_aff );};func (_cbe CustomProperties )SetPropertyAsBstr (name string ,bstr string ){_geea :=_cbe .getNewProperty (name );_geea .Bstr =&bstr ;_cbe .setOrReplaceProperty (_geea );};
|
||||
func NewRelationshipsCopy (rels Relationships )Relationships {_bgbg :=*rels ._adc ;return Relationships {_adc :&_bgbg };};
|
||||
|
||||
// Cells returns an array of row cells.
|
||||
func (_fff TableRow )Cells ()[]*_eb .CT_TableCell {return _fff ._edab .Tc };
|
||||
// Application returns the name of the application that created the document.
|
||||
// For unioffice created documents, it defaults to github.com/unidoc/unioffice
|
||||
func (_bafc AppProperties )Application ()string {if _bafc ._fgg .Application !=nil {return *_bafc ._fgg .Application ;};return "";};func (_bfe CustomProperties )setPropertyHelper (_bfc *_aeb .CT_Property ,_dba bool ){_cbfa :=_bfe .GetPropertyByName (*_bfc .NameAttr );if (_cbfa ==CustomProperty {}){_bfe ._ebe .Property =append (_bfe ._ebe .Property ,_bfc );}else if _dba {_bfc .FmtidAttr =_cbfa ._cbd .FmtidAttr ;if _cbfa ._cbd .PidAttr ==0{_bfc .PidAttr =_cbfa ._cbd .PidAttr ;};_bfc .LinkTargetAttr =_cbfa ._cbd .LinkTargetAttr ;*_cbfa ._cbd =*_bfc ;};};
|
||||
|
||||
// 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 (_aggc ImageRef )RelativeWidth (h _eb .Distance )_eb .Distance {_fgfe :=float64 (_aggc .Size ().X )/float64 (_aggc .Size ().Y );return h *_eb .Distance (_fgfe );};func (_fef CustomProperties )SetPropertyAsArray (name string ,array *_gd .Array ){_cdb :=_fef .getNewProperty (name );_cdb .Array =array ;_fef .setOrReplaceProperty (_cdb );};
|
||||
|
||||
// FindRIDForN returns the relationship ID for the i'th relationship of type t.
|
||||
func (_fcce Relationships )FindRIDForN (i int ,t string )string {for _ ,_cgfg :=range _fcce ._adc .CT_Relationships .Relationship {if _cgfg .TypeAttr ==t {if i ==0{return _cgfg .IdAttr ;};i --;};};return "";};
|
||||
|
||||
// Table represents a table in the document.
|
||||
type Table struct{_dfd *_cg .Tbl ;_cff *_cg .CT_Transform2D ;};
|
||||
|
||||
// AddDefault registers a default content type for a given file extension.
|
||||
func (_dc ContentTypes )AddDefault (fileExtension string ,contentType string ){fileExtension =_gf .ToLower (fileExtension );for _ ,_ad :=range _dc ._cc .Default {if _ad .ExtensionAttr ==fileExtension &&_ad .ContentTypeAttr ==contentType {return ;};};_gfd :=_ag .NewDefault ();_gfd .ExtensionAttr =fileExtension ;_gfd .ContentTypeAttr =contentType ;_dc ._cc .Default =append (_dc ._cc .Default ,_gfd );};func (_ggbe CustomProperties )SetPropertyAsStream (name string ,stream string ){_dee :=_ggbe .getNewProperty (name );_dee .Stream =&stream ;_ggbe .setOrReplaceProperty (_dee );};
|
||||
|
||||
// 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 (_fddg Relationships )AddAutoRelationship (dt _gg .DocType ,src string ,idx int ,ctype string )Relationship {return _fddg .AddRelationship (_gg .RelativeFilename (dt ,src ,ctype ,idx ),ctype );};
|
||||
|
||||
// Append appends DocBase part of an office document to another DocBase.
|
||||
func (_db DocBase )Append (docBase1 DocBase )DocBase {_ff :=docBase1 .ContentTypes .X ();for _ ,_cdg :=range _ff .Default {_db .ContentTypes .AddDefault (_cdg .ExtensionAttr ,_cdg .ContentTypeAttr );};for _ ,_cb :=range _ff .Override {_db .ContentTypes .AddOverride (_cb .PartNameAttr ,_cb .ContentTypeAttr );};_ffe :=_db .AppProperties .X ();_ee :=docBase1 .AppProperties .X ();if _ffe .Pages !=nil {if _ee .Pages !=nil {*_ffe .Pages +=*_ee .Pages ;};}else if _ee .Pages !=nil {_ffe .Pages =_ee .Pages ;};if _ffe .Words !=nil {if _ee .Words !=nil {*_ffe .Words +=*_ee .Words ;};}else if _ee .Words !=nil {_ffe .Words =_ee .Words ;};if _ffe .Characters !=nil {if _ee .Characters !=nil {*_ffe .Characters +=*_ee .Characters ;};}else if _ee .Characters !=nil {_ffe .Characters =_ee .Characters ;};if _ffe .Lines !=nil {if _ee .Lines !=nil {*_ffe .Lines +=*_ee .Lines ;};}else if _ee .Lines !=nil {_ffe .Lines =_ee .Lines ;};if _ffe .Paragraphs !=nil {if _ee .Paragraphs !=nil {*_ffe .Paragraphs +=*_ee .Paragraphs ;};}else if _ee .Paragraphs !=nil {_ffe .Paragraphs =_ee .Paragraphs ;};if _ffe .Notes !=nil {if _ee .Notes !=nil {*_ffe .Notes +=*_ee .Notes ;};}else if _ee .Notes !=nil {_ffe .Notes =_ee .Notes ;};if _ffe .HiddenSlides !=nil {if _ee .HiddenSlides !=nil {*_ffe .HiddenSlides +=*_ee .HiddenSlides ;};}else if _ee .HiddenSlides !=nil {_ffe .HiddenSlides =_ee .HiddenSlides ;};if _ffe .MMClips !=nil {if _ee .MMClips !=nil {*_ffe .MMClips +=*_ee .MMClips ;};}else if _ee .MMClips !=nil {_ffe .MMClips =_ee .MMClips ;};if _ffe .LinksUpToDate !=nil {if _ee .LinksUpToDate !=nil {*_ffe .LinksUpToDate =*_ffe .LinksUpToDate &&*_ee .LinksUpToDate ;};}else if _ee .LinksUpToDate !=nil {_ffe .LinksUpToDate =_ee .LinksUpToDate ;};if _ffe .CharactersWithSpaces !=nil {if _ee .CharactersWithSpaces !=nil {*_ffe .CharactersWithSpaces +=*_ee .CharactersWithSpaces ;};}else if _ee .CharactersWithSpaces !=nil {_ffe .CharactersWithSpaces =_ee .CharactersWithSpaces ;};if _ffe .SharedDoc !=nil {if _ee .SharedDoc !=nil {*_ffe .SharedDoc =*_ffe .SharedDoc ||*_ee .SharedDoc ;};}else if _ee .SharedDoc !=nil {_ffe .SharedDoc =_ee .SharedDoc ;};if _ffe .HyperlinksChanged !=nil {if _ee .HyperlinksChanged !=nil {*_ffe .HyperlinksChanged =*_ffe .HyperlinksChanged ||*_ee .HyperlinksChanged ;};}else if _ee .HyperlinksChanged !=nil {_ffe .HyperlinksChanged =_ee .HyperlinksChanged ;};_ffe .DigSig =nil ;if _ffe .TitlesOfParts ==nil &&_ee .TitlesOfParts !=nil {_ffe .TitlesOfParts =_ee .TitlesOfParts ;};if _ffe .HeadingPairs !=nil {if _ee .HeadingPairs !=nil {_dac :=_ffe .HeadingPairs .Vector ;_cdf :=_ee .HeadingPairs .Vector ;_cbc :=_dac .Variant ;_fff :=_cdf .Variant ;_ffg :=[]*_gd .Variant {};for _baf :=0;_baf < len (_fff );_baf +=2{_df :=_fff [_baf ].Lpstr ;_fd :=false ;for _eg :=0;_eg < len (_cbc );_eg +=2{_eaa :=_cbc [_eg ].Lpstr ;if _eaa !=nil &&_df !=nil &&*_eaa ==*_df {*_cbc [_eg +1].I4 =*_cbc [_eg +1].I4 +*_fff [_baf +1].I4 ;_fd =true ;break ;};};if !_fd {_ffg =append (_ffg ,&_gd .Variant {CT_Variant :_gd .CT_Variant {Lpstr :_fff [_baf ].Lpstr }});_ffg =append (_ffg ,&_gd .Variant {CT_Variant :_gd .CT_Variant {I4 :_fff [_baf ].I4 }});};};_cbc =append (_cbc ,_ffg ...);_dac .SizeAttr =uint32 (len (_cbc ));};}else if _ee .HeadingPairs !=nil {_ffe .HeadingPairs =_ee .HeadingPairs ;};if _ffe .HLinks !=nil {if _ee .HLinks !=nil {_dg :=_ffe .HLinks .Vector ;_gb :=_ee .HLinks .Vector ;_dbf :=_dg .Variant ;_ce :=_gb .Variant ;for _ ,_cbf :=range _ce {_dace :=true ;for _ ,_gde :=range _dbf {if _c .DeepEqual (_gde ,_cbf ){_dace =false ;break ;};};if _dace {_dbf =append (_dbf ,_cbf );_dg .SizeAttr ++;};};};}else if _ee .HLinks !=nil {_ffe .HLinks =_ee .HLinks ;};_gee :=_db .GetOrCreateCustomProperties ();_ebc :=docBase1 .GetOrCreateCustomProperties ();for _ ,_bb :=range _ebc .PropertiesList (){_gee .setProperty (_bb );};_db .CustomProperties =_gee ;_fgf :=_db .Rels .X ().Relationship ;for _ ,_age :=range docBase1 .Rels .X ().Relationship {_fe :=true ;for _ ,_ded :=range _fgf {if _ded .TargetAttr ==_age .TargetAttr &&_ded .TypeAttr ==_age .TypeAttr {_fe =false ;break ;};};if _fe {_db .Rels .AddRelationship (_age .TargetAttr ,_age .TypeAttr );};};for _ ,_ege :=range docBase1 .ExtraFiles {_agbd :=_ege .ZipPath ;_fdf :=true ;for _ ,_af :=range _db .ExtraFiles {if _af .ZipPath ==_agbd {_fdf =false ;break ;};};if _fdf {_db .ExtraFiles =append (_db .ExtraFiles ,_ege );};};return _db ;};func UtcTimeFormat (t _ba .Time )string {return t .Format (_ffbg )+"\u0020\u0055\u0054\u0043"};
|
||||
|
||||
// Relationships returns a slice of all of the relationships.
|
||||
func (_fcde Relationships )Relationships ()[]Relationship {_ade :=[]Relationship {};for _ ,_fgba :=range _fcde ._adc .Relationship {_ade =append (_ade ,Relationship {_egfa :_fgba });};return _ade ;};
|
||||
|
||||
// SetApplication sets the name of the application that created the document.
|
||||
func (_gbe AppProperties )SetApplication (s string ){_gbe ._fgg .Application =&s };
|
||||
|
||||
// RemoveOverride removes an override given a path.
|
||||
func (_eef ContentTypes )RemoveOverride (path string ){if !_gf .HasPrefix (path ,"\u002f"){path ="\u002f"+path ;};for _eacd ,_fffb :=range _eef ._cc .Override {if _fffb .PartNameAttr ==path {copy (_eef ._cc .Override [_eacd :],_eef ._cc .Override [_eacd +1:]);_eef ._cc .Override =_eef ._cc .Override [0:len (_eef ._cc .Override )-1];};};};func (_eaf CustomProperties )SetPropertyAsFiletime (name string ,filetime _ba .Time ){_feb :=_eaf .getNewProperty (name );_feb .Filetime =&filetime ;_eaf .setOrReplaceProperty (_feb );};
|
||||
|
||||
// AppProperties contains properties specific to the document and the
|
||||
// application that created it.
|
||||
type AppProperties struct{_fgg *_ec .Properties };
|
||||
|
||||
// WriteExtraFiles writes the extra files to the zip package.
|
||||
func (_dbda *DocBase )WriteExtraFiles (z *_da .Writer )error {for _ ,_fdfb :=range _dbda .ExtraFiles {if _adff :=_fg .AddFileFromDisk (z ,_fdfb .ZipPath ,_fdfb .DiskPath );_adff !=nil {return _adff ;};};return nil ;};
|
||||
|
||||
// SetTitle records the title of the document.
|
||||
func (_cfb CoreProperties )SetTitle (s string ){if _cfb ._ggf .Title ==nil {_cfb ._ggf .Title =&_gg .XSDAny {XMLName :_cd .Name {Local :"\u0064\u0063\u003a\u0074\u0069\u0074\u006c\u0065"}};};_cfb ._ggf .Title .Data =[]byte (s );};
|
||||
|
||||
// Target returns the target attrubute of the image reference (a path where the image file is located in the document structure).
|
||||
func (_dff *ImageRef )Target ()string {return _dff ._eafb };func init (){_ge .SetAsStorage ()};
|
||||
|
||||
// ImageRef is a reference to an image within a document.
|
||||
type ImageRef struct{_acd *DocBase ;_aeg Relationships ;_cea Image ;_ddb string ;_eafb string ;};
|
||||
|
||||
// SetCompany sets the name of the company that created the document.
|
||||
func (_dafa AppProperties )SetCompany (s string ){_dafa ._fgg .Company =&s };
|
||||
|
||||
// SetModified sets the time that the document was modified.
|
||||
func (_baa CoreProperties )SetModified (t _ba .Time ){_baa ._ggf .Modified =_gce (t ,"\u0064\u0063t\u0065\u0072\u006ds\u003a\u006d\u006f\u0064\u0069\u0066\u0069\u0065\u0064");};
|
||||
|
||||
// SetContentStatus records the content status of the document.
|
||||
func (_cba CoreProperties )SetContentStatus (s string ){_cba ._ggf .ContentStatus =&s };
|
||||
|
||||
// EnsureDefault esnures that an extension and default content type exist,
|
||||
// adding it if necessary.
|
||||
func (_fbbd ContentTypes )EnsureDefault (ext ,contentType string ){ext =_gf .ToLower (ext );for _ ,_bc :=range _fbbd ._cc .Default {if _bc .ExtensionAttr ==ext {_bc .ContentTypeAttr =contentType ;return ;};};_cbe :=&_ag .Default {};_cbe .ContentTypeAttr =contentType ;_cbe .ExtensionAttr =ext ;_fbbd ._cc .Default =append (_fbbd ._cc .Default ,_cbe );};
|
||||
|
||||
// AddCol adds a column to a table.
|
||||
func (_ddg Table )AddCol ()*TableCol {_agac :=_cg .NewCT_TableCol ();_ddg ._dfd .TblGrid .GridCol =append (_ddg ._dfd .TblGrid .GridCol ,_agac );for _ ,_aff :=range _ddg ._dfd .Tr {_gff :=_cg .NewCT_TableCell ();_aff .Tc =append (_aff .Tc ,_gff );};return &TableCol {_gfbc :_agac };};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_beg CustomProperties )X ()*_aeb .Properties {return _beg ._ebe };func (_eaab *ImageRef )SetRelID (id string ){_eaab ._ddb =id };const _efd =15;
|
||||
|
||||
// CreateCustomProperties creates the custom properties of the document.
|
||||
func (_ecc *DocBase )CreateCustomProperties (){_ecc .CustomProperties =NewCustomProperties ();_ecc .AddCustomRelationships ();};const _edg =1;
|
||||
|
||||
// RemoveOverrideByIndex removes an override given a path and override index.
|
||||
func (_fga ContentTypes )RemoveOverrideByIndex (path string ,indexToFind int )error {_egf :=path [0:len (path )-5];if !_gf .HasPrefix (_egf ,"\u002f"){_egf ="\u002f"+_egf ;};_dbfd ,_fda :=_bg .Compile (_egf +"\u0028\u005b\u0030-\u0039\u005d\u002b\u0029\u002e\u0078\u006d\u006c");if _fda !=nil {return _fda ;};_dfba :=0;_deb :=-1;for _fbe ,_beb :=range _fga ._cc .Override {if _aga :=_dbfd .FindStringSubmatch (_beb .PartNameAttr );len (_aga )> 1{if _dfba ==indexToFind {_deb =_fbe ;}else if _dfba > indexToFind {_bf ,_ :=_de .Atoi (_aga [1]);_bf --;_beb .PartNameAttr =_ea .Sprintf ("\u0025\u0073\u0025\u0064\u002e\u0078\u006d\u006c",_egf ,_bf );};_dfba ++;};};if _deb > -1{copy (_fga ._cc .Override [_deb :],_fga ._cc .Override [_deb +1:]);_fga ._cc .Override =_fga ._cc .Override [0:len (_fga ._cc .Override )-1];};return nil ;};
|
||||
|
||||
// Remove removes an existing relationship.
|
||||
func (_cafe Relationships )Remove (rel Relationship )bool {for _cgga ,_dgee :=range _cafe ._adc .Relationship {if _dgee ==rel ._egfa {copy (_cafe ._adc .Relationship [_cgga :],_cafe ._adc .Relationship [_cgga +1:]);_cafe ._adc .Relationship =_cafe ._adc .Relationship [0:len (_cafe ._adc .Relationship )-1];return true ;};};return false ;};func (_bgb CustomProperties )SetPropertyAsR4 (name string ,r4 float32 ){_adg :=_bgb .getNewProperty (name );_adg .R4 =&r4 ;_bgb .setOrReplaceProperty (_adg );};
|
||||
|
||||
// Rows returns all table rows.
|
||||
func (_ecd Table )Rows ()[]*TableRow {_egb :=_ecd ._dfd .Tr ;_gceg :=[]*TableRow {};for _ ,_fdc :=range _egb {_gceg =append (_gceg ,&TableRow {_fccb :_fdc });};return _gceg ;};
|
||||
|
||||
// SetID set the ID of a relationship.
|
||||
func (_gfe Relationship )SetID (ID string ){_gfe ._egfa .IdAttr =ID ;};
|
||||
|
||||
// SetStyle assigns TableStyle to a table.
|
||||
func (_eccf Table )SetStyle (style *_cg .CT_TableStyle ){if _eccf ._dfd .TblPr ==nil {_eccf ._dfd .TblPr =_cg .NewCT_TableProperties ();};if _eccf ._dfd .TblPr .Choice ==nil {_eccf ._dfd .TblPr .Choice =_cg .NewCT_TablePropertiesChoice ();};_eccf ._dfd .TblPr .Choice .TableStyle =style ;};const _bcec =30;
|
||||
|
||||
// Path returns the path to an image file, if any.
|
||||
func (_dae ImageRef )Path ()string {return _dae ._cea .Path };
|
||||
|
||||
// ExtraFile is an unsupported file type extracted from, or to be written to a
|
||||
// zip package
|
||||
type ExtraFile struct{ZipPath string ;DiskPath string ;};
|
||||
|
||||
// Theme is a drawingml theme.
|
||||
type Theme struct{_fca *_cg .Theme };
|
||||
|
||||
// NewTableWithXfrm makes a new table with a pointer to its parent Xfrm for changing its offset and size.
|
||||
func NewTableWithXfrm (xfrm *_cg .CT_Transform2D )*Table {_fecc :=_cg .NewTbl ();_fecc .TblPr =_cg .NewCT_TableProperties ();return &Table {_dfd :_fecc ,_cff :xfrm };};
|
||||
|
||||
// SetLanguage records the language of the document.
|
||||
func (_agee CoreProperties )SetLanguage (s string ){_agee ._ggf .Language =&_gg .XSDAny {XMLName :_cd .Name {Local :"d\u0063\u003a\u006c\u0061\u006e\u0067\u0075\u0061\u0067\u0065"}};_agee ._ggf .Language .Data =[]byte (s );};
|
||||
|
||||
// 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 _f .Point ;Format string ;Path string ;Data *[]byte ;};func (_bcd CustomProperties )SetPropertyAsVector (name string ,vector *_gd .Vector ){_dbg :=_bcd .getNewProperty (name );_dbg .Vector =vector ;_bcd .setOrReplaceProperty (_dbg );};
|
||||
|
||||
// SetDescription records the description of the document.
|
||||
func (_bce CoreProperties )SetDescription (s string ){if _bce ._dfe .Description ==nil {_bce ._dfe .Description =&_eca .XSDAny {XMLName :_fb .Name {Local :"\u0064\u0063\u003a\u0064\u0065\u0073\u0063\u0072\u0069p\u0074\u0069\u006f\u006e"}};};_bce ._dfe .Description .Data =[]byte (s );};
|
||||
func (_geg CoreProperties )SetDescription (s string ){if _geg ._ggf .Description ==nil {_geg ._ggf .Description =&_gg .XSDAny {XMLName :_cd .Name {Local :"\u0064\u0063\u003a\u0064\u0065\u0073\u0063\u0072\u0069p\u0074\u0069\u006f\u006e"}};};_geg ._ggf .Description .Data =[]byte (s );};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_gebf Relationship )X ()*_gb .Relationship {return _gebf ._gaac };
|
||||
// NewRelationships creates a new relationship wrapper.
|
||||
func NewRelationships ()Relationships {return Relationships {_adc :_agb .NewRelationships ()}};
|
||||
|
||||
// X returns the underlying raw XML data.
|
||||
func (_cdfb Relationships )X ()*_gb .Relationships {return _cdfb ._cdba };
|
||||
// ApplicationVersion returns the version of the application that created the
|
||||
// document.
|
||||
func (_cf AppProperties )ApplicationVersion ()string {if _cf ._fgg .AppVersion !=nil {return *_cf ._fgg .AppVersion ;};return "";};
|
||||
|
||||
// SetOffsetY sets vertical offset of a table in distance units (see measurement package).
|
||||
func (_ffed Table )SetOffsetY (offY float64 ){if _ffed ._ebd .Off ==nil {_ffed ._ebd .Off =_eb .NewCT_Point2D ();_bdbg :=int64 (0);_ffed ._ebd .Off .XAttr =_eb .ST_Coordinate {ST_CoordinateUnqualified :&_bdbg };};_aca :=_ga .ToEMU (offY );_ffed ._ebd .Off .YAttr =_eb .ST_Coordinate {ST_CoordinateUnqualified :&_aca };};
|
||||
|
||||
// AddRow adds a row to a table.
|
||||
func (_dcbb Table )AddRow ()*TableRow {_adeg :=_eb .NewCT_TableRow ();for _gfd :=0;_gfd < len (_dcbb ._bff .TblGrid .GridCol );_gfd ++{_adeg .Tc =append (_adeg .Tc ,_eb .NewCT_TableCell ());};_dcbb ._bff .Tr =append (_dcbb ._bff .Tr ,_adeg );return &TableRow {_edab :_adeg };};
|
||||
|
||||
// TableStyles contains document specific properties.
|
||||
type TableStyles struct{_fbf *_eb .TblStyleLst };func (_edb CustomProperties )SetPropertyAsR4 (name string ,r4 float32 ){_eaaa :=_edb .getNewProperty (name );_eaaa .R4 =&r4 ;_edb .setOrReplaceProperty (_eaaa );};
|
||||
|
||||
// CopyOverride copies override content type for a given `path` and puts it with a path `newPath`.
|
||||
func (_fdb ContentTypes )CopyOverride (path ,newPath string ){if !_db .HasPrefix (path ,"\u002f"){path ="\u002f"+path ;};if !_db .HasPrefix (newPath ,"\u002f"){newPath ="\u002f"+newPath ;};for _cgf :=range _fdb ._beg .Override {if _fdb ._beg .Override [_cgf ].PartNameAttr ==path {_dc :=*_fdb ._beg .Override [_cgf ];_dc .PartNameAttr =newPath ;_fdb ._beg .Override =append (_fdb ._beg .Override ,&_dc );};};};func (_gaa CustomProperties )SetPropertyAsEmpty (name string ){_geab :=_gaa .getNewProperty (name );_geab .Empty =_ed .NewEmpty ();_gaa .setOrReplaceProperty (_geab );};
|
||||
|
||||
// SetCreated sets the time that the document was created.
|
||||
func (_aaf CoreProperties )SetCreated (t _be .Time ){_aaf ._dfe .Created =_bcf (t ,"\u0064c\u0074e\u0072\u006d\u0073\u003a\u0063\u0072\u0065\u0061\u0074\u0065\u0064");};
|
||||
|
||||
// SetLastModifiedBy records the last person to modify the document.
|
||||
func (_edc CoreProperties )SetLastModifiedBy (s string ){_edc ._dfe .LastModifiedBy =&s };
|
||||
|
||||
// CustomProperties contains document specific properties.
|
||||
type CustomProperties struct{_dag *_da .Properties };
|
||||
|
||||
// ImageRef is a reference to an image within a document.
|
||||
type ImageRef struct{_bfbf *DocBase ;_gbfe Relationships ;_cgg Image ;_edcg string ;_fcbg string ;};
|
||||
|
||||
// FindRIDForN returns the relationship ID for the i'th relationship of type t.
|
||||
func (_cdfa Relationships )FindRIDForN (i int ,t string )string {for _ ,_deg :=range _cdfa ._cdba .CT_Relationships .Relationship {if _deg .TypeAttr ==t {if i ==0{return _deg .IdAttr ;};i --;};};return "";};func (_cafe CustomProperties )SetPropertyAsR8 (name string ,r8 float64 ){_bgfa :=_cafe .getNewProperty (name );_bgfa .R8 =&r8 ;_cafe .setOrReplaceProperty (_bgfa );};func (_cfc TableRow )addCell ()*_eb .CT_TableCell {_afgf :=_eb .NewCT_TableCell ();_cfc ._edab .Tc =append (_cfc ._edab .Tc ,_afgf );return _afgf ;};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_gecg TableStyles )X ()*_eb .TblStyleLst {return _gecg ._fbf };
|
||||
|
||||
// Hyperlink is just an appropriately configured relationship.
|
||||
type Hyperlink Relationship ;
|
||||
|
||||
// Target returns the target (path) of a relationship.
|
||||
func (_fbg Relationship )Target ()string {return _fbg ._gaac .TargetAttr };
|
||||
|
||||
// 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 ){_gcbe :=Image {};_bdba ,_efgg ,_fec :=_bd .Decode (_ee .NewReader (data ));if _fec !=nil {return _gcbe ,_gef .Errorf ("\u0075n\u0061\u0062\u006c\u0065 \u0074\u006f\u0020\u0070\u0061r\u0073e\u0020i\u006d\u0061\u0067\u0065\u003a\u0020\u0025s",_fec );};_gcbe .Data =&data ;_gcbe .Format =_efgg ;_gcbe .Size =_bdba .Bounds ().Size ();return _gcbe ,nil ;};
|
||||
|
||||
// NewCoreProperties constructs a new CoreProperties.
|
||||
func NewCoreProperties ()CoreProperties {return CoreProperties {_dfe :_ba .NewCoreProperties ()}};
|
||||
|
||||
// Application returns the name of the application that created the document.
|
||||
// For unioffice created documents, it defaults to github.com/unidoc/unioffice
|
||||
func (_gc AppProperties )Application ()string {if _gc ._ade .Application !=nil {return *_gc ._ade .Application ;};return "";};
|
||||
|
||||
// Type returns the type of a relationship.
|
||||
func (_gge Relationship )Type ()string {return _gge ._gaac .TypeAttr };
|
||||
|
||||
// Format returns the format of the underlying image
|
||||
func (_ffg ImageRef )Format ()string {return _ffg ._cgg .Format };
|
||||
|
||||
// TblStyle returns the TblStyle property.
|
||||
func (_cgae TableStyles )TblStyle ()[]*_eb .CT_TableStyle {return _cgae ._fbf .TblStyle };
|
||||
|
||||
// SetOffsetX sets horizontal offset of a table in distance units (see measurement package).
|
||||
func (_ddgg Table )SetOffsetX (offX float64 ){if _ddgg ._ebd .Off ==nil {_ddgg ._ebd .Off =_eb .NewCT_Point2D ();_adg :=int64 (0);_ddgg ._ebd .Off .YAttr =_eb .ST_Coordinate {ST_CoordinateUnqualified :&_adg };};_aafd :=_ga .ToEMU (offX );_ddgg ._ebd .Off .XAttr =_eb .ST_Coordinate {ST_CoordinateUnqualified :&_aafd };};
|
||||
|
||||
// GetImageBytesByTarget returns Image object with Data bytes read from its target.
|
||||
func (_aega *DocBase )GetImageBytesByTarget (target string )(Image ,error ){if target !=""{target ="\u0077\u006f\u0072d\u002f"+target ;for _ ,_cgcd :=range _aega .Images {if _cgcd .Target ()==target {return ImageFromStorage (_cgcd .Path ());};};};return Image {},_gfgd ;};
|
||||
|
||||
// Created returns the time that the document was created.
|
||||
func (_cdcg CoreProperties )Created ()_be .Time {return _bbcb (_cdcg ._dfe .Created )};
|
||||
|
||||
// X returns the inner wrapped XML type of CustomProperty.
|
||||
func (_dbeg CustomProperty )X ()*_da .CT_Property {return _dbeg ._eag };
|
||||
|
||||
// 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 (_eafb AppProperties )Pages ()int32 {if _eafb ._ade .Pages !=nil {return *_eafb ._ade .Pages ;};return 0;};
|
||||
|
||||
// AppProperties contains properties specific to the document and the
|
||||
// application that created it.
|
||||
type AppProperties struct{_ade *_ebe .Properties };func init (){_bag .SetAsStorage ()};
|
||||
|
||||
// WriteExtraFiles writes the extra files to the zip package.
|
||||
func (_dac *DocBase )WriteExtraFiles (z *_ef .Writer )error {for _ ,_dgfe :=range _dac .ExtraFiles {if _bde :=_fc .AddFileFromDisk (z ,_dgfe .ZipPath ,_dgfe .DiskPath );_bde !=nil {return _bde ;};};return nil ;};func (_edf CustomProperties )SetPropertyAsUi4 (name string ,ui4 uint32 ){_eced :=_edf .getNewProperty (name );_eced .Ui4 =&ui4 ;_edf .setOrReplaceProperty (_eced );};
|
||||
|
||||
// EnsureOverride ensures that an override for the given path exists, adding it if necessary
|
||||
func (_baf ContentTypes )EnsureOverride (path ,contentType string ){for _ ,_dbe :=range _baf ._beg .Override {if _dbe .PartNameAttr ==path {if _db .HasPrefix (contentType ,"\u0068\u0074\u0074\u0070"){_bdg .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 );};_dbe .ContentTypeAttr =contentType ;return ;};};_baf .AddOverride (path ,contentType );};
|
||||
|
||||
// SetModified sets the time that the document was modified.
|
||||
func (_aeb CoreProperties )SetModified (t _be .Time ){_aeb ._dfe .Modified =_bcf (t ,"\u0064\u0063t\u0065\u0072\u006ds\u003a\u006d\u006f\u0064\u0069\u0066\u0069\u0065\u0064");};func (_ffb CustomProperties )SetPropertyAsBlob (name ,blob string ){_ecbd :=_ffb .getNewProperty (name );_ecbd .Blob =&blob ;_ffb .setOrReplaceProperty (_ecbd );};func (_cde CustomProperties )SetPropertyAsVstream (name string ,vstream *_ed .Vstream ){_edd :=_cde .getNewProperty (name );_edd .Vstream =vstream ;_cde .setOrReplaceProperty (_edd );};func (_aead Relationship )String ()string {return _gef .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",_aead .ID (),_aead .Target (),_aead .Type ());};func (_gab CustomProperties )SetPropertyAsVector (name string ,vector *_ed .Vector ){_bbcc :=_gab .getNewProperty (name );_bbcc .Vector =vector ;_gab .setOrReplaceProperty (_bbcc );};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_gda CoreProperties )X ()*_ba .CoreProperties {return _gda ._dfe };func (_cbf CustomProperties )SetPropertyAsDate (name string ,date _be .Time ){date =date .UTC ();_dcb ,_bfe ,_gdd :=date .Date ();_bfca ,_gagc ,_cbfg :=date .Clock ();_gfga :=_be .Date (_dcb ,_bfe ,_gdd ,_bfca ,_gagc ,_cbfg ,0,_be .UTC );_bega :=_cbf .getNewProperty (name );_bega .Filetime =&_gfga ;_cbf .setOrReplaceProperty (_bega );};
|
||||
|
||||
// AddHyperlink adds an external hyperlink relationship.
|
||||
func (_dagc Relationships )AddHyperlink (target string )Hyperlink {_feag :=_dagc .AddRelationship (target ,_eca .HyperLinkType );_feag ._gaac .TargetModeAttr =_gb .ST_TargetModeExternal ;return Hyperlink (_feag );};const _fged =15;
|
||||
|
||||
// Remove removes an existing relationship.
|
||||
func (_gcc Relationships )Remove (rel Relationship )bool {for _gadgb ,_ggf :=range _gcc ._cdba .Relationship {if _ggf ==rel ._gaac {copy (_gcc ._cdba .Relationship [_gadgb :],_gcc ._cdba .Relationship [_gadgb +1:]);_gcc ._cdba .Relationship =_gcc ._cdba .Relationship [0:len (_gcc ._cdba .Relationship )-1];return true ;};};return false ;};
|
||||
|
||||
// NewTableStyles constructs a new TableStyles.
|
||||
func NewTableStyles ()TableStyles {return TableStyles {_fbf :_eb .NewTblStyleLst ()}};
|
||||
|
||||
// NewTheme constructs a new theme.
|
||||
func NewTheme ()Theme {return Theme {_eb .NewTheme ()}};
|
||||
|
||||
// ContentStatus returns the content status of the document (e.g. "Final", "Draft")
|
||||
func (_dcc CoreProperties )ContentStatus ()string {if _dcc ._dfe .ContentStatus !=nil {return *_dcc ._dfe .ContentStatus ;};return "";};
|
||||
|
||||
// RemoveOverride removes an override given a path.
|
||||
func (_efd ContentTypes )RemoveOverride (path string ){if !_db .HasPrefix (path ,"\u002f"){path ="\u002f"+path ;};for _cdc ,_ace :=range _efd ._beg .Override {if _ace .PartNameAttr ==path {copy (_efd ._beg .Override [_cdc :],_efd ._beg .Override [_cdc +1:]);_efd ._beg .Override =_efd ._beg .Override [0:len (_efd ._beg .Override )-1];};};};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_egec AppProperties )X ()*_ebe .Properties {return _egec ._ade };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_ccfd Table )X ()*_eb .Tbl {return _ccfd ._bff };
|
||||
|
||||
// Company returns the name of the company that created the document.
|
||||
// For unioffice created documents, it defaults to github.com/unidoc/unioffice
|
||||
func (_af AppProperties )Company ()string {if _af ._ade .Company !=nil {return *_af ._ade .Company ;};return "";};
|
||||
|
||||
// ID returns the ID of a relationship.
|
||||
func (_fdd Relationship )ID ()string {return _fdd ._gaac .IdAttr };
|
||||
// SetDocSecurity sets the document security flag.
|
||||
func (_ead AppProperties )SetDocSecurity (v int32 ){_ead ._fgg .DocSecurity =_gg .Int32 (v )};func (_gcdf CustomProperties )SetPropertyAsError (name string ,error string ){_dfg :=_gcdf .getNewProperty (name );_dfg .Error =&error ;_gcdf .setOrReplaceProperty (_dfg );};
|
||||
|
||||
// Properties returns table properties.
|
||||
func (_eee Table )Grid ()*_eb .CT_TableGrid {return _eee ._bff .TblGrid };
|
||||
func (_aee Table )Properties ()*_cg .CT_TableProperties {return _aee ._dfd .TblPr };var ReleasedAt =_ba .Date (_bef ,_edg ,_efd ,_dgeef ,_bcec ,0,0,_ba .UTC );
|
||||
|
||||
// IsEmpty returns true if there are no relationships.
|
||||
func (_eec Relationships )IsEmpty ()bool {return _eec ._cdba ==nil ||len (_eec ._cdba .Relationship )==0;};
|
||||
// GetImageBytesByTarget returns Image object with Data bytes read from its target.
|
||||
func (_gge *DocBase )GetImageBytesByTarget (target string )(Image ,error ){if target !=""{target ="\u0077\u006f\u0072d\u002f"+target ;for _ ,_gdg :=range _gge .Images {if _gdg .Target ()==target {return ImageFromStorage (_gdg .Path ());};};};return Image {},_ede ;};
|
||||
|
||||
// Theme is a drawingml theme.
|
||||
type Theme struct{_bdbf *_eb .Theme };const _aeaa =30;
|
||||
// NewCoreProperties constructs a new CoreProperties.
|
||||
func NewCoreProperties ()CoreProperties {return CoreProperties {_ggf :_fc .NewCoreProperties ()}};
|
||||
|
||||
// GetOrCreateCustomProperties returns the custom properties of the document (and if they not exist yet, creating them first).
|
||||
func (_ced *DocBase )GetOrCreateCustomProperties ()CustomProperties {if _ced .CustomProperties .X ()==nil {_ced .CreateCustomProperties ();};return _ced .CustomProperties ;};
|
||||
|
||||
// AddRelationship adds a relationship.
|
||||
func (_aed Relationships )AddRelationship (target ,ctype string )Relationship {if !_db .HasPrefix (ctype ,"\u0068t\u0074\u0070\u003a\u002f\u002f"){_bdg .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 );};_bad :=_gb .NewRelationship ();_affe :=len (_aed ._cdba .Relationship )+1;_affg :=map[string ]struct{}{};for _ ,_cgge :=range _aed ._cdba .Relationship {_affg [_cgge .IdAttr ]=struct{}{};};for _ ,_cded :=_affg [_gef .Sprintf ("\u0072\u0049\u0064%\u0064",_affe )];_cded ;_ ,_cded =_affg [_gef .Sprintf ("\u0072\u0049\u0064%\u0064",_affe )]{_affe ++;};_bad .IdAttr =_gef .Sprintf ("\u0072\u0049\u0064%\u0064",_affe );_bad .TargetAttr =target ;_bad .TypeAttr =ctype ;_aed ._cdba .Relationship =append (_aed ._cdba .Relationship ,_bad );return Relationship {_gaac :_bad };};
|
||||
|
||||
// DefAttr returns the DefAttr property.
|
||||
func (_bea TableStyles )DefAttr ()string {return _bea ._fbf .DefAttr };
|
||||
|
||||
// Modified returns the time that the document was modified.
|
||||
func (_fdf CoreProperties )Modified ()_be .Time {return _bbcb (_fdf ._dfe .Modified )};
|
||||
|
||||
// TableRow represents a row in a table.
|
||||
type TableRow struct{_edab *_eb .CT_TableRow };func (_fgec CustomProperties )SetPropertyAsLpwstr (name string ,lpwstr string ){_abf :=_fgec .getNewProperty (name );_abf .Lpwstr =&lpwstr ;_fgec .setOrReplaceProperty (_abf );};const _ccgf =10;
|
||||
|
||||
// Data returns the data of an image file, if any.
|
||||
func (_afef ImageRef )Data ()*[]byte {return _afef ._cgg .Data };
|
||||
|
||||
// Clear removes any existing relationships.
|
||||
func (_gadb Relationships )Clear (){_gadb ._cdba .Relationship =nil };func _bbcb (_acb *_eca .XSDAny )_be .Time {if _acb ==nil {return _be .Time {};};_ecb ,_bafe :=_be .Parse (_cca ,string (_acb .Data ));if _bafe !=nil {_bdg .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 (_acb .Data ),_bafe );};return _ecb ;};
|
||||
// GetTargetByRelId returns a target path with the associated relation ID.
|
||||
func (_bdfg Relationships )GetTargetByRelId (idAttr string )string {for _ ,_dcgc :=range _bdfg ._adc .Relationship {if _dcgc .IdAttr ==idAttr {return _dcgc .TargetAttr ;};};return "";};
|
@ -11,34 +11,34 @@
|
||||
|
||||
// Package license helps manage commercial licenses and check if they
|
||||
// are valid for the version of UniOffice used.
|
||||
package license ;import _ga "github.com/unidoc/unioffice/internal/license";
|
||||
|
||||
// MakeUnlicensedKey returns a default key.
|
||||
func MakeUnlicensedKey ()*LicenseKey {return _ga .MakeUnlicensedKey ()};
|
||||
|
||||
// LegacyLicense holds the old-style unioffice license information.
|
||||
type LegacyLicense =_ga .LegacyLicense ;
|
||||
|
||||
// SetLegacyLicenseKey installs a legacy license code. License codes issued prior to June 2019.
|
||||
// Will be removed at some point in a future major version.
|
||||
func SetLegacyLicenseKey (s string )error {return _ga .SetLegacyLicenseKey (s )};
|
||||
|
||||
// GetLicenseKey returns the currently loaded license key.
|
||||
func GetLicenseKey ()*LicenseKey {return _ga .GetLicenseKey ()};
|
||||
|
||||
// SetLicenseKey sets and validates the license key.
|
||||
func SetLicenseKey (content string ,customerName string )error {return _ga .SetLicenseKey (content ,customerName );};
|
||||
package license ;import _d "github.com/unidoc/unioffice/internal/license";
|
||||
|
||||
// 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 _ga .SetMeteredKey (apiKey )};const (LicenseTierUnlicensed =_ga .LicenseTierUnlicensed ;LicenseTierCommunity =_ga .LicenseTierCommunity ;LicenseTierIndividual =_ga .LicenseTierIndividual ;LicenseTierBusiness =_ga .LicenseTierBusiness ;);
|
||||
func SetMeteredKey (apiKey string )error {return _d .SetMeteredKey (apiKey )};
|
||||
|
||||
// LicenseKey represents a loaded license key.
|
||||
type LicenseKey =_d .LicenseKey ;
|
||||
|
||||
// SetLicenseKey sets and validates the license key.
|
||||
func SetLicenseKey (content string ,customerName string )error {return _d .SetLicenseKey (content ,customerName );};
|
||||
|
||||
// LegacyLicense holds the old-style unioffice license information.
|
||||
type LegacyLicense =_d .LegacyLicense ;const (LicenseTierUnlicensed =_d .LicenseTierUnlicensed ;LicenseTierCommunity =_d .LicenseTierCommunity ;LicenseTierIndividual =_d .LicenseTierIndividual ;LicenseTierBusiness =_d .LicenseTierBusiness ;);
|
||||
|
||||
// GetLicenseKey returns the currently loaded license key.
|
||||
func GetLicenseKey ()*LicenseKey {return _d .GetLicenseKey ()};
|
||||
|
||||
// GetMeteredState checks the currently used metered document usage status,
|
||||
// documents used and credits available.
|
||||
func GetMeteredState ()(_ga .MeteredStatus ,error ){return _ga .GetMeteredState ()};
|
||||
|
||||
// LicenseKey represents a loaded license key.
|
||||
type LicenseKey =_ga .LicenseKey ;
|
||||
func GetMeteredState ()(_d .MeteredStatus ,error ){return _d .GetMeteredState ()};
|
||||
|
||||
// LegacyLicenseType is the type of license
|
||||
type LegacyLicenseType =_ga .LegacyLicenseType ;
|
||||
type LegacyLicenseType =_d .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 _d .SetLegacyLicenseKey (s )};
|
||||
|
||||
// MakeUnlicensedKey returns a default key.
|
||||
func MakeUnlicensedKey ()*LicenseKey {return _d .MakeUnlicensedKey ()};
|
@ -9,93 +9,93 @@
|
||||
// Use of this source code is governed by the UniDoc End User License Agreement
|
||||
// terms that can be accessed at https://unidoc.io/eula/
|
||||
|
||||
package logger ;import (_c "fmt";_ea "io";_fd "os";_fg "path/filepath";_e "runtime";);
|
||||
package logger ;import (_b "fmt";_de "io";_a "os";_d "path/filepath";_c "runtime";);
|
||||
|
||||
// WriterLogger is the logger that writes data to the Output writer
|
||||
type WriterLogger struct{LogLevel LogLevel ;Output _ea .Writer ;};
|
||||
|
||||
// NewConsoleLogger creates new console logger.
|
||||
func NewConsoleLogger (logLevel LogLevel )*ConsoleLogger {return &ConsoleLogger {LogLevel :logLevel }};
|
||||
|
||||
// Warning logs warning message.
|
||||
func (_dc ConsoleLogger )Warning (format string ,args ...interface{}){if _dc .LogLevel >=LogLevelWarning {_cb :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_dc .output (_fd .Stdout ,_cb ,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 (_db WriterLogger )IsLogLevel (level LogLevel )bool {return _db .LogLevel >=level };
|
||||
|
||||
// Info does nothing for dummy logger.
|
||||
func (DummyLogger )Info (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 (_be ConsoleLogger )IsLogLevel (level LogLevel )bool {return _be .LogLevel >=level };
|
||||
|
||||
// Debug logs debug message.
|
||||
func (_ca ConsoleLogger )Debug (format string ,args ...interface{}){if _ca .LogLevel >=LogLevelDebug {_ge :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_ca .output (_a .Stdout ,_ge ,format ,args ...);};};
|
||||
|
||||
// ConsoleLogger is a logger that writes logs to the 'os.Stdout'
|
||||
type ConsoleLogger struct{LogLevel LogLevel ;};func (_cd WriterLogger )logToWriter (_egg _ea .Writer ,_gb string ,_ccg string ,_cge ...interface{}){_gga (_egg ,_gb ,_ccg ,_cge );};
|
||||
|
||||
// Debug logs debug message.
|
||||
func (_df ConsoleLogger )Debug (format string ,args ...interface{}){if _df .LogLevel >=LogLevelDebug {_fb :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_df .output (_fd .Stdout ,_fb ,format ,args ...);};};const (LogLevelTrace LogLevel =5;LogLevelDebug LogLevel =4;LogLevelInfo LogLevel =3;LogLevelNotice LogLevel =2;LogLevelWarning LogLevel =1;LogLevelError LogLevel =0;);
|
||||
|
||||
// Debug logs debug message.
|
||||
func (_aag WriterLogger )Debug (format string ,args ...interface{}){if _aag .LogLevel >=LogLevelDebug {_gg :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_aag .logToWriter (_aag .Output ,_gg ,format ,args ...);};};func (_aab ConsoleLogger )output (_ab _ea .Writer ,_g string ,_cbf string ,_dge ...interface{}){_gga (_ab ,_g ,_cbf ,_dge ...);};
|
||||
|
||||
// Info logs info message.
|
||||
func (_cc ConsoleLogger )Info (format string ,args ...interface{}){if _cc .LogLevel >=LogLevelInfo {_dg :="\u005bI\u004e\u0046\u004f\u005d\u0020";_cc .output (_fd .Stdout ,_dg ,format ,args ...);};};
|
||||
|
||||
// Trace does nothing for dummy logger.
|
||||
func (DummyLogger )Trace (format string ,args ...interface{}){};
|
||||
|
||||
// Error logs error message.
|
||||
func (_aa ConsoleLogger )Error (format string ,args ...interface{}){if _aa .LogLevel >=LogLevelError {_db :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_aa .output (_fd .Stdout ,_db ,format ,args ...);};};
|
||||
|
||||
// Notice logs notice message.
|
||||
func (_fa ConsoleLogger )Notice (format string ,args ...interface{}){if _fa .LogLevel >=LogLevelNotice {_ffb :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_fa .output (_fd .Stdout ,_ffb ,format ,args ...);};};
|
||||
type ConsoleLogger struct{LogLevel LogLevel ;};
|
||||
|
||||
// LogLevel is the verbosity level for logging.
|
||||
type LogLevel int ;
|
||||
|
||||
// Trace does nothing for dummy logger.
|
||||
func (DummyLogger )Trace (format string ,args ...interface{}){};
|
||||
|
||||
// SetLogger sets 'logger' to be used by the unidoc unipdf library.
|
||||
func SetLogger (logger Logger ){Log =logger };
|
||||
|
||||
// IsLogLevel returns true if log level is greater or equal than `level`.
|
||||
// Can be used to avoid resource intensive calls to loggers.
|
||||
func (_eegc ConsoleLogger )IsLogLevel (level LogLevel )bool {return _eegc .LogLevel >=level };
|
||||
|
||||
// IsLogLevel returns true from dummy logger.
|
||||
func (DummyLogger )IsLogLevel (level LogLevel )bool {return true };
|
||||
|
||||
// Warning does nothing for dummy logger.
|
||||
func (DummyLogger )Warning (format string ,args ...interface{}){};
|
||||
|
||||
// Trace logs trace message.
|
||||
func (_fe ConsoleLogger )Trace (format string ,args ...interface{}){if _fe .LogLevel >=LogLevelTrace {_agc :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_fe .output (_fd .Stdout ,_agc ,format ,args ...);};};
|
||||
|
||||
// DummyLogger does nothing.
|
||||
type DummyLogger struct{};
|
||||
|
||||
// Logger is the interface used for logging in the unipdf package.
|
||||
type Logger interface{Error (_b string ,_ee ...interface{});Warning (_eeg string ,_d ...interface{});Notice (_bb string ,_a ...interface{});Info (_ae string ,_ag ...interface{});Debug (_ed string ,_bbf ...interface{});Trace (_ff string ,_eef ...interface{});IsLogLevel (_bd LogLevel )bool ;};
|
||||
type Logger interface{Error (_cd string ,_dd ...interface{});Warning (_ab string ,_ea ...interface{});Notice (_cf string ,_df ...interface{});Info (_f string ,_abd ...interface{});Debug (_ff string ,_ac ...interface{});Trace (_g string ,_fg ...interface{});IsLogLevel (_gc LogLevel )bool ;};
|
||||
|
||||
// Notice does nothing for dummy logger.
|
||||
func (DummyLogger )Notice (format string ,args ...interface{}){};var Log Logger =DummyLogger {};func _gga (_cbb _ea .Writer ,_fba string ,_egb string ,_cgee ...interface{}){_ ,_ccc ,_gad ,_agb :=_e .Caller (3);if !_agb {_ccc ="\u003f\u003f\u003f";_gad =0;}else {_ccc =_fg .Base (_ccc );};_ef :=_c .Sprintf ("\u0025s\u0020\u0025\u0073\u003a\u0025\u0064 ",_fba ,_ccc ,_gad )+_egb +"\u000a";_c .Fprintf (_cbb ,_ef ,_cgee ...);};
|
||||
func (DummyLogger )Notice (format string ,args ...interface{}){};
|
||||
|
||||
// Error does nothing for dummy logger.
|
||||
func (DummyLogger )Error (format string ,args ...interface{}){};
|
||||
|
||||
// IsLogLevel returns true if log level is greater or equal than `level`.
|
||||
// Can be used to avoid resource intensive calls to loggers.
|
||||
func (_fab WriterLogger )IsLogLevel (level LogLevel )bool {return _fab .LogLevel >=level };
|
||||
// Warning logs warning message.
|
||||
func (_adb WriterLogger )Warning (format string ,args ...interface{}){if _adb .LogLevel >=LogLevelWarning {_ec :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_adb .logToWriter (_adb .Output ,_ec ,format ,args ...);};};
|
||||
|
||||
// Error logs error message.
|
||||
func (_de WriterLogger )Error (format string ,args ...interface{}){if _de .LogLevel >=LogLevelError {_dga :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_de .logToWriter (_de .Output ,_dga ,format ,args ...);};};
|
||||
func (_gd ConsoleLogger )Error (format string ,args ...interface{}){if _gd .LogLevel >=LogLevelError {_da :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_gd .output (_a .Stdout ,_da ,format ,args ...);};};
|
||||
|
||||
// NewWriterLogger creates new 'writer' logger.
|
||||
func NewWriterLogger (logLevel LogLevel ,writer _de .Writer )*WriterLogger {logger :=WriterLogger {Output :writer ,LogLevel :logLevel };return &logger ;};
|
||||
|
||||
// Debug logs debug message.
|
||||
func (_dbc WriterLogger )Debug (format string ,args ...interface{}){if _dbc .LogLevel >=LogLevelDebug {_ade :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_dbc .logToWriter (_dbc .Output ,_ade ,format ,args ...);};};
|
||||
|
||||
// Trace logs trace message.
|
||||
func (_gf ConsoleLogger )Trace (format string ,args ...interface{}){if _gf .LogLevel >=LogLevelTrace {_bb :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_gf .output (_a .Stdout ,_bb ,format ,args ...);};};
|
||||
|
||||
// Info logs info message.
|
||||
func (_gdg ConsoleLogger )Info (format string ,args ...interface{}){if _gdg .LogLevel >=LogLevelInfo {_ad :="\u005bI\u004e\u0046\u004f\u005d\u0020";_gdg .output (_a .Stdout ,_ad ,format ,args ...);};};
|
||||
|
||||
// Error logs error message.
|
||||
func (_aba WriterLogger )Error (format string ,args ...interface{}){if _aba .LogLevel >=LogLevelError {_bc :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_aba .logToWriter (_aba .Output ,_bc ,format ,args ...);};};func (_ded ConsoleLogger )output (_fb _de .Writer ,_fbc string ,_af string ,_eg ...interface{}){_acg (_fb ,_fbc ,_af ,_eg ...);};
|
||||
|
||||
// Notice logs notice message.
|
||||
func (_fe ConsoleLogger )Notice (format string ,args ...interface{}){if _fe .LogLevel >=LogLevelNotice {_bg :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_fe .output (_a .Stdout ,_bg ,format ,args ...);};};
|
||||
|
||||
// Debug does nothing for dummy logger.
|
||||
func (DummyLogger )Debug (format string ,args ...interface{}){};
|
||||
|
||||
// Info logs info message.
|
||||
func (_bg WriterLogger )Info (format string ,args ...interface{}){if _bg .LogLevel >=LogLevelInfo {_bbg :="\u005bI\u004e\u0046\u004f\u005d\u0020";_bg .logToWriter (_bg .Output ,_bbg ,format ,args ...);};};
|
||||
// Warning does nothing for dummy logger.
|
||||
func (DummyLogger )Warning (format string ,args ...interface{}){};
|
||||
|
||||
// DummyLogger does nothing.
|
||||
type DummyLogger struct{};
|
||||
|
||||
// Notice logs notice message.
|
||||
func (_gc WriterLogger )Notice (format string ,args ...interface{}){if _gc .LogLevel >=LogLevelNotice {_eg :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_gc .logToWriter (_gc .Output ,_eg ,format ,args ...);};};
|
||||
func (_cc WriterLogger )Notice (format string ,args ...interface{}){if _cc .LogLevel >=LogLevelNotice {_dg :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_cc .logToWriter (_cc .Output ,_dg ,format ,args ...);};};
|
||||
|
||||
// IsLogLevel returns true from dummy logger.
|
||||
func (DummyLogger )IsLogLevel (level LogLevel )bool {return true };func (_dc WriterLogger )logToWriter (_cdb _de .Writer ,_ef string ,_bcd string ,_fc ...interface{}){_acg (_cdb ,_ef ,_bcd ,_fc );};
|
||||
|
||||
// Info logs info message.
|
||||
func (_gfa WriterLogger )Info (format string ,args ...interface{}){if _gfa .LogLevel >=LogLevelInfo {_egf :="\u005bI\u004e\u0046\u004f\u005d\u0020";_gfa .logToWriter (_gfa .Output ,_egf ,format ,args ...);};};func _acg (_cba _de .Writer ,_cdf string ,_ba string ,_ee ...interface{}){_ ,_cgf ,_dbf ,_eaf :=_c .Caller (3);if !_eaf {_cgf ="\u003f\u003f\u003f";_dbf =0;}else {_cgf =_d .Base (_cgf );};_dga :=_b .Sprintf ("\u0025s\u0020\u0025\u0073\u003a\u0025\u0064 ",_cdf ,_cgf ,_dbf )+_ba +"\u000a";_b .Fprintf (_cba ,_dga ,_ee ...);};
|
||||
|
||||
// Trace logs trace message.
|
||||
func (_cg WriterLogger )Trace (format string ,args ...interface{}){if _cg .LogLevel >=LogLevelTrace {_gf :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_cg .logToWriter (_cg .Output ,_gf ,format ,args ...);};};
|
||||
func (_afb WriterLogger )Trace (format string ,args ...interface{}){if _afb .LogLevel >=LogLevelTrace {_cb :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_afb .logToWriter (_afb .Output ,_cb ,format ,args ...);};};
|
||||
|
||||
// NewWriterLogger creates new 'writer' logger.
|
||||
func NewWriterLogger (logLevel LogLevel ,writer _ea .Writer )*WriterLogger {logger :=WriterLogger {Output :writer ,LogLevel :logLevel };return &logger ;};
|
||||
// Error does nothing for dummy logger.
|
||||
func (DummyLogger )Error (format string ,args ...interface{}){};
|
||||
|
||||
// WriterLogger is the logger that writes data to the Output writer
|
||||
type WriterLogger struct{LogLevel LogLevel ;Output _de .Writer ;};
|
||||
|
||||
// Warning logs warning message.
|
||||
func (_ec WriterLogger )Warning (format string ,args ...interface{}){if _ec .LogLevel >=LogLevelWarning {_gaa :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_ec .logToWriter (_ec .Output ,_gaa ,format ,args ...);};};
|
||||
func (_cg ConsoleLogger )Warning (format string ,args ...interface{}){if _cg .LogLevel >=LogLevelWarning {_ffd :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_cg .output (_a .Stdout ,_ffd ,format ,args ...);};};
|
||||
|
||||
// NewConsoleLogger creates new console logger.
|
||||
func NewConsoleLogger (logLevel LogLevel )*ConsoleLogger {return &ConsoleLogger {LogLevel :logLevel }};const (LogLevelTrace LogLevel =5;LogLevelDebug LogLevel =4;LogLevelInfo LogLevel =3;LogLevelNotice LogLevel =2;LogLevelWarning LogLevel =1;LogLevelError LogLevel =0;);var Log Logger =DummyLogger {};
|
@ -11,22 +11,22 @@
|
||||
|
||||
// Package diskstore implements tempStorage interface
|
||||
// by using disk as a storage
|
||||
package diskstore ;import (_gag "github.com/unidoc/unioffice/common/tempstorage";_a "io/ioutil";_ga "os";_g "strings";);
|
||||
|
||||
// SetAsStorage sets temp storage as a disk storage
|
||||
func SetAsStorage (){_e :=diskStorage {};_gag .SetAsStorage (&_e )};
|
||||
package diskstore ;import (_bd "github.com/unidoc/unioffice/common/tempstorage";_g "io/ioutil";_ed "os";_e "strings";);
|
||||
|
||||
// Open opens file from disk according to a path
|
||||
func (_gf diskStorage )Open (path string )(_gag .File ,error ){return _ga .Open (path )};
|
||||
|
||||
// RemoveAll removes all files in the directory
|
||||
func (_d diskStorage )RemoveAll (dir string )error {if _g .HasPrefix (dir ,_ga .TempDir ()){return _ga .RemoveAll (dir );};return nil ;};
|
||||
func (_c diskStorage )Open (path string )(_bd .File ,error ){return _ed .OpenFile (path ,_ed .O_RDWR ,0644);};
|
||||
|
||||
// Add is not applicable in the diskstore implementation
|
||||
func (_gd diskStorage )Add (path string )error {return nil };type diskStorage struct{};
|
||||
func (_cg diskStorage )Add (path string )error {return nil };
|
||||
|
||||
// TempFile creates a new temp directory by calling ioutil TempDir
|
||||
func (_b diskStorage )TempDir (pattern string )(string ,error ){return _a .TempDir ("",pattern )};
|
||||
// SetAsStorage sets temp storage as a disk storage
|
||||
func SetAsStorage (){_ga :=diskStorage {};_bd .SetAsStorage (&_ga )};type diskStorage struct{};
|
||||
|
||||
// TempFile creates a new temp file by calling ioutil TempFile
|
||||
func (_c diskStorage )TempFile (dir ,pattern string )(_gag .File ,error ){return _a .TempFile (dir ,pattern );};
|
||||
func (_gg diskStorage )TempFile (dir ,pattern string )(_bd .File ,error ){return _g .TempFile (dir ,pattern );};
|
||||
|
||||
// TempFile creates a new temp directory by calling ioutil TempDir
|
||||
func (_eg diskStorage )TempDir (pattern string )(string ,error ){return _g .TempDir ("",pattern )};
|
||||
|
||||
// RemoveAll removes all files in the directory
|
||||
func (_d diskStorage )RemoveAll (dir string )error {if _e .HasPrefix (dir ,_ed .TempDir ()){return _ed .RemoveAll (dir );};return nil ;};
|
@ -11,34 +11,38 @@
|
||||
|
||||
// Package memstore implements tempStorage interface
|
||||
// by using memory as a storage
|
||||
package memstore ;import (_c "encoding/hex";_e "errors";_gf "fmt";_eb "github.com/unidoc/unioffice/common/tempstorage";_g "io";_fb "io/ioutil";_d "math/rand";_fc "sync";);
|
||||
|
||||
// Name returns the filename of the underlying memDataCell
|
||||
func (_b *memFile )Name ()string {return _b ._ga ._bd };
|
||||
|
||||
// TempDir creates a name for a new temp directory using a pattern argument
|
||||
func (_gad *memStorage )TempDir (pattern string )(string ,error ){return _bg (pattern ),nil };
|
||||
|
||||
// Read reads from the underlying memDataCell in order to implement Reader interface
|
||||
func (_a *memFile )Read (p []byte )(int ,error ){_gg :=_a ._de ;_fg :=_a ._ga ._fbe ;_gfe :=int64 (len (p ));if _gfe > _fg {_gfe =_fg ;p =p [:_gfe ];};if _gg >=_fg {return 0,_g .EOF ;};_dc :=_gg +_gfe ;if _dc >=_fg {_dc =_fg ;};_dg :=copy (p ,_a ._ga ._cd [_gg :_dc ]);_a ._de =_dc ;return _dg ,nil ;};
|
||||
|
||||
// Open returns tempstorage File object by name
|
||||
func (_ce *memStorage )Open (path string )(_eb .File ,error ){_ced ,_bf :=_ce ._fd .Load (path );if !_bf {return nil ,_e .New (_gf .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 {_ga :_ced .(*memDataCell )},nil ;};
|
||||
|
||||
// Close is not applicable in this implementation
|
||||
func (_ebg *memFile )Close ()error {return nil };
|
||||
|
||||
// Add reads a file from a disk and adds it to the storage
|
||||
func (_ab *memStorage )Add (path string )error {_ ,_gb :=_ab ._fd .Load (path );if _gb {return nil ;};_cf ,_aa :=_fb .ReadFile (path );if _aa !=nil {return _aa ;};_ab ._fd .Store (path ,&memDataCell {_bd :path ,_cd :_cf ,_fbe :int64 (len (_cf ))});return nil ;};
|
||||
package memstore ;import (_ab "encoding/hex";_bf "errors";_e "fmt";_cf "github.com/unidoc/unioffice/common/tempstorage";_g "io";_c "io/ioutil";_a "math/rand";_gf "sync";);type memStorage struct{_abd _gf .Map };func _ca (_gd string )string {_bbe ,_ :=_db (6);return _gd +_bbe };
|
||||
|
||||
// Write writes to the end of the underlying memDataCell in order to implement Writer interface
|
||||
func (_fe *memFile )Write (p []byte )(int ,error ){_fe ._ga ._cd =append (_fe ._ga ._cd ,p ...);_fe ._ga ._fbe +=int64 (len (p ));return len (p ),nil ;};type memDataCell struct{_bd string ;_cd []byte ;_fbe int64 ;};func _ee (_af int )(string ,error ){_ca :=make ([]byte ,_af );if _ ,_aad :=_d .Read (_ca );_aad !=nil {return "",_aad ;};return _c .EncodeToString (_ca ),nil ;};
|
||||
func (_de *memFile )Write (p []byte )(int ,error ){_de ._ce ._cb =append (_de ._ce ._cb ,p ...);_de ._ce ._dd +=int64 (len (p ));return len (p ),nil ;};
|
||||
|
||||
// RemoveAll removes all files according to the dir argument prefix
|
||||
func (_fbef *memStorage )RemoveAll (dir string )error {_fbef ._fd .Range (func (_bb ,_ec interface{})bool {_fbef ._fd .Delete (_bb );return true });return nil ;};type memFile struct{_ga *memDataCell ;_de int64 ;};
|
||||
// Read reads from the underlying memDataCell in order to implement Reader interface
|
||||
func (_f *memFile )Read (p []byte )(int ,error ){_d :=_f ._gc ;_eb :=_f ._ce ._dd ;_abe :=int64 (len (p ));if _abe > _eb {_abe =_eb ;p =p [:_abe ];};if _d >=_eb {return 0,_g .EOF ;};_ag :=_d +_abe ;if _ag >=_eb {_ag =_eb ;};_bc :=copy (p ,_f ._ce ._cb [_d :_ag ]);_f ._gc =_ag ;return _bc ,nil ;};type memDataCell struct{_cec string ;_cb []byte ;_dd int64 ;};
|
||||
|
||||
// SetAsStorage sets temp storage as a memory storage
|
||||
func SetAsStorage (){_ggg :=memStorage {_fd :_fc .Map {}};_eb .SetAsStorage (&_ggg )};type memStorage struct{_fd _fc .Map };
|
||||
// Open returns tempstorage File object by name
|
||||
func (_aa *memStorage )Open (path string )(_cf .File ,error ){_efe ,_age :=_aa ._abd .Load (path );if !_age {return nil ,_bf .New (_e .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 {_ce :_efe .(*memDataCell )},nil ;};
|
||||
|
||||
// Name returns the filename of the underlying memDataCell
|
||||
func (_bfg *memFile )Name ()string {return _bfg ._ce ._cec };
|
||||
|
||||
// TempFile creates a new empty file in the storage and returns it
|
||||
func (_gfef *memStorage )TempFile (dir ,pattern string )(_eb .File ,error ){_be :=dir +"\u002f"+_bg (pattern );_bfc :=&memDataCell {_bd :_be ,_cd :[]byte {}};_da :=&memFile {_ga :_bfc };_gfef ._fd .Store (_be ,_bfc );return _da ,nil ;};func _bg (_ff string )string {_cb ,_ :=_ee (6);return _ff +_cb };
|
||||
func (_bb *memStorage )TempFile (dir ,pattern string )(_cf .File ,error ){_fe :=dir +"\u002f"+_ca (pattern );_gcf :=&memDataCell {_cec :_fe ,_cb :[]byte {}};_aae :=&memFile {_ce :_gcf };_bb ._abd .Store (_fe ,_gcf );return _aae ,nil ;};
|
||||
|
||||
// ReadAt reads from the underlying memDataCell at an offset provided in order to implement ReaderAt interface.
|
||||
// It does not affect f.readOffset.
|
||||
func (_bfb *memFile )ReadAt (p []byte ,readOffset int64 )(int ,error ){_df :=_bfb ._ce ._dd ;_ac :=int64 (len (p ));if _ac > _df {_ac =_df ;p =p [:_ac ];};if readOffset >=_df {return 0,_g .EOF ;};_ef :=readOffset +_ac ;if _ef >=_df {_ef =_df ;};_ed :=copy (p ,_bfb ._ce ._cb [readOffset :_ef ]);return _ed ,nil ;};
|
||||
|
||||
// Close is not applicable in this implementation
|
||||
func (_ea *memFile )Close ()error {return nil };func _db (_fc int )(string ,error ){_ccb :=make ([]byte ,_fc );if _ ,_cee :=_a .Read (_ccb );_cee !=nil {return "",_cee ;};return _ab .EncodeToString (_ccb ),nil ;};type memFile struct{_ce *memDataCell ;_gc int64 ;};
|
||||
|
||||
// Add reads a file from a disk and adds it to the storage
|
||||
func (_cbg *memStorage )Add (path string )error {_ ,_cd :=_cbg ._abd .Load (path );if _cd {return nil ;};_eg ,_efb :=_c .ReadFile (path );if _efb !=nil {return _efb ;};_cbg ._abd .Store (path ,&memDataCell {_cec :path ,_cb :_eg ,_dd :int64 (len (_eg ))});return nil ;};
|
||||
|
||||
// RemoveAll removes all files according to the dir argument prefix
|
||||
func (_cc *memStorage )RemoveAll (dir string )error {_cc ._abd .Range (func (_gfc ,_bbb interface{})bool {_cc ._abd .Delete (_gfc );return true });return nil ;};
|
||||
|
||||
// SetAsStorage sets temp storage as a memory storage
|
||||
func SetAsStorage (){_cfc :=memStorage {_abd :_gf .Map {}};_cf .SetAsStorage (&_cfc )};
|
||||
|
||||
// TempDir creates a name for a new temp directory using a pattern argument
|
||||
func (_ga *memStorage )TempDir (pattern string )(string ,error ){return _ca (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 _g "io";
|
||||
|
||||
// TempDir creates a name for a new temp directory using a pattern argument.
|
||||
func TempDir (pattern string )(string ,error ){return _ee .TempDir (pattern )};
|
||||
|
||||
// RemoveAll removes all files according to the dir argument prefix.
|
||||
func RemoveAll (dir string )error {return _ee .RemoveAll (dir )};
|
||||
package tempstorage ;import _d "io";var _g storage ;
|
||||
|
||||
// File is a representation of a storage file
|
||||
// with Read, Write, Close and Name methods identical to os.File.
|
||||
type File interface{_g .Reader ;_g .Writer ;_g .Closer ;Name ()string ;};
|
||||
type File interface{_d .Reader ;_d .ReaderAt ;_d .Writer ;_d .Closer ;Name ()string ;};type storage interface{Open (_e string )(File ,error );TempFile (_b ,_dd string )(File ,error );TempDir (_c string )(string ,error );RemoveAll (_bd string )error ;Add (_dc string )error ;};
|
||||
|
||||
// TempFile creates new empty file in the storage and returns it.
|
||||
func TempFile (dir ,pattern string )(File ,error ){return _ee .TempFile (dir ,pattern )};
|
||||
func TempFile (dir ,pattern string )(File ,error ){return _g .TempFile (dir ,pattern )};
|
||||
|
||||
// Add reads a file from a disk and adds it to the storage.
|
||||
func Add (path string )error {return _ee .Add (path )};var _ee storage ;
|
||||
|
||||
// SetAsStorage changes temporary storage to newStorage.
|
||||
func SetAsStorage (newStorage storage ){_ee =newStorage };type storage interface{Open (_e string )(File ,error );TempFile (_ga ,_b string )(File ,error );TempDir (_ea string )(string ,error );RemoveAll (_c string )error ;Add (_d string )error ;};
|
||||
func Add (path string )error {return _g .Add (path )};
|
||||
|
||||
// Open returns tempstorage File object by name.
|
||||
func Open (path string )(File ,error ){return _ee .Open (path )};
|
||||
func Open (path string )(File ,error ){return _g .Open (path )};
|
||||
|
||||
// RemoveAll removes all files according to the dir argument prefix.
|
||||
func RemoveAll (dir string )error {return _g .RemoveAll (dir )};
|
||||
|
||||
// SetAsStorage changes temporary storage to newStorage.
|
||||
func SetAsStorage (newStorage storage ){_g =newStorage };
|
||||
|
||||
// TempDir creates a name for a new temp directory using a pattern argument.
|
||||
func TempDir (pattern string )(string ,error ){return _g .TempDir (pattern )};
|
File diff suppressed because one or more lines are too long
3152
document/document.go
3152
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 (_ff "github.com/unidoc/unioffice";_c "github.com/unidoc/unioffice/color";_g "github.com/unidoc/unioffice/measurement";_fc "github.com/unidoc/unioffice/schema/soo/dml";);
|
||||
package drawing ;import (_a "github.com/unidoc/unioffice";_d "github.com/unidoc/unioffice/color";_e "github.com/unidoc/unioffice/measurement";_g "github.com/unidoc/unioffice/schema/soo/dml";);func (_ab LineProperties )clearFill (){_ab ._dd .NoFill =nil ;_ab ._dd .GradFill =nil ;_ab ._dd .SolidFill =nil ;_ab ._dd .PattFill =nil ;};
|
||||
|
||||
// Properties returns the paragraph properties.
|
||||
func (_dd Paragraph )Properties ()ParagraphProperties {if _dd ._fe .PPr ==nil {_dd ._fe .PPr =_fc .NewCT_TextParagraphProperties ();};return MakeParagraphProperties (_dd ._fe .PPr );};
|
||||
// MakeParagraphProperties constructs a new ParagraphProperties wrapper.
|
||||
func MakeParagraphProperties (x *_g .CT_TextParagraphProperties )ParagraphProperties {return ParagraphProperties {x };};
|
||||
|
||||
// SetSize sets the width and height of the shape.
|
||||
func (_dab ShapeProperties )SetSize (w ,h _g .Distance ){_dab .SetWidth (w );_dab .SetHeight (h )};
|
||||
|
||||
// SetBold controls the bolding of a run.
|
||||
func (_ga RunProperties )SetBold (b bool ){_ga ._aa .BAttr =_ff .Bool (b )};
|
||||
|
||||
// SetNumbered controls if bullets are numbered or not.
|
||||
func (_ee ParagraphProperties )SetNumbered (scheme _fc .ST_TextAutonumberScheme ){if scheme ==_fc .ST_TextAutonumberSchemeUnset {_ee ._ce .BuAutoNum =nil ;}else {_ee ._ce .BuAutoNum =_fc .NewCT_TextAutonumberBullet ();_ee ._ce .BuAutoNum .TypeAttr =scheme ;};};func (_gg ShapeProperties )SetSolidFill (c _c .Color ){_gg .clearFill ();_gg ._da .SolidFill =_fc .NewCT_SolidColorFillProperties ();_gg ._da .SolidFill .SrgbClr =_fc .NewCT_SRgbColor ();_gg ._da .SolidFill .SrgbClr .ValAttr =*c .AsRGBString ();};
|
||||
// LineJoin is the type of line join
|
||||
type LineJoin byte ;
|
||||
|
||||
// SetWidth sets the line width, MS products treat zero as the minimum width
|
||||
// that can be displayed.
|
||||
func (_af LineProperties )SetWidth (w _g .Distance ){_af ._b .WAttr =_ff .Int32 (int32 (w /_g .EMU ))};
|
||||
|
||||
// SetBulletFont controls the font for the bullet character.
|
||||
func (_be ParagraphProperties )SetBulletFont (f string ){if f ==""{_be ._ce .BuFont =nil ;}else {_be ._ce .BuFont =_fc .NewCT_TextFont ();_be ._ce .BuFont .TypefaceAttr =f ;};};
|
||||
|
||||
// SetFlipVertical controls if the shape is flipped vertically.
|
||||
func (_ac ShapeProperties )SetFlipVertical (b bool ){_ac .ensureXfrm ();if !b {_ac ._da .Xfrm .FlipVAttr =nil ;}else {_ac ._da .Xfrm .FlipVAttr =_ff .Bool (true );};};
|
||||
|
||||
// MakeRun constructs a new Run wrapper.
|
||||
func MakeRun (x *_fc .EG_TextRun )Run {return Run {x }};func (_fd ShapeProperties )SetNoFill (){_fd .clearFill ();_fd ._da .NoFill =_fc .NewCT_NoFillProperties ();};
|
||||
|
||||
// ParagraphProperties allows controlling paragraph properties.
|
||||
type ParagraphProperties struct{_ce *_fc .CT_TextParagraphProperties ;};
|
||||
|
||||
// SetJoin sets the line join style.
|
||||
func (_ef LineProperties )SetJoin (e LineJoin ){_ef ._b .Round =nil ;_ef ._b .Miter =nil ;_ef ._b .Bevel =nil ;switch e {case LineJoinRound :_ef ._b .Round =_fc .NewCT_LineJoinRound ();case LineJoinBevel :_ef ._b .Bevel =_fc .NewCT_LineJoinBevel ();case LineJoinMiter :_ef ._b .Miter =_fc .NewCT_LineJoinMiterProperties ();};};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_ea ShapeProperties )X ()*_fc .CT_ShapeProperties {return _ea ._da };
|
||||
|
||||
// Properties returns the run's properties.
|
||||
func (_dbe Run )Properties ()RunProperties {if _dbe ._eee .R ==nil {_dbe ._eee .R =_fc .NewCT_RegularTextRun ();};if _dbe ._eee .R .RPr ==nil {_dbe ._eee .R .RPr =_fc .NewCT_TextCharacterProperties ();};return RunProperties {_dbe ._eee .R .RPr };};
|
||||
|
||||
// AddRun adds a new run to a paragraph.
|
||||
func (_cg Paragraph )AddRun ()Run {_fg :=MakeRun (_fc .NewEG_TextRun ());_cg ._fe .EG_TextRun =append (_cg ._fe .EG_TextRun ,_fg .X ());return _fg ;};
|
||||
|
||||
// SetWidth sets the width of the shape.
|
||||
func (_cb ShapeProperties )SetWidth (w _g .Distance ){_cb .ensureXfrm ();if _cb ._da .Xfrm .Ext ==nil {_cb ._da .Xfrm .Ext =_fc .NewCT_PositiveSize2D ();};_cb ._da .Xfrm .Ext .CxAttr =int64 (w /_g .EMU );};func MakeShapeProperties (x *_fc .CT_ShapeProperties )ShapeProperties {return ShapeProperties {x }};
|
||||
|
||||
// Paragraph is a paragraph within a document.
|
||||
type Paragraph struct{_fe *_fc .CT_TextParagraph };
|
||||
|
||||
// SetText sets the run's text contents.
|
||||
func (_eg Run )SetText (s string ){_eg ._eee .Br =nil ;_eg ._eee .Fld =nil ;if _eg ._eee .R ==nil {_eg ._eee .R =_fc .NewCT_RegularTextRun ();};_eg ._eee .R .T =s ;};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_db ParagraphProperties )X ()*_fc .CT_TextParagraphProperties {return _db ._ce };type ShapeProperties struct{_da *_fc .CT_ShapeProperties };
|
||||
|
||||
// SetBulletChar sets the bullet character for the paragraph.
|
||||
func (_bd ParagraphProperties )SetBulletChar (c string ){if c ==""{_bd ._ce .BuChar =nil ;}else {_bd ._ce .BuChar =_fc .NewCT_TextCharBullet ();_bd ._ce .BuChar .CharAttr =c ;};};
|
||||
|
||||
// GetPosition gets the position of the shape in EMU.
|
||||
func (_eb ShapeProperties )GetPosition ()(int64 ,int64 ){_eb .ensureXfrm ();if _eb ._da .Xfrm .Off ==nil {_eb ._da .Xfrm .Off =_fc .NewCT_Point2D ();};return *_eb ._da .Xfrm .Off .XAttr .ST_CoordinateUnqualified ,*_eb ._da .Xfrm .Off .YAttr .ST_CoordinateUnqualified ;};
|
||||
|
||||
// SetAlign controls the paragraph alignment
|
||||
func (_fa ParagraphProperties )SetAlign (a _fc .ST_TextAlignType ){_fa ._ce .AlgnAttr =a };
|
||||
|
||||
// SetGeometry sets the shape type of the shape
|
||||
func (_fgc ShapeProperties )SetGeometry (g _fc .ST_ShapeType ){if _fgc ._da .PrstGeom ==nil {_fgc ._da .PrstGeom =_fc .NewCT_PresetGeometry2D ();};_fgc ._da .PrstGeom .PrstAttr =g ;};func (_ba LineProperties )SetSolidFill (c _c .Color ){_ba .clearFill ();_ba ._b .SolidFill =_fc .NewCT_SolidColorFillProperties ();_ba ._b .SolidFill .SrgbClr =_fc .NewCT_SRgbColor ();_ba ._b .SolidFill .SrgbClr .ValAttr =*c .AsRGBString ();};func (_e LineProperties )SetNoFill (){_e .clearFill ();_e ._b .NoFill =_fc .NewCT_NoFillProperties ()};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_a LineProperties )X ()*_fc .CT_LineProperties {return _a ._b };
|
||||
|
||||
// SetSize sets the font size of the run text
|
||||
func (_df RunProperties )SetSize (sz _g .Distance ){_df ._aa .SzAttr =_ff .Int32 (int32 (sz /_g .HundredthPoint ));};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_bg Run )X ()*_fc .EG_TextRun {return _bg ._eee };func (_de ShapeProperties )ensureXfrm (){if _de ._da .Xfrm ==nil {_de ._da .Xfrm =_fc .NewCT_Transform2D ();};};
|
||||
|
||||
// SetFlipHorizontal controls if the shape is flipped horizontally.
|
||||
func (_dea ShapeProperties )SetFlipHorizontal (b bool ){_dea .ensureXfrm ();if !b {_dea ._da .Xfrm .FlipHAttr =nil ;}else {_dea ._da .Xfrm .FlipHAttr =_ff .Bool (true );};};
|
||||
func (_ae LineProperties )SetWidth (w _e .Distance ){_ae ._dd .WAttr =_a .Int32 (int32 (w /_e .EMU ))};
|
||||
|
||||
// SetPosition sets the position of the shape.
|
||||
func (_dgf ShapeProperties )SetPosition (x ,y _g .Distance ){_dgf .ensureXfrm ();if _dgf ._da .Xfrm .Off ==nil {_dgf ._da .Xfrm .Off =_fc .NewCT_Point2D ();};_dgf ._da .Xfrm .Off .XAttr .ST_CoordinateUnqualified =_ff .Int64 (int64 (x /_g .EMU ));_dgf ._da .Xfrm .Off .YAttr .ST_CoordinateUnqualified =_ff .Int64 (int64 (y /_g .EMU ));};const (LineJoinRound LineJoin =iota ;LineJoinBevel ;LineJoinMiter ;);
|
||||
func (_abg ShapeProperties )SetPosition (x ,y _e .Distance ){_abg .ensureXfrm ();if _abg ._ee .Xfrm .Off ==nil {_abg ._ee .Xfrm .Off =_g .NewCT_Point2D ();};_abg ._ee .Xfrm .Off .XAttr .ST_CoordinateUnqualified =_a .Int64 (int64 (x /_e .EMU ));_abg ._ee .Xfrm .Off .YAttr .ST_CoordinateUnqualified =_a .Int64 (int64 (y /_e .EMU ));};
|
||||
|
||||
// MakeParagraph constructs a new paragraph wrapper.
|
||||
func MakeParagraph (x *_fc .CT_TextParagraph )Paragraph {return Paragraph {x }};
|
||||
|
||||
// Run is a run within a paragraph.
|
||||
type Run struct{_eee *_fc .EG_TextRun };func (_ad ShapeProperties )clearFill (){_ad ._da .NoFill =nil ;_ad ._da .BlipFill =nil ;_ad ._da .GradFill =nil ;_ad ._da .GrpFill =nil ;_ad ._da .SolidFill =nil ;_ad ._da .PattFill =nil ;};
|
||||
|
||||
// SetSolidFill controls the text color of a run.
|
||||
func (_eeg RunProperties )SetSolidFill (c _c .Color ){_eeg ._aa .NoFill =nil ;_eeg ._aa .BlipFill =nil ;_eeg ._aa .GradFill =nil ;_eeg ._aa .GrpFill =nil ;_eeg ._aa .PattFill =nil ;_eeg ._aa .SolidFill =_fc .NewCT_SolidColorFillProperties ();_eeg ._aa .SolidFill .SrgbClr =_fc .NewCT_SRgbColor ();_eeg ._aa .SolidFill .SrgbClr .ValAttr =*c .AsRGBString ();};
|
||||
|
||||
// SetHeight sets the height of the shape.
|
||||
func (_bc ShapeProperties )SetHeight (h _g .Distance ){_bc .ensureXfrm ();if _bc ._da .Xfrm .Ext ==nil {_bc ._da .Xfrm .Ext =_fc .NewCT_PositiveSize2D ();};_bc ._da .Xfrm .Ext .CyAttr =int64 (h /_g .EMU );};
|
||||
|
||||
// SetFont controls the font of a run.
|
||||
func (_eeee RunProperties )SetFont (s string ){_eeee ._aa .Latin =_fc .NewCT_TextFont ();_eeee ._aa .Latin .TypefaceAttr =s ;};
|
||||
// GetPosition gets the position of the shape in EMU.
|
||||
func (_gee ShapeProperties )GetPosition ()(int64 ,int64 ){_gee .ensureXfrm ();if _gee ._ee .Xfrm .Off ==nil {_gee ._ee .Xfrm .Off =_g .NewCT_Point2D ();};return *_gee ._ee .Xfrm .Off .XAttr .ST_CoordinateUnqualified ,*_gee ._ee .Xfrm .Off .YAttr .ST_CoordinateUnqualified ;};const (LineJoinRound LineJoin =iota ;LineJoinBevel ;LineJoinMiter ;);func (_ef LineProperties )SetSolidFill (c _d .Color ){_ef .clearFill ();_ef ._dd .SolidFill =_g .NewCT_SolidColorFillProperties ();_ef ._dd .SolidFill .SrgbClr =_g .NewCT_SRgbColor ();_ef ._dd .SolidFill .SrgbClr .ValAttr =*c .AsRGBString ();};
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_afg Paragraph )X ()*_fc .CT_TextParagraph {return _afg ._fe };
|
||||
func (_dde LineProperties )X ()*_g .CT_LineProperties {return _dde ._dd };
|
||||
|
||||
// Properties returns the paragraph properties.
|
||||
func (_db Paragraph )Properties ()ParagraphProperties {if _db ._eb .PPr ==nil {_db ._eb .PPr =_g .NewCT_TextParagraphProperties ();};return MakeParagraphProperties (_db ._eb .PPr );};
|
||||
|
||||
// SetLevel sets the level of indentation of a paragraph.
|
||||
func (_cc ParagraphProperties )SetLevel (idx int32 ){_cc ._ce .LvlAttr =_ff .Int32 (idx )};type LineProperties struct{_b *_fc .CT_LineProperties };
|
||||
func (_c ParagraphProperties )SetLevel (idx int32 ){_c ._af .LvlAttr =_a .Int32 (idx )};
|
||||
|
||||
// LineJoin is the type of line join
|
||||
type LineJoin byte ;func (_d LineProperties )clearFill (){_d ._b .NoFill =nil ;_d ._b .GradFill =nil ;_d ._b .SolidFill =nil ;_d ._b .PattFill =nil ;};
|
||||
// SetSize sets the font size of the run text
|
||||
func (_cb RunProperties )SetSize (sz _e .Distance ){_cb ._ca .SzAttr =_a .Int32 (int32 (sz /_e .HundredthPoint ));};
|
||||
|
||||
// AddBreak adds a new line break to a paragraph.
|
||||
func (_dg Paragraph )AddBreak (){_gc :=_fc .NewEG_TextRun ();_gc .Br =_fc .NewCT_TextLineBreak ();_dg ._fe .EG_TextRun =append (_dg ._fe .EG_TextRun ,_gc );};
|
||||
// SetBold controls the bolding of a run.
|
||||
func (_be RunProperties )SetBold (b bool ){_be ._ca .BAttr =_a .Bool (b )};
|
||||
|
||||
// MakeRunProperties constructs a new RunProperties wrapper.
|
||||
func MakeRunProperties (x *_fc .CT_TextCharacterProperties )RunProperties {return RunProperties {x }};
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_aag Run )X ()*_g .EG_TextRun {return _aag ._fc };func (_dbc ShapeProperties )ensureXfrm (){if _dbc ._ee .Xfrm ==nil {_dbc ._ee .Xfrm =_g .NewCT_Transform2D ();};};
|
||||
|
||||
// SetAlign controls the paragraph alignment
|
||||
func (_efb ParagraphProperties )SetAlign (a _g .ST_TextAlignType ){_efb ._af .AlgnAttr =a };
|
||||
|
||||
// RunProperties controls the run properties.
|
||||
type RunProperties struct{_aa *_fc .CT_TextCharacterProperties ;};func (_gb ShapeProperties )LineProperties ()LineProperties {if _gb ._da .Ln ==nil {_gb ._da .Ln =_fc .NewCT_LineProperties ();};return LineProperties {_gb ._da .Ln };};
|
||||
type RunProperties struct{_ca *_g .CT_TextCharacterProperties ;};func (_da LineProperties )SetNoFill (){_da .clearFill ();_da ._dd .NoFill =_g .NewCT_NoFillProperties ()};
|
||||
|
||||
// MakeParagraphProperties constructs a new ParagraphProperties wrapper.
|
||||
func MakeParagraphProperties (x *_fc .CT_TextParagraphProperties )ParagraphProperties {return ParagraphProperties {x };};
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_bf ParagraphProperties )X ()*_g .CT_TextParagraphProperties {return _bf ._af };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_eeg ShapeProperties )X ()*_g .CT_ShapeProperties {return _eeg ._ee };
|
||||
|
||||
// MakeRun constructs a new Run wrapper.
|
||||
func MakeRun (x *_g .EG_TextRun )Run {return Run {x }};
|
||||
|
||||
// SetFlipHorizontal controls if the shape is flipped horizontally.
|
||||
func (_ac ShapeProperties )SetFlipHorizontal (b bool ){_ac .ensureXfrm ();if !b {_ac ._ee .Xfrm .FlipHAttr =nil ;}else {_ac ._ee .Xfrm .FlipHAttr =_a .Bool (true );};};
|
||||
|
||||
// Paragraph is a paragraph within a document.
|
||||
type Paragraph struct{_eb *_g .CT_TextParagraph };
|
||||
|
||||
// SetSolidFill controls the text color of a run.
|
||||
func (_baf RunProperties )SetSolidFill (c _d .Color ){_baf ._ca .NoFill =nil ;_baf ._ca .BlipFill =nil ;_baf ._ca .GradFill =nil ;_baf ._ca .GrpFill =nil ;_baf ._ca .PattFill =nil ;_baf ._ca .SolidFill =_g .NewCT_SolidColorFillProperties ();_baf ._ca .SolidFill .SrgbClr =_g .NewCT_SRgbColor ();_baf ._ca .SolidFill .SrgbClr .ValAttr =*c .AsRGBString ();};
|
||||
|
||||
// MakeParagraph constructs a new paragraph wrapper.
|
||||
func MakeParagraph (x *_g .CT_TextParagraph )Paragraph {return Paragraph {x }};
|
||||
|
||||
// SetFont controls the font of a run.
|
||||
func (_bfe RunProperties )SetFont (s string ){_bfe ._ca .Latin =_g .NewCT_TextFont ();_bfe ._ca .Latin .TypefaceAttr =s ;};
|
||||
|
||||
// Properties returns the run's properties.
|
||||
func (_cc Run )Properties ()RunProperties {if _cc ._fc .R ==nil {_cc ._fc .R =_g .NewCT_RegularTextRun ();};if _cc ._fc .R .RPr ==nil {_cc ._fc .R .RPr =_g .NewCT_TextCharacterProperties ();};return RunProperties {_cc ._fc .R .RPr };};type ShapeProperties struct{_ee *_g .CT_ShapeProperties };
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (_gg Paragraph )X ()*_g .CT_TextParagraph {return _gg ._eb };
|
||||
|
||||
// SetHeight sets the height of the shape.
|
||||
func (_dce ShapeProperties )SetHeight (h _e .Distance ){_dce .ensureXfrm ();if _dce ._ee .Xfrm .Ext ==nil {_dce ._ee .Xfrm .Ext =_g .NewCT_PositiveSize2D ();};_dce ._ee .Xfrm .Ext .CyAttr =int64 (h /_e .EMU );};
|
||||
|
||||
// AddBreak adds a new line break to a paragraph.
|
||||
func (_gf Paragraph )AddBreak (){_f :=_g .NewEG_TextRun ();_f .Br =_g .NewCT_TextLineBreak ();_gf ._eb .EG_TextRun =append (_gf ._eb .EG_TextRun ,_f );};
|
||||
|
||||
// SetGeometry sets the shape type of the shape
|
||||
func (_bd ShapeProperties )SetGeometry (g _g .ST_ShapeType ){if _bd ._ee .PrstGeom ==nil {_bd ._ee .PrstGeom =_g .NewCT_PresetGeometry2D ();};_bd ._ee .PrstGeom .PrstAttr =g ;};func (_dcb ShapeProperties )clearFill (){_dcb ._ee .NoFill =nil ;_dcb ._ee .BlipFill =nil ;_dcb ._ee .GradFill =nil ;_dcb ._ee .GrpFill =nil ;_dcb ._ee .SolidFill =nil ;_dcb ._ee .PattFill =nil ;};func (_fg ShapeProperties )SetNoFill (){_fg .clearFill ();_fg ._ee .NoFill =_g .NewCT_NoFillProperties ()};
|
||||
|
||||
// MakeRunProperties constructs a new RunProperties wrapper.
|
||||
func MakeRunProperties (x *_g .CT_TextCharacterProperties )RunProperties {return RunProperties {x }};
|
||||
|
||||
// Run is a run within a paragraph.
|
||||
type Run struct{_fc *_g .EG_TextRun };
|
||||
|
||||
// SetSize sets the width and height of the shape.
|
||||
func (_eg ShapeProperties )SetSize (w ,h _e .Distance ){_eg .SetWidth (w );_eg .SetHeight (h )};
|
||||
|
||||
// SetText sets the run's text contents.
|
||||
func (_fa Run )SetText (s string ){_fa ._fc .Br =nil ;_fa ._fc .Fld =nil ;if _fa ._fc .R ==nil {_fa ._fc .R =_g .NewCT_RegularTextRun ();};_fa ._fc .R .T =s ;};
|
||||
|
||||
// SetBulletFont controls the font for the bullet character.
|
||||
func (_bc ParagraphProperties )SetBulletFont (f string ){if f ==""{_bc ._af .BuFont =nil ;}else {_bc ._af .BuFont =_g .NewCT_TextFont ();_bc ._af .BuFont .TypefaceAttr =f ;};};
|
||||
|
||||
// SetJoin sets the line join style.
|
||||
func (_aa LineProperties )SetJoin (e LineJoin ){_aa ._dd .Round =nil ;_aa ._dd .Miter =nil ;_aa ._dd .Bevel =nil ;switch e {case LineJoinRound :_aa ._dd .Round =_g .NewCT_LineJoinRound ();case LineJoinBevel :_aa ._dd .Bevel =_g .NewCT_LineJoinBevel ();case LineJoinMiter :_aa ._dd .Miter =_g .NewCT_LineJoinMiterProperties ();};};
|
||||
|
||||
// SetBulletChar sets the bullet character for the paragraph.
|
||||
func (_ge ParagraphProperties )SetBulletChar (c string ){if c ==""{_ge ._af .BuChar =nil ;}else {_ge ._af .BuChar =_g .NewCT_TextCharBullet ();_ge ._af .BuChar .CharAttr =c ;};};type LineProperties struct{_dd *_g .CT_LineProperties };func MakeShapeProperties (x *_g .CT_ShapeProperties )ShapeProperties {return ShapeProperties {x }};
|
||||
|
||||
// ParagraphProperties allows controlling paragraph properties.
|
||||
type ParagraphProperties struct{_af *_g .CT_TextParagraphProperties ;};
|
||||
|
||||
// SetWidth sets the width of the shape.
|
||||
func (_gd ShapeProperties )SetWidth (w _e .Distance ){_gd .ensureXfrm ();if _gd ._ee .Xfrm .Ext ==nil {_gd ._ee .Xfrm .Ext =_g .NewCT_PositiveSize2D ();};_gd ._ee .Xfrm .Ext .CxAttr =int64 (w /_e .EMU );};
|
||||
|
||||
// AddRun adds a new run to a paragraph.
|
||||
func (_ba Paragraph )AddRun ()Run {_dc :=MakeRun (_g .NewEG_TextRun ());_ba ._eb .EG_TextRun =append (_ba ._eb .EG_TextRun ,_dc .X ());return _dc ;};func (_dab ShapeProperties )SetSolidFill (c _d .Color ){_dab .clearFill ();_dab ._ee .SolidFill =_g .NewCT_SolidColorFillProperties ();_dab ._ee .SolidFill .SrgbClr =_g .NewCT_SRgbColor ();_dab ._ee .SolidFill .SrgbClr .ValAttr =*c .AsRGBString ();};
|
||||
|
||||
// SetNumbered controls if bullets are numbered or not.
|
||||
func (_gb ParagraphProperties )SetNumbered (scheme _g .ST_TextAutonumberScheme ){if scheme ==_g .ST_TextAutonumberSchemeUnset {_gb ._af .BuAutoNum =nil ;}else {_gb ._af .BuAutoNum =_g .NewCT_TextAutonumberBullet ();_gb ._af .BuAutoNum .TypeAttr =scheme ;};};
|
||||
|
||||
// SetFlipVertical controls if the shape is flipped vertically.
|
||||
func (_bag ShapeProperties )SetFlipVertical (b bool ){_bag .ensureXfrm ();if !b {_bag ._ee .Xfrm .FlipVAttr =nil ;}else {_bag ._ee .Xfrm .FlipVAttr =_a .Bool (true );};};func (_de ShapeProperties )LineProperties ()LineProperties {if _de ._ee .Ln ==nil {_de ._ee .Ln =_g .NewCT_LineProperties ();};return LineProperties {_de ._ee .Ln };};
|
3
go.mod
3
go.mod
@ -3,7 +3,8 @@ module github.com/unidoc/unioffice
|
||||
go 1.13
|
||||
|
||||
require (
|
||||
github.com/richardlehane/msoleps v1.0.1
|
||||
github.com/stretchr/testify v1.7.0
|
||||
github.com/unidoc/unipdf/v3 v3.28.0
|
||||
github.com/unidoc/unipdf/v3 v3.31.0
|
||||
github.com/unidoc/unitype v0.2.1
|
||||
)
|
||||
|
File diff suppressed because one or more lines are too long
12
internal/formatutils/formatutils.go
Normal file
12
internal/formatutils/formatutils.go
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -9,4 +9,4 @@
|
||||
// Use of this source code is governed by the UniDoc End User License Agreement
|
||||
// terms that can be accessed at https://unidoc.io/eula/
|
||||
|
||||
package mergesort ;func MergeSort (array []float64 )[]float64 {if len (array )<=1{_a :=make ([]float64 ,len (array ));copy (_a ,array );return _a ;};_af :=len (array )/2;_f :=MergeSort (array [:_af ]);_c :=MergeSort (array [_af :]);_ff :=make ([]float64 ,len (array ));_fc :=0;_d :=0;_fd :=0;for _d < len (_f )&&_fd < len (_c ){if _f [_d ]<=_c [_fd ]{_ff [_fc ]=_f [_d ];_d ++;}else {_ff [_fc ]=_c [_fd ];_fd ++;};_fc ++;};for _d < len (_f ){_ff [_fc ]=_f [_d ];_d ++;_fc ++;};for _fd < len (_c ){_ff [_fc ]=_c [_fd ];_fd ++;_fc ++;};return _ff ;};
|
||||
package mergesort ;func MergeSort (array []float64 )[]float64 {if len (array )<=1{_a :=make ([]float64 ,len (array ));copy (_a ,array );return _a ;};_de :=len (array )/2;_c :=MergeSort (array [:_de ]);_aa :=MergeSort (array [_de :]);_ae :=make ([]float64 ,len (array ));_f :=0;_ad :=0;_ab :=0;for _ad < len (_c )&&_ab < len (_aa ){if _c [_ad ]<=_aa [_ab ]{_ae [_f ]=_c [_ad ];_ad ++;}else {_ae [_f ]=_aa [_ab ];_ab ++;};_f ++;};for _ad < len (_c ){_ae [_f ]=_c [_ad ];_ad ++;_f ++;};for _ab < len (_aa ){_ae [_f ]=_aa [_ab ];_ab ++;_f ++;};return _ae ;};
|
12
internal/mscfb/mscfb.go
Normal file
12
internal/mscfb/mscfb.go
Normal file
File diff suppressed because one or more lines are too long
12
internal/mscfb/rw/rw.go
Normal file
12
internal/mscfb/rw/rw.go
Normal file
File diff suppressed because one or more lines are too long
12
internal/testutils/testutils.go
Normal file
12
internal/testutils/testutils.go
Normal file
@ -0,0 +1,12 @@
|
||||
//
|
||||
// Copyright 2020 FoxyUtils ehf. All rights reserved.
|
||||
//
|
||||
// This is a commercial product and requires a license to operate.
|
||||
// A trial license can be obtained at https://unidoc.io
|
||||
//
|
||||
// DO NOT EDIT: generated by unitwist Go source code obfuscator.
|
||||
//
|
||||
// Use of this source code is governed by the UniDoc End User License Agreement
|
||||
// terms that can be accessed at https://unidoc.io/eula/
|
||||
|
||||
package testutils ;import (_fg "crypto/md5";_bd "encoding/hex";_cf "errors";_aa "fmt";_ad "image";_cb "image/png";_a "io";_bc "os";_c "os/exec";_d "path/filepath";_g "strings";_b "testing";);func ComparePNGFiles (file1 ,file2 string )(bool ,error ){_fgc ,_aff :=HashFile (file1 );if _aff !=nil {return false ,_aff ;};_ed ,_aff :=HashFile (file2 );if _aff !=nil {return false ,_aff ;};if _fgc ==_ed {return true ,nil ;};_fb ,_aff :=ReadPNG (file1 );if _aff !=nil {return false ,_aff ;};_de ,_aff :=ReadPNG (file2 );if _aff !=nil {return false ,_aff ;};if _fb .Bounds ()!=_de .Bounds (){return false ,nil ;};return CompareImages (_fb ,_de );};func CopyFile (src ,dst string )error {_ce ,_ab :=_bc .Open (src );if _ab !=nil {return _ab ;};defer _ce .Close ();_cea ,_ab :=_bc .Create (dst );if _ab !=nil {return _ab ;};defer _cea .Close ();_ ,_ab =_a .Copy (_cea ,_ce );return _ab ;};func ReadPNG (file string )(_ad .Image ,error ){_bdc ,_adb :=_bc .Open (file );if _adb !=nil {return nil ,_adb ;};defer _bdc .Close ();return _cb .Decode (_bdc );};var (ErrRenderNotSupported =_cf .New ("\u0072\u0065\u006e\u0064\u0065r\u0069\u006e\u0067\u0020\u0050\u0044\u0046\u0020\u0066\u0069\u006c\u0065\u0073 \u0069\u0073\u0020\u006e\u006f\u0074\u0020\u0073\u0075\u0070\u0070\u006f\u0072\u0074\u0065\u0064\u0020\u006f\u006e\u0020\u0074\u0068\u0069\u0073\u0020\u0073\u0079\u0073\u0074\u0065m"););func CompareImages (img1 ,img2 _ad .Image )(bool ,error ){_be :=img1 .Bounds ();_ff :=0;for _gb :=0;_gb < _be .Size ().X ;_gb ++{for _cfa :=0;_cfa < _be .Size ().Y ;_cfa ++{_af ,_ge ,_gbg ,_ :=img1 .At (_gb ,_cfa ).RGBA ();_e ,_eb ,_fa ,_ :=img2 .At (_gb ,_cfa ).RGBA ();if _af !=_e ||_ge !=_eb ||_gbg !=_fa {_ff ++;};};};_bfb :=float64 (_ff )/float64 (_be .Dx ()*_be .Dy ());if _bfb > 0.0001{_aa .Printf ("\u0064\u0069\u0066f \u0066\u0072\u0061\u0063\u0074\u0069\u006f\u006e\u003a\u0020\u0025\u0076\u0020\u0028\u0025\u0064\u0029\u000a",_bfb ,_ff );return false ,nil ;};return true ,nil ;};func RenderPDFToPNGs (pdfPath string ,dpi int ,outpathTpl string )error {if dpi <=0{dpi =100;};if _ ,_ga :=_c .LookPath ("\u0067\u0073");_ga !=nil {return ErrRenderNotSupported ;};return _c .Command ("\u0067\u0073","\u002d\u0073\u0044\u0045\u0056\u0049\u0043\u0045\u003d\u0070\u006e\u0067a\u006c\u0070\u0068\u0061","\u002d\u006f",outpathTpl ,_aa .Sprintf ("\u002d\u0072\u0025\u0064",dpi ),pdfPath ).Run ();};func RunRenderTest (t *_b .T ,pdfPath ,outputDir ,baselineRenderPath string ,saveBaseline bool ){_db :=_g .TrimSuffix (_d .Base (pdfPath ),_d .Ext (pdfPath ));t .Run ("\u0072\u0065\u006e\u0064\u0065\u0072",func (_edb *_b .T ){_cg :=_d .Join (outputDir ,_db );_cfc :=_cg +"\u002d%\u0064\u002e\u0070\u006e\u0067";if _ef :=RenderPDFToPNGs (pdfPath ,0,_cfc );_ef !=nil {_edb .Skip (_ef );};for _cd :=1;true ;_cd ++{_dg :=_aa .Sprintf ("\u0025s\u002d\u0025\u0064\u002e\u0070\u006eg",_cg ,_cd );_bee :=_d .Join (baselineRenderPath ,_aa .Sprintf ("\u0025\u0073\u002d\u0025\u0064\u005f\u0065\u0078\u0070\u002e\u0070\u006e\u0067",_db ,_cd ));if _ ,_bcc :=_bc .Stat (_dg );_bcc !=nil {break ;};_edb .Logf ("\u0025\u0073",_bee );if saveBaseline {_edb .Logf ("\u0043\u006fp\u0079\u0069\u006eg\u0020\u0025\u0073\u0020\u002d\u003e\u0020\u0025\u0073",_dg ,_bee );_gcc :=CopyFile (_dg ,_bee );if _gcc !=nil {_edb .Fatalf ("\u0045\u0052\u0052OR\u0020\u0063\u006f\u0070\u0079\u0069\u006e\u0067\u0020\u0074\u006f\u0020\u0025\u0073\u003a\u0020\u0025\u0076",_bee ,_gcc );};continue ;};_edb .Run (_aa .Sprintf ("\u0070\u0061\u0067\u0065\u0025\u0064",_cd ),func (_gcg *_b .T ){_gcg .Logf ("\u0043o\u006dp\u0061\u0072\u0069\u006e\u0067 \u0025\u0073 \u0076\u0073\u0020\u0025\u0073",_dg ,_bee );_ac ,_faf :=ComparePNGFiles (_dg ,_bee );if _bc .IsNotExist (_faf ){_gcg .Fatal ("\u0069m\u0061g\u0065\u0020\u0066\u0069\u006ce\u0020\u006di\u0073\u0073\u0069\u006e\u0067");}else if !_ac {_gcg .Fatal ("\u0077\u0072\u006f\u006eg \u0070\u0061\u0067\u0065\u0020\u0072\u0065\u006e\u0064\u0065\u0072\u0065\u0064");};});};});};func HashFile (file string )(string ,error ){_bdce ,_ca :=_bc .Open (file );if _ca !=nil {return "",_ca ;};defer _bdce .Close ();_gc :=_fg .New ();if _ ,_ca =_a .Copy (_gc ,_bdce );_ca !=nil {return "",_ca ;};return _bd .EncodeToString (_gc .Sum (nil )),nil ;};
|
@ -9,4 +9,4 @@
|
||||
// Use of this source code is governed by the UniDoc End User License Agreement
|
||||
// terms that can be accessed at https://unidoc.io/eula/
|
||||
|
||||
package wildcard ;func Index (pattern ,name string )(_ba int ){if pattern ==""||pattern =="\u002a"{return 0;};_fd :=make ([]rune ,0,len (name ));_dgb :=make ([]rune ,0,len (pattern ));for _ ,_g :=range name {_fd =append (_fd ,_g );};for _ ,_dga :=range pattern {_dgb =append (_dgb ,_dga );};return _fc (_fd ,_dgb ,0);};func Match (pattern ,name string )(_ef bool ){if pattern ==""{return name ==pattern ;};if pattern =="\u002a"{return true ;};_ed :=make ([]rune ,0,len (name ));_a :=make ([]rune ,0,len (pattern ));for _ ,_dg :=range name {_ed =append (_ed ,_dg );};for _ ,_fg :=range pattern {_a =append (_a ,_fg );};_bg :=false ;return _cd (_ed ,_a ,_bg );};func _fc (_df ,_fe []rune ,_aa int )int {for len (_fe )> 0{switch _fe [0]{default:if len (_df )==0{return -1;};if _df [0]!=_fe [0]{return _fc (_df [1:],_fe ,_aa +1);};case '?':if len (_df )==0{return -1;};case '*':if len (_df )==0{return -1;};_cf :=_fc (_df ,_fe [1:],_aa );if _cf !=-1{return _aa ;}else {_cf =_fc (_df [1:],_fe ,_aa );if _cf !=-1{return _aa ;}else {return -1;};};};_df =_df [1:];_fe =_fe [1:];};return _aa ;};func _cd (_bf ,_ac []rune ,_dgd bool )bool {for len (_ac )> 0{switch _ac [0]{default:if len (_bf )==0||_bf [0]!=_ac [0]{return false ;};case '?':if len (_bf )==0&&!_dgd {return false ;};case '*':return _cd (_bf ,_ac [1:],_dgd )||(len (_bf )> 0&&_cd (_bf [1:],_ac ,_dgd ));};_bf =_bf [1:];_ac =_ac [1:];};return len (_bf )==0&&len (_ac )==0;};func MatchSimple (pattern ,name string )bool {if pattern ==""{return name ==pattern ;};if pattern =="\u002a"{return true ;};_fb :=make ([]rune ,0,len (name ));_b :=make ([]rune ,0,len (pattern ));for _ ,_d :=range name {_fb =append (_fb ,_d );};for _ ,_eb :=range pattern {_b =append (_b ,_eb );};_dd :=true ;return _cd (_fb ,_b ,_dd );};
|
||||
package wildcard ;func _cce (_fea ,_dae []rune ,_de int )int {for len (_dae )> 0{switch _dae [0]{default:if len (_fea )==0{return -1;};if _fea [0]!=_dae [0]{return _cce (_fea [1:],_dae ,_de +1);};case '?':if len (_fea )==0{return -1;};case '*':if len (_fea )==0{return -1;};_gf :=_cce (_fea ,_dae [1:],_de );if _gf !=-1{return _de ;}else {_gf =_cce (_fea [1:],_dae ,_de );if _gf !=-1{return _de ;}else {return -1;};};};_fea =_fea [1:];_dae =_dae [1:];};return _de ;};func Match (pattern ,name string )(_ed bool ){if pattern ==""{return name ==pattern ;};if pattern =="\u002a"{return true ;};_da :=make ([]rune ,0,len (name ));_f :=make ([]rune ,0,len (pattern ));for _ ,_gg :=range name {_da =append (_da ,_gg );};for _ ,_ab :=range pattern {_f =append (_f ,_ab );};_b :=false ;return _gcb (_da ,_f ,_b );};func Index (pattern ,name string )(_cd int ){if pattern ==""||pattern =="\u002a"{return 0;};_acd :=make ([]rune ,0,len (name ));_fe :=make ([]rune ,0,len (pattern ));for _ ,_fa :=range name {_acd =append (_acd ,_fa );};for _ ,_aca :=range pattern {_fe =append (_fe ,_aca );};return _cce (_acd ,_fe ,0);};func _gcb (_eb ,_ff []rune ,_ebb bool )bool {for len (_ff )> 0{switch _ff [0]{default:if len (_eb )==0||_eb [0]!=_ff [0]{return false ;};case '?':if len (_eb )==0&&!_ebb {return false ;};case '*':return _gcb (_eb ,_ff [1:],_ebb )||(len (_eb )> 0&&_gcb (_eb [1:],_ff ,_ebb ));};_eb =_eb [1:];_ff =_ff [1:];};return len (_eb )==0&&len (_ff )==0;};func MatchSimple (pattern ,name string )bool {if pattern ==""{return name ==pattern ;};if pattern =="\u002a"{return true ;};_g :=make ([]rune ,0,len (name ));_ac :=make ([]rune ,0,len (pattern ));for _ ,_e :=range name {_g =append (_g ,_e );};for _ ,_d :=range pattern {_ac =append (_ac ,_d );};_cc :=true ;return _gcb (_g ,_ac ,_cc );};
|
@ -11,12 +11,12 @@
|
||||
|
||||
package measurement ;
|
||||
|
||||
// FromEMU converts int64 ENU units to float64 distance units.
|
||||
func FromEMU (emu int64 )float64 {return float64 (emu )/914400*Inch };
|
||||
|
||||
// ToEMU converts float64 distance units to int64 EMU.
|
||||
func ToEMU (m float64 )int64 {return int64 (914400.0/Inch *m )};
|
||||
|
||||
// FromEMU converts int64 ENU units to float64 distance units.
|
||||
func FromEMU (emu int64 )float64 {return float64 (emu )/914400*Inch };
|
||||
|
||||
// Distance represents a distance and is automatically converted
|
||||
// to the units needed internally in the various ECMA 376 formats.
|
||||
type Distance float64 ;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 ;);
|
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 (_e "encoding/xml";_g "fmt";_d "github.com/unidoc/unioffice";_c "github.com/unidoc/unioffice/common/logger";);func NewSimpleLiteral ()*SimpleLiteral {_deb :=&SimpleLiteral {};return _deb };func (_cda *ElementsGroup )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {_cg :for {_ab ,_cdd :=d .Token ();if _cdd !=nil {return _cdd ;};switch _dfa :=_ab .(type ){case _e .StartElement :switch _dfa .Name {case _e .Name {Space :"\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0072\u0067/\u0064c\u002f\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u002f\u0031\u002e\u0031\u002f",Local :"\u0061\u006e\u0079"}:_dfb :=NewElementsGroupChoice ();if _ee :=d .DecodeElement (&_dfb .Any ,&_dfa );_ee !=nil {return _ee ;};_cda .Choice =append (_cda .Choice ,_dfb );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\u0045\u006c\u0065\u006de\u006e\u0074\u0073\u0047\u0072\u006f\u0075\u0070 \u0025\u0076",_dfa .Name );if _de :=d .Skip ();_de !=nil {return _de ;};};case _e .EndElement :break _cg ;case _e .CharData :};};return nil ;};
|
||||
|
||||
// ValidateWithPath validates the ElementContainer and its children, prefixing error messages with path
|
||||
func (_df *ElementContainer )ValidateWithPath (path string )error {for _age ,_efa :=range _df .Choice {if _cc :=_efa .ValidateWithPath (_g .Sprintf ("\u0025\u0073\u002f\u0043\u0068\u006f\u0069\u0063\u0065\u005b\u0025\u0064\u005d",path ,_age ));_cc !=nil {return _cc ;};};return nil ;};
|
||||
|
||||
// Validate validates the ElementsGroupChoice and its children
|
||||
func (_daf *ElementsGroupChoice )Validate ()error {return _daf .ValidateWithPath ("\u0045\u006c\u0065\u006den\u0074\u0073\u0047\u0072\u006f\u0075\u0070\u0043\u0068\u006f\u0069\u0063\u0065");};func (_eg *Any )MarshalXML (e *_e .Encoder ,start _e .StartElement )error {return _eg .SimpleLiteral .MarshalXML (e ,start );};func (_adf *SimpleLiteral )MarshalXML (e *_e .Encoder ,start _e .StartElement )error {e .EncodeToken (start );e .EncodeToken (_e .EndElement {Name :start .Name });return nil ;};
|
||||
|
||||
// Validate validates the ElementContainer and its children
|
||||
func (_gca *ElementContainer )Validate ()error {return _gca .ValidateWithPath ("\u0045\u006ce\u006d\u0065\u006et\u0043\u006f\u006e\u0074\u0061\u0069\u006e\u0065\u0072");};
|
||||
|
||||
// ValidateWithPath validates the ElementsGroup and its children, prefixing error messages with path
|
||||
func (_ded *ElementsGroup )ValidateWithPath (path string )error {for _ff ,_cgg :=range _ded .Choice {if _fcc :=_cgg .ValidateWithPath (_g .Sprintf ("\u0025\u0073\u002f\u0043\u0068\u006f\u0069\u0063\u0065\u005b\u0025\u0064\u005d",path ,_ff ));_fcc !=nil {return _fcc ;};};return nil ;};type ElementsGroup struct{Choice []*ElementsGroupChoice ;};func NewElementContainer ()*ElementContainer {_ebd :=&ElementContainer {};return _ebd };func (_egc *SimpleLiteral )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {for {_ga ,_ebg :=d .Token ();if _ebg !=nil {return _g .Errorf ("\u0070a\u0072\u0073\u0069\u006eg\u0020\u0053\u0069\u006d\u0070l\u0065L\u0069t\u0065\u0072\u0061\u006c\u003a\u0020\u0025s",_ebg );};if _bf ,_fg :=_ga .(_e .EndElement );_fg &&_bf .Name ==start .Name {break ;};};return nil ;};func (_dbe *ElementsGroupChoice )MarshalXML (e *_e .Encoder ,start _e .StartElement )error {if _dbe .Any !=nil {_af :=_e .StartElement {Name :_e .Name {Local :"\u0064\u0063\u003a\u0061\u006e\u0079"}};for _ ,_bb :=range _dbe .Any {e .EncodeElement (_bb ,_af );};};return nil ;};type Any struct{SimpleLiteral };func NewAny ()*Any {_eb :=&Any {};_eb .SimpleLiteral =*NewSimpleLiteral ();return _eb };func (_efb *ElementsGroup )MarshalXML (e *_e .Encoder ,start _e .StartElement )error {if _efb .Choice !=nil {for _ ,_fd :=range _efb .Choice {_fd .MarshalXML (e ,_e .StartElement {});};};return nil ;};
|
||||
|
||||
// Validate validates the ElementsGroup and its children
|
||||
func (_ac *ElementsGroup )Validate ()error {return _ac .ValidateWithPath ("\u0045\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u0047\u0072\u006f\u0075\u0070");};func (_cd *ElementContainer )MarshalXML (e *_e .Encoder ,start _e .StartElement )error {start .Name .Local ="\u0065\u006ce\u006d\u0065\u006et\u0043\u006f\u006e\u0074\u0061\u0069\u006e\u0065\u0072";e .EncodeToken (start );if _cd .Choice !=nil {for _ ,_da :=range _cd .Choice {_da .MarshalXML (e ,_e .StartElement {});};};e .EncodeToken (_e .EndElement {Name :start .Name });return nil ;};type ElementsGroupChoice struct{Any []*Any ;};func (_aa *Any )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {_aa .SimpleLiteral =*NewSimpleLiteral ();for {_ag ,_f :=d .Token ();if _f !=nil {return _g .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0041\u006e\u0079\u003a\u0020\u0025\u0073",_f );};if _db ,_ef :=_ag .(_e .EndElement );_ef &&_db .Name ==start .Name {break ;};};return nil ;};
|
||||
package elements ;import (_a "encoding/xml";_e "fmt";_d "github.com/unidoc/unioffice";_b "github.com/unidoc/unioffice/common/logger";);func NewElementContainer ()*ElementContainer {_eg :=&ElementContainer {};return _eg };func (_f *Any )UnmarshalXML (d *_a .Decoder ,start _a .StartElement )error {_f .SimpleLiteral =*NewSimpleLiteral ();for {_da ,_c :=d .Token ();if _c !=nil {return _e .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0041\u006e\u0079\u003a\u0020\u0025\u0073",_c );};if _gf ,_bf :=_da .(_a .EndElement );_bf &&_gf .Name ==start .Name {break ;};};return nil ;};type SimpleLiteral struct{};
|
||||
|
||||
// ValidateWithPath validates the Any and its children, prefixing error messages with path
|
||||
func (_ca *Any )ValidateWithPath (path string )error {if _fe :=_ca .SimpleLiteral .ValidateWithPath (path );_fe !=nil {return _fe ;};return nil ;};
|
||||
func (_ff *Any )ValidateWithPath (path string )error {if _gfa :=_ff .SimpleLiteral .ValidateWithPath (path );_gfa !=nil {return _gfa ;};return nil ;};func (_ffb *ElementsGroupChoice )UnmarshalXML (d *_a .Decoder ,start _a .StartElement )error {_dbe :for {_fg ,_df :=d .Token ();if _df !=nil {return _df ;};switch _ea :=_fg .(type ){case _a .StartElement :switch _ea .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"}:_bcd :=NewAny ();if _cgb :=d .DecodeElement (_bcd ,&_ea );_cgb !=nil {return _cgb ;};_ffb .Any =append (_ffb .Any ,_bcd );default:_b .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",_ea .Name );if _dab :=d .Skip ();_dab !=nil {return _dab ;};};case _a .EndElement :break _dbe ;case _a .CharData :};};return nil ;};func (_ed *Any )MarshalXML (e *_a .Encoder ,start _a .StartElement )error {return _ed .SimpleLiteral .MarshalXML (e ,start );};func (_de *ElementContainer )UnmarshalXML (d *_a .Decoder ,start _a .StartElement )error {_ad :for {_dc ,_cf :=d .Token ();if _cf !=nil {return _cf ;};switch _fa :=_dc .(type ){case _a .StartElement :switch _fa .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 _ec :=d .DecodeElement (&_af .Any ,&_fa );_ec !=nil {return _ec ;};_de .Choice =append (_de .Choice ,_af );default:_b .Log .Debug ("\u0073\u006b\u0069\u0070\u0070i\u006e\u0067\u0020\u0075\u006e\u0073\u0075\u0070\u0070\u006f\u0072\u0074\u0065d\u0020\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0020\u006f\u006e\u0020\u0045\u006c\u0065\u006d\u0065\u006e\u0074\u0043\u006f\u006e\u0074\u0061\u0069\u006e\u0065\u0072\u0020\u0025v",_fa .Name );if _db :=d .Skip ();_db !=nil {return _db ;};};case _a .EndElement :break _ad ;case _a .CharData :};};return nil ;};func NewElementsGroup ()*ElementsGroup {_bec :=&ElementsGroup {};return _bec };
|
||||
|
||||
// ValidateWithPath validates the ElementsGroupChoice and its children, prefixing error messages with path
|
||||
func (_fcf *ElementsGroupChoice )ValidateWithPath (path string )error {for _eeb ,_ge :=range _fcf .Any {if _ad :=_ge .ValidateWithPath (_g .Sprintf ("\u0025\u0073\u002f\u0041\u006e\u0079\u005b\u0025\u0064\u005d",path ,_eeb ));_ad !=nil {return _ad ;};};return nil ;};func (_be *ElementsGroupChoice )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {_dc :for {_efdg ,_gfb :=d .Token ();if _gfb !=nil {return _gfb ;};switch _ccg :=_efdg .(type ){case _e .StartElement :switch _ccg .Name {case _e .Name {Space :"\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0072\u0067/\u0064c\u002f\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u002f\u0031\u002e\u0031\u002f",Local :"\u0061\u006e\u0079"}:_ddd :=NewAny ();if _acb :=d .DecodeElement (_ddd ,&_ccg );_acb !=nil {return _acb ;};_be .Any =append (_be .Any ,_ddd );default:_c .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",_ccg .Name );if _dad :=d .Skip ();_dad !=nil {return _dad ;};};case _e .EndElement :break _dc ;case _e .CharData :};};return nil ;};func NewElementsGroupChoice ()*ElementsGroupChoice {_gf :=&ElementsGroupChoice {};return _gf };
|
||||
|
||||
// Validate validates the SimpleLiteral and its children
|
||||
func (_cab *SimpleLiteral )Validate ()error {return _cab .ValidateWithPath ("\u0053\u0069\u006d\u0070\u006c\u0065\u004c\u0069\u0074\u0065\u0072\u0061\u006c");};func (_fc *ElementContainer )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {_fb :for {_gc ,_dg :=d .Token ();if _dg !=nil {return _dg ;};switch _dd :=_gc .(type ){case _e .StartElement :switch _dd .Name {case _e .Name {Space :"\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0070\u0075\u0072\u006c\u002e\u006f\u0072\u0067/\u0064c\u002f\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u002f\u0031\u002e\u0031\u002f",Local :"\u0061\u006e\u0079"}:_fcg :=NewElementsGroupChoice ();if _b :=d .DecodeElement (&_fcg .Any ,&_dd );_b !=nil {return _b ;};_fc .Choice =append (_fc .Choice ,_fcg );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\u0045\u006c\u0065\u006d\u0065\u006e\u0074\u0043\u006f\u006e\u0074\u0061\u0069\u006e\u0065\u0072\u0020\u0025v",_dd .Name );if _fef :=d .Skip ();_fef !=nil {return _fef ;};};case _e .EndElement :break _fb ;case _e .CharData :};};return nil ;};func NewElementsGroup ()*ElementsGroup {_fec :=&ElementsGroup {};return _fec };
|
||||
// ValidateWithPath validates the ElementsGroup and its children, prefixing error messages with path
|
||||
func (_edcc *ElementsGroup )ValidateWithPath (path string )error {for _abb ,_ag :=range _edcc .Choice {if _fd :=_ag .ValidateWithPath (_e .Sprintf ("\u0025\u0073\u002f\u0043\u0068\u006f\u0069\u0063\u0065\u005b\u0025\u0064\u005d",path ,_abb ));_fd !=nil {return _fd ;};};return nil ;};type ElementsGroupChoice struct{Any []*Any ;};
|
||||
|
||||
// Validate validates the Any and its children
|
||||
func (_efd *Any )Validate ()error {return _efd .ValidateWithPath ("\u0041\u006e\u0079")};type SimpleLiteral struct{};
|
||||
func (_ba *Any )Validate ()error {return _ba .ValidateWithPath ("\u0041\u006e\u0079")};func NewAny ()*Any {_eb :=&Any {};_eb .SimpleLiteral =*NewSimpleLiteral ();return _eb };type ElementsGroup struct{Choice []*ElementsGroupChoice ;};func (_cc *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 _cc .Choice !=nil {for _ ,_bag :=range _cc .Choice {_bag .MarshalXML (e ,_a .StartElement {});};};e .EncodeToken (_a .EndElement {Name :start .Name });return nil ;};
|
||||
|
||||
// Validate validates the ElementsGroupChoice and its children
|
||||
func (_ga *ElementsGroupChoice )Validate ()error {return _ga .ValidateWithPath ("\u0045\u006c\u0065\u006den\u0074\u0073\u0047\u0072\u006f\u0075\u0070\u0043\u0068\u006f\u0069\u0063\u0065");};func (_fae *ElementsGroupChoice )MarshalXML (e *_a .Encoder ,start _a .StartElement )error {if _fae .Any !=nil {_cbf :=_a .StartElement {Name :_a .Name {Local :"\u0064\u0063\u003a\u0061\u006e\u0079"}};for _ ,_begb :=range _fae .Any {e .EncodeElement (_begb ,_cbf );};};return nil ;};func (_ged *SimpleLiteral )MarshalXML (e *_a .Encoder ,start _a .StartElement )error {e .EncodeToken (start );e .EncodeToken (_a .EndElement {Name :start .Name });return nil ;};
|
||||
|
||||
// ValidateWithPath validates the SimpleLiteral and its children, prefixing error messages with path
|
||||
func (_fbb *SimpleLiteral )ValidateWithPath (path string )error {return nil };type ElementContainer struct{Choice []*ElementsGroupChoice ;};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 );};
|
||||
func (_gc *SimpleLiteral )ValidateWithPath (path string )error {return nil };func NewElementsGroupChoice ()*ElementsGroupChoice {_cfg :=&ElementsGroupChoice {};return _cfg };func NewSimpleLiteral ()*SimpleLiteral {_fb :=&SimpleLiteral {};return _fb };func (_ab *ElementsGroup )MarshalXML (e *_a .Encoder ,start _a .StartElement )error {if _ab .Choice !=nil {for _ ,_afb :=range _ab .Choice {_afb .MarshalXML (e ,_a .StartElement {});};};return nil ;};type ElementContainer struct{Choice []*ElementsGroupChoice ;};
|
||||
|
||||
// ValidateWithPath validates the ElementsGroupChoice and its children, prefixing error messages with path
|
||||
func (_dcd *ElementsGroupChoice )ValidateWithPath (path string )error {for _bce ,_ffe :=range _dcd .Any {if _ggd :=_ffe .ValidateWithPath (_e .Sprintf ("\u0025\u0073\u002f\u0041\u006e\u0079\u005b\u0025\u0064\u005d",path ,_bce ));_ggd !=nil {return _ggd ;};};return nil ;};func (_cb *ElementsGroup )UnmarshalXML (d *_a .Decoder ,start _a .StartElement )error {_edc :for {_bffd ,_ge :=d .Token ();if _ge !=nil {return _ge ;};switch _gee :=_bffd .(type ){case _a .StartElement :switch _gee .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"}:_ee :=NewElementsGroupChoice ();if _cgd :=d .DecodeElement (&_ee .Any ,&_gee );_cgd !=nil {return _cgd ;};_cb .Choice =append (_cb .Choice ,_ee );default:_b .Log .Debug ("\u0073\u006b\u0069\u0070\u0070\u0069\u006e\u0067 \u0075\u006e\u0073up\u0070\u006f\u0072\u0074\u0065\u0064 \u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0020\u006f\u006e\u0020\u0045\u006c\u0065\u006de\u006e\u0074\u0073\u0047\u0072\u006f\u0075\u0070 \u0025\u0076",_gee .Name );if _bc :=d .Skip ();_bc !=nil {return _bc ;};};case _a .EndElement :break _edc ;case _a .CharData :};};return nil ;};
|
||||
|
||||
// Validate validates the SimpleLiteral and its children
|
||||
func (_ffa *SimpleLiteral )Validate ()error {return _ffa .ValidateWithPath ("\u0053\u0069\u006d\u0070\u006c\u0065\u004c\u0069\u0074\u0065\u0072\u0061\u006c");};func (_dfd *SimpleLiteral )UnmarshalXML (d *_a .Decoder ,start _a .StartElement )error {for {_fe ,_ecg :=d .Token ();if _ecg !=nil {return _e .Errorf ("\u0070a\u0072\u0073\u0069\u006eg\u0020\u0053\u0069\u006d\u0070l\u0065L\u0069t\u0065\u0072\u0061\u006c\u003a\u0020\u0025s",_ecg );};if _fed ,_fdd :=_fe .(_a .EndElement );_fdd &&_fed .Name ==start .Name {break ;};};return nil ;};type Any struct{SimpleLiteral };
|
||||
|
||||
// Validate validates the ElementContainer and its children
|
||||
func (_gg *ElementContainer )Validate ()error {return _gg .ValidateWithPath ("\u0045\u006ce\u006d\u0065\u006et\u0043\u006f\u006e\u0074\u0061\u0069\u006e\u0065\u0072");};
|
||||
|
||||
// ValidateWithPath validates the ElementContainer and its children, prefixing error messages with path
|
||||
func (_bb *ElementContainer )ValidateWithPath (path string )error {for _gd ,_bff :=range _bb .Choice {if _adg :=_bff .ValidateWithPath (_e .Sprintf ("\u0025\u0073\u002f\u0043\u0068\u006f\u0069\u0063\u0065\u005b\u0025\u0064\u005d",path ,_gd ));_adg !=nil {return _adg ;};};return nil ;};
|
||||
|
||||
// Validate validates the ElementsGroup and its children
|
||||
func (_daf *ElementsGroup )Validate ()error {return _daf .ValidateWithPath ("\u0045\u006c\u0065\u006d\u0065\u006e\u0074\u0073\u0047\u0072\u006f\u0075\u0070");};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 );};
|
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,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 (_d "encoding/xml";_c "fmt";_ef "github.com/unidoc/unioffice";_e "github.com/unidoc/unioffice/schema/soo/dml";);
|
||||
|
||||
// ValidateWithPath validates the LockedCanvas and its children, prefixing error messages with path
|
||||
func (_ad *LockedCanvas )ValidateWithPath (path string )error {if _dc :=_ad .CT_GvmlGroupShape .ValidateWithPath (path );_dc !=nil {return _dc ;};return nil ;};
|
||||
package lockedCanvas ;import (_c "encoding/xml";_fb "fmt";_e "github.com/unidoc/unioffice";_fc "github.com/unidoc/unioffice/schema/soo/dml";);
|
||||
|
||||
// Validate validates the LockedCanvas and its children
|
||||
func (_ca *LockedCanvas )Validate ()error {return _ca .ValidateWithPath ("\u004c\u006f\u0063k\u0065\u0064\u0043\u0061\u006e\u0076\u0061\u0073");};func (_db *LockedCanvas )UnmarshalXML (d *_d .Decoder ,start _d .StartElement )error {_db .CT_GvmlGroupShape =*_e .NewCT_GvmlGroupShape ();for {_ac ,_ga :=d .Token ();if _ga !=nil {return _c .Errorf ("\u0070a\u0072\u0073\u0069\u006e\u0067\u0020\u004c\u006f\u0063\u006b\u0065d\u0043\u0061\u006e\u0076\u0061\u0073\u003a\u0020\u0025\u0073",_ga );};if _b ,_dd :=_ac .(_d .EndElement );_dd &&_b .Name ==start .Name {break ;};};return nil ;};type LockedCanvas struct{_e .CT_GvmlGroupShape };func NewLockedCanvas ()*LockedCanvas {_gb :=&LockedCanvas {};_gb .CT_GvmlGroupShape =*_e .NewCT_GvmlGroupShape ();return _gb ;};func (_a *LockedCanvas )MarshalXML (e *_d .Encoder ,start _d .StartElement )error {start .Attr =append (start .Attr ,_d .Attr {Name :_d .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 ,_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 ="\u006c\u006f\u0063k\u0065\u0064\u0043\u0061\u006e\u0076\u0061\u0073";return _a .CT_GvmlGroupShape .MarshalXML (e ,start );};func init (){_ef .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 (_be *LockedCanvas )Validate ()error {return _be .ValidateWithPath ("\u004c\u006f\u0063k\u0065\u0064\u0043\u0061\u006e\u0076\u0061\u0073");};func NewLockedCanvas ()*LockedCanvas {_cf :=&LockedCanvas {};_cf .CT_GvmlGroupShape =*_fc .NewCT_GvmlGroupShape ();return _cf ;};func (_fcg *LockedCanvas )MarshalXML (e *_c .Encoder ,start _c .StartElement )error {start .Attr =append (start .Attr ,_c .Attr {Name :_c .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 ,_c .Attr {Name :_c .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u0078\u006dl"},Value :"\u0068\u0074tp\u003a\u002f\u002fw\u0077\u0077\u002e\u00773.o\u0072g/\u0058\u004d\u004c\u002f\u0031\u0039\u00398/\u006e\u0061\u006d\u0065\u0073\u0070\u0061c\u0065"});start .Name .Local ="\u006c\u006f\u0063k\u0065\u0064\u0043\u0061\u006e\u0076\u0061\u0073";return _fcg .CT_GvmlGroupShape .MarshalXML (e ,start );};func (_d *LockedCanvas )UnmarshalXML (d *_c .Decoder ,start _c .StartElement )error {_d .CT_GvmlGroupShape =*_fc .NewCT_GvmlGroupShape ();for {_eb ,_b :=d .Token ();if _b !=nil {return _fb .Errorf ("\u0070a\u0072\u0073\u0069\u006e\u0067\u0020\u004c\u006f\u0063\u006b\u0065d\u0043\u0061\u006e\u0076\u0061\u0073\u003a\u0020\u0025\u0073",_b );};if _g ,_df :=_eb .(_c .EndElement );_df &&_g .Name ==start .Name {break ;};};return nil ;};
|
||||
|
||||
// ValidateWithPath validates the LockedCanvas and its children, prefixing error messages with path
|
||||
func (_a *LockedCanvas )ValidateWithPath (path string )error {if _ae :=_a .CT_GvmlGroupShape .ValidateWithPath (path );_ae !=nil {return _ae ;};return nil ;};type LockedCanvas struct{_fc .CT_GvmlGroupShape };func init (){_e .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
@ -9,40 +9,40 @@
|
||||
// Use of this source code is governed by the UniDoc End User License Agreement
|
||||
// terms that can be accessed at https://unidoc.io/eula/
|
||||
|
||||
package content_types ;import (_c "encoding/xml";_fg "fmt";_b "github.com/unidoc/unioffice";_g "github.com/unidoc/unioffice/common/logger";_e "regexp";);
|
||||
|
||||
// ValidateWithPath validates the CT_Default and its children, prefixing error messages with path
|
||||
func (_fc *CT_Default )ValidateWithPath (path string )error {if !ST_ExtensionPatternRe .MatchString (_fc .ExtensionAttr ){return _fg .Errorf ("\u0025s\u002f\u006d.\u0045\u0078\u0074\u0065n\u0073\u0069\u006fn\u0041\u0074\u0074\u0072\u0020\u006d\u0075\u0073\u0074 m\u0061\u0074\u0063h\u0020\u0027%\u0073\u0027\u0020\u0028\u0068\u0061v\u0065\u0020%\u0076\u0029",path ,ST_ExtensionPatternRe ,_fc .ExtensionAttr );};if !ST_ContentTypePatternRe .MatchString (_fc .ContentTypeAttr ){return _fg .Errorf ("\u0025\u0073/\u006d\u002e\u0043\u006f\u006e\u0074\u0065\u006e\u0074\u0054\u0079\u0070\u0065\u0041\u0074\u0074\u0072\u0020\u006d\u0075\u0073\u0074\u0020\u006d\u0061\u0074\u0063\u0068\u0020\u0027\u0025\u0073\u0027\u0020\u0028\u0068\u0061\u0076\u0065\u0020\u0025\u0076\u0029",path ,ST_ContentTypePatternRe ,_fc .ContentTypeAttr );};return nil ;};func (_cgcb *Types )UnmarshalXML (d *_c .Decoder ,start _c .StartElement )error {_cgcb .CT_Types =*NewCT_Types ();_gdb :for {_bfg ,_dcf :=d .Token ();if _dcf !=nil {return _dcf ;};switch _cgg :=_bfg .(type ){case _c .StartElement :switch _cgg .Name {case _c .Name {Space :"ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s",Local :"\u0044e\u0066\u0061\u0075\u006c\u0074"}:_gfe :=NewDefault ();if _ga :=d .DecodeElement (_gfe ,&_cgg );_ga !=nil {return _ga ;};_cgcb .Default =append (_cgcb .Default ,_gfe );case _c .Name {Space :"ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s",Local :"\u004f\u0076\u0065\u0072\u0072\u0069\u0064\u0065"}:_bad :=NewOverride ();if _efc :=d .DecodeElement (_bad ,&_cgg );_efc !=nil {return _efc ;};_cgcb .Override =append (_cgcb .Override ,_bad );default:_g .Log .Debug ("s\u006b\u0069\u0070\u0070\u0069\u006e\u0067\u0020\u0075\u006e\u0073\u0075\u0070\u0070\u006f\u0072\u0074\u0065d\u0020\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0020\u006fn \u0054\u0079\u0070e\u0073 \u0025\u0076",_cgg .Name );if _gcfb :=d .Skip ();_gcfb !=nil {return _gcfb ;};};case _c .EndElement :break _gdb ;case _c .CharData :};};return nil ;};
|
||||
|
||||
// ValidateWithPath validates the Override and its children, prefixing error messages with path
|
||||
func (_edbc *Override )ValidateWithPath (path string )error {if _bcce :=_edbc .CT_Override .ValidateWithPath (path );_bcce !=nil {return _bcce ;};return nil ;};func (_gcf *Default )MarshalXML (e *_c .Encoder ,start _c .StartElement )error {return _gcf .CT_Default .MarshalXML (e ,start );};type Types struct{CT_Types };func NewCT_Types ()*CT_Types {_dg :=&CT_Types {};return _dg };
|
||||
|
||||
// ValidateWithPath validates the CT_Override and its children, prefixing error messages with path
|
||||
func (_gd *CT_Override )ValidateWithPath (path string )error {if !ST_ContentTypePatternRe .MatchString (_gd .ContentTypeAttr ){return _fg .Errorf ("\u0025\u0073/\u006d\u002e\u0043\u006f\u006e\u0074\u0065\u006e\u0074\u0054\u0079\u0070\u0065\u0041\u0074\u0074\u0072\u0020\u006d\u0075\u0073\u0074\u0020\u006d\u0061\u0074\u0063\u0068\u0020\u0027\u0025\u0073\u0027\u0020\u0028\u0068\u0061\u0076\u0065\u0020\u0025\u0076\u0029",path ,ST_ContentTypePatternRe ,_gd .ContentTypeAttr );};return nil ;};type CT_Override struct{ContentTypeAttr string ;PartNameAttr string ;};
|
||||
|
||||
// Validate validates the Default and its children
|
||||
func (_fe *Default )Validate ()error {return _fe .ValidateWithPath ("\u0044e\u0066\u0061\u0075\u006c\u0074");};
|
||||
|
||||
// Validate validates the CT_Override and its children
|
||||
func (_cbg *CT_Override )Validate ()error {return _cbg .ValidateWithPath ("C\u0054\u005f\u004f\u0076\u0065\u0072\u0072\u0069\u0064\u0065");};func (_da *CT_Types )UnmarshalXML (d *_c .Decoder ,start _c .StartElement )error {_gdg :for {_eg ,_fd :=d .Token ();if _fd !=nil {return _fd ;};switch _dgg :=_eg .(type ){case _c .StartElement :switch _dgg .Name {case _c .Name {Space :"ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s",Local :"\u0044e\u0066\u0061\u0075\u006c\u0074"}:_fgb :=NewDefault ();if _ced :=d .DecodeElement (_fgb ,&_dgg );_ced !=nil {return _ced ;};_da .Default =append (_da .Default ,_fgb );case _c .Name {Space :"ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s",Local :"\u004f\u0076\u0065\u0072\u0072\u0069\u0064\u0065"}:_bcd :=NewOverride ();if _bcc :=d .DecodeElement (_bcd ,&_dgg );_bcc !=nil {return _bcc ;};_da .Override =append (_da .Override ,_bcd );default:_g .Log .Debug ("\u0073\u006b\u0069\u0070\u0070\u0069\u006eg\u0020\u0075\u006es\u0075\u0070\u0070\u006fr\u0074\u0065\u0064\u0020\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0020\u006f\u006e\u0020\u0043\u0054\u005f\u0054\u0079\u0070\u0065\u0073\u0020\u0025\u0076",_dgg .Name );if _ecd :=d .Skip ();_ecd !=nil {return _ecd ;};};case _c .EndElement :break _gdg ;case _c .CharData :};};return nil ;};func (_ea *CT_Default )MarshalXML (e *_c .Encoder ,start _c .StartElement )error {start .Attr =append (start .Attr ,_c .Attr {Name :_c .Name {Local :"\u0045x\u0074\u0065\u006e\u0073\u0069\u006fn"},Value :_fg .Sprintf ("\u0025\u0076",_ea .ExtensionAttr )});start .Attr =append (start .Attr ,_c .Attr {Name :_c .Name {Local :"C\u006f\u006e\u0074\u0065\u006e\u0074\u0054\u0079\u0070\u0065"},Value :_fg .Sprintf ("\u0025\u0076",_ea .ContentTypeAttr )});e .EncodeToken (start );e .EncodeToken (_c .EndElement {Name :start .Name });return nil ;};func (_eff *Default )UnmarshalXML (d *_c .Decoder ,start _c .StartElement )error {_eff .CT_Default =*NewCT_Default ();for _ ,_dbc :=range start .Attr {if _dbc .Name .Local =="\u0045x\u0074\u0065\u006e\u0073\u0069\u006fn"{_fca ,_cgc :=_dbc .Value ,error (nil );if _cgc !=nil {return _cgc ;};_eff .ExtensionAttr =_fca ;continue ;};if _dbc .Name .Local =="C\u006f\u006e\u0074\u0065\u006e\u0074\u0054\u0079\u0070\u0065"{_cec ,_gbe :=_dbc .Value ,error (nil );if _gbe !=nil {return _gbe ;};_eff .ContentTypeAttr =_cec ;continue ;};};for {_bd ,_ead :=d .Token ();if _ead !=nil {return _fg .Errorf ("\u0070\u0061\u0072\u0073in\u0067\u0020\u0044\u0065\u0066\u0061\u0075\u006c\u0074\u003a\u0020\u0025\u0073",_ead );};if _gfc ,_fbc :=_bd .(_c .EndElement );_fbc &&_gfc .Name ==start .Name {break ;};};return nil ;};
|
||||
|
||||
// ValidateWithPath validates the CT_Types and its children, prefixing error messages with path
|
||||
func (_af *CT_Types )ValidateWithPath (path string )error {for _dbf ,_ef :=range _af .Default {if _ffc :=_ef .ValidateWithPath (_fg .Sprintf ("\u0025\u0073\u002f\u0044\u0065\u0066\u0061\u0075\u006ct\u005b\u0025\u0064\u005d",path ,_dbf ));_ffc !=nil {return _ffc ;};};for _aaf ,_bf :=range _af .Override {if _dcd :=_bf .ValidateWithPath (_fg .Sprintf ("\u0025s\u002fO\u0076\u0065\u0072\u0072\u0069\u0064\u0065\u005b\u0025\u0064\u005d",path ,_aaf ));_dcd !=nil {return _dcd ;};};return nil ;};func NewDefault ()*Default {_ege :=&Default {};_ege .CT_Default =*NewCT_Default ();return _ege };func (_ad *CT_Override )MarshalXML (e *_c .Encoder ,start _c .StartElement )error {start .Attr =append (start .Attr ,_c .Attr {Name :_c .Name {Local :"C\u006f\u006e\u0074\u0065\u006e\u0074\u0054\u0079\u0070\u0065"},Value :_fg .Sprintf ("\u0025\u0076",_ad .ContentTypeAttr )});start .Attr =append (start .Attr ,_c .Attr {Name :_c .Name {Local :"\u0050\u0061\u0072\u0074\u004e\u0061\u006d\u0065"},Value :_fg .Sprintf ("\u0025\u0076",_ad .PartNameAttr )});e .EncodeToken (start );e .EncodeToken (_c .EndElement {Name :start .Name });return nil ;};
|
||||
|
||||
// Validate validates the CT_Default and its children
|
||||
func (_cd *CT_Default )Validate ()error {return _cd .ValidateWithPath ("\u0043\u0054\u005f\u0044\u0065\u0066\u0061\u0075\u006c\u0074");};func NewTypes ()*Types {_fgbg :=&Types {};_fgbg .CT_Types =*NewCT_Types ();return _fgbg };const ST_ContentTypePattern ="\u005e\\\u0070{\u004c\u0061\u0074\u0069\u006e\u007d\u002b\u002f\u002e\u002a\u0024";
|
||||
package content_types ;import (_d "encoding/xml";_c "fmt";_a "github.com/unidoc/unioffice";_e "github.com/unidoc/unioffice/common/logger";_f "regexp";);
|
||||
|
||||
// ValidateWithPath validates the Types and its children, prefixing error messages with path
|
||||
func (_dde *Types )ValidateWithPath (path string )error {if _gdf :=_dde .CT_Types .ValidateWithPath (path );_gdf !=nil {return _gdf ;};return nil ;};func (_cea *Override )UnmarshalXML (d *_c .Decoder ,start _c .StartElement )error {_cea .CT_Override =*NewCT_Override ();for _ ,_be :=range start .Attr {if _be .Name .Local =="C\u006f\u006e\u0074\u0065\u006e\u0074\u0054\u0079\u0070\u0065"{_bb ,_fba :=_be .Value ,error (nil );if _fba !=nil {return _fba ;};_cea .ContentTypeAttr =_bb ;continue ;};if _be .Name .Local =="\u0050\u0061\u0072\u0074\u004e\u0061\u006d\u0065"{_egg ,_dba :=_be .Value ,error (nil );if _dba !=nil {return _dba ;};_cea .PartNameAttr =_egg ;continue ;};};for {_edb ,_afc :=d .Token ();if _afc !=nil {return _fg .Errorf ("p\u0061r\u0073\u0069\u006e\u0067\u0020\u004f\u0076\u0065r\u0072\u0069\u0064\u0065: \u0025\u0073",_afc );};if _cgf ,_fdf :=_edb .(_c .EndElement );_fdf &&_cgf .Name ==start .Name {break ;};};return nil ;};func NewCT_Default ()*CT_Default {_gb :=&CT_Default {};_gb .ExtensionAttr ="\u0078\u006d\u006c";_gb .ContentTypeAttr ="\u0061p\u0070l\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u0078\u006d\u006c";return _gb ;};func NewOverride ()*Override {_aag :=&Override {};_aag .CT_Override =*NewCT_Override ();return _aag };const ST_ExtensionPattern ="\u0028\u005b\u0021\u0024\u0026\u0027\\\u0028\u005c\u0029\u005c\u002a\\\u002b\u002c\u003a\u003d\u005d\u007c(\u0025\u005b\u0030\u002d\u0039a\u002d\u0066\u0041\u002d\u0046\u005d\u005b\u0030\u002d\u0039\u0061\u002df\u0041\u002d\u0046\u005d\u0029\u007c\u005b\u003a\u0040\u005d\u007c\u005b\u0061\u002d\u007aA\u002d\u005a\u0030\u002d\u0039\u005c\u002d\u005f~\u005d\u0029\u002b";type CT_Default struct{ExtensionAttr string ;ContentTypeAttr string ;};
|
||||
|
||||
// Validate validates the CT_Types and its children
|
||||
func (_aae *CT_Types )Validate ()error {return _aae .ValidateWithPath ("\u0043\u0054\u005f\u0054\u0079\u0070\u0065\u0073");};
|
||||
func (_bdg *Types )ValidateWithPath (path string )error {if _gbe :=_bdg .CT_Types .ValidateWithPath (path );_gbe !=nil {return _gbe ;};return nil ;};func (_eg *CT_Override )MarshalXML (e *_d .Encoder ,start _d .StartElement )error {start .Attr =append (start .Attr ,_d .Attr {Name :_d .Name {Local :"C\u006f\u006e\u0074\u0065\u006e\u0074\u0054\u0079\u0070\u0065"},Value :_c .Sprintf ("\u0025\u0076",_eg .ContentTypeAttr )});start .Attr =append (start .Attr ,_d .Attr {Name :_d .Name {Local :"\u0050\u0061\u0072\u0074\u004e\u0061\u006d\u0065"},Value :_c .Sprintf ("\u0025\u0076",_eg .PartNameAttr )});e .EncodeToken (start );e .EncodeToken (_d .EndElement {Name :start .Name });return nil ;};type Default struct{CT_Default };func (_fgd *CT_Types )MarshalXML (e *_d .Encoder ,start _d .StartElement )error {e .EncodeToken (start );if _fgd .Default !=nil {_ee :=_d .StartElement {Name :_d .Name {Local :"\u0044e\u0066\u0061\u0075\u006c\u0074"}};for _ ,_cf :=range _fgd .Default {e .EncodeElement (_cf ,_ee );};};if _fgd .Override !=nil {_agf :=_d .StartElement {Name :_d .Name {Local :"\u004f\u0076\u0065\u0072\u0072\u0069\u0064\u0065"}};for _ ,_ab :=range _fgd .Override {e .EncodeElement (_ab ,_agf );};};e .EncodeToken (_d .EndElement {Name :start .Name });return nil ;};func (_cdd *Override )MarshalXML (e *_d .Encoder ,start _d .StartElement )error {return _cdd .CT_Override .MarshalXML (e ,start );};
|
||||
|
||||
// Validate validates the Override and its children
|
||||
func (_bbc *Override )Validate ()error {return _bbc .ValidateWithPath ("\u004f\u0076\u0065\u0072\u0072\u0069\u0064\u0065");};func (_db *CT_Types )MarshalXML (e *_c .Encoder ,start _c .StartElement )error {e .EncodeToken (start );if _db .Default !=nil {_ac :=_c .StartElement {Name :_c .Name {Local :"\u0044e\u0066\u0061\u0075\u006c\u0074"}};for _ ,_ag :=range _db .Default {e .EncodeElement (_ag ,_ac );};};if _db .Override !=nil {_gdc :=_c .StartElement {Name :_c .Name {Local :"\u004f\u0076\u0065\u0072\u0072\u0069\u0064\u0065"}};for _ ,_dd :=range _db .Override {e .EncodeElement (_dd ,_gdc );};};e .EncodeToken (_c .EndElement {Name :start .Name });return nil ;};func NewCT_Override ()*CT_Override {_fbd :=&CT_Override {};_fbd .ContentTypeAttr ="\u0061p\u0070l\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u0078\u006d\u006c";return _fbd ;};func (_bag *Override )MarshalXML (e *_c .Encoder ,start _c .StartElement )error {return _bag .CT_Override .MarshalXML (e ,start );};func (_ec *CT_Override )UnmarshalXML (d *_c .Decoder ,start _c .StartElement )error {_ec .ContentTypeAttr ="\u0061p\u0070l\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u0078\u006d\u006c";for _ ,_ff :=range start .Attr {if _ff .Name .Local =="C\u006f\u006e\u0074\u0065\u006e\u0074\u0054\u0079\u0070\u0065"{_ba ,_aa :=_ff .Value ,error (nil );if _aa !=nil {return _aa ;};_ec .ContentTypeAttr =_ba ;continue ;};if _ff .Name .Local =="\u0050\u0061\u0072\u0074\u004e\u0061\u006d\u0065"{_ffg ,_ab :=_ff .Value ,error (nil );if _ab !=nil {return _ab ;};_ec .PartNameAttr =_ffg ;continue ;};};for {_gcg ,_eb :=d .Token ();if _eb !=nil {return _fg .Errorf ("\u0070\u0061\u0072si\u006e\u0067\u0020\u0043\u0054\u005f\u004f\u0076\u0065\u0072\u0072\u0069\u0064\u0065\u003a\u0020\u0025\u0073",_eb );};if _abb ,_ce :=_gcg .(_c .EndElement );_ce &&_abb .Name ==start .Name {break ;};};return nil ;};type Override struct{CT_Override };
|
||||
func (_cc *Override )Validate ()error {return _cc .ValidateWithPath ("\u004f\u0076\u0065\u0072\u0072\u0069\u0064\u0065");};func NewDefault ()*Default {_ggg :=&Default {};_ggg .CT_Default =*NewCT_Default ();return _ggg };
|
||||
|
||||
// ValidateWithPath validates the Default and its children, prefixing error messages with path
|
||||
func (_egf *Default )ValidateWithPath (path string )error {if _daf :=_egf .CT_Default .ValidateWithPath (path );_daf !=nil {return _daf ;};return nil ;};var ST_ExtensionPatternRe =_e .MustCompile (ST_ExtensionPattern );
|
||||
// ValidateWithPath validates the CT_Types and its children, prefixing error messages with path
|
||||
func (_badg *CT_Types )ValidateWithPath (path string )error {for _fea ,_gef :=range _badg .Default {if _egc :=_gef .ValidateWithPath (_c .Sprintf ("\u0025\u0073\u002f\u0044\u0065\u0066\u0061\u0075\u006ct\u005b\u0025\u0064\u005d",path ,_fea ));_egc !=nil {return _egc ;};};for _egcd ,_cbb :=range _badg .Override {if _bf :=_cbb .ValidateWithPath (_c .Sprintf ("\u0025s\u002fO\u0076\u0065\u0072\u0072\u0069\u0064\u0065\u005b\u0025\u0064\u005d",path ,_egcd ));_bf !=nil {return _bf ;};};return nil ;};func (_def *CT_Override )UnmarshalXML (d *_d .Decoder ,start _d .StartElement )error {_def .ContentTypeAttr ="\u0061p\u0070l\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u0078\u006d\u006c";for _ ,_bbfc :=range start .Attr {if _bbfc .Name .Local =="C\u006f\u006e\u0074\u0065\u006e\u0074\u0054\u0079\u0070\u0065"{_ca ,_fbd :=_bbfc .Value ,error (nil );if _fbd !=nil {return _fbd ;};_def .ContentTypeAttr =_ca ;continue ;};if _bbfc .Name .Local =="\u0050\u0061\u0072\u0074\u004e\u0061\u006d\u0065"{_fec ,_dg :=_bbfc .Value ,error (nil );if _dg !=nil {return _dg ;};_def .PartNameAttr =_fec ;continue ;};};for {_cae ,_be :=d .Token ();if _be !=nil {return _c .Errorf ("\u0070\u0061\u0072si\u006e\u0067\u0020\u0043\u0054\u005f\u004f\u0076\u0065\u0072\u0072\u0069\u0064\u0065\u003a\u0020\u0025\u0073",_be );};if _dge ,_bad :=_cae .(_d .EndElement );_bad &&_dge .Name ==start .Name {break ;};};return nil ;};func NewCT_Default ()*CT_Default {_ec :=&CT_Default {};_ec .ExtensionAttr ="\u0078\u006d\u006c";_ec .ContentTypeAttr ="\u0061p\u0070l\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u0078\u006d\u006c";return _ec ;};func (_fc *Default )MarshalXML (e *_d .Encoder ,start _d .StartElement )error {return _fc .CT_Default .MarshalXML (e ,start );};type CT_Default struct{ExtensionAttr string ;ContentTypeAttr string ;};func (_df *CT_Types )UnmarshalXML (d *_d .Decoder ,start _d .StartElement )error {_fee :for {_ecg ,_dfd :=d .Token ();if _dfd !=nil {return _dfd ;};switch _cb :=_ecg .(type ){case _d .StartElement :switch _cb .Name {case _d .Name {Space :"ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s",Local :"\u0044e\u0066\u0061\u0075\u006c\u0074"}:_aba :=NewDefault ();if _dca :=d .DecodeElement (_aba ,&_cb );_dca !=nil {return _dca ;};_df .Default =append (_df .Default ,_aba );case _d .Name {Space :"ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s",Local :"\u004f\u0076\u0065\u0072\u0072\u0069\u0064\u0065"}:_ed :=NewOverride ();if _badf :=d .DecodeElement (_ed ,&_cb );_badf !=nil {return _badf ;};_df .Override =append (_df .Override ,_ed );default:_e .Log .Debug ("\u0073\u006b\u0069\u0070\u0070\u0069\u006eg\u0020\u0075\u006es\u0075\u0070\u0070\u006fr\u0074\u0065\u0064\u0020\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0020\u006f\u006e\u0020\u0043\u0054\u005f\u0054\u0079\u0070\u0065\u0073\u0020\u0025\u0076",_cb .Name );if _ef :=d .Skip ();_ef !=nil {return _ef ;};};case _d .EndElement :break _fee ;case _d .CharData :};};return nil ;};
|
||||
|
||||
// Validate validates the Default and its children
|
||||
func (_edc *Default )Validate ()error {return _edc .ValidateWithPath ("\u0044e\u0066\u0061\u0075\u006c\u0074");};
|
||||
|
||||
// ValidateWithPath validates the Override and its children, prefixing error messages with path
|
||||
func (_gf *Override )ValidateWithPath (path string )error {if _db :=_gf .CT_Override .ValidateWithPath (path );_db !=nil {return _db ;};return nil ;};func (_g *CT_Default )UnmarshalXML (d *_d .Decoder ,start _d .StartElement )error {_g .ExtensionAttr ="\u0078\u006d\u006c";_g .ContentTypeAttr ="\u0061p\u0070l\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u0078\u006d\u006c";for _ ,_ge :=range start .Attr {if _ge .Name .Local =="\u0045x\u0074\u0065\u006e\u0073\u0069\u006fn"{_ac ,_fe :=_ge .Value ,error (nil );if _fe !=nil {return _fe ;};_g .ExtensionAttr =_ac ;continue ;};if _ge .Name .Local =="C\u006f\u006e\u0074\u0065\u006e\u0074\u0054\u0079\u0070\u0065"{_acd ,_fb :=_ge .Value ,error (nil );if _fb !=nil {return _fb ;};_g .ContentTypeAttr =_acd ;continue ;};};for {_bb ,_bbf :=d .Token ();if _bbf !=nil {return _c .Errorf ("\u0070\u0061\u0072\u0073in\u0067\u0020\u0043\u0054\u005f\u0044\u0065\u0066\u0061\u0075\u006c\u0074\u003a\u0020%\u0073",_bbf );};if _ag ,_gd :=_bb .(_d .EndElement );_gd &&_ag .Name ==start .Name {break ;};};return nil ;};type CT_Override struct{ContentTypeAttr string ;PartNameAttr string ;};const ST_ExtensionPattern ="\u0028\u005b\u0021\u0024\u0026\u0027\\\u0028\u005c\u0029\u005c\u002a\\\u002b\u002c\u003a\u003d\u005d\u007c(\u0025\u005b\u0030\u002d\u0039a\u002d\u0066\u0041\u002d\u0046\u005d\u005b\u0030\u002d\u0039\u0061\u002df\u0041\u002d\u0046\u005d\u0029\u007c\u005b\u003a\u0040\u005d\u007c\u005b\u0061\u002d\u007aA\u002d\u005a\u0030\u002d\u0039\u005c\u002d\u005f~\u005d\u0029\u002b";
|
||||
|
||||
// Validate validates the Types and its children
|
||||
func (_dafd *Types )Validate ()error {return _dafd .ValidateWithPath ("\u0054\u0079\u0070e\u0073")};func (_ee *CT_Default )UnmarshalXML (d *_c .Decoder ,start _c .StartElement )error {_ee .ExtensionAttr ="\u0078\u006d\u006c";_ee .ContentTypeAttr ="\u0061p\u0070l\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u0078\u006d\u006c";for _ ,_gf :=range start .Attr {if _gf .Name .Local =="\u0045x\u0074\u0065\u006e\u0073\u0069\u006fn"{_cg ,_dc :=_gf .Value ,error (nil );if _dc !=nil {return _dc ;};_ee .ExtensionAttr =_cg ;continue ;};if _gf .Name .Local =="C\u006f\u006e\u0074\u0065\u006e\u0074\u0054\u0079\u0070\u0065"{_ed ,_cgb :=_gf .Value ,error (nil );if _cgb !=nil {return _cgb ;};_ee .ContentTypeAttr =_ed ;continue ;};};for {_gc ,_cb :=d .Token ();if _cb !=nil {return _fg .Errorf ("\u0070\u0061\u0072\u0073in\u0067\u0020\u0043\u0054\u005f\u0044\u0065\u0066\u0061\u0075\u006c\u0074\u003a\u0020%\u0073",_cb );};if _fb ,_a :=_gc .(_c .EndElement );_a &&_fb .Name ==start .Name {break ;};};return nil ;};type CT_Types struct{Default []*Default ;Override []*Override ;};func (_cee *Types )MarshalXML (e *_c .Encoder ,start _c .StartElement )error {start .Attr =append (start .Attr ,_c .Attr {Name :_c .Name {Local :"\u0078\u006d\u006cn\u0073"},Value :"ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s"});start .Attr =append (start .Attr ,_c .Attr {Name :_c .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u0078\u006dl"},Value :"\u0068\u0074tp\u003a\u002f\u002fw\u0077\u0077\u002e\u00773.o\u0072g/\u0058\u004d\u004c\u002f\u0031\u0039\u00398/\u006e\u0061\u006d\u0065\u0073\u0070\u0061c\u0065"});start .Name .Local ="\u0054\u0079\u0070e\u0073";return _cee .CT_Types .MarshalXML (e ,start );};type Default struct{CT_Default };var ST_ContentTypePatternRe =_e .MustCompile (ST_ContentTypePattern );func init (){_b .RegisterConstructor ("ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s","\u0043\u0054\u005f\u0054\u0079\u0070\u0065\u0073",NewCT_Types );_b .RegisterConstructor ("ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s","\u0043\u0054\u005f\u0044\u0065\u0066\u0061\u0075\u006c\u0074",NewCT_Default );_b .RegisterConstructor ("ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s","C\u0054\u005f\u004f\u0076\u0065\u0072\u0072\u0069\u0064\u0065",NewCT_Override );_b .RegisterConstructor ("ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s","\u0054\u0079\u0070e\u0073",NewTypes );_b .RegisterConstructor ("ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s","\u0044e\u0066\u0061\u0075\u006c\u0074",NewDefault );_b .RegisterConstructor ("ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s","\u004f\u0076\u0065\u0072\u0072\u0069\u0064\u0065",NewOverride );};
|
||||
func (_gbd *Types )Validate ()error {return _gbd .ValidateWithPath ("\u0054\u0079\u0070e\u0073")};type Types struct{CT_Types };
|
||||
|
||||
// Validate validates the CT_Types and its children
|
||||
func (_eaa *CT_Types )Validate ()error {return _eaa .ValidateWithPath ("\u0043\u0054\u005f\u0054\u0079\u0070\u0065\u0073");};func NewCT_Types ()*CT_Types {_fg :=&CT_Types {};return _fg };func NewOverride ()*Override {_cd :=&Override {};_cd .CT_Override =*NewCT_Override ();return _cd };func NewCT_Override ()*CT_Override {_ba :=&CT_Override {};_ba .ContentTypeAttr ="\u0061p\u0070l\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u0078\u006d\u006c";return _ba ;};func (_cg *CT_Default )MarshalXML (e *_d .Encoder ,start _d .StartElement )error {start .Attr =append (start .Attr ,_d .Attr {Name :_d .Name {Local :"\u0045x\u0074\u0065\u006e\u0073\u0069\u006fn"},Value :_c .Sprintf ("\u0025\u0076",_cg .ExtensionAttr )});start .Attr =append (start .Attr ,_d .Attr {Name :_d .Name {Local :"C\u006f\u006e\u0074\u0065\u006e\u0074\u0054\u0079\u0070\u0065"},Value :_c .Sprintf ("\u0025\u0076",_cg .ContentTypeAttr )});e .EncodeToken (start );e .EncodeToken (_d .EndElement {Name :start .Name });return nil ;};func (_dcg *Types )UnmarshalXML (d *_d .Decoder ,start _d .StartElement )error {_dcg .CT_Types =*NewCT_Types ();_bbfb :for {_geff ,_bbb :=d .Token ();if _bbb !=nil {return _bbb ;};switch _fdb :=_geff .(type ){case _d .StartElement :switch _fdb .Name {case _d .Name {Space :"ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s",Local :"\u0044e\u0066\u0061\u0075\u006c\u0074"}:_dfb :=NewDefault ();if _acc :=d .DecodeElement (_dfb ,&_fdb );_acc !=nil {return _acc ;};_dcg .Default =append (_dcg .Default ,_dfb );case _d .Name {Space :"ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s",Local :"\u004f\u0076\u0065\u0072\u0072\u0069\u0064\u0065"}:_ggc :=NewOverride ();if _fa :=d .DecodeElement (_ggc ,&_fdb );_fa !=nil {return _fa ;};_dcg .Override =append (_dcg .Override ,_ggc );default:_e .Log .Debug ("s\u006b\u0069\u0070\u0070\u0069\u006e\u0067\u0020\u0075\u006e\u0073\u0075\u0070\u0070\u006f\u0072\u0074\u0065d\u0020\u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0020\u006fn \u0054\u0079\u0070e\u0073 \u0025\u0076",_fdb .Name );if _fcee :=d .Skip ();_fcee !=nil {return _fcee ;};};case _d .EndElement :break _bbfb ;case _d .CharData :};};return nil ;};func NewTypes ()*Types {_da :=&Types {};_da .CT_Types =*NewCT_Types ();return _da };func (_fce *Default )UnmarshalXML (d *_d .Decoder ,start _d .StartElement )error {_fce .CT_Default =*NewCT_Default ();for _ ,_dfa :=range start .Attr {if _dfa .Name .Local =="\u0045x\u0074\u0065\u006e\u0073\u0069\u006fn"{_abac ,_fd :=_dfa .Value ,error (nil );if _fd !=nil {return _fd ;};_fce .ExtensionAttr =_abac ;continue ;};if _dfa .Name .Local =="C\u006f\u006e\u0074\u0065\u006e\u0074\u0054\u0079\u0070\u0065"{_bfa ,_eec :=_dfa .Value ,error (nil );if _eec !=nil {return _eec ;};_fce .ContentTypeAttr =_bfa ;continue ;};};for {_bd ,_bc :=d .Token ();if _bc !=nil {return _c .Errorf ("\u0070\u0061\u0072\u0073in\u0067\u0020\u0044\u0065\u0066\u0061\u0075\u006c\u0074\u003a\u0020\u0025\u0073",_bc );};if _eee ,_aa :=_bd .(_d .EndElement );_aa &&_eee .Name ==start .Name {break ;};};return nil ;};
|
||||
|
||||
// ValidateWithPath validates the CT_Override and its children, prefixing error messages with path
|
||||
func (_gg *CT_Override )ValidateWithPath (path string )error {if !ST_ContentTypePatternRe .MatchString (_gg .ContentTypeAttr ){return _c .Errorf ("\u0025\u0073/\u006d\u002e\u0043\u006f\u006e\u0074\u0065\u006e\u0074\u0054\u0079\u0070\u0065\u0041\u0074\u0074\u0072\u0020\u006d\u0075\u0073\u0074\u0020\u006d\u0061\u0074\u0063\u0068\u0020\u0027\u0025\u0073\u0027\u0020\u0028\u0068\u0061\u0076\u0065\u0020\u0025\u0076\u0029",path ,ST_ContentTypePatternRe ,_gg .ContentTypeAttr );};return nil ;};func (_agb *Types )MarshalXML (e *_d .Encoder ,start _d .StartElement )error {start .Attr =append (start .Attr ,_d .Attr {Name :_d .Name {Local :"\u0078\u006d\u006cn\u0073"},Value :"ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s"});start .Attr =append (start .Attr ,_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 ="\u0054\u0079\u0070e\u0073";return _agb .CT_Types .MarshalXML (e ,start );};const ST_ContentTypePattern ="\u005e\\\u0070{\u004c\u0061\u0074\u0069\u006e\u007d\u002b\u002f\u002e\u002a\u0024";type Override struct{CT_Override };
|
||||
|
||||
// Validate validates the CT_Default and its children
|
||||
func (_cgf *CT_Default )Validate ()error {return _cgf .ValidateWithPath ("\u0043\u0054\u005f\u0044\u0065\u0066\u0061\u0075\u006c\u0074");};
|
||||
|
||||
// Validate validates the CT_Override and its children
|
||||
func (_ea *CT_Override )Validate ()error {return _ea .ValidateWithPath ("C\u0054\u005f\u004f\u0076\u0065\u0072\u0072\u0069\u0064\u0065");};var ST_ContentTypePatternRe =_f .MustCompile (ST_ContentTypePattern );type CT_Types struct{Default []*Default ;Override []*Override ;};
|
||||
|
||||
// ValidateWithPath validates the Default and its children, prefixing error messages with path
|
||||
func (_abg *Default )ValidateWithPath (path string )error {if _fbdg :=_abg .CT_Default .ValidateWithPath (path );_fbdg !=nil {return _fbdg ;};return nil ;};
|
||||
|
||||
// ValidateWithPath validates the CT_Default and its children, prefixing error messages with path
|
||||
func (_de *CT_Default )ValidateWithPath (path string )error {if !ST_ExtensionPatternRe .MatchString (_de .ExtensionAttr ){return _c .Errorf ("\u0025s\u002f\u006d.\u0045\u0078\u0074\u0065n\u0073\u0069\u006fn\u0041\u0074\u0074\u0072\u0020\u006d\u0075\u0073\u0074 m\u0061\u0074\u0063h\u0020\u0027%\u0073\u0027\u0020\u0028\u0068\u0061v\u0065\u0020%\u0076\u0029",path ,ST_ExtensionPatternRe ,_de .ExtensionAttr );};if !ST_ContentTypePatternRe .MatchString (_de .ContentTypeAttr ){return _c .Errorf ("\u0025\u0073/\u006d\u002e\u0043\u006f\u006e\u0074\u0065\u006e\u0074\u0054\u0079\u0070\u0065\u0041\u0074\u0074\u0072\u0020\u006d\u0075\u0073\u0074\u0020\u006d\u0061\u0074\u0063\u0068\u0020\u0027\u0025\u0073\u0027\u0020\u0028\u0068\u0061\u0076\u0065\u0020\u0025\u0076\u0029",path ,ST_ContentTypePatternRe ,_de .ContentTypeAttr );};return nil ;};func (_cad *Override )UnmarshalXML (d *_d .Decoder ,start _d .StartElement )error {_cad .CT_Override =*NewCT_Override ();for _ ,_fecf :=range start .Attr {if _fecf .Name .Local =="C\u006f\u006e\u0074\u0065\u006e\u0074\u0054\u0079\u0070\u0065"{_ga ,_fead :=_fecf .Value ,error (nil );if _fead !=nil {return _fead ;};_cad .ContentTypeAttr =_ga ;continue ;};if _fecf .Name .Local =="\u0050\u0061\u0072\u0074\u004e\u0061\u006d\u0065"{_fbdge ,_dff :=_fecf .Value ,error (nil );if _dff !=nil {return _dff ;};_cad .PartNameAttr =_fbdge ;continue ;};};for {_caf ,_cbf :=d .Token ();if _cbf !=nil {return _c .Errorf ("p\u0061r\u0073\u0069\u006e\u0067\u0020\u004f\u0076\u0065r\u0072\u0069\u0064\u0065: \u0025\u0073",_cbf );};if _ce ,_ged :=_caf .(_d .EndElement );_ged &&_ce .Name ==start .Name {break ;};};return nil ;};var ST_ExtensionPatternRe =_f .MustCompile (ST_ExtensionPattern );func init (){_a .RegisterConstructor ("ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s","\u0043\u0054\u005f\u0054\u0079\u0070\u0065\u0073",NewCT_Types );_a .RegisterConstructor ("ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s","\u0043\u0054\u005f\u0044\u0065\u0066\u0061\u0075\u006c\u0074",NewCT_Default );_a .RegisterConstructor ("ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s","C\u0054\u005f\u004f\u0076\u0065\u0072\u0072\u0069\u0064\u0065",NewCT_Override );_a .RegisterConstructor ("ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s","\u0054\u0079\u0070e\u0073",NewTypes );_a .RegisterConstructor ("ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s","\u0044e\u0066\u0061\u0075\u006c\u0074",NewDefault );_a .RegisterConstructor ("ht\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u0070\u0061\u0063\u006b\u0061\u0067\u0065\u002f\u00320\u00306\u002f\u0063\u006f\u006e\u0074\u0065\u006e\u0074-\u0074y\u0070\u0065s","\u004f\u0076\u0065\u0072\u0072\u0069\u0064\u0065",NewOverride );};
|
File diff suppressed because one or more lines are too long
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";_df "fmt";_de "github.com/unidoc/unioffice";_da "github.com/unidoc/unioffice/common/logger";);
|
||||
|
||||
// ValidateWithPath validates the CT_Schema and its children, prefixing error messages with path
|
||||
func (_eb *CT_Schema )ValidateWithPath (path string )error {return nil };type CT_Schema struct{UriAttr *string ;ManifestLocationAttr *string ;SchemaLocationAttr *string ;SchemaLanguageAttr *string ;};func (_dce *SchemaLibrary )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {_dce .CT_SchemaLibrary =*NewCT_SchemaLibrary ();_ed :for {_efc ,_dff :=d .Token ();if _dff !=nil {return _dff ;};switch _gcd :=_efc .(type ){case _g .StartElement :switch _gcd .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"}:_ddf :=NewCT_Schema ();if _eg :=d .DecodeElement (_ddf ,&_gcd );_eg !=nil {return _eg ;};_dce .Schema =append (_dce .Schema ,_ddf );default:_da .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",_gcd .Name );if _deb :=d .Skip ();_deb !=nil {return _deb ;};};case _g .EndElement :break _ed ;case _g .CharData :};};return nil ;};
|
||||
|
||||
// Validate validates the SchemaLibrary and its children
|
||||
func (_dcec *SchemaLibrary )Validate ()error {return _dcec .ValidateWithPath ("\u0053\u0063\u0068\u0065\u006d\u0061\u004c\u0069\u0062\u0072\u0061\u0072\u0079");};func NewSchemaLibrary ()*SchemaLibrary {_fc :=&SchemaLibrary {};_fc .CT_SchemaLibrary =*NewCT_SchemaLibrary ();return _fc ;};func (_dd *CT_Schema )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {if _dd .UriAttr !=nil {start .Attr =append (start .Attr ,_g .Attr {Name :_g .Name {Local :"\u006d\u0061\u003a\u0075\u0072\u0069"},Value :_df .Sprintf ("\u0025\u0076",*_dd .UriAttr )});};if _dd .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 :_df .Sprintf ("\u0025\u0076",*_dd .ManifestLocationAttr )});};if _dd .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 :_df .Sprintf ("\u0025\u0076",*_dd .SchemaLocationAttr )});};if _dd .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 :_df .Sprintf ("\u0025\u0076",*_dd .SchemaLanguageAttr )});};e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};
|
||||
package schemaLibrary ;import (_d "encoding/xml";_dc "fmt";_c "github.com/unidoc/unioffice";_de "github.com/unidoc/unioffice/common/logger";);func (_dg *SchemaLibrary )UnmarshalXML (d *_d .Decoder ,start _d .StartElement )error {_dg .CT_SchemaLibrary =*NewCT_SchemaLibrary ();_deg :for {_ba ,_ff :=d .Token ();if _ff !=nil {return _ff ;};switch _ac :=_ba .(type ){case _d .StartElement :switch _ac .Name {case _d .Name {Space :"\u0068\u0074\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067/\u0073\u0063\u0068\u0065\u006da\u004c\u0069\u0062\u0072\u0061\u0072\u0079\u002f\u0032\u0030\u0030\u0036\u002f\u006d\u0061\u0069\u006e",Local :"\u0073\u0063\u0068\u0065\u006d\u0061"}:_beg :=NewCT_Schema ();if _fdg :=d .DecodeElement (_beg ,&_ac );_fdg !=nil {return _fdg ;};_dg .Schema =append (_dg .Schema ,_beg );default:_de .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",_ac .Name );if _gbc :=d .Skip ();_gbc !=nil {return _gbc ;};};case _d .EndElement :break _deg ;case _d .CharData :};};return nil ;};
|
||||
|
||||
// ValidateWithPath validates the SchemaLibrary and its children, prefixing error messages with path
|
||||
func (_dfb *SchemaLibrary )ValidateWithPath (path string )error {if _ea :=_dfb .CT_SchemaLibrary .ValidateWithPath (path );_ea !=nil {return _ea ;};return nil ;};func NewCT_SchemaLibrary ()*CT_SchemaLibrary {_cg :=&CT_SchemaLibrary {};return _cg };type CT_SchemaLibrary struct{Schema []*CT_Schema ;};func (_ce *CT_SchemaLibrary )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {e .EncodeToken (start );if _ce .Schema !=nil {_dg :=_g .StartElement {Name :_g .Name {Local :"\u006da\u003a\u0073\u0063\u0068\u0065\u006da"}};for _ ,_gb :=range _ce .Schema {e .EncodeElement (_gb ,_dg );};};e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};type SchemaLibrary struct{CT_SchemaLibrary };
|
||||
|
||||
// Validate validates the CT_SchemaLibrary and its children
|
||||
func (_ef *CT_SchemaLibrary )Validate ()error {return _ef .ValidateWithPath ("\u0043\u0054_\u0053\u0063\u0068e\u006d\u0061\u004c\u0069\u0062\u0072\u0061\u0072\u0079");};func (_ad *CT_Schema )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for _ ,_c :=range start .Attr {if _c .Name .Local =="\u0075\u0072\u0069"{_b ,_dfc :=_c .Value ,error (nil );if _dfc !=nil {return _dfc ;};_ad .UriAttr =&_b ;continue ;};if _c .Name .Local =="\u006d\u0061n\u0069\u0066\u0065s\u0074\u004c\u006f\u0063\u0061\u0074\u0069\u006f\u006e"{_cf ,_cb :=_c .Value ,error (nil );if _cb !=nil {return _cb ;};_ad .ManifestLocationAttr =&_cf ;continue ;};if _c .Name .Local =="\u0073\u0063\u0068\u0065\u006d\u0061\u004c\u006f\u0063a\u0074\u0069\u006f\u006e"{_dac ,_gg :=_c .Value ,error (nil );if _gg !=nil {return _gg ;};_ad .SchemaLocationAttr =&_dac ;continue ;};if _c .Name .Local =="\u0073\u0063\u0068\u0065\u006d\u0061\u004c\u0061\u006eg\u0075\u0061\u0067\u0065"{_gge ,_bc :=_c .Value ,error (nil );if _bc !=nil {return _bc ;};_ad .SchemaLanguageAttr =&_gge ;continue ;};};for {_fe ,_ab :=d .Token ();if _ab !=nil {return _df .Errorf ("p\u0061\u0072\u0073\u0069ng\u0020C\u0054\u005f\u0053\u0063\u0068e\u006d\u0061\u003a\u0020\u0025\u0073",_ab );};if _e ,_cc :=_fe .(_g .EndElement );_cc &&_e .Name ==start .Name {break ;};};return nil ;};
|
||||
func (_gf *SchemaLibrary )ValidateWithPath (path string )error {if _gde :=_gf .CT_SchemaLibrary .ValidateWithPath (path );_gde !=nil {return _gde ;};return nil ;};
|
||||
|
||||
// ValidateWithPath validates the CT_SchemaLibrary and its children, prefixing error messages with path
|
||||
func (_ag *CT_SchemaLibrary )ValidateWithPath (path string )error {for _ec ,_af :=range _ag .Schema {if _db :=_af .ValidateWithPath (_df .Sprintf ("\u0025\u0073\u002f\u0053\u0063\u0068\u0065\u006d\u0061\u005b\u0025\u0064\u005d",path ,_ec ));_db !=nil {return _db ;};};return nil ;};func NewCT_Schema ()*CT_Schema {_a :=&CT_Schema {};return _a };func (_cd *CT_SchemaLibrary )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {_gdc :for {_cff ,_feg :=d .Token ();if _feg !=nil {return _feg ;};switch _dc :=_cff .(type ){case _g .StartElement :switch _dc .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"}:_cbg :=NewCT_Schema ();if _dgd :=d .DecodeElement (_cbg ,&_dc );_dgd !=nil {return _dgd ;};_cd .Schema =append (_cd .Schema ,_cbg );default:_da .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",_dc .Name );if _fd :=d .Skip ();_fd !=nil {return _fd ;};};case _g .EndElement :break _gdc ;case _g .CharData :};};return nil ;};
|
||||
func (_bg *CT_SchemaLibrary )ValidateWithPath (path string )error {for _aag ,_fa :=range _bg .Schema {if _eg :=_fa .ValidateWithPath (_dc .Sprintf ("\u0025\u0073\u002f\u0053\u0063\u0068\u0065\u006d\u0061\u005b\u0025\u0064\u005d",path ,_aag ));_eg !=nil {return _eg ;};};return nil ;};func (_bff *CT_SchemaLibrary )UnmarshalXML (d *_d .Decoder ,start _d .StartElement )error {_ga :for {_fc ,_gg :=d .Token ();if _gg !=nil {return _gg ;};switch _ee :=_fc .(type ){case _d .StartElement :switch _ee .Name {case _d .Name {Space :"\u0068\u0074\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067/\u0073\u0063\u0068\u0065\u006da\u004c\u0069\u0062\u0072\u0061\u0072\u0079\u002f\u0032\u0030\u0030\u0036\u002f\u006d\u0061\u0069\u006e",Local :"\u0073\u0063\u0068\u0065\u006d\u0061"}:_bb :=NewCT_Schema ();if _bfe :=d .DecodeElement (_bb ,&_ee );_bfe !=nil {return _bfe ;};_bff .Schema =append (_bff .Schema ,_bb );default:_de .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",_ee .Name );if _da :=d .Skip ();_da !=nil {return _da ;};};case _d .EndElement :break _ga ;case _d .CharData :};};return nil ;};
|
||||
|
||||
// ValidateWithPath validates the CT_Schema and its children, prefixing error messages with path
|
||||
func (_cb *CT_Schema )ValidateWithPath (path string )error {return nil };func (_db *CT_Schema )MarshalXML (e *_d .Encoder ,start _d .StartElement )error {if _db .UriAttr !=nil {start .Attr =append (start .Attr ,_d .Attr {Name :_d .Name {Local :"\u006d\u0061\u003a\u0075\u0072\u0069"},Value :_dc .Sprintf ("\u0025\u0076",*_db .UriAttr )});};if _db .ManifestLocationAttr !=nil {start .Attr =append (start .Attr ,_d .Attr {Name :_d .Name {Local :"\u006d\u0061\u003a\u006dan\u0069\u0066\u0065\u0073\u0074\u004c\u006f\u0063\u0061\u0074\u0069\u006f\u006e"},Value :_dc .Sprintf ("\u0025\u0076",*_db .ManifestLocationAttr )});};if _db .SchemaLocationAttr !=nil {start .Attr =append (start .Attr ,_d .Attr {Name :_d .Name {Local :"\u006d\u0061\u003a\u0073\u0063\u0068\u0065\u006d\u0061\u004c\u006f\u0063a\u0074\u0069\u006f\u006e"},Value :_dc .Sprintf ("\u0025\u0076",*_db .SchemaLocationAttr )});};if _db .SchemaLanguageAttr !=nil {start .Attr =append (start .Attr ,_d .Attr {Name :_d .Name {Local :"\u006d\u0061\u003a\u0073\u0063\u0068\u0065\u006d\u0061\u004c\u0061\u006eg\u0075\u0061\u0067\u0065"},Value :_dc .Sprintf ("\u0025\u0076",*_db .SchemaLanguageAttr )});};e .EncodeToken (start );e .EncodeToken (_d .EndElement {Name :start .Name });return nil ;};func NewCT_Schema ()*CT_Schema {_a :=&CT_Schema {};return _a };type CT_Schema struct{UriAttr *string ;ManifestLocationAttr *string ;SchemaLocationAttr *string ;SchemaLanguageAttr *string ;};func (_af *SchemaLibrary )MarshalXML (e *_d .Encoder ,start _d .StartElement )error {start .Attr =append (start .Attr ,_d .Attr {Name :_d .Name {Local :"\u0078\u006d\u006cn\u0073"},Value :"\u0068\u0074\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067/\u0073\u0063\u0068\u0065\u006da\u004c\u0069\u0062\u0072\u0061\u0072\u0079\u002f\u0032\u0030\u0030\u0036\u002f\u006d\u0061\u0069\u006e"});start .Attr =append (start .Attr ,_d .Attr {Name :_d .Name {Local :"\u0078\u006d\u006c\u006e\u0073\u003a\u006d\u0061"},Value :"\u0068\u0074\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067/\u0073\u0063\u0068\u0065\u006da\u004c\u0069\u0062\u0072\u0061\u0072\u0079\u002f\u0032\u0030\u0030\u0036\u002f\u006d\u0061\u0069\u006e"});start .Attr =append (start .Attr ,_d .Attr {Name :_d .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u0078\u006dl"},Value :"\u0068\u0074tp\u003a\u002f\u002fw\u0077\u0077\u002e\u00773.o\u0072g/\u0058\u004d\u004c\u002f\u0031\u0039\u00398/\u006e\u0061\u006d\u0065\u0073\u0070\u0061c\u0065"});start .Name .Local ="\u006d\u0061:\u0073\u0063\u0068e\u006d\u0061\u004c\u0069\u0062\u0072\u0061\u0072\u0079";return _af .CT_SchemaLibrary .MarshalXML (e ,start );};func NewSchemaLibrary ()*SchemaLibrary {_fb :=&SchemaLibrary {};_fb .CT_SchemaLibrary =*NewCT_SchemaLibrary ();return _fb ;};
|
||||
|
||||
// Validate validates the CT_SchemaLibrary and its children
|
||||
func (_ag *CT_SchemaLibrary )Validate ()error {return _ag .ValidateWithPath ("\u0043\u0054_\u0053\u0063\u0068e\u006d\u0061\u004c\u0069\u0062\u0072\u0061\u0072\u0079");};func (_fd *CT_SchemaLibrary )MarshalXML (e *_d .Encoder ,start _d .StartElement )error {e .EncodeToken (start );if _fd .Schema !=nil {_fdd :=_d .StartElement {Name :_d .Name {Local :"\u006da\u003a\u0073\u0063\u0068\u0065\u006da"}};for _ ,_cd :=range _fd .Schema {e .EncodeElement (_cd ,_fdd );};};e .EncodeToken (_d .EndElement {Name :start .Name });return nil ;};
|
||||
|
||||
// Validate validates the SchemaLibrary and its children
|
||||
func (_bd *SchemaLibrary )Validate ()error {return _bd .ValidateWithPath ("\u0053\u0063\u0068\u0065\u006d\u0061\u004c\u0069\u0062\u0072\u0061\u0072\u0079");};type CT_SchemaLibrary struct{Schema []*CT_Schema ;};func (_b *CT_Schema )UnmarshalXML (d *_d .Decoder ,start _d .StartElement )error {for _ ,_dbg :=range start .Attr {if _dbg .Name .Local =="\u0075\u0072\u0069"{_f ,_dbe :=_dbg .Value ,error (nil );if _dbe !=nil {return _dbe ;};_b .UriAttr =&_f ;continue ;};if _dbg .Name .Local =="\u006d\u0061n\u0069\u0066\u0065s\u0074\u004c\u006f\u0063\u0061\u0074\u0069\u006f\u006e"{_ea ,_dbd :=_dbg .Value ,error (nil );if _dbd !=nil {return _dbd ;};_b .ManifestLocationAttr =&_ea ;continue ;};if _dbg .Name .Local =="\u0073\u0063\u0068\u0065\u006d\u0061\u004c\u006f\u0063a\u0074\u0069\u006f\u006e"{_aa ,_be :=_dbg .Value ,error (nil );if _be !=nil {return _be ;};_b .SchemaLocationAttr =&_aa ;continue ;};if _dbg .Name .Local =="\u0073\u0063\u0068\u0065\u006d\u0061\u004c\u0061\u006eg\u0075\u0061\u0067\u0065"{_gd ,_gdg :=_dbg .Value ,error (nil );if _gdg !=nil {return _gdg ;};_b .SchemaLanguageAttr =&_gd ;continue ;};};for {_ab ,_ae :=d .Token ();if _ae !=nil {return _dc .Errorf ("p\u0061\u0072\u0073\u0069ng\u0020C\u0054\u005f\u0053\u0063\u0068e\u006d\u0061\u003a\u0020\u0025\u0073",_ae );};if _ef ,_bf :=_ab .(_d .EndElement );_bf &&_ef .Name ==start .Name {break ;};};return nil ;};
|
||||
|
||||
// Validate validates the CT_Schema and its children
|
||||
func (_gd *CT_Schema )Validate ()error {return _gd .ValidateWithPath ("\u0043T\u005f\u0053\u0063\u0068\u0065\u006da");};func (_agd *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 _agd .CT_SchemaLibrary .MarshalXML (e ,start );};func init (){_de .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 );_de .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 );_de .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 (_eb *CT_Schema )Validate ()error {return _eb .ValidateWithPath ("\u0043T\u005f\u0053\u0063\u0068\u0065\u006da");};type SchemaLibrary struct{CT_SchemaLibrary };func NewCT_SchemaLibrary ()*CT_SchemaLibrary {_gb :=&CT_SchemaLibrary {};return _gb };func init (){_c .RegisterConstructor ("\u0068\u0074\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067/\u0073\u0063\u0068\u0065\u006da\u004c\u0069\u0062\u0072\u0061\u0072\u0079\u002f\u0032\u0030\u0030\u0036\u002f\u006d\u0061\u0069\u006e","\u0043T\u005f\u0053\u0063\u0068\u0065\u006da",NewCT_Schema );_c .RegisterConstructor ("\u0068\u0074\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067/\u0073\u0063\u0068\u0065\u006da\u004c\u0069\u0062\u0072\u0061\u0072\u0079\u002f\u0032\u0030\u0030\u0036\u002f\u006d\u0061\u0069\u006e","\u0043\u0054_\u0053\u0063\u0068e\u006d\u0061\u004c\u0069\u0062\u0072\u0061\u0072\u0079",NewCT_SchemaLibrary );_c .RegisterConstructor ("\u0068\u0074\u0074\u0070:\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073.\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067/\u0073\u0063\u0068\u0065\u006da\u004c\u0069\u0062\u0072\u0061\u0072\u0079\u002f\u0032\u0030\u0030\u0036\u002f\u006d\u0061\u0069\u006e","\u0073\u0063\u0068\u0065\u006d\u0061\u004c\u0069\u0062\u0072\u0061\u0072\u0079",NewSchemaLibrary );};
|
14396
schema/soo/sml/sml.go
14396
schema/soo/sml/sml.go
File diff suppressed because one or more lines are too long
10958
schema/soo/wml/wml.go
10958
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 (_e "encoding/xml";_b "fmt";_ef "github.com/unidoc/unioffice";);func (_gf *Iscomment )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {_gf .CT_Empty =*NewCT_Empty ();for {_bed ,_dd :=d .Token ();if _dd !=nil {return _b .Errorf ("p\u0061\u0072\u0073\u0069ng\u0020I\u0073\u0063\u006f\u006d\u006de\u006e\u0074\u003a\u0020\u0025\u0073",_dd );};if _ab ,_cg :=_bed .(_e .EndElement );_cg &&_ab .Name ==start .Name {break ;};};return nil ;};
|
||||
|
||||
// ValidateWithPath validates the CT_Empty and its children, prefixing error messages with path
|
||||
func (_aec *CT_Empty )ValidateWithPath (path string )error {return nil };func (_bb *CT_Rel )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {for _ ,_ec :=range start .Attr {if _ec .Name .Local =="\u0069\u0064"{_cc ,_g :=_ec .Value ,error (nil );if _g !=nil {return _g ;};_bb .IdAttr =&_cc ;continue ;};};for {_ecg ,_de :=d .Token ();if _de !=nil {return _b .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0043T\u005f\u0052e\u006c\u003a\u0020\u0025\u0073",_de );};if _fe ,_ba :=_ecg .(_e .EndElement );_ba &&_fe .Name ==start .Name {break ;};};return nil ;};func NewCT_Empty ()*CT_Empty {_eg :=&CT_Empty {};return _eg };func NewTextdata ()*Textdata {_gef :=&Textdata {};_gef .CT_Rel =*NewCT_Rel ();return _gef };
|
||||
|
||||
// Validate validates the Textdata and its children
|
||||
func (_ada *Textdata )Validate ()error {return _ada .ValidateWithPath ("\u0054\u0065\u0078\u0074\u0064\u0061\u0074\u0061");};
|
||||
|
||||
// Validate validates the Iscomment and its children
|
||||
func (_ag *Iscomment )Validate ()error {return _ag .ValidateWithPath ("\u0049s\u0063\u006f\u006d\u006d\u0065\u006et");};
|
||||
|
||||
// ValidateWithPath validates the Iscomment and its children, prefixing error messages with path
|
||||
func (_egd *Iscomment )ValidateWithPath (path string )error {if _egf :=_egd .CT_Empty .ValidateWithPath (path );_egf !=nil {return _egf ;};return nil ;};
|
||||
|
||||
// Validate validates the CT_Rel and its children
|
||||
func (_ge *CT_Rel )Validate ()error {return _ge .ValidateWithPath ("\u0043\u0054\u005f\u0052\u0065\u006c");};func (_c *CT_Rel )MarshalXML (e *_e .Encoder ,start _e .StartElement )error {if _c .IdAttr !=nil {start .Attr =append (start .Attr ,_e .Attr {Name :_e .Name {Local :"\u0069\u0064"},Value :_b .Sprintf ("\u0025\u0076",*_c .IdAttr )});};e .EncodeToken (start );e .EncodeToken (_e .EndElement {Name :start .Name });return nil ;};type CT_Rel struct{IdAttr *string ;};func NewIscomment ()*Iscomment {_cd :=&Iscomment {};_cd .CT_Empty =*NewCT_Empty ();return _cd };func (_fd *Textdata )MarshalXML (e *_e .Encoder ,start _e .StartElement )error {start .Attr =append (start .Attr ,_e .Attr {Name :_e .Name {Local :"\u0078\u006d\u006cn\u0073"},Value :"\u0075\u0072\u006e\u003a\u0073\u0063\u0068e\u006d\u0061\u0073-\u006d\u0069\u0063\u0072o\u0073\u006f\u0066\u0074\u002d\u0063\u006f\u006d\u003a\u006f\u0066\u0066\u0069\u0063\u0065\u003a\u0070\u006f\u0077\u0065\u0072\u0070\u006f\u0069\u006e\u0074"});start .Attr =append (start .Attr ,_e .Attr {Name :_e .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u0078\u006dl"},Value :"\u0068\u0074tp\u003a\u002f\u002fw\u0077\u0077\u002e\u00773.o\u0072g/\u0058\u004d\u004c\u002f\u0031\u0039\u00398/\u006e\u0061\u006d\u0065\u0073\u0070\u0061c\u0065"});start .Name .Local ="\u0074\u0065\u0078\u0074\u0064\u0061\u0074\u0061";return _fd .CT_Rel .MarshalXML (e ,start );};func (_ea *CT_Empty )MarshalXML (e *_e .Encoder ,start _e .StartElement )error {e .EncodeToken (start );e .EncodeToken (_e .EndElement {Name :start .Name });return nil ;};type Textdata struct{CT_Rel };func (_acc *Iscomment )MarshalXML (e *_e .Encoder ,start _e .StartElement )error {start .Attr =append (start .Attr ,_e .Attr {Name :_e .Name {Local :"\u0078\u006d\u006cn\u0073"},Value :"\u0075\u0072\u006e\u003a\u0073\u0063\u0068e\u006d\u0061\u0073-\u006d\u0069\u0063\u0072o\u0073\u006f\u0066\u0074\u002d\u0063\u006f\u006d\u003a\u006f\u0066\u0066\u0069\u0063\u0065\u003a\u0070\u006f\u0077\u0065\u0072\u0070\u006f\u0069\u006e\u0074"});start .Attr =append (start .Attr ,_e .Attr {Name :_e .Name {Local :"\u0078m\u006c\u006e\u0073\u003a\u0078\u006dl"},Value :"\u0068\u0074tp\u003a\u002f\u002fw\u0077\u0077\u002e\u00773.o\u0072g/\u0058\u004d\u004c\u002f\u0031\u0039\u00398/\u006e\u0061\u006d\u0065\u0073\u0070\u0061c\u0065"});start .Name .Local ="\u0069s\u0063\u006f\u006d\u006d\u0065\u006et";return _acc .CT_Empty .MarshalXML (e ,start );};type CT_Empty struct{};func (_cf *Textdata )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {_cf .CT_Rel =*NewCT_Rel ();for _ ,_eag :=range start .Attr {if _eag .Name .Local =="\u0069\u0064"{_ad ,_ce :=_eag .Value ,error (nil );if _ce !=nil {return _ce ;};_cf .IdAttr =&_ad ;continue ;};};for {_fa ,_bd :=d .Token ();if _bd !=nil {return _b .Errorf ("p\u0061r\u0073\u0069\u006e\u0067\u0020\u0054\u0065\u0078t\u0064\u0061\u0074\u0061: \u0025\u0073",_bd );};if _gc ,_bf :=_fa .(_e .EndElement );_bf &&_gc .Name ==start .Name {break ;};};return nil ;};
|
||||
package powerpoint ;import (_g "encoding/xml";_gd "fmt";_f "github.com/unidoc/unioffice";);func NewCT_Rel ()*CT_Rel {_ab :=&CT_Rel {};return _ab };type CT_Empty struct{};
|
||||
|
||||
// Validate validates the CT_Empty and its children
|
||||
func (_ed *CT_Empty )Validate ()error {return _ed .ValidateWithPath ("\u0043\u0054\u005f\u0045\u006d\u0070\u0074\u0079");};type Iscomment struct{CT_Empty };func NewCT_Rel ()*CT_Rel {_be :=&CT_Rel {};return _be };
|
||||
func (_a *CT_Empty )Validate ()error {return _a .ValidateWithPath ("\u0043\u0054\u005f\u0045\u006d\u0070\u0074\u0079");};type Textdata struct{CT_Rel };
|
||||
|
||||
// ValidateWithPath validates the Textdata and its children, prefixing error messages with path
|
||||
func (_fec *Textdata )ValidateWithPath (path string )error {if _ca :=_fec .CT_Rel .ValidateWithPath (path );_ca !=nil {return _ca ;};return nil ;};
|
||||
// ValidateWithPath validates the Iscomment and its children, prefixing error messages with path
|
||||
func (_fce *Iscomment )ValidateWithPath (path string )error {if _dd :=_fce .CT_Empty .ValidateWithPath (path );_dd !=nil {return _dd ;};return nil ;};func NewTextdata ()*Textdata {_bcg :=&Textdata {};_bcg .CT_Rel =*NewCT_Rel ();return _bcg };
|
||||
|
||||
// ValidateWithPath validates the CT_Rel and its children, prefixing error messages with path
|
||||
func (_ac *CT_Rel )ValidateWithPath (path string )error {return nil };func (_bc *CT_Empty )UnmarshalXML (d *_e .Decoder ,start _e .StartElement )error {for {_a ,_ae :=d .Token ();if _ae !=nil {return _b .Errorf ("p\u0061r\u0073\u0069\u006e\u0067\u0020\u0043\u0054\u005fE\u006d\u0070\u0074\u0079: \u0025\u0073",_ae );};if _d ,_eb :=_a .(_e .EndElement );_eb &&_d .Name ==start .Name {break ;};};return nil ;};func init (){_ef .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 );_ef .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 );_ef .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 );_ef .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 (_aed *CT_Rel )ValidateWithPath (path string )error {return nil };type CT_Rel struct{IdAttr *string ;};func (_bd *Iscomment )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {_bd .CT_Empty =*NewCT_Empty ();for {_aeb ,_cd :=d .Token ();if _cd !=nil {return _gd .Errorf ("p\u0061\u0072\u0073\u0069ng\u0020I\u0073\u0063\u006f\u006d\u006de\u006e\u0074\u003a\u0020\u0025\u0073",_cd );};if _gde ,_bcb :=_aeb .(_g .EndElement );_bcb &&_gde .Name ==start .Name {break ;};};return nil ;};
|
||||
|
||||
// ValidateWithPath validates the Textdata and its children, prefixing error messages with path
|
||||
func (_fde *Textdata )ValidateWithPath (path string )error {if _ddd :=_fde .CT_Rel .ValidateWithPath (path );_ddd !=nil {return _ddd ;};return nil ;};
|
||||
|
||||
// Validate validates the Iscomment and its children
|
||||
func (_ge *Iscomment )Validate ()error {return _ge .ValidateWithPath ("\u0049s\u0063\u006f\u006d\u006d\u0065\u006et");};
|
||||
|
||||
// ValidateWithPath validates the CT_Empty and its children, prefixing error messages with path
|
||||
func (_de *CT_Empty )ValidateWithPath (path string )error {return nil };func (_e *CT_Empty )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for {_bf ,_fc :=d .Token ();if _fc !=nil {return _gd .Errorf ("p\u0061r\u0073\u0069\u006e\u0067\u0020\u0043\u0054\u005fE\u006d\u0070\u0074\u0079: \u0025\u0073",_fc );};if _c ,_fe :=_bf .(_g .EndElement );_fe &&_c .Name ==start .Name {break ;};};return nil ;};func (_ec *CT_Rel )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {for _ ,_ac :=range start .Attr {if _ac .Name .Local =="\u0069\u0064"{_bc ,_deg :=_ac .Value ,error (nil );if _deg !=nil {return _deg ;};_ec .IdAttr =&_bc ;continue ;};};for {_dgc ,_fd :=d .Token ();if _fd !=nil {return _gd .Errorf ("\u0070a\u0072s\u0069\u006e\u0067\u0020\u0043T\u005f\u0052e\u006c\u003a\u0020\u0025\u0073",_fd );};if _ae ,_ed :=_dgc .(_g .EndElement );_ed &&_ae .Name ==start .Name {break ;};};return nil ;};type Iscomment struct{CT_Empty };func NewIscomment ()*Iscomment {_gg :=&Iscomment {};_gg .CT_Empty =*NewCT_Empty ();return _gg };func (_ad *CT_Rel )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {if _ad .IdAttr !=nil {start .Attr =append (start .Attr ,_g .Attr {Name :_g .Name {Local :"\u0069\u0064"},Value :_gd .Sprintf ("\u0025\u0076",*_ad .IdAttr )});};e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};func NewCT_Empty ()*CT_Empty {_fa :=&CT_Empty {};return _fa };func (_bb *Textdata )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {_bb .CT_Rel =*NewCT_Rel ();for _ ,_ba :=range start .Attr {if _ba .Name .Local =="\u0069\u0064"{_fec ,_ga :=_ba .Value ,error (nil );if _ga !=nil {return _ga ;};_bb .IdAttr =&_fec ;continue ;};};for {_gdc ,_gb :=d .Token ();if _gb !=nil {return _gd .Errorf ("p\u0061r\u0073\u0069\u006e\u0067\u0020\u0054\u0065\u0078t\u0064\u0061\u0074\u0061: \u0025\u0073",_gb );};if _gdg ,_ef :=_gdc .(_g .EndElement );_ef &&_gdg .Name ==start .Name {break ;};};return nil ;};
|
||||
|
||||
// Validate validates the Textdata and its children
|
||||
func (_dc *Textdata )Validate ()error {return _dc .ValidateWithPath ("\u0054\u0065\u0078\u0074\u0064\u0061\u0074\u0061");};func (_af *Iscomment )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Attr =append (start .Attr ,_g .Attr {Name :_g .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 ,_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 ="\u0069s\u0063\u006f\u006d\u006d\u0065\u006et";return _af .CT_Empty .MarshalXML (e ,start );};
|
||||
|
||||
// Validate validates the CT_Rel and its children
|
||||
func (_df *CT_Rel )Validate ()error {return _df .ValidateWithPath ("\u0043\u0054\u005f\u0052\u0065\u006c");};func (_d *CT_Empty )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {e .EncodeToken (start );e .EncodeToken (_g .EndElement {Name :start .Name });return nil ;};func (_ggb *Textdata )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Attr =append (start .Attr ,_g .Attr {Name :_g .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 ,_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 ="\u0074\u0065\u0078\u0074\u0064\u0061\u0074\u0061";return _ggb .CT_Rel .MarshalXML (e ,start );};func init (){_f .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 );_f .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 );_f .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 );_f .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 (_fe "errors";_eg "fmt";_fg "github.com/unidoc/unioffice/spreadsheet/update";_e "regexp";_d "strconv";_ea "strings";);
|
||||
package reference ;import (_c "errors";_g "fmt";_fd "github.com/unidoc/unioffice/spreadsheet/update";_b "regexp";_f "strconv";_da "strings";);
|
||||
|
||||
// ParseCellReference parses a cell reference of the form 'A10' and splits it
|
||||
// into column/row segments.
|
||||
func ParseCellReference (s string )(CellReference ,error ){s =_da .TrimSpace (s );if len (s )< 2{return CellReference {},_c .New ("\u0063\u0065\u006c\u006c\u0020\u0072\u0065\u0066e\u0072\u0065\u006ece\u0020\u006d\u0075\u0073\u0074\u0020h\u0061\u0076\u0065\u0020\u0061\u0074\u0020\u006c\u0065\u0061\u0073\u0074\u0020\u0074\u0077o\u0020\u0063\u0068\u0061\u0072\u0061\u0063\u0074e\u0072\u0073");};_af :=CellReference {};_ac ,_ace ,_df :=_cab (s );if _df !=nil {return CellReference {},_df ;};if _ac !=""{_af .SheetName =_ac ;};if s [0]=='$'{_af .AbsoluteColumn =true ;_ace =_ace [1:];};_cd :=-1;_ca :for _ga :=0;_ga < len (_ace );_ga ++{switch {case _ace [_ga ]>='0'&&_ace [_ga ]<='9'||_ace [_ga ]=='$':_cd =_ga ;break _ca ;};};switch _cd {case 0:return CellReference {},_g .Errorf ("\u006e\u006f\u0020\u006cet\u0074\u0065\u0072\u0020\u0070\u0072\u0065\u0066\u0069\u0078\u0020\u0069\u006e\u0020%\u0073",_ace );case -1:return CellReference {},_g .Errorf ("\u006eo\u0020d\u0069\u0067\u0069\u0074\u0073\u0020\u0069\u006e\u0020\u0025\u0073",_ace );};_af .Column =_ace [0:_cd ];if _ace [_cd ]=='$'{_af .AbsoluteRow =true ;_cd ++;};_af .ColumnIdx =ColumnToIndex (_af .Column );_ab ,_df :=_f .ParseUint (_ace [_cd :],10,32);if _df !=nil {return CellReference {},_g .Errorf ("e\u0072\u0072\u006f\u0072 p\u0061r\u0073\u0069\u006e\u0067\u0020r\u006f\u0077\u003a\u0020\u0025\u0073",_df );};if _ab ==0{return CellReference {},_g .Errorf ("\u0065\u0072\u0072\u006f\u0072\u0020\u0070\u0061\u0072\u0073i\u006e\u0067\u0020\u0072\u006f\u0077\u003a \u0063\u0061\u006e\u006e\u006f\u0074\u0020\u0062\u0065\u0020\u0030");};_af .RowIdx =uint32 (_ab );return _af ,nil ;};
|
||||
|
||||
// Update updates reference to point one of the neighboring cells with respect to the update type after removing a row/column.
|
||||
func (_gd *CellReference )Update (updateType _fd .UpdateAction )*CellReference {switch updateType {case _fd .UpdateActionRemoveColumn :_ge :=_gd ;_ge .ColumnIdx =_gd .ColumnIdx -1;_ge .Column =IndexToColumn (_ge .ColumnIdx );return _ge ;default:return _gd ;};};
|
||||
|
||||
// String returns a string representation of CellReference.
|
||||
func (_b CellReference )String ()string {_g :=make ([]byte ,0,4);if _b .AbsoluteColumn {_g =append (_g ,'$');};_g =append (_g ,_b .Column ...);if _b .AbsoluteRow {_g =append (_g ,'$');};_g =_d .AppendInt (_g ,int64 (_b .RowIdx ),10);return string (_g );};
|
||||
func (_a CellReference )String ()string {_daf :=make ([]byte ,0,4);if _a .AbsoluteColumn {_daf =append (_daf ,'$');};_daf =append (_daf ,_a .Column ...);if _a .AbsoluteRow {_daf =append (_daf ,'$');};_daf =_f .AppendInt (_daf ,int64 (_a .RowIdx ),10);return string (_daf );};
|
||||
|
||||
// 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 ;};
|
||||
// ParseRangeReference splits a range reference of the form "A1:B5" into its
|
||||
// components.
|
||||
func ParseRangeReference (s string )(_ggf ,_cg CellReference ,_fe error ){_dad ,_ec ,_fe :=_cab (s );if _fe !=nil {return CellReference {},CellReference {},_fe ;};_cbe :=_da .Split (_ec ,"\u003a");if len (_cbe )!=2{return CellReference {},CellReference {},_c .New ("i\u006ev\u0061\u006c\u0069\u0064\u0020\u0072\u0061\u006eg\u0065\u0020\u0066\u006frm\u0061\u0074");};if _dad !=""{_cbe [0]=_dad +"\u0021"+_cbe [0];_cbe [1]=_dad +"\u0021"+_cbe [1];};_bec ,_fe :=ParseCellReference (_cbe [0]);if _fe !=nil {return CellReference {},CellReference {},_fe ;};_eb ,_fe :=ParseCellReference (_cbe [1]);if _fe !=nil {return CellReference {},CellReference {},_fe ;};return _bec ,_eb ,nil ;};
|
||||
|
||||
// Update updates reference to point one of the neighboring columns with respect to the update type after removing a row/column.
|
||||
func (_dbf *ColumnReference )Update (updateType _fg .UpdateAction )*ColumnReference {switch updateType {case _fg .UpdateActionRemoveColumn :_gd :=_dbf ;_gd .ColumnIdx =_dbf .ColumnIdx -1;_gd .Column =IndexToColumn (_gd .ColumnIdx );return _gd ;default:return _dbf ;};};
|
||||
// IndexToColumn maps a column number to a column name (e.g. 0 = A, 1 = B, 26 = AA)
|
||||
func IndexToColumn (col uint32 )string {var _be [64+1]byte ;_bef :=len (_be );_de :=col ;const _acc =26;for _de >=_acc {_bef --;_gc :=_de /_acc ;_be [_bef ]=byte ('A'+uint (_de -_gc *_acc ));_de =_gc -1;};_bef --;_be [_bef ]=byte ('A'+uint (_de ));return string (_be [_bef :]);};
|
||||
|
||||
// ParseColumnRangeReference splits a range reference of the form "A:B" into its
|
||||
// components.
|
||||
func ParseColumnRangeReference (s string )(_bd ,_dg ColumnReference ,_bf error ){_ecc :="";_ce :=_da .Split (s ,"\u0021");if len (_ce )==2{_ecc =_ce [0];s =_ce [1];};_fdb :=_da .Split (s ,"\u003a");if len (_fdb )!=2{return ColumnReference {},ColumnReference {},_c .New ("i\u006ev\u0061\u006c\u0069\u0064\u0020\u0072\u0061\u006eg\u0065\u0020\u0066\u006frm\u0061\u0074");};if _ecc !=""{_fdb [0]=_ecc +"\u0021"+_fdb [0];_fdb [1]=_ecc +"\u0021"+_fdb [1];};_fde ,_bf :=ParseColumnReference (_fdb [0]);if _bf !=nil {return ColumnReference {},ColumnReference {},_bf ;};_gb ,_bf :=ParseColumnReference (_fdb [1]);if _bf !=nil {return ColumnReference {},ColumnReference {},_bf ;};return _fde ,_gb ,nil ;};
|
||||
|
||||
// String returns a string representation of ColumnReference.
|
||||
func (_cb ColumnReference )String ()string {_ba :=make ([]byte ,0,4);if _cb .AbsoluteColumn {_ba =append (_ba ,'$');};_ba =append (_ba ,_cb .Column ...);return string (_ba );};
|
||||
|
||||
// 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 ;};
|
||||
|
||||
// String returns a string representation of ColumnReference.
|
||||
func (_de ColumnReference )String ()string {_bg :=make ([]byte ,0,4);if _de .AbsoluteColumn {_bg =append (_bg ,'$');};_bg =append (_bg ,_de .Column ...);return string (_bg );};
|
||||
// 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 _cab (_cda string )(string ,string ,error ){_ad :="";_gf :=_da .LastIndex (_cda ,"\u0021");if _gf > -1{_ad =_cda [:_gf ];_cda =_cda [_gf +1:];if _ad ==""{return "","",_c .New ("\u0049n\u0076a\u006c\u0069\u0064\u0020\u0073h\u0065\u0065t\u0020\u006e\u0061\u006d\u0065");};};return _ad ,_cda ,nil ;};
|
||||
|
||||
// ParseRangeReference splits a range reference of the form "A1:B5" into its
|
||||
// components.
|
||||
func ParseRangeReference (s string )(_ee ,_bc CellReference ,_cd error ){_afd ,_ed ,_cd :=_gf (s );if _cd !=nil {return CellReference {},CellReference {},_cd ;};_df :=_ea .Split (_ed ,"\u003a");if len (_df )!=2{return CellReference {},CellReference {},_fe .New ("i\u006ev\u0061\u006c\u0069\u0064\u0020\u0072\u0061\u006eg\u0065\u0020\u0066\u006frm\u0061\u0074");};if _afd !=""{_df [0]=_afd +"\u0021"+_df [0];_df [1]=_afd +"\u0021"+_df [1];};_deg ,_cd :=ParseCellReference (_df [0]);if _cd !=nil {return CellReference {},CellReference {},_cd ;};_gff ,_cd :=ParseCellReference (_df [1]);if _cd !=nil {return CellReference {},CellReference {},_cd ;};return _deg ,_gff ,nil ;};
|
||||
// ColumnToIndex maps a column to a zero based index (e.g. A = 0, B = 1, AA = 26)
|
||||
func ColumnToIndex (col string )uint32 {col =_da .ToUpper (col );_gg :=uint32 (0);for _ ,_dfc :=range col {_gg *=26;_gg +=uint32 (_dfc -'A'+1);};return _gg -1;};var _fg =_b .MustCompile ("^\u005b\u0061\u002d\u007aA-\u005a]\u0028\u005b\u0061\u002d\u007aA\u002d\u005a\u005d\u003f\u0029\u0024");
|
||||
|
||||
// ParseColumnReference parses a column reference of the form 'Sheet1!A' and splits it
|
||||
// into sheet name and column segments.
|
||||
func ParseColumnReference (s string )(ColumnReference ,error ){s =_ea .TrimSpace (s );if len (s )< 1{return ColumnReference {},_fe .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");};_af :=ColumnReference {};_ca ,_bf ,_ff :=_gf (s );if _ff !=nil {return ColumnReference {},_ff ;};if _ca !=""{_af .SheetName =_ca ;};if _bf [0]=='$'{_af .AbsoluteColumn =true ;_bf =_bf [1:];};if !_dg .MatchString (_bf ){return ColumnReference {},_fe .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");};_af .Column =_bf ;_af .ColumnIdx =ColumnToIndex (_af .Column );return _af ,nil ;};
|
||||
func ParseColumnReference (s string )(ColumnReference ,error ){s =_da .TrimSpace (s );if len (s )< 1{return ColumnReference {},_c .New ("\u0063\u006f\u006c\u0075\u006d\u006e \u0072\u0065\u0066\u0065\u0072\u0065\u006e\u0063\u0065\u0020\u006d\u0075\u0073\u0074\u0020\u0068\u0061\u0076\u0065\u0020a\u0074\u0020\u006c\u0065\u0061\u0073\u0074\u0020\u006f\u006e\u0065\u0020\u0063\u0068a\u0072a\u0063\u0074\u0065\u0072");};_ff :=ColumnReference {};_cba ,_acf ,_fb :=_cab (s );if _fb !=nil {return ColumnReference {},_fb ;};if _cba !=""{_ff .SheetName =_cba ;};if _acf [0]=='$'{_ff .AbsoluteColumn =true ;_acf =_acf [1:];};if !_fg .MatchString (_acf ){return ColumnReference {},_c .New ("\u0063\u006f\u006c\u0075\u006dn\u0020\u0072\u0065\u0066\u0065\u0072\u0065\u006e\u0063\u0065\u0020\u006d\u0075s\u0074\u0020\u0062\u0065\u0020\u0062\u0065\u0074\u0077\u0065\u0065\u006e\u0020\u0041\u0020\u0061\u006e\u0064\u0020\u005a\u005a");};_ff .Column =_acf ;_ff .ColumnIdx =ColumnToIndex (_ff .Column );return _ff ,nil ;};
|
||||
|
||||
// ColumnToIndex maps a column to a zero based index (e.g. A = 0, B = 1, AA = 26)
|
||||
func ColumnToIndex (col string )uint32 {col =_ea .ToUpper (col );_ad :=uint32 (0);for _ ,_gc :=range col {_ad *=26;_ad +=uint32 (_gc -'A'+1);};return _ad -1;};
|
||||
|
||||
// IndexToColumn maps a column number to a column name (e.g. 0 = A, 1 = B, 26 = AA)
|
||||
func IndexToColumn (col uint32 )string {var _ec [64+1]byte ;_ge :=len (_ec );_dbd :=col ;const _dee =26;for _dbd >=_dee {_ge --;_cge :=_dbd /_dee ;_ec [_ge ]=byte ('A'+uint (_dbd -_cge *_dee ));_dbd =_cge -1;};_ge --;_ec [_ge ]=byte ('A'+uint (_dbd ));return string (_ec [_ge :]);};func _gf (_ef string )(string ,string ,error ){_ce :="";_gdd :=_ea .LastIndex (_ef ,"\u0021");if _gdd > -1{_ce =_ef [:_gdd ];_ef =_ef [_gdd +1:];if _ce ==""{return "","",_fe .New ("\u0049n\u0076a\u006c\u0069\u0064\u0020\u0073h\u0065\u0065t\u0020\u006e\u0061\u006d\u0065");};};return _ce ,_ef ,nil ;};
|
||||
|
||||
// ParseCellReference parses a cell reference of the form 'A10' and splits it
|
||||
// into column/row segments.
|
||||
func ParseCellReference (s string )(CellReference ,error ){s =_ea .TrimSpace (s );if len (s )< 2{return CellReference {},_fe .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");};_db :=CellReference {};_ba ,_fa ,_eb :=_gf (s );if _eb !=nil {return CellReference {},_eb ;};if _ba !=""{_db .SheetName =_ba ;};if s [0]=='$'{_db .AbsoluteColumn =true ;_fa =_fa [1:];};_gg :=-1;_c :for _cf :=0;_cf < len (_fa );_cf ++{switch {case _fa [_cf ]>='0'&&_fa [_cf ]<='9'||_fa [_cf ]=='$':_gg =_cf ;break _c ;};};switch _gg {case 0:return CellReference {},_eg .Errorf ("\u006e\u006f\u0020\u006cet\u0074\u0065\u0072\u0020\u0070\u0072\u0065\u0066\u0069\u0078\u0020\u0069\u006e\u0020%\u0073",_fa );case -1:return CellReference {},_eg .Errorf ("\u006eo\u0020d\u0069\u0067\u0069\u0074\u0073\u0020\u0069\u006e\u0020\u0025\u0073",_fa );};_db .Column =_fa [0:_gg ];if _fa [_gg ]=='$'{_db .AbsoluteRow =true ;_gg ++;};_db .ColumnIdx =ColumnToIndex (_db .Column );_a ,_eb :=_d .ParseUint (_fa [_gg :],10,32);if _eb !=nil {return CellReference {},_eg .Errorf ("e\u0072\u0072\u006f\u0072 p\u0061r\u0073\u0069\u006e\u0067\u0020r\u006f\u0077\u003a\u0020\u0025\u0073",_eb );};if _a ==0{return CellReference {},_eg .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");};_db .RowIdx =uint32 (_a );return _db ,nil ;};
|
||||
|
||||
// Update updates reference to point one of the neighboring cells with respect to the update type after removing a row/column.
|
||||
func (_cg *CellReference )Update (updateType _fg .UpdateAction )*CellReference {switch updateType {case _fg .UpdateActionRemoveColumn :_dc :=_cg ;_dc .ColumnIdx =_cg .ColumnIdx -1;_dc .Column =IndexToColumn (_dc .ColumnIdx );return _dc ;default:return _cg ;};};
|
||||
|
||||
// ParseColumnRangeReference splits a range reference of the form "A:B" into its
|
||||
// components.
|
||||
func ParseColumnRangeReference (s string )(_ebb ,_fd ColumnReference ,_bcd error ){_cee :="";_gda :=_ea .Split (s ,"\u0021");if len (_gda )==2{_cee =_gda [0];s =_gda [1];};_fc :=_ea .Split (s ,"\u003a");if len (_fc )!=2{return ColumnReference {},ColumnReference {},_fe .New ("i\u006ev\u0061\u006c\u0069\u0064\u0020\u0072\u0061\u006eg\u0065\u0020\u0066\u006frm\u0061\u0074");};if _cee !=""{_fc [0]=_cee +"\u0021"+_fc [0];_fc [1]=_cee +"\u0021"+_fc [1];};_fgd ,_bcd :=ParseColumnReference (_fc [0]);if _bcd !=nil {return ColumnReference {},ColumnReference {},_bcd ;};_eae ,_bcd :=ParseColumnReference (_fc [1]);if _bcd !=nil {return ColumnReference {},ColumnReference {},_bcd ;};return _fgd ,_eae ,nil ;};var _dg =_e .MustCompile ("^\u005b\u0061\u002d\u007aA-\u005a]\u0028\u005b\u0061\u002d\u007aA\u002d\u005a\u005d\u003f\u0029\u0024");
|
||||
// Update updates reference to point one of the neighboring columns with respect to the update type after removing a row/column.
|
||||
func (_fc *ColumnReference )Update (updateType _fd .UpdateAction )*ColumnReference {switch updateType {case _fd .UpdateActionRemoveColumn :_db :=_fc ;_db .ColumnIdx =_fc .ColumnIdx -1;_db .Column =IndexToColumn (_db .ColumnIdx );return _db ;default:return _fc ;};};
|
File diff suppressed because one or more lines are too long
@ -12,9 +12,6 @@
|
||||
// Package update contains definitions needed for updating references after removing rows/columns.
|
||||
package update ;
|
||||
|
||||
// UpdateAction is the type for update types constants.
|
||||
type UpdateAction byte ;
|
||||
|
||||
// UpdateQuery contains terms of how to update references after removing row/column.
|
||||
type UpdateQuery struct{
|
||||
|
||||
@ -28,4 +25,7 @@ ColumnIdx uint32 ;
|
||||
SheetToUpdate string ;
|
||||
|
||||
// UpdateCurrentSheet is true if references without sheet prefix should be updated as well.
|
||||
UpdateCurrentSheet bool ;};const (UpdateActionRemoveColumn UpdateAction =iota ;);
|
||||
UpdateCurrentSheet bool ;};
|
||||
|
||||
// UpdateAction is the type for update types constants.
|
||||
type UpdateAction byte ;const (UpdateActionRemoveColumn UpdateAction =iota ;);
|
152
unioffice.go
152
unioffice.go
File diff suppressed because one or more lines are too long
@ -9,68 +9,68 @@
|
||||
// Use of this source code is governed by the UniDoc End User License Agreement
|
||||
// terms that can be accessed at https://unidoc.io/eula/
|
||||
|
||||
package vmldrawing ;import (_ddc "encoding/xml";_d "fmt";_a "github.com/unidoc/unioffice";_f "github.com/unidoc/unioffice/schema/soo/ofc/sharedTypes";_c "github.com/unidoc/unioffice/schema/urn/schemas_microsoft_com/office/excel";_ac "github.com/unidoc/unioffice/schema/urn/schemas_microsoft_com/vml";_dg "strconv";_dd "strings";);
|
||||
|
||||
// SetHeight set height of shape.
|
||||
func (_bed *ShapeStyle )SetHeight (height int64 ){_bed ._ff =height };
|
||||
|
||||
// IsItalic returns true if text is italic.
|
||||
func (_abeb *TextpathStyle )IsItalic ()bool {return _abeb ._cd };
|
||||
|
||||
// Height return height of shape.
|
||||
func (_edg *ShapeStyle )Height ()int64 {return _edg ._ff };
|
||||
|
||||
// Width return width of shape.
|
||||
func (_ef *ShapeStyle )Width ()int64 {return _ef ._cc };
|
||||
|
||||
// SetItalic sets text to italic.
|
||||
func (_dbb *TextpathStyle )SetItalic (italic bool ){_dbb ._cd =italic };
|
||||
|
||||
// CreateFormula creates F element for typeFormulas.
|
||||
func CreateFormula (s string )*_ac .CT_F {_fcg :=_ac .NewCT_F ();_fcg .EqnAttr =&s ;return _fcg };type Container struct{Layout *_ac .OfcShapelayout ;ShapeType *_ac .Shapetype ;Shape []*_ac .Shape ;};
|
||||
|
||||
// NewCommentDrawing constructs a new comment drawing.
|
||||
func NewCommentDrawing ()*Container {_b :=NewContainer ();_b .Layout =_ac .NewOfcShapelayout ();_b .Layout .ExtAttr =_ac .ST_ExtEdit ;_b .Layout .Idmap =_ac .NewOfcCT_IdMap ();_b .Layout .Idmap .DataAttr =_a .String ("\u0031");_b .Layout .Idmap .ExtAttr =_ac .ST_ExtEdit ;_b .ShapeType =_ac .NewShapetype ();_b .ShapeType .IdAttr =_a .String ("_\u0078\u0030\u0030\u0030\u0030\u005f\u0074\u0032\u0030\u0032");_b .ShapeType .CoordsizeAttr =_a .String ("2\u0031\u0036\u0030\u0030\u002c\u0032\u0031\u0036\u0030\u0030");_b .ShapeType .SptAttr =_a .Float32 (202);_b .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");_ce :=_ac .NewEG_ShapeElements ();_b .ShapeType .EG_ShapeElements =append (_b .ShapeType .EG_ShapeElements ,_ce );_ce .Path =_ac .NewPath ();_ce .Path .GradientshapeokAttr =_f .ST_TrueFalseT ;_ce .Path .ConnecttypeAttr =_ac .OfcST_ConnectTypeRect ;return _b ;};
|
||||
|
||||
// IsBold returns true if text is bold.
|
||||
func (_fa *TextpathStyle )IsBold ()bool {return _fa ._db };
|
||||
|
||||
// SetBold sets text to bold.
|
||||
func (_dgd *TextpathStyle )SetBold (bold bool ){_dgd ._db =bold };func NewContainer ()*Container {return &Container {}};
|
||||
package vmldrawing ;import (_g "encoding/xml";_d "fmt";_a "github.com/unidoc/unioffice";_cg "github.com/unidoc/unioffice/schema/soo/ofc/sharedTypes";_e "github.com/unidoc/unioffice/schema/urn/schemas_microsoft_com/office/excel";_ca "github.com/unidoc/unioffice/schema/urn/schemas_microsoft_com/vml";_b "strconv";_ce "strings";);func NewContainer ()*Container {return &Container {}};
|
||||
|
||||
// NewTextpathStyle accept value of string style attribute of element v:textpath and format it to generate TextpathStyle.
|
||||
func NewTextpathStyle (style string )TextpathStyle {_gb :=TextpathStyle {_gd :"\u0022C\u0061\u006c\u0069\u0062\u0072\u0069\"",_gdg :44,_db :false ,_cd :false };_dae :=_dd .Split (style ,"\u003b");for _ ,_fg :=range _dae {_gag :=_dd .Split (_fg ,"\u003a");if len (_gag )!=2{continue ;};switch _gag [0]{case "f\u006f\u006e\u0074\u002d\u0066\u0061\u006d\u0069\u006c\u0079":_gb ._gd =_gag [1];break ;case "\u0066o\u006e\u0074\u002d\u0073\u0069\u007ae":_gb ._gdg ,_ =_dg .ParseInt (_dd .ReplaceAll (_gag [1],"\u0070\u0074",""),10,64);break ;case "f\u006f\u006e\u0074\u002d\u0077\u0065\u0069\u0067\u0068\u0074":_gb ._db =_gag [1]=="\u0062\u006f\u006c\u0064";break ;case "\u0066\u006f\u006e\u0074\u002d\u0073\u0074\u0079\u006c\u0065":_gb ._cd =_gag [1]=="\u0069\u0074\u0061\u006c\u0069\u0063";break ;};};return _gb ;};
|
||||
func NewTextpathStyle (style string )TextpathStyle {_ccc :=TextpathStyle {_gbd :"\u0022C\u0061\u006c\u0069\u0062\u0072\u0069\"",_bc :44,_dbb :false ,_adc :false };_bfe :=_ce .Split (style ,"\u003b");for _ ,_ebb :=range _bfe {_dc :=_ce .Split (_ebb ,"\u003a");if len (_dc )!=2{continue ;};switch _dc [0]{case "f\u006f\u006e\u0074\u002d\u0066\u0061\u006d\u0069\u006c\u0079":_ccc ._gbd =_dc [1];break ;case "\u0066o\u006e\u0074\u002d\u0073\u0069\u007ae":_ccc ._bc ,_ =_b .ParseInt (_ce .ReplaceAll (_dc [1],"\u0070\u0074",""),10,64);break ;case "f\u006f\u006e\u0074\u002d\u0077\u0065\u0069\u0067\u0068\u0074":_ccc ._dbb =_dc [1]=="\u0062\u006f\u006c\u0064";break ;case "\u0066\u006f\u006e\u0074\u002d\u0073\u0074\u0079\u006c\u0065":_ccc ._adc =_dc [1]=="\u0069\u0074\u0061\u006c\u0069\u0063";break ;};};return _ccc ;};
|
||||
|
||||
// NewCommentDrawing constructs a new comment drawing.
|
||||
func NewCommentDrawing ()*Container {_de :=NewContainer ();_de .Layout =_ca .NewOfcShapelayout ();_de .Layout .ExtAttr =_ca .ST_ExtEdit ;_de .Layout .Idmap =_ca .NewOfcCT_IdMap ();_de .Layout .Idmap .DataAttr =_a .String ("\u0031");_de .Layout .Idmap .ExtAttr =_ca .ST_ExtEdit ;_de .ShapeType =_ca .NewShapetype ();_de .ShapeType .IdAttr =_a .String ("_\u0078\u0030\u0030\u0030\u0030\u005f\u0074\u0032\u0030\u0032");_de .ShapeType .CoordsizeAttr =_a .String ("2\u0031\u0036\u0030\u0030\u002c\u0032\u0031\u0036\u0030\u0030");_de .ShapeType .SptAttr =_a .Float32 (202);_de .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");_da :=_ca .NewEG_ShapeElements ();_de .ShapeType .EG_ShapeElements =append (_de .ShapeType .EG_ShapeElements ,_da );_da .Path =_ca .NewPath ();_da .Path .GradientshapeokAttr =_cg .ST_TrueFalseT ;_da .Path .ConnecttypeAttr =_ca .OfcST_ConnectTypeRect ;return _de ;};
|
||||
|
||||
// IsBold returns true if text is bold.
|
||||
func (_ffg *TextpathStyle )IsBold ()bool {return _ffg ._dbb };
|
||||
|
||||
// ToString generate string of TextpathStyle.
|
||||
func (_bcd *TextpathStyle )String ()string {_dag :="";_dag +=_d .Sprintf ("\u0066o\u006et\u002d\u0066\u0061\u006d\u0069\u006c\u0079\u003a\u0025\u0073\u003b",_bcd ._gbd );_dag +=_d .Sprintf ("\u0066o\u006et\u002d\u0073\u0069\u007a\u0065\u003a\u0025\u0064\u0070\u0074\u003b",_bcd ._bc );if _bcd ._adc {_dag +=_d .Sprintf ("\u0066o\u006et\u002d\u0073\u0074\u0079\u006ce\u003a\u0069t\u0061\u006c\u0069\u0063\u003b");};if _bcd ._dbb {_dag +=_d .Sprintf ("\u0066\u006f\u006e\u0074\u002d\u0077\u0065\u0069\u0067\u0068\u0074\u003ab\u006f\u006c\u0064\u003b");};return _dag ;};
|
||||
|
||||
// TextpathStyle is style attribute of element v:textpath.
|
||||
type TextpathStyle struct{_gd string ;_gdg int64 ;_db bool ;_cd bool ;};
|
||||
|
||||
// ToString formatting ShapeStyle to string.
|
||||
func (_ca *ShapeStyle )String ()string {_ddf :="";_ddf +=_d .Sprintf ("\u0070\u006f\u0073i\u0074\u0069\u006f\u006e\u003a\u0025\u0073\u003b",_ca ._eec );_ddf +=_d .Sprintf ("\u006da\u0072g\u0069\u006e\u002d\u006c\u0065\u0066\u0074\u003a\u0025\u0064\u003b",_ca ._fb );_ddf +=_d .Sprintf ("\u006d\u0061\u0072\u0067\u0069\u006e\u002d\u0074\u006fp\u003a\u0025\u0064\u003b",_ca ._cbb );_ddf +=_d .Sprintf ("w\u0069\u0064\u0074\u0068\u003a\u0025\u0064\u0070\u0074\u003b",_ca ._cc );_ddf +=_d .Sprintf ("\u0068\u0065\u0069g\u0068\u0074\u003a\u0025\u0064\u0070\u0074\u003b",_ca ._ff );_ddf +=_d .Sprintf ("z\u002d\u0069\u006e\u0064\u0065\u0078\u003a\u0025\u0064\u003b",_ca ._fe );_ddf +=_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",_ca ._be );_ddf +=_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",_ca ._eb );_ddf +=_d .Sprintf ("\u006ds\u006f\u002d\u0070\u006fs\u0069\u0074\u0069\u006f\u006e-\u0076e\u0072t\u0069\u0063\u0061\u006c\u003a\u0025\u0073;",_ca ._fcc );_ddf +=_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",_ca ._baa );return _ddf ;};func (_fc *Container )MarshalXML (e *_ddc .Encoder ,start _ddc .StartElement )error {start .Attr =append (start .Attr ,_ddc .Attr {Name :_ddc .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 ,_ddc .Attr {Name :_ddc .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 ,_ddc .Attr {Name :_ddc .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 _fc .Layout !=nil {_dgb :=_ddc .StartElement {Name :_ddc .Name {Local :"\u006f\u003a\u0073\u0068\u0061\u0070\u0065\u006c\u0061\u0079\u006f\u0075\u0074"}};e .EncodeElement (_fc .Layout ,_dgb );};if _fc .ShapeType !=nil {_ad :=_ddc .StartElement {Name :_ddc .Name {Local :"v\u003a\u0073\u0068\u0061\u0070\u0065\u0074\u0079\u0070\u0065"}};e .EncodeElement (_fc .ShapeType ,_ad );};for _ ,_ae :=range _fc .Shape {_cbe :=_ddc .StartElement {Name :_ddc .Name {Local :"\u0076:\u0073\u0068\u0061\u0070\u0065"}};e .EncodeElement (_ae ,_cbe );};return e .EncodeToken (_ddc .EndElement {Name :start .Name });};
|
||||
|
||||
// SetFontFamily sets text's fontFamily.
|
||||
func (_cfe *TextpathStyle )SetFontFamily (fontFamily string ){_cfe ._gd =fontFamily };
|
||||
type TextpathStyle struct{_gbd string ;_bc int64 ;_dbb bool ;_adc bool ;};
|
||||
|
||||
// FontSize returns fontSize of the text.
|
||||
func (_cg *TextpathStyle )FontSize ()int64 {return _cg ._gdg };
|
||||
func (_fd *TextpathStyle )FontSize ()int64 {return _fd ._bc };
|
||||
|
||||
// FontFamily returns fontFamily of the text.
|
||||
func (_fea *TextpathStyle )FontFamily ()string {return _fea ._gbd };
|
||||
|
||||
// ToString formatting ShapeStyle to string.
|
||||
func (_ge *ShapeStyle )String ()string {_dd :="";_dd +=_d .Sprintf ("\u0070\u006f\u0073i\u0074\u0069\u006f\u006e\u003a\u0025\u0073\u003b",_ge ._dae );_dd +=_d .Sprintf ("\u006da\u0072g\u0069\u006e\u002d\u006c\u0065\u0066\u0074\u003a\u0025\u0064\u003b",_ge ._gf );_dd +=_d .Sprintf ("\u006d\u0061\u0072\u0067\u0069\u006e\u002d\u0074\u006fp\u003a\u0025\u0064\u003b",_ge ._dac );_dd +=_d .Sprintf ("w\u0069\u0064\u0074\u0068\u003a\u0025\u0064\u0070\u0074\u003b",_ge ._ad );_dd +=_d .Sprintf ("\u0068\u0065\u0069g\u0068\u0074\u003a\u0025\u0064\u0070\u0074\u003b",_ge ._fg );_dd +=_d .Sprintf ("z\u002d\u0069\u006e\u0064\u0065\u0078\u003a\u0025\u0064\u003b",_ge ._db );_dd +=_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",_ge ._bf );_dd +=_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",_ge ._cga );_dd +=_d .Sprintf ("\u006ds\u006f\u002d\u0070\u006fs\u0069\u0074\u0069\u006f\u006e-\u0076e\u0072t\u0069\u0063\u0061\u006c\u003a\u0025\u0073;",_ge ._fe );_dd +=_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",_ge ._cef );return _dd ;};
|
||||
|
||||
// IsItalic returns true if text is italic.
|
||||
func (_abaf *TextpathStyle )IsItalic ()bool {return _abaf ._adc };func (_ab *Container )MarshalXML (e *_g .Encoder ,start _g .StartElement )error {start .Attr =append (start .Attr ,_g .Attr {Name :_g .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 ,_g .Attr {Name :_g .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 ,_g .Attr {Name :_g .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 _ab .Layout !=nil {_cc :=_g .StartElement {Name :_g .Name {Local :"\u006f\u003a\u0073\u0068\u0061\u0070\u0065\u006c\u0061\u0079\u006f\u0075\u0074"}};e .EncodeElement (_ab .Layout ,_cc );};if _ab .ShapeType !=nil {_bg :=_g .StartElement {Name :_g .Name {Local :"v\u003a\u0073\u0068\u0061\u0070\u0065\u0074\u0079\u0070\u0065"}};e .EncodeElement (_ab .ShapeType ,_bg );};for _ ,_ec :=range _ab .Shape {_bb :=_g .StartElement {Name :_g .Name {Local :"\u0076:\u0073\u0068\u0061\u0070\u0065"}};e .EncodeElement (_ec ,_bb );};return e .EncodeToken (_g .EndElement {Name :start .Name });};type Container struct{Layout *_ca .OfcShapelayout ;ShapeType *_ca .Shapetype ;Shape []*_ca .Shape ;};
|
||||
|
||||
// SetFontSize sets text's fontSize.
|
||||
func (_fgb *TextpathStyle )SetFontSize (fontSize int64 ){_fgb ._bc =fontSize };
|
||||
|
||||
// SetFontFamily sets text's fontFamily.
|
||||
func (_abe *TextpathStyle )SetFontFamily (fontFamily string ){_abe ._gbd =fontFamily };
|
||||
|
||||
// NewShapeStyle accept value of string style attribute in v:shape and format it to generate ShapeStyle.
|
||||
func NewShapeStyle (style string )ShapeStyle {_gb :=ShapeStyle {_ad :0,_fg :0};_cge :=_ce .Split (style ,"\u003b");for _ ,_cgaf :=range _cge {_ae :=_ce .Split (_cgaf ,"\u003a");if len (_ae )!=2{continue ;};switch _ae [0]{case "\u0070\u006f\u0073\u0069\u0074\u0069\u006f\u006e":_gb ._dae =_ae [1];break ;case "m\u0061\u0072\u0067\u0069\u006e\u002d\u006c\u0065\u0066\u0074":_gb ._gf ,_ =_b .ParseInt (_ae [1],10,64);break ;case "\u006d\u0061\u0072\u0067\u0069\u006e\u002d\u0074\u006f\u0070":_gb ._dac ,_ =_b .ParseInt (_ae [1],10,64);break ;case "\u0077\u0069\u0064t\u0068":_gb ._ad ,_ =_b .ParseInt (_ce .ReplaceAll (_ae [1],"\u0070\u0074",""),10,64);break ;case "\u0068\u0065\u0069\u0067\u0068\u0074":_gb ._fg ,_ =_b .ParseInt (_ce .ReplaceAll (_ae [1],"\u0070\u0074",""),10,64);break ;case "\u007a-\u0069\u006e\u0064\u0065\u0078":_gb ._db ,_ =_b .ParseInt (_ae [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":_gb ._bf =_ae [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":_gb ._cga =_ae [1];break ;case "m\u0073\u006f\u002d\u0070os\u0069t\u0069\u006f\u006e\u002d\u0076e\u0072\u0074\u0069\u0063\u0061\u006c":_gb ._fe =_ae [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":_gb ._cef =_ae [1];break ;};};return _gb ;};
|
||||
|
||||
// NewCommentShape creates a new comment shape for a given cell index. The
|
||||
// indices here are zero based.
|
||||
func NewCommentShape (col ,row int64 )*_ac .Shape {_acb :=_ac .NewShape ();_acb .IdAttr =_a .String (_d .Sprintf ("\u0063\u0073\u005f\u0025\u0064\u005f\u0025\u0064",col ,row ));_acb .TypeAttr =_a .String ("\u0023\u005f\u00780\u0030\u0030\u0030\u005f\u0074\u0032\u0030\u0032");_acb .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");_acb .FillcolorAttr =_a .String ("\u0023f\u0062\u0066\u0036\u0064\u0036");_acb .StrokecolorAttr =_a .String ("\u0023e\u0064\u0065\u0061\u0061\u0031");_dgc :=_ac .NewEG_ShapeElements ();_dgc .Fill =_ac .NewFill ();_dgc .Fill .Color2Attr =_a .String ("\u0023f\u0062\u0066\u0065\u0038\u0032");_dgc .Fill .AngleAttr =_a .Float64 (-180);_dgc .Fill .TypeAttr =_ac .ST_FillTypeGradient ;_dgc .Fill .Fill =_ac .NewOfcFill ();_dgc .Fill .Fill .ExtAttr =_ac .ST_ExtView ;_dgc .Fill .Fill .TypeAttr =_ac .OfcST_FillTypeGradientUnscaled ;_acb .EG_ShapeElements =append (_acb .EG_ShapeElements ,_dgc );_bc :=_ac .NewEG_ShapeElements ();_bc .Shadow =_ac .NewShadow ();_bc .Shadow .OnAttr =_f .ST_TrueFalseT ;_bc .Shadow .ObscuredAttr =_f .ST_TrueFalseT ;_acb .EG_ShapeElements =append (_acb .EG_ShapeElements ,_bc );_cb :=_ac .NewEG_ShapeElements ();_cb .Path =_ac .NewPath ();_cb .Path .ConnecttypeAttr =_ac .OfcST_ConnectTypeNone ;_acb .EG_ShapeElements =append (_acb .EG_ShapeElements ,_cb );_aca :=_ac .NewEG_ShapeElements ();_aca .Textbox =_ac .NewTextbox ();_aca .Textbox .StyleAttr =_a .String ("\u006d\u0073\u006f\u002ddi\u0072\u0065\u0063\u0074\u0069\u006f\u006e\u002d\u0061\u006c\u0074\u003a\u0061\u0075t\u006f");_acb .EG_ShapeElements =append (_acb .EG_ShapeElements ,_aca );_g :=_ac .NewEG_ShapeElements ();_g .ClientData =_c .NewClientData ();_g .ClientData .ObjectTypeAttr =_c .ST_ObjectTypeNote ;_g .ClientData .MoveWithCells =_f .ST_TrueFalseBlankT ;_g .ClientData .SizeWithCells =_f .ST_TrueFalseBlankT ;_g .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");_g .ClientData .AutoFill =_f .ST_TrueFalseBlankFalse ;_g .ClientData .Row =_a .Int64 (row );_g .ClientData .Column =_a .Int64 (col );_acb .EG_ShapeElements =append (_acb .EG_ShapeElements ,_g );return _acb ;};func (_edd *Container )UnmarshalXML (d *_ddc .Decoder ,start _ddc .StartElement )error {_edd .Shape =nil ;_bg :for {_ba ,_cbed :=d .Token ();if _cbed !=nil {return _cbed ;};switch _bcf :=_ba .(type ){case _ddc .StartElement :switch _bcf .Name .Local {case "s\u0068\u0061\u0070\u0065\u006c\u0061\u0079\u006f\u0075\u0074":_edd .Layout =_ac .NewOfcShapelayout ();if _ec :=d .DecodeElement (_edd .Layout ,&_bcf );_ec !=nil {return _ec ;};case "\u0073h\u0061\u0070\u0065\u0074\u0079\u0070e":_edd .ShapeType =_ac .NewShapetype ();if _ee :=d .DecodeElement (_edd .ShapeType ,&_bcf );_ee !=nil {return _ee ;};case "\u0073\u0068\u0061p\u0065":_bad :=_ac .NewShape ();if _ab :=d .DecodeElement (_bad ,&_bcf );_ab !=nil {return _ab ;};_edd .Shape =append (_edd .Shape ,_bad );};case _ddc .EndElement :break _bg ;};};return nil ;};
|
||||
func NewCommentShape (col ,row int64 )*_ca .Shape {_ag :=_ca .NewShape ();_ag .IdAttr =_a .String (_d .Sprintf ("\u0063\u0073\u005f\u0025\u0064\u005f\u0025\u0064",col ,row ));_ag .TypeAttr =_a .String ("\u0023\u005f\u00780\u0030\u0030\u0030\u005f\u0074\u0032\u0030\u0032");_ag .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");_ag .FillcolorAttr =_a .String ("\u0023f\u0062\u0066\u0036\u0064\u0036");_ag .StrokecolorAttr =_a .String ("\u0023e\u0064\u0065\u0061\u0061\u0031");_f :=_ca .NewEG_ShapeElements ();_f .Fill =_ca .NewFill ();_f .Fill .Color2Attr =_a .String ("\u0023f\u0062\u0066\u0065\u0038\u0032");_f .Fill .AngleAttr =_a .Float64 (-180);_f .Fill .TypeAttr =_ca .ST_FillTypeGradient ;_f .Fill .Fill =_ca .NewOfcFill ();_f .Fill .Fill .ExtAttr =_ca .ST_ExtView ;_f .Fill .Fill .TypeAttr =_ca .OfcST_FillTypeGradientUnscaled ;_ag .EG_ShapeElements =append (_ag .EG_ShapeElements ,_f );_cgg :=_ca .NewEG_ShapeElements ();_cgg .Shadow =_ca .NewShadow ();_cgg .Shadow .OnAttr =_cg .ST_TrueFalseT ;_cgg .Shadow .ObscuredAttr =_cg .ST_TrueFalseT ;_ag .EG_ShapeElements =append (_ag .EG_ShapeElements ,_cgg );_fc :=_ca .NewEG_ShapeElements ();_fc .Path =_ca .NewPath ();_fc .Path .ConnecttypeAttr =_ca .OfcST_ConnectTypeNone ;_ag .EG_ShapeElements =append (_ag .EG_ShapeElements ,_fc );_ga :=_ca .NewEG_ShapeElements ();_ga .Textbox =_ca .NewTextbox ();_ga .Textbox .StyleAttr =_a .String ("\u006d\u0073\u006f\u002ddi\u0072\u0065\u0063\u0074\u0069\u006f\u006e\u002d\u0061\u006c\u0074\u003a\u0061\u0075t\u006f");_ag .EG_ShapeElements =append (_ag .EG_ShapeElements ,_ga );_eg :=_ca .NewEG_ShapeElements ();_eg .ClientData =_e .NewClientData ();_eg .ClientData .ObjectTypeAttr =_e .ST_ObjectTypeNote ;_eg .ClientData .MoveWithCells =_cg .ST_TrueFalseBlankT ;_eg .ClientData .SizeWithCells =_cg .ST_TrueFalseBlankT ;_eg .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");_eg .ClientData .AutoFill =_cg .ST_TrueFalseBlankFalse ;_eg .ClientData .Row =_a .Int64 (row );_eg .ClientData .Column =_a .Int64 (col );_ag .EG_ShapeElements =append (_ag .EG_ShapeElements ,_eg );return _ag ;};
|
||||
|
||||
// NewShapeStyle accept value of string style attribute in v:shape and format it to generate ShapeStyle.
|
||||
func NewShapeStyle (style string )ShapeStyle {_beg :=ShapeStyle {_cc :0,_ff :0};_ga :=_dd .Split (style ,"\u003b");for _ ,_da :=range _ga {_abe :=_dd .Split (_da ,"\u003a");if len (_abe )!=2{continue ;};switch _abe [0]{case "\u0070\u006f\u0073\u0069\u0074\u0069\u006f\u006e":_beg ._eec =_abe [1];break ;case "m\u0061\u0072\u0067\u0069\u006e\u002d\u006c\u0065\u0066\u0074":_beg ._fb ,_ =_dg .ParseInt (_abe [1],10,64);break ;case "\u006d\u0061\u0072\u0067\u0069\u006e\u002d\u0074\u006f\u0070":_beg ._cbb ,_ =_dg .ParseInt (_abe [1],10,64);break ;case "\u0077\u0069\u0064t\u0068":_beg ._cc ,_ =_dg .ParseInt (_dd .ReplaceAll (_abe [1],"\u0070\u0074",""),10,64);break ;case "\u0068\u0065\u0069\u0067\u0068\u0074":_beg ._ff ,_ =_dg .ParseInt (_dd .ReplaceAll (_abe [1],"\u0070\u0074",""),10,64);break ;case "\u007a-\u0069\u006e\u0064\u0065\u0078":_beg ._fe ,_ =_dg .ParseInt (_abe [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":_beg ._be =_abe [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":_beg ._eb =_abe [1];break ;case "m\u0073\u006f\u002d\u0070os\u0069t\u0069\u006f\u006e\u002d\u0076e\u0072\u0074\u0069\u0063\u0061\u006c":_beg ._fcc =_abe [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":_beg ._baa =_abe [1];break ;};};return _beg ;};
|
||||
// Width return width of shape.
|
||||
func (_cea *ShapeStyle )Width ()int64 {return _cea ._ad };
|
||||
|
||||
// SetWidth set width of shape.
|
||||
func (_gf *ShapeStyle )SetWidth (width int64 ){_gf ._cc =width };
|
||||
func (_bd *ShapeStyle )SetWidth (width int64 ){_bd ._ad =width };
|
||||
|
||||
// ToString generate string of TextpathStyle.
|
||||
func (_ebe *TextpathStyle )String ()string {_cgc :="";_cgc +=_d .Sprintf ("\u0066o\u006et\u002d\u0066\u0061\u006d\u0069\u006c\u0079\u003a\u0025\u0073\u003b",_ebe ._gd );_cgc +=_d .Sprintf ("\u0066o\u006et\u002d\u0073\u0069\u007a\u0065\u003a\u0025\u0064\u0070\u0074\u003b",_ebe ._gdg );if _ebe ._cd {_cgc +=_d .Sprintf ("\u0066o\u006et\u002d\u0073\u0074\u0079\u006ce\u003a\u0069t\u0061\u006c\u0069\u0063\u003b");};if _ebe ._db {_cgc +=_d .Sprintf ("\u0066\u006f\u006e\u0074\u002d\u0077\u0065\u0069\u0067\u0068\u0074\u003ab\u006f\u006c\u0064\u003b");};return _cgc ;};
|
||||
|
||||
// FontFamily returns fontFamily of the text.
|
||||
func (_cf *TextpathStyle )FontFamily ()string {return _cf ._gd };
|
||||
// Height return height of shape.
|
||||
func (_afd *ShapeStyle )Height ()int64 {return _afd ._fg };
|
||||
|
||||
// ShapeStyle is style attribute of v:shape element.
|
||||
type ShapeStyle struct{_eec string ;_fb int64 ;_cbb int64 ;_cc int64 ;_ff int64 ;_fe int64 ;_be string ;_eb string ;_fcc string ;_baa string ;};
|
||||
type ShapeStyle struct{_dae string ;_gf int64 ;_dac int64 ;_ad int64 ;_fg int64 ;_db int64 ;_bf string ;_cga string ;_fe string ;_cef string ;};func (_deg *Container )UnmarshalXML (d *_g .Decoder ,start _g .StartElement )error {_deg .Shape =nil ;_fb :for {_gd ,_cb :=d .Token ();if _cb !=nil {return _cb ;};switch _eb :=_gd .(type ){case _g .StartElement :switch _eb .Name .Local {case "s\u0068\u0061\u0070\u0065\u006c\u0061\u0079\u006f\u0075\u0074":_deg .Layout =_ca .NewOfcShapelayout ();if _gg :=d .DecodeElement (_deg .Layout ,&_eb );_gg !=nil {return _gg ;};case "\u0073h\u0061\u0070\u0065\u0074\u0079\u0070e":_deg .ShapeType =_ca .NewShapetype ();if _ac :=d .DecodeElement (_deg .ShapeType ,&_eb );_ac !=nil {return _ac ;};case "\u0073\u0068\u0061p\u0065":_fce :=_ca .NewShape ();if _abab :=d .DecodeElement (_fce ,&_eb );_abab !=nil {return _abab ;};_deg .Shape =append (_deg .Shape ,_fce );};case _g .EndElement :break _fb ;};};return nil ;};
|
||||
|
||||
// SetFontSize sets text's fontSize.
|
||||
func (_ea *TextpathStyle )SetFontSize (fontSize int64 ){_ea ._gdg =fontSize };
|
||||
// SetHeight set height of shape.
|
||||
func (_cee *ShapeStyle )SetHeight (height int64 ){_cee ._fg =height };
|
||||
|
||||
// SetBold sets text to bold.
|
||||
func (_caa *TextpathStyle )SetBold (bold bool ){_caa ._dbb =bold };
|
||||
|
||||
// CreateFormula creates F element for typeFormulas.
|
||||
func CreateFormula (s string )*_ca .CT_F {_ecb :=_ca .NewCT_F ();_ecb .EqnAttr =&s ;return _ecb };
|
||||
|
||||
// SetItalic sets text to italic.
|
||||
func (_dbg *TextpathStyle )SetItalic (italic bool ){_dbg ._adc =italic };
|
@ -9,32 +9,15 @@
|
||||
// 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 (_d "archive/zip";_bc "bytes";_f "encoding/xml";_dff "fmt";_gg "github.com/unidoc/unioffice";_e "github.com/unidoc/unioffice/algo";_fg "github.com/unidoc/unioffice/common/tempstorage";_cb "github.com/unidoc/unioffice/schema/soo/pkg/relationships";_bf "io";_c "path";_df "sort";_ge "strings";_g "time";);
|
||||
package zippkg ;import (_af "archive/zip";_ab "bytes";_bf "encoding/xml";_e "fmt";_ce "github.com/unidoc/unioffice";_cd "github.com/unidoc/unioffice/algo";_bc "github.com/unidoc/unioffice/common/tempstorage";_dg "github.com/unidoc/unioffice/schema/soo/pkg/relationships";_fg "io";_c "path";_d "sort";_b "strings";_f "time";);func (_cda *DecodeMap )IndexFor (path string )int {return _cda ._ee [path ]};
|
||||
|
||||
// ExtractToDiskTmp extracts a zip file to a temporary file in a given path,
|
||||
// returning the name of the file.
|
||||
func ExtractToDiskTmp (f *_d .File ,path string )(string ,error ){_aba ,_fcd :=_fg .TempFile (path ,"\u007a\u007a");if _fcd !=nil {return "",_fcd ;};defer _aba .Close ();_gdf ,_fcd :=f .Open ();if _fcd !=nil {return "",_fcd ;};defer _gdf .Close ();_ ,_fcd =_bf .Copy (_aba ,_gdf );if _fcd !=nil {return "",_fcd ;};return _aba .Name (),nil ;};
|
||||
|
||||
// SetOnNewRelationshipFunc sets the function to be called when a new
|
||||
// relationship has been discovered.
|
||||
func (_ee *DecodeMap )SetOnNewRelationshipFunc (fn OnNewRelationshipFunc ){_ee ._fga =fn };func (_ab *DecodeMap )IndexFor (path string )int {return _ab ._bd [path ]};var _aga =[]byte {'/','>'};
|
||||
// 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 *_af .Writer ,zipPath ,storagePath string )error {_gdg ,_ecd :=z .Create (zipPath );if _ecd !=nil {return _e .Errorf ("e\u0072\u0072\u006f\u0072 c\u0072e\u0061\u0074\u0069\u006e\u0067 \u0025\u0073\u003a\u0020\u0025\u0073",zipPath ,_ecd );};_ecdg ,_ecd :=_bc .Open (storagePath );if _ecd !=nil {return _e .Errorf ("e\u0072r\u006f\u0072\u0020\u006f\u0070\u0065\u006e\u0069n\u0067\u0020\u0025\u0073: \u0025\u0073",storagePath ,_ecd );};defer _ecdg .Close ();_ ,_ecd =_fg .Copy (_gdg ,_ecdg );return _ecd ;};
|
||||
|
||||
// Decode loops decoding targets registered with AddTarget and calling th
|
||||
func (_bca *DecodeMap )Decode (files []*_d .File )error {_ca :=1;for _ca > 0{for len (_bca ._ce )> 0{_ae :=_bca ._ce [0];_bca ._ce =_bca ._ce [1:];_ef :=_ae .Ifc .(*_cb .Relationships );for _ ,_dfad :=range _ef .Relationship {_ff ,_ :=_bca ._fc [_ef ];_bca ._fga (_bca ,_ff +_dfad .TargetAttr ,_dfad .TypeAttr ,files ,_dfad ,_ae );};};for _eeb ,_eeg :=range files {if _eeg ==nil {continue ;};if _ad ,_cbc :=_bca ._da [_eeg .Name ];_cbc {delete (_bca ._da ,_eeg .Name );if _bfd :=Decode (_eeg ,_ad .Ifc );_bfd !=nil {return _bfd ;};files [_eeb ]=nil ;if _adf ,_gfc :=_ad .Ifc .(*_cb .Relationships );_gfc {_bca ._ce =append (_bca ._ce ,_ad );_de ,_ :=_c .Split (_c .Clean (_eeg .Name +"\u002f\u002e\u002e\u002f"));_bca ._fc [_adf ]=_de ;_ca ++;};};};_ca --;};return nil ;};
|
||||
|
||||
// MarshalXML creates a file inside of a zip and marshals an object as xml, prefixing it
|
||||
// with a standard XML header.
|
||||
func MarshalXML (z *_d .Writer ,filename string ,v interface{})error {_cff :=&_d .FileHeader {};_cff .Method =_d .Deflate ;_cff .Name =filename ;_cff .SetModTime (_g .Now ());_bb ,_ga :=z .CreateHeader (_cff );if _ga !=nil {return _dff .Errorf ("\u0063\u0072\u0065\u0061ti\u006e\u0067\u0020\u0025\u0073\u0020\u0069\u006e\u0020\u007a\u0069\u0070\u003a\u0020%\u0073",filename ,_ga );};_ ,_ga =_bb .Write ([]byte (XMLHeader ));if _ga !=nil {return _dff .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 ,_ga );};if _ga =_f .NewEncoder (SelfClosingWriter {_bb }).Encode (v );_ga !=nil {return _dff .Errorf ("\u006d\u0061\u0072\u0073\u0068\u0061\u006c\u0069\u006e\u0067\u0020\u0025s\u003a\u0020\u0025\u0073",filename ,_ga );};_ ,_ga =_bb .Write (_ag );return _ga ;};
|
||||
|
||||
// RelationsPathFor returns the relations path for a given filename.
|
||||
func RelationsPathFor (path string )string {_aa :=_ge .Split (path ,"\u002f");_gbb :=_ge .Join (_aa [0:len (_aa )-1],"\u002f");_fgc :=_aa [len (_aa )-1];_gbb +="\u002f_\u0072\u0065\u006c\u0073\u002f";_fgc +="\u002e\u0072\u0065l\u0073";return _gbb +_fgc ;};func MarshalXMLByTypeIndex (z *_d .Writer ,dt _gg .DocType ,typ string ,idx int ,v interface{})error {_gge :=_gg .AbsoluteFilename (dt ,typ ,idx );return MarshalXML (z ,_gge ,v );};
|
||||
|
||||
// SelfClosingWriter wraps a writer and replaces XML tags of the
|
||||
// type <foo></foo> with <foo/>
|
||||
type SelfClosingWriter struct{W _bf .Writer ;};var _ag =[]byte {'\r','\n'};func MarshalXMLByType (z *_d .Writer ,dt _gg .DocType ,typ string ,v interface{})error {_eaf :=_gg .AbsoluteFilename (dt ,typ ,0);return MarshalXML (z ,_eaf ,v );};func (_gb *DecodeMap )RecordIndex (path string ,idx int ){_gb ._bd [path ]=idx };
|
||||
|
||||
// AddFileFromBytes takes a byte array and adds it at a given path to a zip file.
|
||||
func AddFileFromBytes (z *_d .Writer ,zipPath string ,data []byte )error {_gbaa ,_cad :=z .Create (zipPath );if _cad !=nil {return _dff .Errorf ("e\u0072\u0072\u006f\u0072 c\u0072e\u0061\u0074\u0069\u006e\u0067 \u0025\u0073\u003a\u0020\u0025\u0073",zipPath ,_cad );};_ ,_cad =_bf .Copy (_gbaa ,_bc .NewReader (data ));return _cad ;};
|
||||
func (_gb *DecodeMap )Decode (files []*_af .File )error {_gbf :=1;for _gbf > 0{for len (_gb ._df )> 0{_bfd :=_gb ._df [0];_gb ._df =_gb ._df [1:];_dfe :=_bfd .Ifc .(*_dg .Relationships );for _ ,_ba :=range _dfe .Relationship {_cc ,_ :=_gb ._bfa [_dfe ];_gb ._abg (_gb ,_cc +_ba .TargetAttr ,_ba .TypeAttr ,files ,_ba ,_bfd );};};for _fb ,_bcg :=range files {if _bcg ==nil {continue ;};if _eg ,_abf :=_gb ._fe [_bcg .Name ];_abf {delete (_gb ._fe ,_bcg .Name );if _gdc :=Decode (_bcg ,_eg .Ifc );_gdc !=nil {return _gdc ;};files [_fb ]=nil ;if _bag ,_ga :=_eg .Ifc .(*_dg .Relationships );_ga {_gb ._df =append (_gb ._df ,_eg );_eed ,_ :=_c .Split (_c .Clean (_bcg .Name +"\u002f\u002e\u002e\u002f"));_gb ._bfa [_bag ]=_eed ;_gbf ++;};};};_gbf --;};return nil ;};
|
||||
|
||||
// OnNewRelationshipFunc is called when a new relationship has been discovered.
|
||||
//
|
||||
@ -48,23 +31,40 @@ func AddFileFromBytes (z *_d .Writer ,zipPath string ,data []byte )error {_gbaa
|
||||
// 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 (_fb *DecodeMap ,_fd ,_cba string ,_dfg []*_d .File ,_ba *_cb .Relationship ,_gf Target )error ;type Target struct{Path string ;Typ string ;Ifc interface{};Index uint32 ;};
|
||||
|
||||
// DecodeMap is used to walk a tree of relationships, decoding files and passing
|
||||
// control back to the document.
|
||||
type DecodeMap struct{_da map[string ]Target ;_fc map[*_cb .Relationships ]string ;_ce []Target ;_fga OnNewRelationshipFunc ;_be map[string ]struct{};_bd map[string ]int ;};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 (_dg SelfClosingWriter )Write (b []byte )(int ,error ){_bg :=0;_fe :=0;for _cbf :=0;_cbf < len (b )-2;_cbf ++{if b [_cbf ]=='>'&&b [_cbf +1]=='<'&&b [_cbf +2]=='/'{_fcf :=[]byte {};_aeg :=_cbf ;for _bbc :=_cbf ;_bbc >=0;_bbc --{if b [_bbc ]==' '{_aeg =_bbc ;}else if b [_bbc ]=='<'{_fcf =b [_bbc +1:_aeg ];break ;};};_cfd :=[]byte {};for _age :=_cbf +3;_age < len (b );_age ++{if b [_age ]=='>'{_cfd =b [_cbf +3:_age ];break ;};};if !_bc .Equal (_fcf ,_cfd ){continue ;};_bdd ,_bcf :=_dg .W .Write (b [_bg :_cbf ]);if _bcf !=nil {return _fe +_bdd ,_bcf ;};_fe +=_bdd ;_ ,_bcf =_dg .W .Write (_aga );if _bcf !=nil {return _fe ,_bcf ;};_fe +=3;for _efb :=_cbf +2;_efb < len (b )&&b [_efb ]!='>';_efb ++{_fe ++;_bg =_efb +2;_cbf =_bg ;};};};_aded ,_dgc :=_dg .W .Write (b [_bg :]);return _aded +_fe ,_dgc ;};
|
||||
|
||||
// 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 *_d .Writer ,zipPath ,storagePath string )error {_db ,_ac :=z .Create (zipPath );if _ac !=nil {return _dff .Errorf ("e\u0072\u0072\u006f\u0072 c\u0072e\u0061\u0074\u0069\u006e\u0067 \u0025\u0073\u003a\u0020\u0025\u0073",zipPath ,_ac );};_gd ,_ac :=_fg .Open (storagePath );if _ac !=nil {return _dff .Errorf ("e\u0072r\u006f\u0072\u0020\u006f\u0070\u0065\u006e\u0069n\u0067\u0020\u0025\u0073: \u0025\u0073",storagePath ,_ac );};defer _gd .Close ();_ ,_ac =_bf .Copy (_db ,_gd );return _ac ;};
|
||||
type OnNewRelationshipFunc func (_ef *DecodeMap ,_ec ,_eb string ,_bd []*_af .File ,_fge *_dg .Relationship ,_g Target )error ;
|
||||
|
||||
// Decode unmarshals the content of a *zip.File as XML to a given destination.
|
||||
func Decode (f *_d .File ,dest interface{})error {_cd ,_ed :=f .Open ();if _ed !=nil {return _dff .Errorf ("e\u0072r\u006f\u0072\u0020\u0072\u0065\u0061\u0064\u0069n\u0067\u0020\u0025\u0073: \u0025\u0073",f .Name ,_ed );};defer _cd .Close ();_fgd :=_f .NewDecoder (_cd );if _dc :=_fgd .Decode (dest );_dc !=nil {return _dff .Errorf ("e\u0072\u0072\u006f\u0072 d\u0065c\u006f\u0064\u0069\u006e\u0067 \u0025\u0073\u003a\u0020\u0025\u0073",f .Name ,_dc );};if _aae ,_eb :=dest .(*_cb .Relationships );_eb {for _aec ,_ade :=range _aae .Relationship {switch _ade .TypeAttr {case _gg .OfficeDocumentTypeStrict :_aae .Relationship [_aec ].TypeAttr =_gg .OfficeDocumentType ;case _gg .StylesTypeStrict :_aae .Relationship [_aec ].TypeAttr =_gg .StylesType ;case _gg .ThemeTypeStrict :_aae .Relationship [_aec ].TypeAttr =_gg .ThemeType ;case _gg .ControlTypeStrict :_aae .Relationship [_aec ].TypeAttr =_gg .ControlType ;case _gg .SettingsTypeStrict :_aae .Relationship [_aec ].TypeAttr =_gg .SettingsType ;case _gg .ImageTypeStrict :_aae .Relationship [_aec ].TypeAttr =_gg .ImageType ;case _gg .CommentsTypeStrict :_aae .Relationship [_aec ].TypeAttr =_gg .CommentsType ;case _gg .ThumbnailTypeStrict :_aae .Relationship [_aec ].TypeAttr =_gg .ThumbnailType ;case _gg .DrawingTypeStrict :_aae .Relationship [_aec ].TypeAttr =_gg .DrawingType ;case _gg .ChartTypeStrict :_aae .Relationship [_aec ].TypeAttr =_gg .ChartType ;case _gg .ExtendedPropertiesTypeStrict :_aae .Relationship [_aec ].TypeAttr =_gg .ExtendedPropertiesType ;case _gg .CustomXMLTypeStrict :_aae .Relationship [_aec ].TypeAttr =_gg .CustomXMLType ;case _gg .WorksheetTypeStrict :_aae .Relationship [_aec ].TypeAttr =_gg .WorksheetType ;case _gg .SharedStringsTypeStrict :_aae .Relationship [_aec ].TypeAttr =_gg .SharedStringsType ;case _gg .TableTypeStrict :_aae .Relationship [_aec ].TypeAttr =_gg .TableType ;case _gg .HeaderTypeStrict :_aae .Relationship [_aec ].TypeAttr =_gg .HeaderType ;case _gg .FooterTypeStrict :_aae .Relationship [_aec ].TypeAttr =_gg .FooterType ;case _gg .NumberingTypeStrict :_aae .Relationship [_aec ].TypeAttr =_gg .NumberingType ;case _gg .FontTableTypeStrict :_aae .Relationship [_aec ].TypeAttr =_gg .FontTableType ;case _gg .WebSettingsTypeStrict :_aae .Relationship [_aec ].TypeAttr =_gg .WebSettingsType ;case _gg .FootNotesTypeStrict :_aae .Relationship [_aec ].TypeAttr =_gg .FootNotesType ;case _gg .EndNotesTypeStrict :_aae .Relationship [_aec ].TypeAttr =_gg .EndNotesType ;case _gg .SlideTypeStrict :_aae .Relationship [_aec ].TypeAttr =_gg .SlideType ;case _gg .VMLDrawingTypeStrict :_aae .Relationship [_aec ].TypeAttr =_gg .VMLDrawingType ;};};_df .Slice (_aae .Relationship ,func (_aea ,_aece int )bool {_gbab :=_aae .Relationship [_aea ];_ec :=_aae .Relationship [_aece ];return _e .NaturalLess (_gbab .IdAttr ,_ec .IdAttr );});};return nil ;};
|
||||
func Decode (f *_af .File ,dest interface{})error {_dfeg ,_cca :=f .Open ();if _cca !=nil {return _e .Errorf ("e\u0072r\u006f\u0072\u0020\u0072\u0065\u0061\u0064\u0069n\u0067\u0020\u0025\u0073: \u0025\u0073",f .Name ,_cca );};defer _dfeg .Close ();_cg :=_bf .NewDecoder (_dfeg );if _fgc :=_cg .Decode (dest );_fgc !=nil {return _e .Errorf ("e\u0072\u0072\u006f\u0072 d\u0065c\u006f\u0064\u0069\u006e\u0067 \u0025\u0073\u003a\u0020\u0025\u0073",f .Name ,_fgc );};if _dgbg ,_bfc :=dest .(*_dg .Relationships );_bfc {for _ff ,_eff :=range _dgbg .Relationship {switch _eff .TypeAttr {case _ce .OfficeDocumentTypeStrict :_dgbg .Relationship [_ff ].TypeAttr =_ce .OfficeDocumentType ;case _ce .StylesTypeStrict :_dgbg .Relationship [_ff ].TypeAttr =_ce .StylesType ;case _ce .ThemeTypeStrict :_dgbg .Relationship [_ff ].TypeAttr =_ce .ThemeType ;case _ce .ControlTypeStrict :_dgbg .Relationship [_ff ].TypeAttr =_ce .ControlType ;case _ce .SettingsTypeStrict :_dgbg .Relationship [_ff ].TypeAttr =_ce .SettingsType ;case _ce .ImageTypeStrict :_dgbg .Relationship [_ff ].TypeAttr =_ce .ImageType ;case _ce .CommentsTypeStrict :_dgbg .Relationship [_ff ].TypeAttr =_ce .CommentsType ;case _ce .ThumbnailTypeStrict :_dgbg .Relationship [_ff ].TypeAttr =_ce .ThumbnailType ;case _ce .DrawingTypeStrict :_dgbg .Relationship [_ff ].TypeAttr =_ce .DrawingType ;case _ce .ChartTypeStrict :_dgbg .Relationship [_ff ].TypeAttr =_ce .ChartType ;case _ce .ExtendedPropertiesTypeStrict :_dgbg .Relationship [_ff ].TypeAttr =_ce .ExtendedPropertiesType ;case _ce .CustomXMLTypeStrict :_dgbg .Relationship [_ff ].TypeAttr =_ce .CustomXMLType ;case _ce .WorksheetTypeStrict :_dgbg .Relationship [_ff ].TypeAttr =_ce .WorksheetType ;case _ce .SharedStringsTypeStrict :_dgbg .Relationship [_ff ].TypeAttr =_ce .SharedStringsType ;case _ce .TableTypeStrict :_dgbg .Relationship [_ff ].TypeAttr =_ce .TableType ;case _ce .HeaderTypeStrict :_dgbg .Relationship [_ff ].TypeAttr =_ce .HeaderType ;case _ce .FooterTypeStrict :_dgbg .Relationship [_ff ].TypeAttr =_ce .FooterType ;case _ce .NumberingTypeStrict :_dgbg .Relationship [_ff ].TypeAttr =_ce .NumberingType ;case _ce .FontTableTypeStrict :_dgbg .Relationship [_ff ].TypeAttr =_ce .FontTableType ;case _ce .WebSettingsTypeStrict :_dgbg .Relationship [_ff ].TypeAttr =_ce .WebSettingsType ;case _ce .FootNotesTypeStrict :_dgbg .Relationship [_ff ].TypeAttr =_ce .FootNotesType ;case _ce .EndNotesTypeStrict :_dgbg .Relationship [_ff ].TypeAttr =_ce .EndNotesType ;case _ce .SlideTypeStrict :_dgbg .Relationship [_ff ].TypeAttr =_ce .SlideType ;case _ce .VMLDrawingTypeStrict :_dgbg .Relationship [_ff ].TypeAttr =_ce .VMLDrawingType ;};};_d .Slice (_dgbg .Relationship ,func (_bg ,_cfg int )bool {_baga :=_dgbg .Relationship [_bg ];_da :=_dgbg .Relationship [_cfg ];return _cd .NaturalLess (_baga .IdAttr ,_da .IdAttr );});};return nil ;};
|
||||
|
||||
// SelfClosingWriter wraps a writer and replaces XML tags of the
|
||||
// type <foo></foo> with <foo/>
|
||||
type SelfClosingWriter struct{W _fg .Writer ;};func MarshalXMLByTypeIndex (z *_af .Writer ,dt _ce .DocType ,typ string ,idx int ,v interface{})error {_cec :=_ce .AbsoluteFilename (dt ,typ ,idx );return MarshalXML (z ,_cec ,v );};
|
||||
|
||||
// SetOnNewRelationshipFunc sets the function to be called when a new
|
||||
// relationship has been discovered.
|
||||
func (_gd *DecodeMap )SetOnNewRelationshipFunc (fn OnNewRelationshipFunc ){_gd ._abg =fn };var _efcd =[]byte {'/','>'};
|
||||
|
||||
// MarshalXML creates a file inside of a zip and marshals an object as xml, prefixing it
|
||||
// with a standard XML header.
|
||||
func MarshalXML (z *_af .Writer ,filename string ,v interface{})error {_cfc :=&_af .FileHeader {};_cfc .Method =_af .Deflate ;_cfc .Name =filename ;_cfc .SetModTime (_f .Now ());_db ,_bdc :=z .CreateHeader (_cfc );if _bdc !=nil {return _e .Errorf ("\u0063\u0072\u0065\u0061ti\u006e\u0067\u0020\u0025\u0073\u0020\u0069\u006e\u0020\u007a\u0069\u0070\u003a\u0020%\u0073",filename ,_bdc );};_ ,_bdc =_db .Write ([]byte (XMLHeader ));if _bdc !=nil {return _e .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 ,_bdc );};if _bdc =_bf .NewEncoder (SelfClosingWriter {_db }).Encode (v );_bdc !=nil {return _e .Errorf ("\u006d\u0061\u0072\u0073\u0068\u0061\u006c\u0069\u006e\u0067\u0020\u0025s\u003a\u0020\u0025\u0073",filename ,_bdc );};_ ,_bdc =_db .Write (_ca );return _bdc ;};func (_fdd SelfClosingWriter )Write (b []byte )(int ,error ){_gf :=0;_edc :=0;for _cdc :=0;_cdc < len (b )-2;_cdc ++{if b [_cdc ]=='>'&&b [_cdc +1]=='<'&&b [_cdc +2]=='/'{_gbc :=[]byte {};_eca :=_cdc ;for _dgbc :=_cdc ;_dgbc >=0;_dgbc --{if b [_dgbc ]==' '{_eca =_dgbc ;}else if b [_dgbc ]=='<'{_gbc =b [_dgbc +1:_eca ];break ;};};_cee :=[]byte {};for _fga :=_cdc +3;_fga < len (b );_fga ++{if b [_fga ]=='>'{_cee =b [_cdc +3:_fga ];break ;};};if !_ab .Equal (_gbc ,_cee ){continue ;};_gab ,_de :=_fdd .W .Write (b [_gf :_cdc ]);if _de !=nil {return _edc +_gab ,_de ;};_edc +=_gab ;_ ,_de =_fdd .W .Write (_efcd );if _de !=nil {return _edc ,_de ;};_edc +=3;for _ge :=_cdc +2;_ge < len (b )&&b [_ge ]!='>';_ge ++{_edc ++;_gf =_ge +2;_cdc =_gf ;};};};_cgg ,_geg :=_fdd .W .Write (b [_gf :]);return _cgg +_edc ,_geg ;};type Target struct{Path string ;Typ string ;Ifc interface{};Index uint32 ;};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";
|
||||
|
||||
// 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 (_a *DecodeMap )AddTarget (filePath string ,ifc interface{},sourceFileType string ,idx uint32 )bool {if _a ._da ==nil {_a ._da =make (map[string ]Target );_a ._fc =make (map[*_cb .Relationships ]string );_a ._be =make (map[string ]struct{});_a ._bd =make (map[string ]int );};_cf :=_c .Clean (filePath );if _ ,_dfa :=_a ._be [_cf ];_dfa {return false ;};_a ._be [_cf ]=struct{}{};_a ._da [_cf ]=Target {Path :filePath ,Typ :sourceFileType ,Ifc :ifc ,Index :idx };return true ;};
|
||||
func (_fa *DecodeMap )AddTarget (filePath string ,ifc interface{},sourceFileType string ,idx uint32 )bool {if _fa ._fe ==nil {_fa ._fe =make (map[string ]Target );_fa ._bfa =make (map[*_dg .Relationships ]string );_fa ._ae =make (map[string ]struct{});_fa ._ee =make (map[string ]int );};_fd :=_c .Clean (filePath );if _ ,_dgb :=_fa ._ae [_fd ];_dgb {return false ;};_fa ._ae [_fd ]=struct{}{};_fa ._fe [_fd ]=Target {Path :filePath ,Typ :sourceFileType ,Ifc :ifc ,Index :idx };return true ;};func MarshalXMLByType (z *_af .Writer ,dt _ce .DocType ,typ string ,v interface{})error {_be :=_ce .AbsoluteFilename (dt ,typ ,0);return MarshalXML (z ,_be ,v );};
|
||||
|
||||
// RelationsPathFor returns the relations path for a given filename.
|
||||
func RelationsPathFor (path string )string {_cfb :=_b .Split (path ,"\u002f");_gac :=_b .Join (_cfb [0:len (_cfb )-1],"\u002f");_abd :=_cfb [len (_cfb )-1];_gac +="\u002f_\u0072\u0065\u006c\u0073\u002f";_abd +="\u002e\u0072\u0065l\u0073";return _gac +_abd ;};
|
||||
|
||||
// DecodeMap is used to walk a tree of relationships, decoding files and passing
|
||||
// control back to the document.
|
||||
type DecodeMap struct{_fe map[string ]Target ;_bfa map[*_dg .Relationships ]string ;_df []Target ;_abg OnNewRelationshipFunc ;_ae map[string ]struct{};_ee map[string ]int ;};var _ca =[]byte {'\r','\n'};
|
||||
|
||||
// AddFileFromBytes takes a byte array and adds it at a given path to a zip file.
|
||||
func AddFileFromBytes (z *_af .Writer ,zipPath string ,data []byte )error {_ade ,_fgg :=z .Create (zipPath );if _fgg !=nil {return _e .Errorf ("e\u0072\u0072\u006f\u0072 c\u0072e\u0061\u0074\u0069\u006e\u0067 \u0025\u0073\u003a\u0020\u0025\u0073",zipPath ,_fgg );};_ ,_fgg =_fg .Copy (_ade ,_ab .NewReader (data ));return _fgg ;};func (_cf *DecodeMap )RecordIndex (path string ,idx int ){_cf ._ee [path ]=idx };
|
||||
|
||||
// ExtractToDiskTmp extracts a zip file to a temporary file in a given path,
|
||||
// returning the name of the file.
|
||||
func ExtractToDiskTmp (f *_af .File ,path string )(string ,error ){_dfd ,_egf :=_bc .TempFile (path ,"\u007a\u007a");if _egf !=nil {return "",_egf ;};defer _dfd .Close ();_ed ,_egf :=f .Open ();if _egf !=nil {return "",_egf ;};defer _ed .Close ();_ ,_egf =_fg .Copy (_dfd ,_ed );if _egf !=nil {return "",_egf ;};return _dfd .Name (),nil ;};
|
Loading…
x
Reference in New Issue
Block a user