Skip to content

Commit

Permalink
Merge pull request #526 from unidoc-build/prep-rc-v1.38.0
Browse files Browse the repository at this point in the history
Release v1.38.0
  • Loading branch information
gunnsth authored Nov 23, 2024
2 parents 37c77fc + e2d6191 commit aefec45
Show file tree
Hide file tree
Showing 66 changed files with 59,103 additions and 59,115 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 _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'};

package algo ;import _a "strconv";func _g (_dd byte )bool {return _dd >='0'&&_dd <='9'};func RepeatString (s string ,cnt int )string {if cnt <=0{return "";};_ab :=make ([]byte ,len (s )*cnt );_ga :=[]byte (s );for _gbd :=0;_gbd < cnt ;_gbd ++{copy (_ab [_gbd :],_ga );
};return string (_ab );};

// NaturalLess compares two strings in a human manner so rId2 sorts less than rId10
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 );};
func NaturalLess (lhs ,rhs string )bool {_gb ,_gf :=0,0;for _gb < len (lhs )&&_gf < len (rhs ){_c :=lhs [_gb ];_b :=rhs [_gf ];_gba :=_g (_c );_e :=_g (_b );switch {case _gba &&!_e :return true ;case !_gba &&_e :return false ;case !_gba &&!_e :if _c !=_b {return _c < _b ;
};_gb ++;_gf ++;default:_ee :=_gb +1;_bc :=_gf +1;for _ee < len (lhs )&&_g (lhs [_ee ]){_ee ++;};for _bc < len (rhs )&&_g (rhs [_bc ]){_bc ++;};_ef ,_ :=_a .ParseUint (lhs [_gb :_ee ],10,64);_ge ,_ :=_a .ParseUint (rhs [_gb :_bc ],10,64);if _ef !=_ge {return _ef < _ge ;
};_gb =_ee ;_gf =_bc ;};};return len (lhs )< len (rhs );};
881 changes: 440 additions & 441 deletions chart/chart.go

Large diffs are not rendered by default.

74 changes: 37 additions & 37 deletions color/color.go

Large diffs are not rendered by default.

714 changes: 355 additions & 359 deletions common/axcontrol/axcontrol.go

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

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

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

// LegacyLicense holds the old-style unioffice license information.
type LegacyLicense =_ge .LegacyLicense ;
package license ;import _gg "github.com/unidoc/unioffice/internal/license";

// LegacyLicenseType is the type of license
type LegacyLicenseType =_ge .LegacyLicenseType ;
type LegacyLicenseType =_gg .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 _ge .SetLegacyLicenseKey (s )};
// 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 ){_gg .SetMeteredKeyPersistentCache (val )};

// MakeUnlicensedKey returns a default key.
func MakeUnlicensedKey ()*LicenseKey {return _ge .MakeUnlicensedKey ()};
// GetLicenseKey returns the currently loaded license key.
func GetLicenseKey ()*LicenseKey {return _gg .GetLicenseKey ()};

// LicenseKey represents a loaded license key.
type LicenseKey =_ge .LicenseKey ;
// 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 _gg .SetMeteredKey (apiKey )};

// 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 )};
func SetMeteredKeyUsageLogVerboseMode (val bool ){_gg .SetMeteredKeyUsageLogVerboseMode (val )};

// LicenseKey represents a loaded license key.
type LicenseKey =_gg .LicenseKey ;const (LicenseTierUnlicensed =_gg .LicenseTierUnlicensed ;LicenseTierCommunity =_gg .LicenseTierCommunity ;LicenseTierIndividual =_gg .LicenseTierIndividual ;LicenseTierBusiness =_gg .LicenseTierBusiness ;);

// 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 ;);
func SetLicenseKey (content string ,customerName string )error {return _gg .SetLicenseKey (content ,customerName );};

