Skip to content

Commit

Permalink
Merge pull request #523 from unidoc-build/prep-rc-v1.37.0
Browse files Browse the repository at this point in the history
Release v1.37.0
  • Loading branch information
gunnsth authored Oct 18, 2024
2 parents 4a77b86 + 379fdc7 commit 37c77fc
Show file tree
Hide file tree
Showing 66 changed files with 58,865 additions and 58,812 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 _e "strconv";
package algo ;import _fe "strconv";func RepeatString (s string ,cnt int )string {if cnt <=0{return "";};_c :=make ([]byte ,len (s )*cnt );_ef :=[]byte (s );for _gc :=0;_gc < cnt ;_gc ++{copy (_c [_gc :],_ef );};return string (_c );};func _e (_fa byte )bool {return _fa >='0'&&_fa <='9'};


// NaturalLess compares two strings in a human manner so rId2 sorts less than rId10
func NaturalLess (lhs ,rhs string )bool {_cea ,_b :=0,0;for _cea < len (lhs )&&_b < len (rhs ){_f :=lhs [_cea ];_gf :=rhs [_b ];_cf :=_g (_f );_ced :=_g (_gf );switch {case _cf &&!_ced :return true ;case !_cf &&_ced :return false ;case !_cf &&!_ced :if _f !=_gf {return _f < _gf ;
};_cea ++;_b ++;default:_cc :=_cea +1;_bd :=_b +1;for _cc < len (lhs )&&_g (lhs [_cc ]){_cc ++;};for _bd < len (rhs )&&_g (rhs [_bd ]){_bd ++;};_a ,_ :=_e .ParseUint (lhs [_cea :_cc ],10,64);_fd ,_ :=_e .ParseUint (rhs [_cea :_bd ],10,64);if _a !=_fd {return _a < _fd ;
};_cea =_cc ;_b =_bd ;};};return len (lhs )< len (rhs );};func RepeatString (s string ,cnt int )string {if cnt <=0{return "";};_bdg :=make ([]byte ,len (s )*cnt );_d :=[]byte (s );for _ceac :=0;_ceac < cnt ;_ceac ++{copy (_bdg [_ceac :],_d );};return string (_bdg );
};func _g (_ce byte )bool {return _ce >='0'&&_ce <='9'};
func NaturalLess (lhs ,rhs string )bool {_d ,_fg :=0,0;for _d < len (lhs )&&_fg < len (rhs ){_g :=lhs [_d ];_ff :=rhs [_fg ];_eb :=_e (_g );_a :=_e (_ff );switch {case _eb &&!_a :return true ;case !_eb &&_a :return false ;case !_eb &&!_a :if _g !=_ff {return _g < _ff ;
};_d ++;_fg ++;default:_ea :=_d +1;_fga :=_fg +1;for _ea < len (lhs )&&_e (lhs [_ea ]){_ea ++;};for _fga < len (rhs )&&_e (rhs [_fga ]){_fga ++;};_eag ,_ :=_fe .ParseUint (lhs [_d :_ea ],10,64);_ge ,_ :=_fe .ParseUint (rhs [_d :_fga ],10,64);if _eag !=_ge {return _eag < _ge ;
};_d =_ea ;_fg =_fga ;};};return len (lhs )< len (rhs );};
881 changes: 442 additions & 439 deletions chart/chart.go

Large diffs are not rendered by default.

73 changes: 36 additions & 37 deletions color/color.go

Large diffs are not rendered by default.

707 changes: 356 additions & 351 deletions common/axcontrol/axcontrol.go

Large diffs are not rendered by default.

713 changes: 358 additions & 355 deletions common/common.go

Large diffs are not rendered by default.

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

// Package license helps manage commercial licenses and check if they
// are valid for the version of UniOffice used.
package license ;import _b "github.com/unidoc/unioffice/internal/license";
package license ;import _ge "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 _b .SetMeteredKey (apiKey )};
// GetMeteredState checks the currently used metered document usage status,
// documents used and credits available.
func GetMeteredState ()(_ge .MeteredStatus ,error ){return _ge .GetMeteredState ()};

