class Xlsxrb::Ooxml::Reader::VmlHeaderFooterListener
SAX2 listener for parsing VML drawings of header and footer images (<v:shape> and <v:imagedata>).
Attributes
shapes
[R]
Array[Hash[Symbol, untyped]]
@return [Array<Hash[Symbol, untyped]>]
Public Class Methods
() → void
Source
# File lib/xlsxrb/ooxml/reader/listeners/feature_listeners.rb, line 2130 def initialize @shapes = [] @current_shape = nil end
Public Instance Methods
(untyped _uri, String? local_name, String? qname) → void
Source
# File lib/xlsxrb/ooxml/reader/listeners/feature_listeners.rb, line 2157 def end_element(_uri, local_name, qname) name = element_name(local_name, qname) case name when "shape" @shapes << @current_shape if @current_shape && @current_shape[:rel_id] @current_shape = nil end end
(untyped _uri, String? local_name, String? qname, Hash[String, String] attributes) → void
Source
# File lib/xlsxrb/ooxml/reader/listeners/feature_listeners.rb, line 2136 def start_element(_uri, local_name, qname, attributes) name = element_name(local_name, qname) case name when "shape" @current_shape = { id: attributes["id"] } when "imagedata" if @current_shape rel_id = attributes["o:relid"] || attributes["relid"] || attributes["r:id"] || attributes.find { |k, _| k.to_s.end_with?(":relid") }&.last || attributes.find { |k, _| k.to_s.end_with?(":id") }&.last title = attributes["o:title"] || attributes["title"] || attributes.find { |k, _| k.to_s.end_with?(":title") }&.last @current_shape[:rel_id] = rel_id @current_shape[:title] = title if title end end end