Skip to content

Commit

Permalink
Merge pull request #444 from unidoc-build/prep-rc-v1.8.0
Browse files Browse the repository at this point in the history
Prepare release of UniOffice v1.8.0
  • Loading branch information
gunnsth authored Jan 6, 2021
2 parents 0fcd777 + e3d76c4 commit 61a4548
Show file tree
Hide file tree
Showing 47 changed files with 18,865 additions and 18,664 deletions.
4 changes: 2 additions & 2 deletions algo/algo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 _a "strconv";func _e (_c byte )bool {return _c >='0'&&_c <='9'};func RepeatString (s string ,cnt int )string {if cnt <=0{return "";};_fg :=make ([]byte ,len (s )*cnt );_bb :=[]byte (s );for _df :=0;_df < cnt ;_df ++{copy (_fg [_df :],_bb );};return string (_fg );};
package algo ;import _a "strconv";func RepeatString (s string ,cnt int )string {if cnt <=0{return "";};_bb :=make ([]byte ,len (s )*cnt );_bd :=[]byte (s );for _ec :=0;_ec < cnt ;_ec ++{copy (_bb [_ec :],_bd );};return string (_bb );};

// NaturalLess compares two strings in a human manner so rId2 sorts less than rId10
func NaturalLess (lhs ,rhs string )bool {_b ,_ab :=0,0;for _b < len (lhs )&&_ab < len (rhs ){_abf :=lhs [_b ];_cc :=rhs [_ab ];_d :=_e (_abf );_dd :=_e (_cc );switch {case _d &&!_dd :return true ;case !_d &&_dd :return false ;case !_d &&!_dd :if _abf !=_cc {return _abf < _cc ;};_b ++;_ab ++;default:_be :=_b +1;_ag :=_ab +1;for _be < len (lhs )&&_e (lhs [_be ]){_be ++;};for _ag < len (rhs )&&_e (rhs [_ag ]){_ag ++;};_ae ,_ :=_a .ParseUint (lhs [_b :_be ],10,64);_cb ,_ :=_a .ParseUint (rhs [_b :_ag ],10,64);if _ae !=_cb {return _ae < _cb ;};_b =_be ;_ab =_ag ;};};return len (lhs )< len (rhs );};
func NaturalLess (lhs ,rhs string )bool {_ee ,_ag :=0,0;for _ee < len (lhs )&&_ag < len (rhs ){_b :=lhs [_ee ];_ad :=rhs [_ag ];_g :=_ae (_b );_d :=_ae (_ad );switch {case _g &&!_d :return true ;case !_g &&_d :return false ;case !_g &&!_d :if _b !=_ad {return _b < _ad ;};_ee ++;_ag ++;default:_ef :=_ee +1;_f :=_ag +1;for _ef < len (lhs )&&_ae (lhs [_ef ]){_ef ++;};for _f < len (rhs )&&_ae (rhs [_f ]){_f ++;};_fd ,_ :=_a .ParseUint (lhs [_ee :_ef ],10,64);_ce ,_ :=_a .ParseUint (rhs [_ee :_f ],10,64);if _fd !=_ce {return _fd < _ce ;};_ee =_ef ;_ag =_f ;};};return len (lhs )< len (rhs );};func _ae (_ac byte )bool {return _ac >='0'&&_ac <='9'};
666 changes: 333 additions & 333 deletions chart/chart.go

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions color/color.go

Large diffs are not rendered by default.

528 changes: 264 additions & 264 deletions common/common.go

Large diffs are not rendered by default.

46 changes: 23 additions & 23 deletions common/license/license.go

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions common/tempstorage/diskstore/diskstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@

// Package diskstore implements tempStorage interface
// by using disk as a storage
package diskstore ;import (_gc "github.com/unidoc/unioffice/common/tempstorage";_g "io/ioutil";_gd "os";_b "strings";);
package diskstore ;import (_bd "github.com/unidoc/unioffice/common/tempstorage";_e "io/ioutil";_bb "os";_b "strings";);type diskStorage struct{};