// SetMeteredKeyUsageLogVerboseMode sets the metered License API Key usage log verbose mode.
// Default value `false`, set to `true` will log the credit usages and print out to console with log level INFO.
func SetMeteredKeyUsageLogVerboseMode (val bool ){_b .SetMeteredKeyUsageLogVerboseMode (val )};
// LegacyLicense holds the old-style unioffice license information.
type LegacyLicense =_ge .LegacyLicense ;

// LegacyLicenseType is the type of license
type LegacyLicenseType =_b .LegacyLicenseType ;
type LegacyLicenseType =_ge .LegacyLicenseType ;

// 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 ){_b .SetMeteredKeyPersistentCache (val )};
// 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 _ge .SetLegacyLicenseKey (s )};

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

// LicenseKey represents a loaded license key.
type LicenseKey =_b .LicenseKey ;
type LicenseKey =_ge .LicenseKey ;

// GetMeteredState checks the currently used metered document usage status,
// documents used and credits available.
func GetMeteredState ()(_b .MeteredStatus ,error ){return _b .GetMeteredState ()};
// SetMeteredKeyUsageLogVerboseMode sets the metered License API Key usage log verbose mode.
// Default value `false`, set to `true` will log the credit usages and print out to console with log level INFO.
func SetMeteredKeyUsageLogVerboseMode (val bool ){_ge .SetMeteredKeyUsageLogVerboseMode (val )};

// LegacyLicense holds the old-style unioffice license information.
type LegacyLicense =_b .LegacyLicense ;
// SetLicenseKey sets and validates the license key.
func SetLicenseKey (content string ,customerName string )error {return _ge .SetLicenseKey (content ,customerName );};const (LicenseTierUnlicensed =_ge .LicenseTierUnlicensed ;LicenseTierCommunity =_ge .LicenseTierCommunity ;LicenseTierIndividual =_ge .LicenseTierIndividual ;
LicenseTierBusiness =_ge .LicenseTierBusiness ;);

// GetLicenseKey returns the currently loaded license key.
func GetLicenseKey ()*LicenseKey {return _b .GetLicenseKey ()};const (LicenseTierUnlicensed =_b .LicenseTierUnlicensed ;LicenseTierCommunity =_b .LicenseTierCommunity ;LicenseTierIndividual =_b .LicenseTierIndividual ;LicenseTierBusiness =_b .LicenseTierBusiness ;
);

// 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 _b .SetLegacyLicenseKey (s )};
func GetLicenseKey ()*LicenseKey {return _ge .GetLicenseKey ()};

// SetLicenseKey sets and validates the license key.
func SetLicenseKey (content string ,customerName string )error {return _b .SetLicenseKey (content ,customerName );};
// SetMeteredKey sets the metered License API key required for SaaS operation.
// Document usage is reported periodically for the product to function correctly.
func SetMeteredKey (apiKey string )error {return _ge .SetMeteredKey (apiKey )};

// MakeUnlicensedKey returns a default key.
func MakeUnlicensedKey ()*LicenseKey {return _b .MakeUnlicensedKey ()};
// 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 ){_ge .SetMeteredKeyPersistentCache (val )};
121 changes: 61 additions & 60 deletions common/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,96 +9,97 @@
// 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 (_e "fmt";_g "io";_aa "os";_ac "path/filepath";_a "runtime";);
package logger ;import (_a "fmt";_ae "io";_e "os";_c "path/filepath";_g "runtime";);

// NewConsoleLogger creates new console logger.
func NewConsoleLogger (logLevel LogLevel )*ConsoleLogger {return &ConsoleLogger {LogLevel :logLevel }};
// Trace does nothing for dummy logger.
func (DummyLogger )Trace (format string ,args ...interface{}){};

