summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/drawing/title.rb
diff options
context:
space:
mode:
authorStefan <[email protected]>2022-05-13 12:09:23 +0200
committerStefan Daschek <[email protected]>2022-05-18 13:04:15 +0200
commit228772ee37e75f0206a635178d991b2399870353 (patch)
tree8219ec07e3b79a9a8dadfcd90a8f2ebf46f25426 /lib/axlsx/drawing/title.rb
parent39ae1467c0345ac619caa5af5e6727372d30b217 (diff)
downloadcaxlsx-228772ee37e75f0206a635178d991b2399870353.tar.gz
caxlsx-228772ee37e75f0206a635178d991b2399870353.zip
Fix missing cell reference for chart title when cell empty
Before this change, creating a chart title referencing an empty cell would lose the cell reference. If the cell was later set to a non-blank value (either during generating the file, or while editing it in a spreadsheet app), the chart title would stay blank.
Diffstat (limited to 'lib/axlsx/drawing/title.rb')
-rw-r--r--lib/axlsx/drawing/title.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/axlsx/drawing/title.rb b/lib/axlsx/drawing/title.rb
index 002ae94f..d3100d43 100644
--- a/lib/axlsx/drawing/title.rb
+++ b/lib/axlsx/drawing/title.rb
@@ -61,7 +61,7 @@ module Axlsx
# @return [String]
def to_xml_string(str = '')
str << '<c:title>'
- unless @text.empty?
+ unless @text.empty? && @cell.nil?
clean_value = Axlsx::trust_input ? @text.to_s : ::CGI.escapeHTML(Axlsx::sanitize(@text.to_s))
str << '<c:tx>'
if @cell.is_a?(Cell)