// GetLicenseKey returns the currently loaded license key.
func GetLicenseKey ()*LicenseKey {return _ge .GetLicenseKey ()};
// LegacyLicense holds the old-style unioffice license information.
type LegacyLicense =_gg .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 _ge .SetMeteredKey (apiKey )};
// GetMeteredState checks the currently used metered document usage status,
// documents used and credits available.
func GetMeteredState ()(_gg .MeteredStatus ,error ){return _gg .GetMeteredState ()};

// 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 )};
// 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 _gg .SetLegacyLicenseKey (s )};

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

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

// 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 ...);};};
// LogLevel is the verbosity level for logging.
type LogLevel int ;

// 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 {};
// ConsoleLogger is a logger that writes logs to the 'os.Stdout'
type ConsoleLogger struct{LogLevel LogLevel ;};

// 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 ;};
// SetLogger sets 'logger' to be used by the unidoc unipdf library.
func SetLogger (logger Logger ){Log =logger };

// Notice logs notice message.
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 ...);};};
// IsLogLevel returns true from dummy logger.
func (DummyLogger )IsLogLevel (level LogLevel )bool {return true };

// 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 ...);};};
// Notice logs notice message.
func (_af ConsoleLogger )Notice (format string ,args ...interface{}){if _af .LogLevel >=LogLevelNotice {_eg :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_af .output (_a .Stdout ,_eg ,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 ...);};};
func (_bf ConsoleLogger )Info (format string ,args ...interface{}){if _bf .LogLevel >=LogLevelInfo {_gf :="\u005bI\u004e\u0046\u004f\u005d\u0020";_bf .output (_a .Stdout ,_gf ,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 ...);};};
// Warning does nothing for dummy logger.
func (DummyLogger )Warning (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 ...);};};
// Debug logs debug message.
func (_eaa WriterLogger )Debug (format string ,args ...interface{}){if _eaa .LogLevel >=LogLevelDebug {_cb :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_eaa .logToWriter (_eaa .Output ,_cb ,format ,args ...);};};

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

// LogLevel is the verbosity level for logging.
type LogLevel int ;
// Notice logs notice message.
func (_de WriterLogger )Notice (format string ,args ...interface{}){if _de .LogLevel >=LogLevelNotice {_cf :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_de .logToWriter (_de .Output ,_cf ,format ,args ...);};};

// 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 (_b ConsoleLogger )IsLogLevel (level LogLevel )bool {return _b .LogLevel >=level };

// 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 ...);};
// Debug logs debug message.
func (_gee ConsoleLogger )Debug (format string ,args ...interface{}){if _gee .LogLevel >=LogLevelDebug {_da :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_gee .output (_a .Stdout ,_da ,format ,args ...);};};

// Trace logs trace message.
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 ...);};
func (_ddg WriterLogger )Trace (format string ,args ...interface{}){if _ddg .LogLevel >=LogLevelTrace {_efg :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_ddg .logToWriter (_ddg .Output ,_efg ,format ,args ...);};};

// Logger is the interface used for logging in the unipdf package.
type Logger interface{Error (_ad string ,_g ...interface{});Warning (_fb string ,_ef ...interface{});Notice (_ce string ,_adc ...interface{});Info (_gb string ,_ec ...interface{});Debug (_cd string ,_eff ...interface{});Trace (_cc string ,_ga ...interface{});
IsLogLevel (_d LogLevel )bool ;};

// 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;
);

// NewWriterLogger creates new 'writer' logger.
func NewWriterLogger (logLevel LogLevel ,writer _ae .Writer )*WriterLogger {logger :=WriterLogger {Output :writer ,LogLevel :logLevel };return &logger ;};

// IsLogLevel returns true from dummy logger.
func (DummyLogger )IsLogLevel (level LogLevel )bool {return true };
func (_bge WriterLogger )IsLogLevel (level LogLevel )bool {return _bge .LogLevel >=level };

// 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 ...);};};