// Info logs info message.
func (_ee ConsoleLogger )Info (format string ,args ...interface{}){if _ee .LogLevel >=LogLevelInfo {_fa :="\u005bI\u004e\u0046\u004f\u005d\u0020";_ee .output (_aa .Stdout ,_fa ,format ,args ...);};};
// Debug logs debug message.
func (_bec ConsoleLogger )Debug (format string ,args ...interface{}){if _bec .LogLevel >=LogLevelDebug {_ab :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_bec .output (_e .Stdout ,_ab ,format ,args ...);};};

// 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 (_cab ConsoleLogger )IsLogLevel (level LogLevel )bool {return _cab .LogLevel >=level };var Log Logger =DummyLogger {};

// IsLogLevel returns true from dummy logger.
func (DummyLogger )IsLogLevel (level LogLevel )bool {return true };
// Logger is the interface used for logging in the unipdf package.
type Logger interface{Error (_ca string ,_aa ...interface{});Warning (_af string ,_ce ...interface{});Notice (_df string ,_cb ...interface{});Info (_gb string ,_ad ...interface{});Debug (_ea string ,_f ...interface{});Trace (_de string ,_b ...interface{});
IsLogLevel (_ed LogLevel )bool ;};

// Notice logs notice message.
func (_acc WriterLogger )Notice (format string ,args ...interface{}){if _acc .LogLevel >=LogLevelNotice {_bed :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_acc .logToWriter (_acc .Output ,_bed ,format ,args ...);};};
func (_aff ConsoleLogger )Notice (format string ,args ...interface{}){if _aff .LogLevel >=LogLevelNotice {_gc :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_aff .output (_e .Stdout ,_gc ,format ,args ...);};};

// Debug logs debug message.
func (_ba ConsoleLogger )Debug (format string ,args ...interface{}){if _ba .LogLevel >=LogLevelDebug {_fegc :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_ba .output (_aa .Stdout ,_fegc ,format ,args ...);};};
// Info does nothing for dummy logger.
func (DummyLogger )Info (format string ,args ...interface{}){};

// Trace does nothing for dummy logger.
func (DummyLogger )Trace (format string ,args ...interface{}){};
// Trace logs trace message.
func (_cdf WriterLogger )Trace (format string ,args ...interface{}){if _cdf .LogLevel >=LogLevelTrace {_gca :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_cdf .logToWriter (_cdf .Output ,_gca ,format ,args ...);};};

// Warning logs warning message.
func (_ebd WriterLogger )Warning (format string ,args ...interface{}){if _ebd .LogLevel >=LogLevelWarning {_aag :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_ebd .logToWriter (_ebd .Output ,_aag ,format ,args ...);};};
// Info logs info message.
func (_cbb ConsoleLogger )Info (format string ,args ...interface{}){if _cbb .LogLevel >=LogLevelInfo {_fe :="\u005bI\u004e\u0046\u004f\u005d\u0020";_cbb .output (_e .Stdout ,_fe ,format ,args ...);};};

// Trace logs trace message.
func (_be ConsoleLogger )Trace (format string ,args ...interface{}){if _be .LogLevel >=LogLevelTrace {_dee :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_be .output (_aa .Stdout ,_dee ,format ,args ...);};};
// Error logs error message.
func (_fa ConsoleLogger )Error (format string ,args ...interface{}){if _fa .LogLevel >=LogLevelError {_ee :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_fa .output (_e .Stdout ,_ee ,format ,args ...);};};

// Debug does nothing for dummy logger.
func (DummyLogger )Debug (format string ,args ...interface{}){};
// Error logs error message.
func (_eeg WriterLogger )Error (format string ,args ...interface{}){if _eeg .LogLevel >=LogLevelError {_dee :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_eeg .logToWriter (_eeg .Output ,_dee ,format ,args ...);};};

