summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--lib/axlsx.rb2
-rw-r--r--lib/axlsx/workbook/worksheet/worksheet.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/axlsx.rb b/lib/axlsx.rb
index 9dba9144..0fd8260c 100644
--- a/lib/axlsx.rb
+++ b/lib/axlsx.rb
@@ -206,7 +206,7 @@ module Axlsx
# See https://www.owasp.org/index.php/CSV_Injection for details.
# @return [Boolean]
def self.escape_formulas
- @escape_formulas.nil? ? false : @escape_formulas
+ !defined?(@escape_formulas) || @escape_formulas.nil? ? false : @escape_formulas
end
# Sets whether to treat values starting with an equals sign as formulas or as literal strings.
diff --git a/lib/axlsx/workbook/worksheet/worksheet.rb b/lib/axlsx/workbook/worksheet/worksheet.rb
index 38fb5254..b4cad5be 100644
--- a/lib/axlsx/workbook/worksheet/worksheet.rb
+++ b/lib/axlsx/workbook/worksheet/worksheet.rb
@@ -21,7 +21,7 @@ module Axlsx
@sheet_protection = nil
initialize_page_options(options)
parse_options options
- self.escape_formulas = wb.escape_formulas if @escape_formulas.nil?
+ self.escape_formulas = wb.escape_formulas unless defined? @escape_formulas
@workbook.worksheets << self
@sheet_id = index + 1
yield self if block_given?