// Open opens file from disk according to a path
func (_e diskStorage )Open (path string )(_gc .File ,error ){return _gd .Open (path )};
func (_cd diskStorage )Open (path string )(_bd .File ,error ){return _bb .Open (path )};

// RemoveAll removes all files in the directory
func (_f diskStorage )RemoveAll (dir string )error {if _b .HasPrefix (dir ,_gd .TempDir ()){return _gd .RemoveAll (dir );};return nil ;};type diskStorage struct{};

// SetAsStorage sets temp storage as a disk storage
func SetAsStorage (){_c :=diskStorage {};_gc .SetAsStorage (&_c )};
// TempFile creates a new temp directory by calling ioutil TempDir
func (_g diskStorage )TempDir (pattern string )(string ,error ){return _e .TempDir ("",pattern )};

// TempFile creates a new temp file by calling ioutil TempFile
func (_cd diskStorage )TempFile (dir ,pattern string )(_gc .File ,error ){return _g .TempFile (dir ,pattern );};
func (_a diskStorage )TempFile (dir ,pattern string )(_bd .File ,error ){return _e .TempFile (dir ,pattern );};

// RemoveAll removes all files in the directory
func (_gf diskStorage )RemoveAll (dir string )error {if _b .HasPrefix (dir ,_bb .TempDir ()){return _bb .RemoveAll (dir );};return nil ;};

// Add is not applicable in the diskstore implementation
func (_df diskStorage )Add (path string )error {return nil };
func (_bbc diskStorage )Add (path string )error {return nil };

// TempFile creates a new temp directory by calling ioutil TempDir
func (_eg diskStorage )TempDir (pattern string )(string ,error ){return _g .TempDir ("",pattern )};
// SetAsStorage sets temp storage as a disk storage
func SetAsStorage (){_bde :=diskStorage {};_bd .SetAsStorage (&_bde )};
40 changes: 20 additions & 20 deletions common/tempstorage/memstore/memstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,34 @@

// Package memstore implements tempStorage interface
// by using memory as a storage
package memstore ;import (_e "encoding/hex";_df "errors";_da "fmt";_ea "github.com/unidoc/unioffice/common/tempstorage";_c "io";_d "io/ioutil";_ad "math/rand";_ae "sync";);func _eg (_dc int )(string ,error ){_bd :=make ([]byte ,_dc );if _ ,_cc :=_ad .Read (_bd );_cc !=nil {return "",_cc ;};return _e .EncodeToString (_bd ),nil ;};
package memstore ;import (_f "encoding/hex";_e "errors";_c "fmt";_cb "github.com/unidoc/unioffice/common/tempstorage";_a "io";_be "io/ioutil";_ae "math/rand";_g "sync";);func _cff (_bd int )(string ,error ){_ggd :=make ([]byte ,_bd );if _ ,_ga :=_ae .Read (_ggd );_ga !=nil {return "",_ga ;};return _f .EncodeToString (_ggd ),nil ;};type memFile struct{_d *memDataCell ;_cg int64 ;};

// Read reads from the underlying memDataCell in order to implement Reader interface
func (_f *memFile )Read (p []byte )(int ,error ){_ab :=_f ._ee ;_g :=_f ._ag ._bf ;_ce :=int64 (len (p ));if _ce > _g {_ce =_g ;p =p [:_ce ];};if _ab >=_g {return 0,_c .EOF ;};_ff :=_ab +_ce ;if _ff >=_g {_ff =_g ;};_fa :=copy (p ,_f ._ag ._de [_ab :_ff ]);_f ._ee =_ff ;return _fa ,nil ;};
// Open returns tempstorage File object by name
func (_dg *memStorage )Open (path string )(_cb .File ,error ){_af ,_gfe :=_dg ._egg .Load (path );if !_gfe {return nil ,_e .New (_c .Sprintf ("\u0043\u0061\u006eno\u0074\u0020\u006f\u0070\u0065\u006e\u0020\u0074\u0068\u0065\u0020\u0066\u0069\u006c\u0065\u0020\u0025\u0073",path ));};return &memFile {_d :_af .(*memDataCell )},nil ;};

