summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/drawing/graphic_frame.rb
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2013-01-15 21:53:47 +0900
committerRandy Morgan <[email protected]>2013-01-15 21:53:47 +0900
commit40c85619885de848447479b99c08e5feaea89a90 (patch)
tree61cebfceb3ac1d404e4893b376f9f3a5d72e3bd0 /lib/axlsx/drawing/graphic_frame.rb
parente14682fb484cd72ba5f479cc1f7d46a7a9fd6007 (diff)
downloadcaxlsx-40c85619885de848447479b99c08e5feaea89a90.tar.gz
caxlsx-40c85619885de848447479b99c08e5feaea89a90.zip
Refactored relationship management for drawings
This should fix #160
Diffstat (limited to 'lib/axlsx/drawing/graphic_frame.rb')
-rw-r--r--lib/axlsx/drawing/graphic_frame.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/axlsx/drawing/graphic_frame.rb b/lib/axlsx/drawing/graphic_frame.rb
index a829e5ea..888cde76 100644
--- a/lib/axlsx/drawing/graphic_frame.rb
+++ b/lib/axlsx/drawing/graphic_frame.rb
@@ -24,7 +24,16 @@ module Axlsx
# The relationship id for this graphic
# @return [String]
+ #
+ # NOTE: Discontinued. This should not be part of GraphicFrame.
+ # The drawing object maintains relationships and needs to be queried to determine the relationship id of any given graphic data child object.
+ #
+ # @example
+ # <a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/chart">
+ # <c:chart xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" r:id="rId2"/>
+ # </a:graphicData>
def rId
+ warn('axlsx::DEPRECIATED: GraphicFrame#rId has been depreciated. relationship id is determed by the drawing object')
"rId#{@anchor.index+1}"
end
@@ -44,7 +53,7 @@ module Axlsx
str << '</xdr:xfrm>'
str << '<a:graphic>'
str << '<a:graphicData uri="' << XML_NS_C << '">'
- str << '<c:chart xmlns:c="' << XML_NS_C << '" xmlns:r="' << XML_NS_R << '" r:id="' << rId.to_s << '"/>'
+ str << '<c:chart xmlns:c="' << XML_NS_C << '" xmlns:r="' << XML_NS_R << '" r:id="rId' << (@anchor.drawing.index_of(@chart)+1).to_s << '"/>'
str << '</a:graphicData>'
str << '</a:graphic>'
str << '</xdr:graphicFrame>'