Skip to content

Commit

Permalink
In Microsoft Word, paragraph indentation is now always reported in th…
Browse files Browse the repository at this point in the history
…e measurement unit chosen by the user (e.g. centimeters or inches).

Fixes #5804.
  • Loading branch information
michaelDCurran authored and jcsteh committed Mar 31, 2016
1 parent 84dbc55 commit f3572be
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
4 changes: 0 additions & 4 deletions nvdaHelper/remote/winword.cpp
Expand Up @@ -531,10 +531,6 @@ int generateTableXML(IDispatch* pDispatchRange, bool includeLayoutTables, int st

void generateXMLAttribsForFormatting(IDispatch* pDispatchRange, int startOffset, int endOffset, int formatConfig, wostringstream& formatAttribsStream) {
int iVal=0;
// #4165: font size is needed to calculate paragraph indenting
if(formatConfig&formatConfig_reportParagraphIndentation) {
formatConfig|=formatConfig_reportFontSize;
}
if((formatConfig&formatConfig_reportPage)&&(_com_dispatch_raw_method(pDispatchRange,wdDISPID_RANGE_INFORMATION,DISPATCH_PROPERTYGET,VT_I4,&iVal,L"\x0003",wdActiveEndAdjustedPageNumber)==S_OK)&&iVal>0) {
formatAttribsStream<<L"page-number=\""<<iVal<<L"\" ";
}
Expand Down
8 changes: 1 addition & 7 deletions source/NVDAObjects/window/winword.py
Expand Up @@ -614,20 +614,14 @@ def _normalizeFormatField(self,field,extraDetail=False):
except:
log.debugWarning("language error",exc_info=True)
pass
fontSize=field.get("font-size")
fontSizePt = float(fontSize[0:-2]) if fontSize and fontSize[-2:] == "pt" and float(fontSize[0:-2]) > 0.0 else None
for x in ("first-line-indent","left-indent","right-indent","hanging-indent"):
v=field.get(x)
if not v: continue
v=float(v)
if abs(v)<0.001:
v=None
elif fontSizePt:
# translators: the value in characters for a paragraph indenting
v=_("%g characters") % (v / fontSizePt)
else:
# Translators: the value in points for a paragraph indenting
v=_("%g pt") % v
v=self.obj.getLocalizedMeasurementTextForPointSize(v)
field[x]=v
return field

Expand Down
1 change: 1 addition & 0 deletions user_docs/en/changes.t2t
Expand Up @@ -24,6 +24,7 @@
- NVDA no longer reports extraneous information when switching windows in a Java application with multiple windows such as IntelliJ or Android Studio. (#5732)
- In Scintilla based editors such as Notepad++, braille is now updated correctly when moving the cursor using a braille display. (#5678)
- NVDA no longer sometimes crashes when enabling braille output. (#4457)
- In Microsoft Word, paragraph indentation is now always reported in the measurement unit chosen by the user (e.g. centimeters or inches). (#5804)


== Changes for Developers ==
Expand Down

0 comments on commit f3572be

Please sign in to comment.