Table of Contents

Class ThemeEditingExtensions

Namespace
DocWright.Dom.Editing
Assembly
DocWright.Dom.dll

Phase 159 (WQ-0132): a document's theme colours and theme fonts set as an edit, as Word's Design > Colors and Fonts and their Customize dialogs set them. The theme part (RawXml) is rewritten where it changed only, so everything the model does not name is kept; a document with no theme part gets one; and every colour that names a theme slot has its cached RGB refreshed, as Word rewrites it.

public static class ThemeEditingExtensions
Inheritance
ThemeEditingExtensions
Inherited Members

Methods

SetThemeColors(WordDocument, DocumentPosition, Action<ThemeColorScheme>)

Sets the theme's colours: change gets a copy of the colour scheme (its name and its twelve slots), and what it changes is the edit. In the theme part only the slots that changed are rewritten (as a:srgbClr, a system colour too) and the scheme's name; every colour of the document that names a theme slot is drawn in the new colour and has its cached RGB rewritten, as Word does.

SetThemeFonts(WordDocument, DocumentPosition, Action<ThemeFonts>)

Sets the theme's fonts: change gets a copy of the font scheme (its name, its heading and body font sets), and what it changes is the edit. In the theme part only the typefaces that changed are rewritten (their other attributes and every script font kept, as Word keeps them) and the scheme's name; every run that names a theme font takes the new one. ScriptFonts are not changed here.