Skip to content

Commit

Permalink
Merge pull request unidoc#453 from unidoc-build/prep-rc-v1.13.0
Browse files Browse the repository at this point in the history
prepare release UniOffice v1.13.0
  • Loading branch information
gunnsth authored Jul 30, 2021
2 parents 73899c4 + a63348d commit 180c248
Show file tree
Hide file tree
Showing 50 changed files with 18,991 additions and 18,857 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 _c "strconv";
package algo ;import _d "strconv";func _gg (_f byte )bool {return _f >='0'&&_f <='9'};func RepeatString (s string ,cnt int )string {if cnt <=0{return "";};_bb :=make ([]byte ,len (s )*cnt );_dad :=[]byte (s );for _bbb :=0;_bbb < cnt ;_bbb ++{copy (_bb [_bbb :],_dad );};return string (_bb );};

// NaturalLess compares two strings in a human manner so rId2 sorts less than rId10
func NaturalLess (lhs ,rhs string )bool {_g ,_b :=0,0;for _g < len (lhs )&&_b < len (rhs ){_ga :=lhs [_g ];_ae :=rhs [_b ];_cb :=_f (_ga );_fe :=_f (_ae );switch {case _cb &&!_fe :return true ;case !_cb &&_fe :return false ;case !_cb &&!_fe :if _ga !=_ae {return _ga < _ae ;};_g ++;_b ++;default:_cd :=_g +1;_aeb :=_b +1;for _cd < len (lhs )&&_f (lhs [_cd ]){_cd ++;};for _aeb < len (rhs )&&_f (rhs [_aeb ]){_aeb ++;};_e ,_ :=_c .ParseUint (lhs [_g :_cd ],10,64);_da ,_ :=_c .ParseUint (rhs [_g :_aeb ],10,64);if _e !=_da {return _e < _da ;};_g =_cd ;_b =_aeb ;};};return len (lhs )< len (rhs );};func _f (_d byte )bool {return _d >='0'&&_d <='9'};func RepeatString (s string ,cnt int )string {if cnt <=0{return "";};_ea :=make ([]byte ,len (s )*cnt );_eg :=[]byte (s );for _ac :=0;_ac < cnt ;_ac ++{copy (_ea [_ac :],_eg );};return string (_ea );};
func NaturalLess (lhs ,rhs string )bool {_b ,_c :=0,0;for _b < len (lhs )&&_c < len (rhs ){_a :=lhs [_b ];_ad :=rhs [_c ];_e :=_gg (_a );_ed :=_gg (_ad );switch {case _e &&!_ed :return true ;case !_e &&_ed :return false ;case !_e &&!_ed :if _a !=_ad {return _a < _ad ;};_b ++;_c ++;default:_dd :=_b +1;_da :=_c +1;for _dd < len (lhs )&&_gg (lhs [_dd ]){_dd ++;};for _da < len (rhs )&&_gg (rhs [_da ]){_da ++;};_ce ,_ :=_d .ParseUint (lhs [_b :_dd ],10,64);_gf ,_ :=_d .ParseUint (rhs [_b :_da ],10,64);if _ce !=_gf {return _ce < _gf ;};_b =_dd ;_c =_da ;};};return len (lhs )< len (rhs );};
666 changes: 333 additions & 333 deletions chart/chart.go

Large diffs are not rendered by default.

24 changes: 12 additions & 12 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.

36 changes: 18 additions & 18 deletions common/license/license.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 _fc "github.com/unidoc/unioffice/internal/license";
package license ;import _f "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 _fc .SetMeteredKey (apiKey )};
// SetLicenseKey sets and validates the license key.
func SetLicenseKey (content string ,customerName string )error {return _f .SetLicenseKey (content ,customerName );};

// GetLicenseKey returns the currently loaded license key.
func GetLicenseKey ()*LicenseKey {return _fc .GetLicenseKey ()};
func GetLicenseKey ()*LicenseKey {return _f .GetLicenseKey ()};

// SetLegacyLicenseKey installs a legacy license code. License codes issued prior to June 2019.
// Will be removed at some point in a future major version.
func SetLegacyLicenseKey (s string )error {return _fc .SetLegacyLicenseKey (s )};
// LegacyLicense holds the old-style unioffice license information.
type LegacyLicense =_f .LegacyLicense ;

