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

Method _line_spacing_rule

src/docx/text/parfmt.py:272–286  ·  view source on GitHub ↗

Return the line spacing rule value calculated from the combination of `line` and `lineRule`. Returns special members of the :ref:`WdLineSpacing` enumeration when line spacing is single, double, or 1.5 lines.

(line, lineRule)

Source from the content-addressed store, hash-verified

270
271 @staticmethod
272 def _line_spacing_rule(line, lineRule):
273 """Return the line spacing rule value calculated from the combination of `line`
274 and `lineRule`.
275
276 Returns special members of the :ref:`WdLineSpacing` enumeration when line
277 spacing is single, double, or 1.5 lines.
278 """
279 if lineRule == WD_LINE_SPACING.MULTIPLE:
280 if line == Twips(240):
281 return WD_LINE_SPACING.SINGLE
282 if line == Twips(360):
283 return WD_LINE_SPACING.ONE_POINT_FIVE
284 if line == Twips(480):
285 return WD_LINE_SPACING.DOUBLE
286 return lineRule

Callers 1

line_spacing_ruleMethod · 0.95

Calls 1

TwipsClass · 0.90

Tested by

no test coverage detected