Sha256: 79709d4bcf3cfdf6c4e58393c65456820dec2b0c0f6bedf3ce021914d209243a

Contents?: true

Size: 1.15 KB

Versions: 10

Compression:

Stored size: 1.15 KB

Contents

require 'berkeley_library/util/ods/xml/element_node'
require 'berkeley_library/util/ods/xml/style/style'
require 'berkeley_library/util/ods/xml/style/default_style'
require 'berkeley_library/util/ods/xml/style/paragraph_properties'

module BerkeleyLibrary
  module Util
    module ODS
      module XML
        module Office
          class Styles < XML::ElementNode
            def initialize(doc:)
              super(:office, 'styles', doc: doc)

              add_default_children!
            end

            private

            def add_default_children!
              add_child(table_cell_default_style)
              add_child(Style::Style.new('Default', 'table-cell', doc: doc))
            end

            def table_cell_default_style
              style_children = [
                Style::ParagraphProperties.new(doc: doc),
                Style::TextProperties.new(font_name: Style::FontFace::DEFAULT_FONT_FACE, doc: doc)
              ]
              Style::DefaultStyle.new('table-cell', doc: doc).tap do |ds|
                style_children.each { |c| ds.add_child(c) }
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
berkeley_library-tind-0.7.2 lib/berkeley_library/util/ods/xml/office/styles.rb
berkeley_library-tind-0.7.1 lib/berkeley_library/util/ods/xml/office/styles.rb
berkeley_library-tind-0.7.0 lib/berkeley_library/util/ods/xml/office/styles.rb
berkeley_library-tind-0.6.0 lib/berkeley_library/util/ods/xml/office/styles.rb
berkeley_library-tind-0.5.1 lib/berkeley_library/util/ods/xml/office/styles.rb
berkeley_library-tind-0.5.0 lib/berkeley_library/util/ods/xml/office/styles.rb
berkeley_library-tind-0.4.3 lib/berkeley_library/util/ods/xml/office/styles.rb
berkeley_library-tind-0.4.2 lib/berkeley_library/util/ods/xml/office/styles.rb
berkeley_library-tind-0.4.1 lib/berkeley_library/util/ods/xml/office/styles.rb
berkeley_library-tind-0.4.0 lib/berkeley_library/util/ods/xml/office/styles.rb