diff options
| author | Randy Morgan <[email protected]> | 2012-04-01 11:58:09 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2012-04-01 11:58:09 +0900 |
| commit | 1529fce32449a8454208fded20d83c9ceca810e0 (patch) | |
| tree | 02f722182fea58a51b8c0a5433221b3a677e80e4 /lib/axlsx/drawing/series_title.rb | |
| parent | 22a341841f191a5aa00e87b1f166b4f25cc67f0a (diff) | |
| download | caxlsx-1529fce32449a8454208fded20d83c9ceca810e0.tar.gz caxlsx-1529fce32449a8454208fded20d83c9ceca810e0.zip | |
rebuild all serialization to use string concatenation instead of nokogiri.
Diffstat (limited to 'lib/axlsx/drawing/series_title.rb')
| -rw-r--r-- | lib/axlsx/drawing/series_title.rb | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/lib/axlsx/drawing/series_title.rb b/lib/axlsx/drawing/series_title.rb index b13cec89..39ec10d5 100644 --- a/lib/axlsx/drawing/series_title.rb +++ b/lib/axlsx/drawing/series_title.rb @@ -3,21 +3,18 @@ module Axlsx # A series title is a Title with a slightly different serialization than chart titles. class SeriesTitle < Title - # Serializes the series title - # @param [Nokogiri::XML::Builder] xml The document builder instance this objects xml will be added to. - # @return [String] - def to_xml(xml) - xml[:c].tx { - xml[:c].strRef { - xml[:c].f Axlsx::cell_range([@cell]) - xml[:c].strCache { - xml[:c].ptCount :val=>1 - xml[:c].pt(:idx=>0) { - xml[:c].v @text - } - } - } - } + def to_xml_string(str = '') + str << '<c:tx>' + str << '<c:strRef>' + str << '<c:f>' << Axlsx::cell_range([@cell]) << '</c:f>' + str << '<c:strCache>' + str << '<c:ptCount val="1"/>' + str << '<c:pt idx="0">' + str << '<c:v>' << @text << '</c:v>' + str << '</c:pt>' + str << '</c:strCache>' + str << '</c:strRef>' + str << '</c:tx>' end end end |
