package jxl;

import common.Logger;
import java.util.HashMap;
import java.util.Locale;
import jxl.biff.CountryCode;
import jxl.biff.formula.FunctionNames;

/* JADX INFO: loaded from: classes.dex */
public final class WorkbookSettings {
    private static final int DEFAULT_ARRAY_GROW_SIZE = 1048576;
    private static final int DEFAULT_INITIAL_FILE_SIZE = 5242880;
    public static /* synthetic */ Class class$jxl$WorkbookSettings;
    private static Logger logger;
    private boolean autoFilterDisabled;
    private boolean cellValidationDisabled;
    private int characterSet;
    private boolean drawingsDisabled;
    private String encoding;
    private boolean formulaReferenceAdjustDisabled;
    private FunctionNames functionNames;
    private boolean gcDisabled;
    private boolean ignoreBlankCells;
    private Locale locale;
    private boolean mergedCellCheckingDisabled;
    private boolean namesDisabled;
    private boolean propertySetsDisabled;
    private boolean rationalizationDisabled;
    private int initialFileSize = DEFAULT_INITIAL_FILE_SIZE;
    private int arrayGrowSize = DEFAULT_ARRAY_GROW_SIZE;
    private HashMap localeFunctionNames = new HashMap();
    private String excelDisplayLanguage = CountryCode.USA.getCode();
    private String excelRegionalSettings = CountryCode.UK.getCode();

    static {
        Class clsClass$ = class$jxl$WorkbookSettings;
        if (clsClass$ == null) {
            clsClass$ = class$("jxl.WorkbookSettings");
            class$jxl$WorkbookSettings = clsClass$;
        }
        logger = Logger.getLogger(clsClass$);
    }

    public WorkbookSettings() {
        try {
            setSuppressWarnings(Boolean.getBoolean("jxl.nowarnings"));
            this.drawingsDisabled = Boolean.getBoolean("jxl.nodrawings");
            this.namesDisabled = Boolean.getBoolean("jxl.nonames");
            this.gcDisabled = Boolean.getBoolean("jxl.nogc");
            this.rationalizationDisabled = Boolean.getBoolean("jxl.norat");
            this.mergedCellCheckingDisabled = Boolean.getBoolean("jxl.nomergedcellchecks");
            this.formulaReferenceAdjustDisabled = Boolean.getBoolean("jxl.noformulaadjust");
            this.propertySetsDisabled = Boolean.getBoolean("jxl.nopropertysets");
            this.ignoreBlankCells = Boolean.getBoolean("jxl.ignoreblanks");
            this.cellValidationDisabled = Boolean.getBoolean("jxl.nocellvalidation");
            this.autoFilterDisabled = !Boolean.getBoolean("jxl.autofilter");
            this.encoding = System.getProperty("file.encoding");
        } catch (SecurityException e2) {
            logger.warn("Error accessing system properties.", e2);
        }
        try {
            if (System.getProperty("jxl.lang") == null || System.getProperty("jxl.country") == null) {
                this.locale = Locale.getDefault();
            } else {
                this.locale = new Locale(System.getProperty("jxl.lang"), System.getProperty("jxl.country"));
            }
            if (System.getProperty("jxl.encoding") != null) {
                this.encoding = System.getProperty("jxl.encoding");
            }
        } catch (SecurityException e3) {
            logger.warn("Error accessing system properties.", e3);
            this.locale = Locale.getDefault();
        }
    }

    public static /* synthetic */ Class class$(String str) {
        try {
            return Class.forName(str);
        } catch (ClassNotFoundException e2) {
            throw new NoClassDefFoundError(e2.getMessage());
        }
    }

    public int getArrayGrowSize() {
        return this.arrayGrowSize;
    }

    public boolean getAutoFilterDisabled() {
        return this.autoFilterDisabled;
    }

    public boolean getCellValidationDisabled() {
        return this.cellValidationDisabled;
    }

    public int getCharacterSet() {
        return this.characterSet;
    }

    public boolean getDrawingsDisabled() {
        return this.drawingsDisabled;
    }

    public String getEncoding() {
        return this.encoding;
    }

    public String getExcelDisplayLanguage() {
        return this.excelDisplayLanguage;
    }

    public String getExcelRegionalSettings() {
        return this.excelRegionalSettings;
    }

    public boolean getFormulaAdjust() {
        return !this.formulaReferenceAdjustDisabled;
    }

    public FunctionNames getFunctionNames() {
        if (this.functionNames == null) {
            FunctionNames functionNames = (FunctionNames) this.localeFunctionNames.get(this.locale);
            this.functionNames = functionNames;
            if (functionNames == null) {
                FunctionNames functionNames2 = new FunctionNames(this.locale);
                this.functionNames = functionNames2;
                this.localeFunctionNames.put(this.locale, functionNames2);
            }
        }
        return this.functionNames;
    }

    public boolean getGCDisabled() {
        return this.gcDisabled;
    }

    public boolean getIgnoreBlanks() {
        return this.ignoreBlankCells;
    }

    public int getInitialFileSize() {
        return this.initialFileSize;
    }

    public Locale getLocale() {
        return this.locale;
    }

    public boolean getMergedCellCheckingDisabled() {
        return this.mergedCellCheckingDisabled;
    }

    public boolean getNamesDisabled() {
        return this.namesDisabled;
    }

    public boolean getPropertySetsDisabled() {
        return this.propertySetsDisabled;
    }

    public boolean getRationalizationDisabled() {
        return this.rationalizationDisabled;
    }

    public void setArrayGrowSize(int i2) {
        this.arrayGrowSize = i2;
    }

    public void setAutoFilterDisabled(boolean z) {
        this.autoFilterDisabled = z;
    }

    public void setCellValidationDisabled(boolean z) {
        this.cellValidationDisabled = z;
    }

    public void setCharacterSet(int i2) {
        this.characterSet = i2;
    }

    public void setDrawingsDisabled(boolean z) {
        this.drawingsDisabled = z;
    }

    public void setEncoding(String str) {
        this.encoding = str;
    }

    public void setExcelDisplayLanguage(String str) {
        this.excelDisplayLanguage = str;
    }

    public void setExcelRegionalSettings(String str) {
        this.excelRegionalSettings = str;
    }

    public void setFormulaAdjust(boolean z) {
        this.formulaReferenceAdjustDisabled = !z;
    }

    public void setGCDisabled(boolean z) {
        this.gcDisabled = z;
    }

    public void setIgnoreBlanks(boolean z) {
        this.ignoreBlankCells = z;
    }

    public void setInitialFileSize(int i2) {
        this.initialFileSize = i2;
    }

    public void setLocale(Locale locale) {
        this.locale = locale;
    }

    public void setMergedCellChecking(boolean z) {
        this.mergedCellCheckingDisabled = !z;
    }

    public void setNamesDisabled(boolean z) {
        this.namesDisabled = z;
    }

    public void setPropertySets(boolean z) {
        this.propertySetsDisabled = !z;
    }

    public void setRationalization(boolean z) {
        this.rationalizationDisabled = !z;
    }

    public void setSuppressWarnings(boolean z) {
        logger.setSuppressWarnings(z);
    }
}
