Skip to content

Commit

Permalink
Merge pull request #514 from unidoc-build/prep-rc-v1.33.0
Browse files Browse the repository at this point in the history
Release v1.33.0
  • Loading branch information
gunnsth authored May 22, 2024
2 parents 1945334 + 5cff472 commit e353c17
Show file tree
Hide file tree
Showing 60 changed files with 57,354 additions and 57,326 deletions.
10 changes: 5 additions & 5 deletions algo/algo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 algo ;import _c "strconv";func _f (_g byte )bool {return _g >='0'&&_g <='9'};func RepeatString (s string ,cnt int )string {if cnt <=0{return "";};_bc :=make ([]byte ,len (s )*cnt );_bd :=[]byte (s );for _a :=0;_a < cnt ;_a ++{copy (_bc [_a :],_bd );
};return string (_bc );};
package algo ;import _a "strconv";

// NaturalLess compares two strings in a human manner so rId2 sorts less than rId10
func NaturalLess (lhs ,rhs string )bool {_ge ,_bg :=0,0;for _ge < len (lhs )&&_bg < len (rhs ){_e :=lhs [_ge ];_bb :=rhs [_bg ];_fa :=_f (_e );_d :=_f (_bb );switch {case _fa &&!_d :return true ;case !_fa &&_d :return false ;case !_fa &&!_d :if _e !=_bb {return _e < _bb ;
};_ge ++;_bg ++;default:_ff :=_ge +1;_bgf :=_bg +1;for _ff < len (lhs )&&_f (lhs [_ff ]){_ff ++;};for _bgf < len (rhs )&&_f (rhs [_bgf ]){_bgf ++;};_fd ,_ :=_c .ParseUint (lhs [_ge :_ff ],10,64);_ba ,_ :=_c .ParseUint (rhs [_ge :_bgf ],10,64);if _fd !=_ba {return _fd < _ba ;
};_ge =_ff ;_bg =_bgf ;};};return len (lhs )< len (rhs );};
func NaturalLess (lhs ,rhs string )bool {_cf ,_aa :=0,0;for _cf < len (lhs )&&_aa < len (rhs ){_f :=lhs [_cf ];_b :=rhs [_aa ];_fe :=_c (_f );_fg :=_c (_b );switch {case _fe &&!_fg :return true ;case !_fe &&_fg :return false ;case !_fe &&!_fg :if _f !=_b {return _f < _b ;
};_cf ++;_aa ++;default:_dg :=_cf +1;_ce :=_aa +1;for _dg < len (lhs )&&_c (lhs [_dg ]){_dg ++;};for _ce < len (rhs )&&_c (rhs [_ce ]){_ce ++;};_ba ,_ :=_a .ParseUint (lhs [_cf :_dg ],10,64);_e ,_ :=_a .ParseUint (rhs [_cf :_ce ],10,64);if _ba !=_e {return _ba < _e ;
};_cf =_dg ;_aa =_ce ;};};return len (lhs )< len (rhs );};func _c (_g byte )bool {return _g >='0'&&_g <='9'};func RepeatString (s string ,cnt int )string {if cnt <=0{return "";};_ec :=make ([]byte ,len (s )*cnt );_fgc :=[]byte (s );for _gc :=0;_gc < cnt ;
_gc ++{copy (_ec [_gc :],_fgc );};return string (_ec );};
884 changes: 441 additions & 443 deletions chart/chart.go

Large diffs are not rendered by default.

79 changes: 39 additions & 40 deletions color/color.go

Large diffs are not rendered by default.

709 changes: 354 additions & 355 deletions common/axcontrol/axcontrol.go

Large diffs are not rendered by default.

719 changes: 360 additions & 359 deletions common/common.go

Large diffs are not rendered by default.

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

// Package license helps manage commercial licenses and check if they
// are valid for the version of UniOffice used.
package license ;import _a "github.com/unidoc/unioffice/internal/license";
package license ;import _e "github.com/unidoc/unioffice/internal/license";

// SetLicenseKey sets and validates the license key.
func SetLicenseKey (content string ,customerName string )error {return _e .SetLicenseKey (content ,customerName );};

