Skip to content

Commit 3b72d10

Browse files
authored
Merge 7be5af1 into 180c9f2
2 parents 180c9f2 + 7be5af1 commit 3b72d10

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

source/NVDAObjects/UIA/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,8 +388,8 @@ def _getFormatFieldIndent(
388388
formatField['right-indent'] = self._getIndentValueDisplayString(uiaIndentTrailing)
389389
return formatField
390390

391-
@staticmethod
392-
def _getIndentValueDisplayString(val: float) -> str:
391+
# @staticmethod
392+
def _getIndentValueDisplayString(self, val: float) -> str:
393393
"""A function returning the string to display in formatting info.
394394
@param val: an indent value measured in points, fetched via
395395
an UIAHandler.UIA_Indentation*AttributeId attribute.

source/NVDAObjects/UIA/wordDocument.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,21 @@ def _getFormatFieldAtRange(self, textRange, formatConfig, ignoreMixedValues=Fals
448448
if isinstance(textColumnNumber, int):
449449
formatField.field['text-column-number'] = textColumnNumber
450450
return formatField
451+
452+
def _getIndentValueDisplayString(self, val: float) -> str:
453+
"""A function returning the string to display in formatting info.
454+
@param val: an indent value measured in points, fetched via
455+
an UIAHandler.UIA_Indentation*AttributeId attribute.
456+
@return: The string used in formatting information to report the length of an indentation.
457+
"""
458+
459+
if self.WinwordApplicationObject:
460+
# When Word object model is available we use Word's options to report distances.
461+
return self.getLocalizedMeasurementTextForPointSize(offset)
462+
463+
# If Word object model is not available, we just fallback to general case.
464+
super()._getIndentValueDisplayString(val: float) -> str
465+
451466

452467

453468
class WordBrowseModeDocument(UIABrowseModeDocument):

0 commit comments

Comments
 (0)