Return `Style` object of appropriate |BaseStyle| subclass for `style_elm`.
(style_elm: CT_Style)
| 13 | |
| 14 | |
| 15 | def StyleFactory(style_elm: CT_Style) -> BaseStyle: |
| 16 | """Return `Style` object of appropriate |BaseStyle| subclass for `style_elm`.""" |
| 17 | style_cls: Type[BaseStyle] = { |
| 18 | WD_STYLE_TYPE.PARAGRAPH: ParagraphStyle, |
| 19 | WD_STYLE_TYPE.CHARACTER: CharacterStyle, |
| 20 | WD_STYLE_TYPE.TABLE: _TableStyle, |
| 21 | WD_STYLE_TYPE.LIST: _NumberingStyle, |
| 22 | }[style_elm.type] |
| 23 | |
| 24 | return style_cls(style_elm) |
| 25 | |
| 26 | |
| 27 | class BaseStyle(ElementProxy): |
no outgoing calls
searching dependent graphs…