// MakeUnlicensedKey returns a default key.
func MakeUnlicensedKey ()*LicenseKey {return _a .MakeUnlicensedKey ()};const (LicenseTierUnlicensed =_a .LicenseTierUnlicensed ;LicenseTierCommunity =_a .LicenseTierCommunity ;LicenseTierIndividual =_a .LicenseTierIndividual ;LicenseTierBusiness =_a .LicenseTierBusiness ;
func MakeUnlicensedKey ()*LicenseKey {return _e .MakeUnlicensedKey ()};const (LicenseTierUnlicensed =_e .LicenseTierUnlicensed ;LicenseTierCommunity =_e .LicenseTierCommunity ;LicenseTierIndividual =_e .LicenseTierIndividual ;LicenseTierBusiness =_e .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 _a .SetMeteredKey (apiKey )};

// SetLegacyLicenseKey installs a legacy license code. License codes issued prior to June 2019.
// Will be removed at some point in a future major version.
func SetLegacyLicenseKey (s string )error {return _a .SetLegacyLicenseKey (s )};

// SetLicenseKey sets and validates the license key.
func SetLicenseKey (content string ,customerName string )error {return _a .SetLicenseKey (content ,customerName );};
// GetLicenseKey returns the currently loaded license key.
func GetLicenseKey ()*LicenseKey {return _e .GetLicenseKey ()};

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

// SetMeteredKeyPersistentCache sets the metered License API Key persistent cache.
// Default value `true`, set to `false` will report the usage immediately to license server,
// this can be used when there's no access to persistent data storage.
func SetMeteredKeyPersistentCache (val bool ){_a .SetMeteredKeyPersistentCache (val )};
func SetMeteredKeyPersistentCache (val bool ){_e .SetMeteredKeyPersistentCache (val )};

// LegacyLicenseType is the type of license
type LegacyLicenseType =_a .LegacyLicenseType ;
// LicenseKey represents a loaded license key.
type LicenseKey =_e .LicenseKey ;

// LegacyLicense holds the old-style unioffice license information.
type LegacyLicense =_a .LegacyLicense ;
// SetMeteredKey sets the metered License API key required for SaaS operation.
// Document usage is reported periodically for the product to function correctly.
func SetMeteredKey (apiKey string )error {return _e .SetMeteredKey (apiKey )};

// SetLegacyLicenseKey installs a legacy license code. License codes issued prior to June 2019.
// Will be removed at some point in a future major version.
func SetLegacyLicenseKey (s string )error {return _e .SetLegacyLicenseKey (s )};

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

// GetLicenseKey returns the currently loaded license key.
func GetLicenseKey ()*LicenseKey {return _a .GetLicenseKey ()};
// LegacyLicenseType is the type of license
type LegacyLicenseType =_e .LegacyLicenseType ;
116 changes: 59 additions & 57 deletions common/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,96 +9,98 @@
// 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 (_f "fmt";_c "io";_fc "os";_b "path/filepath";_ff "runtime";);

// LogLevel is the verbosity level for logging.
type LogLevel int ;
package logger ;import (_f "fmt";_dg "io";_c "os";_d "path/filepath";_a "runtime";);

// WriterLogger is the logger that writes data to the Output writer
type WriterLogger struct{LogLevel LogLevel ;Output _c .Writer ;};func (_cf ConsoleLogger )output (_ad _c .Writer ,_dbf string ,_bc string ,_aabc ...interface{}){_gag (_ad ,_dbf ,_bc ,_aabc ...);};
type WriterLogger struct{LogLevel LogLevel ;Output _dg .Writer ;};

// Warning logs warning message.
func (_ae ConsoleLogger )Warning (format string ,args ...interface{}){if _ae .LogLevel >=LogLevelWarning {_ac :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_ae .output (_fc .Stdout ,_ac ,format ,args ...);};};
func (_ccc WriterLogger )Warning (format string ,args ...interface{}){if _ccc .LogLevel >=LogLevelWarning {_gdea :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_ccc .logToWriter (_ccc .Output ,_gdea ,format ,args ...);};};var Log Logger =DummyLogger {};

// Warning does nothing for dummy logger.
func (DummyLogger )Warning (format string ,args ...interface{}){};

// Info logs info message.
func (_ba ConsoleLogger )Info (format string ,args ...interface{}){if _ba .LogLevel >=LogLevelInfo {_bae :="\u005bI\u004e\u0046\u004f\u005d\u0020";_ba .output (_fc .Stdout ,_bae ,format ,args ...);};};func _gag (_cef _c .Writer ,_ag string ,_bb string ,_cag ...interface{}){_ ,_ccf ,_abg ,_aga :=_ff .Caller (3);
if !_aga {_ccf ="\u003f\u003f\u003f";_abg =0;}else {_ccf =_b .Base (_ccf );};_abga :=_f .Sprintf ("\u0025s\u0020\u0025\u0073\u003a\u0025\u0064 ",_ag ,_ccf ,_abg )+_bb +"\u000a";_f .Fprintf (_cef ,_abga ,_cag ...);};
// Error logs error message.
func (_adb WriterLogger )Error (format string ,args ...interface{}){if _adb .LogLevel >=LogLevelError {_be :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_adb .logToWriter (_adb .Output ,_be ,format ,args ...);};};func (_fg WriterLogger )logToWriter (_gfc _dg .Writer ,_cd string ,_fa string ,_ecd ...interface{}){_dag (_gfc ,_cd ,_fa ,_ecd );
};

// Notice logs notice message.
func (_gg ConsoleLogger )Notice (format string ,args ...interface{}){if _gg .LogLevel >=LogLevelNotice {_gc :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_gg .output (_fc .Stdout ,_gc ,format ,args ...);};};
// Warning logs warning message.
func (_gb ConsoleLogger )Warning (format string ,args ...interface{}){if _gb .LogLevel >=LogLevelWarning {_gf :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_gb .output (_c .Stdout ,_gf ,format ,args ...);};};

// NewConsoleLogger creates new console logger.
func NewConsoleLogger (logLevel LogLevel )*ConsoleLogger {return &ConsoleLogger {LogLevel :logLevel }};
// IsLogLevel returns true if log level is greater or equal than `level`.
// Can be used to avoid resource intensive calls to loggers.
func (_bd WriterLogger )IsLogLevel (level LogLevel )bool {return _bd .LogLevel >=level };

// Error does nothing for dummy logger.
func (DummyLogger )Error (format string ,args ...interface{}){};

// IsLogLevel returns true from dummy logger.
func (DummyLogger )IsLogLevel (level LogLevel )bool {return true };var Log Logger =DummyLogger {};
func (DummyLogger )IsLogLevel (level LogLevel )bool {return true };

// DummyLogger does nothing.
type DummyLogger struct{};const (LogLevelTrace LogLevel =5;LogLevelDebug LogLevel =4;LogLevelInfo LogLevel =3;LogLevelNotice LogLevel =2;LogLevelWarning LogLevel =1;LogLevelError LogLevel =0;);
// Info logs info message.
func (_cg WriterLogger )Info (format string ,args ...interface{}){if _cg .LogLevel >=LogLevelInfo {_dfd :="\u005bI\u004e\u0046\u004f\u005d\u0020";_cg .logToWriter (_cg .Output ,_dfd ,format ,args ...);};};

// Trace logs trace message.
func (_aab ConsoleLogger )Trace (format string ,args ...interface{}){if _aab .LogLevel >=LogLevelTrace {_gac :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_aab .output (_fc .Stdout ,_gac ,format ,args ...);};};
// Debug does nothing for dummy logger.
func (DummyLogger )Debug (format string ,args ...interface{}){};

// Debug logs debug message.
func (_aa ConsoleLogger )Debug (format string ,args ...interface{}){if _aa .LogLevel >=LogLevelDebug {_bd :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_aa .output (_fc .Stdout ,_bd ,format ,args ...);};};
// Trace logs trace message.
func (_dba ConsoleLogger )Trace (format string ,args ...interface{}){if _dba .LogLevel >=LogLevelTrace {_gde :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_dba .output (_c .Stdout ,_gde ,format ,args ...);};};const (LogLevelTrace LogLevel =5;LogLevelDebug LogLevel =4;
LogLevelInfo LogLevel =3;LogLevelNotice LogLevel =2;LogLevelWarning LogLevel =1;LogLevelError LogLevel =0;);

// ConsoleLogger is a logger that writes logs to the 'os.Stdout'
type ConsoleLogger struct{LogLevel LogLevel ;};
// Trace logs trace message.
func (_ac WriterLogger )Trace (format string ,args ...interface{}){if _ac .LogLevel >=LogLevelTrace {_dcbg :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_ac .logToWriter (_ac .Output ,_dcbg ,format ,args ...);};};

// Notice logs notice message.
func (_eec WriterLogger )Notice (format string ,args ...interface{}){if _eec .LogLevel >=LogLevelNotice {_bf :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_eec .logToWriter (_eec .Output ,_bf ,format ,args ...);};};
func (_gdg WriterLogger )Notice (format string ,args ...interface{}){if _gdg .LogLevel >=LogLevelNotice {_ff :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_gdg .logToWriter (_gdg .Output ,_ff ,format ,args ...);};};

// Trace logs trace message.
func (_ffg WriterLogger )Trace (format string ,args ...interface{}){if _ffg .LogLevel >=LogLevelTrace {_ea :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_ffg .logToWriter (_ffg .Output ,_ea ,format ,args ...);};};
// NewConsoleLogger creates new console logger.
func NewConsoleLogger (logLevel LogLevel )*ConsoleLogger {return &ConsoleLogger {LogLevel :logLevel }};

// Error logs error message.
func (_ccc ConsoleLogger )Error (format string ,args ...interface{}){if _ccc .LogLevel >=LogLevelError {_ec :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_ccc .output (_fc .Stdout ,_ec ,format ,args ...);};};
// Warning does nothing for dummy logger.
func (DummyLogger )Warning (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 (_ga ConsoleLogger )IsLogLevel (level LogLevel )bool {return _ga .LogLevel >=level };
// ConsoleLogger is a logger that writes logs to the 'os.Stdout'
type ConsoleLogger struct{LogLevel LogLevel ;};

// Error logs error message.
func (_gce WriterLogger )Error (format string ,args ...interface{}){if _gce .LogLevel >=LogLevelError {_gef :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_gce .logToWriter (_gce .Output ,_gef ,format ,args ...);};};func (_cb WriterLogger )logToWriter (_fce _c .Writer ,_gge string ,_de string ,_gaf ...interface{}){_gag (_fce ,_gge ,_de ,_gaf );
};
// DummyLogger does nothing.
type DummyLogger struct{};

// IsLogLevel returns true if log level is greater or equal than `level`.
// Can be used to avoid resource intensive calls to loggers.
func (_ge WriterLogger )IsLogLevel (level LogLevel )bool {return _ge .LogLevel >=level };
// Info logs info message.
func (_dcb ConsoleLogger )Info (format string ,args ...interface{}){if _dcb .LogLevel >=LogLevelInfo {_cee :="\u005bI\u004e\u0046\u004f\u005d\u0020";_dcb .output (_c .Stdout ,_cee ,format ,args ...);};};

// SetLogger sets 'logger' to be used by the unidoc unipdf library.
func SetLogger (logger Logger ){Log =logger };
// Debug logs debug message.
func (_db ConsoleLogger )Debug (format string ,args ...interface{}){if _db .LogLevel >=LogLevelDebug {_cb :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_db .output (_c .Stdout ,_cb ,format ,args ...);};};

// Notice does nothing for dummy logger.
func (DummyLogger )Notice (format string ,args ...interface{}){};

// Logger is the interface used for logging in the unipdf package.
type Logger interface{Error (_be string ,_e ...interface{});Warning (_a string ,_ee ...interface{});Notice (_eb string ,_ab ...interface{});Info (_cc string ,_dg ...interface{});Debug (_ce string ,_db ...interface{});Trace (_ef string ,_cg ...interface{});
IsLogLevel (_g LogLevel )bool ;};
// NewWriterLogger creates new 'writer' logger.
func NewWriterLogger (logLevel LogLevel ,writer _dg .Writer )*WriterLogger {logger :=WriterLogger {Output :writer ,LogLevel :logLevel };return &logger ;};

// Debug logs debug message.
func (_ebc WriterLogger )Debug (format string ,args ...interface{}){if _ebc .LogLevel >=LogLevelDebug {_ed :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_ebc .logToWriter (_ebc .Output ,_ed ,format ,args ...);};};
func (_afe WriterLogger )Debug (format string ,args ...interface{}){if _afe .LogLevel >=LogLevelDebug {_dac :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_afe .logToWriter (_afe .Output ,_dac ,format ,args ...);};};

// Error does nothing for dummy logger.
func (DummyLogger )Error (format string ,args ...interface{}){};
// LogLevel is the verbosity level for logging.
type LogLevel int ;

// Warning logs warning message.
func (_ca WriterLogger )Warning (format string ,args ...interface{}){if _ca .LogLevel >=LogLevelWarning {_aaf :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_ca .logToWriter (_ca .Output ,_aaf ,format ,args ...);};};
// Error logs error message.
func (_ed ConsoleLogger )Error (format string ,args ...interface{}){if _ed .LogLevel >=LogLevelError {_g :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_ed .output (_c .Stdout ,_g ,format ,args ...);};};

// Debug does nothing for dummy logger.
func (DummyLogger )Debug (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 (_fc ConsoleLogger )IsLogLevel (level LogLevel )bool {return _fc .LogLevel >=level };

// NewWriterLogger creates new 'writer' logger.
func NewWriterLogger (logLevel LogLevel ,writer _c .Writer )*WriterLogger {logger :=WriterLogger {Output :writer ,LogLevel :logLevel };return &logger ;};
// Info does nothing for dummy logger.
func (DummyLogger )Info (format string ,args ...interface{}){};

// Logger is the interface used for logging in the unipdf package.
type Logger interface{Error (_bg string ,_dc ...interface{});Warning (_df string ,_ag ...interface{});Notice (_agc string ,_ce ...interface{});Info (_fe string ,_dgd ...interface{});Debug (_fb string ,_af ...interface{});Trace (_da string ,_cef ...interface{});
IsLogLevel (_e LogLevel )bool ;};func _dag (_fd _dg .Writer ,_fgb string ,_de string ,_ab ...interface{}){_ ,_bgg ,_cf ,_ef :=_a .Caller (3);if !_ef {_bgg ="\u003f\u003f\u003f";_cf =0;}else {_bgg =_d .Base (_bgg );};_beg :=_f .Sprintf ("\u0025s\u0020\u0025\u0073\u003a\u0025\u0064 ",_fgb ,_bgg ,_cf )+_de +"\u000a";
_f .Fprintf (_fd ,_beg ,_ab ...);};

// Trace does nothing for dummy logger.
func (DummyLogger )Trace (format string ,args ...interface{}){};
func (DummyLogger )Trace (format string ,args ...interface{}){};func (_aa ConsoleLogger )output (_ec _dg .Writer ,_ebg string ,_cc string ,_ad ...interface{}){_dag (_ec ,_ebg ,_cc ,_ad ...);};

// Info does nothing for dummy logger.
func (DummyLogger )Info (format string ,args ...interface{}){};
// Notice logs notice message.
func (_eb ConsoleLogger )Notice (format string ,args ...interface{}){if _eb .LogLevel >=LogLevelNotice {_gd :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_eb .output (_c .Stdout ,_gd ,format ,args ...);};};

// Info logs info message.
func (_fg WriterLogger )Info (format string ,args ...interface{}){if _fg .LogLevel >=LogLevelInfo {_bea :="\u005bI\u004e\u0046\u004f\u005d\u0020";_fg .logToWriter (_fg .Output ,_bea ,format ,args ...);};};
// SetLogger sets 'logger' to be used by the unidoc unipdf library.
func SetLogger (logger Logger ){Log =logger };
Loading

0 comments on commit e353c17

Please sign in to comment.