Class: Uniword::Themes::ThemeApplicator

Inherits:
Object
  • Object
show all
Defined in:
lib/uniword/theme/theme_applicator.rb

Overview

Applies themes to documents by setting theme data and updating styles

When a theme is applied to a document:

  1. The theme XML is stored for serialization to word/theme/theme1.xml

  2. Document defaults get theme font references (minorAscii, etc.)

  3. Heading styles get major font and theme color references

  4. Hyperlink styles get theme color references

Instance Method Summary collapse

Instance Method Details

#apply(theme, document) ⇒ void

This method returns an undefined value.

Apply theme to document

Parameters:



18
19
20
21
22
23
# File 'lib/uniword/theme/theme_applicator.rb', line 18

def apply(theme, document)
  word_theme = normalize_theme(theme)
  document.theme = word_theme.dup
  update_doc_defaults(document, word_theme)
  update_builtin_styles(document, word_theme)
end