// MakeUnlicensedKey returns a default key.
func MakeUnlicensedKey ()*LicenseKey {return _fc .MakeUnlicensedKey ()};
func MakeUnlicensedKey ()*LicenseKey {return _f .MakeUnlicensedKey ()};

// SetLicenseKey sets and validates the license key.
func SetLicenseKey (content string ,customerName string )error {return _fc .SetLicenseKey (content ,customerName );};
// SetLegacyLicenseKey installs a legacy license code. License codes issued prior to June 2019.
// Will be removed at some point in a future major version.
func SetLegacyLicenseKey (s string )error {return _f .SetLegacyLicenseKey (s )};const (LicenseTierUnlicensed =_f .LicenseTierUnlicensed ;LicenseTierCommunity =_f .LicenseTierCommunity ;LicenseTierIndividual =_f .LicenseTierIndividual ;LicenseTierBusiness =_f .LicenseTierBusiness ;);

// SetMeteredKey sets the metered License API key required for SaaS operation.
// Document usage is reported periodically for the product to function correctly.
func SetMeteredKey (apiKey string )error {return _f .SetMeteredKey (apiKey )};

// LegacyLicenseType is the type of license
type LegacyLicenseType =_fc .LegacyLicenseType ;
type LegacyLicenseType =_f .LegacyLicenseType ;

// LegacyLicense holds the old-style unioffice license information.
type LegacyLicense =_fc .LegacyLicense ;
// LicenseKey represents a loaded license key.
type LicenseKey =_f .LicenseKey ;

// GetMeteredState checks the currently used metered document usage status,
// documents used and credits available.
func GetMeteredState ()(_fc .MeteredStatus ,error ){return _fc .GetMeteredState ()};

// LicenseKey represents a loaded license key.
type LicenseKey =_fc .LicenseKey ;const (LicenseTierUnlicensed =_fc .LicenseTierUnlicensed ;LicenseTierCommunity =_fc .LicenseTierCommunity ;LicenseTierIndividual =_fc .LicenseTierIndividual ;LicenseTierBusiness =_fc .LicenseTierBusiness ;);
func GetMeteredState ()(_f .MeteredStatus ,error ){return _f .GetMeteredState ()};
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 (_g "github.com/unidoc/unioffice/common/tempstorage";_e "io/ioutil";_c "os";_a "strings";);
package diskstore ;import (_de "github.com/unidoc/unioffice/common/tempstorage";_e "io/ioutil";_ec "os";_d "strings";);

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

// RemoveAll removes all files in the directory
func (_ee diskStorage )RemoveAll (dir string )error {if _a .HasPrefix (dir ,_c .TempDir ()){return _c .RemoveAll (dir );};return nil ;};
func (_a diskStorage )RemoveAll (dir string )error {if _d .HasPrefix (dir ,_ec .TempDir ()){return _ec .RemoveAll (dir );};return nil ;};

// SetAsStorage sets temp storage as a disk storage
func SetAsStorage (){_ca :=diskStorage {};_g .SetAsStorage (&_ca )};
// TempFile creates a new temp file by calling ioutil TempFile
func (_db diskStorage )TempFile (dir ,pattern string )(_de .File ,error ){return _e .TempFile (dir ,pattern );};

// Add is not applicable in the diskstore implementation
func (_d diskStorage )Add (path string )error {return nil };
// TempFile creates a new temp directory by calling ioutil TempDir
func (_df diskStorage )TempDir (pattern string )(string ,error ){return _e .TempDir ("",pattern )};type diskStorage struct{};

// Open opens file from disk according to a path
func (_af diskStorage )Open (path string )(_g .File ,error ){return _c .Open (path )};type diskStorage struct{};
func (_dc diskStorage )Open (path string )(_de .File ,error ){return _ec .Open (path )};

// TempFile creates a new temp file by calling ioutil TempFile
func (_cg diskStorage )TempFile (dir ,pattern string )(_g .File ,error ){return _e .TempFile (dir ,pattern );};
// Add is not applicable in the diskstore implementation
func (_c diskStorage )Add (path string )error {return nil };
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 (_be "encoding/hex";_a "errors";_fe "fmt";_ad "github.com/unidoc/unioffice/common/tempstorage";_bf "io";_d "io/ioutil";_f "math/rand";_g "sync";);func _gd (_gbf string )string {_dg ,_ :=_dbcg (6);return _gbf +_dg };