// ConsoleLogger is a logger that writes logs to the 'os.Stdout'
type ConsoleLogger struct{LogLevel LogLevel ;};
// Error logs error message.
func (_ab ConsoleLogger )Error (format string ,args ...interface{}){if _ab .LogLevel >=LogLevelError {_gc :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_ab .output (_a .Stdout ,_gc ,format ,args ...);};};

// Warning does nothing for dummy logger.
func (DummyLogger )Warning (format string ,args ...interface{}){};
// Warning logs warning message.
func (_ge ConsoleLogger )Warning (format string ,args ...interface{}){if _ge .LogLevel >=LogLevelWarning {_dd :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_ge .output (_a .Stdout ,_dd ,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 ...);};};
// WriterLogger is the logger that writes data to the Output writer
type WriterLogger struct{LogLevel LogLevel ;Output _c .Writer ;};func _gaf (_gegd _c .Writer ,_bfa string ,_bac string ,_ed ...interface{}){_ ,_dee ,_gff ,_bef :=_fe .Caller (3);if !_bef {_dee ="\u003f\u003f\u003f";_gff =0;}else {_dee =_e .Base (_dee );
};_ada :=_fd .Sprintf ("\u0025s\u0020\u0025\u0073\u003a\u0025\u0064 ",_bfa ,_dee ,_gff )+_bac +"\u000a";_fd .Fprintf (_gegd ,_ada ,_ed ...);};

// Notice does nothing for dummy logger.
func (DummyLogger )Notice (format string ,args ...interface{}){};
// Warning logs warning message.
func (_gdf WriterLogger )Warning (format string ,args ...interface{}){if _gdf .LogLevel >=LogLevelWarning {_db :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_gdf .logToWriter (_gdf .Output ,_db ,format ,args ...);};};

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

// 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 ...);};};
// DummyLogger does nothing.
type DummyLogger struct{};func (_aa WriterLogger )logToWriter (_ba _c .Writer ,_be string ,_fbc string ,_dag ...interface{}){_gaf (_ba ,_be ,_fbc ,_dag );};const (LogLevelTrace LogLevel =5;LogLevelDebug LogLevel =4;LogLevelInfo LogLevel =3;LogLevelNotice LogLevel =2;
LogLevelWarning LogLevel =1;LogLevelError LogLevel =0;);

// NewConsoleLogger creates new console logger.
func NewConsoleLogger (logLevel LogLevel )*ConsoleLogger {return &ConsoleLogger {LogLevel :logLevel }};

// 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 ...);};};

// DummyLogger does nothing.
type DummyLogger struct{};
// Error logs error message.
func (_eaf WriterLogger )Error (format string ,args ...interface{}){if _eaf .LogLevel >=LogLevelError {_fdf :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_eaf .logToWriter (_eaf .Output ,_fdf ,format ,args ...);};};func (_adg ConsoleLogger )output (_dg _c .Writer ,_bfe string ,_geg string ,_ea ...interface{}){_gaf (_dg ,_bfe ,_geg ,_ea ...);
};

// 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 );
};
func (_gae WriterLogger )Info (format string ,args ...interface{}){if _gae .LogLevel >=LogLevelInfo {_cg :="\u005bI\u004e\u0046\u004f\u005d\u0020";_gae .logToWriter (_gae .Output ,_cg ,format ,args ...);};};

// Trace logs trace message.
func (_bg ConsoleLogger )Trace (format string ,args ...interface{}){if _bg .LogLevel >=LogLevelTrace {_efd :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_bg .output (_a .Stdout ,_efd ,format ,args ...);};};var Log Logger =DummyLogger {};

// NewWriterLogger creates new 'writer' logger.
func NewWriterLogger (logLevel LogLevel ,writer _c .Writer )*WriterLogger {logger :=WriterLogger {Output :writer ,LogLevel :logLevel };return &logger ;};

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

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

0 comments on commit aefec45

Please sign in to comment.