summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-08-11 17:06:20 +0900
committerRandy Morgan <[email protected]>2012-08-11 17:06:20 +0900
commit5e2916f42be04d98d5601e479713023587f360aa (patch)
treee6b2481c1c55da4ad6a80f900350ad848270b9f0
parent675d3c7ad41207d29b08bc3157790c00980e00c3 (diff)
downloadcaxlsx-5e2916f42be04d98d5601e479713023587f360aa.tar.gz
caxlsx-5e2916f42be04d98d5601e479713023587f360aa.zip
backward compat for 1.8.7
-rw-r--r--lib/axlsx/doc_props/app.rb6
-rw-r--r--lib/axlsx/workbook/worksheet/worksheet_hyperlink.rb17
2 files changed, 15 insertions, 8 deletions
diff --git a/lib/axlsx/doc_props/app.rb b/lib/axlsx/doc_props/app.rb
index 39f86eb4..d9e9efb0 100644
--- a/lib/axlsx/doc_props/app.rb
+++ b/lib/axlsx/doc_props/app.rb
@@ -134,15 +134,15 @@ module Axlsx
# Sets the template property of your app.xml file
def template=(v) Axlsx::validate_string v; @template = v; end
- alias :Template :template
+ alias :Template= :template=
# Sets the manager property of your app.xml file
def manager=(v) Axlsx::validate_string v; @manager = v; end
- alias :Manager :manager
+ alias :Manager= :manager=
# Sets the company property of your app.xml file
def company=(v) Axlsx::validate_string v; @company = v; end
- alias :Company :company
+ alias :Company= :company=
# Sets the pages property of your app.xml file
def pages=(v) Axlsx::validate_int v; @pages = v; end
diff --git a/lib/axlsx/workbook/worksheet/worksheet_hyperlink.rb b/lib/axlsx/workbook/worksheet/worksheet_hyperlink.rb
index f38f74e4..64c1949d 100644
--- a/lib/axlsx/workbook/worksheet/worksheet_hyperlink.rb
+++ b/lib/axlsx/workbook/worksheet/worksheet_hyperlink.rb
@@ -67,16 +67,23 @@ module Axlsx
end
def id
- "rId#{(@worksheet.relationships_index_of(self)+1)}"
+ "rId#{(@worksheet.relationships_index_of(self)+1)}"
end
def to_xml_string(str='')
- h = instance_values.select { |key, value| %w(display ref tooltip).include? key }
- h['r:id'] = id if @target == :external
- h['location'] = location unless @target == :external
str << '<hyperlink '
- h.map { |key, value| str << key.to_s << '="' << value.to_s << '" ' }
+ serialization_values.map { |key, value| str << key.to_s << '="' << value.to_s << '" ' }
str << '/>'
end
+
+ def serialization_values
+ h = instance_values.reject { |key, value| !%w(display ref tooltip).include?(key) }
+ if @target == :external
+ h['r:id'] = id
+ else
+ h['location'] = location
+ end
+ h
+ end
end
end