// Name returns the filename of the underlying memDataCell
func (_febe *memFile )Name ()string {return _febe ._ae ._ba };
package memstore ;import (_d "encoding/hex";_gf "errors";_c "fmt";_a "github.com/unidoc/unioffice/common/tempstorage";_f "io";_gd "io/ioutil";_g "math/rand";_b "sync";);

// Close is not applicable in this implementation
func (_e *memFile )Close ()error {return nil };

// TempFile creates a new empty file in the storage and returns it
func (_dc *memStorage )TempFile (dir ,pattern string )(_ad .File ,error ){_ag :=dir +"\u002f"+_gd (pattern );_cg :=&memDataCell {_ba :_ag ,_gf :[]byte {}};_df :=&memFile {_ae :_cg };_dc ._dbc .Store (_ag ,_cg );return _df ,nil ;};
func (_bdf *memFile )Close ()error {return nil };func _ceb (_ffe int )(string ,error ){_eca :=make ([]byte ,_ffe );if _ ,_ga :=_g .Read (_eca );_ga !=nil {return "",_ga ;};return _d .EncodeToString (_eca ),nil ;};type memFile struct{_cd *memDataCell ;_bd int64 ;};

// TempDir creates a name for a new temp directory using a pattern argument
func (_bdc *memStorage )TempDir (pattern string )(string ,error ){return _gd (pattern ),nil };
func (_adc *memStorage )TempDir (pattern string )(string ,error ){return _cb (pattern ),nil };type memDataCell struct{_ee string ;_cg []byte ;_ea int64 ;};

// SetAsStorage sets temp storage as a memory storage
func SetAsStorage (){_cc :=memStorage {_dbc :_g .Map {}};_ad .SetAsStorage (&_cc )};

// Write writes to the end of the underlying memDataCell in order to implement Writer interface
func (_fb *memFile )Write (p []byte )(int ,error ){_fb ._ae ._gf =append (_fb ._ae ._gf ,p ...);_fb ._ae ._ab +=int64 (len (p ));return len (p ),nil ;};type memFile struct{_ae *memDataCell ;_ade int64 ;};
// RemoveAll removes all files according to the dir argument prefix
func (_fba *memStorage )RemoveAll (dir string )error {_fba ._bb .Range (func (_bfc ,_ec interface{})bool {_fba ._bb .Delete (_bfc );return true });return nil ;};func _cb (_ab string )string {_gc ,_ :=_ceb (6);return _ab +_gc };

// Open returns tempstorage File object by name
func (_ca *memStorage )Open (path string )(_ad .File ,error ){_eg ,_bdb :=_ca ._dbc .Load (path );if !_bdb {return nil ,_a .New (_fe .Sprintf ("\u0043\u0061\u006eno\u0074\u0020\u006f\u0070\u0065\u006e\u0020\u0074\u0068\u0065\u0020\u0066\u0069\u006c\u0065\u0020\u0025\u0073",path ));};return &memFile {_ae :_eg .(*memDataCell )},nil ;};

// RemoveAll removes all files according to the dir argument prefix
func (_adb *memStorage )RemoveAll (dir string )error {_adb ._dbc .Range (func (_gb ,_dfc interface{})bool {_adb ._dbc .Delete (_gb );return true });return nil ;};func _dbcg (_ee int )(string ,error ){_fea :=make ([]byte ,_ee );if _ ,_ea :=_f .Read (_fea );_ea !=nil {return "",_ea ;};return _be .EncodeToString (_fea ),nil ;};type memStorage struct{_dbc _g .Map };type memDataCell struct{_ba string ;_gf []byte ;_ab int64 ;};
func (_af *memStorage )Open (path string )(_a .File ,error ){_deec ,_fb :=_af ._bb .Load (path );if !_fb {return nil ,_gf .New (_c .Sprintf ("\u0043\u0061\u006eno\u0074\u0020\u006f\u0070\u0065\u006e\u0020\u0074\u0068\u0065\u0020\u0066\u0069\u006c\u0065\u0020\u0025\u0073",path ));};return &memFile {_cd :_deec .(*memDataCell )},nil ;};

