class OoxmlParser::DocxShape
Class for parsing ‘sp`, `wsp` tags
Attributes
@return [True, False] Specifies if text in shape is locked when sheet is protected
Public Class Methods
Source
# File lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape.rb, line 18 def initialize(parent: nil) @locks_text = true super end
Calls superclass method
Public Instance Methods
Source
# File lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape.rb, line 36 def parse(node) node.attributes.each do |key, value| case key when 'fLocksText' @locks_text = attribute_enabled?(value) end end node.xpath('*').each do |node_child| case node_child.name when 'nvSpPr' @non_visual_properties = NonVisualShapeProperties.new(parent: self).parse(node_child) when 'spPr' @properties = DocxShapeProperties.new(parent: self).parse(node_child) when 'style' @style = ShapeStyle.new(parent: self).parse(node_child) when 'txbx' @text_body = OOXMLTextBox.new(parent: self).parse(node_child) when 'txBody' @text_body = TextBody.new(parent: self).parse(node_child) when 'bodyPr' @body_properties = OOXMLShapeBodyProperties.new(parent: self).parse(node_child) end end self end
Parse DocxShape
object @param node [Nokogiri::XML:Element] node to parse @return [DocxShape] result of parsing
Source
# File lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape.rb, line 24 def with_data? return true if @text_body.nil? return true if @text_body.paragraphs.length > 1 return true unless @text_body.paragraphs.first.runs.empty? return true if properties.preset_geometry false end
@return [True, false] if structure contain any user data