// DummyLogger does nothing.
type DummyLogger struct{};func _beb (_bf _g .Writer ,_aad string ,_fb string ,_bfe ...interface{}){_ ,_ca ,_ag ,_aagc :=_a .Caller (3);if !_aagc {_ca ="\u003f\u003f\u003f";_ag =0;}else {_ca =_ac .Base (_ca );};_acb :=_e .Sprintf ("\u0025s\u0020\u0025\u0073\u003a\u0025\u0064 ",_aad ,_ca ,_ag )+_fb +"\u000a";
_e .Fprintf (_bf ,_acb ,_bfe ...);};
// WriterLogger is the logger that writes data to the Output writer
type WriterLogger struct{LogLevel LogLevel ;Output _ae .Writer ;};

// NewWriterLogger creates new 'writer' logger.
func NewWriterLogger (logLevel LogLevel ,writer _g .Writer )*WriterLogger {logger :=WriterLogger {Output :writer ,LogLevel :logLevel };return &logger ;};var Log Logger =DummyLogger {};const (LogLevelTrace LogLevel =5;LogLevelDebug LogLevel =4;LogLevelInfo LogLevel =3;
LogLevelNotice LogLevel =2;LogLevelWarning LogLevel =1;LogLevelError LogLevel =0;);
// LogLevel is the verbosity level for logging.
type LogLevel int ;

// Info does nothing for dummy logger.
func (DummyLogger )Info (format string ,args ...interface{}){};func (_eea WriterLogger )logToWriter (_bcc _g .Writer ,_ad string ,_fec string ,_gfd ...interface{}){_beb (_bcc ,_ad ,_fec ,_gfd );};
// Error does nothing for dummy logger.
func (DummyLogger )Error (format string ,args ...interface{}){};

// Debug logs debug message.
func (_bd WriterLogger )Debug (format string ,args ...interface{}){if _bd .LogLevel >=LogLevelDebug {_cfb :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_bd .logToWriter (_bd .Output ,_cfb ,format ,args ...);};};
// SetLogger sets 'logger' to be used by the unidoc unipdf library.
func SetLogger (logger Logger ){Log =logger };func (_bb ConsoleLogger )output (_gf _ae .Writer ,_cd string ,_eb string ,_afa ...interface{}){_dc (_gf ,_cd ,_eb ,_afa ...);};

// Trace logs trace message.
func (_cfg WriterLogger )Trace (format string ,args ...interface{}){if _cfg .LogLevel >=LogLevelTrace {_bdg :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_cfg .logToWriter (_cfg .Output ,_bdg ,format ,args ...);};};
func (_gg ConsoleLogger )Trace (format string ,args ...interface{}){if _gg .LogLevel >=LogLevelTrace {_ge :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_gg .output (_e .Stdout ,_ge ,format ,args ...);};};func _dc (_dd _ae .Writer ,_ga string ,_fef string ,_dfg ...interface{}){_ ,_fea ,_ace ,_aad :=_g .Caller (3);
if !_aad {_fea ="\u003f\u003f\u003f";_ace =0;}else {_fea =_c .Base (_fea );};_eac :=_a .Sprintf ("\u0025s\u0020\u0025\u0073\u003a\u0025\u0064 ",_ga ,_fea ,_ace )+_fef +"\u000a";_a .Fprintf (_dd ,_eac ,_dfg ...);};

// ConsoleLogger is a logger that writes logs to the 'os.Stdout'
type ConsoleLogger struct{LogLevel LogLevel ;};func (_ab ConsoleLogger )output (_ff _g .Writer ,_dg string ,_db string ,_cg ...interface{}){_beb (_ff ,_dg ,_db ,_cg ...);};
// IsLogLevel returns true if log level is greater or equal than `level`.
// Can be used to avoid resource intensive calls to loggers.
func (_beg WriterLogger )IsLogLevel (level LogLevel )bool {return _beg .LogLevel >=level };const (LogLevelTrace LogLevel =5;LogLevelDebug LogLevel =4;LogLevelInfo LogLevel =3;LogLevelNotice LogLevel =2;LogLevelWarning LogLevel =1;LogLevelError LogLevel =0;
);

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

