diff options
| author | Stefan <[email protected]> | 2022-05-13 12:09:23 +0200 |
|---|---|---|
| committer | Stefan Daschek <[email protected]> | 2022-05-18 13:04:15 +0200 |
| commit | 228772ee37e75f0206a635178d991b2399870353 (patch) | |
| tree | 8219ec07e3b79a9a8dadfcd90a8f2ebf46f25426 /lib/axlsx/drawing/title.rb | |
| parent | 39ae1467c0345ac619caa5af5e6727372d30b217 (diff) | |
| download | caxlsx-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.rb | 2 |
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) |
