Id of `style`, or |None| if it is the default style of `style_type`. Raises |ValueError| if style is not of `style_type`.
(self, style: BaseStyle, style_type: WD_STYLE_TYPE)
| 125 | return self._get_style_id_from_style(self[style_name], style_type) |
| 126 | |
| 127 | def _get_style_id_from_style(self, style: BaseStyle, style_type: WD_STYLE_TYPE) -> str | None: |
| 128 | """Id of `style`, or |None| if it is the default style of `style_type`. |
| 129 | |
| 130 | Raises |ValueError| if style is not of `style_type`. |
| 131 | """ |
| 132 | if style.type != style_type: |
| 133 | raise ValueError("assigned style is type %s, need type %s" % (style.type, style_type)) |
| 134 | if style == self.default(style_type): |
| 135 | return None |
| 136 | return style.style_id |