diff options
| author | Randy Morgan <[email protected]> | 2012-10-18 22:35:12 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2012-10-18 22:35:12 +0900 |
| commit | 757d34152746333f2fa9f1de9b44048ce9a331ad (patch) | |
| tree | 4f5041753ec9f6bb0281e62c8d7ed2311f69f4a6 | |
| parent | e0736deb4a3260651c531b459aac3f80fdbe4be4 (diff) | |
| download | caxlsx-757d34152746333f2fa9f1de9b44048ce9a331ad.tar.gz caxlsx-757d34152746333f2fa9f1de9b44048ce9a331ad.zip | |
refactored pattern_fill to specify tag name for fg and bg colors
| -rw-r--r-- | lib/axlsx/stylesheet/pattern_fill.rb | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/lib/axlsx/stylesheet/pattern_fill.rb b/lib/axlsx/stylesheet/pattern_fill.rb index c06c7f16..504624e6 100644 --- a/lib/axlsx/stylesheet/pattern_fill.rb +++ b/lib/axlsx/stylesheet/pattern_fill.rb @@ -6,7 +6,6 @@ module Axlsx class PatternFill include Axlsx::OptionsParser - # Creates a new PatternFill Object # @option options [Symbol] patternType # @option options [Color] fgColor @@ -62,19 +61,11 @@ module Axlsx def to_xml_string(str = '') str << '<patternFill patternType="' << patternType.to_s << '">' if fgColor.is_a?(Color) - str << "<fgColor " - fgColor.instance_values.each do |key, value| - str << key.to_s << '="' << value.to_s << '" ' - end - str << "/>" + fgColor.to_xml_string str, "fgColor" end if bgColor.is_a?(Color) - str << "<bgColor " - bgColor.instance_values.each do |key, value| - str << key.to_s << '="' << value.to_s << '" ' - end - str << "/>" + bgColor.to_xml_string str, "bgColor" end str << '</patternFill>' end |