// Info logs info message.
func (_ebe WriterLogger )Info (format string ,args ...interface{}){if _ebe .LogLevel >=LogLevelInfo {_bb :="\u005bI\u004e\u0046\u004f\u005d\u0020";_ebe .logToWriter (_ebe .Output ,_bb ,format ,args ...);};};
// IsLogLevel returns true from dummy logger.
func (DummyLogger )IsLogLevel (level LogLevel )bool {return true };

// Notice logs notice message.
func (_af ConsoleLogger )Notice (format string ,args ...interface{}){if _af .LogLevel >=LogLevelNotice {_fg :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_af .output (_aa .Stdout ,_fg ,format ,args ...);};};
// Debug logs debug message.
func (_ac WriterLogger )Debug (format string ,args ...interface{}){if _ac .LogLevel >=LogLevelDebug {_gcc :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_ac .logToWriter (_ac .Output ,_gcc ,format ,args ...);};};

// Warning logs warning message.
func (_gf ConsoleLogger )Warning (format string ,args ...interface{}){if _gf .LogLevel >=LogLevelWarning {_ded :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_gf .output (_aa .Stdout ,_ded ,format ,args ...);};};
// ConsoleLogger is a logger that writes logs to the 'os.Stdout'
type ConsoleLogger struct{LogLevel LogLevel ;};

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

// Error logs error message.
func (_bg WriterLogger )Error (format string ,args ...interface{}){if _bg .LogLevel >=LogLevelError {_eg :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_bg .logToWriter (_bg .Output ,_eg ,format ,args ...);};};
// Notice logs notice message.
func (_dfd WriterLogger )Notice (format string ,args ...interface{}){if _dfd .LogLevel >=LogLevelNotice {_da :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_dfd .logToWriter (_dfd .Output ,_da ,format ,args ...);};};

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

// WriterLogger is the logger that writes data to the Output writer
type WriterLogger struct{LogLevel LogLevel ;Output _g .Writer ;};
// Debug does nothing for dummy logger.
func (DummyLogger )Debug (format string ,args ...interface{}){};

// Logger is the interface used for logging in the unipdf package.
type Logger interface{Error (_de string ,_b ...interface{});Warning (_gd string ,_gc ...interface{});Notice (_f string ,_gdc ...interface{});Info (_bc string ,_eb ...interface{});Debug (_fe string ,_dd ...interface{});Trace (_gcb string ,_c ...interface{});
IsLogLevel (_cf LogLevel )bool ;};
// Warning logs warning message.
func (_bc WriterLogger )Warning (format string ,args ...interface{}){if _bc .LogLevel >=LogLevelWarning {_cdb :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_bc .logToWriter (_bc .Output ,_cdb ,format ,args ...);};};

// LogLevel is the verbosity level for logging.
type LogLevel int ;
// 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 (_cc WriterLogger )IsLogLevel (level LogLevel )bool {return _cc .LogLevel >=level };
// Warning logs warning message.
func (_be ConsoleLogger )Warning (format string ,args ...interface{}){if _be .LogLevel >=LogLevelWarning {_gbd :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_be .output (_e .Stdout ,_gbd ,format ,args ...);};};

// Error logs error message.
func (_dec ConsoleLogger )Error (format string ,args ...interface{}){if _dec .LogLevel >=LogLevelError {_feg :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_dec .output (_aa .Stdout ,_feg ,format ,args ...);};};
// 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 (_deg ConsoleLogger )IsLogLevel (level LogLevel )bool {return _deg .LogLevel >=level };
// Info logs info message.
func (_gfe WriterLogger )Info (format string ,args ...interface{}){if _gfe .LogLevel >=LogLevelInfo {_ba :="\u005bI\u004e\u0046\u004f\u005d\u0020";_gfe .logToWriter (_gfe .Output ,_ba ,format ,args ...);};};func (_gbg WriterLogger )logToWriter (_fc _ae .Writer ,_ff string ,_db string ,_gbe ...interface{}){_dc (_fc ,_ff ,_db ,_gbe );
};
Loading

0 comments on commit 37c77fc

Please sign in to comment.