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 [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 [DocxParagraphRun] run properties
@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
OoxmlParser::OOXMLDocumentObject::new
# File lib/ooxml_parser/docx_parser/docx_data/document_structure/document_style.rb, line 41 def initialize(parent: nil) @q_format = false @table_style_properties_list = [] super end
Public Instance Methods
@return [String] inspect of object for debug means
# File lib/ooxml_parser/docx_parser/docx_data/document_structure/document_style.rb, line 53 def inspect to_s end
Parse single document style @return [DocumentStyle]
# File lib/ooxml_parser/docx_parser/docx_data/document_structure/document_style.rb, line 59 def parse(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 = subnode.attribute('val').value when 'basedOn' @based_on = subnode.attribute('val').value when 'next' @next_style = subnode.attribute('val').value when 'rPr' @run_properties = DocxParagraphRun.new(parent: self).parse_properties(subnode) when 'pPr' @paragraph_properties = ParagraphProperties.new(parent: self).parse(subnode) 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
@return [String] result of convert of object to string
# File lib/ooxml_parser/docx_parser/docx_data/document_structure/document_style.rb, line 48 def to_s "Table style properties list: #{@table_style_properties_list.join(',')}" end