// Add reads a file from a disk and adds it to the storage
func (_bfa *memStorage )Add (path string )error {_ ,_dfd :=_bfa ._dbc .Load (path );if _dfd {return nil ;};_beg ,_bg :=_d .ReadFile (path );if _bg !=nil {return _bg ;};_bfa ._dbc .Store (path ,&memDataCell {_ba :path ,_gf :_beg ,_ab :int64 (len (_beg ))});return nil ;};
func (_fg *memStorage )Add (path string )error {_ ,_ag :=_fg ._bb .Load (path );if _ag {return nil ;};_cdd ,_fe :=_gd .ReadFile (path );if _fe !=nil {return _fe ;};_fg ._bb .Store (path ,&memDataCell {_ee :path ,_cg :_cdd ,_ea :int64 (len (_cdd ))});return nil ;};

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

// Write writes to the end of the underlying memDataCell in order to implement Writer interface
func (_ca *memFile )Write (p []byte )(int ,error ){_ca ._cd ._cg =append (_ca ._cd ._cg ,p ...);_ca ._cd ._ea +=int64 (len (p ));return len (p ),nil ;};

// Read reads from the underlying memDataCell in order to implement Reader interface
func (_fef *memFile )Read (p []byte )(int ,error ){_de :=_fef ._ade ;_feb :=_fef ._ae ._ab ;_c :=int64 (len (p ));if _c > _feb {_c =_feb ;p =p [:_c ];};if _de >=_feb {return 0,_bf .EOF ;};_bd :=_de +_c ;if _bd >=_feb {_bd =_feb ;};_db :=copy (p ,_fef ._ae ._gf [_de :_bd ]);_fef ._ade =_bd ;return _db ,nil ;};
func (_gfe *memFile )Read (p []byte )(int ,error ){_gfg :=_gfe ._bd ;_de :=_gfe ._cd ._ea ;_eg :=int64 (len (p ));if _eg > _de {_eg =_de ;p =p [:_eg ];};if _gfg >=_de {return 0,_f .EOF ;};_bf :=_gfg +_eg ;if _bf >=_de {_bf =_de ;};_dee :=copy (p ,_gfe ._cd ._cg [_gfg :_bf ]);_gfe ._bd =_bf ;return _dee ,nil ;};

// SetAsStorage sets temp storage as a memory storage
func SetAsStorage (){_eb :=memStorage {_bb :_b .Map {}};_a .SetAsStorage (&_eb )};type memStorage struct{_bb _b .Map };

// TempFile creates a new empty file in the storage and returns it
func (_ad *memStorage )TempFile (dir ,pattern string )(_a .File ,error ){_ae :=dir +"\u002f"+_cb (pattern );_dg :=&memDataCell {_ee :_ae ,_cg :[]byte {}};_ff :=&memFile {_cd :_dg };_ad ._bb .Store (_ae ,_dg );return _ff ,nil ;};
20 changes: 10 additions & 10 deletions common/tempstorage/tempstorage.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,24 @@

package tempstorage ;import _g "io";

// TempDir creates a name for a new temp directory using a pattern argument.
func TempDir (pattern string )(string ,error ){return _a .TempDir (pattern )};type storage interface{Open (_d string )(File ,error );TempFile (_dg ,_da string )(File ,error );TempDir (_df string )(string ,error );RemoveAll (_ce string )error ;Add (_f string )error ;};

// TempFile creates new empty file in the storage and returns it.
func TempFile (dir ,pattern string )(File ,error ){return _a .TempFile (dir ,pattern )};

// SetAsStorage changes temporary storage to newStorage.
func SetAsStorage (newStorage storage ){_a =newStorage };
func SetAsStorage (newStorage storage ){_a =newStorage };var _a storage ;

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

// TempDir creates a name for a new temp directory using a pattern argument.
func TempDir (pattern string )(string ,error ){return _a .TempDir (pattern )};type storage interface{Open (_gb string )(File ,error );TempFile (_d ,_c string )(File ,error );TempDir (_de string )(string ,error );RemoveAll (_gf string )error ;Add (_cf string )error ;};

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

// Add reads a file from a disk and adds it to the storage.
func Add (path string )error {return _a .Add (path )};
type File interface{_g .Reader ;_g .Writer ;_g .Closer ;Name ()string ;};

// Open returns tempstorage File object by name.
func Open (path string )(File ,error ){return _a .Open (path )};

// TempFile creates new empty file in the storage and returns it.
func TempFile (dir ,pattern string )(File ,error ){return _a .TempFile (dir ,pattern )};
// Add reads a file from a disk and adds it to the storage.
func Add (path string )error {return _a .Add (path )};
16 changes: 14 additions & 2 deletions document/convert/convert.go

Large diffs are not rendered by default.

Loading

0 comments on commit 180c248

Please sign in to comment.