MCPcopy Index your code
hub / github.com/python-openxml/python-docx / _LatentStyle

Class _LatentStyle

src/docx/styles/latent.py:110–198  ·  view source on GitHub ↗

Proxy for an `w:lsdException` element, which specifies display behaviors for a built-in style when no definition for that style is stored yet in the `styles.xml` part. The values in this element override the defaults specified in the parent `w:latentStyles` element.

Source from the content-addressed store, hash-verified

108
109
110class _LatentStyle(ElementProxy):
111 """Proxy for an `w:lsdException` element, which specifies display behaviors for a
112 built-in style when no definition for that style is stored yet in the `styles.xml`
113 part.
114
115 The values in this element override the defaults specified in the parent
116 `w:latentStyles` element.
117 """
118
119 def delete(self):
120 """Remove this latent style definition such that the defaults defined in the
121 containing |LatentStyles| object provide the effective value for each of its
122 attributes.
123
124 Attempting to access any attributes on this object after calling this method
125 will raise |AttributeError|.
126 """
127 self._element.delete()
128 self._element = None
129
130 @property
131 def hidden(self):
132 """Tri-state value specifying whether this latent style should appear in the
133 recommended list.
134
135 |None| indicates the effective value is inherited from the parent
136 ``<w:latentStyles>`` element.
137 """
138 return self._element.on_off_prop("semiHidden")
139
140 @hidden.setter
141 def hidden(self, value):
142 self._element.set_on_off_prop("semiHidden", value)
143
144 @property
145 def locked(self):
146 """Tri-state value specifying whether this latent styles is locked.
147
148 A locked style does not appear in the styles panel or the style gallery and
149 cannot be applied to document content. This behavior is only active when
150 formatting protection is turned on for the document (via the Developer menu).
151 """
152 return self._element.on_off_prop("locked")
153
154 @locked.setter
155 def locked(self, value):
156 self._element.set_on_off_prop("locked", value)
157
158 @property
159 def name(self):
160 """The name of the built-in style this exception applies to."""
161 return BabelFish.internal2ui(self._element.name)
162
163 @property
164 def priority(self):
165 """The integer sort key for this latent style in the Word UI."""
166 return self._element.uiPriority
167

Callers 9

delete_fixtureMethod · 0.90
name_get_fixtureMethod · 0.90
on_off_get_fixtureMethod · 0.90
on_off_set_fixtureMethod · 0.90
priority_get_fixtureMethod · 0.90
priority_set_fixtureMethod · 0.90
__getitem__Method · 0.85
__iter__Method · 0.85
add_latent_styleMethod · 0.85

Calls

no outgoing calls

Tested by 6

delete_fixtureMethod · 0.72
name_get_fixtureMethod · 0.72
on_off_get_fixtureMethod · 0.72
on_off_set_fixtureMethod · 0.72
priority_get_fixtureMethod · 0.72
priority_set_fixtureMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…