// SetAsStorage sets temp storage as a memory storage
func SetAsStorage (){_agb :=memStorage {_b :_ae .Map {}};_ea .SetAsStorage (&_agb )};func _cge (_ge string )string {_dec ,_ :=_eg (6);return _ge +_dec };type memStorage struct{_b _ae .Map };type memDataCell struct{_bc string ;_de []byte ;_bf int64 ;};
// TempDir creates a name for a new temp directory using a pattern argument
func (_ba *memStorage )TempDir (pattern string )(string ,error ){return _fb (pattern ),nil };

// Add reads a file from a disk and adds it to the storage
func (_de *memStorage )Add (path string )error {_ ,_gfc :=_de ._egg .Load (path );if _gfc {return nil ;};_gg ,_ab :=_be .ReadFile (path );if _ab !=nil {return _ab ;};_de ._egg .Store (path ,&memDataCell {_gc :path ,_ec :_gg ,_ac :int64 (len (_gg ))});return nil ;};

// TempFile creates a new empty file in the storage and returns it
func (_dd *memStorage )TempFile (dir ,pattern string )(_ea .File ,error ){_eb :=dir +"\u002f"+_cge (pattern );_faa :=&memDataCell {_bc :_eb ,_de :[]byte {}};_ga :=&memFile {_ag :_faa };_dd ._b .Store (_eb ,_faa );return _ga ,nil ;};
func (_bb *memStorage )TempFile (dir ,pattern string )(_cb .File ,error ){_cf :=dir +"\u002f"+_fb (pattern );_ce :=&memDataCell {_gc :_cf ,_ec :[]byte {}};_gcd :=&memFile {_d :_ce };_bb ._egg .Store (_cf ,_ce );return _gcd ,nil ;};

// TempDir creates a name for a new temp directory using a pattern argument
func (_ca *memStorage )TempDir (pattern string )(string ,error ){return _cge (pattern ),nil };type memFile struct{_ag *memDataCell ;_ee int64 ;};
// Read reads from the underlying memDataCell in order to implement Reader interface
func (_gf *memFile )Read (p []byte )(int ,error ){_fg :=_gf ._cg ;_gb :=_gf ._d ._ac ;_ad :=int64 (len (p ));if _ad > _gb {_ad =_gb ;p =p [:_ad ];};if _fg >=_gb {return 0,_a .EOF ;};_fa :=_fg +_ad ;if _fa >=_gb {_fa =_gb ;};_ee :=copy (p ,_gf ._d ._ec [_fg :_fa ]);_gf ._cg =_fa ;return _ee ,nil ;};

// Write writes to the end of the underlying memDataCell in order to implement Writer interface
func (_gb *memFile )Write (p []byte )(int ,error ){_gb ._ag ._de =append (_gb ._ag ._de ,p ...);_gb ._ag ._bf +=int64 (len (p ));return len (p ),nil ;};
// RemoveAll removes all files according to the dir argument prefix
func (_aea *memStorage )RemoveAll (dir string )error {_aea ._egg .Range (func (_dc ,_cbf interface{})bool {_aea ._egg .Delete (_dc );return true });return nil ;};type memDataCell struct{_gc string ;_ec []byte ;_ac int64 ;};func _fb (_fbe string )string {_eef ,_ :=_cff (6);return _fbe +_eef };

// Close is not applicable in this implementation
func (_fe *memFile )Close ()error {return nil };
// Write writes to the end of the underlying memDataCell in order to implement Writer interface
func (_eg *memFile )Write (p []byte )(int ,error ){_eg ._d ._ec =append (_eg ._d ._ec ,p ...);_eg ._d ._ac +=int64 (len (p ));return len (p ),nil ;};

