Return the style of `style_type` matching `style_id`. Returns the default for `style_type` if `style_id` is not found or if the style having `style_id` is not of `style_type`.
(self, style_id: str | None, style_type: WD_STYLE_TYPE)
| 105 | return LatentStyles(self._element.get_or_add_latentStyles()) |
| 106 | |
| 107 | def _get_by_id(self, style_id: str | None, style_type: WD_STYLE_TYPE): |
| 108 | """Return the style of `style_type` matching `style_id`. |
| 109 | |
| 110 | Returns the default for `style_type` if `style_id` is not found or if the style |
| 111 | having `style_id` is not of `style_type`. |
| 112 | """ |
| 113 | style = self._element.get_by_id(style_id) if style_id else None |
| 114 | if style is None or style.type != style_type: |
| 115 | return self.default(style_type) |
| 116 | return StyleFactory(style) |
| 117 | |
| 118 | def _get_style_id_from_name(self, style_name: str, style_type: WD_STYLE_TYPE) -> str | None: |
| 119 | """Return the id of the style of `style_type` corresponding to `style_name`. |