class OoxmlParser::DocumentStyle
Class for describing styles containing in styles.xml
Attributes
@return [FixNum] id of style on which this style is based
@return [True, False] is style default
@return [String] name of style
@return [FixNum] id of next style
@return [DocxParagraph] run properties
@return [Nokogiri::XML:Node] paragraph properties node
@return [True, False] Latent Style Primary Style Setting Used to determine if current style is visible in style list in editors According to www.wordarticles.com/Articles/WordStyles/LatentStyles.php
@return [Nokogiri::XML:Element] raw node value
@return [DocxParagraphRun] run properties
@return [Nokogiri::XML:Node] run properties node
@return [FixNum] number of style
@return [CellProperties] properties of table cell
@return [TableProperties] properties of table
@return [TableRowProperties] properties of table row
@return [Array, TableStyleProperties] list of table style properties
@return [Symbol] Type of style (:paragraph
or :table
)
@return [True, False] Latent Style Primary Style Setting Used to determine if current style is visible in style list in editors According to www.wordarticles.com/Articles/WordStyles/LatentStyles.php
Public Class Methods
Source
# File lib/ooxml_parser/docx_parser/document_structure/document_style.rb, line 47 def initialize(parent: nil) @q_format = false @table_style_properties_list = [] super end
OoxmlParser::OOXMLDocumentObject::new
Public Instance Methods
Source
# File lib/ooxml_parser/docx_parser/document_structure/document_style.rb, line 59 def inspect to_s end
@return [String] inspect of object for debug means
Source
# File lib/ooxml_parser/docx_parser/document_structure/document_style.rb, line 65 def parse(node) @raw_node = node node.attributes.each do |key, value| case key when 'type' @type = value.value.to_sym when 'styleId' @style_id = value.value when 'default' @default = attribute_enabled?(value.value) end end node.xpath('*').each do |subnode| case subnode.name when 'name' @name_object = ValuedChild.new(:string, parent: self).parse(subnode) @name = @name_object.value when 'basedOn' @based_on_object = ValuedChild.new(:string, parent: self).parse(subnode) @based_on = @based_on_object.value when 'next' @next_style_object = ValuedChild.new(:string, parent: self).parse(subnode) @next_style = @next_style_object.value when 'rPr' @run_properties_node = subnode @run_properties = DocxParagraphRun.new(parent: self).parse_properties(@run_properties_node) when 'pPr' @paragraph_properties_node = subnode @paragraph_properties = ParagraphProperties.new(parent: self).parse(@paragraph_properties_node) when 'tblPr' @table_properties = TableProperties.new(parent: self).parse(subnode) when 'trPr' @table_row_properties = TableRowProperties.new(parent: self).parse(subnode) when 'tcPr' @table_cell_properties = CellProperties.new(parent: self).parse(subnode) when 'tblStylePr' @table_style_properties_list << TableStyleProperties.new(parent: self).parse(subnode) when 'qFormat' @q_format = true end end fill_empty_table_styles self end
Parse single document style @return [DocumentStyle]
Source
# File lib/ooxml_parser/docx_parser/document_structure/document_style.rb, line 54 def to_s "Table style properties list: #{@table_style_properties_list.join(',')}" end
@return [String] result of convert of object to string