// Open returns tempstorage File object by name
func (_ac *memStorage )Open (path string )(_ea .File ,error ){_fef ,_ec :=_ac ._b .Load (path );if !_ec {return nil ,_df .New (_da .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 {_ag :_fef .(*memDataCell )},nil ;};
// SetAsStorage sets temp storage as a memory storage
func SetAsStorage (){_acg :=memStorage {_egg :_g .Map {}};_cb .SetAsStorage (&_acg )};

// RemoveAll removes all files according to the dir argument prefix
func (_agg *memStorage )RemoveAll (dir string )error {_agg ._b .Range (func (_gf ,_db interface{})bool {_agg ._b .Delete (_gf );return true });return nil ;};
// Close is not applicable in this implementation
func (_fe *memFile )Close ()error {return nil };type memStorage struct{_egg _g .Map };

// Name returns the filename of the underlying memDataCell
func (_cd *memFile )Name ()string {return _cd ._ag ._bc };

// Add reads a file from a disk and adds it to the storage
func (_cg *memStorage )Add (path string )error {_ ,_agf :=_cg ._b .Load (path );if _agf {return nil ;};_bg ,_dag :=_d .ReadFile (path );if _dag !=nil {return _dag ;};_cg ._b .Store (path ,&memDataCell {_bc :path ,_de :_bg ,_bf :int64 (len (_bg ))});return nil ;};
func (_bc *memFile )Name ()string {return _bc ._d ._gc };
26 changes: 13 additions & 13 deletions common/tempstorage/tempstorage.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 _dd "io";type storage interface{Open (_f string )(File ,error );TempFile (_e ,_dg string )(File ,error );TempDir (_a string )(string ,error );RemoveAll (_fc string )error ;Add (_c string )error ;};
package tempstorage ;import _c "io";

// Open returns tempstorage File object by name.
func Open (path string )(File ,error ){return _cd .Open (path )};
// TempFile creates new empty file in the storage and returns it.
func TempFile (dir ,pattern string )(File ,error ){return _fad .TempFile (dir ,pattern )};

// TempDir creates a name for a new temp directory using a pattern argument.
func TempDir (pattern string )(string ,error ){return _cd .TempDir (pattern )};
// Open returns tempstorage File object by name.
func Open (path string )(File ,error ){return _fad .Open (path )};

// File is a representation of a storage file
// with Read, Write, Close and Name methods identical to os.File.
type File interface{_dd .Reader ;_dd .Writer ;_dd .Closer ;Name ()string ;};var _cd storage ;

// SetAsStorage changes temporary storage to newStorage.
func SetAsStorage (newStorage storage ){_cd =newStorage };
type File interface{_c .Reader ;_c .Writer ;_c .Closer ;Name ()string ;};

// RemoveAll removes all files according to the dir argument prefix.
func RemoveAll (dir string )error {return _cd .RemoveAll (dir )};
func RemoveAll (dir string )error {return _fad .RemoveAll (dir )};

// Add reads a file from a disk and adds it to the storage.
func Add (path string )error {return _cd .Add (path )};
func Add (path string )error {return _fad .Add (path )};var _fad storage ;

// TempFile creates new empty file in the storage and returns it.
func TempFile (dir ,pattern string )(File ,error ){return _cd .TempFile (dir ,pattern )};
// SetAsStorage changes temporary storage to newStorage.
func SetAsStorage (newStorage storage ){_fad =newStorage };

// TempDir creates a name for a new temp directory using a pattern argument.
func TempDir (pattern string )(string ,error ){return _fad .TempDir (pattern )};type storage interface{Open (_fa string )(File ,error );TempFile (_cf ,_b string )(File ,error );TempDir (_a string )(string ,error );RemoveAll (_cfe string )error ;Add (_ad string )error ;};
Loading

0 comments on commit 61a4548

Please sign in to comment.